初始化环境文件
This commit is contained in:
10
node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
generated
vendored
Normal file
10
node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { fromUtf8 } from "./fromUtf8";
|
||||
export const toUint8Array = (data) => {
|
||||
if (typeof data === "string") {
|
||||
return fromUtf8(data);
|
||||
}
|
||||
if (ArrayBuffer.isView(data)) {
|
||||
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
||||
}
|
||||
return new Uint8Array(data);
|
||||
};
|
||||
Reference in New Issue
Block a user