update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
22
electron/node_modules/@peculiar/asn1-schema/build/es2015/convert.js
generated
vendored
Normal file
22
electron/node_modules/@peculiar/asn1-schema/build/es2015/convert.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import * as asn1js from "asn1js";
|
||||
import { isBufferSource, toArrayBuffer, } from "@peculiar/utils/bytes";
|
||||
import { AsnParser } from "./parser.js";
|
||||
import { AsnSerializer } from "./serializer.js";
|
||||
export class AsnConvert {
|
||||
static serialize(obj) {
|
||||
return AsnSerializer.serialize(obj);
|
||||
}
|
||||
static parse(data, target, options) {
|
||||
return AsnParser.parse(data, target, options);
|
||||
}
|
||||
static toString(data, options) {
|
||||
const buf = isBufferSource(data)
|
||||
? toArrayBuffer(data)
|
||||
: AsnConvert.serialize(data);
|
||||
const asn = asn1js.fromBER(buf, options?.berOptions);
|
||||
if (asn.offset === -1) {
|
||||
throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`);
|
||||
}
|
||||
return asn.result.toString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue