1.1.0 • Published 6 years ago

orxapi.tools.array v1.1.0

Weekly downloads
11
License
ISC
Repository
-
Last release
6 years ago

npm version

orxapi.tools.array

The Array tools library for orxapi.

Getting Started

If you haven't used NodeJs before, be sure to have install the LTS version on your desktop ! Check your version with this command:

node -v
v8.0.0

Installation

npm install orxapi.tools.toscroll --save-dev

This library is written in TypeScript, but you can use JavaScript.

Usage

TypeScript code

import { makeArray, range } from "orxapi.tools.array";

// Create array calendar with 42 days (7 days x 6 weeks)
const days = makeArray(42);

// Create option list with range
const optionList = seq("2..8").map((value: number) => ({ code: `${value}`, val: `${value}` }));

Methods

  • makeArray Make a fill array with number
  • range Deprecated use seq method
  • seq Make a fill array with number between min and max value
  • pad Format a Number, Exactly Two in Length
  • chuck Split an array on multiple array

See docs for more information

This library was designed to work with ES 5+

TODO

  • Add tests
  • Improve the documentation