@web-ts-toolkit/utils
v0.6.1
Published
Shared collection, object, async, and URL helpers used across workspace packages
Downloads
702
Maintainers
Readme
@web-ts-toolkit/utils
Shared collection, object, async, and URL helpers used across the workspace.
Installation
pnpm add @web-ts-toolkit/utilsHighlights
- object-path helpers such as
get(...)andset(...) - collection helpers such as
map(...),filter(...),uniq(...), andorderBy(...) - small type guards
- URL helpers such as
normalizeUrlPath(...) - async helpers such as
mapValuesAsync(...)
Quick Start
import { get, set, normalizeUrlPath, parseBooleanString } from '@web-ts-toolkit/utils';
const payload = {
user: {
profile: {
name: 'Ada',
},
},
};
get(payload, 'user.profile.name');
set(payload, 'user.profile.role', 'admin');
normalizeUrlPath('api//users');
parseBooleanString('true', false);Main Exports
- object helpers:
get,set,pick,omit,assign,cloneDeep - collection helpers:
map,filter,reduce,find,flatten,uniq,orderBy - guards:
isArray,isPlainObject,isString,isPromise - URL helpers:
addLeadingSlash,removeConsecutiveSlashesFromUrl,normalizeUrlPath
Documentation
Full package documentation lives in website/docs/packages/utils.md.
- live docs: https://web-ts-toolkit.pages.dev/docs/packages/utils
