Ts-utils is a small library providing some TypeScript utility functions to deal with objects and arrays.
Use npm to install:
$ npm i @mikelgo/ts-utils
Just import the util-function you want to use by importing it from the lib.
Example:
import {isValid} from '@mikelgo/ts-utils/common-utils'
if(isValid(somethingToCheck){
// ...execute some code
})
Currently the library does support 12 utility-functions.
isValid
isNotValid
isObject
isNotObject
isObjectOrArray
isNotObjectOrArray
noNullValues
notNull
isArray
isNotArray
isEmptyArray
isNotEmptyArray
allValuesInArrayAreEqual
allValuesInArrayAreNotEqual
For the full documentation see:
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.