feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
21
api.hyungi.net/node_modules/@peculiar/asn1-schema/LICENSE
generated
vendored
Normal file
21
api.hyungi.net/node_modules/@peculiar/asn1-schema/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
106
api.hyungi.net/node_modules/@peculiar/asn1-schema/README.md
generated
vendored
Normal file
106
api.hyungi.net/node_modules/@peculiar/asn1-schema/README.md
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
# `@peculiar/asn1-schema`
|
||||
|
||||
[](https://raw.githubusercontent.com/PeculiarVentures/asn1-schema/master/packages/schema/LICENSE.md)
|
||||
[](https://badge.fury.io/js/%40peculiar%2Fasn1-schema)
|
||||
|
||||
[](https://nodei.co/npm/@peculiar/asn1-schema/)
|
||||
|
||||
This package uses ES2015 [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) to simplify working with ASN.1 creation and parsing.
|
||||
|
||||
|
||||
## Introduction
|
||||
|
||||
Abstract Syntax Notation One (ASN.1) is a standard interface description language for defining data structures that can be serialized and deserialized in a cross-platform way. Working with ASN.1 can be complicated as there are many ways to represent the same data and many solutions handcraft, incorrectly, the ASN.1 representation of the data.
|
||||
|
||||
`asn1-schema` addresses this by using decorators to make both serialization and parsing of ASN.1 possible via a simple class that handles these problems for you.
|
||||
|
||||
This is important because validating input data before its use is important to do because all input data is evil.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Installation is handled via `npm`:
|
||||
|
||||
```
|
||||
$ npm install @peculiar/asn1-schema
|
||||
```
|
||||
|
||||
## TypeScript examples
|
||||
Node.js:
|
||||
|
||||
ASN.1 schema
|
||||
```
|
||||
Extension ::= SEQUENCE {
|
||||
extnID OBJECT IDENTIFIER,
|
||||
critical BOOLEAN DEFAULT FALSE,
|
||||
extnValue OCTET STRING
|
||||
-- contains the DER encoding of an ASN.1 value
|
||||
-- corresponding to the extension type identified
|
||||
-- by extnID
|
||||
}
|
||||
|
||||
id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 }
|
||||
|
||||
BasicConstraints ::= SEQUENCE {
|
||||
cA BOOLEAN DEFAULT FALSE,
|
||||
pathLenConstraint INTEGER (0..MAX) OPTIONAL
|
||||
}
|
||||
```
|
||||
|
||||
ASN.1 schema declaration in TypeScript project
|
||||
```ts
|
||||
import { Asn1Prop, Asn1PropTypes, Asn1Serializer } from "@peculiar/asn1-schema";
|
||||
|
||||
class Extension {
|
||||
|
||||
public static CRITICAL = false;
|
||||
|
||||
@AsnProp({ type: Asn1PropTypes.ObjectIdentifier })
|
||||
public extnID: string = "";
|
||||
|
||||
@AsnProp({
|
||||
type: Asn1PropTypes.Boolean,
|
||||
defaultValue: Extension.CRITICAL,
|
||||
})
|
||||
public critical = Extension.CRITICAL;
|
||||
|
||||
@AsnProp({ type: Asn1PropTypes.OctetString })
|
||||
public extnValue: ArrayBuffer = new ArrayBuffer(0);
|
||||
|
||||
}
|
||||
|
||||
class BasicConstraints {
|
||||
@AsnProp({ type: Asn1PropTypes.Boolean, defaultValue: false })
|
||||
public ca = false;
|
||||
|
||||
@AsnProp({ type: Asn1PropTypes.Integer, optional: true })
|
||||
public pathLenConstraint?: number;
|
||||
}
|
||||
```
|
||||
|
||||
Encoding ASN.1 data
|
||||
```ts
|
||||
const basicConstraints = new BasicConstraints();
|
||||
basicConstraints.ca = true;
|
||||
basicConstraints.pathLenConstraint = 1;
|
||||
|
||||
const extension = new Extension();
|
||||
extension.critical = true;
|
||||
extension.extnID = "2.5.29.19";
|
||||
extension.extnValue = AsnSerializer.serialize(basicConstraints);
|
||||
|
||||
console.log(Buffer.from(AsnSerializer.serialize(extension)).toString("hex")); // 30120603551d130101ff040830060101ff020101
|
||||
```
|
||||
|
||||
[ASN.1 encoded data](http://lapo.it/asn1js/#MBIGA1UdEwEB_wQIMAYBAf8CAQE)
|
||||
|
||||
Decoding ASN.1 data
|
||||
```ts
|
||||
const extension = AsnParser.parse(Buffer.from("30120603551d130101ff040830060101ff020101", "hex"), Extension);
|
||||
console.log("Extension ID:", extension.extnID); // Extension ID: 2.5.29.19
|
||||
console.log("Critical:", extension.critical); // Critical: true
|
||||
|
||||
const basicConstraints = AsnParser.parse(extension.extnValue, BasicConstraints);
|
||||
console.log("CA:", basicConstraints.ca); // CA: true
|
||||
console.log("Path length:", basicConstraints.pathLenConstraint); // Path length: 1
|
||||
```
|
||||
26
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/convert.js
generated
vendored
Normal file
26
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/convert.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnConvert = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const pvtsutils_1 = require("pvtsutils");
|
||||
const parser_1 = require("./parser");
|
||||
const serializer_1 = require("./serializer");
|
||||
class AsnConvert {
|
||||
static serialize(obj) {
|
||||
return serializer_1.AsnSerializer.serialize(obj);
|
||||
}
|
||||
static parse(data, target) {
|
||||
return parser_1.AsnParser.parse(data, target);
|
||||
}
|
||||
static toString(data) {
|
||||
const buf = pvtsutils_1.BufferSourceConverter.isBufferSource(data)
|
||||
? pvtsutils_1.BufferSourceConverter.toArrayBuffer(data)
|
||||
: AsnConvert.serialize(data);
|
||||
const asn = asn1js.fromBER(buf);
|
||||
if (asn.offset === -1) {
|
||||
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
||||
}
|
||||
return asn.result.toString();
|
||||
}
|
||||
}
|
||||
exports.AsnConvert = AsnConvert;
|
||||
140
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/converters.js
generated
vendored
Normal file
140
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/converters.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnNullConverter = exports.AsnGeneralizedTimeConverter = exports.AsnUTCTimeConverter = exports.AsnCharacterStringConverter = exports.AsnGeneralStringConverter = exports.AsnVisibleStringConverter = exports.AsnGraphicStringConverter = exports.AsnIA5StringConverter = exports.AsnVideotexStringConverter = exports.AsnTeletexStringConverter = exports.AsnPrintableStringConverter = exports.AsnNumericStringConverter = exports.AsnUniversalStringConverter = exports.AsnBmpStringConverter = exports.AsnUtf8StringConverter = exports.AsnConstructedOctetStringConverter = exports.AsnOctetStringConverter = exports.AsnBooleanConverter = exports.AsnObjectIdentifierConverter = exports.AsnBitStringConverter = exports.AsnIntegerBigIntConverter = exports.AsnIntegerArrayBufferConverter = exports.AsnEnumeratedConverter = exports.AsnIntegerConverter = exports.AsnAnyConverter = void 0;
|
||||
exports.defaultConverter = defaultConverter;
|
||||
const asn1js = require("asn1js");
|
||||
const enums_1 = require("./enums");
|
||||
const index_1 = require("./types/index");
|
||||
exports.AsnAnyConverter = {
|
||||
fromASN: (value) => value instanceof asn1js.Null ? null : value.valueBeforeDecodeView,
|
||||
toASN: (value) => {
|
||||
if (value === null) {
|
||||
return new asn1js.Null();
|
||||
}
|
||||
const schema = asn1js.fromBER(value);
|
||||
if (schema.result.error) {
|
||||
throw new Error(schema.result.error);
|
||||
}
|
||||
return schema.result;
|
||||
},
|
||||
};
|
||||
exports.AsnIntegerConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4
|
||||
? value.valueBlock.toString()
|
||||
: value.valueBlock.valueDec,
|
||||
toASN: (value) => new asn1js.Integer({ value: +value }),
|
||||
};
|
||||
exports.AsnEnumeratedConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueDec,
|
||||
toASN: (value) => new asn1js.Enumerated({ value }),
|
||||
};
|
||||
exports.AsnIntegerArrayBufferConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.Integer({ valueHex: value }),
|
||||
};
|
||||
exports.AsnIntegerBigIntConverter = {
|
||||
fromASN: (value) => value.toBigInt(),
|
||||
toASN: (value) => asn1js.Integer.fromBigInt(value),
|
||||
};
|
||||
exports.AsnBitStringConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.BitString({ valueHex: value }),
|
||||
};
|
||||
exports.AsnObjectIdentifierConverter = {
|
||||
fromASN: (value) => value.valueBlock.toString(),
|
||||
toASN: (value) => new asn1js.ObjectIdentifier({ value }),
|
||||
};
|
||||
exports.AsnBooleanConverter = {
|
||||
fromASN: (value) => value.valueBlock.value,
|
||||
toASN: (value) => new asn1js.Boolean({ value }),
|
||||
};
|
||||
exports.AsnOctetStringConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.OctetString({ valueHex: value }),
|
||||
};
|
||||
exports.AsnConstructedOctetStringConverter = {
|
||||
fromASN: (value) => new index_1.OctetString(value.getValue()),
|
||||
toASN: (value) => value.toASN(),
|
||||
};
|
||||
function createStringConverter(Asn1Type) {
|
||||
return {
|
||||
fromASN: (value) => value.valueBlock.value,
|
||||
toASN: (value) => new Asn1Type({ value }),
|
||||
};
|
||||
}
|
||||
exports.AsnUtf8StringConverter = createStringConverter(asn1js.Utf8String);
|
||||
exports.AsnBmpStringConverter = createStringConverter(asn1js.BmpString);
|
||||
exports.AsnUniversalStringConverter = createStringConverter(asn1js.UniversalString);
|
||||
exports.AsnNumericStringConverter = createStringConverter(asn1js.NumericString);
|
||||
exports.AsnPrintableStringConverter = createStringConverter(asn1js.PrintableString);
|
||||
exports.AsnTeletexStringConverter = createStringConverter(asn1js.TeletexString);
|
||||
exports.AsnVideotexStringConverter = createStringConverter(asn1js.VideotexString);
|
||||
exports.AsnIA5StringConverter = createStringConverter(asn1js.IA5String);
|
||||
exports.AsnGraphicStringConverter = createStringConverter(asn1js.GraphicString);
|
||||
exports.AsnVisibleStringConverter = createStringConverter(asn1js.VisibleString);
|
||||
exports.AsnGeneralStringConverter = createStringConverter(asn1js.GeneralString);
|
||||
exports.AsnCharacterStringConverter = createStringConverter(asn1js.CharacterString);
|
||||
exports.AsnUTCTimeConverter = {
|
||||
fromASN: (value) => value.toDate(),
|
||||
toASN: (value) => new asn1js.UTCTime({ valueDate: value }),
|
||||
};
|
||||
exports.AsnGeneralizedTimeConverter = {
|
||||
fromASN: (value) => value.toDate(),
|
||||
toASN: (value) => new asn1js.GeneralizedTime({ valueDate: value }),
|
||||
};
|
||||
exports.AsnNullConverter = {
|
||||
fromASN: () => null,
|
||||
toASN: () => {
|
||||
return new asn1js.Null();
|
||||
},
|
||||
};
|
||||
function defaultConverter(type) {
|
||||
switch (type) {
|
||||
case enums_1.AsnPropTypes.Any:
|
||||
return exports.AsnAnyConverter;
|
||||
case enums_1.AsnPropTypes.BitString:
|
||||
return exports.AsnBitStringConverter;
|
||||
case enums_1.AsnPropTypes.BmpString:
|
||||
return exports.AsnBmpStringConverter;
|
||||
case enums_1.AsnPropTypes.Boolean:
|
||||
return exports.AsnBooleanConverter;
|
||||
case enums_1.AsnPropTypes.CharacterString:
|
||||
return exports.AsnCharacterStringConverter;
|
||||
case enums_1.AsnPropTypes.Enumerated:
|
||||
return exports.AsnEnumeratedConverter;
|
||||
case enums_1.AsnPropTypes.GeneralString:
|
||||
return exports.AsnGeneralStringConverter;
|
||||
case enums_1.AsnPropTypes.GeneralizedTime:
|
||||
return exports.AsnGeneralizedTimeConverter;
|
||||
case enums_1.AsnPropTypes.GraphicString:
|
||||
return exports.AsnGraphicStringConverter;
|
||||
case enums_1.AsnPropTypes.IA5String:
|
||||
return exports.AsnIA5StringConverter;
|
||||
case enums_1.AsnPropTypes.Integer:
|
||||
return exports.AsnIntegerConverter;
|
||||
case enums_1.AsnPropTypes.Null:
|
||||
return exports.AsnNullConverter;
|
||||
case enums_1.AsnPropTypes.NumericString:
|
||||
return exports.AsnNumericStringConverter;
|
||||
case enums_1.AsnPropTypes.ObjectIdentifier:
|
||||
return exports.AsnObjectIdentifierConverter;
|
||||
case enums_1.AsnPropTypes.OctetString:
|
||||
return exports.AsnOctetStringConverter;
|
||||
case enums_1.AsnPropTypes.PrintableString:
|
||||
return exports.AsnPrintableStringConverter;
|
||||
case enums_1.AsnPropTypes.TeletexString:
|
||||
return exports.AsnTeletexStringConverter;
|
||||
case enums_1.AsnPropTypes.UTCTime:
|
||||
return exports.AsnUTCTimeConverter;
|
||||
case enums_1.AsnPropTypes.UniversalString:
|
||||
return exports.AsnUniversalStringConverter;
|
||||
case enums_1.AsnPropTypes.Utf8String:
|
||||
return exports.AsnUtf8StringConverter;
|
||||
case enums_1.AsnPropTypes.VideotexString:
|
||||
return exports.AsnVideotexStringConverter;
|
||||
case enums_1.AsnPropTypes.VisibleString:
|
||||
return exports.AsnVisibleStringConverter;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
44
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/decorators.js
generated
vendored
Normal file
44
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/decorators.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnProp = exports.AsnSequenceType = exports.AsnSetType = exports.AsnChoiceType = exports.AsnType = void 0;
|
||||
const converters = require("./converters");
|
||||
const enums_1 = require("./enums");
|
||||
const storage_1 = require("./storage");
|
||||
const AsnType = (options) => (target) => {
|
||||
let schema;
|
||||
if (!storage_1.schemaStorage.has(target)) {
|
||||
schema = storage_1.schemaStorage.createDefault(target);
|
||||
storage_1.schemaStorage.set(target, schema);
|
||||
}
|
||||
else {
|
||||
schema = storage_1.schemaStorage.get(target);
|
||||
}
|
||||
Object.assign(schema, options);
|
||||
};
|
||||
exports.AsnType = AsnType;
|
||||
const AsnChoiceType = () => (0, exports.AsnType)({ type: enums_1.AsnTypeTypes.Choice });
|
||||
exports.AsnChoiceType = AsnChoiceType;
|
||||
const AsnSetType = (options) => (0, exports.AsnType)({ type: enums_1.AsnTypeTypes.Set, ...options });
|
||||
exports.AsnSetType = AsnSetType;
|
||||
const AsnSequenceType = (options) => (0, exports.AsnType)({ type: enums_1.AsnTypeTypes.Sequence, ...options });
|
||||
exports.AsnSequenceType = AsnSequenceType;
|
||||
const AsnProp = (options) => (target, propertyKey) => {
|
||||
let schema;
|
||||
if (!storage_1.schemaStorage.has(target.constructor)) {
|
||||
schema = storage_1.schemaStorage.createDefault(target.constructor);
|
||||
storage_1.schemaStorage.set(target.constructor, schema);
|
||||
}
|
||||
else {
|
||||
schema = storage_1.schemaStorage.get(target.constructor);
|
||||
}
|
||||
const copyOptions = Object.assign({}, options);
|
||||
if (typeof copyOptions.type === "number" && !copyOptions.converter) {
|
||||
const defaultConverter = converters.defaultConverter(options.type);
|
||||
if (!defaultConverter) {
|
||||
throw new Error(`Cannot get default converter for property '${propertyKey}' of ${target.constructor.name}`);
|
||||
}
|
||||
copyOptions.converter = defaultConverter;
|
||||
}
|
||||
schema.items[propertyKey] = copyOptions;
|
||||
};
|
||||
exports.AsnProp = AsnProp;
|
||||
39
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/enums.js
generated
vendored
Normal file
39
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/enums.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnPropTypes = exports.AsnTypeTypes = void 0;
|
||||
var AsnTypeTypes;
|
||||
(function (AsnTypeTypes) {
|
||||
AsnTypeTypes[AsnTypeTypes["Sequence"] = 0] = "Sequence";
|
||||
AsnTypeTypes[AsnTypeTypes["Set"] = 1] = "Set";
|
||||
AsnTypeTypes[AsnTypeTypes["Choice"] = 2] = "Choice";
|
||||
})(AsnTypeTypes || (exports.AsnTypeTypes = AsnTypeTypes = {}));
|
||||
var AsnPropTypes;
|
||||
(function (AsnPropTypes) {
|
||||
AsnPropTypes[AsnPropTypes["Any"] = 1] = "Any";
|
||||
AsnPropTypes[AsnPropTypes["Boolean"] = 2] = "Boolean";
|
||||
AsnPropTypes[AsnPropTypes["OctetString"] = 3] = "OctetString";
|
||||
AsnPropTypes[AsnPropTypes["BitString"] = 4] = "BitString";
|
||||
AsnPropTypes[AsnPropTypes["Integer"] = 5] = "Integer";
|
||||
AsnPropTypes[AsnPropTypes["Enumerated"] = 6] = "Enumerated";
|
||||
AsnPropTypes[AsnPropTypes["ObjectIdentifier"] = 7] = "ObjectIdentifier";
|
||||
AsnPropTypes[AsnPropTypes["Utf8String"] = 8] = "Utf8String";
|
||||
AsnPropTypes[AsnPropTypes["BmpString"] = 9] = "BmpString";
|
||||
AsnPropTypes[AsnPropTypes["UniversalString"] = 10] = "UniversalString";
|
||||
AsnPropTypes[AsnPropTypes["NumericString"] = 11] = "NumericString";
|
||||
AsnPropTypes[AsnPropTypes["PrintableString"] = 12] = "PrintableString";
|
||||
AsnPropTypes[AsnPropTypes["TeletexString"] = 13] = "TeletexString";
|
||||
AsnPropTypes[AsnPropTypes["VideotexString"] = 14] = "VideotexString";
|
||||
AsnPropTypes[AsnPropTypes["IA5String"] = 15] = "IA5String";
|
||||
AsnPropTypes[AsnPropTypes["GraphicString"] = 16] = "GraphicString";
|
||||
AsnPropTypes[AsnPropTypes["VisibleString"] = 17] = "VisibleString";
|
||||
AsnPropTypes[AsnPropTypes["GeneralString"] = 18] = "GeneralString";
|
||||
AsnPropTypes[AsnPropTypes["CharacterString"] = 19] = "CharacterString";
|
||||
AsnPropTypes[AsnPropTypes["UTCTime"] = 20] = "UTCTime";
|
||||
AsnPropTypes[AsnPropTypes["GeneralizedTime"] = 21] = "GeneralizedTime";
|
||||
AsnPropTypes[AsnPropTypes["DATE"] = 22] = "DATE";
|
||||
AsnPropTypes[AsnPropTypes["TimeOfDay"] = 23] = "TimeOfDay";
|
||||
AsnPropTypes[AsnPropTypes["DateTime"] = 24] = "DateTime";
|
||||
AsnPropTypes[AsnPropTypes["Duration"] = 25] = "Duration";
|
||||
AsnPropTypes[AsnPropTypes["TIME"] = 26] = "TIME";
|
||||
AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null";
|
||||
})(AsnPropTypes || (exports.AsnPropTypes = AsnPropTypes = {}));
|
||||
4
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/errors/index.js
generated
vendored
Normal file
4
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/errors/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
tslib_1.__exportStar(require("./schema_validation"), exports);
|
||||
10
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/errors/schema_validation.js
generated
vendored
Normal file
10
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/errors/schema_validation.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnSchemaValidationError = void 0;
|
||||
class AsnSchemaValidationError extends Error {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.schemas = [];
|
||||
}
|
||||
}
|
||||
exports.AsnSchemaValidationError = AsnSchemaValidationError;
|
||||
45
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/helper.js
generated
vendored
Normal file
45
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/helper.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isConvertible = isConvertible;
|
||||
exports.isTypeOfArray = isTypeOfArray;
|
||||
exports.isArrayEqual = isArrayEqual;
|
||||
function isConvertible(target) {
|
||||
if (typeof target === "function" && target.prototype) {
|
||||
if (target.prototype.toASN && target.prototype.fromASN) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return isConvertible(target.prototype);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target);
|
||||
}
|
||||
}
|
||||
function isTypeOfArray(target) {
|
||||
var _a;
|
||||
if (target) {
|
||||
const proto = Object.getPrototypeOf(target);
|
||||
if (((_a = proto === null || proto === void 0 ? void 0 : proto.prototype) === null || _a === void 0 ? void 0 : _a.constructor) === Array) {
|
||||
return true;
|
||||
}
|
||||
return isTypeOfArray(proto);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isArrayEqual(bytes1, bytes2) {
|
||||
if (!(bytes1 && bytes2)) {
|
||||
return false;
|
||||
}
|
||||
if (bytes1.byteLength !== bytes2.byteLength) {
|
||||
return false;
|
||||
}
|
||||
const b1 = new Uint8Array(bytes1);
|
||||
const b2 = new Uint8Array(bytes2);
|
||||
for (let i = 0; i < bytes1.byteLength; i++) {
|
||||
if (b1[i] !== b2[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
22
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/index.js
generated
vendored
Normal file
22
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnSerializer = exports.AsnParser = exports.AsnPropTypes = exports.AsnTypeTypes = exports.AsnSetType = exports.AsnSequenceType = exports.AsnChoiceType = exports.AsnType = exports.AsnProp = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
tslib_1.__exportStar(require("./converters"), exports);
|
||||
tslib_1.__exportStar(require("./types/index"), exports);
|
||||
var decorators_1 = require("./decorators");
|
||||
Object.defineProperty(exports, "AsnProp", { enumerable: true, get: function () { return decorators_1.AsnProp; } });
|
||||
Object.defineProperty(exports, "AsnType", { enumerable: true, get: function () { return decorators_1.AsnType; } });
|
||||
Object.defineProperty(exports, "AsnChoiceType", { enumerable: true, get: function () { return decorators_1.AsnChoiceType; } });
|
||||
Object.defineProperty(exports, "AsnSequenceType", { enumerable: true, get: function () { return decorators_1.AsnSequenceType; } });
|
||||
Object.defineProperty(exports, "AsnSetType", { enumerable: true, get: function () { return decorators_1.AsnSetType; } });
|
||||
var enums_1 = require("./enums");
|
||||
Object.defineProperty(exports, "AsnTypeTypes", { enumerable: true, get: function () { return enums_1.AsnTypeTypes; } });
|
||||
Object.defineProperty(exports, "AsnPropTypes", { enumerable: true, get: function () { return enums_1.AsnPropTypes; } });
|
||||
var parser_1 = require("./parser");
|
||||
Object.defineProperty(exports, "AsnParser", { enumerable: true, get: function () { return parser_1.AsnParser; } });
|
||||
var serializer_1 = require("./serializer");
|
||||
Object.defineProperty(exports, "AsnSerializer", { enumerable: true, get: function () { return serializer_1.AsnSerializer; } });
|
||||
tslib_1.__exportStar(require("./errors"), exports);
|
||||
tslib_1.__exportStar(require("./objects"), exports);
|
||||
tslib_1.__exportStar(require("./convert"), exports);
|
||||
17
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/objects.js
generated
vendored
Normal file
17
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/objects.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnArray = void 0;
|
||||
class AsnArray extends Array {
|
||||
constructor(items = []) {
|
||||
if (typeof items === "number") {
|
||||
super(items);
|
||||
}
|
||||
else {
|
||||
super();
|
||||
for (const item of items) {
|
||||
this.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.AsnArray = AsnArray;
|
||||
139
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/parser.js
generated
vendored
Normal file
139
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/parser.js
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnParser = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const enums_1 = require("./enums");
|
||||
const converters = require("./converters");
|
||||
const errors_1 = require("./errors");
|
||||
const helper_1 = require("./helper");
|
||||
const storage_1 = require("./storage");
|
||||
class AsnParser {
|
||||
static parse(data, target) {
|
||||
const asn1Parsed = asn1js.fromBER(data);
|
||||
if (asn1Parsed.result.error) {
|
||||
throw new Error(asn1Parsed.result.error);
|
||||
}
|
||||
const res = this.fromASN(asn1Parsed.result, target);
|
||||
return res;
|
||||
}
|
||||
static fromASN(asn1Schema, target) {
|
||||
var _a;
|
||||
try {
|
||||
if ((0, helper_1.isConvertible)(target)) {
|
||||
const value = new target();
|
||||
return value.fromASN(asn1Schema);
|
||||
}
|
||||
const schema = storage_1.schemaStorage.get(target);
|
||||
storage_1.schemaStorage.cache(target);
|
||||
let targetSchema = schema.schema;
|
||||
if (asn1Schema.constructor === asn1js.Constructed && schema.type !== enums_1.AsnTypeTypes.Choice) {
|
||||
targetSchema = new asn1js.Constructed({
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: asn1Schema.idBlock.tagNumber,
|
||||
},
|
||||
value: schema.schema.valueBlock.value,
|
||||
});
|
||||
for (const key in schema.items) {
|
||||
delete asn1Schema[key];
|
||||
}
|
||||
}
|
||||
const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema);
|
||||
if (!asn1ComparedSchema.verified) {
|
||||
throw new errors_1.AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema. ${asn1ComparedSchema.result.error}`);
|
||||
}
|
||||
const res = new target();
|
||||
if ((0, helper_1.isTypeOfArray)(target)) {
|
||||
if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) {
|
||||
throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`);
|
||||
}
|
||||
const itemType = schema.itemType;
|
||||
if (typeof itemType === "number") {
|
||||
const converter = converters.defaultConverter(itemType);
|
||||
if (!converter) {
|
||||
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
|
||||
}
|
||||
return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element));
|
||||
}
|
||||
else {
|
||||
return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType));
|
||||
}
|
||||
}
|
||||
for (const key in schema.items) {
|
||||
const asn1SchemaValue = asn1ComparedSchema.result[key];
|
||||
if (!asn1SchemaValue) {
|
||||
continue;
|
||||
}
|
||||
const schemaItem = schema.items[key];
|
||||
const schemaItemType = schemaItem.type;
|
||||
if (typeof schemaItemType === "number" || (0, helper_1.isConvertible)(schemaItemType)) {
|
||||
const converter = (_a = schemaItem.converter) !== null && _a !== void 0 ? _a : ((0, helper_1.isConvertible)(schemaItemType)
|
||||
? new schemaItemType()
|
||||
: null);
|
||||
if (!converter) {
|
||||
throw new Error("Converter is empty");
|
||||
}
|
||||
if (schemaItem.repeated) {
|
||||
if (schemaItem.implicit) {
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
const newItem = new Container();
|
||||
newItem.valueBlock = asn1SchemaValue.valueBlock;
|
||||
const newItemAsn = asn1js.fromBER(newItem.toBER(false));
|
||||
if (newItemAsn.offset === -1) {
|
||||
throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
|
||||
}
|
||||
if (!("value" in newItemAsn.result.valueBlock &&
|
||||
Array.isArray(newItemAsn.result.valueBlock.value))) {
|
||||
throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
|
||||
}
|
||||
const value = newItemAsn.result.valueBlock.value;
|
||||
res[key] = Array.from(value, (element) => converter.fromASN(element));
|
||||
}
|
||||
else {
|
||||
res[key] = Array.from(asn1SchemaValue, (element) => converter.fromASN(element));
|
||||
}
|
||||
}
|
||||
else {
|
||||
let value = asn1SchemaValue;
|
||||
if (schemaItem.implicit) {
|
||||
let newItem;
|
||||
if ((0, helper_1.isConvertible)(schemaItemType)) {
|
||||
newItem = new schemaItemType().toSchema("");
|
||||
}
|
||||
else {
|
||||
const Asn1TypeName = enums_1.AsnPropTypes[schemaItemType];
|
||||
const Asn1Type = asn1js[Asn1TypeName];
|
||||
if (!Asn1Type) {
|
||||
throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);
|
||||
}
|
||||
newItem = new Asn1Type();
|
||||
}
|
||||
newItem.valueBlock = value.valueBlock;
|
||||
value = asn1js.fromBER(newItem.toBER(false)).result;
|
||||
}
|
||||
res[key] = converter.fromASN(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(asn1SchemaValue)) {
|
||||
throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");
|
||||
}
|
||||
res[key] = Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType));
|
||||
}
|
||||
else {
|
||||
res[key] = this.fromASN(asn1SchemaValue, schemaItemType);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof errors_1.AsnSchemaValidationError) {
|
||||
error.schemas.push(target.name);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.AsnParser = AsnParser;
|
||||
160
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/schema.js
generated
vendored
Normal file
160
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/schema.js
generated
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnSchemaStorage = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const enums_1 = require("./enums");
|
||||
const helper_1 = require("./helper");
|
||||
class AsnSchemaStorage {
|
||||
constructor() {
|
||||
this.items = new WeakMap();
|
||||
}
|
||||
has(target) {
|
||||
return this.items.has(target);
|
||||
}
|
||||
get(target, checkSchema = false) {
|
||||
const schema = this.items.get(target);
|
||||
if (!schema) {
|
||||
throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`);
|
||||
}
|
||||
if (checkSchema && !schema.schema) {
|
||||
throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
cache(target) {
|
||||
const schema = this.get(target);
|
||||
if (!schema.schema) {
|
||||
schema.schema = this.create(target, true);
|
||||
}
|
||||
}
|
||||
createDefault(target) {
|
||||
const schema = {
|
||||
type: enums_1.AsnTypeTypes.Sequence,
|
||||
items: {},
|
||||
};
|
||||
const parentSchema = this.findParentSchema(target);
|
||||
if (parentSchema) {
|
||||
Object.assign(schema, parentSchema);
|
||||
schema.items = Object.assign({}, schema.items, parentSchema.items);
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
create(target, useNames) {
|
||||
const schema = this.items.get(target) || this.createDefault(target);
|
||||
const asn1Value = [];
|
||||
for (const key in schema.items) {
|
||||
const item = schema.items[key];
|
||||
const name = useNames ? key : "";
|
||||
let asn1Item;
|
||||
if (typeof item.type === "number") {
|
||||
const Asn1TypeName = enums_1.AsnPropTypes[item.type];
|
||||
const Asn1Type = asn1js[Asn1TypeName];
|
||||
if (!Asn1Type) {
|
||||
throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);
|
||||
}
|
||||
asn1Item = new Asn1Type({ name });
|
||||
}
|
||||
else if ((0, helper_1.isConvertible)(item.type)) {
|
||||
const instance = new item.type();
|
||||
asn1Item = instance.toSchema(name);
|
||||
}
|
||||
else if (item.optional) {
|
||||
const itemSchema = this.get(item.type);
|
||||
if (itemSchema.type === enums_1.AsnTypeTypes.Choice) {
|
||||
asn1Item = new asn1js.Any({ name });
|
||||
}
|
||||
else {
|
||||
asn1Item = this.create(item.type, false);
|
||||
asn1Item.name = name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Item = new asn1js.Any({ name });
|
||||
}
|
||||
const optional = !!item.optional || item.defaultValue !== undefined;
|
||||
if (item.repeated) {
|
||||
asn1Item.name = "";
|
||||
const Container = item.repeated === "set" ? asn1js.Set : asn1js.Sequence;
|
||||
asn1Item = new Container({
|
||||
name: "",
|
||||
value: [
|
||||
new asn1js.Repeated({
|
||||
name,
|
||||
value: asn1Item,
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
if (item.context !== null && item.context !== undefined) {
|
||||
if (item.implicit) {
|
||||
if (typeof item.type === "number" || (0, helper_1.isConvertible)(item.type)) {
|
||||
const Container = item.repeated ? asn1js.Constructed : asn1js.Primitive;
|
||||
asn1Value.push(new Container({
|
||||
name,
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
}));
|
||||
}
|
||||
else {
|
||||
this.cache(item.type);
|
||||
const isRepeated = !!item.repeated;
|
||||
let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;
|
||||
value =
|
||||
"valueBlock" in value
|
||||
? value.valueBlock.value
|
||||
: value.value;
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
name: !isRepeated ? name : "",
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
value: value,
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
value: [asn1Item],
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Item.optional = optional;
|
||||
asn1Value.push(asn1Item);
|
||||
}
|
||||
}
|
||||
switch (schema.type) {
|
||||
case enums_1.AsnTypeTypes.Sequence:
|
||||
return new asn1js.Sequence({ value: asn1Value, name: "" });
|
||||
case enums_1.AsnTypeTypes.Set:
|
||||
return new asn1js.Set({ value: asn1Value, name: "" });
|
||||
case enums_1.AsnTypeTypes.Choice:
|
||||
return new asn1js.Choice({ value: asn1Value, name: "" });
|
||||
default:
|
||||
throw new Error(`Unsupported ASN1 type in use`);
|
||||
}
|
||||
}
|
||||
set(target, schema) {
|
||||
this.items.set(target, schema);
|
||||
return this;
|
||||
}
|
||||
findParentSchema(target) {
|
||||
const parent = Object.getPrototypeOf(target);
|
||||
if (parent) {
|
||||
const schema = this.items.get(parent);
|
||||
return schema || this.findParentSchema(parent);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.AsnSchemaStorage = AsnSchemaStorage;
|
||||
158
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js
generated
vendored
Normal file
158
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsnSerializer = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const converters = require("./converters");
|
||||
const enums_1 = require("./enums");
|
||||
const helper_1 = require("./helper");
|
||||
const storage_1 = require("./storage");
|
||||
class AsnSerializer {
|
||||
static serialize(obj) {
|
||||
if (obj instanceof asn1js.BaseBlock) {
|
||||
return obj.toBER(false);
|
||||
}
|
||||
return this.toASN(obj).toBER(false);
|
||||
}
|
||||
static toASN(obj) {
|
||||
if (obj && typeof obj === "object" && (0, helper_1.isConvertible)(obj)) {
|
||||
return obj.toASN();
|
||||
}
|
||||
if (!(obj && typeof obj === "object")) {
|
||||
throw new TypeError("Parameter 1 should be type of Object.");
|
||||
}
|
||||
const target = obj.constructor;
|
||||
const schema = storage_1.schemaStorage.get(target);
|
||||
storage_1.schemaStorage.cache(target);
|
||||
let asn1Value = [];
|
||||
if (schema.itemType) {
|
||||
if (!Array.isArray(obj)) {
|
||||
throw new TypeError("Parameter 1 should be type of Array.");
|
||||
}
|
||||
if (typeof schema.itemType === "number") {
|
||||
const converter = converters.defaultConverter(schema.itemType);
|
||||
if (!converter) {
|
||||
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
|
||||
}
|
||||
asn1Value = obj.map((o) => converter.toASN(o));
|
||||
}
|
||||
else {
|
||||
asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, "[]", target, o));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (const key in schema.items) {
|
||||
const schemaItem = schema.items[key];
|
||||
const objProp = obj[key];
|
||||
if (objProp === undefined ||
|
||||
schemaItem.defaultValue === objProp ||
|
||||
(typeof schemaItem.defaultValue === "object" &&
|
||||
typeof objProp === "object" &&
|
||||
(0, helper_1.isArrayEqual)(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
|
||||
continue;
|
||||
}
|
||||
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
|
||||
if (typeof schemaItem.context === "number") {
|
||||
if (schemaItem.implicit) {
|
||||
if (!schemaItem.repeated &&
|
||||
(typeof schemaItem.type === "number" || (0, helper_1.isConvertible)(schemaItem.type))) {
|
||||
const value = {};
|
||||
value.valueHex =
|
||||
asn1Item instanceof asn1js.Null
|
||||
? asn1Item.valueBeforeDecodeView
|
||||
: asn1Item.valueBlock.toBER();
|
||||
asn1Value.push(new asn1js.Primitive({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
...value,
|
||||
}));
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
value: asn1Item.valueBlock.value,
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
value: [asn1Item],
|
||||
}));
|
||||
}
|
||||
}
|
||||
else if (schemaItem.repeated) {
|
||||
asn1Value = asn1Value.concat(asn1Item);
|
||||
}
|
||||
else {
|
||||
asn1Value.push(asn1Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
let asnSchema;
|
||||
switch (schema.type) {
|
||||
case enums_1.AsnTypeTypes.Sequence:
|
||||
asnSchema = new asn1js.Sequence({ value: asn1Value });
|
||||
break;
|
||||
case enums_1.AsnTypeTypes.Set:
|
||||
asnSchema = new asn1js.Set({ value: asn1Value });
|
||||
break;
|
||||
case enums_1.AsnTypeTypes.Choice:
|
||||
if (!asn1Value[0]) {
|
||||
throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`);
|
||||
}
|
||||
asnSchema = asn1Value[0];
|
||||
break;
|
||||
}
|
||||
return asnSchema;
|
||||
}
|
||||
static toAsnItem(schemaItem, key, target, objProp) {
|
||||
let asn1Item;
|
||||
if (typeof schemaItem.type === "number") {
|
||||
const converter = schemaItem.converter;
|
||||
if (!converter) {
|
||||
throw new Error(`Property '${key}' doesn't have converter for type ${enums_1.AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
||||
}
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(objProp)) {
|
||||
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
||||
}
|
||||
const items = Array.from(objProp, (element) => converter.toASN(element));
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
asn1Item = new Container({
|
||||
value: items,
|
||||
});
|
||||
}
|
||||
else {
|
||||
asn1Item = converter.toASN(objProp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(objProp)) {
|
||||
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
||||
}
|
||||
const items = Array.from(objProp, (element) => this.toASN(element));
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
asn1Item = new Container({
|
||||
value: items,
|
||||
});
|
||||
}
|
||||
else {
|
||||
asn1Item = this.toASN(objProp);
|
||||
}
|
||||
}
|
||||
return asn1Item;
|
||||
}
|
||||
}
|
||||
exports.AsnSerializer = AsnSerializer;
|
||||
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/storage.js
generated
vendored
Normal file
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/storage.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.schemaStorage = void 0;
|
||||
const schema_1 = require("./schema");
|
||||
exports.schemaStorage = new schema_1.AsnSchemaStorage();
|
||||
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types.js
generated
vendored
Normal file
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
67
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/bit_string.js
generated
vendored
Normal file
67
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/bit_string.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BitString = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const pvtsutils_1 = require("pvtsutils");
|
||||
class BitString {
|
||||
constructor(params, unusedBits = 0) {
|
||||
this.unusedBits = 0;
|
||||
this.value = new ArrayBuffer(0);
|
||||
if (params) {
|
||||
if (typeof params === "number") {
|
||||
this.fromNumber(params);
|
||||
}
|
||||
else if (pvtsutils_1.BufferSourceConverter.isBufferSource(params)) {
|
||||
this.unusedBits = unusedBits;
|
||||
this.value = pvtsutils_1.BufferSourceConverter.toArrayBuffer(params);
|
||||
}
|
||||
else {
|
||||
throw TypeError("Unsupported type of 'params' argument for BitString");
|
||||
}
|
||||
}
|
||||
}
|
||||
fromASN(asn) {
|
||||
if (!(asn instanceof asn1js.BitString)) {
|
||||
throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
|
||||
}
|
||||
this.unusedBits = asn.valueBlock.unusedBits;
|
||||
this.value = asn.valueBlock.valueHex;
|
||||
return this;
|
||||
}
|
||||
toASN() {
|
||||
return new asn1js.BitString({ unusedBits: this.unusedBits, valueHex: this.value });
|
||||
}
|
||||
toSchema(name) {
|
||||
return new asn1js.BitString({ name });
|
||||
}
|
||||
toNumber() {
|
||||
let res = "";
|
||||
const uintArray = new Uint8Array(this.value);
|
||||
for (const octet of uintArray) {
|
||||
res += octet.toString(2).padStart(8, "0");
|
||||
}
|
||||
res = res.split("").reverse().join("");
|
||||
if (this.unusedBits) {
|
||||
res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
|
||||
}
|
||||
return parseInt(res, 2);
|
||||
}
|
||||
fromNumber(value) {
|
||||
let bits = value.toString(2);
|
||||
const octetSize = (bits.length + 7) >> 3;
|
||||
this.unusedBits = (octetSize << 3) - bits.length;
|
||||
const octets = new Uint8Array(octetSize);
|
||||
bits = bits
|
||||
.padStart(octetSize << 3, "0")
|
||||
.split("")
|
||||
.reverse()
|
||||
.join("");
|
||||
let index = 0;
|
||||
while (index < octetSize) {
|
||||
octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
|
||||
index++;
|
||||
}
|
||||
this.value = octets.buffer;
|
||||
}
|
||||
}
|
||||
exports.BitString = BitString;
|
||||
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/index.js
generated
vendored
Normal file
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
tslib_1.__exportStar(require("./bit_string"), exports);
|
||||
tslib_1.__exportStar(require("./octet_string"), exports);
|
||||
43
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/octet_string.js
generated
vendored
Normal file
43
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/cjs/types/octet_string.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OctetString = void 0;
|
||||
const asn1js = require("asn1js");
|
||||
const pvtsutils_1 = require("pvtsutils");
|
||||
class OctetString {
|
||||
get byteLength() {
|
||||
return this.buffer.byteLength;
|
||||
}
|
||||
get byteOffset() {
|
||||
return 0;
|
||||
}
|
||||
constructor(param) {
|
||||
if (typeof param === "number") {
|
||||
this.buffer = new ArrayBuffer(param);
|
||||
}
|
||||
else {
|
||||
if (pvtsutils_1.BufferSourceConverter.isBufferSource(param)) {
|
||||
this.buffer = pvtsutils_1.BufferSourceConverter.toArrayBuffer(param);
|
||||
}
|
||||
else if (Array.isArray(param)) {
|
||||
this.buffer = new Uint8Array(param);
|
||||
}
|
||||
else {
|
||||
this.buffer = new ArrayBuffer(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
fromASN(asn) {
|
||||
if (!(asn instanceof asn1js.OctetString)) {
|
||||
throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
|
||||
}
|
||||
this.buffer = asn.valueBlock.valueHex;
|
||||
return this;
|
||||
}
|
||||
toASN() {
|
||||
return new asn1js.OctetString({ valueHex: this.buffer });
|
||||
}
|
||||
toSchema(name) {
|
||||
return new asn1js.OctetString({ name });
|
||||
}
|
||||
}
|
||||
exports.OctetString = OctetString;
|
||||
22
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/convert.js
generated
vendored
Normal file
22
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/convert.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { BufferSourceConverter } from "pvtsutils";
|
||||
import { AsnParser } from "./parser";
|
||||
import { AsnSerializer } from "./serializer";
|
||||
export class AsnConvert {
|
||||
static serialize(obj) {
|
||||
return AsnSerializer.serialize(obj);
|
||||
}
|
||||
static parse(data, target) {
|
||||
return AsnParser.parse(data, target);
|
||||
}
|
||||
static toString(data) {
|
||||
const buf = BufferSourceConverter.isBufferSource(data)
|
||||
? BufferSourceConverter.toArrayBuffer(data)
|
||||
: AsnConvert.serialize(data);
|
||||
const asn = asn1js.fromBER(buf);
|
||||
if (asn.offset === -1) {
|
||||
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
||||
}
|
||||
return asn.result.toString();
|
||||
}
|
||||
}
|
||||
136
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/converters.js
generated
vendored
Normal file
136
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/converters.js
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { AsnPropTypes } from "./enums";
|
||||
import { OctetString } from "./types/index";
|
||||
export const AsnAnyConverter = {
|
||||
fromASN: (value) => value instanceof asn1js.Null ? null : value.valueBeforeDecodeView,
|
||||
toASN: (value) => {
|
||||
if (value === null) {
|
||||
return new asn1js.Null();
|
||||
}
|
||||
const schema = asn1js.fromBER(value);
|
||||
if (schema.result.error) {
|
||||
throw new Error(schema.result.error);
|
||||
}
|
||||
return schema.result;
|
||||
},
|
||||
};
|
||||
export const AsnIntegerConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4
|
||||
? value.valueBlock.toString()
|
||||
: value.valueBlock.valueDec,
|
||||
toASN: (value) => new asn1js.Integer({ value: +value }),
|
||||
};
|
||||
export const AsnEnumeratedConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueDec,
|
||||
toASN: (value) => new asn1js.Enumerated({ value }),
|
||||
};
|
||||
export const AsnIntegerArrayBufferConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.Integer({ valueHex: value }),
|
||||
};
|
||||
export const AsnIntegerBigIntConverter = {
|
||||
fromASN: (value) => value.toBigInt(),
|
||||
toASN: (value) => asn1js.Integer.fromBigInt(value),
|
||||
};
|
||||
export const AsnBitStringConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.BitString({ valueHex: value }),
|
||||
};
|
||||
export const AsnObjectIdentifierConverter = {
|
||||
fromASN: (value) => value.valueBlock.toString(),
|
||||
toASN: (value) => new asn1js.ObjectIdentifier({ value }),
|
||||
};
|
||||
export const AsnBooleanConverter = {
|
||||
fromASN: (value) => value.valueBlock.value,
|
||||
toASN: (value) => new asn1js.Boolean({ value }),
|
||||
};
|
||||
export const AsnOctetStringConverter = {
|
||||
fromASN: (value) => value.valueBlock.valueHexView,
|
||||
toASN: (value) => new asn1js.OctetString({ valueHex: value }),
|
||||
};
|
||||
export const AsnConstructedOctetStringConverter = {
|
||||
fromASN: (value) => new OctetString(value.getValue()),
|
||||
toASN: (value) => value.toASN(),
|
||||
};
|
||||
function createStringConverter(Asn1Type) {
|
||||
return {
|
||||
fromASN: (value) => value.valueBlock.value,
|
||||
toASN: (value) => new Asn1Type({ value }),
|
||||
};
|
||||
}
|
||||
export const AsnUtf8StringConverter = createStringConverter(asn1js.Utf8String);
|
||||
export const AsnBmpStringConverter = createStringConverter(asn1js.BmpString);
|
||||
export const AsnUniversalStringConverter = createStringConverter(asn1js.UniversalString);
|
||||
export const AsnNumericStringConverter = createStringConverter(asn1js.NumericString);
|
||||
export const AsnPrintableStringConverter = createStringConverter(asn1js.PrintableString);
|
||||
export const AsnTeletexStringConverter = createStringConverter(asn1js.TeletexString);
|
||||
export const AsnVideotexStringConverter = createStringConverter(asn1js.VideotexString);
|
||||
export const AsnIA5StringConverter = createStringConverter(asn1js.IA5String);
|
||||
export const AsnGraphicStringConverter = createStringConverter(asn1js.GraphicString);
|
||||
export const AsnVisibleStringConverter = createStringConverter(asn1js.VisibleString);
|
||||
export const AsnGeneralStringConverter = createStringConverter(asn1js.GeneralString);
|
||||
export const AsnCharacterStringConverter = createStringConverter(asn1js.CharacterString);
|
||||
export const AsnUTCTimeConverter = {
|
||||
fromASN: (value) => value.toDate(),
|
||||
toASN: (value) => new asn1js.UTCTime({ valueDate: value }),
|
||||
};
|
||||
export const AsnGeneralizedTimeConverter = {
|
||||
fromASN: (value) => value.toDate(),
|
||||
toASN: (value) => new asn1js.GeneralizedTime({ valueDate: value }),
|
||||
};
|
||||
export const AsnNullConverter = {
|
||||
fromASN: () => null,
|
||||
toASN: () => {
|
||||
return new asn1js.Null();
|
||||
},
|
||||
};
|
||||
export function defaultConverter(type) {
|
||||
switch (type) {
|
||||
case AsnPropTypes.Any:
|
||||
return AsnAnyConverter;
|
||||
case AsnPropTypes.BitString:
|
||||
return AsnBitStringConverter;
|
||||
case AsnPropTypes.BmpString:
|
||||
return AsnBmpStringConverter;
|
||||
case AsnPropTypes.Boolean:
|
||||
return AsnBooleanConverter;
|
||||
case AsnPropTypes.CharacterString:
|
||||
return AsnCharacterStringConverter;
|
||||
case AsnPropTypes.Enumerated:
|
||||
return AsnEnumeratedConverter;
|
||||
case AsnPropTypes.GeneralString:
|
||||
return AsnGeneralStringConverter;
|
||||
case AsnPropTypes.GeneralizedTime:
|
||||
return AsnGeneralizedTimeConverter;
|
||||
case AsnPropTypes.GraphicString:
|
||||
return AsnGraphicStringConverter;
|
||||
case AsnPropTypes.IA5String:
|
||||
return AsnIA5StringConverter;
|
||||
case AsnPropTypes.Integer:
|
||||
return AsnIntegerConverter;
|
||||
case AsnPropTypes.Null:
|
||||
return AsnNullConverter;
|
||||
case AsnPropTypes.NumericString:
|
||||
return AsnNumericStringConverter;
|
||||
case AsnPropTypes.ObjectIdentifier:
|
||||
return AsnObjectIdentifierConverter;
|
||||
case AsnPropTypes.OctetString:
|
||||
return AsnOctetStringConverter;
|
||||
case AsnPropTypes.PrintableString:
|
||||
return AsnPrintableStringConverter;
|
||||
case AsnPropTypes.TeletexString:
|
||||
return AsnTeletexStringConverter;
|
||||
case AsnPropTypes.UTCTime:
|
||||
return AsnUTCTimeConverter;
|
||||
case AsnPropTypes.UniversalString:
|
||||
return AsnUniversalStringConverter;
|
||||
case AsnPropTypes.Utf8String:
|
||||
return AsnUtf8StringConverter;
|
||||
case AsnPropTypes.VideotexString:
|
||||
return AsnVideotexStringConverter;
|
||||
case AsnPropTypes.VisibleString:
|
||||
return AsnVisibleStringConverter;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
36
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js
generated
vendored
Normal file
36
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import * as converters from "./converters";
|
||||
import { AsnTypeTypes } from "./enums";
|
||||
import { schemaStorage } from "./storage";
|
||||
export const AsnType = (options) => (target) => {
|
||||
let schema;
|
||||
if (!schemaStorage.has(target)) {
|
||||
schema = schemaStorage.createDefault(target);
|
||||
schemaStorage.set(target, schema);
|
||||
}
|
||||
else {
|
||||
schema = schemaStorage.get(target);
|
||||
}
|
||||
Object.assign(schema, options);
|
||||
};
|
||||
export const AsnChoiceType = () => AsnType({ type: AsnTypeTypes.Choice });
|
||||
export const AsnSetType = (options) => AsnType({ type: AsnTypeTypes.Set, ...options });
|
||||
export const AsnSequenceType = (options) => AsnType({ type: AsnTypeTypes.Sequence, ...options });
|
||||
export const AsnProp = (options) => (target, propertyKey) => {
|
||||
let schema;
|
||||
if (!schemaStorage.has(target.constructor)) {
|
||||
schema = schemaStorage.createDefault(target.constructor);
|
||||
schemaStorage.set(target.constructor, schema);
|
||||
}
|
||||
else {
|
||||
schema = schemaStorage.get(target.constructor);
|
||||
}
|
||||
const copyOptions = Object.assign({}, options);
|
||||
if (typeof copyOptions.type === "number" && !copyOptions.converter) {
|
||||
const defaultConverter = converters.defaultConverter(options.type);
|
||||
if (!defaultConverter) {
|
||||
throw new Error(`Cannot get default converter for property '${propertyKey}' of ${target.constructor.name}`);
|
||||
}
|
||||
copyOptions.converter = defaultConverter;
|
||||
}
|
||||
schema.items[propertyKey] = copyOptions;
|
||||
};
|
||||
36
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/enums.js
generated
vendored
Normal file
36
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/enums.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
export var AsnTypeTypes;
|
||||
(function (AsnTypeTypes) {
|
||||
AsnTypeTypes[AsnTypeTypes["Sequence"] = 0] = "Sequence";
|
||||
AsnTypeTypes[AsnTypeTypes["Set"] = 1] = "Set";
|
||||
AsnTypeTypes[AsnTypeTypes["Choice"] = 2] = "Choice";
|
||||
})(AsnTypeTypes || (AsnTypeTypes = {}));
|
||||
export var AsnPropTypes;
|
||||
(function (AsnPropTypes) {
|
||||
AsnPropTypes[AsnPropTypes["Any"] = 1] = "Any";
|
||||
AsnPropTypes[AsnPropTypes["Boolean"] = 2] = "Boolean";
|
||||
AsnPropTypes[AsnPropTypes["OctetString"] = 3] = "OctetString";
|
||||
AsnPropTypes[AsnPropTypes["BitString"] = 4] = "BitString";
|
||||
AsnPropTypes[AsnPropTypes["Integer"] = 5] = "Integer";
|
||||
AsnPropTypes[AsnPropTypes["Enumerated"] = 6] = "Enumerated";
|
||||
AsnPropTypes[AsnPropTypes["ObjectIdentifier"] = 7] = "ObjectIdentifier";
|
||||
AsnPropTypes[AsnPropTypes["Utf8String"] = 8] = "Utf8String";
|
||||
AsnPropTypes[AsnPropTypes["BmpString"] = 9] = "BmpString";
|
||||
AsnPropTypes[AsnPropTypes["UniversalString"] = 10] = "UniversalString";
|
||||
AsnPropTypes[AsnPropTypes["NumericString"] = 11] = "NumericString";
|
||||
AsnPropTypes[AsnPropTypes["PrintableString"] = 12] = "PrintableString";
|
||||
AsnPropTypes[AsnPropTypes["TeletexString"] = 13] = "TeletexString";
|
||||
AsnPropTypes[AsnPropTypes["VideotexString"] = 14] = "VideotexString";
|
||||
AsnPropTypes[AsnPropTypes["IA5String"] = 15] = "IA5String";
|
||||
AsnPropTypes[AsnPropTypes["GraphicString"] = 16] = "GraphicString";
|
||||
AsnPropTypes[AsnPropTypes["VisibleString"] = 17] = "VisibleString";
|
||||
AsnPropTypes[AsnPropTypes["GeneralString"] = 18] = "GeneralString";
|
||||
AsnPropTypes[AsnPropTypes["CharacterString"] = 19] = "CharacterString";
|
||||
AsnPropTypes[AsnPropTypes["UTCTime"] = 20] = "UTCTime";
|
||||
AsnPropTypes[AsnPropTypes["GeneralizedTime"] = 21] = "GeneralizedTime";
|
||||
AsnPropTypes[AsnPropTypes["DATE"] = 22] = "DATE";
|
||||
AsnPropTypes[AsnPropTypes["TimeOfDay"] = 23] = "TimeOfDay";
|
||||
AsnPropTypes[AsnPropTypes["DateTime"] = 24] = "DateTime";
|
||||
AsnPropTypes[AsnPropTypes["Duration"] = 25] = "Duration";
|
||||
AsnPropTypes[AsnPropTypes["TIME"] = 26] = "TIME";
|
||||
AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null";
|
||||
})(AsnPropTypes || (AsnPropTypes = {}));
|
||||
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/errors/index.js
generated
vendored
Normal file
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/errors/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./schema_validation";
|
||||
6
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js
generated
vendored
Normal file
6
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export class AsnSchemaValidationError extends Error {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.schemas = [];
|
||||
}
|
||||
}
|
||||
40
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/helper.js
generated
vendored
Normal file
40
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/helper.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
export function isConvertible(target) {
|
||||
if (typeof target === "function" && target.prototype) {
|
||||
if (target.prototype.toASN && target.prototype.fromASN) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return isConvertible(target.prototype);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target);
|
||||
}
|
||||
}
|
||||
export function isTypeOfArray(target) {
|
||||
var _a;
|
||||
if (target) {
|
||||
const proto = Object.getPrototypeOf(target);
|
||||
if (((_a = proto === null || proto === void 0 ? void 0 : proto.prototype) === null || _a === void 0 ? void 0 : _a.constructor) === Array) {
|
||||
return true;
|
||||
}
|
||||
return isTypeOfArray(proto);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function isArrayEqual(bytes1, bytes2) {
|
||||
if (!(bytes1 && bytes2)) {
|
||||
return false;
|
||||
}
|
||||
if (bytes1.byteLength !== bytes2.byteLength) {
|
||||
return false;
|
||||
}
|
||||
const b1 = new Uint8Array(bytes1);
|
||||
const b2 = new Uint8Array(bytes2);
|
||||
for (let i = 0; i < bytes1.byteLength; i++) {
|
||||
if (b1[i] !== b2[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
9
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/index.js
generated
vendored
Normal file
9
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export * from "./converters";
|
||||
export * from "./types/index";
|
||||
export { AsnProp, AsnType, AsnChoiceType, AsnSequenceType, AsnSetType } from "./decorators";
|
||||
export { AsnTypeTypes, AsnPropTypes } from "./enums";
|
||||
export { AsnParser } from "./parser";
|
||||
export { AsnSerializer } from "./serializer";
|
||||
export * from "./errors";
|
||||
export * from "./objects";
|
||||
export * from "./convert";
|
||||
13
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/objects.js
generated
vendored
Normal file
13
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/objects.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export class AsnArray extends Array {
|
||||
constructor(items = []) {
|
||||
if (typeof items === "number") {
|
||||
super(items);
|
||||
}
|
||||
else {
|
||||
super();
|
||||
for (const item of items) {
|
||||
this.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
135
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/parser.js
generated
vendored
Normal file
135
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/parser.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { AsnPropTypes, AsnTypeTypes } from "./enums";
|
||||
import * as converters from "./converters";
|
||||
import { AsnSchemaValidationError } from "./errors";
|
||||
import { isConvertible, isTypeOfArray } from "./helper";
|
||||
import { schemaStorage } from "./storage";
|
||||
export class AsnParser {
|
||||
static parse(data, target) {
|
||||
const asn1Parsed = asn1js.fromBER(data);
|
||||
if (asn1Parsed.result.error) {
|
||||
throw new Error(asn1Parsed.result.error);
|
||||
}
|
||||
const res = this.fromASN(asn1Parsed.result, target);
|
||||
return res;
|
||||
}
|
||||
static fromASN(asn1Schema, target) {
|
||||
var _a;
|
||||
try {
|
||||
if (isConvertible(target)) {
|
||||
const value = new target();
|
||||
return value.fromASN(asn1Schema);
|
||||
}
|
||||
const schema = schemaStorage.get(target);
|
||||
schemaStorage.cache(target);
|
||||
let targetSchema = schema.schema;
|
||||
if (asn1Schema.constructor === asn1js.Constructed && schema.type !== AsnTypeTypes.Choice) {
|
||||
targetSchema = new asn1js.Constructed({
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: asn1Schema.idBlock.tagNumber,
|
||||
},
|
||||
value: schema.schema.valueBlock.value,
|
||||
});
|
||||
for (const key in schema.items) {
|
||||
delete asn1Schema[key];
|
||||
}
|
||||
}
|
||||
const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema);
|
||||
if (!asn1ComparedSchema.verified) {
|
||||
throw new AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema. ${asn1ComparedSchema.result.error}`);
|
||||
}
|
||||
const res = new target();
|
||||
if (isTypeOfArray(target)) {
|
||||
if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) {
|
||||
throw new Error(`Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.`);
|
||||
}
|
||||
const itemType = schema.itemType;
|
||||
if (typeof itemType === "number") {
|
||||
const converter = converters.defaultConverter(itemType);
|
||||
if (!converter) {
|
||||
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
|
||||
}
|
||||
return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element));
|
||||
}
|
||||
else {
|
||||
return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType));
|
||||
}
|
||||
}
|
||||
for (const key in schema.items) {
|
||||
const asn1SchemaValue = asn1ComparedSchema.result[key];
|
||||
if (!asn1SchemaValue) {
|
||||
continue;
|
||||
}
|
||||
const schemaItem = schema.items[key];
|
||||
const schemaItemType = schemaItem.type;
|
||||
if (typeof schemaItemType === "number" || isConvertible(schemaItemType)) {
|
||||
const converter = (_a = schemaItem.converter) !== null && _a !== void 0 ? _a : (isConvertible(schemaItemType)
|
||||
? new schemaItemType()
|
||||
: null);
|
||||
if (!converter) {
|
||||
throw new Error("Converter is empty");
|
||||
}
|
||||
if (schemaItem.repeated) {
|
||||
if (schemaItem.implicit) {
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
const newItem = new Container();
|
||||
newItem.valueBlock = asn1SchemaValue.valueBlock;
|
||||
const newItemAsn = asn1js.fromBER(newItem.toBER(false));
|
||||
if (newItemAsn.offset === -1) {
|
||||
throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`);
|
||||
}
|
||||
if (!("value" in newItemAsn.result.valueBlock &&
|
||||
Array.isArray(newItemAsn.result.valueBlock.value))) {
|
||||
throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");
|
||||
}
|
||||
const value = newItemAsn.result.valueBlock.value;
|
||||
res[key] = Array.from(value, (element) => converter.fromASN(element));
|
||||
}
|
||||
else {
|
||||
res[key] = Array.from(asn1SchemaValue, (element) => converter.fromASN(element));
|
||||
}
|
||||
}
|
||||
else {
|
||||
let value = asn1SchemaValue;
|
||||
if (schemaItem.implicit) {
|
||||
let newItem;
|
||||
if (isConvertible(schemaItemType)) {
|
||||
newItem = new schemaItemType().toSchema("");
|
||||
}
|
||||
else {
|
||||
const Asn1TypeName = AsnPropTypes[schemaItemType];
|
||||
const Asn1Type = asn1js[Asn1TypeName];
|
||||
if (!Asn1Type) {
|
||||
throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`);
|
||||
}
|
||||
newItem = new Asn1Type();
|
||||
}
|
||||
newItem.valueBlock = value.valueBlock;
|
||||
value = asn1js.fromBER(newItem.toBER(false)).result;
|
||||
}
|
||||
res[key] = converter.fromASN(value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(asn1SchemaValue)) {
|
||||
throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");
|
||||
}
|
||||
res[key] = Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType));
|
||||
}
|
||||
else {
|
||||
res[key] = this.fromASN(asn1SchemaValue, schemaItemType);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof AsnSchemaValidationError) {
|
||||
error.schemas.push(target.name);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
156
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/schema.js
generated
vendored
Normal file
156
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/schema.js
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { AsnPropTypes, AsnTypeTypes } from "./enums";
|
||||
import { isConvertible } from "./helper";
|
||||
export class AsnSchemaStorage {
|
||||
constructor() {
|
||||
this.items = new WeakMap();
|
||||
}
|
||||
has(target) {
|
||||
return this.items.has(target);
|
||||
}
|
||||
get(target, checkSchema = false) {
|
||||
const schema = this.items.get(target);
|
||||
if (!schema) {
|
||||
throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`);
|
||||
}
|
||||
if (checkSchema && !schema.schema) {
|
||||
throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
cache(target) {
|
||||
const schema = this.get(target);
|
||||
if (!schema.schema) {
|
||||
schema.schema = this.create(target, true);
|
||||
}
|
||||
}
|
||||
createDefault(target) {
|
||||
const schema = {
|
||||
type: AsnTypeTypes.Sequence,
|
||||
items: {},
|
||||
};
|
||||
const parentSchema = this.findParentSchema(target);
|
||||
if (parentSchema) {
|
||||
Object.assign(schema, parentSchema);
|
||||
schema.items = Object.assign({}, schema.items, parentSchema.items);
|
||||
}
|
||||
return schema;
|
||||
}
|
||||
create(target, useNames) {
|
||||
const schema = this.items.get(target) || this.createDefault(target);
|
||||
const asn1Value = [];
|
||||
for (const key in schema.items) {
|
||||
const item = schema.items[key];
|
||||
const name = useNames ? key : "";
|
||||
let asn1Item;
|
||||
if (typeof item.type === "number") {
|
||||
const Asn1TypeName = AsnPropTypes[item.type];
|
||||
const Asn1Type = asn1js[Asn1TypeName];
|
||||
if (!Asn1Type) {
|
||||
throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`);
|
||||
}
|
||||
asn1Item = new Asn1Type({ name });
|
||||
}
|
||||
else if (isConvertible(item.type)) {
|
||||
const instance = new item.type();
|
||||
asn1Item = instance.toSchema(name);
|
||||
}
|
||||
else if (item.optional) {
|
||||
const itemSchema = this.get(item.type);
|
||||
if (itemSchema.type === AsnTypeTypes.Choice) {
|
||||
asn1Item = new asn1js.Any({ name });
|
||||
}
|
||||
else {
|
||||
asn1Item = this.create(item.type, false);
|
||||
asn1Item.name = name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Item = new asn1js.Any({ name });
|
||||
}
|
||||
const optional = !!item.optional || item.defaultValue !== undefined;
|
||||
if (item.repeated) {
|
||||
asn1Item.name = "";
|
||||
const Container = item.repeated === "set" ? asn1js.Set : asn1js.Sequence;
|
||||
asn1Item = new Container({
|
||||
name: "",
|
||||
value: [
|
||||
new asn1js.Repeated({
|
||||
name,
|
||||
value: asn1Item,
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
if (item.context !== null && item.context !== undefined) {
|
||||
if (item.implicit) {
|
||||
if (typeof item.type === "number" || isConvertible(item.type)) {
|
||||
const Container = item.repeated ? asn1js.Constructed : asn1js.Primitive;
|
||||
asn1Value.push(new Container({
|
||||
name,
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
}));
|
||||
}
|
||||
else {
|
||||
this.cache(item.type);
|
||||
const isRepeated = !!item.repeated;
|
||||
let value = !isRepeated ? this.get(item.type, true).schema : asn1Item;
|
||||
value =
|
||||
"valueBlock" in value
|
||||
? value.valueBlock.value
|
||||
: value.value;
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
name: !isRepeated ? name : "",
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
value: value,
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: item.context,
|
||||
},
|
||||
value: [asn1Item],
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Item.optional = optional;
|
||||
asn1Value.push(asn1Item);
|
||||
}
|
||||
}
|
||||
switch (schema.type) {
|
||||
case AsnTypeTypes.Sequence:
|
||||
return new asn1js.Sequence({ value: asn1Value, name: "" });
|
||||
case AsnTypeTypes.Set:
|
||||
return new asn1js.Set({ value: asn1Value, name: "" });
|
||||
case AsnTypeTypes.Choice:
|
||||
return new asn1js.Choice({ value: asn1Value, name: "" });
|
||||
default:
|
||||
throw new Error(`Unsupported ASN1 type in use`);
|
||||
}
|
||||
}
|
||||
set(target, schema) {
|
||||
this.items.set(target, schema);
|
||||
return this;
|
||||
}
|
||||
findParentSchema(target) {
|
||||
const parent = Object.getPrototypeOf(target);
|
||||
if (parent) {
|
||||
const schema = this.items.get(parent);
|
||||
return schema || this.findParentSchema(parent);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
154
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js
generated
vendored
Normal file
154
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js
generated
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import * as converters from "./converters";
|
||||
import { AsnPropTypes, AsnTypeTypes } from "./enums";
|
||||
import { isConvertible, isArrayEqual } from "./helper";
|
||||
import { schemaStorage } from "./storage";
|
||||
export class AsnSerializer {
|
||||
static serialize(obj) {
|
||||
if (obj instanceof asn1js.BaseBlock) {
|
||||
return obj.toBER(false);
|
||||
}
|
||||
return this.toASN(obj).toBER(false);
|
||||
}
|
||||
static toASN(obj) {
|
||||
if (obj && typeof obj === "object" && isConvertible(obj)) {
|
||||
return obj.toASN();
|
||||
}
|
||||
if (!(obj && typeof obj === "object")) {
|
||||
throw new TypeError("Parameter 1 should be type of Object.");
|
||||
}
|
||||
const target = obj.constructor;
|
||||
const schema = schemaStorage.get(target);
|
||||
schemaStorage.cache(target);
|
||||
let asn1Value = [];
|
||||
if (schema.itemType) {
|
||||
if (!Array.isArray(obj)) {
|
||||
throw new TypeError("Parameter 1 should be type of Array.");
|
||||
}
|
||||
if (typeof schema.itemType === "number") {
|
||||
const converter = converters.defaultConverter(schema.itemType);
|
||||
if (!converter) {
|
||||
throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`);
|
||||
}
|
||||
asn1Value = obj.map((o) => converter.toASN(o));
|
||||
}
|
||||
else {
|
||||
asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, "[]", target, o));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (const key in schema.items) {
|
||||
const schemaItem = schema.items[key];
|
||||
const objProp = obj[key];
|
||||
if (objProp === undefined ||
|
||||
schemaItem.defaultValue === objProp ||
|
||||
(typeof schemaItem.defaultValue === "object" &&
|
||||
typeof objProp === "object" &&
|
||||
isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp)))) {
|
||||
continue;
|
||||
}
|
||||
const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp);
|
||||
if (typeof schemaItem.context === "number") {
|
||||
if (schemaItem.implicit) {
|
||||
if (!schemaItem.repeated &&
|
||||
(typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) {
|
||||
const value = {};
|
||||
value.valueHex =
|
||||
asn1Item instanceof asn1js.Null
|
||||
? asn1Item.valueBeforeDecodeView
|
||||
: asn1Item.valueBlock.toBER();
|
||||
asn1Value.push(new asn1js.Primitive({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
...value,
|
||||
}));
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
value: asn1Item.valueBlock.value,
|
||||
}));
|
||||
}
|
||||
}
|
||||
else {
|
||||
asn1Value.push(new asn1js.Constructed({
|
||||
optional: schemaItem.optional,
|
||||
idBlock: {
|
||||
tagClass: 3,
|
||||
tagNumber: schemaItem.context,
|
||||
},
|
||||
value: [asn1Item],
|
||||
}));
|
||||
}
|
||||
}
|
||||
else if (schemaItem.repeated) {
|
||||
asn1Value = asn1Value.concat(asn1Item);
|
||||
}
|
||||
else {
|
||||
asn1Value.push(asn1Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
let asnSchema;
|
||||
switch (schema.type) {
|
||||
case AsnTypeTypes.Sequence:
|
||||
asnSchema = new asn1js.Sequence({ value: asn1Value });
|
||||
break;
|
||||
case AsnTypeTypes.Set:
|
||||
asnSchema = new asn1js.Set({ value: asn1Value });
|
||||
break;
|
||||
case AsnTypeTypes.Choice:
|
||||
if (!asn1Value[0]) {
|
||||
throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`);
|
||||
}
|
||||
asnSchema = asn1Value[0];
|
||||
break;
|
||||
}
|
||||
return asnSchema;
|
||||
}
|
||||
static toAsnItem(schemaItem, key, target, objProp) {
|
||||
let asn1Item;
|
||||
if (typeof schemaItem.type === "number") {
|
||||
const converter = schemaItem.converter;
|
||||
if (!converter) {
|
||||
throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`);
|
||||
}
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(objProp)) {
|
||||
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
||||
}
|
||||
const items = Array.from(objProp, (element) => converter.toASN(element));
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
asn1Item = new Container({
|
||||
value: items,
|
||||
});
|
||||
}
|
||||
else {
|
||||
asn1Item = converter.toASN(objProp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (schemaItem.repeated) {
|
||||
if (!Array.isArray(objProp)) {
|
||||
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
||||
}
|
||||
const items = Array.from(objProp, (element) => this.toASN(element));
|
||||
const Container = schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set;
|
||||
asn1Item = new Container({
|
||||
value: items,
|
||||
});
|
||||
}
|
||||
else {
|
||||
asn1Item = this.toASN(objProp);
|
||||
}
|
||||
}
|
||||
return asn1Item;
|
||||
}
|
||||
}
|
||||
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/storage.js
generated
vendored
Normal file
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/storage.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { AsnSchemaStorage } from "./schema";
|
||||
export const schemaStorage = new AsnSchemaStorage();
|
||||
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types.js
generated
vendored
Normal file
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
63
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js
generated
vendored
Normal file
63
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { BufferSourceConverter } from "pvtsutils";
|
||||
export class BitString {
|
||||
constructor(params, unusedBits = 0) {
|
||||
this.unusedBits = 0;
|
||||
this.value = new ArrayBuffer(0);
|
||||
if (params) {
|
||||
if (typeof params === "number") {
|
||||
this.fromNumber(params);
|
||||
}
|
||||
else if (BufferSourceConverter.isBufferSource(params)) {
|
||||
this.unusedBits = unusedBits;
|
||||
this.value = BufferSourceConverter.toArrayBuffer(params);
|
||||
}
|
||||
else {
|
||||
throw TypeError("Unsupported type of 'params' argument for BitString");
|
||||
}
|
||||
}
|
||||
}
|
||||
fromASN(asn) {
|
||||
if (!(asn instanceof asn1js.BitString)) {
|
||||
throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
|
||||
}
|
||||
this.unusedBits = asn.valueBlock.unusedBits;
|
||||
this.value = asn.valueBlock.valueHex;
|
||||
return this;
|
||||
}
|
||||
toASN() {
|
||||
return new asn1js.BitString({ unusedBits: this.unusedBits, valueHex: this.value });
|
||||
}
|
||||
toSchema(name) {
|
||||
return new asn1js.BitString({ name });
|
||||
}
|
||||
toNumber() {
|
||||
let res = "";
|
||||
const uintArray = new Uint8Array(this.value);
|
||||
for (const octet of uintArray) {
|
||||
res += octet.toString(2).padStart(8, "0");
|
||||
}
|
||||
res = res.split("").reverse().join("");
|
||||
if (this.unusedBits) {
|
||||
res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
|
||||
}
|
||||
return parseInt(res, 2);
|
||||
}
|
||||
fromNumber(value) {
|
||||
let bits = value.toString(2);
|
||||
const octetSize = (bits.length + 7) >> 3;
|
||||
this.unusedBits = (octetSize << 3) - bits.length;
|
||||
const octets = new Uint8Array(octetSize);
|
||||
bits = bits
|
||||
.padStart(octetSize << 3, "0")
|
||||
.split("")
|
||||
.reverse()
|
||||
.join("");
|
||||
let index = 0;
|
||||
while (index < octetSize) {
|
||||
octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
|
||||
index++;
|
||||
}
|
||||
this.value = octets.buffer;
|
||||
}
|
||||
}
|
||||
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/index.js
generated
vendored
Normal file
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./bit_string";
|
||||
export * from "./octet_string";
|
||||
39
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js
generated
vendored
Normal file
39
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { BufferSourceConverter } from "pvtsutils";
|
||||
export class OctetString {
|
||||
get byteLength() {
|
||||
return this.buffer.byteLength;
|
||||
}
|
||||
get byteOffset() {
|
||||
return 0;
|
||||
}
|
||||
constructor(param) {
|
||||
if (typeof param === "number") {
|
||||
this.buffer = new ArrayBuffer(param);
|
||||
}
|
||||
else {
|
||||
if (BufferSourceConverter.isBufferSource(param)) {
|
||||
this.buffer = BufferSourceConverter.toArrayBuffer(param);
|
||||
}
|
||||
else if (Array.isArray(param)) {
|
||||
this.buffer = new Uint8Array(param);
|
||||
}
|
||||
else {
|
||||
this.buffer = new ArrayBuffer(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
fromASN(asn) {
|
||||
if (!(asn instanceof asn1js.OctetString)) {
|
||||
throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
|
||||
}
|
||||
this.buffer = asn.valueBlock.valueHex;
|
||||
return this;
|
||||
}
|
||||
toASN() {
|
||||
return new asn1js.OctetString({ valueHex: this.buffer });
|
||||
}
|
||||
toSchema(name) {
|
||||
return new asn1js.OctetString({ name });
|
||||
}
|
||||
}
|
||||
18
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/convert.d.ts
generated
vendored
Normal file
18
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/convert.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { BufferSource } from "pvtsutils";
|
||||
import { IEmptyConstructor } from "./types";
|
||||
export declare class AsnConvert {
|
||||
static serialize(obj: unknown): ArrayBuffer;
|
||||
static parse<T>(data: BufferSource, target: IEmptyConstructor<T>): T;
|
||||
/**
|
||||
* Returns a string representation of an ASN.1 encoded data
|
||||
* @param data ASN.1 encoded buffer source
|
||||
* @returns String representation of ASN.1 structure
|
||||
*/
|
||||
static toString(data: BufferSource): string;
|
||||
/**
|
||||
* Returns a string representation of an ASN.1 schema
|
||||
* @param obj Object which can be serialized to ASN.1 schema
|
||||
* @returns String representation of ASN.1 structure
|
||||
*/
|
||||
static toString(obj: unknown): string;
|
||||
}
|
||||
113
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/converters.d.ts
generated
vendored
Normal file
113
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/converters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { AnyConverterType, IAsnConverter, IntegerConverterType } from "./types";
|
||||
import { AsnPropTypes } from "./enums";
|
||||
import { OctetString } from "./types/index";
|
||||
/**
|
||||
* NOTE: Converter MUST have name Asn<Asn1PropType.name>Converter.
|
||||
* Asn1Prop decorator link custom converters by name of the Asn1PropType
|
||||
*/
|
||||
/**
|
||||
* ASN.1 ANY converter
|
||||
*/
|
||||
export declare const AsnAnyConverter: IAsnConverter<AnyConverterType>;
|
||||
/**
|
||||
* ASN.1 INTEGER to Number/String converter
|
||||
*/
|
||||
export declare const AsnIntegerConverter: IAsnConverter<IntegerConverterType, asn1js.Integer>;
|
||||
/**
|
||||
* ASN.1 ENUMERATED converter
|
||||
*/
|
||||
export declare const AsnEnumeratedConverter: IAsnConverter<number, asn1js.Enumerated>;
|
||||
/**
|
||||
* ASN.1 INTEGER to ArrayBuffer converter
|
||||
*/
|
||||
export declare const AsnIntegerArrayBufferConverter: IAsnConverter<ArrayBuffer, asn1js.Integer>;
|
||||
/**
|
||||
* ASN.1 INTEGER to BigInt converter
|
||||
*/
|
||||
export declare const AsnIntegerBigIntConverter: IAsnConverter<bigint, asn1js.Integer>;
|
||||
/**
|
||||
* ASN.1 BIT STRING converter
|
||||
*/
|
||||
export declare const AsnBitStringConverter: IAsnConverter<ArrayBuffer, asn1js.BitString>;
|
||||
/**
|
||||
* ASN.1 OBJECT IDENTIFIER converter
|
||||
*/
|
||||
export declare const AsnObjectIdentifierConverter: IAsnConverter<string, asn1js.ObjectIdentifier>;
|
||||
/**
|
||||
* ASN.1 BOOLEAN converter
|
||||
*/
|
||||
export declare const AsnBooleanConverter: IAsnConverter<boolean, asn1js.Boolean>;
|
||||
/**
|
||||
* ASN.1 OCTET_STRING converter
|
||||
*/
|
||||
export declare const AsnOctetStringConverter: IAsnConverter<ArrayBuffer, asn1js.OctetString>;
|
||||
/**
|
||||
* ASN.1 OCTET_STRING converter to OctetString class
|
||||
*/
|
||||
export declare const AsnConstructedOctetStringConverter: IAsnConverter<OctetString, asn1js.OctetString>;
|
||||
/**
|
||||
* ASN.1 UTF8_STRING converter
|
||||
*/
|
||||
export declare const AsnUtf8StringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 BPM STRING converter
|
||||
*/
|
||||
export declare const AsnBmpStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 UNIVERSAL STRING converter
|
||||
*/
|
||||
export declare const AsnUniversalStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 NUMERIC STRING converter
|
||||
*/
|
||||
export declare const AsnNumericStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 PRINTABLE STRING converter
|
||||
*/
|
||||
export declare const AsnPrintableStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 TELETEX STRING converter
|
||||
*/
|
||||
export declare const AsnTeletexStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 VIDEOTEX STRING converter
|
||||
*/
|
||||
export declare const AsnVideotexStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 IA5 STRING converter
|
||||
*/
|
||||
export declare const AsnIA5StringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 GRAPHIC STRING converter
|
||||
*/
|
||||
export declare const AsnGraphicStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 VISIBLE STRING converter
|
||||
*/
|
||||
export declare const AsnVisibleStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 GENERAL STRING converter
|
||||
*/
|
||||
export declare const AsnGeneralStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 CHARACTER STRING converter
|
||||
*/
|
||||
export declare const AsnCharacterStringConverter: IAsnConverter<string, asn1js.AsnType>;
|
||||
/**
|
||||
* ASN.1 UTCTime converter
|
||||
*/
|
||||
export declare const AsnUTCTimeConverter: IAsnConverter<Date, asn1js.UTCTime>;
|
||||
/**
|
||||
* ASN.1 GeneralizedTime converter
|
||||
*/
|
||||
export declare const AsnGeneralizedTimeConverter: IAsnConverter<Date, asn1js.GeneralizedTime>;
|
||||
/**
|
||||
* ASN.1 ANY converter
|
||||
*/
|
||||
export declare const AsnNullConverter: IAsnConverter<null, asn1js.Null>;
|
||||
/**
|
||||
* Returns default converter for specified type
|
||||
* @param type
|
||||
*/
|
||||
export declare function defaultConverter(type: AsnPropTypes): IAsnConverter | null;
|
||||
31
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/decorators.d.ts
generated
vendored
Normal file
31
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/decorators.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { AsnPropTypes, AsnTypeTypes } from "./enums";
|
||||
import { IAsnConverter, IEmptyConstructor } from "./types";
|
||||
export type AsnItemType<T = unknown> = AsnPropTypes | IEmptyConstructor<T>;
|
||||
export interface IAsn1TypeOptions {
|
||||
type: AsnTypeTypes;
|
||||
itemType?: AsnItemType;
|
||||
}
|
||||
export type AsnRepeatTypeString = "sequence" | "set";
|
||||
export type AsnRepeatType = AsnRepeatTypeString;
|
||||
export interface IAsn1PropOptions {
|
||||
type: AsnItemType;
|
||||
optional?: boolean;
|
||||
defaultValue?: unknown;
|
||||
context?: number;
|
||||
implicit?: boolean;
|
||||
converter?: IAsnConverter;
|
||||
repeated?: AsnRepeatType;
|
||||
}
|
||||
export type AsnTypeDecorator = (target: IEmptyConstructor) => void;
|
||||
export declare const AsnType: (options: IAsn1TypeOptions) => AsnTypeDecorator;
|
||||
export declare const AsnChoiceType: () => AsnTypeDecorator;
|
||||
export interface IAsn1SetOptions {
|
||||
itemType: AsnItemType;
|
||||
}
|
||||
export declare const AsnSetType: (options: IAsn1SetOptions) => AsnTypeDecorator;
|
||||
export interface IAsn1SequenceOptions {
|
||||
itemType?: AsnItemType;
|
||||
}
|
||||
export declare const AsnSequenceType: (options: IAsn1SequenceOptions) => AsnTypeDecorator;
|
||||
export type AsnPropDecorator = (target: object, propertyKey: string) => void;
|
||||
export declare const AsnProp: (options: IAsn1PropOptions) => AsnPropDecorator;
|
||||
40
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/enums.d.ts
generated
vendored
Normal file
40
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/enums.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* ASN.1 types for classes
|
||||
*/
|
||||
export declare enum AsnTypeTypes {
|
||||
Sequence = 0,
|
||||
Set = 1,
|
||||
Choice = 2
|
||||
}
|
||||
/**
|
||||
* ASN.1 types for properties
|
||||
*/
|
||||
export declare enum AsnPropTypes {
|
||||
Any = 1,
|
||||
Boolean = 2,
|
||||
OctetString = 3,
|
||||
BitString = 4,
|
||||
Integer = 5,
|
||||
Enumerated = 6,
|
||||
ObjectIdentifier = 7,
|
||||
Utf8String = 8,
|
||||
BmpString = 9,
|
||||
UniversalString = 10,
|
||||
NumericString = 11,
|
||||
PrintableString = 12,
|
||||
TeletexString = 13,
|
||||
VideotexString = 14,
|
||||
IA5String = 15,
|
||||
GraphicString = 16,
|
||||
VisibleString = 17,
|
||||
GeneralString = 18,
|
||||
CharacterString = 19,
|
||||
UTCTime = 20,
|
||||
GeneralizedTime = 21,
|
||||
DATE = 22,
|
||||
TimeOfDay = 23,
|
||||
DateTime = 24,
|
||||
Duration = 25,
|
||||
TIME = 26,
|
||||
Null = 27
|
||||
}
|
||||
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/errors/index.d.ts
generated
vendored
Normal file
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/errors/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./schema_validation";
|
||||
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/errors/schema_validation.d.ts
generated
vendored
Normal file
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/errors/schema_validation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare class AsnSchemaValidationError extends Error {
|
||||
schemas: string[];
|
||||
}
|
||||
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/helper.d.ts
generated
vendored
Normal file
5
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/helper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { IAsnConvertible, IEmptyConstructor } from "./types";
|
||||
export declare function isConvertible(target: IEmptyConstructor): target is new () => IAsnConvertible;
|
||||
export declare function isConvertible(target: unknown): target is IAsnConvertible;
|
||||
export declare function isTypeOfArray(target: unknown): target is typeof Array;
|
||||
export declare function isArrayEqual(bytes1: ArrayBuffer, bytes2: ArrayBuffer): boolean;
|
||||
10
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/index.d.ts
generated
vendored
Normal file
10
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from "./converters";
|
||||
export * from "./types/index";
|
||||
export { AsnProp, AsnType, AsnChoiceType, AsnSequenceType, AsnSetType } from "./decorators";
|
||||
export { AsnTypeTypes, AsnPropTypes } from "./enums";
|
||||
export { AsnParser } from "./parser";
|
||||
export { AsnSerializer } from "./serializer";
|
||||
export { IAsnConverter, IAsnConvertible } from "./types";
|
||||
export * from "./errors";
|
||||
export * from "./objects";
|
||||
export * from "./convert";
|
||||
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/objects.d.ts
generated
vendored
Normal file
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/objects.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare abstract class AsnArray<T> extends Array<T> {
|
||||
constructor(items?: T[]);
|
||||
}
|
||||
20
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/parser.d.ts
generated
vendored
Normal file
20
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import type { BufferSource } from "pvtsutils";
|
||||
import { IEmptyConstructor } from "./types";
|
||||
/**
|
||||
* Deserializes objects from ASN.1 encoded data
|
||||
*/
|
||||
export declare class AsnParser {
|
||||
/**
|
||||
* Deserializes an object from the ASN.1 encoded buffer
|
||||
* @param data ASN.1 encoded buffer
|
||||
* @param target Target schema for object deserialization
|
||||
*/
|
||||
static parse<T>(data: BufferSource, target: IEmptyConstructor<T>): T;
|
||||
/**
|
||||
* Deserializes an object from the asn1js object
|
||||
* @param asn1Schema asn1js object
|
||||
* @param target Target schema for object deserialization
|
||||
*/
|
||||
static fromASN<T>(asn1Schema: asn1js.AsnType, target: IEmptyConstructor<T>): T;
|
||||
}
|
||||
33
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/schema.d.ts
generated
vendored
Normal file
33
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { AsnRepeatType } from "./decorators";
|
||||
import { AsnPropTypes, AsnTypeTypes } from "./enums";
|
||||
import { IAsnConverter, IEmptyConstructor } from "./types";
|
||||
export interface IAsnSchemaItem {
|
||||
type: AsnPropTypes | IEmptyConstructor;
|
||||
optional?: boolean;
|
||||
defaultValue?: unknown;
|
||||
context?: number;
|
||||
implicit?: boolean;
|
||||
converter?: IAsnConverter;
|
||||
repeated?: AsnRepeatType;
|
||||
}
|
||||
export interface IAsnSchema {
|
||||
type: AsnTypeTypes;
|
||||
itemType: AsnPropTypes | IEmptyConstructor;
|
||||
items: {
|
||||
[key: string]: IAsnSchemaItem;
|
||||
};
|
||||
schema?: AsnSchemaType;
|
||||
}
|
||||
export type AsnSchemaType = asn1js.Sequence | asn1js.Set | asn1js.Choice;
|
||||
export declare class AsnSchemaStorage {
|
||||
protected items: WeakMap<object, IAsnSchema>;
|
||||
has(target: object): boolean;
|
||||
get(target: IEmptyConstructor, checkSchema: true): IAsnSchema & Required<Pick<IAsnSchema, "schema">>;
|
||||
get(target: IEmptyConstructor, checkSchema?: false): IAsnSchema;
|
||||
cache(target: IEmptyConstructor): void;
|
||||
createDefault(target: object): IAsnSchema;
|
||||
create(target: object, useNames: boolean): AsnSchemaType;
|
||||
set(target: object, schema: IAsnSchema): this;
|
||||
protected findParentSchema(target: object): IAsnSchema | null;
|
||||
}
|
||||
17
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/serializer.d.ts
generated
vendored
Normal file
17
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/serializer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as asn1js from "asn1js";
|
||||
/**
|
||||
* Serializes objects into ASN.1 encoded data
|
||||
*/
|
||||
export declare class AsnSerializer {
|
||||
/**
|
||||
* Serializes an object to the ASN.1 encoded buffer
|
||||
* @param obj The object to serialize
|
||||
*/
|
||||
static serialize(obj: unknown): ArrayBuffer;
|
||||
/**
|
||||
* Serialize an object to the asn1js object
|
||||
* @param obj The object to serialize
|
||||
*/
|
||||
static toASN(obj: unknown): asn1js.AsnType;
|
||||
private static toAsnItem;
|
||||
}
|
||||
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/storage.d.ts
generated
vendored
Normal file
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/storage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { AsnSchemaStorage } from "./schema";
|
||||
export declare const schemaStorage: AsnSchemaStorage;
|
||||
35
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types.d.ts
generated
vendored
Normal file
35
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* ASN1 type
|
||||
*/
|
||||
import * as asn1js from "asn1js";
|
||||
export interface IEmptyConstructor<T = unknown> {
|
||||
new (): T;
|
||||
}
|
||||
/**
|
||||
* Allows to convert ASN.1 object to JS value and back
|
||||
*/
|
||||
export interface IAsnConverter<T = unknown, AsnType = asn1js.AsnType> {
|
||||
/**
|
||||
* Returns JS value from ASN.1 object
|
||||
* @param value ASN.1 object from asn1js module
|
||||
*/
|
||||
fromASN(value: AsnType): T;
|
||||
/**
|
||||
* Returns ASN.1 object from JS value
|
||||
* @param value JS value
|
||||
*/
|
||||
toASN(value: T): AsnType;
|
||||
}
|
||||
export type IntegerConverterType = string | number;
|
||||
export type AnyConverterType = ArrayBuffer | null;
|
||||
/**
|
||||
* Allows an object to control its own ASN.1 serialization and deserialization
|
||||
*/
|
||||
export interface IAsnConvertible<T = asn1js.AsnType> {
|
||||
fromASN(asn: T): this;
|
||||
toASN(): T;
|
||||
toSchema(name: string): asn1js.BaseBlock;
|
||||
}
|
||||
export interface IAsnConvertibleConstructor {
|
||||
new (): IAsnConvertible;
|
||||
}
|
||||
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/bit_string.d.ts
generated
vendored
Normal file
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/bit_string.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { BufferSource } from "pvtsutils";
|
||||
import { IAsnConvertible } from "../types";
|
||||
export declare class BitString<T extends number = number> implements IAsnConvertible {
|
||||
unusedBits: number;
|
||||
value: ArrayBuffer;
|
||||
constructor();
|
||||
constructor(value: T);
|
||||
constructor(value: BufferSource, unusedBits?: number);
|
||||
fromASN(asn: asn1js.BitString): this;
|
||||
toASN(): asn1js.BitString;
|
||||
toSchema(name: string): asn1js.BitString;
|
||||
toNumber(): T;
|
||||
fromNumber(value: T): void;
|
||||
}
|
||||
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/index.d.ts
generated
vendored
Normal file
2
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./bit_string";
|
||||
export * from "./octet_string";
|
||||
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/octet_string.d.ts
generated
vendored
Normal file
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/build/types/types/octet_string.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as asn1js from "asn1js";
|
||||
import { BufferSource } from "pvtsutils";
|
||||
import { IAsnConvertible } from "../types";
|
||||
export declare class OctetString implements IAsnConvertible, ArrayBufferView {
|
||||
buffer: ArrayBuffer;
|
||||
get byteLength(): number;
|
||||
get byteOffset(): number;
|
||||
constructor();
|
||||
constructor(byteLength: number);
|
||||
constructor(bytes: number[]);
|
||||
constructor(bytes: BufferSource);
|
||||
fromASN(asn: asn1js.OctetString): this;
|
||||
toASN(): asn1js.OctetString;
|
||||
toSchema(name: string): asn1js.OctetString;
|
||||
}
|
||||
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
15
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/CopyrightNotice.txt
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
12
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
12
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
164
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/README.md
generated
vendored
Normal file
164
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/README.md
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
# tslib
|
||||
|
||||
This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
|
||||
|
||||
This library is primarily used by the `--importHelpers` flag in TypeScript.
|
||||
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
|
||||
|
||||
```ts
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
exports.x = {};
|
||||
exports.y = __assign({}, exports.x);
|
||||
|
||||
```
|
||||
|
||||
will instead be emitted as something like the following:
|
||||
|
||||
```ts
|
||||
var tslib_1 = require("tslib");
|
||||
exports.x = {};
|
||||
exports.y = tslib_1.__assign({}, exports.x);
|
||||
```
|
||||
|
||||
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
|
||||
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
|
||||
|
||||
# Installing
|
||||
|
||||
For the latest stable version, run:
|
||||
|
||||
## npm
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
npm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
npm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
npm install tslib@1.6.1
|
||||
```
|
||||
|
||||
## yarn
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
yarn add tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
yarn add tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
yarn add tslib@1.6.1
|
||||
```
|
||||
|
||||
## bower
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
bower install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
bower install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
bower install tslib@1.6.1
|
||||
```
|
||||
|
||||
## JSPM
|
||||
|
||||
```sh
|
||||
# TypeScript 3.9.2 or later
|
||||
jspm install tslib
|
||||
|
||||
# TypeScript 3.8.4 or earlier
|
||||
jspm install tslib@^1
|
||||
|
||||
# TypeScript 2.3.2 or earlier
|
||||
jspm install tslib@1.6.1
|
||||
```
|
||||
|
||||
# Usage
|
||||
|
||||
Set the `importHelpers` compiler option on the command line:
|
||||
|
||||
```
|
||||
tsc --importHelpers file.ts
|
||||
```
|
||||
|
||||
or in your tsconfig.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"importHelpers": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### For bower and JSPM users
|
||||
|
||||
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "amd",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["bower_components/tslib/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For JSPM users:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "system",
|
||||
"importHelpers": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
- Choose your new version number
|
||||
- Set it in `package.json` and `bower.json`
|
||||
- Create a tag: `git tag [version]`
|
||||
- Push the tag: `git push --tags`
|
||||
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
|
||||
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow
|
||||
|
||||
Done.
|
||||
|
||||
# Contribute
|
||||
|
||||
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
|
||||
|
||||
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
||||
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
|
||||
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
|
||||
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
|
||||
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
||||
|
||||
# Documentation
|
||||
|
||||
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
|
||||
* [Programming handbook](http://www.typescriptlang.org/Handbook)
|
||||
* [Homepage](http://www.typescriptlang.org/)
|
||||
41
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
41
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
38
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
38
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Note: named reexports are used instead of `export *` because
|
||||
// TypeScript itself doesn't resolve the `export *` when checking
|
||||
// if a particular helper exists.
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__createBinding,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension,
|
||||
} from '../tslib.js';
|
||||
export * as default from '../tslib.js';
|
||||
70
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/index.js
generated
vendored
Normal file
70
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/index.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
import tslib from '../tslib.js';
|
||||
const {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension,
|
||||
} = tslib;
|
||||
export {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__exportStar,
|
||||
__createBinding,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension,
|
||||
};
|
||||
export default tslib;
|
||||
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/package.json
generated
vendored
Normal file
3
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/modules/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
47
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/package.json
generated
vendored
Normal file
47
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "tslib",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "2.8.1",
|
||||
"license": "0BSD",
|
||||
"description": "Runtime library for TypeScript helper functions",
|
||||
"keywords": [
|
||||
"TypeScript",
|
||||
"Microsoft",
|
||||
"compiler",
|
||||
"language",
|
||||
"javascript",
|
||||
"tslib",
|
||||
"runtime"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/TypeScript/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/tslib.git"
|
||||
},
|
||||
"main": "tslib.js",
|
||||
"module": "tslib.es6.js",
|
||||
"jsnext:main": "tslib.es6.js",
|
||||
"typings": "tslib.d.ts",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"module": {
|
||||
"types": "./modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
},
|
||||
"import": {
|
||||
"node": "./modules/index.js",
|
||||
"default": {
|
||||
"types": "./modules/index.d.ts",
|
||||
"default": "./tslib.es6.mjs"
|
||||
}
|
||||
},
|
||||
"default": "./tslib.js"
|
||||
},
|
||||
"./*": "./*",
|
||||
"./": "./"
|
||||
}
|
||||
}
|
||||
460
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
460
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.d.ts
generated
vendored
Normal file
@@ -0,0 +1,460 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
/**
|
||||
* Used to shim class extends.
|
||||
*
|
||||
* @param d The derived class.
|
||||
* @param b The base class.
|
||||
*/
|
||||
export declare function __extends(d: Function, b: Function): void;
|
||||
|
||||
/**
|
||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
||||
* target object. Returns the target object.
|
||||
*
|
||||
* @param t The target object to copy to.
|
||||
* @param sources One or more source objects from which to copy properties
|
||||
*/
|
||||
export declare function __assign(t: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Performs a rest spread on an object.
|
||||
*
|
||||
* @param t The source value.
|
||||
* @param propertyNames The property names excluded from the rest spread.
|
||||
*/
|
||||
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
|
||||
|
||||
/**
|
||||
* Applies decorators to a target object
|
||||
*
|
||||
* @param decorators The set of decorators to apply.
|
||||
* @param target The target object.
|
||||
* @param key If specified, the own property to apply the decorators to.
|
||||
* @param desc The property descriptor, defaults to fetching the descriptor from the target object.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
|
||||
|
||||
/**
|
||||
* Creates an observing function decorator from a parameter decorator.
|
||||
*
|
||||
* @param paramIndex The parameter index to apply the decorator to.
|
||||
* @param decorator The parameter decorator to apply. Note that the return value is ignored.
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __param(paramIndex: number, decorator: Function): Function;
|
||||
|
||||
/**
|
||||
* Applies decorators to a class or class member, following the native ECMAScript decorator specification.
|
||||
* @param ctor For non-field class members, the class constructor. Otherwise, `null`.
|
||||
* @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`.
|
||||
* @param decorators The decorators to apply
|
||||
* @param contextIn The `DecoratorContext` to clone for each decorator application.
|
||||
* @param initializers An array of field initializer mutation functions into which new initializers are written.
|
||||
* @param extraInitializers An array of extra initializer functions into which new initializers are written.
|
||||
*/
|
||||
export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void;
|
||||
|
||||
/**
|
||||
* Runs field initializers or extra initializers generated by `__esDecorate`.
|
||||
* @param thisArg The `this` argument to use.
|
||||
* @param initializers The array of initializers to evaluate.
|
||||
* @param value The initial value to pass to the initializers.
|
||||
*/
|
||||
export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any;
|
||||
|
||||
/**
|
||||
* Converts a computed property name into a `string` or `symbol` value.
|
||||
*/
|
||||
export declare function __propKey(x: any): string | symbol;
|
||||
|
||||
/**
|
||||
* Assigns the name of a function derived from the left-hand side of an assignment.
|
||||
* @param f The function to rename.
|
||||
* @param name The new name for the function.
|
||||
* @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name.
|
||||
*/
|
||||
export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function;
|
||||
|
||||
/**
|
||||
* Creates a decorator that sets metadata.
|
||||
*
|
||||
* @param metadataKey The metadata key
|
||||
* @param metadataValue The metadata value
|
||||
* @experimental
|
||||
*/
|
||||
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
|
||||
|
||||
/**
|
||||
* Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param P The optional promise constructor argument, defaults to the `Promise` property of the global object.
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Creates an Iterator object using the body as the implementation.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the function
|
||||
* @param body The generator state-machine based implementation.
|
||||
*
|
||||
* @see [./docs/generator.md]
|
||||
*/
|
||||
export declare function __generator(thisArg: any, body: Function): any;
|
||||
|
||||
/**
|
||||
* Creates bindings for all enumerable properties of `m` on `exports`
|
||||
*
|
||||
* @param m The source object
|
||||
* @param o The `exports` object.
|
||||
*/
|
||||
export declare function __exportStar(m: any, o: any): void;
|
||||
|
||||
/**
|
||||
* Creates a value iterator from an `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __values(o: any): any;
|
||||
|
||||
/**
|
||||
* Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array.
|
||||
*
|
||||
* @param o The object to read from.
|
||||
* @param n The maximum number of arguments to read, defaults to `Infinity`.
|
||||
*/
|
||||
export declare function __read(o: any, n?: number): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from iterable spread.
|
||||
*
|
||||
* @param args The Iterable objects to spread.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spread(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Creates an array from array spread.
|
||||
*
|
||||
* @param args The ArrayLikes to spread into the resulting array.
|
||||
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
|
||||
*/
|
||||
export declare function __spreadArrays(...args: any[][]): any[];
|
||||
|
||||
/**
|
||||
* Spreads the `from` array into the `to` array.
|
||||
*
|
||||
* @param pack Replace empty elements with `undefined`.
|
||||
*/
|
||||
export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[];
|
||||
|
||||
/**
|
||||
* Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded,
|
||||
* and instead should be awaited and the resulting value passed back to the generator.
|
||||
*
|
||||
* @param v The value to await.
|
||||
*/
|
||||
export declare function __await(v: any): any;
|
||||
|
||||
/**
|
||||
* Converts a generator function into an async generator function, by using `yield __await`
|
||||
* in place of normal `await`.
|
||||
*
|
||||
* @param thisArg The reference to use as the `this` value in the generator function
|
||||
* @param _arguments The optional arguments array
|
||||
* @param generator The generator function
|
||||
*/
|
||||
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
|
||||
|
||||
/**
|
||||
* Used to wrap a potentially async iterator in such a way so that it wraps the result
|
||||
* of calling iterator methods of `o` in `__await` instances, and then yields the awaited values.
|
||||
*
|
||||
* @param o The potentially async iterator.
|
||||
* @returns A synchronous iterator yielding `__await` instances on every odd invocation
|
||||
* and returning the awaited `IteratorResult` passed to `next` every even invocation.
|
||||
*/
|
||||
export declare function __asyncDelegator(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object.
|
||||
*
|
||||
* @param o The object.
|
||||
* @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`.
|
||||
*/
|
||||
export declare function __asyncValues(o: any): any;
|
||||
|
||||
/**
|
||||
* Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays.
|
||||
*
|
||||
* @param cooked The cooked possibly-sparse array.
|
||||
* @param raw The raw string content.
|
||||
*/
|
||||
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
|
||||
|
||||
/**
|
||||
* Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default, { Named, Other } from "mod";
|
||||
* // or
|
||||
* import { default as Default, Named, Other } from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importStar<T>(mod: T): T;
|
||||
|
||||
/**
|
||||
* Used to shim default imports in ECMAScript Modules transpiled to CommonJS.
|
||||
*
|
||||
* ```js
|
||||
* import Default from "mod";
|
||||
* ```
|
||||
*
|
||||
* @param mod The CommonJS module exports object.
|
||||
*/
|
||||
export declare function __importDefault<T>(mod: T): T | { default: T };
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance field.
|
||||
*
|
||||
* @param receiver The instance from which to read the private field.
|
||||
* @param state A WeakMap containing the private field value for an instance.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, get(o: T): V | undefined },
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static field.
|
||||
*
|
||||
* @param receiver The object from which to read the private static field.
|
||||
* @param state The class constructor containing the definition of the static field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private instance "get" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private "get" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates evaluating a private static "get" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "get" accessor.
|
||||
* @param state The class constructor containing the definition of the static "get" accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "get" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "a",
|
||||
f: () => V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private instance method.
|
||||
*
|
||||
* @param receiver The instance from which to read a private method.
|
||||
* @param state A WeakSet used to verify an instance supports the private method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private instance method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends object, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates reading a private static method.
|
||||
*
|
||||
* @param receiver The object from which to read the private static method.
|
||||
* @param state The class constructor containing the definition of the static method.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The function to return as the private static method.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V extends (...args: any[]) => unknown>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
kind: "m",
|
||||
f: V
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance field.
|
||||
*
|
||||
* @param receiver The instance on which to set a private field value.
|
||||
* @param state A WeakMap used to store the private field value for an instance.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean, set(o: T, value: V): unknown },
|
||||
value: V,
|
||||
kind?: "f"
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static field.
|
||||
*
|
||||
* @param receiver The object on which to set the private static field.
|
||||
* @param state The class constructor containing the definition of the private static field.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The descriptor that holds the static field value.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "f",
|
||||
f: { value: V }
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private instance "set" accessor.
|
||||
*
|
||||
* @param receiver The instance on which to evaluate the private instance "set" accessor.
|
||||
* @param state A WeakSet used to verify an instance supports the private "set" accessor.
|
||||
* @param value The value to store in the private accessor.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends object, V>(
|
||||
receiver: T,
|
||||
state: { has(o: T): boolean },
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Emulates writing to a private static "set" accessor.
|
||||
*
|
||||
* @param receiver The object on which to evaluate the private static "set" accessor.
|
||||
* @param state The class constructor containing the definition of the static "set" accessor.
|
||||
* @param value The value to store in the private field.
|
||||
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
|
||||
* @param f The "set" accessor function to evaluate.
|
||||
*
|
||||
* @throws {TypeError} If `receiver` is not `state`.
|
||||
*/
|
||||
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
|
||||
receiver: T,
|
||||
state: T,
|
||||
value: V,
|
||||
kind: "a",
|
||||
f: (v: V) => void
|
||||
): V;
|
||||
|
||||
/**
|
||||
* Checks for the existence of a private field/method/accessor.
|
||||
*
|
||||
* @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member.
|
||||
* @param receiver The object for which to test the presence of the private member.
|
||||
*/
|
||||
export declare function __classPrivateFieldIn(
|
||||
state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
|
||||
receiver: unknown,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Creates a re-export binding on `object` with key `objectKey` that references `target[key]`.
|
||||
*
|
||||
* @param object The local `exports` object.
|
||||
* @param target The object to re-export from.
|
||||
* @param key The property key of `target` to re-export.
|
||||
* @param objectKey The property key to re-export as. Defaults to `key`.
|
||||
*/
|
||||
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
|
||||
|
||||
/**
|
||||
* Adds a disposable resource to a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`.
|
||||
* @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added.
|
||||
* @returns The {@link value} argument.
|
||||
*
|
||||
* @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not
|
||||
* defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method.
|
||||
*/
|
||||
export declare function __addDisposableResource<T>(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T;
|
||||
|
||||
/**
|
||||
* Disposes all resources in a resource-tracking environment object.
|
||||
* @param env A resource-tracking environment object.
|
||||
* @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`.
|
||||
*
|
||||
* @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the
|
||||
* error recorded in the resource-tracking environment object.
|
||||
* @seealso {@link __addDisposableResource}
|
||||
*/
|
||||
export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any;
|
||||
|
||||
/**
|
||||
* Transforms a relative import specifier ending in a non-declaration TypeScript file extension to its JavaScript file extension counterpart.
|
||||
* @param path The import specifier.
|
||||
* @param preserveJsx Causes '*.tsx' to transform to '*.jsx' instead of '*.js'. Should be true when `--jsx` is set to `preserve`.
|
||||
*/
|
||||
export declare function __rewriteRelativeImportExtension(path: string, preserveJsx?: boolean): string;
|
||||
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.html
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<script src="tslib.es6.js"></script>
|
||||
402
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
402
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.js
generated
vendored
Normal file
@@ -0,0 +1,402 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
export function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export function __rewriteRelativeImportExtension(path, preserveJsx) {
|
||||
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
||||
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
||||
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
||||
});
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends: __extends,
|
||||
__assign: __assign,
|
||||
__rest: __rest,
|
||||
__decorate: __decorate,
|
||||
__param: __param,
|
||||
__esDecorate: __esDecorate,
|
||||
__runInitializers: __runInitializers,
|
||||
__propKey: __propKey,
|
||||
__setFunctionName: __setFunctionName,
|
||||
__metadata: __metadata,
|
||||
__awaiter: __awaiter,
|
||||
__generator: __generator,
|
||||
__createBinding: __createBinding,
|
||||
__exportStar: __exportStar,
|
||||
__values: __values,
|
||||
__read: __read,
|
||||
__spread: __spread,
|
||||
__spreadArrays: __spreadArrays,
|
||||
__spreadArray: __spreadArray,
|
||||
__await: __await,
|
||||
__asyncGenerator: __asyncGenerator,
|
||||
__asyncDelegator: __asyncDelegator,
|
||||
__asyncValues: __asyncValues,
|
||||
__makeTemplateObject: __makeTemplateObject,
|
||||
__importStar: __importStar,
|
||||
__importDefault: __importDefault,
|
||||
__classPrivateFieldGet: __classPrivateFieldGet,
|
||||
__classPrivateFieldSet: __classPrivateFieldSet,
|
||||
__classPrivateFieldIn: __classPrivateFieldIn,
|
||||
__addDisposableResource: __addDisposableResource,
|
||||
__disposeResources: __disposeResources,
|
||||
__rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
|
||||
};
|
||||
401
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
401
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.es6.mjs
generated
vendored
Normal file
@@ -0,0 +1,401 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
||||
|
||||
var extendStatics = function(d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
|
||||
export function __extends(d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
}
|
||||
|
||||
export var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return __assign.apply(this, arguments);
|
||||
}
|
||||
|
||||
export function __rest(s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
export function __decorate(decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
}
|
||||
|
||||
export function __param(paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
}
|
||||
|
||||
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
export function __runInitializers(thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
export function __propKey(x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
export function __setFunctionName(f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
export function __metadata(metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
}
|
||||
|
||||
export function __awaiter(thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
}
|
||||
|
||||
export function __generator(thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
}
|
||||
|
||||
export var __createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
export function __exportStar(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
}
|
||||
|
||||
export function __values(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
}
|
||||
|
||||
export function __read(o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spread() {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export function __spreadArrays() {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
}
|
||||
|
||||
export function __spreadArray(to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
}
|
||||
|
||||
export function __await(v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
}
|
||||
|
||||
export function __asyncGenerator(thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
}
|
||||
|
||||
export function __asyncDelegator(o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
}
|
||||
|
||||
export function __asyncValues(o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
}
|
||||
|
||||
export function __makeTemplateObject(cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
|
||||
export function __importStar(mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
}
|
||||
|
||||
export function __importDefault(mod) {
|
||||
return (mod && mod.__esModule) ? mod : { default: mod };
|
||||
}
|
||||
|
||||
export function __classPrivateFieldGet(receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
}
|
||||
|
||||
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
}
|
||||
|
||||
export function __classPrivateFieldIn(state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
}
|
||||
|
||||
export function __addDisposableResource(env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
export function __disposeResources(env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
export function __rewriteRelativeImportExtension(path, preserveJsx) {
|
||||
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
||||
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
||||
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
||||
});
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
export default {
|
||||
__extends,
|
||||
__assign,
|
||||
__rest,
|
||||
__decorate,
|
||||
__param,
|
||||
__esDecorate,
|
||||
__runInitializers,
|
||||
__propKey,
|
||||
__setFunctionName,
|
||||
__metadata,
|
||||
__awaiter,
|
||||
__generator,
|
||||
__createBinding,
|
||||
__exportStar,
|
||||
__values,
|
||||
__read,
|
||||
__spread,
|
||||
__spreadArrays,
|
||||
__spreadArray,
|
||||
__await,
|
||||
__asyncGenerator,
|
||||
__asyncDelegator,
|
||||
__asyncValues,
|
||||
__makeTemplateObject,
|
||||
__importStar,
|
||||
__importDefault,
|
||||
__classPrivateFieldGet,
|
||||
__classPrivateFieldSet,
|
||||
__classPrivateFieldIn,
|
||||
__addDisposableResource,
|
||||
__disposeResources,
|
||||
__rewriteRelativeImportExtension,
|
||||
};
|
||||
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.html
generated
vendored
Normal file
1
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.html
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<script src="tslib.js"></script>
|
||||
484
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.js
generated
vendored
Normal file
484
api.hyungi.net/node_modules/@peculiar/asn1-schema/node_modules/tslib/tslib.js
generated
vendored
Normal file
@@ -0,0 +1,484 @@
|
||||
/******************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
|
||||
var __extends;
|
||||
var __assign;
|
||||
var __rest;
|
||||
var __decorate;
|
||||
var __param;
|
||||
var __esDecorate;
|
||||
var __runInitializers;
|
||||
var __propKey;
|
||||
var __setFunctionName;
|
||||
var __metadata;
|
||||
var __awaiter;
|
||||
var __generator;
|
||||
var __exportStar;
|
||||
var __values;
|
||||
var __read;
|
||||
var __spread;
|
||||
var __spreadArrays;
|
||||
var __spreadArray;
|
||||
var __await;
|
||||
var __asyncGenerator;
|
||||
var __asyncDelegator;
|
||||
var __asyncValues;
|
||||
var __makeTemplateObject;
|
||||
var __importStar;
|
||||
var __importDefault;
|
||||
var __classPrivateFieldGet;
|
||||
var __classPrivateFieldSet;
|
||||
var __classPrivateFieldIn;
|
||||
var __createBinding;
|
||||
var __addDisposableResource;
|
||||
var __disposeResources;
|
||||
var __rewriteRelativeImportExtension;
|
||||
(function (factory) {
|
||||
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
|
||||
}
|
||||
else if (typeof module === "object" && typeof module.exports === "object") {
|
||||
factory(createExporter(root, createExporter(module.exports)));
|
||||
}
|
||||
else {
|
||||
factory(createExporter(root));
|
||||
}
|
||||
function createExporter(exports, previous) {
|
||||
if (exports !== root) {
|
||||
if (typeof Object.create === "function") {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
}
|
||||
else {
|
||||
exports.__esModule = true;
|
||||
}
|
||||
}
|
||||
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
|
||||
}
|
||||
})
|
||||
(function (exporter) {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
|
||||
__extends = function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
|
||||
__assign = Object.assign || function (t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__rest = function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
||||
t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
||||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
||||
t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
||||
__decorate = function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
|
||||
__param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
|
||||
__esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
||||
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
||||
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
||||
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
||||
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
||||
var _, done = false;
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
var context = {};
|
||||
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
||||
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
||||
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
||||
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
||||
if (kind === "accessor") {
|
||||
if (result === void 0) continue;
|
||||
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
||||
if (_ = accept(result.get)) descriptor.get = _;
|
||||
if (_ = accept(result.set)) descriptor.set = _;
|
||||
if (_ = accept(result.init)) initializers.unshift(_);
|
||||
}
|
||||
else if (_ = accept(result)) {
|
||||
if (kind === "field") initializers.unshift(_);
|
||||
else descriptor[key] = _;
|
||||
}
|
||||
}
|
||||
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
||||
done = true;
|
||||
};
|
||||
|
||||
__runInitializers = function (thisArg, initializers, value) {
|
||||
var useValue = arguments.length > 2;
|
||||
for (var i = 0; i < initializers.length; i++) {
|
||||
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
||||
}
|
||||
return useValue ? value : void 0;
|
||||
};
|
||||
|
||||
__propKey = function (x) {
|
||||
return typeof x === "symbol" ? x : "".concat(x);
|
||||
};
|
||||
|
||||
__setFunctionName = function (f, name, prefix) {
|
||||
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
||||
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
||||
};
|
||||
|
||||
__metadata = function (metadataKey, metadataValue) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
||||
};
|
||||
|
||||
__awaiter = function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
|
||||
__generator = function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
|
||||
__exportStar = function(m, o) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
||||
};
|
||||
|
||||
__createBinding = Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
});
|
||||
|
||||
__values = function (o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
|
||||
__read = function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spread = function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++)
|
||||
ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
|
||||
/** @deprecated */
|
||||
__spreadArrays = function () {
|
||||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
||||
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
||||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
||||
r[k] = a[j];
|
||||
return r;
|
||||
};
|
||||
|
||||
__spreadArray = function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
|
||||
__await = function (v) {
|
||||
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
||||
};
|
||||
|
||||
__asyncGenerator = function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
||||
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
|
||||
__asyncDelegator = function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
||||
};
|
||||
|
||||
__asyncValues = function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
|
||||
__makeTemplateObject = function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
|
||||
var __setModuleDefault = Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
};
|
||||
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
|
||||
__importStar = function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
|
||||
__importDefault = function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
|
||||
__classPrivateFieldGet = function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
|
||||
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
|
||||
__classPrivateFieldIn = function (state, receiver) {
|
||||
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
||||
return typeof state === "function" ? receiver === state : state.has(receiver);
|
||||
};
|
||||
|
||||
__addDisposableResource = function (env, value, async) {
|
||||
if (value !== null && value !== void 0) {
|
||||
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
||||
var dispose, inner;
|
||||
if (async) {
|
||||
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
||||
dispose = value[Symbol.asyncDispose];
|
||||
}
|
||||
if (dispose === void 0) {
|
||||
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
||||
dispose = value[Symbol.dispose];
|
||||
if (async) inner = dispose;
|
||||
}
|
||||
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
||||
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
||||
env.stack.push({ value: value, dispose: dispose, async: async });
|
||||
}
|
||||
else if (async) {
|
||||
env.stack.push({ async: true });
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
||||
var e = new Error(message);
|
||||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
||||
};
|
||||
|
||||
__disposeResources = function (env) {
|
||||
function fail(e) {
|
||||
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
||||
env.hasError = true;
|
||||
}
|
||||
var r, s = 0;
|
||||
function next() {
|
||||
while (r = env.stack.pop()) {
|
||||
try {
|
||||
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
||||
if (r.dispose) {
|
||||
var result = r.dispose.call(r.value);
|
||||
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
||||
}
|
||||
else s |= 1;
|
||||
}
|
||||
catch (e) {
|
||||
fail(e);
|
||||
}
|
||||
}
|
||||
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
||||
if (env.hasError) throw env.error;
|
||||
}
|
||||
return next();
|
||||
};
|
||||
|
||||
__rewriteRelativeImportExtension = function (path, preserveJsx) {
|
||||
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
||||
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
||||
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
||||
});
|
||||
}
|
||||
return path;
|
||||
};
|
||||
|
||||
exporter("__extends", __extends);
|
||||
exporter("__assign", __assign);
|
||||
exporter("__rest", __rest);
|
||||
exporter("__decorate", __decorate);
|
||||
exporter("__param", __param);
|
||||
exporter("__esDecorate", __esDecorate);
|
||||
exporter("__runInitializers", __runInitializers);
|
||||
exporter("__propKey", __propKey);
|
||||
exporter("__setFunctionName", __setFunctionName);
|
||||
exporter("__metadata", __metadata);
|
||||
exporter("__awaiter", __awaiter);
|
||||
exporter("__generator", __generator);
|
||||
exporter("__exportStar", __exportStar);
|
||||
exporter("__createBinding", __createBinding);
|
||||
exporter("__values", __values);
|
||||
exporter("__read", __read);
|
||||
exporter("__spread", __spread);
|
||||
exporter("__spreadArrays", __spreadArrays);
|
||||
exporter("__spreadArray", __spreadArray);
|
||||
exporter("__await", __await);
|
||||
exporter("__asyncGenerator", __asyncGenerator);
|
||||
exporter("__asyncDelegator", __asyncDelegator);
|
||||
exporter("__asyncValues", __asyncValues);
|
||||
exporter("__makeTemplateObject", __makeTemplateObject);
|
||||
exporter("__importStar", __importStar);
|
||||
exporter("__importDefault", __importDefault);
|
||||
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
||||
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
||||
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
||||
exporter("__addDisposableResource", __addDisposableResource);
|
||||
exporter("__disposeResources", __disposeResources);
|
||||
exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
|
||||
});
|
||||
|
||||
0 && (module.exports = {
|
||||
__extends: __extends,
|
||||
__assign: __assign,
|
||||
__rest: __rest,
|
||||
__decorate: __decorate,
|
||||
__param: __param,
|
||||
__esDecorate: __esDecorate,
|
||||
__runInitializers: __runInitializers,
|
||||
__propKey: __propKey,
|
||||
__setFunctionName: __setFunctionName,
|
||||
__metadata: __metadata,
|
||||
__awaiter: __awaiter,
|
||||
__generator: __generator,
|
||||
__exportStar: __exportStar,
|
||||
__createBinding: __createBinding,
|
||||
__values: __values,
|
||||
__read: __read,
|
||||
__spread: __spread,
|
||||
__spreadArrays: __spreadArrays,
|
||||
__spreadArray: __spreadArray,
|
||||
__await: __await,
|
||||
__asyncGenerator: __asyncGenerator,
|
||||
__asyncDelegator: __asyncDelegator,
|
||||
__asyncValues: __asyncValues,
|
||||
__makeTemplateObject: __makeTemplateObject,
|
||||
__importStar: __importStar,
|
||||
__importDefault: __importDefault,
|
||||
__classPrivateFieldGet: __classPrivateFieldGet,
|
||||
__classPrivateFieldSet: __classPrivateFieldSet,
|
||||
__classPrivateFieldIn: __classPrivateFieldIn,
|
||||
__addDisposableResource: __addDisposableResource,
|
||||
__disposeResources: __disposeResources,
|
||||
__rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
|
||||
});
|
||||
56
api.hyungi.net/node_modules/@peculiar/asn1-schema/package.json
generated
vendored
Normal file
56
api.hyungi.net/node_modules/@peculiar/asn1-schema/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "@peculiar/asn1-schema",
|
||||
"version": "2.3.15",
|
||||
"description": "Decorators for ASN.1 schemas building",
|
||||
"files": [
|
||||
"build/**/*.{js,d.ts}",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/PeculiarVentures/asn1-schema/issues"
|
||||
},
|
||||
"homepage": "https://github.com/PeculiarVentures/asn1-schema/tree/master/packages/schema#readme",
|
||||
"keywords": [
|
||||
"asn",
|
||||
"serialize",
|
||||
"parse",
|
||||
"convert",
|
||||
"decorator"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "PeculiarVentures, LLC",
|
||||
"main": "build/cjs/index.js",
|
||||
"module": "build/es2015/index.js",
|
||||
"types": "build/types/index.d.ts",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"clear": "rimraf build",
|
||||
"build": "npm run build:module && npm run build:types",
|
||||
"build:module": "npm run build:cjs && npm run build:es2015",
|
||||
"build:cjs": "tsc -p tsconfig.compile.json --removeComments --module commonjs --outDir build/cjs",
|
||||
"build:es2015": "tsc -p tsconfig.compile.json --removeComments --module ES2015 --outDir build/es2015",
|
||||
"prebuild:types": "rimraf build/types",
|
||||
"build:types": "tsc -p tsconfig.compile.json --outDir build/types --declaration --emitDeclarationOnly",
|
||||
"rebuild": "npm run clear && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"asn1js": "^3.0.5",
|
||||
"pvtsutils": "^1.3.6",
|
||||
"tslib": "^2.8.1"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"email": "rmh@unmitigatedrisk.com",
|
||||
"name": "Ryan Hurst"
|
||||
},
|
||||
{
|
||||
"email": "microshine@mail.ru",
|
||||
"name": "Miroshin Stepan"
|
||||
}
|
||||
],
|
||||
"gitHead": "b6c7130efa9bc3ee5e2ea1da5d01aede5182921f"
|
||||
}
|
||||
Reference in New Issue
Block a user