1.0.4 • Published 5 years ago

@epeli/utils v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

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.

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago