@preflower/utils
General purpose TypeScript utilities for daily development.
Installation
bash
pnpm add @preflower/utilsUtilities Index
Array
- getArrayFirst: Safety access to the first element of a variable.
Date
- format: Lightweight date formatting without dependencies.
Device
- isIOS: Detect if the device is iOS.
Function
- idempotent: Ensure a function only executes once.
Object
- defineMap: Transform lists into typed maps or extracted arrays.
- toRawType: Get the underlying JS type string.
- pick: Create a new object with selected properties.
Screen
- returnIsRotationFunction: Detect screen rotation events.
Storage
- storage: Typed wrappers for
localStorageandsessionStorage.