summaryrefslogtreecommitdiff
path: root/node_modules/@webassemblyjs/utf8/lib
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:10:59 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-05-18 23:41:44 +0800
commitfc87c009806dcc98867f6b58efe29b042aa01dee (patch)
tree8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/@webassemblyjs/utf8/lib
parent3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff)
node: updatemain
Diffstat (limited to 'node_modules/@webassemblyjs/utf8/lib')
-rw-r--r--node_modules/@webassemblyjs/utf8/lib/decoder.js74
-rw-r--r--node_modules/@webassemblyjs/utf8/lib/encoder.js67
-rw-r--r--node_modules/@webassemblyjs/utf8/lib/index.js21
3 files changed, 0 insertions, 162 deletions
diff --git a/node_modules/@webassemblyjs/utf8/lib/decoder.js b/node_modules/@webassemblyjs/utf8/lib/decoder.js
deleted file mode 100644
index 305a2b6e..00000000
--- a/node_modules/@webassemblyjs/utf8/lib/decoder.js
+++ /dev/null
@@ -1,74 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.decode = decode;
-
-function con(b) {
- if ((b & 0xc0) === 0x80) {
- return b & 0x3f;
- } else {
- throw new Error("invalid UTF-8 encoding");
- }
-}
-
-function code(min, n) {
- if (n < min || 0xd800 <= n && n < 0xe000 || n >= 0x10000) {
- throw new Error("invalid UTF-8 encoding");
- } else {
- return n;
- }
-}
-
-function decode(bytes) {
- return _decode(bytes).map(function (x) {
- return String.fromCharCode(x);
- }).join("");
-}
-
-function _decode(bytes) {
- var result = [];
-
- while (bytes.length > 0) {
- var b1 = bytes[0];
-
- if (b1 < 0x80) {
- result.push(code(0x0, b1));
- bytes = bytes.slice(1);
- continue;
- }
-
- if (b1 < 0xc0) {
- throw new Error("invalid UTF-8 encoding");
- }
-
- var b2 = bytes[1];
-
- if (b1 < 0xe0) {
- result.push(code(0x80, ((b1 & 0x1f) << 6) + con(b2)));
- bytes = bytes.slice(2);
- continue;
- }
-
- var b3 = bytes[2];
-
- if (b1 < 0xf0) {
- result.push(code(0x800, ((b1 & 0x0f) << 12) + (con(b2) << 6) + con(b3)));
- bytes = bytes.slice(3);
- continue;
- }
-
- var b4 = bytes[3];
-
- if (b1 < 0xf8) {
- result.push(code(0x10000, (((b1 & 0x07) << 18) + con(b2) << 12) + (con(b3) << 6) + con(b4)));
- bytes = bytes.slice(4);
- continue;
- }
-
- throw new Error("invalid UTF-8 encoding");
- }
-
- return result;
-} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/utf8/lib/encoder.js b/node_modules/@webassemblyjs/utf8/lib/encoder.js
deleted file mode 100644
index 5ed0f03d..00000000
--- a/node_modules/@webassemblyjs/utf8/lib/encoder.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.encode = encode;
-
-function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
-
-function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-
-function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
-
-function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
-
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
-
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-function con(n) {
- return 0x80 | n & 0x3f;
-}
-
-function encode(str) {
- var arr = str.split("").map(function (x) {
- return x.charCodeAt(0);
- });
- return _encode(arr);
-}
-
-function _encode(arr) {
- if (arr.length === 0) {
- return [];
- }
-
- var _arr = _toArray(arr),
- n = _arr[0],
- ns = _arr.slice(1);
-
- if (n < 0) {
- throw new Error("utf8");
- }
-
- if (n < 0x80) {
- return [n].concat(_toConsumableArray(_encode(ns)));
- }
-
- if (n < 0x800) {
- return [0xc0 | n >>> 6, con(n)].concat(_toConsumableArray(_encode(ns)));
- }
-
- if (n < 0x10000) {
- return [0xe0 | n >>> 12, con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns)));
- }
-
- if (n < 0x110000) {
- return [0xf0 | n >>> 18, con(n >>> 12), con(n >>> 6), con(n)].concat(_toConsumableArray(_encode(ns)));
- }
-
- throw new Error("utf8");
-} \ No newline at end of file
diff --git a/node_modules/@webassemblyjs/utf8/lib/index.js b/node_modules/@webassemblyjs/utf8/lib/index.js
deleted file mode 100644
index fef94701..00000000
--- a/node_modules/@webassemblyjs/utf8/lib/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-Object.defineProperty(exports, "decode", {
- enumerable: true,
- get: function get() {
- return _decoder.decode;
- }
-});
-Object.defineProperty(exports, "encode", {
- enumerable: true,
- get: function get() {
- return _encoder.encode;
- }
-});
-
-var _decoder = require("./decoder");
-
-var _encoder = require("./encoder"); \ No newline at end of file