Skip to content

Commit 54337ff

Browse files
committed
refactor: Use ES2019 lib and use BufferSource from pvtsutils
1 parent 642b7c4 commit 54337ff

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/HexBlock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { checkBufferParams } from "./internals/utils";
77

88
export interface IHexBlock {
99
isHexOnly: boolean;
10-
valueHex: BufferSource;
10+
valueHex: pvtsutils.BufferSource;
1111
}
1212

1313
export interface HexBlockJson extends Omit<IHexBlock, "valueHex"> {

src/internals/LocalBaseBlock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface LocalBaseBlockJson extends ILocalBaseBlock {
1313
}
1414

1515
export interface LocalBaseBlockParams extends Partial<ILocalBaseBlock> {
16-
valueBeforeDecode?: BufferSource;
16+
valueBeforeDecode?: pvtsutils.BufferSource;
1717
}
1818

1919
export interface LocalBaseBlockConstructor<T extends LocalBaseBlock = LocalBaseBlock> {

src/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export function localFromBER(inputBuffer: Uint8Array, inputOffset = 0, inputLeng
286286
* Major function for decoding ASN.1 BER array into internal library structures
287287
* @param inputBuffer ASN.1 BER encoded array of bytes
288288
*/
289-
export function fromBER(inputBuffer: BufferSource): FromBerResult {
289+
export function fromBER(inputBuffer: pvtsutils.BufferSource): FromBerResult {
290290
if (!inputBuffer.byteLength) {
291291
const result = new BaseBlock({}, ValueBlock);
292292
result.error = "Input buffer has zero length";

src/schema.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export type CompareSchemaResult = CompareSchemaSuccess | CompareSchemaFail;
3030
* @return Returns result of comparison
3131
*/
3232
export function compareSchema(root: AsnType, inputData: AsnType, inputSchema: AsnSchemaType): CompareSchemaResult {
33+
Buffer.from("");
3334
//#region Special case for Choice schema element type
3435
if (inputSchema instanceof Choice) {
3536
const choiceResult = false;
@@ -450,7 +451,7 @@ export function compareSchema(root: AsnType, inputData: AsnType, inputSchema: As
450451
* @return
451452
*/
452453

453-
export function verifySchema(inputBuffer: BufferSource, inputSchema: AsnSchemaType): CompareSchemaResult {
454+
export function verifySchema(inputBuffer: pvtsutils.BufferSource, inputSchema: AsnSchemaType): CompareSchemaResult {
454455
//#region Initial check
455456
if ((inputSchema instanceof Object) === false) {
456457
return {

tsconfig.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"compilerOptions": {
33
"target": "ES2019",
44
"module": "CommonJS",
5+
"lib": [
6+
"ES2019"
7+
],
58
"strict": true,
69
"importHelpers": true,
710
"noImplicitOverride": true,
811
"skipLibCheck": true,
912
"noErrorTruncation": true,
1013
"experimentalDecorators": true
11-
},
12-
"exclude": [
13-
"build/**/*.ts"
14-
]
14+
}
1515
}

0 commit comments

Comments
 (0)