@peculiar/fortify-client-core
Version:
Fortify client core API for quickly connect to Fortify App
29 lines (28 loc) • 920 B
JavaScript
;
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the BSD 3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsnData = void 0;
const asn1_schema_1 = require("@peculiar/asn1-schema");
const pvtsutils_1 = require("pvtsutils");
class AsnData {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(...args) {
if (args.length === 1) {
// asn
this.asn = args[0];
this.rawData = asn1_schema_1.AsnConvert.serialize(this.asn);
}
else {
// raw, type
this.asn = asn1_schema_1.AsnConvert.parse(args[0], args[1]);
this.rawData = pvtsutils_1.BufferSourceConverter.toArrayBuffer(args[0]);
}
}
}
exports.AsnData = AsnData;