Socket
Socket
Sign inDemoInstall

@epeli/utils

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @epeli/utils

Some utility functions I use across multiple projects that are not available in any de facto utility libraries like Lodash.


Version published
Weekly downloads
14
Maintainers
1
Install size
12.0 kB
Created
Weekly downloads
 

Readme

Source

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.

FAQs

Last updated on 22 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc