@wildboar/acse
Version:
Association Control Service Element PDUs in TypeScript
31 lines (30 loc) • 1.16 kB
JavaScript
import * as $ from '@wildboar/asn1/functional';
import { _decode_ASOI_tag_Item, _encode_ASOI_tag_Item, } from '../ACSE-1/ASOI-tag-Item.ta.mjs';
let _cached_decoder_for_ASOI_tag = null;
/**
* @summary Decodes an ASN.1 element into a(n) ASOI_tag
* @function
* @param {_Element} el The element being decoded.
* @returns {ASOI_tag} The decoded data structure.
*/
export function _decode_ASOI_tag(el) {
if (!_cached_decoder_for_ASOI_tag) {
_cached_decoder_for_ASOI_tag = $._decodeSequenceOf(() => _decode_ASOI_tag_Item);
}
return _cached_decoder_for_ASOI_tag(el);
}
let _cached_encoder_for_ASOI_tag = null;
/**
* @summary Encodes a(n) ASOI_tag into an ASN.1 Element.
* @function
* @param value The element being encoded.
* @param elGetter A function that can be used to get new ASN.1 elements.
* @returns {_Element} The ASOI_tag, encoded as an ASN.1 Element.
*/
export function _encode_ASOI_tag(value, elGetter) {
if (!_cached_encoder_for_ASOI_tag) {
_cached_encoder_for_ASOI_tag = $._encodeSequenceOf(() => _encode_ASOI_tag_Item, $.BER);
}
return _cached_encoder_for_ASOI_tag(value, elGetter);
}
/* eslint-enable */