The helpers every package shares
cn(), filteredObject, groupArray, parseDate, and the other small utilities gentleduck runs on. Each helper has its own subpath.
cn()
Merges class names with clsx and tailwind-merge. When Tailwind utilities conflict, the last one wins.
filteredObject
Picks or omits object keys with a typed result. A typed stand-in for
lodash.pickandomit.groupArray
Groups a list by key or by function and returns a record of matching items per group.
groupDataByNumbers
Buckets numbers into explicit ranges. Useful for histograms, charts, and ad hoc analytics on number arrays.
parseDate
Turns strings, numbers, or
Dateinputs into a realDate. Invalid input returnsnull, so you can return early.Subpath imports
Every helper has its own entry point, like
@gentleduck/libs/cnor/parse-date. No framework dependencies.
Install
Import each helper from its own subpath.
Install
bun add @gentleduck/libsImport a helper
import { cn } from '@gentleduck/libs/cn'
Free & open source
gentleduck is MIT licensed and will always be free and open source. Every package ships with full source access — fork it, modify it, own it.