1.2.3 • Published 3 years ago

reinforcements v1.2.3

Weekly downloads
32
License
ISC
Repository
github
Last release
3 years ago

Reinforcements

Reinforcements is a node js package written in Typescript to give a massive support for variant data like Strings, Arrays, Objects ... and so on.

Installation

npm i reinforcements

Importing package

You can import package using CommonJS format or using require syntax.

import $_ from 'reinforcements';

OR

const { $_ } = require('reinforcements');

Usage

Almost everything is encapsulated inside $_ variable, so whatever you pass to the function, it will detect the proper type of the given value and returns a corresponding object.

import $_ from 'reinforcements';

let myArray = $_([1, 2, 3]);

myArray.min(); // 1

Available Helpers

Arrays

All of Array methods are integrated inside the package so you'll expect to receive the same result and output for each method plus the new added methods to the Arr class.

Properties

Array length

To get the length of the array at any time, use the length property.

Example

let arrayItems = $_(['Hello', 'World']);

console.log(arrayItems.length); // 2

Iterations

You can also iterate over the object using the for..of syntax.

let arrayItems = $_(['Hello', 'World']);

for (let value of arrayItems) {
    // do something
}

List of methods

Array min

Returns the minimum value of the array items.

Example

import $_ from 'reinforcements';

let myArray = $_([1, 2, 3]);

myArray.min(); // 1 

Tests

Run npm run test to perform test suits on all of the available methods and functions.

Pull Requests

Another purpose of creating this package is for people who wants to develop their experience, you're welcome to make a PR to implement any unimplemented method, but don't forget to write a test file inside the tests directory for each single method separately.

1.2.3

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago