Chip's standard TypeScript library
Find a file
2025-11-17 15:03:46 -07:00
src Correct export 2025-11-17 15:03:46 -07:00
.gitignore Add docs, add isDefinedFilter 2025-11-17 14:37:09 -07:00
.npmrc Start of cstd 2025-11-14 15:54:31 -07:00
jest.config.js 0.0.5 2025-11-14 16:32:23 -07:00
Makefile Add docs, add isDefinedFilter 2025-11-17 14:37:09 -07:00
package.json v0.0.8 2025-11-17 15:01:27 -07:00
README.md Add docs, add isDefinedFilter 2025-11-17 14:37:09 -07:00
tsconfig.json Start of cstd 2025-11-14 15:54:31 -07:00
typedoc.json Add docs, add isDefinedFilter 2025-11-17 14:37:09 -07:00
yarn.lock Add docs, add isDefinedFilter 2025-11-17 14:37:09 -07:00

@chip/cstd

Chip's standard library.

This is a somewhat eclectic collection of functions, types, etc. that I find useful in different projects that I've pulled into a standard library.

Using @chip/cstd

First, add this registry in your project's .npmrc file:

@chip:registry=https://git.gg/api/packages/chip/npm/

Then just install @chip/cstd as normal, e.g.:

yarn add @chip/cstd

You can import the entire package to rely on your packer to do any code splitting, or you can perform more specific imports yourself:

import { safeConcat } from "@chip/cstd";
import { safePush } from "@chip/cstd/array";

Documentation

You can view the Typedocs for @chip/cstd here.

Functional Implementation

If you'd prefer unary versions of functions import like so. See also ramda's curry though it may be what you're really looking for.

import { safeConcat } from "@chip/cstd/fp";
const concatToOriginal = safeConcat(sourceArray);
const batchOne = concatToOriginal([1, 2, undefined]);
const batchTwo = concatToOriginal(["billy", undefined, "bobertson"]);