@dfinity/candid
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -70,2 +70,4 @@ /** | ||
*/ | ||
export declare function bufFromBufLike(bufLike: ArrayBuffer | Uint8Array | DataView | ArrayBufferView | ArrayBufferLike): ArrayBuffer; | ||
export declare function bufFromBufLike(bufLike: ArrayBuffer | Uint8Array | DataView | ArrayBufferView | ArrayBufferLike | [number] | number[] | { | ||
buffer: ArrayBuffer; | ||
}): ArrayBuffer; |
@@ -127,8 +127,11 @@ "use strict"; | ||
} | ||
if (Array.isArray(bufLike)) { | ||
return uint8ToBuf(new Uint8Array(bufLike)); | ||
} | ||
if ('buffer' in bufLike) { | ||
return bufLike.buffer; | ||
return bufFromBufLike(bufLike.buffer); | ||
} | ||
return new Uint8Array(bufLike); | ||
return uint8ToBuf(new Uint8Array(bufLike)); | ||
} | ||
exports.bufFromBufLike = bufFromBufLike; | ||
//# sourceMappingURL=buffer.js.map |
@@ -70,2 +70,4 @@ /** | ||
*/ | ||
export declare function bufFromBufLike(bufLike: ArrayBuffer | Uint8Array | DataView | ArrayBufferView | ArrayBufferLike): ArrayBuffer; | ||
export declare function bufFromBufLike(bufLike: ArrayBuffer | Uint8Array | DataView | ArrayBufferView | ArrayBufferLike | [number] | number[] | { | ||
buffer: ArrayBuffer; | ||
}): ArrayBuffer; |
@@ -119,7 +119,10 @@ /** | ||
} | ||
if (Array.isArray(bufLike)) { | ||
return uint8ToBuf(new Uint8Array(bufLike)); | ||
} | ||
if ('buffer' in bufLike) { | ||
return bufLike.buffer; | ||
return bufFromBufLike(bufLike.buffer); | ||
} | ||
return new Uint8Array(bufLike); | ||
return uint8ToBuf(new Uint8Array(bufLike)); | ||
} | ||
//# sourceMappingURL=buffer.js.map |
{ | ||
"name": "@dfinity/candid", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"author": "DFINITY Stiftung <sdk@dfinity.org>", | ||
@@ -51,3 +51,3 @@ "license": "Apache-2.0", | ||
"peerDependencies": { | ||
"@dfinity/principal": "^1.1.1" | ||
"@dfinity/principal": "^1.2.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
650535
6834