@hahanova/jsmp-infrastucture-hahan

3.0.3 • Public • Published

@hahanova/jsmp-infrastucture-hahan

The lib can mostly everithing!

processArray

processArray(array, operationType, [number]) array - array of numbers operationType - type of math operations: sum, sub, mul, div, sqr number(optional) - number, which will be used for math calculation with each array number

processString

processString(string, processType) string - string processType - type of process that will be executed: removeSpaces, reverse, camelCase, emoji (replace all 'a' and 'o' with cock emoji)

Install

$ npm i hahanova/jsmp-infrastucture-hahan

Usage

const hahan = require('@hahanova/jsmp-infrastucture-hahan');

hahan.processArray([1, 2, 3], 'sum', 2);
//=> [3, 4, 5]

hahan.processArray([1, 2, 3], 'sub', 1);
//=> [0, 1, 2]

hahan.processArray([1, 2, 3], 'mul', 2);
//=> [2, 4, 6]

hahan.processArray([1, 2, 3], 'div', 2);
//=> [0.5, 1, 1.5]

hahan.processArray([1, 2, 3], 'sqr');
//=> [1, 4, 9]

hahan.processString('  H  el lo', 'removeSpaces');
//=> "Hello"

hahan.processString('hello world', 'camelCase');
//=> "helloWorld"

hahan.processString('Hello', 'reverse');
//=> "olleH"

hahan.processString('Hello', 'emoji');
//=> "Hell🐓"

Package Sidebar

Install

npm i @hahanova/jsmp-infrastucture-hahan

Weekly Downloads

0

Version

3.0.3

License

MIT

Unpacked Size

5.3 kB

Total Files

7

Last publish

Collaborators

  • hahanova