update electron to v43

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View 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();
}
}