@gentleduck/libs
v0.1.16
Published
Tiny, framework-agnostic utility functions for gentleduck/ui.
Maintainers
Readme
@gentleduck/libs
A collection of tiny, framework-agnostic utilities. Each utility lives in its own folder and can be imported individually or all together.
Installation
npm install @gentleduck/libsor with yarn:
yarn add @gentleduck/libsAvailable Utilities
cn- Utility for conditional className merging.filtered-object- Create a new object with only selected keys or values.group-array- Group array items by a given key or function.group-data-by-numbers- Group numbers into ranges or buckets.parse-date- Parse strings or values into valid Date objects.
Usage
import { cn } from '@gentleduck/libs'
function MyComponent({ active }: { active: boolean }) {
return <div className={cn('base', active && 'active')} />
}