@lgd-utils/validate
A front-end verification tool
Usage
import validate from '@lgd-utils/validate';
import lodashTrim from 'lodash/trim';
validate.validToStringType(1, 'Number'); // true
validate.validToStringType(undefined, 'Null'); // false
validate.validToStringType(void 0, 'Undefined'); // true
validate.validToStringType(function () {}, 'Object'); // false
validate.validEmptyString(1); // false
validate.validEmptyString(' '); // false
validate.validEmptyString(''); // true
validate.validEmptyString(' ', lodashTrim); // true
Contribute
Documentation
Related
- @lgd-utils/array - A front-end array tool
- @lgd-utils/axios - A axios adapter and middleware tool
- @lgd-utils/cached-storage - 一个具有失效功能的缓存存储库
- @lgd-utils/collection - A front-end collection tool
- @lgd-utils/error - A front-end error tool
- @lgd-utils/html - A front-end html tool
- @lgd-utils/number - A front-end number tool
- @lgd-utils/object - A front-end object tool
- @lgd-utils/polling - A front-end polling tool
- @lgd-utils/regexp - A front-end regexp tool
- @lgd-utils/request-queue - A front-end request-queue tool
- @lgd-utils/screenlog - Bring console.log and so on, on the screen
- @lgd-utils/symbol - A front-end symbol tool
- @lgd-utils/utils - A front-end utils tool
- More…