Some utility functions I use across multiple projects that are not available in any de facto utility libraries like Lodash.
Very Typescript heavy.
DISCLAIMER:
Not maintaining this for anyone else. This is open source because why not. Might do breaking changes at will - although I try follow semver but I won't be doing changelogs.
So if you find something useful from this I suggest you just copy paste it to your project.
Install
npm install @epeli/utils
See __dtslint__
for usage examples
Like omit() in Lodash but properly typed for Typescript.
Supports only plain objects.
Same as Object.assign() but does not allow extending the type. Eg. the return type is always the same as target.
Works nicely with Immer.
setTimeout
for async functions.
Resolve promise within the time
(ms) or reject with the message.