Skip to content

Getting Started

Import styles

You can import the entire package and rely on your bundler for tree-shaking:

import { safeConcat, Option, match } from "@wasson-ece/wstd";

Or use subpath imports for more explicit dependency boundaries:

import { safeConcat } from "@wasson-ece/wstd/array";
import { Option, Either } from "@wasson-ece/wstd/logic";
import { variableToWords } from "@wasson-ece/wstd/text";

Available modules

ModuleImport pathDescription
Array@wasson-ece/wstd/arraysafeConcat, safeAppend, split
Filtration@wasson-ece/wstd/filtrationisDefined type guard
Logic@wasson-ece/wstd/logicOption, Either, These, match, T
Text@wasson-ece/wstd/textCase splitting, variableToWords, text processing factories
Object@wasson-ece/wstd/objectmapObj, mapObjKeys
URI@wasson-ece/wstd/uriencodeUri
Math@wasson-ece/wstd/mathSimpleRollingAverage
FP@wasson-ece/wstd/fpCurried versions of all utilities

Functional programming variants

Most functions have curried FP variants available through the /fp subpath:

import { safeConcat } from "@wasson-ece/wstd/fp";
const appendDefaults = safeConcat([1, 2, 3]);
appendDefaults([4, undefined, 5]); // [1, 2, 3, 4, 5]