UNPKG

ts-mls

Version:

[![CI](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml/badge.svg)](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/ts-mls.svg)](https://badge.fury.io/js/ts-mls) [![Coverage Status](https://co

12 lines 523 B
import { decodeUint8, encodeUint8 } from "./codec/number"; import { mapDecoderOption } from "./codec/tlsDecoder"; import { contramapEncoder } from "./codec/tlsEncoder"; import { enumNumberToKey } from "./util/enumHelpers"; const contentTypes = { application: 1, proposal: 2, commit: 3, }; export const encodeContentType = contramapEncoder(encodeUint8, (t) => contentTypes[t]); export const decodeContentType = mapDecoderOption(decodeUint8, enumNumberToKey(contentTypes)); //# sourceMappingURL=contentType.js.map