@crazywhite/js-check

0.1.2 • Public • Published

js-check

npm npm bundle size
check some javascript data via vanillaJS

$ npm install @crazywhite/js-check
const { string_t, number_t, boolean_t, object_t, array_t, check } = require("@crazywhite/js-check");

check(string_t(), "this arg should be string"); // => true
check(string_t(), 12.3); // => false
check(string_t("abc"), "abc"); // => true

check(object_t(), { a: 1 }); // => true
check(object_t({ a: number_t() }), { a: 1 }); // => true
check(object_t({ a: number_t() }), { a: 1, b: 2 }); // => true

check(array_t(), ["abc"]); // => true
check(array_t([string_t(), number_t()]), ["abc", 123]); // => true

dev

npm install
npm run build

test

npm run test

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.21latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.21
0.1.10
0.1.00

Package Sidebar

Install

npm i @crazywhite/js-check

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

6.42 kB

Total Files

6

Last publish

Collaborators

  • yieldray