jsmp-infra-skakun
v1.0.3
Published
This package is for educational purposes
Downloads
5
Maintainers
Readme
SJMP-INFRA-SKAKUN
This package contains two functions for working with strings (changeStringRegister) and arrays (excludeFromArray).
- changeStringRegister has ability to change register of passed string;
- excludeFromArray has ability to exclude set of values from specified array;
INSTALLATION
npm i jsmp-infra-skakun
USAGE
First of all, import necessary function from the package:
const { changeStringRegister } = require('jsmp-infra-skakun');
or
import { changeStringRegister } from 'jsmp-infra-skakun';
Expected arguments:
changeStringRegister(string, mode)
string [type: string] - string that would be modified
mode [type: string] - mode for string transformation. Three modes are available:
- cap - capitalize
- upper - transform to uppercase
- lower - transform to lower case
const { excludeFromArray } = require('jsmp-infra-skakun');
or
import { excludeFromArray } from 'jsmp-infra-skakun';
excludeFromArray(array, values)
array [type: array] - array that would be modified
values [type: array] - array of the values that will be excluded from the original array
EXAMPLES
Then just use imported functions in your code with appropriate arguments:
changeStringRegister('tEST STRING', 'cap') // 'Test string'
excludeFromArray([1, 2, 3, 4, 5], [1, 2, 3]) // [4, 5]