https://github.com/michaelbe812/ts-utils
https://github.com/michaelbe812/ts-utils
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelbe812/ts-utils
- Owner: michaelbe812
- Created: 2020-03-25T21:36:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T08:07:40.000Z (about 2 years ago)
- Last Synced: 2025-03-18T04:59:08.836Z (2 months ago)
- Language: TypeScript
- Size: 629 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/mikelgo/ts-utils)
[](https://www.npmjs.com/package/mikelgo/ts-utils)
[](https://www.npmjs.com/package/mikelgo/ts-utils)
[](https://codecov.io/gh/mikelgo/ts-utils)# Ts-utils
Ts-utils is a small library providing some TypeScript utility functions to deal with objects and arrays.
## Installation
Use npm to install:
```bash
$ npm i @mikelgo/ts-utils
```## Usage
Just import the util-function you want to use by importing it from the lib.
Example:
```typescript
import {isValid} from '@mikelgo/ts-utils/common-utils'if(isValid(somethingToCheck){
// ...execute some code
})
```## Overview
Currently the library does support 12 utility-functions.
### Common utils
- `isValid`
- `isNotValid`
- `isObject`
- `isNotObject`
- `isObjectOrArray`
- `isNotObjectOrArray`
- `noNullValues`
- `notNull`### Array utils
- `isArray`
- `isNotArray`
- `isEmptyArray`
- `isNotEmptyArray`
- `allValuesInArrayAreEqual`
- `allValuesInArrayAreNotEqual`For the full documentation see:
- [Object utils doc](./src/common/README.md)
- [Array utils doc](./src/array/README.md)## Contributing
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.
## License
[MIT](https://choosealicense.com/licenses/mit/)