Typedash is a modern, type-safe collection of utility functions designed for TypeScript environments, offering a robust alternative to libraries like Lodash with a strong focus on simplicity, tree-shaking, and precise type inference. It currently stands at version 3.3.3 and maintains a fairly active release cadence with frequent minor and patch updates, as evidenced by recent changelog entries. Key differentiators include its complete type-safety, ensuring type-level transformations for string casing functions and precise key/value types for object utilities. The library boasts zero runtime dependencies, making it highly tree-shakeable and performant. It operates on the principle of "trust the compiler" by leveraging TypeScript's robust type system for correctness rather than relying on extensive runtime checks. Typedash provides over 60 utility functions categorized for Array, Object, String, Type Guards, Function, and Math operations.
npm install typedashVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates `typedash`'s core features including `pick` for object property selection, `objectKeys` for precise key inference, `camelCase` for type-level string transformations, and `compact` for array filtering, all with robust TypeScript support.
Ensure your codebase is strictly typed and compiler errors are addressed. Runtime type checking should be implemented separately if required for untrusted input at boundaries.
Upgrade your Node.js environment to version 20.0.0 or newer using `nvm` or your preferred Node.js version manager.
Upgrade to Typedash version 3.2.3 or newer to resolve CommonJS build and import issues. For older Node.js projects, consider using individual function imports (e.g., `require('typedash/pick')`) if the main entry point causes problems.Ensure you are using `import { functionName } from 'typedash'` for named ESM imports in a compatible environment. If using CommonJS, individual function imports like `const pick = require('typedash/pick')` are often more reliable, as full CJS support for the main entry point may vary by version and build setup.Review your object's type definition and ensure it accurately reflects all possible properties. Use type assertions (`as Type`) sparingly and only when you are absolutely certain of the type. For dynamic property access, consider using type guards or utility functions like `objectKeys` to safely narrow types.
Ensure the array of keys passed to functions like `pick` or `omit` is correctly typed as a `const` assertion (`['a', 'b'] as const`) or explicitly as a union of literal types (e.g., `const keys: Array<'a' | 'b'> = ['a', 'b'];`) so TypeScript can infer the precise subset of keys.
No dependency data recorded yet.