1.1.0 • Published 10 months ago

codec-builder v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

codec-builder

Helps you build type-safe codecs.

Installation

npm install codec-builder

Usage

import { stringifier, parser } from "codec-builder";

type AllowedTypes = number | bigint;

const stringifyNumber = stringifier<AllowedTypes>((value) => value.toString());
const parseNumber = parser<AllowedTypes>((value) => BigInt(value));

const string = stringifyNumber(7777);
const number = parseNumber(string);
1.1.0

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.0.0

10 months ago