diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/@webassemblyjs/utf8/lib | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/@webassemblyjs/utf8/lib')
-rw-r--r-- | node_modules/@webassemblyjs/utf8/lib/decoder.js | 102 | ||||
-rw-r--r-- | node_modules/@webassemblyjs/utf8/lib/encoder.js | 53 | ||||
-rw-r--r-- | node_modules/@webassemblyjs/utf8/lib/index.js | 21 |
3 files changed, 0 insertions, 176 deletions
diff --git a/node_modules/@webassemblyjs/utf8/lib/decoder.js b/node_modules/@webassemblyjs/utf8/lib/decoder.js deleted file mode 100644 index 824c843..0000000 --- a/node_modules/@webassemblyjs/utf8/lib/decoder.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.decode = decode; - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } - -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) { - if (bytes.length === 0) { - return []; - } - /** - * 1 byte - */ - - - { - var _bytes = _toArray(bytes), - b1 = _bytes[0], - bs = _bytes.slice(1); - - if (b1 < 0x80) { - return [code(0x0, b1)].concat(_toConsumableArray(_decode(bs))); - } - - if (b1 < 0xc0) { - throw new Error("invalid UTF-8 encoding"); - } - } - /** - * 2 bytes - */ - - { - var _bytes2 = _toArray(bytes), - _b = _bytes2[0], - b2 = _bytes2[1], - _bs = _bytes2.slice(2); - - if (_b < 0xe0) { - return [code(0x80, ((_b & 0x1f) << 6) + con(b2))].concat(_toConsumableArray(_decode(_bs))); - } - } - /** - * 3 bytes - */ - - { - var _bytes3 = _toArray(bytes), - _b2 = _bytes3[0], - _b3 = _bytes3[1], - b3 = _bytes3[2], - _bs2 = _bytes3.slice(3); - - if (_b2 < 0xf0) { - return [code(0x800, ((_b2 & 0x0f) << 12) + (con(_b3) << 6) + con(b3))].concat(_toConsumableArray(_decode(_bs2))); - } - } - /** - * 4 bytes - */ - - { - var _bytes4 = _toArray(bytes), - _b4 = _bytes4[0], - _b5 = _bytes4[1], - _b6 = _bytes4[2], - b4 = _bytes4[3], - _bs3 = _bytes4.slice(4); - - if (_b4 < 0xf8) { - return [code(0x10000, (((_b4 & 0x07) << 18) + con(_b5) << 12) + (con(_b6) << 6) + con(b4))].concat(_toConsumableArray(_decode(_bs3))); - } - } - throw new Error("invalid UTF-8 encoding"); -}
\ 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 0606b56..0000000 --- a/node_modules/@webassemblyjs/utf8/lib/encoder.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.encode = encode; - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(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 fef9470..0000000 --- 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 |