From c808c0bfa81d092da2d7a1cbde401d98a3cf2f7e Mon Sep 17 00:00:00 2001 From: Matt Lubner Date: Tue, 3 Nov 2020 14:40:41 -0800 Subject: [PATCH] feat: convert to typescript & export a binary --- .gitignore | 1 + decode.js | 22 ----- encode.js | 13 --- package.json | 23 ++++- src/atoqr.ts | 11 +++ src/bin.ts | 69 ++++++++++++++ src/index.ts | 2 + src/qrtoa.ts | 14 +++ tsconfig.json | 24 +++++ yarn.lock | 252 +++++++++++++++++++++++++++++++++++++++++++++++++- 10 files changed, 389 insertions(+), 42 deletions(-) delete mode 100644 decode.js delete mode 100644 encode.js create mode 100644 src/atoqr.ts create mode 100644 src/bin.ts create mode 100644 src/index.ts create mode 100644 src/qrtoa.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index eb03e3e..f0c2471 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +lib *.log diff --git a/decode.js b/decode.js deleted file mode 100644 index 8ba5206..0000000 --- a/decode.js +++ /dev/null @@ -1,22 +0,0 @@ -const Jimp = require('jimp'); -const jsQR = require('jsqr'); - -// expected usage: node index.js -const dataUrl = process.argv[2] || `data:image/png;base64,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`; - -const [, encoding, content] = dataUrl.match(/^data:image\/png;([^,]+),(.+)$/) || []; -const buffer = Buffer.from(content, encoding); - -// alternate method if using an image file... -// const buffer = require('fs').readFileSync(__dirname + '/image.png'); - -const main = async () => { - const image = await Jimp.read(buffer); - const { data: result } = jsQR(image.bitmap.data, image.bitmap.width, image.bitmap.height); - console.log(result); -}; - -main().catch(err => { - console.error(err); - process.exit(1); -}); diff --git a/encode.js b/encode.js deleted file mode 100644 index 3f709a6..0000000 --- a/encode.js +++ /dev/null @@ -1,13 +0,0 @@ -const QRCode = require('qrcode'); - -const inputString = process.argv[2] || 'Have you tried forcing an unexpected reboot?'; - -const main = async () => { - const url = await QRCode.toDataURL(inputString); - console.log(url); -}; - -main().catch(err => { - console.error(err); - process.exit(1); -}); diff --git a/package.json b/package.json index e87b584..57d05e8 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,30 @@ "name": "qr-decode-encode", "description": "Shell scripts for decoding / encoding QR codes.", "version": "0.0.0-unversioned", - "main": "decode.js", + "main": "lib/index.js", + "bin": "lib/bin.js", "scripts": { - "decode": "node decode.js", - "encode": "node encode.js", - "test": "[ \"$(node decode.js \"$(node encode.js 'magic_test_string')\")\" == \"magic_test_string\" ]" + "start": "ts-node src/bin.ts", + "build": "tsc && chmod +x lib/bin.js", + "clean": "rimraf lib", + "test": "[ \"$(ts-node src/bin.ts decode \"$(ts-node src/bin.ts encode 'magic_test_string')\")\" == \"magic_test_string\" ]", + "type-check": "tsc --noEmit", + "decode": "yarn start decode", + "encode": "yarn start encode" }, "license": "MIT", "author": "Matt Lubner ", "dependencies": { "jimp": "^0.14.0", "jsqr": "^1.3.1", - "qrcode": "^1.4.4" + "qrcode": "^1.4.4", + "ts-node": "^9.0.0", + "typescript": "^4.0.5", + "yargs": "^16.1.0" + }, + "devDependencies": { + "@types/qrcode": "^1.3.5", + "@types/yargs": "^15.0.9", + "rimraf": "^3.0.2" } } diff --git a/src/atoqr.ts b/src/atoqr.ts new file mode 100644 index 0000000..40dbbe7 --- /dev/null +++ b/src/atoqr.ts @@ -0,0 +1,11 @@ +import * as QRCode from 'qrcode'; + +/** + * Encodes an ascii string into a data URL-embedded QR code. + */ +export const atoqr = async (ascii: string, output: 'dataUrl' | string = 'dataUrl'): Promise => { + if (output === 'dataUrl') { + return QRCode.toDataURL(ascii); + } + return QRCode.toFile(output, ascii); +}; diff --git a/src/bin.ts b/src/bin.ts new file mode 100644 index 0000000..efa0413 --- /dev/null +++ b/src/bin.ts @@ -0,0 +1,69 @@ +#!/usr/bin/env node +import yargs from 'yargs'; +import { readFileSync } from 'fs'; +import { normalize } from 'path'; +import { atoqr, qrtoa } from './'; + +const argv = yargs(process.argv.slice(2)) + .scriptName(require('../package.json').name) + .usage('Usage: $0 [options]') + .command('decode ', 'Decode qr_code back into an ascii string', _yargs => { + _yargs.positional('qr_code', { + describe: 'A data url or a path to an image file', + type: 'string', + }); + }) + .alias('qrtoa', 'decode') + .command('encode [options]', 'Encode an ascii string into a qr code', _yargs => { + _yargs.positional('ascii', { + describe: 'An ascii string', + }).option('file', { + alias: 'f', + describe: 'Path to save output to (as *.{png,svg,txt})', + normalize: true, + type: 'string', + }); + }) + .alias('atoqr', 'encode') + .demandCommand(1, 'You must specify a command') + .option('clean', { + alias: 'c', + describe: 'Omit the trailing newline', + type: 'boolean', + }) + .help('h') + .alias('h', 'help') + .argv; + +const [command] = argv._; + +const main = async () => { + switch (command) { + case 'decode': { + const dataUrlOrFile = argv.qr_code as string; + const [, content] = dataUrlOrFile.match(/^data:image\/(?:jpeg|png|bmp|tiff|gif);base64,(.+)$/) || []; + const isDataUrl = !!content; + const buffer = isDataUrl + ? Buffer.from(content, 'base64') + : readFileSync(normalize(dataUrlOrFile)); + const ascii = await qrtoa(buffer); + process.stdout.write(ascii); + break; + } + case 'encode': { + const ascii = argv.ascii as string; + const file = argv.file as string | undefined; + const qrCode = await atoqr(ascii, file); + process.stdout.write(qrCode); + break; + } + } + if (!argv.clean) { + process.stdout.write('\n'); + } +}; + +main().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..abe7c6b --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export * from './atoqr'; +export * from './qrtoa'; diff --git a/src/qrtoa.ts b/src/qrtoa.ts new file mode 100644 index 0000000..1bdba52 --- /dev/null +++ b/src/qrtoa.ts @@ -0,0 +1,14 @@ +import Jimp from 'jimp'; +import jsQR from 'jsqr'; + +/** + * Decodes a buffer containing a QR code into an ascii string. + */ +export const qrtoa = async (buffer: Buffer): Promise => { + const image = await Jimp.read(buffer); + const result = jsQR(new Uint8ClampedArray(image.bitmap.data), image.bitmap.width, image.bitmap.height); + if (!result) { + return Promise.reject(new Error('Failed to parse qr_code')); + } + return result.data; +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..14662c4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "allowJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6" + ], + "moduleResolution": "node", + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "skipLibCheck": true, + "strict": true, + "target": "es5" + }, + "include": [ + "src/*.ts" + ], + "exclude": [ + "node_modules", + "package.json" + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 3b4408a..7e279e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -299,11 +299,40 @@ "@babel/runtime" "^7.7.2" regenerator-runtime "^0.13.3" +"@types/node@*": + version "14.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.6.tgz#146d3da57b3c636cc0d1769396ce1cfa8991147f" + integrity sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw== + +"@types/qrcode@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/qrcode/-/qrcode-1.3.5.tgz#9c97cc2875f03e2b16a0d89856fc48414e380c38" + integrity sha512-92QMnMb9m0ErBU20za5Eqtf4lzUcSkk5w/Cz30q5qod0lWHm2loztmFs2EnCY06yT51GY1+m/oFq2D8qVK2Bjg== + dependencies: + "@types/node" "*" + +"@types/yargs-parser@*": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" + integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== + +"@types/yargs@^15.0.9": + version "15.0.9" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.9.tgz#524cd7998fe810cdb02f26101b699cccd156ff19" + integrity sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g== + dependencies: + "@types/yargs-parser" "*" + ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +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@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -311,11 +340,28 @@ ansi-styles@^3.2.0: 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" + any-base@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/any-base/-/any-base-1.1.0.tgz#ae101a62bc08a597b4c9ab5b7089d456630549fe" integrity sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg== +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + base64-js@^1.0.2: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" @@ -326,6 +372,14 @@ bmp-js@^0.1.0: resolved "https://registry.yarnpkg.com/bmp-js/-/bmp-js-0.1.0.tgz#e05a63f796a6c1ff25f4771ec7adadc148c07233" integrity sha1-4Fpj95amwf8l9Hcex62twUjAcjM= +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" @@ -349,7 +403,7 @@ buffer-fill@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= -buffer-from@^1.1.1: +buffer-from@^1.0.0, buffer-from@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== @@ -384,6 +438,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.3.tgz#ef180f26c8d9bff3927ee52428bfec2090427981" + integrity sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -391,11 +454,28 @@ 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== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -408,6 +488,11 @@ define-properties@^1.1.2, define-properties@^1.1.3: dependencies: object-keys "^1.0.12" +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dijkstrajs@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/dijkstrajs/-/dijkstrajs-1.0.1.tgz#d3cd81221e3ea40742cfcde556d4e99e98ddc71b" @@ -423,6 +508,11 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +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== + es-abstract@^1.5.1: version "1.16.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.0.tgz#d3a26dc9c3283ac9750dca569586e976d9dcc06d" @@ -448,6 +538,11 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + exif-parser@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/exif-parser/-/exif-parser-0.1.12.tgz#58a9d2d72c02c1f6f02a0ef4a9166272b7760922" @@ -465,12 +560,17 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, 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== @@ -483,6 +583,18 @@ gifwrap@^0.9.2: image-q "^1.1.1" omggif "^1.0.10" +glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + global@~4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" @@ -513,6 +625,19 @@ image-q@^1.1.1: resolved "https://registry.yarnpkg.com/image-q/-/image-q-1.1.1.tgz#fc84099664460b90ca862d9300b6bfbbbfbf8056" integrity sha1-/IQJlmRGC5DKhi2TALa/u7+/gFY= +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -528,6 +653,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-function@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" @@ -595,6 +725,11 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + mime@^1.3.4: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -607,6 +742,13 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" @@ -642,6 +784,13 @@ omggif@^1.0.10, omggif@^1.0.9: resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" integrity sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw== +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + p-limit@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" @@ -694,6 +843,11 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + phin@^2.9.1: version "2.9.3" resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c" @@ -744,6 +898,13 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + sax@>=0.6.0: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -754,6 +915,19 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +source-map-support@^0.5.17: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -763,6 +937,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.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.prototype.trimleft@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" @@ -786,6 +969,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.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" + timm@^1.6.1: version "1.6.2" resolved "https://registry.yarnpkg.com/timm/-/timm-1.6.2.tgz#dfd8c6719f7ba1fcfc6295a32670a1c6d166c0bd" @@ -796,6 +986,22 @@ tinycolor2@^1.4.1: resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= +ts-node@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.0.0.tgz#e7699d2a110cc8c0d3b831715e417688683460b3" + integrity sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +typescript@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" + integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== + utif@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/utif/-/utif-2.0.1.tgz#9e1582d9bbd20011a6588548ed3266298e711759" @@ -825,6 +1031,20 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +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" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + xhr@^2.0.1: version "2.5.0" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" @@ -864,6 +1084,11 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== +y18n@^5.0.2: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + yargs-parser@^13.1.1: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" @@ -872,6 +1097,11 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.3.tgz#92419ba867b858c868acf8bae9bf74af0dd0ce26" + integrity sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww== + yargs@^13.2.4: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" @@ -887,3 +1117,21 @@ yargs@^13.2.4: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^13.1.1" + +yargs@^16.1.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.0.tgz#fc333fe4791660eace5a894b39d42f851cd48f2a" + integrity sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g== + 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.2" + yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==