Miscellaneous
A modern collection of utility functions for all occasions, all written in TypeScript and type-safe.
Similar to lodash but with a focus on simplicity and type-safety (no excessive checks are made, trust the compiler), tree-shaking, and leveraging the platform whenever possible.
npm install typedash
# or using yarn
yarn add typedash
typedash provides utility functions that can be imported and used in your TypeScript projects. Here’s an example of how to import and use the pick
function:
import { objectKeys } from 'typedash';
import { pick } from 'typedash/pick'; // either syntax works
const obj = {
a: 1,
b: 2,
c: 3,
};
const result = objectKeys(obj); // ["a", "b", "c"]
// ^? ("a" | "b" | "c")[]
const result2 = pick(obj, ['a', 'b']); // { a: 1, b: 2 }
// ^? { a: number, b: number }
typedash is MIT licensed.