bp-ts-utils
v2.4.2
Published
TypeScript Utility library
Downloads
11
Maintainers
Readme
ts-utils
A library of utilities to be used with TypeScript. The already established utility libraries out there for both TypeScript and JavaScript have inspired me to write my own. This is for fun and to learn. Anyone is welcome to try it out.
Installation
Using npm:
$ npm install --save bp-ts-utils
Library
Array Global Augmentation
first(): T
isEmpty(): boolean
isIdenticalTo(array: T[]): boolean
last(): T
longerThan(array: T[]): boolean
shorterThan(array: T[]): boolean
clone(array: unknown[]): unknown[]
cloneWithValidation(array: unknown[]): unknown[]
Boolean Global Augmentation
not(): boolean
Clone
clone(argument: unknown | unknown[]): unknown | unknown[]
cloneWithValidation(argument: unknown | unknown[]): unknown | unknown[]
Object
areIdentical<T>(first: T, second: T): boolean
isUndefined(argument: unknown): boolean
isNull(argument: unknown): boolean
isNullOrUndefined(argument: unknown): boolean
isANumber(argument: unknown): boolean
areIdenticalArrays(first: T[], second: T[]): boolean
Releasing to NPM Registry
npm run build
npm version <semantic-version>
npm publish
- View release on registry
Commands
- lint:
npm run lint
- test:
npm test
- build:
npm run build
Links
- https://github.com/benj-power/ts-utils
- https://www.npmjs.com/package/bp-ts-utils
- Technical Notes