@jswork/next-get-valid

1.0.2 • Public • Published

next-get-valid

Get valid data by condtion.

version license size download

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.

Package Sidebar

Install

npm i @jswork/next-get-valid

Homepage

js.work

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

5.9 kB

Total Files

6

Last publish

Collaborators

  • afeiship