@epeli/utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Epeli's Javascript / Typescript utilities

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

Exported functions

See __dtslint__ for usage examples

omit(obj: object, keys: string[]): object

Like omit() in Lodash but properly typed for Typescript.

Supports only plain objects.

strictAssign(target: object, ...sources: object[]): object

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.

wait(time: number): Promise

setTimeout for async functions.

withTimeout(message: string, time: number, promise: Promise)

Resolve promise within the time (ms) or reject with the message.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.5-dev.dd820c9600next
1.0.40latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.5-dev.dd820c9600
1.0.40
1.0.5-dev.1569169391613.3b49062b0
1.0.30
1.0.4-dev.1569168921412.5041c7660
1.0.3-dev.1569168802120.39095adc0
1.0.20
1.0.10
1.0.00
0.3.40
0.3.30
0.3.00
0.2.00
0.1.00

Package Sidebar

Install

npm i @epeli/utils

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

11.3 kB

Total Files

23

Last publish

Collaborators

  • esamatti