@jswork/next-get-valid
v1.0.2
Published
Get valid data by condtion.
Downloads
9
Maintainers
Readme
next-get-valid
Get valid data by condtion.
installation
yarn add @jswork/next-get-valid
usage
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.