Initial
This commit is contained in:
1
resources/app/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js
generated
vendored
Normal file
1
resources/app/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const fromUtf8 = (input) => new TextEncoder().encode(input);
|
||||
5
resources/app/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
generated
vendored
Normal file
5
resources/app/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { fromString } from "@smithy/util-buffer-from";
|
||||
export const fromUtf8 = (input) => {
|
||||
const buf = fromString(input, "utf8");
|
||||
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
||||
};
|
||||
3
resources/app/node_modules/@smithy/util-utf8/dist-es/index.js
generated
vendored
Normal file
3
resources/app/node_modules/@smithy/util-utf8/dist-es/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./fromUtf8";
|
||||
export * from "./toUint8Array";
|
||||
export * from "./toUtf8";
|
||||
10
resources/app/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
generated
vendored
Normal file
10
resources/app/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);
|
||||
};
|
||||
9
resources/app/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js
generated
vendored
Normal file
9
resources/app/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export const toUtf8 = (input) => {
|
||||
if (typeof input === "string") {
|
||||
return input;
|
||||
}
|
||||
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
||||
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
||||
}
|
||||
return new TextDecoder("utf-8").decode(input);
|
||||
};
|
||||
10
resources/app/node_modules/@smithy/util-utf8/dist-es/toUtf8.js
generated
vendored
Normal file
10
resources/app/node_modules/@smithy/util-utf8/dist-es/toUtf8.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { fromArrayBuffer } from "@smithy/util-buffer-from";
|
||||
export const toUtf8 = (input) => {
|
||||
if (typeof input === "string") {
|
||||
return input;
|
||||
}
|
||||
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
||||
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
||||
}
|
||||
return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
|
||||
};
|
||||
Reference in New Issue
Block a user