@rdub/base
v0.7.2
Published
JS/TS utils; helper functions I've missed from standard libraries (and React)
Downloads
377
Readme
@rdub/base
JS/TS utils; helper functions I've missed from standard libraries (and React)
- a.tsx - Anchor component wrapper (sets
target="_blank"
andrel="noreferrer"
for external URLs). - arr.ts - Array utils:
Arr
,concat
,range
- color-scheme.tsx -
useColorScheme
React hook for managing light/dark mode - console.ts - import-able
time
,timeEnd
,log
,warn
,error
- heading.tsx:
<H1>
…<H6>
components: headings with configurable link-target offsets - json/load.ts, json/fetch.ts:
fetchJson
,loadJson{,Sync}
- math.ts - exports most of
Math
, also implements aclamp
helper - objs.ts - typed helpers for mapping between objects and arrays, over keys/values/entries
- singleton.ts - dedupe arrays, verify exactly one unique element, return it
- state.ts -
State<T, "name">
helper ({ name: T, setName: (t: T) => void }
) - str.ts -
titlecase
helper - time.ts -
time
,timeEnd
,Timer
- use-set.ts -
useSet
,useOptSet
hooks for React