Skip to content

afeiship/next-get-valid

Repository files navigation

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.