From 16378ce1c828e1847739575b5700c5d61c3e7129 Mon Sep 17 00:00:00 2001 From: Nadir Date: Sat, 23 Jan 2021 15:57:57 +0000 Subject: [PATCH] Refactor JS Code + Add support for Deno. --- README.md | 12 +++-- dist/bottomify.js | 117 ++++++++++++++++-------------------------- dist/bottomify.min.js | 2 +- package.json | 7 ++- src/bottomify.ts | 105 ++++++++++++++++++------------------- src/deno.ts | 53 +++++++++++++++++++ tsconfig.json | 7 +-- yarn.lock | 106 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 269 insertions(+), 140 deletions(-) create mode 100644 src/deno.ts diff --git a/README.md b/README.md index 7e2f6a9..a33a153 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,21 @@ ## Installation ### Node: + ```sh $ npm i bottomify # OR $ yarn add bottomify ``` +### Deno: + +```ts +import { encode, decode } from "https://deno.land/x/bottomify@0.2.0/deno.ts" +``` + ### Browser: + ```html @@ -29,7 +37,5 @@ $ yarn add bottomify ## Examples ```js -const bottomify = require("bottomify") - -console.log(bottomify.encode("Hello World!")) +console.log(encode("Hello World!")); ``` diff --git a/dist/bottomify.js b/dist/bottomify.js index 8988cf9..29e6780 100644 --- a/dist/bottomify.js +++ b/dist/bottomify.js @@ -1,15 +1,4 @@ "use strict"; -var __values = (this && this.__values) || function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -}; var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; @@ -31,77 +20,59 @@ var __spread = (this && this.__spread) || function () { return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); -var CHARACTER_VALUES = { - 200: "🫂", - 50: "💖", - 10: "✨", - 5: "🥺", - 1: ",", - 0: "❤️", -}; -var CHARACTER_VALUES_MAP = Object.entries(CHARACTER_VALUES).reverse(); -var VALUES_CHARACTER = CHARACTER_VALUES_MAP.reduce(function (obj, item) { return (obj[item[1]] = item[0]) && obj; }, {}); +var CHARACTER_VALUES = [ + [200, "🫂"], + [50, "💖"], + [10, "✨"], + [5, "🥺"], + [1, ","], + [0, "❤️"], +]; var SECTION_SEPERATOR = "👉👈"; var FINAL_TERMINATOR = new RegExp("(" + SECTION_SEPERATOR + ")?$"); -function encode(value) { - var e_1, _a, e_2, _b; - var input = Array.from(value).map(function (v) { return v.codePointAt(0); }); - var output = []; +function textEncoder() { try { - for (var input_1 = __values(input), input_1_1 = input_1.next(); !input_1_1.done; input_1_1 = input_1.next()) { - var char = input_1_1.value; - while (char !== 0) { - try { - for (var CHARACTER_VALUES_MAP_1 = (e_2 = void 0, __values(CHARACTER_VALUES_MAP)), CHARACTER_VALUES_MAP_1_1 = CHARACTER_VALUES_MAP_1.next(); !CHARACTER_VALUES_MAP_1_1.done; CHARACTER_VALUES_MAP_1_1 = CHARACTER_VALUES_MAP_1.next()) { - var _c = __read(CHARACTER_VALUES_MAP_1_1.value, 2), value_1 = _c[0], emoji = _c[1]; - var parsedValue = parseInt(value_1); - if (char >= parsedValue) { - char -= parsedValue; - output.push(emoji); - break; - } - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (CHARACTER_VALUES_MAP_1_1 && !CHARACTER_VALUES_MAP_1_1.done && (_b = CHARACTER_VALUES_MAP_1.return)) _b.call(CHARACTER_VALUES_MAP_1); - } - finally { if (e_2) throw e_2.error; } - } - } - output.push(SECTION_SEPERATOR); - } + return new TextEncoder(); } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (input_1_1 && !input_1_1.done && (_a = input_1.return)) _a.call(input_1); - } - finally { if (e_1) throw e_1.error; } + catch (_a) { + // more than likely Node.JS + return new (require("util").TextEncoder)(); } - return output.join(""); +} +function encodeChar(charValue) { + if (charValue === 0) + return ""; + var _a = __read(CHARACTER_VALUES.find(function (_a) { + var _b = __read(_a, 1), val = _b[0]; + return charValue >= val; + }) || + CHARACTER_VALUES.find(function () { return 0; }), 2), val = _a[0], currentCase = _a[1]; + return "" + currentCase + encodeChar(charValue - val); +} +function encode(value) { + return Array.from(textEncoder().encode(value)) + .map(function (v) { return encodeChar(v) + SECTION_SEPERATOR; }) + .join(""); } exports.encode = encode; function decode(value) { - var input = value + return String.fromCodePoint.apply(String, __spread(value .trim() .replace(FINAL_TERMINATOR, "") - .split(SECTION_SEPERATOR); - var output = []; - if (Array.from(value).some(function (v) { - return !(Object.keys(VALUES_CHARACTER).includes(v) || - SECTION_SEPERATOR.includes(v)); - })) { - throw TypeError("Invalid bottom text: '" + value + "'"); - } - input.forEach(function (word) { - var codepoint = 0; - Array.from(word).forEach(function (char) { - codepoint += parseInt(VALUES_CHARACTER[char]); - }); - output.push(codepoint); - }); - return String.fromCodePoint.apply(String, __spread(output)); + .split(SECTION_SEPERATOR) + .map(function (letters) { + return Array.from(letters) + .map(function (character) { + var _a = __read(CHARACTER_VALUES.find(function (_a) { + var _b = __read(_a, 2), _ = _b[0], em = _b[1]; + return em == character; + }), 2), value = _a[0], emoji = _a[1]; + if (!emoji) { + throw TypeError("Invalid bottom text: '" + value + "'"); + } + return value; + }) + .reduce(function (p, c) { return p + c; }); + }))); } exports.decode = decode; diff --git a/dist/bottomify.min.js b/dist/bottomify.min.js index c0b3482..d796970 100644 --- a/dist/bottomify.min.js +++ b/dist/bottomify.min.js @@ -1 +1 @@ -"use strict";var __values=this&&this.__values||function(r){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},__read=this&&this.__read||function(r,e){var t="function"==typeof Symbol&&r[Symbol.iterator];if(!t)return r;var n,o,a=t.call(r),i=[];try{for(;(void 0===e||0 (obj[item[1]] = item[0]) && obj, - {} -); +const CHARACTER_VALUES: [number, string][] = [ + [200, "🫂"], + [50, "💖"], + [10, "✨"], + [5, "🥺"], + [1, ","], + [0, "❤️"], +]; const SECTION_SEPERATOR = "👉👈"; const FINAL_TERMINATOR = new RegExp(`(${SECTION_SEPERATOR})?$`); -export function encode(value: string): string { - let input = Array.from(value).map((v) => v.codePointAt(0)); - let output = []; +interface TextEncoderType { + encode: (input?: string) => Uint8Array +} - for (let char of input) { - while (char !== 0) { - for (let [value, emoji] of CHARACTER_VALUES_MAP) { - let parsedValue = parseInt(value); - if (char >= parsedValue) { - char -= parsedValue; - output.push(emoji); - break; - } - } - } - output.push(SECTION_SEPERATOR); +function textEncoder(): TextEncoderType { + try { + return new TextEncoder(); + } catch { + // more than likely Node.JS + return new (require("util").TextEncoder)(); } - - return output.join(""); } -export function decode(value: string): string { - let input: string[] = value - .trim() - .replace(FINAL_TERMINATOR, "") - .split(SECTION_SEPERATOR); - let output = []; - - if ( - Array.from(value).some( - (v) => - !( - Object.keys(VALUES_CHARACTER).includes(v) || - SECTION_SEPERATOR.includes(v) - ) - ) - ) { - throw TypeError(`Invalid bottom text: '${value}'`); - } +function encodeChar(charValue: number): string { + if (charValue === 0) return ""; + let [val, currentCase]: [number, string] = + CHARACTER_VALUES.find(([val]) => charValue >= val) || + CHARACTER_VALUES.find(() => 0); + return `${currentCase}${encodeChar(charValue - val)}`; +} - input.forEach((word) => { - let codepoint = 0; - Array.from(word).forEach((char) => { - codepoint += parseInt(VALUES_CHARACTER[char]); - }); - output.push(codepoint); - }); +export function encode(value: string): string { + return Array.from(textEncoder().encode(value)) + .map((v: number) => encodeChar(v) + SECTION_SEPERATOR) + .join(""); +} - return String.fromCodePoint(...output); +export function decode(value: string): string { + return String.fromCodePoint( + ...value + .trim() + .replace(FINAL_TERMINATOR, "") + .split(SECTION_SEPERATOR) + .map((letters) => { + return Array.from(letters) + .map((character) => { + let [value, emoji]: [number, string] = CHARACTER_VALUES.find( + ([_, em]) => em == character + ); + if (!emoji) { + throw TypeError(`Invalid bottom text: '${value}'`); + } + return value; + }) + .reduce((p, c) => p + c); + }) + ); } diff --git a/src/deno.ts b/src/deno.ts new file mode 100644 index 0000000..87dc243 --- /dev/null +++ b/src/deno.ts @@ -0,0 +1,53 @@ +const CHARACTER_VALUES: [number, string][] = [ + [200, "🫂"], + [50, "💖"], + [10, "✨"], + [5, "🥺"], + [1, ","], + [0, "❤️"], +]; +const SECTION_SEPERATOR = "👉👈"; +const FINAL_TERMINATOR = new RegExp(`(${SECTION_SEPERATOR})?$`); + +interface TextEncoderType { + encode: (input?: string) => Uint8Array; +} + +function textEncoder(): TextEncoderType { + return new TextEncoder(); +} + +function encodeChar(charValue: number): string { + if (charValue === 0) return ""; + let [val, currentCase]: [number, string] = + CHARACTER_VALUES.find(([val]) => charValue >= val) || CHARACTER_VALUES[-1]; + return `${currentCase}${encodeChar(charValue - val)}`; +} + +export function encode(value: string): string { + return Array.from(textEncoder().encode(value)) + .map((v: number) => encodeChar(v) + SECTION_SEPERATOR) + .join(""); +} + +export function decode(value: string): string { + return String.fromCodePoint( + ...value + .trim() + .replace(FINAL_TERMINATOR, "") + .split(SECTION_SEPERATOR) + .map((letters) => { + return Array.from(letters) + .map((character) => { + let [value, emoji]: [number, string] = + CHARACTER_VALUES.find(([_, em]) => em == character) || + CHARACTER_VALUES[-1]; + if (!emoji) { + throw TypeError(`Invalid bottom text: '${value}'`); + } + return value; + }) + .reduce((p, c) => p + c); + }) + ); +} diff --git a/tsconfig.json b/tsconfig.json index 2af3811..fd4b0d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,10 +5,7 @@ "outDir": "dist", "esModuleInterop": true, "downlevelIteration": true, - "declaration": true, + "declaration": true }, - "exclude": [ - "test/**/*.ts", - "dist" - ] + "exclude": ["test/**/*.ts", "dist", "src/deno.ts"] } diff --git a/yarn.lock b/yarn.lock index 86b2f72..2d47b40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,6 +29,11 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -41,6 +46,13 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -504,6 +516,15 @@ cli-spinners@^1.1.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" integrity sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg== +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" @@ -547,11 +568,23 @@ color-convert@^1.7.0, color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -707,6 +740,16 @@ duplexer@^0.1.1: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -740,6 +783,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -912,6 +960,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" @@ -1318,6 +1371,11 @@ replace-ext@^1.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -1423,6 +1481,15 @@ string-width@^2.0.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -1444,6 +1511,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -1641,6 +1715,15 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -1660,7 +1743,30 @@ xdg-basedir@^3.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@^20.2.2: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2"