Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-get-valid
Get valid data by condtion.
https://github.com/afeiship/next-get-valid
empty get is-empty is-valid next nil nx
Last synced: 18 days ago
JSON representation
Get valid data by condtion.
- Host: GitHub
- URL: https://github.com/afeiship/next-get-valid
- Owner: afeiship
- License: mit
- Created: 2018-09-07T06:34:53.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T02:50:25.000Z (4 months ago)
- Last Synced: 2024-10-12T15:18:49.935Z (about 1 month ago)
- Topics: empty, get, is-empty, is-valid, next, nil, nx
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-get-valid
> Get valid data by condtion.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
yarn add @jswork/next-get-valid
```## usage
```js
import '@jswork/next-get-valid';const data = {
name: 'xiaoming',
age: 18,
email: ''
};const isValidEmail = (value) => {
return value.indexOf('@') > -1;
};const res = nx.getValid(data, 'email', 'example@email', isValidEmail);
// res -> 'example@email'
```## license
Code released under [the MIT license](https://github.com/afeiship/next-get-valid/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-get-valid
[version-url]: https://npmjs.org/package/@jswork/next-get-valid[license-image]: https://img.shields.io/npm/l/@jswork/next-get-valid
[license-url]: https://github.com/afeiship/next-get-valid/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-get-valid
[size-url]: https://github.com/afeiship/next-get-valid/blob/master/dist/next-get-valid.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-get-valid
[download-url]: https://www.npmjs.com/package/@jswork/next-get-valid