From d38d73ae524ff47d3fbd06a74dab7cfe009134cb Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Apr 2019 16:12:04 -0700 Subject: [PATCH 1/2] Flatten the library export structure --- src/base16.js | 14 ------- src/base32.js | 24 ------------ src/base32hex.js | 14 ------- src/base64.js | 14 ------- src/base64url.js | 14 ------- src/index.js | 96 ++++++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 src/base16.js delete mode 100644 src/base32.js delete mode 100644 src/base32hex.js delete mode 100644 src/base64.js delete mode 100644 src/base64url.js diff --git a/src/base16.js b/src/base16.js deleted file mode 100644 index 8b22863..0000000 --- a/src/base16.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as codec from './codec.js' - -const encoding = { - chars: '0123456789ABCDEF', - bits: 4 -} - -export function parse(string, opts) { - return codec.parse(string.toUpperCase(), encoding, opts) -} - -export function stringify(data, opts) { - return codec.stringify(data, encoding, opts) -} diff --git a/src/base32.js b/src/base32.js deleted file mode 100644 index 91dd6de..0000000 --- a/src/base32.js +++ /dev/null @@ -1,24 +0,0 @@ -import * as codec from './codec.js' - -const encoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bits: 5 -} - -export function parse(string, opts = {}) { - return codec.parse( - opts.loose - ? string - .toUpperCase() - .replace(/0/g, 'O') - .replace(/1/g, 'L') - .replace(/8/g, 'B') - : string, - encoding, - opts - ) -} - -export function stringify(data, opts) { - return codec.stringify(data, encoding, opts) -} diff --git a/src/base32hex.js b/src/base32hex.js deleted file mode 100644 index 918e345..0000000 --- a/src/base32hex.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as codec from './codec.js' - -const encoding = { - chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bits: 5 -} - -export function parse(string, opts) { - return codec.parse(string, encoding, opts) -} - -export function stringify(data, opts) { - return codec.stringify(data, encoding, opts) -} diff --git a/src/base64.js b/src/base64.js deleted file mode 100644 index 836b0ea..0000000 --- a/src/base64.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as codec from './codec.js' - -const encoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bits: 6 -} - -export function parse(string, opts) { - return codec.parse(string, encoding, opts) -} - -export function stringify(data, opts) { - return codec.stringify(data, encoding, opts) -} diff --git a/src/base64url.js b/src/base64url.js deleted file mode 100644 index 72125ca..0000000 --- a/src/base64url.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as codec from './codec.js' - -const encoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bits: 6 -} - -export function parse(string, opts) { - return codec.parse(string, encoding, opts) -} - -export function stringify(data, opts) { - return codec.stringify(data, encoding, opts) -} diff --git a/src/index.js b/src/index.js index ddbaa58..d0ca2a9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,88 @@ -import * as base16 from './base16.js' -import * as base32 from './base32.js' -import * as base32hex from './base32hex.js' -import * as base64 from './base64.js' -import * as base64url from './base64url.js' -import * as codec from './codec.js' - -export { base16, base32, base32hex, base64, base64url, codec } +import { parse, stringify } from './codec.js' + +const base16Encoding = { + chars: '0123456789ABCDEF', + bits: 4 +} + +export const base16 = { + parse(string, opts) { + return parse(string.toUpperCase(), base16Encoding, opts) + }, + + stringify(data, opts) { + return stringify(data, base16Encoding, opts) + } +} + +const base32Encoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bits: 5 +} + +export const base32 = { + parse(string, opts = {}) { + return parse( + opts.loose + ? string + .toUpperCase() + .replace(/0/g, 'O') + .replace(/1/g, 'L') + .replace(/8/g, 'B') + : string, + base32Encoding, + opts + ) + }, + + stringify(data, opts) { + return stringify(data, base32Encoding, opts) + } +} + +const base32HexEncoding = { + chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bits: 5 +} + +export const base32hex = { + parse(string, opts) { + return parse(string, base32HexEncoding, opts) + }, + + stringify(data, opts) { + return stringify(data, base32HexEncoding, opts) + } +} + +const base64Encoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bits: 6 +} + +export const base64 = { + parse(string, opts) { + return parse(string, base64Encoding, opts) + }, + + stringify(data, opts) { + return stringify(data, base64Encoding, opts) + } +} + +const base64UrlEncoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bits: 6 +} + +export const base64url = { + parse(string, opts) { + return parse(string, base64UrlEncoding, opts) + }, + + stringify(data, opts) { + return stringify(data, base64UrlEncoding, opts) + } +} + +export const codec = { parse, stringify } From a2c5d2b2e6ad595c893f856aa8a8b2afa8861ddd Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 5 Apr 2019 17:16:19 -0700 Subject: [PATCH 2/2] Port everything over to TypeScript --- .eslintignore | 2 - .eslintrc.js | 17 +++ .eslintrc.json | 7 -- .gitignore | 19 +++- .nycrc.json | 12 +++ package.json | 22 ++-- rollup.config.js | 16 ++- src/{codec.js => codec.ts} | 33 +++++- src/{index.js => index.ts} | 72 +++++++------ test/{tests.js => tests.ts} | 46 +++++--- tsconfig.json | 15 +++ yarn.lock | 206 +++++++++++++++++++++++++++++++++++- 12 files changed, 387 insertions(+), 80 deletions(-) delete mode 100644 .eslintignore create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.json create mode 100644 .nycrc.json rename src/{codec.js => codec.ts} (78%) rename src/{index.js => index.ts} (55%) rename test/{tests.js => tests.ts} (84%) create mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 626c4f3..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/lib -/node_modules diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..b0261b9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +const path = require('path') + +module.exports = { + extends: [ + 'standard-kit/lint', + 'standard-kit/lint/typescript' + ], + parserOptions: { + project: path.resolve(__dirname, './tsconfig.json'), + tsconfigRootDir: __dirname + }, + plugins: ['prettier'], + rules: { + 'no-var': 'error', + 'prettier/prettier': 'error' + } +} diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9adf82e..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["standard-kit/lint"], - "plugins": ["prettier"], - "rules": { - "prettier/prettier": "error" - } -} diff --git a/.gitignore b/.gitignore index 29095b0..3e205fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,15 @@ -.nyc_output -/coverage -/lib -/node_modules +# Build output: +.nyc_output/ +coverage/ +lib/ + +# Package managers: +node_modules/ +npm-debug.log +package-lock.json +yarn-error.log + +# Editors: +.DS_Store +.idea/ +.vscode/ diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 0000000..d0b48d7 --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,12 @@ +{ + "include": [ + "src/**/*.ts" + ], + "extension": [ + ".ts" + ], + "require": [ + "sucrase/register" + ], + "all": true +} diff --git a/package.json b/package.json index 53d4199..baf5ea4 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,14 @@ ], "main": "lib/index.cjs.js", "module": "lib/index.js", + "types": "lib/src/index.d.ts", "scripts": { - "build": "rimraf lib && rollup -c", - "format": "eslint . --fix", - "lint": "eslint .", - "precommit": "npm run lint && npm test", + "build": "rimraf lib && rollup -c && tsc", + "format": "npm run lint -- --fix", + "lint": "eslint --ignore-path .gitignore --ext .js,.ts .", + "precommit": "npm run lint && npm test && npm run build", "prepare": "npm run build", - "pretest": "npm run build", - "test": "nyc mocha" + "test": "nyc mocha test/**/*.ts" }, "husky": { "hooks": { @@ -41,6 +41,11 @@ "devDependencies": { "@babel/core": "^7.6.2", "@babel/preset-env": "^7.6.2", + "@babel/preset-typescript": "^7.6.0", + "@types/chai": "^4.2.3", + "@types/mocha": "^5.2.7", + "@typescript-eslint/eslint-plugin": "^2.3.1", + "@typescript-eslint/parser": "^2.3.1", "chai": "^4.2.0", "eslint": "^6.4.0", "eslint-config-standard-kit": "^0.14.0", @@ -56,6 +61,9 @@ "rollup": "^1.21.4", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-filesize": "^6.2.0", - "rollup-plugin-uglify": "^6.0.3" + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-uglify": "^6.0.3", + "sucrase": "^3.10.1", + "typescript": "^3.6.3" } } diff --git a/rollup.config.js b/rollup.config.js index 894b152..10665b3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,11 +1,15 @@ import babel from 'rollup-plugin-babel' import filesize from 'rollup-plugin-filesize' +import resolve from 'rollup-plugin-node-resolve' import { uglify } from 'rollup-plugin-uglify' import packageJson from './package.json' +const extensions = ['.ts'] const babelOpts = { babelrc: false, + extensions, + include: ['src/**/*'], presets: [ [ '@babel/preset-env', @@ -13,22 +17,24 @@ const babelOpts = { exclude: ['transform-regenerator'], loose: true } - ] + ], + '@babel/typescript' ] } +const resolveOpts = { extensions } export default [ { - input: 'src/index.js', + input: 'src/index.ts', output: [ { file: packageJson.module, format: 'esm', sourceMap: true }, { file: packageJson.main, format: 'cjs', sourceMap: true } ], - plugins: [babel(babelOpts)] + plugins: [resolve(resolveOpts), babel(babelOpts)] }, { - input: 'src/index.js', + input: 'src/index.ts', output: { file: 'lib/index.min.js', format: 'iife', name: 'rfc4648' }, - plugins: [babel(babelOpts), uglify(), filesize()] + plugins: [resolve(resolveOpts), babel(babelOpts), uglify(), filesize()] } ] diff --git a/src/codec.js b/src/codec.ts similarity index 78% rename from src/codec.js rename to src/codec.ts index 5efddf7..368ed55 100644 --- a/src/codec.js +++ b/src/codec.ts @@ -1,4 +1,25 @@ -export function parse(string, encoding, opts = {}) { +/* eslint-disable @typescript-eslint/strict-boolean-expressions */ + +export interface Encoding { + bits: number + chars: string + codes?: { [char: string]: number } +} + +export interface ParseOptions { + loose?: boolean + out?: new (size: number) => { [index: number]: number } +} + +export interface StringifyOptions { + pad?: boolean +} + +export function parse( + string: string, + encoding: Encoding, + opts: ParseOptions = {} +): Uint8Array { // Build the character lookup table: if (!encoding.codes) { encoding.codes = {} @@ -24,7 +45,9 @@ export function parse(string, encoding, opts = {}) { } // Allocate the output: - const out = new (opts.out || Uint8Array)(((end * encoding.bits) / 8) | 0) + const out = new (opts.out || Uint8Array)( + ((end * encoding.bits) / 8) | 0 + ) as Uint8Array // Parse the data: let bits = 0 // Number of bits currently in the buffer @@ -56,7 +79,11 @@ export function parse(string, encoding, opts = {}) { return out } -export function stringify(data, encoding, opts = {}) { +export function stringify( + data: ArrayLike, + encoding: Encoding, + opts: StringifyOptions = {} +): string { const { pad = true } = opts const mask = (1 << encoding.bits) - 1 let out = '' diff --git a/src/index.js b/src/index.ts similarity index 55% rename from src/index.js rename to src/index.ts index d0ca2a9..38a2baf 100644 --- a/src/index.js +++ b/src/index.ts @@ -1,27 +1,50 @@ -import { parse, stringify } from './codec.js' +/* eslint-disable @typescript-eslint/strict-boolean-expressions */ -const base16Encoding = { +import { + Encoding, + ParseOptions, + StringifyOptions, + parse, + stringify +} from './codec' + +const base16Encoding: Encoding = { chars: '0123456789ABCDEF', bits: 4 } +const base32Encoding: Encoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', + bits: 5 +} + +const base32HexEncoding: Encoding = { + chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV', + bits: 5 +} + +const base64Encoding: Encoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + bits: 6 +} + +const base64UrlEncoding: Encoding = { + chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', + bits: 6 +} + export const base16 = { - parse(string, opts) { + parse(string: string, opts?: ParseOptions): Uint8Array { return parse(string.toUpperCase(), base16Encoding, opts) }, - stringify(data, opts) { + stringify(data: ArrayLike, opts?: StringifyOptions): string { return stringify(data, base16Encoding, opts) } } -const base32Encoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', - bits: 5 -} - export const base32 = { - parse(string, opts = {}) { + parse(string: string, opts: ParseOptions = {}): Uint8Array { return parse( opts.loose ? string @@ -35,52 +58,37 @@ export const base32 = { ) }, - stringify(data, opts) { + stringify(data: ArrayLike, opts?: StringifyOptions): string { return stringify(data, base32Encoding, opts) } } -const base32HexEncoding = { - chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV', - bits: 5 -} - export const base32hex = { - parse(string, opts) { + parse(string: string, opts?: ParseOptions): Uint8Array { return parse(string, base32HexEncoding, opts) }, - stringify(data, opts) { + stringify(data: ArrayLike, opts?: StringifyOptions): string { return stringify(data, base32HexEncoding, opts) } } -const base64Encoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - bits: 6 -} - export const base64 = { - parse(string, opts) { + parse(string: string, opts?: ParseOptions): Uint8Array { return parse(string, base64Encoding, opts) }, - stringify(data, opts) { + stringify(data: ArrayLike, opts?: StringifyOptions): string { return stringify(data, base64Encoding, opts) } } -const base64UrlEncoding = { - chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - bits: 6 -} - export const base64url = { - parse(string, opts) { + parse(string: string, opts?: ParseOptions): Uint8Array { return parse(string, base64UrlEncoding, opts) }, - stringify(data, opts) { + stringify(data: ArrayLike, opts?: StringifyOptions): string { return stringify(data, base64UrlEncoding, opts) } } diff --git a/test/tests.js b/test/tests.ts similarity index 84% rename from test/tests.js rename to test/tests.ts index 8214fab..afa0d5d 100644 --- a/test/tests.js +++ b/test/tests.ts @@ -1,15 +1,21 @@ -/* global describe, it, require */ - -const { expect } = require('chai') -const { - base16, - base32, - base32hex, - base64, - base64url -} = require('../lib/index.cjs.js') - -function parseAscii(string) { +/* global describe, it */ + +import { expect } from 'chai' +import { base16, base32, base32hex, base64, base64url } from '../src/index' + +// Test for simple round-trips: +type TestVector = [number[] | string, string] + +// Test for encoded string with errors: +type ErrorTestVector = + | [string, string, number[]] // Strict fails, loose parses + | [string, string, string] // Both fail differently + | [string, string] // Both fail the same way + +/** + * Turns an ASCII string into a Uint8Array: + */ +function parseAscii(string: string): Uint8Array { const out = new Uint8Array(string.length) for (let i = 0; i < string.length; ++i) { out[i] = string.charCodeAt(i) @@ -17,7 +23,10 @@ function parseAscii(string) { return out } -function generateTests(codec, vectors) { +/** + * Tests the provided codec's round-trip capabilities. + */ +function generateTests(codec: typeof base16, vectors: TestVector[]): void { for (const [data, text] of vectors) { it(`round-trips "${text}"`, function() { const expected = @@ -28,12 +37,19 @@ function generateTests(codec, vectors) { } } -function generateErrorTests(codec, vectors) { +/** + * Tests the provided codec's error-handling capabilities. + */ +function generateErrorTests( + codec: typeof base16, + vectors: ErrorTestVector[] +): void { for (const [text, error, loose] of vectors) { if (loose == null || typeof loose === 'string') { it(`rejects "${text}"`, function() { + const looseMessage = loose == null ? error : loose expect(() => codec.parse(text)).throws(error) - expect(() => codec.parse(text, { loose: true })).throws(loose || error) + expect(() => codec.parse(text, { loose: true })).throws(looseMessage) }) } else { it(`loosely parses "${text}"`, function() { diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bdbf53f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationDir": "lib", + "emitDeclarationOnly": true, + + "esModuleInterop": true, + "lib": ["es2015"], + "module": "es2015", + "target": "es2015", + + "strict": true + }, + "exclude": ["node_modules", "lib"] +} diff --git a/yarn.lock b/yarn.lock index 2183557..7b5b3c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,6 +63,18 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/helper-create-class-features-plugin@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz#769711acca889be371e9bc2eb68641d55218021f" + integrity sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.5.5" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-define-map@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" @@ -302,6 +314,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-typescript@^7.2.0": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" + integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-arrow-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" @@ -539,6 +558,15 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-typescript@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.6.0.tgz#48d78405f1aa856ebeea7288a48a19ed8da377a6" + integrity sha512-yzw7EopOOr6saONZ3KA3lpizKnWRTe+rfBqg4AmQbSow7ik7fqmzrfIqt053osLwLE2AaTqGinLM2tl6+M/uog== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.6.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-typescript" "^7.2.0" + "@babel/plugin-transform-unicode-regex@^7.6.2": version "7.6.2" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.6.2.tgz#b692aad888a7e8d8b1b214be6b9dc03d5031f698" @@ -604,6 +632,14 @@ js-levenshtein "^1.1.3" semver "^5.5.0" +"@babel/preset-typescript@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.6.0.tgz#25768cb8830280baf47c45ab1a519a9977498c98" + integrity sha512-4xKw3tTcCm0qApyT6PqM9qniseCE79xGHiUnNdKGdxNsGUc2X7WwZybqIpnTmoukg3nhPceI5KPNzNqLNeIJww== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-typescript" "^7.6.0" + "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" @@ -637,12 +673,32 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@types/chai@^4.2.3": + version "4.2.3" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.3.tgz#419477a3d5202bad19e14c787940a61dc9ea6407" + integrity sha512-VRw2xEGbll3ZiTQ4J02/hUjNqZoue1bMhoo2dgM2LXjDdyaq4q80HgBDHwpI0/VKlo4Eg+BavyQMv/NYgTetzA== + +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/node@^12.7.5": +"@types/json-schema@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" + integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== + +"@types/mocha@^5.2.7": + version "5.2.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" + integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== + +"@types/node@*", "@types/node@^12.7.5": version "12.7.7" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.7.tgz#f9bd8c00fa9e1a8129af910fc829f6139c397d6c" integrity sha512-4jUncNe2tj1nmrO/34PsRpZqYVnRV1svbU78cKhuQKkMntKB/AmdLyGgswcZKjFHEHGpiY8pVD8CuVI55nP54w== @@ -652,6 +708,53 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/resolve@0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + +"@typescript-eslint/eslint-plugin@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.3.1.tgz#b0b1e6b9b3f84b3e1afbdd338f4194c8ab92db21" + integrity sha512-VqVNEsvemviajlaWm03kVMabc6S3xCHGYuY0fReTrIIOZg+3WzB+wfw6fD3KYKerw5lYxmzogmHOZ0i7YKnuwA== + dependencies: + "@typescript-eslint/experimental-utils" "2.3.1" + eslint-utils "^1.4.2" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.3.1.tgz#92f2531d3e7c22e64a2cc10cfe89935deaf00f7c" + integrity sha512-FaZEj73o4h6Wd0Lg+R4pZiJGdR0ZYbJr+O2+RbQ1aZjX8bZcfkVDtD+qm74Dv77rfSKkDKE64UTziLBo9UYHQA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.3.1" + eslint-scope "^5.0.0" + +"@typescript-eslint/parser@^2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.3.1.tgz#f2b93b614d9b338825c44e75552a433e2ebf8c33" + integrity sha512-ZlWdzhCJ2iZnSp/VBAJ/sowFbyHycIux8t0UEH0JsKgQvfSf7949hLYFMwTXdCMeEnpP1zRTHimrR+YHzs8LIw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.3.1" + "@typescript-eslint/typescript-estree" "2.3.1" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/typescript-estree@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.3.1.tgz#62c64f149948473d06a129dc33b4fc76e6c051f9" + integrity sha512-9SFhUgFuePJBB6jlLkOPPhMkZNiDCr+S8Ft7yAkkP2c5x5bxPhG3pe/exMiQaF8IGyVMDW6Ul0q4/cZ+uF3uog== + dependencies: + glob "^7.1.4" + is-glob "^4.0.1" + lodash.unescape "4.0.1" + semver "^6.3.0" + acorn-jsx@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" @@ -711,6 +814,11 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + append-transform@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" @@ -808,6 +916,11 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +builtin-modules@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" + integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + caching-transform@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-3.0.2.tgz#601d46b91eca87687a281e71cef99791b0efca70" @@ -945,7 +1058,7 @@ colors@^1.3.3: resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -commander@^2.20.0, commander@~2.20.0: +commander@^2.19.0, commander@^2.20.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -1511,7 +1624,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.3: +glob@^7.1.3, glob@^7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -1746,6 +1859,11 @@ is-glob@^4.0.0, is-glob@^4.0.1: dependencies: is-extglob "^2.1.1" +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -1963,6 +2081,11 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" @@ -2114,6 +2237,15 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -2142,6 +2274,11 @@ node-environment-flags@1.0.5: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + node-releases@^1.1.29: version "1.1.32" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.32.tgz#485b35c1bf9b4d8baa105d782f8ca731e518276e" @@ -2202,6 +2339,11 @@ nyc@^14.1.1: yargs "^13.2.2" yargs-parser "^13.0.0" +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + object-inspect@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" @@ -2459,6 +2601,13 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== +pirates@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -2656,7 +2805,7 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: +resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.5.0: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== @@ -2713,6 +2862,17 @@ rollup-plugin-filesize@^6.2.0: gzip-size "^5.1.1" terser "^4.1.3" +rollup-plugin-node-resolve@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" + integrity sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== + dependencies: + "@types/resolve" "0.0.8" + builtin-modules "^3.1.0" + is-module "^1.0.0" + resolve "^1.11.1" + rollup-pluginutils "^2.8.1" + rollup-plugin-uglify@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.3.tgz#e3f776171344b580bec6c6ab8888622b67099457" @@ -2982,6 +3142,16 @@ strip-json-comments@^3.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== +sucrase@^3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.10.1.tgz#70ce0bad0e4c8fbc3c3184dbd1797e82990d0602" + integrity sha512-nMOs6rFWwkYRxcKHHDjyQmC5CmLbHN2LwRyWF1n2i0kb/pq0xcB9M19TdY5Ivfcj1BsWfs+az9Ga5B0tFdE5ww== + dependencies: + commander "^2.19.0" + lines-and-columns "^1.1.6" + mz "^2.7.0" + pirates "^4.0.0" + supports-color@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" @@ -3042,6 +3212,20 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.0" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" + integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= + dependencies: + any-promise "^1.0.0" + through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -3059,11 +3243,18 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -tslib@^1.9.0: +tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -3086,6 +3277,11 @@ type-fest@^0.6.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== +typescript@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" + integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== + uglify-js@^3.1.4, uglify-js@^3.4.9: version "3.6.0" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5"