![Release](https://github.com/alanscodelog/my-utils/workflows/Release/badge.svg)
Install
npm install @alanscodelog/utils
yarn add @alanscodelog/utils
Usage
There's four types of utility functions available:
utils
- the main utility functionstesting
- functions that are only useful for testing purposesretypes
- existing functions typed as something else (e.g. Object.keys cast to a type that's useful for iterating, etc)types
- all the types used internally + any utility types
import { keys, debounce, ... } from "@alanscodelog/utils"
You can also import an entire set, although this is not reccomended because it makes it so the imports can't be treeshaking. Still it's possible because it's ocassionally useful for prototyping.
import {utils, testing, retypes, types} from "@alanscodelog/utils"
Usually though, for better clarity, I import directly from the folders in the dist
folder. The path becomes kind of long though so I set an alias to it (@utils
) in my babel/typescript configs.
import { keys } from "@alanscodelog/utils/dist/retypes"
import { keys } from "@utils/retypes"