https://github.com/michaelbe812/ts-guava
https://github.com/michaelbe812/ts-guava
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelbe812/ts-guava
- Owner: michaelbe812
- Created: 2020-04-24T08:23:07.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T10:45:33.000Z (over 1 year ago)
- Last Synced: 2025-03-20T05:35:39.021Z (2 months ago)
- Language: TypeScript
- Size: 323 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
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-guava)
[](https://www.npmjs.com/package/mikelgo/ts-guava)
[](https://codecov.io/gh/mikelgo/ts-guava)# Ts-guava
Ts-guava is a small library providing some TypeScript utility functions to deal with objects and arrays. The libraries aim is
to provide the Google Guava utilities to the TypeScript world.## Installation
Use npm to install:
```bash
$ npm i @mikelgo/ts-guava
```## Usage
Just import the util-function you want to use by importing it from the lib.
Example:
```typescript
import {isValid} from '@mikelgo/ts-guava/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`
- `assignValid`### 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/)