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

8 lines 887 B
import { encodeCredentialType, decodeCredentialType } from "./credentialType.js"; import { encodeVarLenType, decodeVarLenType } from "./codec/variableLength.js"; import { contramapEncoders } from "./codec/tlsEncoder.js"; import { mapDecoders } from "./codec/tlsDecoder.js"; import { decodeUint16, encodeUint16 } from "./codec/number.js"; export const encodeRequiredCapabilities = contramapEncoders([encodeVarLenType(encodeUint16), encodeVarLenType(encodeUint16), encodeVarLenType(encodeCredentialType)], (rc) => [rc.extensionTypes, rc.proposalTypes, rc.credentialTypes]); export const decodeRequiredCapabilities = mapDecoders([decodeVarLenType(decodeUint16), decodeVarLenType(decodeUint16), decodeVarLenType(decodeCredentialType)], (extensionTypes, proposalTypes, credentialTypes) => ({ extensionTypes, proposalTypes, credentialTypes })); //# sourceMappingURL=requiredCapabilities.js.map