@zakodium/utils
v0.5.1
Published
Small utilities by zakodium for zakodium
Readme
@zakodium/utils
Small utilities by zakodium for zakodium.
Installation
npm install @zakodium/utilsUsage
import { assertNotNullish } from '@zakodium/utils';
const value: object | string | number | boolean | null | undefined = JSON.parse(someJsonString);
assertNotNullish(value); // throws if value is null or undefined
value;
// value type is object | string | number | booleanList of utilities
Features that could be added later
- Iterable helpers like
map,filterand so on. Could be useful when IteratorHelpers is not available. Or add some more niche helpers likechunkify. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator - functional helpers like
pipeand so on. Could be useful until the pipe operator is not available. https://github.com/tc39/proposal-pipeline-operator
TypeScript types
Total TypeScript from Matt Pocock is a great inspiration for type utilities exported by this package.
