diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-02-21 22:56:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 22:56:58 -0500 |
commit | 2f98c3e1a6fe5c0c4933ec38e91af842b1e78947 (patch) | |
tree | ebb9686f2d01f9ea547fe7ed4c8a7a4c51a6bd73 /cli/tsc | |
parent | 860b6cbd233760e867099960c4c69d3e28b9401b (diff) |
chore: remove base64 encoding code from typescript snapshot (#17862)
This code is no longer used because we use swc for this now.
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 138b24ba0..bd966f03b 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -93,43 +93,6 @@ delete Object.prototype.__proto__; } } - // deno-fmt-ignore - const base64abc = [ - "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", - "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", - "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", - "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", "+", "/", - ]; - - /** Taken from https://deno.land/std/encoding/base64.ts */ - function convertToBase64(data) { - const uint8 = core.encode(data); - let result = "", - i; - const l = uint8.length; - for (i = 2; i < l; i += 3) { - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; - result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; - result += base64abc[uint8[i] & 0x3f]; - } - if (i === l + 1) { - // 1 octet yet to write - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[(uint8[i - 2] & 0x03) << 4]; - result += "=="; - } - if (i === l) { - // 2 octets yet to write - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; - result += base64abc[(uint8[i - 1] & 0x0f) << 2]; - result += "="; - } - return result; - } - class SpecifierIsCjsCache { /** @type {Set<string>} */ #cache = new Set(); @@ -818,14 +781,6 @@ delete Object.prototype.__proto__; * @param {Request} request */ function exec({ config, debug: debugFlag, rootNames }) { - // https://github.com/microsoft/TypeScript/issues/49150 - ts.base64encode = function (host, input) { - if (host && host.base64encode) { - return host.base64encode(input); - } - return convertToBase64(input); - }; - setLogDebug(debugFlag, "TS"); performanceStart(); if (logDebug) { |