@bitty/falsy
Advanced tools
Comparing version 0.1.2 to 0.2.0
{ | ||
"name": "@bitty/falsy", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Falsy helper functions and types for TypeScript.", | ||
@@ -62,7 +62,7 @@ "sideEffects": false, | ||
"devDependencies": { | ||
"ava": "^3.15.0", | ||
"prettier": "^2.4.1", | ||
"rollup": "^2.60.0", | ||
"ava": "^4.0.1", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.63.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.5.2" | ||
"typescript": "^4.5.4" | ||
}, | ||
@@ -77,3 +77,4 @@ "scripts": { | ||
"build:bundle": "rollup --config rollup.config.js" | ||
} | ||
}, | ||
"readme": "# `@bitty/falsy`\n\n[![Bundle minified size](https://badgen.net/bundlephobia/min/@bitty/falsy)](https://bundlephobia.com/result?p=@bitty/falsy)\n[![Bundle minified and gzipped size](https://badgen.net/bundlephobia/minzip/@bitty/falsy)](https://bundlephobia.com/result?p=@bitty/falsy)\n\nFalsy helper functions and types for TypeScript.\n\n- 📦 Distributions in ESM, CommonJS, UMD and UMD _minified_ formats.\n\n- ⚡ Lightweight:\n - Weighs less than 0.2KB (min + gzip).\n - Tree-shakeable.\n - Side-effects free.\n\n- 🔋 Bateries included:\n - No dependencies.\n - Its not based on newer browser's APIs or es2015+ features.\n\n- 🏷 Safe:\n - JSDocs and type declarations for IDEs and editor's autocomplete/intellisense.\n - Made with TypeScript as strict as possible.\n - Unit tests with AVA.\n\n## Installation\n\nThis library is published in the NPM registry and can be installed using any compatible package manager.\n\n```sh\nnpm install @bitty/falsy --save\n\n# For Yarn, use the command below.\nyarn add @bitty/falsy\n```\n\n### Installation from CDN\n\nThis module has a UMD bundle available through JSDelivr and Unpkg CDNs.\n\n```html\n<!-- For UNPKG use the code below. -->\n<script src=\"https://unpkg.com/@bitty/falsy\"></script>\n\n<!-- For JSDelivr use the code below. -->\n<script src=\"https://cdn.jsdelivr.net/npm/@bitty/falsy\"></script>\n\n<script>\n // UMD module is exposed through the \"isFalsy\" global function.\n console.log(isFalsy);\n //=> \"[Function: isFalsy]\"\n\n console.log(isFalsy(null));\n //=> true\n</script>\n```\n\n## Getting Stated\n\nThis module default exports `isFalsy`, which is a predicate function that checks if value is _falsy_.\n\n```ts\nimport isFalsy from '@bitty/pipe';\n\nisFalsy();\nisFalsy(null);\nisFalsy(undefined);\nisFalsy(0);\nisFalsy(-0);\nisFalsy(0n);\nisFalsy(NaN);\nisFalsy('');\nisFalsy(false);\n//=> true\n\nisFalsy('Not empty.');\n//=> false\n```\n\nWe also exports `NonFalsy` and `Falsy` types.\n\n- `Falsy` is simply an union of `false`, `void`, `''`, `0`, `0n`, `null` and `undefined`, types.\n\n ```ts\n import { Falsy } from '@bitty/falsy';\n\n let falsy: Falsy;\n falsy = false;\n falsy = undefined as void;\n falsy = '';\n falsy = 0;\n falsy = 0n;\n falsy = null;\n falsy = undefined;\n\n falsy = 1;\n //=> throws \"Type '1' is not assignable to type 'Falsy'.\".\n ```\n\n- `NonFalsy<T>` is a type helper that removes _falsy_ types.\n\n ```ts\n import { NonFalsy } from '@bitty/falsy';\n\n type Value = 0 | 1 | 2;\n\n const value: NonFalsy<Value> = 0;\n //=> throws \"Type '0' is not assignable to type '1 | 2'.\".\n ```\n\n## License\n\nReleased under [MIT License](./LICENSE).\n" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16028