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
| Module | Import path | Description |
|---|---|---|
| Array | @wasson-ece/wstd/array | safeConcat, safeAppend, split |
| Filtration | @wasson-ece/wstd/filtration | isDefined type guard |
| Logic | @wasson-ece/wstd/logic | Option, Either, These, match, T |
| Text | @wasson-ece/wstd/text | Case splitting, variableToWords, text processing factories |
| Object | @wasson-ece/wstd/object | mapObj, mapObjKeys |
| URI | @wasson-ece/wstd/uri | encodeUri |
| Math | @wasson-ece/wstd/math | SimpleRollingAverage |
| FP | @wasson-ece/wstd/fp | Curried 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]