From 052584b09a0ee86853fc4d3594f6b1d3d88968f1 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 12:37:48 +0200 Subject: [PATCH 01/80] typescript(option): chore: initial setup Signed-off-by: prescientmoon --- typescript/option/.gitignore | 3 ++ typescript/option/.prettierrc | 5 +++ typescript/option/LICENSE | 39 +++++++++++++++++++++ typescript/option/package.json | 36 ++++++++++++++++++++ typescript/option/rollup.config.ts | 54 ++++++++++++++++++++++++++++++ typescript/option/src/index.ts | 0 typescript/option/tsconfig.json | 11 ++++++ 7 files changed, 148 insertions(+) create mode 100644 typescript/option/.gitignore create mode 100644 typescript/option/.prettierrc create mode 100644 typescript/option/LICENSE create mode 100644 typescript/option/package.json create mode 100644 typescript/option/rollup.config.ts create mode 100644 typescript/option/src/index.ts create mode 100644 typescript/option/tsconfig.json diff --git a/typescript/option/.gitignore b/typescript/option/.gitignore new file mode 100644 index 0000000..25d4951 --- /dev/null +++ b/typescript/option/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +sandbox \ No newline at end of file diff --git a/typescript/option/.prettierrc b/typescript/option/.prettierrc new file mode 100644 index 0000000..da62ca6 --- /dev/null +++ b/typescript/option/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "tabWidth": 4, + "singleQuote": true +} diff --git a/typescript/option/LICENSE b/typescript/option/LICENSE new file mode 100644 index 0000000..5cd6321 --- /dev/null +++ b/typescript/option/LICENSE @@ -0,0 +1,39 @@ +The Prosperity Public License 2.0.0 + +Contributor: Matei Adriel + +Source Code: https://github.com/Mateiadrielrafael/ecs + +This license lets you use and share this software for free, +with a trial-length time limit on commercial use. Specifically: + +If you follow the rules below, you may do everything with this +software that would otherwise infringe either the contributor's +copyright in it, any patent claim the contributor can license +that covers this software as of the contributor's latest +contribution, or both. + +1. You must limit use of this software in any manner primarily + intended for or directed toward commercial advantage or + private monetary compensation to a trial period of 32 + consecutive calendar days. This limit does not apply to use in + developing feedback, modifications, or extensions that you + contribute back to those giving this license. + +2. Ensure everyone who gets a copy of this software from you, in + source code or any other form, gets the text of this license + and the contributor and source code lines above. + +3. Do not make any legal claim against anyone for infringing any + patent claim they would infringe by using this software alone, + accusing this software, with or without changes, alone or as + part of a larger application. + +You are excused for unknowingly breaking rule 1 if you stop +doing anything requiring this license within 30 days of +learning you broke the rule. + +**This software comes as is, without any warranty at all. As far +as the law allows, the contributor will not be liable for any +damages related to this software or this license, for any kind of +legal claim.** \ No newline at end of file diff --git a/typescript/option/package.json b/typescript/option/package.json new file mode 100644 index 0000000..a10fbc3 --- /dev/null +++ b/typescript/option/package.json @@ -0,0 +1,36 @@ +{ + "name": "@adrielus/option", + "version": "0.0.0-development", + "description": "Typescript version of fsharps Option module", + "main": "dist/bundle.cjs.js", + "module": "dist/bundle.esm.js", + "typings": "dist/index.d.ts", + "scripts": { + "prebuild": "rimraf dist", + "build": "rollup -c rollup.config.ts" + }, + "files": [ + "dist" + ], + "keywords": [ + "typescript", + "fsharp", + "option", + "maybe", + "nullable" + ], + "dependencies": {}, + "sideEffects": false, + "devDependencies": { + "rimraf": "^3.0.0", + "rollup": "^1.27.5", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-dts": "^1.1.12", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-terser": "^5.1.2", + "rollup-plugin-typescript2": "^0.25.2", + "typescript": "^3.7.2" + }, + "author": "Matei Adriel", + "license": "SEE LICENSE IN LICENSE" +} diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts new file mode 100644 index 0000000..19dadb4 --- /dev/null +++ b/typescript/option/rollup.config.ts @@ -0,0 +1,54 @@ +import commonjs from 'rollup-plugin-commonjs' +import nodeResolve from 'rollup-plugin-node-resolve' +import dts from 'rollup-plugin-dts' +import typescript from 'rollup-plugin-typescript2' +import { terser } from 'rollup-plugin-terser' +import { resolve } from 'path' + +const outputDirectory = resolve(__dirname, 'dist') +const inputFile = resolve(__dirname, 'src/index.ts') + +const npmConfig = require(resolve(__dirname, `package.json`)) + +const external = Object.keys(npmConfig.dependencies || {}) +const dev = Boolean(process.env.ROLLUP_WATCH) + +export default [ + { + input: inputFile, + external, + output: [ + { + file: `${outputDirectory}/bundle.cjs.js`, + format: 'cjs', + sourcemap: true + }, + { + file: `${outputDirectory}/bundle.esm.js`, + format: 'esm', + sourcemap: true + }, + { + file: `${outputDirectory}/bundle.amd.js`, + sourcemap: true, + format: 'amd', + name: 'Loopover' + } + ], + plugins: [ + nodeResolve({ + extensions: ['.ts'] + }), + commonjs(), + typescript({ + tsconfig: resolve(__dirname, 'tsconfig.json') + }), + !dev && terser() + ] + }, + { + input: inputFile, + output: [{ file: `${outputDirectory}/index.d.ts`, format: 'es' }], + plugins: [dts()] + } +] diff --git a/typescript/option/src/index.ts b/typescript/option/src/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/typescript/option/tsconfig.json b/typescript/option/tsconfig.json new file mode 100644 index 0000000..ee2ac52 --- /dev/null +++ b/typescript/option/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "lib": ["esnext", "dom", "es2015.iterable"], + "moduleResolution": "node", + "strictNullChecks": true, + "sourceMap": true, + "downlevelIteration": true, + "target": "es6" + }, + "include": ["src", "sandbox"] +} From b388fb76aa2c5d0e4d04fee846c99370a016ebaa Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 13:26:22 +0200 Subject: [PATCH 02/80] typescript(option): feat: added the base helpers Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 110 +++++++++++++++++++++++++ typescript/option/src/index.ts | 2 + typescript/option/src/internalTypes.ts | 7 ++ typescript/option/src/internals.ts | 17 ++++ typescript/option/src/types.ts | 6 ++ 5 files changed, 142 insertions(+) create mode 100644 typescript/option/src/helpers.ts create mode 100644 typescript/option/src/internalTypes.ts create mode 100644 typescript/option/src/internals.ts create mode 100644 typescript/option/src/types.ts diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts new file mode 100644 index 0000000..9967f8a --- /dev/null +++ b/typescript/option/src/helpers.ts @@ -0,0 +1,110 @@ +import { Option, Some, None } from './types' +import { Binder, Folder, Mapper, Predicate, BackFolder } from './internalTypes' +import Internals, { SomeClass } from './internals' + +export const isSome = (option: Option) => + option instanceof Internals.SomeClass +export const isNothing = (option: Option) => + option instanceof Internals.NoneClass + +export const match = ( + option: Option, + caseSome: (v: T) => U, + caseNone: () => U +) => { + if (isSome(option)) { + return caseSome((option as SomeClass)[Internals.someValue]) + } + + return caseNone() +} + +export const bind = ( + binder: Binder, + option: Option +): Option => { + return match(option, binder, () => None) +} + +export const map = ( + mapper: Mapper, + option: Option +): Option => { + return match( + option, + v => Some(mapper(v)), + () => None + ) +} + +export const count = (option: Option) => Number(isSome(option)) + +export const exists = (predicate: Predicate, option: Option) => { + return match(option, predicate, () => false) +} + +export const filter = (predicate: Predicate, option: Option) => { + return match( + option, + v => (predicate(v) ? Some(v) : None), + () => None + ) +} + +export const fold = ( + folder: Folder, + initial: U, + option: Option +) => { + match( + option, + v => folder(initial, v), + () => initial + ) +} + +export const foldback = ( + folder: BackFolder, + option: Option, + initial: U +) => { + return match( + option, + v => folder(v, initial), + () => initial + ) +} + +export const forall = (predicate: Predicate, option: Option) => { + return match(option, predicate, () => true) +} + +export const get = (option: Option) => { + return match( + option, + v => v, + () => { + throw new Error('Cannot get value from None') + } + ) +} + +export const iter = (mapper: Mapper, option: Option) => { + match(option, mapper, () => {}) +} + +export const toArray = (option: Option) => { + return match( + option, + v => [v], + () => [] + ) +} + +export const toNullable = (option: Option) => { + return match( + option, + v => v, + () => null + ) +} diff --git a/typescript/option/src/index.ts b/typescript/option/src/index.ts index e69de29..493732d 100644 --- a/typescript/option/src/index.ts +++ b/typescript/option/src/index.ts @@ -0,0 +1,2 @@ +export * from './helpers' +export * from './types' diff --git a/typescript/option/src/internalTypes.ts b/typescript/option/src/internalTypes.ts new file mode 100644 index 0000000..a636b21 --- /dev/null +++ b/typescript/option/src/internalTypes.ts @@ -0,0 +1,7 @@ +import { Option } from './types' + +export type Mapper = (v: T) => U +export type Binder = Mapper> +export type Predicate = Mapper +export type Folder = (s: U, v: T) => U +export type BackFolder = (v: T, s: U) => U diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts new file mode 100644 index 0000000..6e5911a --- /dev/null +++ b/typescript/option/src/internals.ts @@ -0,0 +1,17 @@ +export const isOption = Symbol('option') +export const someValue = Symbol('value') + +export class SomeClass { + public [isOption] = true + public [someValue]: T + + public constructor(value: T) { + this[someValue] = value + } +} + +export class NoneClass { + public [isOption] = true +} + +export default { NoneClass, SomeClass, isOption, someValue } diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts new file mode 100644 index 0000000..3f55148 --- /dev/null +++ b/typescript/option/src/types.ts @@ -0,0 +1,6 @@ +import * as Internals from './internals' + +export type Option = Internals.SomeClass | Internals.NoneClass + +export const None = new Internals.NoneClass() +export const Some = (v: T) => new Internals.SomeClass(v) From 1178d0407906955a35fb8164be82823a5b55883d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 13:44:39 +0200 Subject: [PATCH 03/80] typescript(option): feat: custom toString method for better logging Signed-off-by: prescientmoon --- typescript/option/pnpm-lock.yaml | 495 +++++++++++++++++++++++++++++ typescript/option/src/internals.ts | 8 + 2 files changed, 503 insertions(+) create mode 100644 typescript/option/pnpm-lock.yaml diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml new file mode 100644 index 0000000..6b9c283 --- /dev/null +++ b/typescript/option/pnpm-lock.yaml @@ -0,0 +1,495 @@ +devDependencies: + rimraf: 3.0.0 + rollup: 1.27.13 + rollup-plugin-commonjs: 10.1.0_rollup@1.27.13 + rollup-plugin-dts: 1.1.13_rollup@1.27.13+typescript@3.7.3 + rollup-plugin-node-resolve: 5.2.0_rollup@1.27.13 + rollup-plugin-terser: 5.1.3_rollup@1.27.13 + rollup-plugin-typescript2: 0.25.3_rollup@1.27.13+typescript@3.7.3 + typescript: 3.7.3 +lockfileVersion: 5.1 +packages: + /@babel/code-frame/7.5.5: + dependencies: + '@babel/highlight': 7.5.0 + dev: true + resolution: + integrity: sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + /@babel/highlight/7.5.0: + dependencies: + chalk: 2.4.2 + esutils: 2.0.3 + js-tokens: 4.0.0 + dev: true + resolution: + integrity: sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + /@types/estree/0.0.39: + dev: true + resolution: + integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + /@types/estree/0.0.40: + dev: true + resolution: + integrity: sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== + /@types/node/12.12.21: + dev: true + resolution: + integrity: sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== + /@types/resolve/0.0.8: + dependencies: + '@types/node': 12.12.21 + dev: true + resolution: + integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + /acorn/7.1.0: + dev: true + engines: + node: '>=0.4.0' + hasBin: true + resolution: + integrity: sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + /ansi-styles/3.2.1: + dependencies: + color-convert: 1.9.3 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + /balanced-match/1.0.0: + dev: true + resolution: + integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + /brace-expansion/1.1.11: + dependencies: + balanced-match: 1.0.0 + concat-map: 0.0.1 + dev: true + resolution: + integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + /buffer-from/1.1.1: + dev: true + resolution: + integrity: sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + /builtin-modules/3.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + /chalk/2.4.2: + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + /color-convert/1.9.3: + dependencies: + color-name: 1.1.3 + dev: true + resolution: + integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + /color-name/1.1.3: + dev: true + resolution: + integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + /commander/2.20.3: + dev: true + resolution: + integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + /commondir/1.0.1: + dev: true + resolution: + integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + /concat-map/0.0.1: + dev: true + resolution: + integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + /escape-string-regexp/1.0.5: + dev: true + engines: + node: '>=0.8.0' + resolution: + integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + /estree-walker/0.6.1: + dev: true + resolution: + integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== + /esutils/2.0.3: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + /find-cache-dir/3.2.0: + dependencies: + commondir: 1.0.1 + make-dir: 3.0.0 + pkg-dir: 4.2.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== + /find-up/4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + /fs-extra/8.1.0: + dependencies: + graceful-fs: 4.2.3 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + engines: + node: '>=6 <7 || >=8' + resolution: + integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + /fs.realpath/1.0.0: + dev: true + resolution: + integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + /glob/7.1.6: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.0.4 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + resolution: + integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + /graceful-fs/4.2.3: + dev: true + resolution: + integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + /has-flag/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + /inflight/1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + resolution: + integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + /inherits/2.0.4: + dev: true + resolution: + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + /is-module/1.0.0: + dev: true + resolution: + integrity: sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + /is-reference/1.1.4: + dependencies: + '@types/estree': 0.0.39 + dev: true + resolution: + integrity: sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + /jest-worker/24.9.0: + dependencies: + merge-stream: 2.0.0 + supports-color: 6.1.0 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + /js-tokens/4.0.0: + dev: true + resolution: + integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + /jsonfile/4.0.0: + dev: true + optionalDependencies: + graceful-fs: 4.2.3 + resolution: + integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + /locate-path/5.0.0: + dependencies: + p-locate: 4.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + /magic-string/0.25.4: + dependencies: + sourcemap-codec: 1.4.6 + dev: true + resolution: + integrity: sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== + /make-dir/3.0.0: + dependencies: + semver: 6.3.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== + /merge-stream/2.0.0: + dev: true + resolution: + integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + /minimatch/3.0.4: + dependencies: + brace-expansion: 1.1.11 + dev: true + resolution: + integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + /once/1.4.0: + dependencies: + wrappy: 1.0.2 + dev: true + resolution: + integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + /p-limit/2.2.1: + dependencies: + p-try: 2.2.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== + /p-locate/4.1.0: + dependencies: + p-limit: 2.2.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + /p-try/2.2.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + /path-exists/4.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + /path-is-absolute/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + /path-parse/1.0.6: + dev: true + resolution: + integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + /pkg-dir/4.2.0: + dependencies: + find-up: 4.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + /resolve/1.12.0: + dependencies: + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== + /resolve/1.14.1: + dependencies: + path-parse: 1.0.6 + dev: true + resolution: + integrity: sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg== + /rimraf/3.0.0: + dependencies: + glob: 7.1.6 + dev: true + hasBin: true + resolution: + integrity: sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== + /rollup-plugin-commonjs/10.1.0_rollup@1.27.13: + dependencies: + estree-walker: 0.6.1 + is-reference: 1.1.4 + magic-string: 0.25.4 + resolve: 1.14.1 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + dev: true + peerDependencies: + rollup: '>=1.12.0' + resolution: + integrity: sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== + /rollup-plugin-dts/1.1.13_rollup@1.27.13+typescript@3.7.3: + dependencies: + rollup: 1.27.13 + typescript: 3.7.3 + dev: true + optionalDependencies: + '@babel/code-frame': 7.5.5 + peerDependencies: + rollup: ^1.27.8 + typescript: ^3.7.3 + resolution: + integrity: sha512-vpCSjTFodt8saLkFAi/Xn7JFgs2ZnbFYRbYyirlZjQtxS81JhU7oXuuyC9UrkftIot+/JbuavPOtI9OQoVQIcQ== + /rollup-plugin-node-resolve/5.2.0_rollup@1.27.13: + dependencies: + '@types/resolve': 0.0.8 + builtin-modules: 3.1.0 + is-module: 1.0.0 + resolve: 1.14.1 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve. + dev: true + peerDependencies: + rollup: '>=1.11.0' + resolution: + integrity: sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== + /rollup-plugin-terser/5.1.3_rollup@1.27.13: + dependencies: + '@babel/code-frame': 7.5.5 + jest-worker: 24.9.0 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + serialize-javascript: 2.1.2 + terser: 4.4.3 + dev: true + peerDependencies: + rollup: '>=0.66.0 <2' + resolution: + integrity: sha512-FuFuXE5QUJ7snyxHLPp/0LFXJhdomKlIx/aK7Tg88Yubsx/UU/lmInoJafXJ4jwVVNcORJ1wRUC5T9cy5yk0wA== + /rollup-plugin-typescript2/0.25.3_rollup@1.27.13+typescript@3.7.3: + dependencies: + find-cache-dir: 3.2.0 + fs-extra: 8.1.0 + resolve: 1.12.0 + rollup: 1.27.13 + rollup-pluginutils: 2.8.1 + tslib: 1.10.0 + typescript: 3.7.3 + dev: true + peerDependencies: + rollup: '>=1.26.3' + typescript: '>=2.4.0' + resolution: + integrity: sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg== + /rollup-pluginutils/2.8.1: + dependencies: + estree-walker: 0.6.1 + dev: true + resolution: + integrity: sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== + /rollup-pluginutils/2.8.2: + dependencies: + estree-walker: 0.6.1 + dev: true + resolution: + integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + /rollup/1.27.13: + dependencies: + '@types/estree': 0.0.40 + '@types/node': 12.12.21 + acorn: 7.1.0 + dev: true + hasBin: true + resolution: + integrity: sha512-hDi7M07MpmNSDE8YVwGVFA8L7n8jTLJ4lG65nMAijAyqBe//rtu4JdxjUBE7JqXfdpqxqDTbCDys9WcqdpsQvw== + /semver/6.3.0: + dev: true + hasBin: true + resolution: + integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + /serialize-javascript/2.1.2: + dev: true + resolution: + integrity: sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== + /source-map-support/0.5.16: + dependencies: + buffer-from: 1.1.1 + source-map: 0.6.1 + dev: true + resolution: + integrity: sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + /source-map/0.6.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + /sourcemap-codec/1.4.6: + dev: true + resolution: + integrity: sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg== + /supports-color/5.5.0: + dependencies: + has-flag: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + /supports-color/6.1.0: + dependencies: + has-flag: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + /terser/4.4.3: + dependencies: + commander: 2.20.3 + source-map: 0.6.1 + source-map-support: 0.5.16 + dev: true + engines: + node: '>=6.0.0' + hasBin: true + resolution: + integrity: sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA== + /tslib/1.10.0: + dev: true + resolution: + integrity: sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + /typescript/3.7.3: + dev: true + engines: + node: '>=4.2.0' + hasBin: true + resolution: + integrity: sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== + /universalify/0.1.2: + dev: true + engines: + node: '>= 4.0.0' + resolution: + integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + /wrappy/1.0.2: + dev: true + resolution: + integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +specifiers: + rimraf: ^3.0.0 + rollup: ^1.27.5 + rollup-plugin-commonjs: ^10.1.0 + rollup-plugin-dts: ^1.1.12 + rollup-plugin-node-resolve: ^5.2.0 + rollup-plugin-terser: ^5.1.2 + rollup-plugin-typescript2: ^0.25.2 + typescript: ^3.7.2 diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 6e5911a..2ec597a 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -8,10 +8,18 @@ export class SomeClass { public constructor(value: T) { this[someValue] = value } + + public toString() { + return `Some(${this[someValue]})` + } } export class NoneClass { public [isOption] = true + + public toString() { + return 'None' + } } export default { NoneClass, SomeClass, isOption, someValue } From 8620f4b78d95c4101cb66004b7b70b0e0bb83bb9 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 13:50:17 +0200 Subject: [PATCH 04/80] typescript(option): chore: added semantic release Signed-off-by: prescientmoon --- .../option/.github/workflows/release.yml | 23 + typescript/option/package.json | 12 +- typescript/option/pnpm-lock.yaml | 2151 ++++++++++++++++- 3 files changed, 2175 insertions(+), 11 deletions(-) create mode 100644 typescript/option/.github/workflows/release.yml diff --git a/typescript/option/.github/workflows/release.yml b/typescript/option/.github/workflows/release.yml new file mode 100644 index 0000000..9fa6fea --- /dev/null +++ b/typescript/option/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + push: + branches: + - master + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + # check out repository code and setup node + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.x' + # install dependencies and run semantic-release + - run: npm i -g pnpm + - run: pnpm install + - run: pnpx semantic-release + env: + _GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/typescript/option/package.json b/typescript/option/package.json index a10fbc3..7951675 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -19,17 +19,17 @@ "maybe", "nullable" ], - "dependencies": {}, "sideEffects": false, "devDependencies": { "rimraf": "^3.0.0", - "rollup": "^1.27.5", + "rollup": "^1.27.13", "rollup-plugin-commonjs": "^10.1.0", - "rollup-plugin-dts": "^1.1.12", + "rollup-plugin-dts": "^1.1.13", "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-terser": "^5.1.2", - "rollup-plugin-typescript2": "^0.25.2", - "typescript": "^3.7.2" + "rollup-plugin-terser": "^5.1.3", + "rollup-plugin-typescript2": "^0.25.3", + "semantic-release": "^15.13.31", + "typescript": "^3.7.3" }, "author": "Matei Adriel", "license": "SEE LICENSE IN LICENSE" diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 6b9c283..095e18c 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -6,6 +6,7 @@ devDependencies: rollup-plugin-node-resolve: 5.2.0_rollup@1.27.13 rollup-plugin-terser: 5.1.3_rollup@1.27.13 rollup-plugin-typescript2: 0.25.3_rollup@1.27.13+typescript@3.7.3 + semantic-release: 15.13.31_semantic-release@15.13.31 typescript: 3.7.3 lockfileVersion: 5.1 packages: @@ -23,6 +24,180 @@ packages: dev: true resolution: integrity: sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + /@babel/runtime/7.7.7: + dependencies: + regenerator-runtime: 0.13.3 + dev: true + resolution: + integrity: sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA== + /@nodelib/fs.scandir/2.1.3: + dependencies: + '@nodelib/fs.stat': 2.0.3 + run-parallel: 1.1.9 + dev: true + engines: + node: '>= 8' + resolution: + integrity: sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + /@nodelib/fs.stat/2.0.3: + dev: true + engines: + node: '>= 8' + resolution: + integrity: sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + /@nodelib/fs.walk/1.2.4: + dependencies: + '@nodelib/fs.scandir': 2.1.3 + fastq: 1.6.0 + dev: true + engines: + node: '>= 8' + resolution: + integrity: sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + /@octokit/endpoint/5.5.1: + dependencies: + '@octokit/types': 2.0.2 + is-plain-object: 3.0.0 + universal-user-agent: 4.0.0 + dev: true + resolution: + integrity: sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg== + /@octokit/request-error/1.2.0: + dependencies: + '@octokit/types': 2.0.2 + deprecation: 2.3.1 + once: 1.4.0 + dev: true + resolution: + integrity: sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg== + /@octokit/request/5.3.1: + dependencies: + '@octokit/endpoint': 5.5.1 + '@octokit/request-error': 1.2.0 + '@octokit/types': 2.0.2 + deprecation: 2.3.1 + is-plain-object: 3.0.0 + node-fetch: 2.6.0 + once: 1.4.0 + universal-user-agent: 4.0.0 + dev: true + resolution: + integrity: sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg== + /@octokit/rest/16.35.2: + dependencies: + '@octokit/request': 5.3.1 + '@octokit/request-error': 1.2.0 + atob-lite: 2.0.0 + before-after-hook: 2.1.0 + btoa-lite: 1.0.0 + deprecation: 2.3.1 + lodash.get: 4.4.2 + lodash.set: 4.3.2 + lodash.uniq: 4.5.0 + octokit-pagination-methods: 1.1.0 + once: 1.4.0 + universal-user-agent: 4.0.0 + dev: true + resolution: + integrity: sha512-iijaNZpn9hBpUdh8YdXqNiWazmq4R1vCUsmxpBB0kCQ0asHZpCx+HNs22eiHuwYKRhO31ZSAGBJLi0c+3XHaKQ== + /@octokit/types/2.0.2: + dependencies: + '@types/node': 12.12.21 + dev: true + resolution: + integrity: sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ== + /@semantic-release/commit-analyzer/6.3.3_semantic-release@15.13.31: + dependencies: + conventional-changelog-angular: 5.0.6 + conventional-commits-filter: 2.0.2 + conventional-commits-parser: 3.0.8 + debug: 4.1.1 + import-from: 3.0.0 + lodash: 4.17.15 + semantic-release: 15.13.31_semantic-release@15.13.31 + dev: true + engines: + node: '>=8.16' + peerDependencies: + semantic-release: '>=15.8.0 <16.0.0' + resolution: + integrity: sha512-Pyv1ZL2u5AIOY4YbxFCAB5J1PEh5yON8ylbfiPiriDGGW6Uu1U3Y8lysMtWu+FUD5x7tSnyIzhqx0+fxPxqbgw== + /@semantic-release/error/2.2.0: + dev: true + resolution: + integrity: sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg== + /@semantic-release/github/5.5.5_semantic-release@15.13.31: + dependencies: + '@octokit/rest': 16.35.2 + '@semantic-release/error': 2.2.0 + aggregate-error: 3.0.1 + bottleneck: 2.19.5 + debug: 4.1.1 + dir-glob: 3.0.1 + fs-extra: 8.1.0 + globby: 10.0.1 + http-proxy-agent: 2.1.0 + https-proxy-agent: 3.0.1 + issue-parser: 5.0.0 + lodash: 4.17.15 + mime: 2.4.4 + p-filter: 2.1.0 + p-retry: 4.2.0 + semantic-release: 15.13.31_semantic-release@15.13.31 + url-join: 4.0.1 + dev: true + engines: + node: '>=8.16' + peerDependencies: + semantic-release: '>=15.8.0 <16.0.0' + resolution: + integrity: sha512-Wo9OIULMRydbq+HpFh9yiLvra1XyEULPro9Tp4T5MQJ0WZyAQ3YQm74IdT8Pe/UmVDq2nfpT1oHrWkwOc4loHg== + /@semantic-release/npm/5.3.4_semantic-release@15.13.31: + dependencies: + '@semantic-release/error': 2.2.0 + aggregate-error: 3.0.1 + execa: 3.4.0 + fs-extra: 8.1.0 + lodash: 4.17.15 + nerf-dart: 1.0.0 + normalize-url: 4.5.0 + npm: 6.13.4 + rc: 1.2.8 + read-pkg: 5.2.0 + registry-auth-token: 4.0.0 + semantic-release: 15.13.31_semantic-release@15.13.31 + tempy: 0.3.0 + dev: true + engines: + node: '>=8.16' + peerDependencies: + semantic-release: '>=15.9.0 <16.0.0' + resolution: + integrity: sha512-XjITNRA/oOpJ7BfHk/WaOHs1WniYBszTde/bwADjjk1Luacpxg87jbDQVVt/oA3Zlx+MelxACRIEuRiPC5gu8g== + /@semantic-release/release-notes-generator/7.3.5_semantic-release@15.13.31: + dependencies: + conventional-changelog-angular: 5.0.6 + conventional-changelog-writer: 4.0.11 + conventional-commits-filter: 2.0.2 + conventional-commits-parser: 3.0.8 + debug: 4.1.1 + get-stream: 5.1.0 + import-from: 3.0.0 + into-stream: 5.1.1 + lodash: 4.17.15 + read-pkg-up: 7.0.1 + semantic-release: 15.13.31_semantic-release@15.13.31 + dev: true + engines: + node: '>=8.16' + peerDependencies: + semantic-release: '>=15.8.0 <16.0.0 || >=16.0.0-beta <17.0.0' + resolution: + integrity: sha512-LGjgPBGjjmjap/76O0Md3wc04Y7IlLnzZceLsAkcYRwGQdRPTTFUJKqDQTuieWTs7zfHzQoZqsqPfFxEN+g2+Q== + /@types/color-name/1.1.1: + dev: true + resolution: + integrity: sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== /@types/estree/0.0.39: dev: true resolution: @@ -31,16 +206,52 @@ packages: dev: true resolution: integrity: sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== + /@types/events/3.0.0: + dev: true + resolution: + integrity: sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + /@types/glob/7.1.1: + dependencies: + '@types/events': 3.0.0 + '@types/minimatch': 3.0.3 + '@types/node': 12.12.21 + dev: true + resolution: + integrity: sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + /@types/minimatch/3.0.3: + dev: true + resolution: + integrity: sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== /@types/node/12.12.21: dev: true resolution: integrity: sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== + /@types/normalize-package-data/2.4.0: + dev: true + resolution: + integrity: sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + /@types/parse-json/4.0.0: + dev: true + resolution: + integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== /@types/resolve/0.0.8: dependencies: '@types/node': 12.12.21 dev: true resolution: integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + /@types/retry/0.12.0: + dev: true + resolution: + integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== + /JSONStream/1.3.5: + dependencies: + jsonparse: 1.3.1 + through: 2.3.8 + dev: true + hasBin: true + resolution: + integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== /acorn/7.1.0: dev: true engines: @@ -48,6 +259,35 @@ packages: hasBin: true resolution: integrity: sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + /agent-base/4.3.0: + dependencies: + es6-promisify: 5.0.0 + dev: true + engines: + node: '>= 4.0.0' + resolution: + integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + /aggregate-error/3.0.1: + dependencies: + clean-stack: 2.2.0 + indent-string: 4.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + /ansi-escapes/3.2.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + /ansi-regex/5.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== /ansi-styles/3.2.1: dependencies: color-convert: 1.9.3 @@ -56,10 +296,61 @@ packages: node: '>=4' resolution: integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + /ansi-styles/4.2.0: + dependencies: + '@types/color-name': 1.1.1 + color-convert: 2.0.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg== + /ansicolors/0.3.2: + dev: true + resolution: + integrity: sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk= + /argv-formatter/1.0.0: + dev: true + resolution: + integrity: sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk= + /array-find-index/1.0.2: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + /array-ify/1.0.0: + dev: true + resolution: + integrity: sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= + /array-union/2.1.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + /arrify/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + /atob-lite/2.0.0: + dev: true + resolution: + integrity: sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= /balanced-match/1.0.0: dev: true resolution: integrity: sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + /before-after-hook/2.1.0: + dev: true + resolution: + integrity: sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== + /bottleneck/2.19.5: + dev: true + resolution: + integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw== /brace-expansion/1.1.11: dependencies: balanced-match: 1.0.0 @@ -67,6 +358,18 @@ packages: dev: true resolution: integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + /braces/3.0.2: + dependencies: + fill-range: 7.0.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + /btoa-lite/1.0.0: + dev: true + resolution: + integrity: sha1-M3dm2hWAEhD92VbCLpxokaudAzc= /buffer-from/1.1.1: dev: true resolution: @@ -77,6 +380,42 @@ packages: node: '>=6' resolution: integrity: sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== + /callsites/3.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + /camelcase-keys/4.2.0: + dependencies: + camelcase: 4.1.0 + map-obj: 2.0.0 + quick-lru: 1.1.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= + /camelcase/4.1.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + /camelcase/5.3.1: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + /cardinal/2.1.1: + dependencies: + ansicolors: 0.3.2 + redeyed: 2.1.1 + dev: true + hasBin: true + resolution: + integrity: sha1-fMEFXYItISlU0HsIXeolHMe8VQU= /chalk/2.4.2: dependencies: ansi-styles: 3.2.1 @@ -87,16 +426,56 @@ packages: node: '>=4' resolution: integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + /clean-stack/2.2.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + /cli-table/0.3.1: + dependencies: + colors: 1.0.3 + dev: true + engines: + node: '>= 0.2.0' + resolution: + integrity: sha1-9TsFJmqLGguTSz0IIebi3FkUriM= + /cliui/6.0.0: + dependencies: + string-width: 4.2.0 + strip-ansi: 6.0.0 + wrap-ansi: 6.2.0 + dev: true + resolution: + integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== /color-convert/1.9.3: dependencies: color-name: 1.1.3 dev: true resolution: integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + /color-convert/2.0.1: + dependencies: + color-name: 1.1.4 + dev: true + engines: + node: '>=7.0.0' + resolution: + integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== /color-name/1.1.3: dev: true resolution: integrity: sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + /color-name/1.1.4: + dev: true + resolution: + integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + /colors/1.0.3: + dev: true + engines: + node: '>=0.1.90' + resolution: + integrity: sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= /commander/2.20.3: dev: true resolution: @@ -105,16 +484,237 @@ packages: dev: true resolution: integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + /compare-func/1.3.2: + dependencies: + array-ify: 1.0.0 + dot-prop: 3.0.0 + dev: true + resolution: + integrity: sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg= /concat-map/0.0.1: dev: true resolution: integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + /conventional-changelog-angular/5.0.6: + dependencies: + compare-func: 1.3.2 + q: 1.5.1 + dev: true + engines: + node: '>=6.9.0' + resolution: + integrity: sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA== + /conventional-changelog-writer/4.0.11: + dependencies: + compare-func: 1.3.2 + conventional-commits-filter: 2.0.2 + dateformat: 3.0.3 + handlebars: 4.5.3 + json-stringify-safe: 5.0.1 + lodash: 4.17.15 + meow: 5.0.0 + semver: 6.3.0 + split: 1.0.1 + through2: 3.0.1 + dev: true + engines: + node: '>=6.9.0' + hasBin: true + resolution: + integrity: sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw== + /conventional-commits-filter/2.0.2: + dependencies: + lodash.ismatch: 4.4.0 + modify-values: 1.0.1 + dev: true + engines: + node: '>=6.9.0' + resolution: + integrity: sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ== + /conventional-commits-parser/3.0.8: + dependencies: + JSONStream: 1.3.5 + is-text-path: 1.0.1 + lodash: 4.17.15 + meow: 5.0.0 + split2: 2.2.0 + through2: 3.0.1 + trim-off-newlines: 1.0.1 + dev: true + engines: + node: '>=6.9.0' + hasBin: true + resolution: + integrity: sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ== + /core-util-is/1.0.2: + dev: true + resolution: + integrity: sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + /cosmiconfig/6.0.0: + dependencies: + '@types/parse-json': 4.0.0 + import-fresh: 3.2.1 + parse-json: 5.0.0 + path-type: 4.0.0 + yaml: 1.7.2 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + /cross-spawn/6.0.5: + dependencies: + nice-try: 1.0.5 + path-key: 2.0.1 + semver: 5.7.1 + shebang-command: 1.2.0 + which: 1.3.1 + dev: true + engines: + node: '>=4.8' + resolution: + integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + /cross-spawn/7.0.1: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + engines: + node: '>= 8' + resolution: + integrity: sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== + /crypto-random-string/1.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= + /currently-unhandled/0.4.1: + dependencies: + array-find-index: 1.0.2 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-mI3zP+qxke95mmE2nddsF635V+o= + /dateformat/3.0.3: + dev: true + resolution: + integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== + /debug/3.1.0: + dependencies: + ms: 2.0.0 + dev: true + resolution: + integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + /debug/3.2.6: + dependencies: + ms: 2.1.2 + dev: true + resolution: + integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + /debug/4.1.1: + dependencies: + ms: 2.1.2 + dev: true + resolution: + integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + /decamelize-keys/1.1.0: + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= + /decamelize/1.2.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + /deep-extend/0.6.0: + dev: true + engines: + node: '>=4.0.0' + resolution: + integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + /deprecation/2.3.1: + dev: true + resolution: + integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + /dir-glob/3.0.1: + dependencies: + path-type: 4.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + /dot-prop/3.0.0: + dependencies: + is-obj: 1.0.1 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-G3CK8JSknJoOfbyteQq6U52sEXc= + /duplexer2/0.1.4: + dependencies: + readable-stream: 2.3.6 + dev: true + resolution: + integrity: sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + /emoji-regex/8.0.0: + dev: true + resolution: + integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + /end-of-stream/1.4.4: + dependencies: + once: 1.4.0 + dev: true + resolution: + integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + /env-ci/4.5.2: + dependencies: + execa: 3.4.0 + java-properties: 1.0.2 + dev: true + engines: + node: '>=8.3' + resolution: + integrity: sha512-lS+edpNp2+QXEPkx6raEMIjKxKKWnJ4+VWzovYJ2NLYiJAYenSAXotFfVdgaFxdbVnvAbUI8epQDa1u12ERxfQ== + /error-ex/1.3.2: + dependencies: + is-arrayish: 0.2.1 + dev: true + resolution: + integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + /es6-promise/4.2.8: + dev: true + resolution: + integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== + /es6-promisify/5.0.0: + dependencies: + es6-promise: 4.2.8 + dev: true + resolution: + integrity: sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= /escape-string-regexp/1.0.5: dev: true engines: node: '>=0.8.0' resolution: integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + /esprima/4.0.1: + dev: true + engines: + node: '>=4' + hasBin: true + resolution: + integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== /estree-walker/0.6.1: dev: true resolution: @@ -125,6 +725,79 @@ packages: node: '>=0.10.0' resolution: integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + /execa/1.0.0: + dependencies: + cross-spawn: 6.0.5 + get-stream: 4.1.0 + is-stream: 1.1.0 + npm-run-path: 2.0.2 + p-finally: 1.0.0 + signal-exit: 3.0.2 + strip-eof: 1.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + /execa/3.4.0: + dependencies: + cross-spawn: 7.0.1 + get-stream: 5.1.0 + human-signals: 1.1.1 + is-stream: 2.0.0 + merge-stream: 2.0.0 + npm-run-path: 4.0.0 + onetime: 5.1.0 + p-finally: 2.0.1 + signal-exit: 3.0.2 + strip-final-newline: 2.0.0 + dev: true + engines: + node: ^8.12.0 || >=9.7.0 + resolution: + integrity: sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== + /fast-glob/3.1.1: + dependencies: + '@nodelib/fs.stat': 2.0.3 + '@nodelib/fs.walk': 1.2.4 + glob-parent: 5.1.0 + merge2: 1.3.0 + micromatch: 4.0.2 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g== + /fastq/1.6.0: + dependencies: + reusify: 1.0.4 + dev: true + resolution: + integrity: sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + /figures/2.0.0: + dependencies: + escape-string-regexp: 1.0.5 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + /figures/3.1.0: + dependencies: + escape-string-regexp: 1.0.5 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + /fill-range/7.0.1: + dependencies: + to-regex-range: 5.0.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== /find-cache-dir/3.2.0: dependencies: commondir: 1.0.1 @@ -135,6 +808,14 @@ packages: node: '>=8' resolution: integrity: sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== + /find-up/2.1.0: + dependencies: + locate-path: 2.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c= /find-up/4.1.0: dependencies: locate-path: 5.0.0 @@ -144,6 +825,21 @@ packages: node: '>=8' resolution: integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + /find-versions/3.2.0: + dependencies: + semver-regex: 2.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== + /from2/2.3.0: + dependencies: + inherits: 2.0.4 + readable-stream: 2.3.6 + dev: true + resolution: + integrity: sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= /fs-extra/8.1.0: dependencies: graceful-fs: 4.2.3 @@ -158,6 +854,47 @@ packages: dev: true resolution: integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + /get-caller-file/2.0.5: + dev: true + engines: + node: 6.* || 8.* || >= 10.* + resolution: + integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + /get-stream/4.1.0: + dependencies: + pump: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + /get-stream/5.1.0: + dependencies: + pump: 3.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + /git-log-parser/1.2.0: + dependencies: + argv-formatter: 1.0.0 + spawn-error-forwarder: 1.0.0 + split2: 1.0.0 + stream-combiner2: 1.1.1 + through2: 2.0.5 + traverse: 0.6.6 + dev: true + resolution: + integrity: sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo= + /glob-parent/5.1.0: + dependencies: + is-glob: 4.0.1 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== /glob/7.1.6: dependencies: fs.realpath: 1.0.0 @@ -169,16 +906,125 @@ packages: dev: true resolution: integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + /globby/10.0.1: + dependencies: + '@types/glob': 7.1.1 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.1.1 + glob: 7.1.6 + ignore: 5.1.4 + merge2: 1.3.0 + slash: 3.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== /graceful-fs/4.2.3: dev: true resolution: integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + /handlebars/4.5.3: + dependencies: + neo-async: 2.6.1 + optimist: 0.6.1 + source-map: 0.6.1 + dev: true + engines: + node: '>=0.4.7' + hasBin: true + optionalDependencies: + uglify-js: 3.7.2 + resolution: + integrity: sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== + /has-flag/2.0.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= /has-flag/3.0.0: dev: true engines: node: '>=4' resolution: integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + /hook-std/2.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-zZ6T5WcuBMIUVh49iPQS9t977t7C0l7OtHrpeMb5uk48JdflRX0NSFvCekfYNmGQETnLq9W/isMyHl69kxGi8g== + /hosted-git-info/2.8.5: + dev: true + resolution: + integrity: sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg== + /hosted-git-info/3.0.2: + dependencies: + lru-cache: 5.1.1 + dev: true + resolution: + integrity: sha512-ezZMWtHXm7Eb7Rq4Mwnx2vs79WUx2QmRg3+ZqeGroKzfDO+EprOcgRPYghsOP9JuYBfK18VojmRTGCg8Ma+ktw== + /http-proxy-agent/2.1.0: + dependencies: + agent-base: 4.3.0 + debug: 3.1.0 + dev: true + engines: + node: '>= 4.5.0' + resolution: + integrity: sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== + /https-proxy-agent/3.0.1: + dependencies: + agent-base: 4.3.0 + debug: 3.2.6 + dev: true + engines: + node: '>= 4.5.0' + resolution: + integrity: sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg== + /human-signals/1.1.1: + dev: true + engines: + node: '>=8.12.0' + resolution: + integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + /ignore/5.1.4: + dev: true + engines: + node: '>= 4' + resolution: + integrity: sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + /import-fresh/3.2.1: + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + /import-from/3.0.0: + dependencies: + resolve-from: 5.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== + /indent-string/3.2.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= + /indent-string/4.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== /inflight/1.0.6: dependencies: once: 1.4.0 @@ -190,16 +1036,131 @@ packages: dev: true resolution: integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + /ini/1.3.5: + dev: true + resolution: + integrity: sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + /into-stream/5.1.1: + dependencies: + from2: 2.3.0 + p-is-promise: 3.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA== + /is-arrayish/0.2.1: + dev: true + resolution: + integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + /is-extglob/2.1.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + /is-fullwidth-code-point/3.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + /is-glob/4.0.1: + dependencies: + is-extglob: 2.1.1 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== /is-module/1.0.0: dev: true resolution: integrity: sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + /is-number/7.0.0: + dev: true + engines: + node: '>=0.12.0' + resolution: + integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + /is-obj/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + /is-plain-obj/1.1.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + /is-plain-object/3.0.0: + dependencies: + isobject: 4.0.0 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg== /is-reference/1.1.4: dependencies: '@types/estree': 0.0.39 dev: true resolution: integrity: sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + /is-stream/1.1.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + /is-stream/2.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + /is-text-path/1.0.1: + dependencies: + text-extensions: 1.9.0 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= + /isarray/1.0.0: + dev: true + resolution: + integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + /isexe/2.0.0: + dev: true + resolution: + integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + /isobject/4.0.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== + /issue-parser/5.0.0: + dependencies: + lodash.capitalize: 4.2.1 + lodash.escaperegexp: 4.1.2 + lodash.isplainobject: 4.0.6 + lodash.isstring: 4.0.1 + lodash.uniqby: 4.7.0 + dev: true + engines: + node: '>=8.3' + resolution: + integrity: sha512-q/16W7EPHRL0FKVz9NU++TUsoygXGj6JOi88oulyAcQG+IEZ0T6teVdE+VLbe19OfL/tbV8Wi3Dfo0HedeHW0Q== + /java-properties/1.0.2: + dev: true + engines: + node: '>= 0.6.0' + resolution: + integrity: sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ== /jest-worker/24.9.0: dependencies: merge-stream: 2.0.0 @@ -213,12 +1174,50 @@ packages: dev: true resolution: integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + /json-parse-better-errors/1.0.2: + dev: true + resolution: + integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + /json-stringify-safe/5.0.1: + dev: true + resolution: + integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= /jsonfile/4.0.0: dev: true optionalDependencies: graceful-fs: 4.2.3 resolution: integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + /jsonparse/1.3.1: + dev: true + engines: + '0': node >= 0.2.0 + resolution: + integrity: sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + /lines-and-columns/1.1.6: + dev: true + resolution: + integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + /load-json-file/4.0.0: + dependencies: + graceful-fs: 4.2.3 + parse-json: 4.0.0 + pify: 3.0.0 + strip-bom: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + /locate-path/2.0.0: + dependencies: + p-locate: 2.0.0 + path-exists: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= /locate-path/5.0.0: dependencies: p-locate: 4.1.0 @@ -227,6 +1226,71 @@ packages: node: '>=8' resolution: integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + /lodash.capitalize/4.2.1: + dev: true + resolution: + integrity: sha1-+CbJtOKoUR2E46yinbBeGk87cqk= + /lodash.escaperegexp/4.1.2: + dev: true + resolution: + integrity: sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= + /lodash.get/4.4.2: + dev: true + resolution: + integrity: sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + /lodash.ismatch/4.4.0: + dev: true + resolution: + integrity: sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= + /lodash.isplainobject/4.0.6: + dev: true + resolution: + integrity: sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + /lodash.isstring/4.0.1: + dev: true + resolution: + integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + /lodash.set/4.3.2: + dev: true + resolution: + integrity: sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= + /lodash.toarray/4.4.0: + dev: true + resolution: + integrity: sha1-JMS/zWsvuji/0FlNsRedjptlZWE= + /lodash.uniq/4.5.0: + dev: true + resolution: + integrity: sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= + /lodash.uniqby/4.7.0: + dev: true + resolution: + integrity: sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= + /lodash/4.17.15: + dev: true + resolution: + integrity: sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + /loud-rejection/1.6.0: + dependencies: + currently-unhandled: 0.4.1 + signal-exit: 3.0.2 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= + /lru-cache/5.1.1: + dependencies: + yallist: 3.1.1 + dev: true + resolution: + integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + /macos-release/2.3.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== /magic-string/0.25.4: dependencies: sourcemap-codec: 1.4.6 @@ -241,22 +1305,376 @@ packages: node: '>=8' resolution: integrity: sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== + /map-obj/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + /map-obj/2.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-plzSkIepJZi4eRJXpSPgISIqwfk= + /marked-terminal/3.3.0_marked@0.7.0: + dependencies: + ansi-escapes: 3.2.0 + cardinal: 2.1.1 + chalk: 2.4.2 + cli-table: 0.3.1 + marked: 0.7.0 + node-emoji: 1.10.0 + supports-hyperlinks: 1.0.1 + dev: true + peerDependencies: + marked: ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 + resolution: + integrity: sha512-+IUQJ5VlZoAFsM5MHNT7g3RHSkA3eETqhRCdXv4niUMAKHQ7lb1yvAcuGPmm4soxhmtX13u4Li6ZToXtvSEH+A== + /marked/0.7.0: + dev: true + engines: + node: '>=0.10.0' + hasBin: true + resolution: + integrity: sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== + /meow/5.0.0: + dependencies: + camelcase-keys: 4.2.0 + decamelize-keys: 1.1.0 + loud-rejection: 1.6.0 + minimist-options: 3.0.2 + normalize-package-data: 2.5.0 + read-pkg-up: 3.0.0 + redent: 2.0.0 + trim-newlines: 2.0.0 + yargs-parser: 10.1.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== /merge-stream/2.0.0: dev: true resolution: integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + /merge2/1.3.0: + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== + /micromatch/4.0.2: + dependencies: + braces: 3.0.2 + picomatch: 2.1.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + /mime/2.4.4: + dev: true + engines: + node: '>=4.0.0' + hasBin: true + resolution: + integrity: sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== + /mimic-fn/2.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== /minimatch/3.0.4: dependencies: brace-expansion: 1.1.11 dev: true resolution: integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + /minimist-options/3.0.2: + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + dev: true + engines: + node: '>= 4' + resolution: + integrity: sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== + /minimist/0.0.10: + dev: true + resolution: + integrity: sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + /minimist/1.2.0: + dev: true + resolution: + integrity: sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + /modify-values/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== + /ms/2.0.0: + dev: true + resolution: + integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + /ms/2.1.2: + dev: true + resolution: + integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + /neo-async/2.6.1: + dev: true + resolution: + integrity: sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + /nerf-dart/1.0.0: + dev: true + resolution: + integrity: sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo= + /nice-try/1.0.5: + dev: true + resolution: + integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + /node-emoji/1.10.0: + dependencies: + lodash.toarray: 4.4.0 + dev: true + resolution: + integrity: sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== + /node-fetch/2.6.0: + dev: true + engines: + node: 4.x || >=6.0.0 + resolution: + integrity: sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + /normalize-package-data/2.5.0: + dependencies: + hosted-git-info: 2.8.5 + resolve: 1.14.1 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: true + resolution: + integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + /normalize-url/4.5.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + /npm-run-path/2.0.2: + dependencies: + path-key: 2.0.1 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + /npm-run-path/4.0.0: + dependencies: + path-key: 3.1.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-8eyAOAH+bYXFPSnNnKr3J+yoybe8O87Is5rtAQ8qRczJz1ajcsjg8l2oZqP+Ppx15Ii3S1vUTjQN2h4YO2tWWQ== + /npm/6.13.4: + bundledDependencies: + - abbrev + - ansicolors + - ansistyles + - aproba + - archy + - bin-links + - bluebird + - byte-size + - cacache + - call-limit + - chownr + - ci-info + - cli-columns + - cli-table3 + - cmd-shim + - columnify + - config-chain + - debuglog + - detect-indent + - detect-newline + - dezalgo + - editor + - figgy-pudding + - find-npm-prefix + - fs-vacuum + - fs-write-stream-atomic + - gentle-fs + - glob + - graceful-fs + - has-unicode + - hosted-git-info + - iferr + - imurmurhash + - infer-owner + - inflight + - inherits + - ini + - init-package-json + - is-cidr + - json-parse-better-errors + - JSONStream + - lazy-property + - libcipm + - libnpm + - libnpmaccess + - libnpmhook + - libnpmorg + - libnpmsearch + - libnpmteam + - libnpx + - lock-verify + - lockfile + - lodash._baseindexof + - lodash._baseuniq + - lodash._bindcallback + - lodash._cacheindexof + - lodash._createcache + - lodash._getnative + - lodash.clonedeep + - lodash.restparam + - lodash.union + - lodash.uniq + - lodash.without + - lru-cache + - meant + - mississippi + - mkdirp + - move-concurrently + - node-gyp + - nopt + - normalize-package-data + - npm-audit-report + - npm-cache-filename + - npm-install-checks + - npm-lifecycle + - npm-package-arg + - npm-packlist + - npm-pick-manifest + - npm-profile + - npm-registry-fetch + - npm-user-validate + - npmlog + - once + - opener + - osenv + - pacote + - path-is-inside + - promise-inflight + - qrcode-terminal + - query-string + - qw + - read-cmd-shim + - read-installed + - read-package-json + - read-package-tree + - read + - readable-stream + - readdir-scoped-modules + - request + - retry + - rimraf + - safe-buffer + - semver + - sha + - slide + - sorted-object + - sorted-union-stream + - ssri + - stringify-package + - tar + - text-table + - tiny-relative-date + - uid-number + - umask + - unique-filename + - unpipe + - update-notifier + - uuid + - validate-npm-package-license + - validate-npm-package-name + - which + - worker-farm + - write-file-atomic + dev: true + hasBin: true + resolution: + integrity: sha512-vTcUL4SCg3AzwInWTbqg1OIaOXlzKSS8Mb8kc5avwrJpcvevDA5J9BhYSuei+fNs3pwOp4lzA5x2FVDXACvoXA== + /octokit-pagination-methods/1.1.0: + dev: true + resolution: + integrity: sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== /once/1.4.0: dependencies: wrappy: 1.0.2 dev: true resolution: integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + /onetime/5.1.0: + dependencies: + mimic-fn: 2.1.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + /optimist/0.6.1: + dependencies: + minimist: 0.0.10 + wordwrap: 0.0.3 + dev: true + resolution: + integrity: sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + /os-name/3.1.0: + dependencies: + macos-release: 2.3.0 + windows-release: 3.2.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg== + /p-filter/2.1.0: + dependencies: + p-map: 2.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw== + /p-finally/1.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + /p-finally/2.0.1: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== + /p-is-promise/3.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ== + /p-limit/1.3.0: + dependencies: + p-try: 1.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== /p-limit/2.2.1: dependencies: p-try: 2.2.0 @@ -265,6 +1683,14 @@ packages: node: '>=6' resolution: integrity: sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== + /p-locate/2.0.0: + dependencies: + p-limit: 1.3.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= /p-locate/4.1.0: dependencies: p-limit: 2.2.1 @@ -273,12 +1699,73 @@ packages: node: '>=8' resolution: integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + /p-map/2.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + /p-reduce/2.1.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== + /p-retry/4.2.0: + dependencies: + '@types/retry': 0.12.0 + retry: 0.12.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-jPH38/MRh263KKcq0wBNOGFJbm+U6784RilTmHjB/HM9kH9V8WlCpVUcdOmip9cjXOh6MxZ5yk1z2SjDUJfWmA== + /p-try/1.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= /p-try/2.2.0: dev: true engines: node: '>=6' resolution: integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + /parent-module/1.0.1: + dependencies: + callsites: 3.1.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + /parse-json/4.0.0: + dependencies: + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + /parse-json/5.0.0: + dependencies: + '@babel/code-frame': 7.5.5 + error-ex: 1.3.2 + json-parse-better-errors: 1.0.2 + lines-and-columns: 1.1.6 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + /path-exists/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= /path-exists/4.0.0: dev: true engines: @@ -291,10 +1778,57 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + /path-key/2.0.1: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + /path-key/3.1.1: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== /path-parse/1.0.6: dev: true resolution: integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + /path-type/3.0.0: + dependencies: + pify: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + /path-type/4.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + /picomatch/2.1.1: + dev: true + engines: + node: '>=8.6' + resolution: + integrity: sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA== + /pify/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + /pkg-conf/2.1.0: + dependencies: + find-up: 2.1.0 + load-json-file: 4.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg= /pkg-dir/4.2.0: dependencies: find-up: 4.1.0 @@ -303,6 +1837,152 @@ packages: node: '>=8' resolution: integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + /process-nextick-args/2.0.1: + dev: true + resolution: + integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + /pump/3.0.0: + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + dev: true + resolution: + integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + /q/1.5.1: + dev: true + engines: + node: '>=0.6.0' + teleport: '>=0.2.0' + resolution: + integrity: sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + /quick-lru/1.1.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= + /rc/1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.5 + minimist: 1.2.0 + strip-json-comments: 2.0.1 + dev: true + hasBin: true + resolution: + integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + /read-pkg-up/3.0.0: + dependencies: + find-up: 2.1.0 + read-pkg: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + /read-pkg-up/7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + /read-pkg/3.0.0: + dependencies: + load-json-file: 4.0.0 + normalize-package-data: 2.5.0 + path-type: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + /read-pkg/5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.0 + normalize-package-data: 2.5.0 + parse-json: 5.0.0 + type-fest: 0.6.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + /readable-stream/2.3.6: + dependencies: + core-util-is: 1.0.2 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + resolution: + integrity: sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + /readable-stream/3.4.0: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + /redent/2.0.0: + dependencies: + indent-string: 3.2.0 + strip-indent: 2.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= + /redeyed/2.1.1: + dependencies: + esprima: 4.0.1 + dev: true + resolution: + integrity: sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs= + /regenerator-runtime/0.13.3: + dev: true + resolution: + integrity: sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== + /registry-auth-token/4.0.0: + dependencies: + rc: 1.2.8 + safe-buffer: 5.2.0 + dev: true + engines: + node: '>=6.0.0' + resolution: + integrity: sha512-lpQkHxd9UL6tb3k/aHAVfnVtn+Bcs9ob5InuFLLEDqSqeq+AljB8GZW9xY0x7F+xYwEcjKe07nyoxzEYz6yvkw== + /require-directory/2.1.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + /require-main-filename/2.0.0: + dev: true + resolution: + integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + /resolve-from/4.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + /resolve-from/5.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== /resolve/1.12.0: dependencies: path-parse: 1.0.6 @@ -315,6 +1995,19 @@ packages: dev: true resolution: integrity: sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg== + /retry/0.12.0: + dev: true + engines: + node: '>= 4' + resolution: + integrity: sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + /reusify/1.0.4: + dev: true + engines: + iojs: '>=1.0.0' + node: '>=0.10.0' + resolution: + integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== /rimraf/3.0.0: dependencies: glob: 7.1.6 @@ -410,6 +2103,65 @@ packages: hasBin: true resolution: integrity: sha512-hDi7M07MpmNSDE8YVwGVFA8L7n8jTLJ4lG65nMAijAyqBe//rtu4JdxjUBE7JqXfdpqxqDTbCDys9WcqdpsQvw== + /run-parallel/1.1.9: + dev: true + resolution: + integrity: sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + /safe-buffer/5.1.2: + dev: true + resolution: + integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + /safe-buffer/5.2.0: + dev: true + resolution: + integrity: sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + /semantic-release/15.13.31_semantic-release@15.13.31: + dependencies: + '@semantic-release/commit-analyzer': 6.3.3_semantic-release@15.13.31 + '@semantic-release/error': 2.2.0 + '@semantic-release/github': 5.5.5_semantic-release@15.13.31 + '@semantic-release/npm': 5.3.4_semantic-release@15.13.31 + '@semantic-release/release-notes-generator': 7.3.5_semantic-release@15.13.31 + aggregate-error: 3.0.1 + cosmiconfig: 6.0.0 + debug: 4.1.1 + env-ci: 4.5.2 + execa: 3.4.0 + figures: 3.1.0 + find-versions: 3.2.0 + get-stream: 5.1.0 + git-log-parser: 1.2.0 + hook-std: 2.0.0 + hosted-git-info: 3.0.2 + lodash: 4.17.15 + marked: 0.7.0 + marked-terminal: 3.3.0_marked@0.7.0 + p-locate: 4.1.0 + p-reduce: 2.1.0 + read-pkg-up: 7.0.1 + resolve-from: 5.0.0 + semver: 6.3.0 + signale: 1.4.0 + yargs: 15.0.2 + dev: true + engines: + node: '>=8.16' + hasBin: true + peerDependencies: + semantic-release: '*' + resolution: + integrity: sha512-mrtYkH4p0FvXIRFCsr2r5il/A+Uj7oeeq+dgyojAbr4Tzywv9AlCYHeE3A8U3eE4bMJPiBV4YnQRsk1QS8yDDw== + /semver-regex/2.0.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== + /semver/5.7.1: + dev: true + hasBin: true + resolution: + integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== /semver/6.3.0: dev: true hasBin: true @@ -419,6 +2171,58 @@ packages: dev: true resolution: integrity: sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== + /set-blocking/2.0.0: + dev: true + resolution: + integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + /shebang-command/1.2.0: + dependencies: + shebang-regex: 1.0.0 + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + /shebang-command/2.0.0: + dependencies: + shebang-regex: 3.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + /shebang-regex/1.0.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + /shebang-regex/3.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + /signal-exit/3.0.2: + dev: true + resolution: + integrity: sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + /signale/1.4.0: + dependencies: + chalk: 2.4.2 + figures: 2.0.0 + pkg-conf: 2.1.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w== + /slash/3.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== /source-map-support/0.5.16: dependencies: buffer-from: 1.1.1 @@ -436,6 +2240,117 @@ packages: dev: true resolution: integrity: sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg== + /spawn-error-forwarder/1.0.0: + dev: true + resolution: + integrity: sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk= + /spdx-correct/3.1.0: + dependencies: + spdx-expression-parse: 3.0.0 + spdx-license-ids: 3.0.5 + dev: true + resolution: + integrity: sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + /spdx-exceptions/2.2.0: + dev: true + resolution: + integrity: sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + /spdx-expression-parse/3.0.0: + dependencies: + spdx-exceptions: 2.2.0 + spdx-license-ids: 3.0.5 + dev: true + resolution: + integrity: sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + /spdx-license-ids/3.0.5: + dev: true + resolution: + integrity: sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== + /split/1.0.1: + dependencies: + through: 2.3.8 + dev: true + resolution: + integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== + /split2/1.0.0: + dependencies: + through2: 2.0.5 + dev: true + resolution: + integrity: sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ= + /split2/2.2.0: + dependencies: + through2: 2.0.5 + dev: true + resolution: + integrity: sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== + /stream-combiner2/1.1.1: + dependencies: + duplexer2: 0.1.4 + readable-stream: 2.3.6 + dev: true + resolution: + integrity: sha1-+02KFCDqNidk4hrUeAOXvry0HL4= + /string-width/4.2.0: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + /string_decoder/1.1.1: + dependencies: + safe-buffer: 5.1.2 + dev: true + resolution: + integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + /string_decoder/1.3.0: + dependencies: + safe-buffer: 5.2.0 + dev: true + resolution: + integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + /strip-ansi/6.0.0: + dependencies: + ansi-regex: 5.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + /strip-bom/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + /strip-eof/1.0.0: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + /strip-final-newline/2.0.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + /strip-indent/2.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= + /strip-json-comments/2.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo= /supports-color/5.5.0: dependencies: has-flag: 3.0.0 @@ -452,6 +2367,31 @@ packages: node: '>=6' resolution: integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + /supports-hyperlinks/1.0.1: + dependencies: + has-flag: 2.0.0 + supports-color: 5.5.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw== + /temp-dir/1.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= + /tempy/0.3.0: + dependencies: + temp-dir: 1.0.0 + type-fest: 0.3.1 + unique-string: 1.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-WrH/pui8YCwmeiAoxV+lpRH9HpRtgBhSR2ViBPgpGb/wnYDzp21R4MN45fsCGvLROvY67o3byhJRYRONJyImVQ== /terser/4.4.3: dependencies: commander: 2.20.3 @@ -463,10 +2403,75 @@ packages: hasBin: true resolution: integrity: sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA== + /text-extensions/1.9.0: + dev: true + engines: + node: '>=0.10' + resolution: + integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== + /through/2.3.8: + dev: true + resolution: + integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + /through2/2.0.5: + dependencies: + readable-stream: 2.3.6 + xtend: 4.0.2 + dev: true + resolution: + integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + /through2/3.0.1: + dependencies: + readable-stream: 3.4.0 + dev: true + resolution: + integrity: sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== + /to-regex-range/5.0.1: + dependencies: + is-number: 7.0.0 + dev: true + engines: + node: '>=8.0' + resolution: + integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + /traverse/0.6.6: + dev: true + resolution: + integrity: sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= + /trim-newlines/2.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= + /trim-off-newlines/1.0.1: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-n5up2e+odkw4dpi8v+sshI8RrbM= /tslib/1.10.0: dev: true resolution: integrity: sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + /type-fest/0.3.1: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== + /type-fest/0.6.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + /type-fest/0.8.1: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== /typescript/3.7.3: dev: true engines: @@ -474,22 +2479,158 @@ packages: hasBin: true resolution: integrity: sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== + /uglify-js/3.7.2: + dependencies: + commander: 2.20.3 + source-map: 0.6.1 + dev: true + engines: + node: '>=0.8.0' + hasBin: true + optional: true + resolution: + integrity: sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA== + /unique-string/1.0.0: + dependencies: + crypto-random-string: 1.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= + /universal-user-agent/4.0.0: + dependencies: + os-name: 3.1.0 + dev: true + resolution: + integrity: sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA== /universalify/0.1.2: dev: true engines: node: '>= 4.0.0' resolution: integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + /url-join/4.0.1: + dev: true + resolution: + integrity: sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + /util-deprecate/1.0.2: + dev: true + resolution: + integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + /validate-npm-package-license/3.0.4: + dependencies: + spdx-correct: 3.1.0 + spdx-expression-parse: 3.0.0 + dev: true + resolution: + integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + /which-module/2.0.0: + dev: true + resolution: + integrity: sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + /which/1.3.1: + dependencies: + isexe: 2.0.0 + dev: true + hasBin: true + resolution: + integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + /which/2.0.2: + dependencies: + isexe: 2.0.0 + dev: true + engines: + node: '>= 8' + hasBin: true + resolution: + integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + /windows-release/3.2.0: + dependencies: + execa: 1.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA== + /wordwrap/0.0.3: + dev: true + engines: + node: '>=0.4.0' + resolution: + integrity: sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + /wrap-ansi/6.2.0: + dependencies: + ansi-styles: 4.2.0 + string-width: 4.2.0 + strip-ansi: 6.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== /wrappy/1.0.2: dev: true resolution: integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + /xtend/4.0.2: + dev: true + engines: + node: '>=0.4' + resolution: + integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + /y18n/4.0.0: + dev: true + resolution: + integrity: sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + /yallist/3.1.1: + dev: true + resolution: + integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + /yaml/1.7.2: + dependencies: + '@babel/runtime': 7.7.7 + dev: true + engines: + node: '>= 6' + resolution: + integrity: sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw== + /yargs-parser/10.1.0: + dependencies: + camelcase: 4.1.0 + dev: true + resolution: + integrity: sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== + /yargs-parser/16.1.0: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + resolution: + integrity: sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== + /yargs/15.0.2: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.0 + which-module: 2.0.0 + y18n: 4.0.0 + yargs-parser: 16.1.0 + dev: true + resolution: + integrity: sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q== specifiers: rimraf: ^3.0.0 - rollup: ^1.27.5 + rollup: ^1.27.13 rollup-plugin-commonjs: ^10.1.0 - rollup-plugin-dts: ^1.1.12 + rollup-plugin-dts: ^1.1.13 rollup-plugin-node-resolve: ^5.2.0 - rollup-plugin-terser: ^5.1.2 - rollup-plugin-typescript2: ^0.25.2 - typescript: ^3.7.2 + rollup-plugin-terser: ^5.1.3 + rollup-plugin-typescript2: ^0.25.3 + semantic-release: ^15.13.31 + typescript: ^3.7.3 From 4cdd3862953017c414c970ae4595b17e0ff08f63 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:01:33 +0200 Subject: [PATCH 05/80] typescript(option): chore: replaced rollup-plugin-node-resolve with @rollup/plugin-node-resolve Signed-off-by: prescientmoon --- typescript/option/package.json | 2 +- typescript/option/pnpm-lock.yaml | 44 +++++++++++++++++++----------- typescript/option/rollup.config.ts | 2 +- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index 7951675..50be6d6 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -21,11 +21,11 @@ ], "sideEffects": false, "devDependencies": { + "@rollup/plugin-node-resolve": "^6.0.0", "rimraf": "^3.0.0", "rollup": "^1.27.13", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-dts": "^1.1.13", - "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-terser": "^5.1.3", "rollup-plugin-typescript2": "^0.25.3", "semantic-release": "^15.13.31", diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 095e18c..c20f9c5 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,9 +1,9 @@ devDependencies: + '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.13 rimraf: 3.0.0 rollup: 1.27.13 rollup-plugin-commonjs: 10.1.0_rollup@1.27.13 rollup-plugin-dts: 1.1.13_rollup@1.27.13+typescript@3.7.3 - rollup-plugin-node-resolve: 5.2.0_rollup@1.27.13 rollup-plugin-terser: 5.1.3_rollup@1.27.13 rollup-plugin-typescript2: 0.25.3_rollup@1.27.13+typescript@3.7.3 semantic-release: 15.13.31_semantic-release@15.13.31 @@ -106,6 +106,32 @@ packages: dev: true resolution: integrity: sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ== + /@rollup/plugin-node-resolve/6.0.0_rollup@1.27.13: + dependencies: + '@rollup/pluginutils': 3.0.0_rollup@1.27.13 + '@types/resolve': 0.0.8 + builtin-modules: 3.1.0 + is-module: 1.0.0 + resolve: 1.14.1 + rollup: 1.27.13 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0 + resolution: + integrity: sha512-GqWz1CfXOsqpeVMcoM315+O7zMxpRsmhWyhJoxLFHVSp9S64/u02i7len/FnbTNbmgYs+sZyilasijH8UiuboQ== + /@rollup/pluginutils/3.0.0_rollup@1.27.13: + dependencies: + estree-walker: 0.6.1 + rollup: 1.27.13 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0 + resolution: + integrity: sha512-qBbGQQaUUiId/lBU9VMeYlVLOoRNvz1fV8HWY5tiGDpI2gdPZHbmOfCjzSdXPhdq3XOfyWvXEBlIPbnM3+9ogQ== /@semantic-release/commit-analyzer/6.3.3_semantic-release@15.13.31: dependencies: conventional-changelog-angular: 5.0.6 @@ -2040,20 +2066,6 @@ packages: typescript: ^3.7.3 resolution: integrity: sha512-vpCSjTFodt8saLkFAi/Xn7JFgs2ZnbFYRbYyirlZjQtxS81JhU7oXuuyC9UrkftIot+/JbuavPOtI9OQoVQIcQ== - /rollup-plugin-node-resolve/5.2.0_rollup@1.27.13: - dependencies: - '@types/resolve': 0.0.8 - builtin-modules: 3.1.0 - is-module: 1.0.0 - resolve: 1.14.1 - rollup: 1.27.13 - rollup-pluginutils: 2.8.2 - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve. - dev: true - peerDependencies: - rollup: '>=1.11.0' - resolution: - integrity: sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== /rollup-plugin-terser/5.1.3_rollup@1.27.13: dependencies: '@babel/code-frame': 7.5.5 @@ -2625,11 +2637,11 @@ packages: resolution: integrity: sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q== specifiers: + '@rollup/plugin-node-resolve': ^6.0.0 rimraf: ^3.0.0 rollup: ^1.27.13 rollup-plugin-commonjs: ^10.1.0 rollup-plugin-dts: ^1.1.13 - rollup-plugin-node-resolve: ^5.2.0 rollup-plugin-terser: ^5.1.3 rollup-plugin-typescript2: ^0.25.3 semantic-release: ^15.13.31 diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index 19dadb4..4938f82 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -1,5 +1,5 @@ import commonjs from 'rollup-plugin-commonjs' -import nodeResolve from 'rollup-plugin-node-resolve' +import nodeResolve from '@rollup/plugin-node-resolve' import dts from 'rollup-plugin-dts' import typescript from 'rollup-plugin-typescript2' import { terser } from 'rollup-plugin-terser' From ec2964ecffb895640a04ccd9b007fdb17b0eab7f Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:03:26 +0200 Subject: [PATCH 06/80] typescript(option): chore: fixed github action config Signed-off-by: prescientmoon --- typescript/option/.github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/option/.github/workflows/release.yml b/typescript/option/.github/workflows/release.yml index 9fa6fea..13b1bc7 100644 --- a/typescript/option/.github/workflows/release.yml +++ b/typescript/option/.github/workflows/release.yml @@ -19,5 +19,5 @@ jobs: - run: pnpm install - run: pnpx semantic-release env: - _GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 9a2ff8d1742415217c58d8548cb4380e20002cf4 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:04:54 +0200 Subject: [PATCH 07/80] typescript(option): chore: changed amd namespace to Option Signed-off-by: prescientmoon --- typescript/option/rollup.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index 4938f82..f5ec4c8 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -32,7 +32,7 @@ export default [ file: `${outputDirectory}/bundle.amd.js`, sourcemap: true, format: 'amd', - name: 'Loopover' + name: 'Option' } ], plugins: [ From 068f6ebd508c84f1e6c7be07127097a86d57702b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:06:56 +0200 Subject: [PATCH 08/80] typescript(option): chore: added a Readme Signed-off-by: prescientmoon --- typescript/option/README.md | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 typescript/option/README.md diff --git a/typescript/option/README.md b/typescript/option/README.md new file mode 100644 index 0000000..2ec954c --- /dev/null +++ b/typescript/option/README.md @@ -0,0 +1,38 @@ +![npm (scoped)](https://img.shields.io/npm/v/@adrielus/option?style=for-the-badge) +![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@adrielus/option?style=for-the-badge) +[![forthebadge](https://forthebadge.com/images/badges/powered-by-water.svg)](https://forthebadge.com) + +# Option + +## Installation + +```sh +npm install @adrielus/option +``` + +(There is also an amd build at `/dist/bundle.amd.js` which uses the `Option` namespace) + +## Usage + +Curently there are no docs, but all functions have the same type definition as the ones from [fsharp](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/core.option-module-%5Bfsharp%5D) (except the ones from my package are not curreied) + +# Contributing + +First, clone this repo: + +```sh +git clone https://github.com/Mateiadrielrafael/option +cd option +``` + +Then use **_pnpm_** to install the dependencies: + +```sh +pnpm install +``` + +You can use the `build` command to build the package (this is dont automatically by github actions): + +```sh +pnpm run build +``` From c226f17987b22ba671775f35c2101503acdae2e8 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:10:32 +0200 Subject: [PATCH 09/80] typescript(option): chore: fixed github action config... again Signed-off-by: prescientmoon --- typescript/option/.github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/option/.github/workflows/release.yml b/typescript/option/.github/workflows/release.yml index 13b1bc7..7ee9048 100644 --- a/typescript/option/.github/workflows/release.yml +++ b/typescript/option/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: # install dependencies and run semantic-release - run: npm i -g pnpm - run: pnpm install + - run: pnpm run build - run: pnpx semantic-release env: GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} From 0458b226c7f6f9e5ae219f0364b8142e2a2ab2b5 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:17:55 +0200 Subject: [PATCH 10/80] typescript(option): refactor: created some internal helpers to clean some of the code Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 45 ++++++----------------- typescript/option/src/internalHelperts.ts | 2 + 2 files changed, 13 insertions(+), 34 deletions(-) create mode 100644 typescript/option/src/internalHelperts.ts diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 9967f8a..3d68a9c 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -1,5 +1,6 @@ import { Option, Some, None } from './types' import { Binder, Folder, Mapper, Predicate, BackFolder } from './internalTypes' +import { always, identity } from './internalHelperts' import Internals, { SomeClass } from './internals' export const isSome = (option: Option) => @@ -9,8 +10,8 @@ export const isNothing = (option: Option) => export const match = ( option: Option, - caseSome: (v: T) => U, - caseNone: () => U + caseSome: Mapper, + caseNone: Mapper ) => { if (isSome(option)) { return caseSome((option as SomeClass)[Internals.someValue]) @@ -23,32 +24,24 @@ export const bind = ( binder: Binder, option: Option ): Option => { - return match(option, binder, () => None) + return match(option, binder, always(None)) } export const map = ( mapper: Mapper, option: Option ): Option => { - return match( - option, - v => Some(mapper(v)), - () => None - ) + return match(option, v => Some(mapper(v)), always(None)) } export const count = (option: Option) => Number(isSome(option)) export const exists = (predicate: Predicate, option: Option) => { - return match(option, predicate, () => false) + return match(option, predicate, always(false)) } export const filter = (predicate: Predicate, option: Option) => { - return match( - option, - v => (predicate(v) ? Some(v) : None), - () => None - ) + return match(option, v => (predicate(v) ? Some(v) : None), always(None)) } export const fold = ( @@ -56,11 +49,7 @@ export const fold = ( initial: U, option: Option ) => { - match( - option, - v => folder(initial, v), - () => initial - ) + match(option, v => folder(initial, v), always(initial)) } export const foldback = ( @@ -68,11 +57,7 @@ export const foldback = ( option: Option, initial: U ) => { - return match( - option, - v => folder(v, initial), - () => initial - ) + return match(option, v => folder(v, initial), always(initial)) } export const forall = (predicate: Predicate, option: Option) => { @@ -94,17 +79,9 @@ export const iter = (mapper: Mapper, option: Option) => { } export const toArray = (option: Option) => { - return match( - option, - v => [v], - () => [] - ) + return match(option, v => [v], always([])) } export const toNullable = (option: Option) => { - return match( - option, - v => v, - () => null - ) + return match(option, identity, always(null)) } diff --git a/typescript/option/src/internalHelperts.ts b/typescript/option/src/internalHelperts.ts new file mode 100644 index 0000000..693472b --- /dev/null +++ b/typescript/option/src/internalHelperts.ts @@ -0,0 +1,2 @@ +export const always = (v: T) => () => v +export const identity = (v: T) => v From 4ebe549c293c76921fb9f40854dc55fb7b303f30 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:20:47 +0200 Subject: [PATCH 11/80] typescript(option): feat: added a withDefault hepler Signed-off-by: prescientmoon --- typescript/option/README.md | 2 ++ typescript/option/src/helpers.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/typescript/option/README.md b/typescript/option/README.md index 2ec954c..7aefdc9 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -16,6 +16,8 @@ npm install @adrielus/option Curently there are no docs, but all functions have the same type definition as the ones from [fsharp](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/core.option-module-%5Bfsharp%5D) (except the ones from my package are not curreied) +There are also a few original helpers (match, and withDefault), but I'ts pretty easy to guess what those do + # Contributing First, clone this repo: diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 3d68a9c..7e4017c 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -85,3 +85,7 @@ export const toArray = (option: Option) => { export const toNullable = (option: Option) => { return match(option, identity, always(null)) } + +export const withDefault = (_default: T, option: Option) => { + return match(option, identity, always(_default)) +} From 17569d94170b3f70841198779821f3c58b2445de Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:27:19 +0200 Subject: [PATCH 12/80] typescript(option): chore: explicitly set package to public Signed-off-by: prescientmoon --- typescript/option/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/typescript/option/package.json b/typescript/option/package.json index 50be6d6..d19279e 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -9,6 +9,9 @@ "prebuild": "rimraf dist", "build": "rollup -c rollup.config.ts" }, + "publishConfig": { + "access": "public" + }, "files": [ "dist" ], From c9cc0b0f2239e8d39abca471f04157e6900adb0e Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 14:34:48 +0200 Subject: [PATCH 13/80] typescript(option): feat: added a "flat" helper Signed-off-by: prescientmoon --- typescript/option/README.md | 2 +- typescript/option/src/helpers.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/typescript/option/README.md b/typescript/option/README.md index 7aefdc9..7c24f01 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -16,7 +16,7 @@ npm install @adrielus/option Curently there are no docs, but all functions have the same type definition as the ones from [fsharp](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/core.option-module-%5Bfsharp%5D) (except the ones from my package are not curreied) -There are also a few original helpers (match, and withDefault), but I'ts pretty easy to guess what those do +There are also a few original helpers (match, flat and withDefault), but I'ts pretty easy to guess what those do # Contributing diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 7e4017c..2351ffc 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -1,7 +1,7 @@ import { Option, Some, None } from './types' import { Binder, Folder, Mapper, Predicate, BackFolder } from './internalTypes' import { always, identity } from './internalHelperts' -import Internals, { SomeClass } from './internals' +import Internals, { SomeClass, isOption } from './internals' export const isSome = (option: Option) => option instanceof Internals.SomeClass @@ -89,3 +89,7 @@ export const toNullable = (option: Option) => { export const withDefault = (_default: T, option: Option) => { return match(option, identity, always(_default)) } + +export const flat = (option: Option>) => { + return bind(inner => (isSome(inner) ? flat(inner) : inner), option) +} From 1fda9e824210165dadda2c1e2343dfddee4369ae Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 15:12:01 +0200 Subject: [PATCH 14/80] typescript(option): fix: fixed the flat helper returning a non-option value Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 2351ffc..bb455ad 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -90,6 +90,18 @@ export const withDefault = (_default: T, option: Option) => { return match(option, identity, always(_default)) } -export const flat = (option: Option>) => { - return bind(inner => (isSome(inner) ? flat(inner) : inner), option) +const checkIfOption = (x): x is Option => x[isOption] + +export const flat = (option: Option) => { + return match( + option, + inner => { + if (checkIfOption(inner)) { + return flat(inner) + } else { + return Some(inner) + } + }, + always(None) + ) } From 5c3225273c2b85c0129b6c6adc8ceabf7b5f3920 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 20:23:59 +0200 Subject: [PATCH 15/80] typescript(option): fix: fixed fold returning void Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index bb455ad..b248d65 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -49,7 +49,7 @@ export const fold = ( initial: U, option: Option ) => { - match(option, v => folder(initial, v), always(initial)) + return match(option, v => folder(initial, v), always(initial)) } export const foldback = ( @@ -92,7 +92,7 @@ export const withDefault = (_default: T, option: Option) => { const checkIfOption = (x): x is Option => x[isOption] -export const flat = (option: Option) => { +export const flat = (option: Option): Option => { return match( option, inner => { From 64cbae483000868797b8e4d50efc70a9e2873f69 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 20:42:23 +0200 Subject: [PATCH 16/80] typescript(option): docs: started working on the docs Signed-off-by: prescientmoon --- typescript/option/README.md | 4 +- typescript/option/docs/main.md | 190 +++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 3 deletions(-) create mode 100644 typescript/option/docs/main.md diff --git a/typescript/option/README.md b/typescript/option/README.md index 7c24f01..734f94d 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -14,9 +14,7 @@ npm install @adrielus/option ## Usage -Curently there are no docs, but all functions have the same type definition as the ones from [fsharp](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/core.option-module-%5Bfsharp%5D) (except the ones from my package are not curreied) - -There are also a few original helpers (match, flat and withDefault), but I'ts pretty easy to guess what those do +For detailed usage read [the docs](docs/main.md) # Contributing diff --git a/typescript/option/docs/main.md b/typescript/option/docs/main.md new file mode 100644 index 0000000..3e0d141 --- /dev/null +++ b/typescript/option/docs/main.md @@ -0,0 +1,190 @@ +# Documentation + +## Table of contents: + +### General: + +- [Option](#Option) +- [Some](#Some) +- [None](#None) + +### Helpers: + +- [bind](#Bind) +- [count](#Count) +- [exists](#Exists) +- [filter](#Filter) +- [fold](#Fold) +- [foldback](#Foldback) +- [forall](#Forall) + +# General + +## Option + +Data type holding an optional value (can be either None or Some(x)) + +### Signature + +```ts +type Option = Internals.SomeClass | Internals.NoneClass +``` + +## None + +Value holding nothing + +### Signature + +```ts +const None: Internals.NoneClass +``` + +## Some + +Creates an Option instance holding a value + +### Signature + +```ts +const Some: (v: T) => Internals.SomeClass +``` + +### Usage + +```ts +import { Some } from '@adrielus/option' + +Some(x) // Some(x) +``` + +# Helpers + +## Bind + +Invokes a function on an optional value that itself yields an option. + +### Signature + +```ts +const bind: (binder: Mapper>, option: Option) => Option +``` + +### Usage + +```ts +import { Some, None, bind } from '@adrielus/option' + +const half = (x: number) => (x % 2 ? None : Some(x / 2)) + +bind(half, Some(14)) // Some(7) +bind(half, Some(13)) // None +bind(half, None) // None +``` + +## Count + +Returns a zero if the option is None, a one otherwise. + +### Signature: + +```ts +const count: (option: Option) => number +``` + +### Usage + +```ts +import { Some, None, count } from '@adrielus/option' + +count(Some(x)) // 1 +count(None) // 0 +``` + +## Exists + +Returns false if the option is None, otherwise it returns the result of applying the predicate to the option value. + +### Signature + +```ts +const exists: (predicate: Mapper, option: Option) => boolean +``` + +### Usage + +```ts +import { Some, None, exists } from '@adrielus/option' + +exists(() => true, None) // false +exists(() => true, Some(x)) // true +exists(() => false, Some(x)) // false +``` + +## Filter + +Invokes a function on an optional value that itself yields an option. + +### Signature: + +```ts +const filter: (predicate: Mapper, option: Option) => NoneClass +``` + +### Usage + +```ts +import { Some, None, filter } from '@adrielus/option' + +filter(() => true, None) // None +filter(() => true, Some(x)) // Some(x) +filter(() => false, Some(x)) // None +``` + +## Fold + +A function to update the state data when given a value from an option. + +### Signature + +```ts +const fold: (folder: Folder, initial: U, option: Option) => U +``` + +### Usage + +```ts +import { Some, None, fold } from '@adrielus/option' + +const add = (a: number, b: number) => a + b + +fold(add, x, None) // x +fold(add, x, Some(y)) // x + y +``` + +## Foldback + +A function to update the state data when given a value from an option. + +### Signature + +```ts +const foldback: ( + folder: BackFolder, + option: Option, + initial: U +) => U +``` + +### Usage + +```ts +import { Some, None, foldback } from '@adrielus/option' + +const add = (a: number, b: number) => a + b + +foldback(add, None, x) // x +foldback(add, Some(y), x) // x + y +``` + +**_This is still work in progress, right now only covering about 60% of the library. Contributions are welcome_** From 04ca5c6e00cfc1ae4675cecc11cbbd2e0ff1e887 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 19 Dec 2019 20:58:54 +0200 Subject: [PATCH 17/80] typescript(option): chore: fixed readme docs url Signed-off-by: prescientmoon --- typescript/option/.vscode/settings.json | 4 ++++ typescript/option/README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 typescript/option/.vscode/settings.json diff --git a/typescript/option/.vscode/settings.json b/typescript/option/.vscode/settings.json new file mode 100644 index 0000000..adb3e3c --- /dev/null +++ b/typescript/option/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "editor.formatOnSave": true +} diff --git a/typescript/option/README.md b/typescript/option/README.md index 734f94d..cf3f23c 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -14,7 +14,7 @@ npm install @adrielus/option ## Usage -For detailed usage read [the docs](docs/main.md) +For detailed usage read [the docs](https://github.com/Mateiadrielrafael/option/tree/master/docs/main.md) # Contributing From aa18688c7a177590d51bf99299c8e5e196d5b98c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 14:41:13 +0200 Subject: [PATCH 18/80] typescript(option): refactor: refactored iter to use always Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index b248d65..fb87ce1 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -75,7 +75,7 @@ export const get = (option: Option) => { } export const iter = (mapper: Mapper, option: Option) => { - match(option, mapper, () => {}) + return match(option, mapper, always(None)) } export const toArray = (option: Option) => { From 1f1afc0f28f309462cbd4a0b27883a6b77213722 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 14:44:42 +0200 Subject: [PATCH 19/80] typescript(option): feat: added a fromNullable helper Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index fb87ce1..09a419f 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -105,3 +105,7 @@ export const flat = (option: Option): Option => { always(None) ) } + +export const fromNullable = (value: null | T): Option => { + return value === null ? None : Some(value) +} From 6bd58b46ff6505b8b22aff297ef2d38f90e3fbb9 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 14:46:53 +0200 Subject: [PATCH 20/80] typescript(option): docs: added the docs for the fromNullable helper Signed-off-by: prescientmoon --- typescript/option/docs/main.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/typescript/option/docs/main.md b/typescript/option/docs/main.md index 3e0d141..e2c05a2 100644 --- a/typescript/option/docs/main.md +++ b/typescript/option/docs/main.md @@ -187,4 +187,23 @@ foldback(add, None, x) // x foldback(add, Some(y), x) // x + y ``` +# FromNullable + +A function to create options from nullable values. + +### Signature + +```ts +const fromNullable: (value: T | null) => Option +``` + +### Usage + +```ts +import { Some, None, fromNullable } from '@adrielus/option' + +fromNullable(7) // Some(7) +fromNullable(null) // None +``` + **_This is still work in progress, right now only covering about 60% of the library. Contributions are welcome_** From 689c7466824dd5990b106e31aad47c45d0031c1d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 14:54:40 +0200 Subject: [PATCH 21/80] typescript(option): refactor: islotated T | null in a Nullable internal type and updated the docs Signed-off-by: prescientmoon --- typescript/option/docs/main.md | 2 +- typescript/option/src/helpers.ts | 11 +++++++++-- typescript/option/src/internalTypes.ts | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/typescript/option/docs/main.md b/typescript/option/docs/main.md index e2c05a2..db1f2ec 100644 --- a/typescript/option/docs/main.md +++ b/typescript/option/docs/main.md @@ -194,7 +194,7 @@ A function to create options from nullable values. ### Signature ```ts -const fromNullable: (value: T | null) => Option +const fromNullable: (value: Nullable) => Option ``` ### Usage diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 09a419f..629e830 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -1,5 +1,12 @@ import { Option, Some, None } from './types' -import { Binder, Folder, Mapper, Predicate, BackFolder } from './internalTypes' +import { + Binder, + Folder, + Mapper, + Predicate, + BackFolder, + Nullable +} from './internalTypes' import { always, identity } from './internalHelperts' import Internals, { SomeClass, isOption } from './internals' @@ -106,6 +113,6 @@ export const flat = (option: Option): Option => { ) } -export const fromNullable = (value: null | T): Option => { +export const fromNullable = (value: Nullable): Option => { return value === null ? None : Some(value) } diff --git a/typescript/option/src/internalTypes.ts b/typescript/option/src/internalTypes.ts index a636b21..091ab91 100644 --- a/typescript/option/src/internalTypes.ts +++ b/typescript/option/src/internalTypes.ts @@ -5,3 +5,4 @@ export type Binder = Mapper> export type Predicate = Mapper export type Folder = (s: U, v: T) => U export type BackFolder = (v: T, s: U) => U +export type Nullable = T | null From 15f54ea45fd4d6ddc9c3c2b186db986991d2ca8b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 14:57:46 +0200 Subject: [PATCH 22/80] typescript(option): feat: added a fromArray helper Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 629e830..296edd2 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -116,3 +116,7 @@ export const flat = (option: Option): Option => { export const fromNullable = (value: Nullable): Option => { return value === null ? None : Some(value) } + +export const fromArray = (value: [T] | []): Option => { + return value[0] === undefined ? None : Some(value[0]) +} From 7c143655aecb0fe02e25af139dab0e4b8b1dcdfa Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 15:00:09 +0200 Subject: [PATCH 23/80] typescript(option): feat: added the fromArray function to the docs Signed-off-by: prescientmoon --- typescript/option/docs/main.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/typescript/option/docs/main.md b/typescript/option/docs/main.md index db1f2ec..7609ce1 100644 --- a/typescript/option/docs/main.md +++ b/typescript/option/docs/main.md @@ -17,6 +17,7 @@ - [fold](#Fold) - [foldback](#Foldback) - [forall](#Forall) +- [fromArray](#FromArray) # General @@ -206,4 +207,23 @@ fromNullable(7) // Some(7) fromNullable(null) // None ``` +## FromArray + +A function to create options from arrays. If the given array is empty produces None, else Some of the first element. + +### Signature + +```ts +const fromArray: (value: [T] | []) => Option +``` + +### Usage + +```ts +import { Some, None, fromArray } from '@adrielus/option' + +fromArray([7]) // Some(7) +fromArray([]) // None +``` + **_This is still work in progress, right now only covering about 60% of the library. Contributions are welcome_** From db6417d8719226456c66d21c86f84919e4f2a6a2 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 20 Dec 2019 15:00:54 +0200 Subject: [PATCH 24/80] typescript(option): docs: fixed the fromNullable section not beeing in the table of contents Signed-off-by: prescientmoon --- typescript/option/docs/main.md | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/option/docs/main.md b/typescript/option/docs/main.md index 7609ce1..2d30523 100644 --- a/typescript/option/docs/main.md +++ b/typescript/option/docs/main.md @@ -17,6 +17,7 @@ - [fold](#Fold) - [foldback](#Foldback) - [forall](#Forall) +- [fromNullable](#FromNullable) - [fromArray](#FromArray) # General From 906096a5cb5d60eb98e477fa8a56fc54030bb417 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 22 Dec 2019 15:38:16 +0200 Subject: [PATCH 25/80] typescript(option): feat: Refactored everything to use nominal types typescript(option): typescript(option): BREAKING CHANGE: flat only works on one layer but is now strongly typed | everything uses nominal types now | match has the correct parameter order Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 76 ++++++++++------------- typescript/option/src/internalHelperts.ts | 1 - typescript/option/src/internals.ts | 28 ++------- typescript/option/src/types.ts | 18 ++++-- 4 files changed, 51 insertions(+), 72 deletions(-) diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 296edd2..5f28819 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -7,48 +7,48 @@ import { BackFolder, Nullable } from './internalTypes' -import { always, identity } from './internalHelperts' -import Internals, { SomeClass, isOption } from './internals' +import { identity } from './internalHelperts' +import { none, some } from './internals' -export const isSome = (option: Option) => - option instanceof Internals.SomeClass -export const isNothing = (option: Option) => - option instanceof Internals.NoneClass +export const isSome = (option: Option): option is Some => + option.type === some +export const isNothing = (option: Option): option is None => + option.type === none -export const match = ( - option: Option, +const match = ( caseSome: Mapper, - caseNone: Mapper + _default: U, + option: Option ) => { if (isSome(option)) { - return caseSome((option as SomeClass)[Internals.someValue]) + return caseSome(option.value as T) } - return caseNone() + return _default } export const bind = ( binder: Binder, option: Option ): Option => { - return match(option, binder, always(None)) + return match(binder, None, option) } export const map = ( mapper: Mapper, option: Option ): Option => { - return match(option, v => Some(mapper(v)), always(None)) + return match(v => Some(mapper(v)), None, option) } export const count = (option: Option) => Number(isSome(option)) export const exists = (predicate: Predicate, option: Option) => { - return match(option, predicate, always(false)) + return match(predicate, false, option) } export const filter = (predicate: Predicate, option: Option) => { - return match(option, v => (predicate(v) ? Some(v) : None), always(None)) + return match(v => (predicate(v) ? Some(v) : None), None, option) } export const fold = ( @@ -56,7 +56,7 @@ export const fold = ( initial: U, option: Option ) => { - return match(option, v => folder(initial, v), always(initial)) + return match(v => folder(initial, v), initial, option) } export const foldback = ( @@ -64,53 +64,41 @@ export const foldback = ( option: Option, initial: U ) => { - return match(option, v => folder(v, initial), always(initial)) + return match(v => folder(v, initial), initial, option) } export const forall = (predicate: Predicate, option: Option) => { - return match(option, predicate, () => true) + return match(predicate, true, option) } -export const get = (option: Option) => { - return match( - option, - v => v, - () => { - throw new Error('Cannot get value from None') - } - ) +export const get = (option: Option): T => { + if (isSome(option)) { + return option.value + } + + throw new Error(`Cannot get value of None`) } export const iter = (mapper: Mapper, option: Option) => { - return match(option, mapper, always(None)) + if (isSome(option)) { + mapper(option.value) + } } export const toArray = (option: Option) => { - return match(option, v => [v], always([])) + return match(v => [v], [], option) } export const toNullable = (option: Option) => { - return match(option, identity, always(null)) + return match(identity, null, option) } export const withDefault = (_default: T, option: Option) => { - return match(option, identity, always(_default)) + return match(identity, _default, option) } -const checkIfOption = (x): x is Option => x[isOption] - -export const flat = (option: Option): Option => { - return match( - option, - inner => { - if (checkIfOption(inner)) { - return flat(inner) - } else { - return Some(inner) - } - }, - always(None) - ) +export const flat = (option: Option>): Option => { + return bind(identity, option) } export const fromNullable = (value: Nullable): Option => { diff --git a/typescript/option/src/internalHelperts.ts b/typescript/option/src/internalHelperts.ts index 693472b..d1600f3 100644 --- a/typescript/option/src/internalHelperts.ts +++ b/typescript/option/src/internalHelperts.ts @@ -1,2 +1 @@ -export const always = (v: T) => () => v export const identity = (v: T) => v diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 2ec597a..f4845fd 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -1,25 +1,7 @@ -export const isOption = Symbol('option') -export const someValue = Symbol('value') +export const some = Symbol('some') +export const none = Symbol('none') -export class SomeClass { - public [isOption] = true - public [someValue]: T - - public constructor(value: T) { - this[someValue] = value - } - - public toString() { - return `Some(${this[someValue]})` - } +export type NominalTyped = { + type: T + value: U } - -export class NoneClass { - public [isOption] = true - - public toString() { - return 'None' - } -} - -export default { NoneClass, SomeClass, isOption, someValue } diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index 3f55148..ff1d556 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,6 +1,16 @@ -import * as Internals from './internals' +import { NominalTyped, none, some } from './internals' -export type Option = Internals.SomeClass | Internals.NoneClass +export type None = NominalTyped +export type Some = NominalTyped -export const None = new Internals.NoneClass() -export const Some = (v: T) => new Internals.SomeClass(v) +export type Option = Some | None + +export const None: Option = { + type: none, + value: null +} + +export const Some = (value: T): Option => ({ + type: some, + value +}) From 6f938855070709df73ef404ca2c49dfabfb7fc96 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 22 Dec 2019 17:38:10 +0200 Subject: [PATCH 26/80] typescript(option): chore: fixed build process Signed-off-by: prescientmoon --- typescript/option/package.json | 14 +- typescript/option/pnpm-lock.yaml | 1200 +++++++++++++++++++++++++--- typescript/option/rollup.config.ts | 43 +- typescript/option/src/helpers.ts | 14 +- typescript/option/src/internals.ts | 6 +- typescript/option/src/types.ts | 8 +- 6 files changed, 1132 insertions(+), 153 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index d19279e..dd9ded0 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -3,8 +3,8 @@ "version": "0.0.0-development", "description": "Typescript version of fsharps Option module", "main": "dist/bundle.cjs.js", - "module": "dist/bundle.esm.js", - "typings": "dist/index.d.ts", + "module": "dist/index.esm.js", + "typings": "dist/index.esm.d.ts", "scripts": { "prebuild": "rimraf dist", "build": "rollup -c rollup.config.ts" @@ -24,15 +24,15 @@ ], "sideEffects": false, "devDependencies": { + "@rollup/plugin-commonjs": "^11.0.0", "@rollup/plugin-node-resolve": "^6.0.0", + "@types/node": "^12.12.21", + "@wessberg/rollup-plugin-ts": "^1.1.83", "rimraf": "^3.0.0", "rollup": "^1.27.13", - "rollup-plugin-commonjs": "^10.1.0", - "rollup-plugin-dts": "^1.1.13", "rollup-plugin-terser": "^5.1.3", - "rollup-plugin-typescript2": "^0.25.3", - "semantic-release": "^15.13.31", - "typescript": "^3.7.3" + "semantic-release": "^15.14.0", + "typescript": "^3.7.4" }, "author": "Matei Adriel", "license": "SEE LICENSE IN LICENSE" diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index c20f9c5..685f1b0 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,13 +1,13 @@ devDependencies: + '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.13 '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.13 + '@types/node': 12.12.21 + '@wessberg/rollup-plugin-ts': 1.1.83_rollup@1.27.13+typescript@3.7.4 rimraf: 3.0.0 rollup: 1.27.13 - rollup-plugin-commonjs: 10.1.0_rollup@1.27.13 - rollup-plugin-dts: 1.1.13_rollup@1.27.13+typescript@3.7.3 rollup-plugin-terser: 5.1.3_rollup@1.27.13 - rollup-plugin-typescript2: 0.25.3_rollup@1.27.13+typescript@3.7.3 - semantic-release: 15.13.31_semantic-release@15.13.31 - typescript: 3.7.3 + semantic-release: 15.14.0_semantic-release@15.14.0 + typescript: 3.7.4 lockfileVersion: 5.1 packages: /@babel/code-frame/7.5.5: @@ -16,6 +16,190 @@ packages: dev: true resolution: integrity: sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + /@babel/core/7.7.7: + dependencies: + '@babel/code-frame': 7.5.5 + '@babel/generator': 7.7.7 + '@babel/helpers': 7.7.4 + '@babel/parser': 7.7.7 + '@babel/template': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + convert-source-map: 1.7.0 + debug: 4.1.1 + json5: 2.1.1 + lodash: 4.17.15 + resolve: 1.14.1 + semver: 5.7.1 + source-map: 0.5.7 + dev: true + engines: + node: '>=6.9.0' + resolution: + integrity: sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ== + /@babel/generator/7.7.7: + dependencies: + '@babel/types': 7.7.4 + jsesc: 2.5.2 + lodash: 4.17.15 + source-map: 0.5.7 + dev: true + resolution: + integrity: sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ== + /@babel/helper-annotate-as-pure/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og== + /@babel/helper-builder-binary-assignment-operator-visitor/7.7.4: + dependencies: + '@babel/helper-explode-assignable-expression': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ== + /@babel/helper-call-delegate/7.7.4: + dependencies: + '@babel/helper-hoist-variables': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA== + /@babel/helper-create-regexp-features-plugin/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-regex': 7.5.5 + regexpu-core: 4.6.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0 + resolution: + integrity: sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A== + /@babel/helper-define-map/7.7.4: + dependencies: + '@babel/helper-function-name': 7.7.4 + '@babel/types': 7.7.4 + lodash: 4.17.15 + dev: true + resolution: + integrity: sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg== + /@babel/helper-explode-assignable-expression/7.7.4: + dependencies: + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg== + /@babel/helper-function-name/7.7.4: + dependencies: + '@babel/helper-get-function-arity': 7.7.4 + '@babel/template': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ== + /@babel/helper-get-function-arity/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== + /@babel/helper-hoist-variables/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ== + /@babel/helper-member-expression-to-functions/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw== + /@babel/helper-module-imports/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ== + /@babel/helper-module-transforms/7.7.5: + dependencies: + '@babel/helper-module-imports': 7.7.4 + '@babel/helper-simple-access': 7.7.4 + '@babel/helper-split-export-declaration': 7.7.4 + '@babel/template': 7.7.4 + '@babel/types': 7.7.4 + lodash: 4.17.15 + dev: true + resolution: + integrity: sha512-A7pSxyJf1gN5qXVcidwLWydjftUN878VkalhXX5iQDuGyiGK3sOrrKKHF4/A4fwHtnsotv/NipwAeLzY4KQPvw== + /@babel/helper-optimise-call-expression/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg== + /@babel/helper-plugin-utils/7.0.0: + dev: true + resolution: + integrity: sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + /@babel/helper-regex/7.5.5: + dependencies: + lodash: 4.17.15 + dev: true + resolution: + integrity: sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw== + /@babel/helper-remap-async-to-generator/7.7.4: + dependencies: + '@babel/helper-annotate-as-pure': 7.7.4 + '@babel/helper-wrap-function': 7.7.4 + '@babel/template': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw== + /@babel/helper-replace-supers/7.7.4: + dependencies: + '@babel/helper-member-expression-to-functions': 7.7.4 + '@babel/helper-optimise-call-expression': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg== + /@babel/helper-simple-access/7.7.4: + dependencies: + '@babel/template': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A== + /@babel/helper-split-export-declaration/7.7.4: + dependencies: + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== + /@babel/helper-wrap-function/7.7.4: + dependencies: + '@babel/helper-function-name': 7.7.4 + '@babel/template': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg== + /@babel/helpers/7.7.4: + dependencies: + '@babel/template': 7.7.4 + '@babel/traverse': 7.7.4 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg== /@babel/highlight/7.5.0: dependencies: chalk: 2.4.2 @@ -24,12 +208,543 @@ packages: dev: true resolution: integrity: sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + /@babel/parser/7.7.7: + dev: true + engines: + node: '>=6.0.0' + hasBin: true + resolution: + integrity: sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw== + /@babel/plugin-proposal-async-generator-functions/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-remap-async-to-generator': 7.7.4 + '@babel/plugin-syntax-async-generators': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw== + /@babel/plugin-proposal-dynamic-import/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/plugin-syntax-dynamic-import': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ== + /@babel/plugin-proposal-json-strings/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/plugin-syntax-json-strings': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-wQvt3akcBTfLU/wYoqm/ws7YOAQKu8EVJEvHip/mzkNtjaclQoCCIqKXFP5/eyfnfbQCDV3OLRIK3mIVyXuZlw== + /@babel/plugin-proposal-object-rest-spread/7.7.7_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/plugin-syntax-object-rest-spread': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-3qp9I8lelgzNedI3hrhkvhaEYree6+WHnyA/q4Dza9z7iEIs1eyhWyJnetk3jJ69RT0AT4G0UhEGwyGFJ7GUuQ== + /@babel/plugin-proposal-optional-catch-binding/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/plugin-syntax-optional-catch-binding': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w== + /@babel/plugin-proposal-unicode-property-regex/7.7.7_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-create-regexp-features-plugin': 7.7.4_@babel+core@7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + engines: + node: '>=4' + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-80PbkKyORBUVm1fbTLrHpYdJxMThzM1UqFGh0ALEhO9TYbG86Ah9zQYAB/84axz2vcxefDLdZwWwZNlYARlu9w== + /@babel/plugin-syntax-async-generators/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g== + /@babel/plugin-syntax-dynamic-import/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg== + /@babel/plugin-syntax-json-strings/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-QpGupahTQW1mHRXddMG5srgpHWqRLwJnJZKXTigB9RPFCCGbDGCgBeM/iC82ICXp414WeYx/tD54w7M2qRqTMg== + /@babel/plugin-syntax-object-rest-spread/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg== + /@babel/plugin-syntax-optional-catch-binding/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ== + /@babel/plugin-syntax-top-level-await/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-wdsOw0MvkL1UIgiQ/IFr3ETcfv1xb8RMM0H9wbiDyLaJFyiDg5oZvDLCXosIXmFeIlweML5iOBXAkqddkYNizg== + /@babel/plugin-transform-arrow-functions/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA== + /@babel/plugin-transform-async-to-generator/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-imports': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-remap-async-to-generator': 7.7.4 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg== + /@babel/plugin-transform-block-scoped-functions/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ== + /@babel/plugin-transform-block-scoping/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + lodash: 4.17.15 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg== + /@babel/plugin-transform-classes/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-annotate-as-pure': 7.7.4 + '@babel/helper-define-map': 7.7.4 + '@babel/helper-function-name': 7.7.4 + '@babel/helper-optimise-call-expression': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-replace-supers': 7.7.4 + '@babel/helper-split-export-declaration': 7.7.4 + globals: 11.12.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg== + /@babel/plugin-transform-computed-properties/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ== + /@babel/plugin-transform-destructuring/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA== + /@babel/plugin-transform-dotall-regex/7.7.7_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-create-regexp-features-plugin': 7.7.4_@babel+core@7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-b4in+YlTeE/QmTgrllnb3bHA0HntYvjz8O3Mcbx75UBPJA2xhb5A8nle498VhxSXJHQefjtQxpnLPehDJ4TRlg== + /@babel/plugin-transform-duplicate-keys/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-g1y4/G6xGWMD85Tlft5XedGaZBCIVN+/P0bs6eabmcPP9egFleMAo65OOjlhcz1njpwagyY3t0nsQC9oTFegJA== + /@babel/plugin-transform-exponentiation-operator/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ== + /@babel/plugin-transform-for-of/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA== + /@babel/plugin-transform-function-name/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-function-name': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g== + /@babel/plugin-transform-literals/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw== + /@babel/plugin-transform-member-expression-literals/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA== + /@babel/plugin-transform-modules-amd/7.7.5_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-transforms': 7.7.5 + '@babel/helper-plugin-utils': 7.0.0 + babel-plugin-dynamic-import-node: 2.3.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-CT57FG4A2ZUNU1v+HdvDSDrjNWBrtCmSH6YbbgN3Lrf0Di/q/lWRxZrE72p3+HCCz9UjfZOEBdphgC0nzOS6DQ== + /@babel/plugin-transform-modules-commonjs/7.7.5_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-transforms': 7.7.5 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-simple-access': 7.7.4 + babel-plugin-dynamic-import-node: 2.3.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-9Cq4zTFExwFhQI6MT1aFxgqhIsMWQWDVwOgLzl7PTWJHsNaqFvklAU+Oz6AQLAS0dJKTwZSOCo20INwktxpi3Q== + /@babel/plugin-transform-modules-systemjs/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-hoist-variables': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + babel-plugin-dynamic-import-node: 2.3.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-y2c96hmcsUi6LrMqvmNDPBBiGCiQu0aYqpHatVVu6kD4mFEXKjyNxd/drc18XXAf9dv7UXjrZwBVmTTGaGP8iw== + /@babel/plugin-transform-modules-umd/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-transforms': 7.7.5 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-u2B8TIi0qZI4j8q4C51ktfO7E3cQ0qnaXFI1/OXITordD40tt17g/sXqgNNCcMTcBFKrUPcGDx+TBJuZxLx7tw== + /@babel/plugin-transform-named-capturing-groups-regex/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-create-regexp-features-plugin': 7.7.4_@babel+core@7.7.7 + dev: true + peerDependencies: + '@babel/core': ^7.0.0 + resolution: + integrity: sha512-jBUkiqLKvUWpv9GLSuHUFYdmHg0ujC1JEYoZUfeOOfNydZXp1sXObgyPatpcwjWgsdBGsagWW0cdJpX/DO2jMw== + /@babel/plugin-transform-new-target/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-CnPRiNtOG1vRodnsyGX37bHQleHE14B9dnnlgSeEs3ek3fHN1A1SScglTCg1sfbe7sRQ2BUcpgpTpWSfMKz3gg== + /@babel/plugin-transform-object-super/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-replace-supers': 7.7.4 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg== + /@babel/plugin-transform-parameters/7.7.7_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-call-delegate': 7.7.4 + '@babel/helper-get-function-arity': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-OhGSrf9ZBrr1fw84oFXj5hgi8Nmg+E2w5L7NhnG0lPvpDtqd7dbyilM2/vR8CKbJ907RyxPh2kj6sBCSSfI9Ew== + /@babel/plugin-transform-property-literals/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ== + /@babel/plugin-transform-regenerator/7.7.5_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + regenerator-transform: 0.14.1 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-/8I8tPvX2FkuEyWbjRCt4qTAgZK0DVy8QRguhA524UH48RfGJy94On2ri+dCuwOpcerPRl9O4ebQkRcVzIaGBw== + /@babel/plugin-transform-reserved-words/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-OrPiUB5s5XvkCO1lS7D8ZtHcswIC57j62acAnJZKqGGnHP+TIc/ljQSrgdX/QyOTdEK5COAhuc820Hi1q2UgLQ== + /@babel/plugin-transform-runtime/7.7.6_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-imports': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + resolve: 1.14.1 + semver: 5.7.1 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-tajQY+YmXR7JjTwRvwL4HePqoL3DYxpYXIHKVvrOIvJmeHe2y1w4tz5qz9ObUDC9m76rCzIMPyn4eERuwA4a4A== + /@babel/plugin-transform-shorthand-properties/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q== + /@babel/plugin-transform-spread/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q== + /@babel/plugin-transform-sticky-regex/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/helper-regex': 7.5.5 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A== + /@babel/plugin-transform-template-literals/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-annotate-as-pure': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ== + /@babel/plugin-transform-typeof-symbol/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-KQPUQ/7mqe2m0B8VecdyaW5XcQYaePyl9R7IsKd+irzj6jvbhoGnRE+M0aNkyAzI07VfUQ9266L5xMARitV3wg== + /@babel/plugin-transform-unicode-regex/7.7.4_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-create-regexp-features-plugin': 7.7.4_@babel+core@7.7.7 + '@babel/helper-plugin-utils': 7.0.0 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw== + /@babel/preset-env/7.7.7_@babel+core@7.7.7: + dependencies: + '@babel/core': 7.7.7 + '@babel/helper-module-imports': 7.7.4 + '@babel/helper-plugin-utils': 7.0.0 + '@babel/plugin-proposal-async-generator-functions': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-proposal-dynamic-import': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-proposal-json-strings': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-proposal-object-rest-spread': 7.7.7_@babel+core@7.7.7 + '@babel/plugin-proposal-optional-catch-binding': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-proposal-unicode-property-regex': 7.7.7_@babel+core@7.7.7 + '@babel/plugin-syntax-async-generators': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-syntax-dynamic-import': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-syntax-json-strings': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-syntax-object-rest-spread': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-syntax-optional-catch-binding': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-syntax-top-level-await': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-arrow-functions': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-async-to-generator': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-block-scoped-functions': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-block-scoping': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-classes': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-computed-properties': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-destructuring': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-dotall-regex': 7.7.7_@babel+core@7.7.7 + '@babel/plugin-transform-duplicate-keys': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-exponentiation-operator': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-for-of': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-function-name': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-literals': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-member-expression-literals': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-modules-amd': 7.7.5_@babel+core@7.7.7 + '@babel/plugin-transform-modules-commonjs': 7.7.5_@babel+core@7.7.7 + '@babel/plugin-transform-modules-systemjs': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-modules-umd': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-named-capturing-groups-regex': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-new-target': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-object-super': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-parameters': 7.7.7_@babel+core@7.7.7 + '@babel/plugin-transform-property-literals': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-regenerator': 7.7.5_@babel+core@7.7.7 + '@babel/plugin-transform-reserved-words': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-shorthand-properties': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-spread': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-sticky-regex': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-template-literals': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-typeof-symbol': 7.7.4_@babel+core@7.7.7 + '@babel/plugin-transform-unicode-regex': 7.7.4_@babel+core@7.7.7 + '@babel/types': 7.7.4 + browserslist: 4.7.2 + core-js-compat: 3.6.0 + invariant: 2.2.4 + js-levenshtein: 1.1.6 + semver: 5.7.1 + dev: true + peerDependencies: + '@babel/core': ^7.0.0-0 + resolution: + integrity: sha512-pCu0hrSSDVI7kCVUOdcMNQEbOPJ52E+LrQ14sN8uL2ALfSqePZQlKrOy+tM4uhEdYlCHi4imr8Zz2cZe9oSdIg== /@babel/runtime/7.7.7: dependencies: regenerator-runtime: 0.13.3 dev: true resolution: integrity: sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA== + /@babel/template/7.7.4: + dependencies: + '@babel/code-frame': 7.5.5 + '@babel/parser': 7.7.7 + '@babel/types': 7.7.4 + dev: true + resolution: + integrity: sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== + /@babel/traverse/7.7.4: + dependencies: + '@babel/code-frame': 7.5.5 + '@babel/generator': 7.7.7 + '@babel/helper-function-name': 7.7.4 + '@babel/helper-split-export-declaration': 7.7.4 + '@babel/parser': 7.7.7 + '@babel/types': 7.7.4 + debug: 4.1.1 + globals: 11.12.0 + lodash: 4.17.15 + dev: true + resolution: + integrity: sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== + /@babel/types/7.7.4: + dependencies: + esutils: 2.0.3 + lodash: 4.17.15 + to-fast-properties: 2.0.0 + dev: true + resolution: + integrity: sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== /@nodelib/fs.scandir/2.1.3: dependencies: '@nodelib/fs.stat': 2.0.3 @@ -106,9 +821,24 @@ packages: dev: true resolution: integrity: sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ== + /@rollup/plugin-commonjs/11.0.0_rollup@1.27.13: + dependencies: + '@rollup/pluginutils': 3.0.1_rollup@1.27.13 + estree-walker: 0.6.1 + is-reference: 1.1.4 + magic-string: 0.25.4 + resolve: 1.14.1 + rollup: 1.27.13 + dev: true + engines: + node: '>= 8.0.0' + peerDependencies: + rollup: ^1.20.0 + resolution: + integrity: sha512-jnm//T5ZWOZ6zmJ61fReSCBOif+Ax8dHVoVggA+d2NA7T4qCWgQ3KYr+zN2faGEYLpe1wa03IzvhR+sqVLxUWg== /@rollup/plugin-node-resolve/6.0.0_rollup@1.27.13: dependencies: - '@rollup/pluginutils': 3.0.0_rollup@1.27.13 + '@rollup/pluginutils': 3.0.1_rollup@1.27.13 '@types/resolve': 0.0.8 builtin-modules: 3.1.0 is-module: 1.0.0 @@ -121,7 +851,7 @@ packages: rollup: ^1.20.0 resolution: integrity: sha512-GqWz1CfXOsqpeVMcoM315+O7zMxpRsmhWyhJoxLFHVSp9S64/u02i7len/FnbTNbmgYs+sZyilasijH8UiuboQ== - /@rollup/pluginutils/3.0.0_rollup@1.27.13: + /@rollup/pluginutils/3.0.1_rollup@1.27.13: dependencies: estree-walker: 0.6.1 rollup: 1.27.13 @@ -131,8 +861,8 @@ packages: peerDependencies: rollup: ^1.20.0 resolution: - integrity: sha512-qBbGQQaUUiId/lBU9VMeYlVLOoRNvz1fV8HWY5tiGDpI2gdPZHbmOfCjzSdXPhdq3XOfyWvXEBlIPbnM3+9ogQ== - /@semantic-release/commit-analyzer/6.3.3_semantic-release@15.13.31: + integrity: sha512-PmNurkecagFimv7ZdKCVOfQuqKDPkrcpLFxRBcQ00LYr4HAjJwhCFxBiY2Xoletll2htTIiXBg6g0Yg21h2M3w== + /@semantic-release/commit-analyzer/6.3.3_semantic-release@15.14.0: dependencies: conventional-changelog-angular: 5.0.6 conventional-commits-filter: 2.0.2 @@ -140,7 +870,7 @@ packages: debug: 4.1.1 import-from: 3.0.0 lodash: 4.17.15 - semantic-release: 15.13.31_semantic-release@15.13.31 + semantic-release: 15.14.0_semantic-release@15.14.0 dev: true engines: node: '>=8.16' @@ -152,7 +882,7 @@ packages: dev: true resolution: integrity: sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg== - /@semantic-release/github/5.5.5_semantic-release@15.13.31: + /@semantic-release/github/5.5.5_semantic-release@15.14.0: dependencies: '@octokit/rest': 16.35.2 '@semantic-release/error': 2.2.0 @@ -169,7 +899,7 @@ packages: mime: 2.4.4 p-filter: 2.1.0 p-retry: 4.2.0 - semantic-release: 15.13.31_semantic-release@15.13.31 + semantic-release: 15.14.0_semantic-release@15.14.0 url-join: 4.0.1 dev: true engines: @@ -178,7 +908,7 @@ packages: semantic-release: '>=15.8.0 <16.0.0' resolution: integrity: sha512-Wo9OIULMRydbq+HpFh9yiLvra1XyEULPro9Tp4T5MQJ0WZyAQ3YQm74IdT8Pe/UmVDq2nfpT1oHrWkwOc4loHg== - /@semantic-release/npm/5.3.4_semantic-release@15.13.31: + /@semantic-release/npm/5.3.4_semantic-release@15.14.0: dependencies: '@semantic-release/error': 2.2.0 aggregate-error: 3.0.1 @@ -191,7 +921,7 @@ packages: rc: 1.2.8 read-pkg: 5.2.0 registry-auth-token: 4.0.0 - semantic-release: 15.13.31_semantic-release@15.13.31 + semantic-release: 15.14.0_semantic-release@15.14.0 tempy: 0.3.0 dev: true engines: @@ -200,7 +930,7 @@ packages: semantic-release: '>=15.9.0 <16.0.0' resolution: integrity: sha512-XjITNRA/oOpJ7BfHk/WaOHs1WniYBszTde/bwADjjk1Luacpxg87jbDQVVt/oA3Zlx+MelxACRIEuRiPC5gu8g== - /@semantic-release/release-notes-generator/7.3.5_semantic-release@15.13.31: + /@semantic-release/release-notes-generator/7.3.5_semantic-release@15.14.0: dependencies: conventional-changelog-angular: 5.0.6 conventional-changelog-writer: 4.0.11 @@ -212,7 +942,7 @@ packages: into-stream: 5.1.1 lodash: 4.17.15 read-pkg-up: 7.0.1 - semantic-release: 15.13.31_semantic-release@15.13.31 + semantic-release: 15.14.0_semantic-release@15.14.0 dev: true engines: node: '>=8.16' @@ -248,6 +978,12 @@ packages: dev: true resolution: integrity: sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + /@types/mkdirp/0.5.2: + dependencies: + '@types/node': 12.12.21 + dev: true + resolution: + integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== /@types/node/12.12.21: dev: true resolution: @@ -256,6 +992,10 @@ packages: dev: true resolution: integrity: sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + /@types/object-path/0.11.0: + dev: true + resolution: + integrity: sha512-/tuN8jDbOXcPk+VzEVZzzAgw1Byz7s/itb2YI10qkSyy6nykJH02DuhfrflxVdAdE7AZ91h5X6Cn0dmVdFw2TQ== /@types/parse-json/4.0.0: dev: true resolution: @@ -270,6 +1010,75 @@ packages: dev: true resolution: integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== + /@types/semver/6.2.0: + dev: true + resolution: + integrity: sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA== + /@types/ua-parser-js/0.7.33: + dev: true + resolution: + integrity: sha512-ngUKcHnytUodUCL7C6EZ+lVXUjTMQb+9p/e1JjV5tN9TVzS98lHozWEFRPY1QcCdwFeMsmVWfZ3DPPT/udCyIw== + /@wessberg/browserslist-generator/1.0.30: + dependencies: + '@types/object-path': 0.11.0 + '@types/semver': 6.2.0 + '@types/ua-parser-js': 0.7.33 + browserslist: 4.7.2 + caniuse-lite: 1.0.30001016 + mdn-browser-compat-data: 0.0.98 + object-path: 0.11.4 + semver: 6.3.0 + ua-parser-js: 0.7.21 + dev: true + engines: + node: '>=8.0.0' + resolution: + integrity: sha512-Ba1Q36FZhe1KrLWDkxUetrWCEIdmyPvndKp4zTirWHYnTfNyvr4adDIrQaIq1h49DkPDgQEkBw7PcMRSvuFA3g== + /@wessberg/rollup-plugin-ts/1.1.83_rollup@1.27.13+typescript@3.7.4: + dependencies: + '@babel/core': 7.7.7 + '@babel/plugin-transform-runtime': 7.7.6_@babel+core@7.7.7 + '@babel/preset-env': 7.7.7_@babel+core@7.7.7 + '@babel/runtime': 7.7.7 + '@types/mkdirp': 0.5.2 + '@types/node': 12.12.21 + '@types/resolve': 0.0.8 + '@wessberg/browserslist-generator': 1.0.30 + '@wessberg/stringutil': 1.0.19 + '@wessberg/ts-clone-node': 0.0.0 + browserslist: 4.7.2 + find-up: 4.1.0 + magic-string: 0.25.4 + mkdirp: 0.5.1 + resolve: 1.14.1 + rollup: 1.27.13 + rollup-pluginutils: 2.8.2 + slash: 3.0.0 + tslib: 1.10.0 + typescript: 3.7.4 + dev: true + engines: + node: '>=8.0.0' + peerDependencies: + rollup: ^1.27.0 + typescript: ^3.x + resolution: + integrity: sha512-6lbqD/awcGTPhFCxTHS/DBKEy5OQ53AIWoaZd3u1bizJ+Nx6ih1JEGzAak9ghX9+aCW9ItVHU+NPrdDHl03W+w== + /@wessberg/stringutil/1.0.19: + dev: true + engines: + node: '>=8.0.0' + resolution: + integrity: sha512-9AZHVXWlpN8Cn9k5BC/O0Dzb9E9xfEMXzYrNunwvkUTvuK7xgQPVRZpLo+jWCOZ5r8oBa8NIrHuPEu1hzbb6bg== + /@wessberg/ts-clone-node/0.0.0: + dependencies: + '@types/node': 12.12.21 + typescript: 3.7.4 + dev: true + engines: + node: '>=8.0.0' + resolution: + integrity: sha512-bJ+Hoxh6xU8r6N4fOKIC64nAWUqFxUj0IrT66qGKG7IpF9+pC54Xy/2XSZljEnJGtYgv0WiaeEkRaellwFF42A== /JSONStream/1.3.5: dependencies: jsonparse: 1.3.1 @@ -365,6 +1174,12 @@ packages: dev: true resolution: integrity: sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= + /babel-plugin-dynamic-import-node/2.3.0: + dependencies: + object.assign: 4.1.0 + dev: true + resolution: + integrity: sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== /balanced-match/1.0.0: dev: true resolution: @@ -392,6 +1207,24 @@ packages: node: '>=8' resolution: integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + /browserslist/4.7.2: + dependencies: + caniuse-lite: 1.0.30001016 + electron-to-chromium: 1.3.322 + node-releases: 1.1.43 + dev: true + hasBin: true + resolution: + integrity: sha512-uZavT/gZXJd2UTi9Ov7/Z340WOSQ3+m1iBVRUknf+okKxonL9P83S3ctiBDtuRmRu8PiCHjqyueqQ9HYlJhxiw== + /browserslist/4.8.2: + dependencies: + caniuse-lite: 1.0.30001016 + electron-to-chromium: 1.3.322 + node-releases: 1.1.43 + dev: true + hasBin: true + resolution: + integrity: sha512-+M4oeaTplPm/f1pXDw84YohEv7B1i/2Aisei8s4s6k3QsoSHa7i5sz8u/cGQkkatCPxMASKxPualR4wwYgVboA== /btoa-lite/1.0.0: dev: true resolution: @@ -434,6 +1267,10 @@ packages: node: '>=6' resolution: integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + /caniuse-lite/1.0.30001016: + dev: true + resolution: + integrity: sha512-yYQ2QfotceRiH4U+h1Us86WJXtVHDmy3nEKIdYPsZCYnOV5/tMgGbmoIlrMzmh2VXlproqYtVaKeGDBkMZifFA== /cardinal/2.1.1: dependencies: ansicolors: 0.3.2 @@ -506,10 +1343,6 @@ packages: dev: true resolution: integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - /commondir/1.0.1: - dev: true - resolution: - integrity: sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= /compare-func/1.3.2: dependencies: array-ify: 1.0.0 @@ -572,6 +1405,19 @@ packages: hasBin: true resolution: integrity: sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ== + /convert-source-map/1.7.0: + dependencies: + safe-buffer: 5.1.2 + dev: true + resolution: + integrity: sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + /core-js-compat/3.6.0: + dependencies: + browserslist: 4.8.2 + semver: 7.0.0 + dev: true + resolution: + integrity: sha512-Z3eCNjGgoYluH89Jt4wVkfYsc/VdLrA2/woX5lm0isO/pCT+P+Y+o65bOuEnjDJLthdwTBxbCVzptTXtc18fJg== /core-util-is/1.0.2: dev: true resolution: @@ -667,6 +1513,14 @@ packages: node: '>=4.0.0' resolution: integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + /define-properties/1.1.3: + dependencies: + object-keys: 1.1.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== /deprecation/2.3.1: dev: true resolution: @@ -693,6 +1547,10 @@ packages: dev: true resolution: integrity: sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= + /electron-to-chromium/1.3.322: + dev: true + resolution: + integrity: sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== /emoji-regex/8.0.0: dev: true resolution: @@ -782,6 +1640,10 @@ packages: node: ^8.12.0 || >=9.7.0 resolution: integrity: sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== + /extend/3.0.2: + dev: true + resolution: + integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== /fast-glob/3.1.1: dependencies: '@nodelib/fs.stat': 2.0.3 @@ -824,16 +1686,6 @@ packages: node: '>=8' resolution: integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - /find-cache-dir/3.2.0: - dependencies: - commondir: 1.0.1 - make-dir: 3.0.0 - pkg-dir: 4.2.0 - dev: true - engines: - node: '>=8' - resolution: - integrity: sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== /find-up/2.1.0: dependencies: locate-path: 2.0.0 @@ -880,6 +1732,10 @@ packages: dev: true resolution: integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + /function-bind/1.1.1: + dev: true + resolution: + integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== /get-caller-file/2.0.5: dev: true engines: @@ -932,6 +1788,12 @@ packages: dev: true resolution: integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + /globals/11.12.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== /globby/10.0.1: dependencies: '@types/glob': 7.1.1 @@ -976,6 +1838,12 @@ packages: node: '>=4' resolution: integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + /has-symbols/1.0.1: + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== /hook-std/2.0.0: dev: true engines: @@ -1075,6 +1943,12 @@ packages: node: '>=8' resolution: integrity: sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA== + /invariant/2.2.4: + dependencies: + loose-envify: 1.4.0 + dev: true + resolution: + integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== /is-arrayish/0.2.1: dev: true resolution: @@ -1196,10 +2070,28 @@ packages: node: '>= 6' resolution: integrity: sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== + /js-levenshtein/1.1.6: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== /js-tokens/4.0.0: dev: true resolution: integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + /jsesc/0.5.0: + dev: true + hasBin: true + resolution: + integrity: sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + /jsesc/2.5.2: + dev: true + engines: + node: '>=4' + hasBin: true + resolution: + integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== /json-parse-better-errors/1.0.2: dev: true resolution: @@ -1208,6 +2100,15 @@ packages: dev: true resolution: integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + /json5/2.1.1: + dependencies: + minimist: 1.2.0 + dev: true + engines: + node: '>=6' + hasBin: true + resolution: + integrity: sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== /jsonfile/4.0.0: dev: true optionalDependencies: @@ -1296,6 +2197,13 @@ packages: dev: true resolution: integrity: sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + /loose-envify/1.4.0: + dependencies: + js-tokens: 4.0.0 + dev: true + hasBin: true + resolution: + integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== /loud-rejection/1.6.0: dependencies: currently-unhandled: 0.4.1 @@ -1323,14 +2231,6 @@ packages: dev: true resolution: integrity: sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== - /make-dir/3.0.0: - dependencies: - semver: 6.3.0 - dev: true - engines: - node: '>=8' - resolution: - integrity: sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== /map-obj/1.0.1: dev: true engines: @@ -1364,6 +2264,14 @@ packages: hasBin: true resolution: integrity: sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== + /mdn-browser-compat-data/0.0.98: + dependencies: + extend: 3.0.2 + dev: true + engines: + node: '>=8.0.0' + resolution: + integrity: sha512-aixrkulXdvMp90I5rWuzBCks9GruwEyNfMgX5qg9lSATyOvI5OPzuFnO98BAsXG5x5MrA9BSxu0jwJbRFaAG/g== /meow/5.0.0: dependencies: camelcase-keys: 4.2.0 @@ -1431,10 +2339,21 @@ packages: dev: true resolution: integrity: sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + /minimist/0.0.8: + dev: true + resolution: + integrity: sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= /minimist/1.2.0: dev: true resolution: integrity: sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + /mkdirp/0.5.1: + dependencies: + minimist: 0.0.8 + dev: true + hasBin: true + resolution: + integrity: sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= /modify-values/1.0.1: dev: true engines: @@ -1473,6 +2392,12 @@ packages: node: 4.x || >=6.0.0 resolution: integrity: sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + /node-releases/1.1.43: + dependencies: + semver: 6.3.0 + dev: true + resolution: + integrity: sha512-Rmfnj52WNhvr83MvuAWHEqXVoZXCcDQssSOffU4n4XOL9sPrP61mSZ88g25NqmABDvH7PiAlFCzoSCSdzA293w== /normalize-package-data/2.5.0: dependencies: hosted-git-info: 2.8.5 @@ -1633,6 +2558,29 @@ packages: hasBin: true resolution: integrity: sha512-vTcUL4SCg3AzwInWTbqg1OIaOXlzKSS8Mb8kc5avwrJpcvevDA5J9BhYSuei+fNs3pwOp4lzA5x2FVDXACvoXA== + /object-keys/1.1.1: + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + /object-path/0.11.4: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-NwrnUvvzfePqcKhhwju6iRVpGUk= + /object.assign/4.1.0: + dependencies: + define-properties: 1.1.3 + function-bind: 1.1.1 + has-symbols: 1.0.1 + object-keys: 1.1.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== /octokit-pagination-methods/1.1.0: dev: true resolution: @@ -1855,14 +2803,12 @@ packages: node: '>=4' resolution: integrity: sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg= - /pkg-dir/4.2.0: - dependencies: - find-up: 4.1.0 + /private/0.1.8: dev: true engines: - node: '>=8' + node: '>= 0.6' resolution: - integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== /process-nextick-args/2.0.1: dev: true resolution: @@ -1974,10 +2920,41 @@ packages: dev: true resolution: integrity: sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs= + /regenerate-unicode-properties/8.1.0: + dependencies: + regenerate: 1.4.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== + /regenerate/1.4.0: + dev: true + resolution: + integrity: sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== /regenerator-runtime/0.13.3: dev: true resolution: integrity: sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== + /regenerator-transform/0.14.1: + dependencies: + private: 0.1.8 + dev: true + resolution: + integrity: sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ== + /regexpu-core/4.6.0: + dependencies: + regenerate: 1.4.0 + regenerate-unicode-properties: 8.1.0 + regjsgen: 0.5.1 + regjsparser: 0.6.2 + unicode-match-property-ecmascript: 1.0.4 + unicode-match-property-value-ecmascript: 1.1.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg== /registry-auth-token/4.0.0: dependencies: rc: 1.2.8 @@ -1987,6 +2964,17 @@ packages: node: '>=6.0.0' resolution: integrity: sha512-lpQkHxd9UL6tb3k/aHAVfnVtn+Bcs9ob5InuFLLEDqSqeq+AljB8GZW9xY0x7F+xYwEcjKe07nyoxzEYz6yvkw== + /regjsgen/0.5.1: + dev: true + resolution: + integrity: sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== + /regjsparser/0.6.2: + dependencies: + jsesc: 0.5.0 + dev: true + hasBin: true + resolution: + integrity: sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q== /require-directory/2.1.1: dev: true engines: @@ -2009,12 +2997,6 @@ packages: node: '>=8' resolution: integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - /resolve/1.12.0: - dependencies: - path-parse: 1.0.6 - dev: true - resolution: - integrity: sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== /resolve/1.14.1: dependencies: path-parse: 1.0.6 @@ -2041,31 +3023,6 @@ packages: hasBin: true resolution: integrity: sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== - /rollup-plugin-commonjs/10.1.0_rollup@1.27.13: - dependencies: - estree-walker: 0.6.1 - is-reference: 1.1.4 - magic-string: 0.25.4 - resolve: 1.14.1 - rollup: 1.27.13 - rollup-pluginutils: 2.8.2 - dev: true - peerDependencies: - rollup: '>=1.12.0' - resolution: - integrity: sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== - /rollup-plugin-dts/1.1.13_rollup@1.27.13+typescript@3.7.3: - dependencies: - rollup: 1.27.13 - typescript: 3.7.3 - dev: true - optionalDependencies: - '@babel/code-frame': 7.5.5 - peerDependencies: - rollup: ^1.27.8 - typescript: ^3.7.3 - resolution: - integrity: sha512-vpCSjTFodt8saLkFAi/Xn7JFgs2ZnbFYRbYyirlZjQtxS81JhU7oXuuyC9UrkftIot+/JbuavPOtI9OQoVQIcQ== /rollup-plugin-terser/5.1.3_rollup@1.27.13: dependencies: '@babel/code-frame': 7.5.5 @@ -2079,27 +3036,6 @@ packages: rollup: '>=0.66.0 <2' resolution: integrity: sha512-FuFuXE5QUJ7snyxHLPp/0LFXJhdomKlIx/aK7Tg88Yubsx/UU/lmInoJafXJ4jwVVNcORJ1wRUC5T9cy5yk0wA== - /rollup-plugin-typescript2/0.25.3_rollup@1.27.13+typescript@3.7.3: - dependencies: - find-cache-dir: 3.2.0 - fs-extra: 8.1.0 - resolve: 1.12.0 - rollup: 1.27.13 - rollup-pluginutils: 2.8.1 - tslib: 1.10.0 - typescript: 3.7.3 - dev: true - peerDependencies: - rollup: '>=1.26.3' - typescript: '>=2.4.0' - resolution: - integrity: sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg== - /rollup-pluginutils/2.8.1: - dependencies: - estree-walker: 0.6.1 - dev: true - resolution: - integrity: sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== /rollup-pluginutils/2.8.2: dependencies: estree-walker: 0.6.1 @@ -2127,13 +3063,13 @@ packages: dev: true resolution: integrity: sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== - /semantic-release/15.13.31_semantic-release@15.13.31: + /semantic-release/15.14.0_semantic-release@15.14.0: dependencies: - '@semantic-release/commit-analyzer': 6.3.3_semantic-release@15.13.31 + '@semantic-release/commit-analyzer': 6.3.3_semantic-release@15.14.0 '@semantic-release/error': 2.2.0 - '@semantic-release/github': 5.5.5_semantic-release@15.13.31 - '@semantic-release/npm': 5.3.4_semantic-release@15.13.31 - '@semantic-release/release-notes-generator': 7.3.5_semantic-release@15.13.31 + '@semantic-release/github': 5.5.5_semantic-release@15.14.0 + '@semantic-release/npm': 5.3.4_semantic-release@15.14.0 + '@semantic-release/release-notes-generator': 7.3.5_semantic-release@15.14.0 aggregate-error: 3.0.1 cosmiconfig: 6.0.0 debug: 4.1.1 @@ -2162,7 +3098,7 @@ packages: peerDependencies: semantic-release: '*' resolution: - integrity: sha512-mrtYkH4p0FvXIRFCsr2r5il/A+Uj7oeeq+dgyojAbr4Tzywv9AlCYHeE3A8U3eE4bMJPiBV4YnQRsk1QS8yDDw== + integrity: sha512-Cn43W35AOLY0RMcDbtwhJODJmWg6YCs1+R5jRQsTmmkEGzkV4B2F/QXkjVZpl4UbH91r93GGH0xhoq9kh7I5PA== /semver-regex/2.0.0: dev: true engines: @@ -2179,6 +3115,11 @@ packages: hasBin: true resolution: integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + /semver/7.0.0: + dev: true + hasBin: true + resolution: + integrity: sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== /serialize-javascript/2.1.2: dev: true resolution: @@ -2242,6 +3183,12 @@ packages: dev: true resolution: integrity: sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== + /source-map/0.5.7: + dev: true + engines: + node: '>=0.10.0' + resolution: + integrity: sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= /source-map/0.6.1: dev: true engines: @@ -2438,6 +3385,12 @@ packages: dev: true resolution: integrity: sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== + /to-fast-properties/2.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= /to-regex-range/5.0.1: dependencies: is-number: 7.0.0 @@ -2484,13 +3437,17 @@ packages: node: '>=8' resolution: integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - /typescript/3.7.3: + /typescript/3.7.4: dev: true engines: node: '>=4.2.0' hasBin: true resolution: - integrity: sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== + integrity: sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw== + /ua-parser-js/0.7.21: + dev: true + resolution: + integrity: sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ== /uglify-js/3.7.2: dependencies: commander: 2.20.3 @@ -2502,6 +3459,33 @@ packages: optional: true resolution: integrity: sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA== + /unicode-canonical-property-names-ecmascript/1.0.4: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + /unicode-match-property-ecmascript/1.0.4: + dependencies: + unicode-canonical-property-names-ecmascript: 1.0.4 + unicode-property-aliases-ecmascript: 1.0.5 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== + /unicode-match-property-value-ecmascript/1.1.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== + /unicode-property-aliases-ecmascript/1.0.5: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== /unique-string/1.0.0: dependencies: crypto-random-string: 1.0.0 @@ -2637,12 +3621,12 @@ packages: resolution: integrity: sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q== specifiers: + '@rollup/plugin-commonjs': ^11.0.0 '@rollup/plugin-node-resolve': ^6.0.0 + '@types/node': ^12.12.21 + '@wessberg/rollup-plugin-ts': ^1.1.83 rimraf: ^3.0.0 rollup: ^1.27.13 - rollup-plugin-commonjs: ^10.1.0 - rollup-plugin-dts: ^1.1.13 rollup-plugin-terser: ^5.1.3 - rollup-plugin-typescript2: ^0.25.3 - semantic-release: ^15.13.31 - typescript: ^3.7.3 + semantic-release: ^15.14.0 + typescript: ^3.7.4 diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index f5ec4c8..2d1c5a9 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -1,9 +1,6 @@ -import commonjs from 'rollup-plugin-commonjs' -import nodeResolve from '@rollup/plugin-node-resolve' -import dts from 'rollup-plugin-dts' -import typescript from 'rollup-plugin-typescript2' import { terser } from 'rollup-plugin-terser' import { resolve } from 'path' +import ts from '@wessberg/rollup-plugin-ts' const outputDirectory = resolve(__dirname, 'dist') const inputFile = resolve(__dirname, 'src/index.ts') @@ -19,36 +16,36 @@ export default [ external, output: [ { - file: `${outputDirectory}/bundle.cjs.js`, + file: `${outputDirectory}/index.cjs.js`, format: 'cjs', sourcemap: true }, { - file: `${outputDirectory}/bundle.esm.js`, - format: 'esm', - sourcemap: true - }, - { - file: `${outputDirectory}/bundle.amd.js`, + file: `${outputDirectory}/index.amd.js`, sourcemap: true, format: 'amd', name: 'Option' } ], - plugins: [ - nodeResolve({ - extensions: ['.ts'] - }), - commonjs(), - typescript({ - tsconfig: resolve(__dirname, 'tsconfig.json') - }), - !dev && terser() - ] + plugins: [ts(), !dev && terser()] }, { input: inputFile, - output: [{ file: `${outputDirectory}/index.d.ts`, format: 'es' }], - plugins: [dts()] + external, + output: [ + { + file: `${outputDirectory}/index.esm.js`, + format: 'esm', + sourcemap: true + } + ], + plugins: [ + ts({ + tsconfig: { + declaration: true + } + }), + !dev && terser() + ] } ] diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 5f28819..cba4003 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -10,18 +10,16 @@ import { import { identity } from './internalHelperts' import { none, some } from './internals' -export const isSome = (option: Option): option is Some => - option.type === some -export const isNothing = (option: Option): option is None => - option.type === none +export const isSome = (option: Option) => option._type === some +export const isNothing = (option: Option) => option._type === none const match = ( caseSome: Mapper, _default: U, option: Option ) => { - if (isSome(option)) { - return caseSome(option.value as T) + if (option._type === some) { + return caseSome(option.value) } return _default @@ -72,7 +70,7 @@ export const forall = (predicate: Predicate, option: Option) => { } export const get = (option: Option): T => { - if (isSome(option)) { + if (option._type === some) { return option.value } @@ -80,7 +78,7 @@ export const get = (option: Option): T => { } export const iter = (mapper: Mapper, option: Option) => { - if (isSome(option)) { + if (option._type === some) { mapper(option.value) } } diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index f4845fd..0b62f3d 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -1,7 +1,7 @@ -export const some = Symbol('some') -export const none = Symbol('none') +export const some = 'some' +export const none = 'none' export type NominalTyped = { - type: T + _type: T value: U } diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index ff1d556..ce2a5d5 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,16 +1,16 @@ import { NominalTyped, none, some } from './internals' -export type None = NominalTyped -export type Some = NominalTyped +export type None = NominalTyped<'none', null> +export type Some = NominalTyped<'some', T> export type Option = Some | None export const None: Option = { - type: none, + _type: 'none', value: null } export const Some = (value: T): Option => ({ - type: some, + _type: 'some', value }) From 92a5ecbca1dddcefcb4156cd75e074a588299b5b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 22 Dec 2019 17:48:39 +0200 Subject: [PATCH 27/80] typescript(option): feat: using symbols instead of plain strings Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 3 +-- typescript/option/src/internalHelperts.ts | 1 - typescript/option/src/internals.ts | 9 +++------ typescript/option/src/types.ts | 15 ++++++++++----- 4 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 typescript/option/src/internalHelperts.ts diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index cba4003..68c35c3 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -7,8 +7,7 @@ import { BackFolder, Nullable } from './internalTypes' -import { identity } from './internalHelperts' -import { none, some } from './internals' +import { identity, none, some } from './internals' export const isSome = (option: Option) => option._type === some export const isNothing = (option: Option) => option._type === none diff --git a/typescript/option/src/internalHelperts.ts b/typescript/option/src/internalHelperts.ts deleted file mode 100644 index d1600f3..0000000 --- a/typescript/option/src/internalHelperts.ts +++ /dev/null @@ -1 +0,0 @@ -export const identity = (v: T) => v diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 0b62f3d..0e16212 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -1,7 +1,4 @@ -export const some = 'some' -export const none = 'none' +export const identity = (v: T) => v -export type NominalTyped = { - _type: T - value: U -} +export const some = Symbol('some') +export const none = Symbol('none') diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index ce2a5d5..e1e15af 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,16 +1,21 @@ -import { NominalTyped, none, some } from './internals' +import { some, none } from './internals' -export type None = NominalTyped<'none', null> -export type Some = NominalTyped<'some', T> +type NominalTyped = { + _type: T + value: U +} + +export type None = NominalTyped +export type Some = NominalTyped export type Option = Some | None export const None: Option = { - _type: 'none', + _type: none, value: null } export const Some = (value: T): Option => ({ - _type: 'some', + _type: some, value }) From aed68688a1fbe64208bdd5ffc3549c0c394f0491 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 22 Dec 2019 17:50:25 +0200 Subject: [PATCH 28/80] typescript(option): fix: fixed the exporting by misstake of Some and None Signed-off-by: prescientmoon --- typescript/option/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index e1e15af..83ff10e 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -5,8 +5,8 @@ type NominalTyped = { value: U } -export type None = NominalTyped -export type Some = NominalTyped +type None = NominalTyped +type Some = NominalTyped export type Option = Some | None From d1b7740878034dff288444f15de8794cc9a20377 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:00:11 +0200 Subject: [PATCH 29/80] typescript(option): refactor: Ditched the cusom NominalType type typescript(option): typescript(option): Instead of defining my own NominalType now I use the Brand type from typescript(option): utility types. Signed-off-by: prescientmoon --- typescript/option/package.json | 5 +-- typescript/option/pnpm-lock.yaml | 54 ++++++++++++++++++-------------- typescript/option/src/helpers.ts | 16 +++++----- typescript/option/src/types.ts | 21 +++---------- 4 files changed, 47 insertions(+), 49 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index dd9ded0..e2e31cd 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -29,10 +29,11 @@ "@types/node": "^12.12.21", "@wessberg/rollup-plugin-ts": "^1.1.83", "rimraf": "^3.0.0", - "rollup": "^1.27.13", + "rollup": "^1.27.14", "rollup-plugin-terser": "^5.1.3", "semantic-release": "^15.14.0", - "typescript": "^3.7.4" + "typescript": "^3.7.4", + "utility-types": "^3.10.0" }, "author": "Matei Adriel", "license": "SEE LICENSE IN LICENSE" diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 685f1b0..7d955d7 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,13 +1,14 @@ devDependencies: - '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.13 - '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.13 + '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.14 + '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.14 '@types/node': 12.12.21 - '@wessberg/rollup-plugin-ts': 1.1.83_rollup@1.27.13+typescript@3.7.4 + '@wessberg/rollup-plugin-ts': 1.1.83_rollup@1.27.14+typescript@3.7.4 rimraf: 3.0.0 - rollup: 1.27.13 - rollup-plugin-terser: 5.1.3_rollup@1.27.13 + rollup: 1.27.14 + rollup-plugin-terser: 5.1.3_rollup@1.27.14 semantic-release: 15.14.0_semantic-release@15.14.0 typescript: 3.7.4 + utility-types: 3.10.0 lockfileVersion: 5.1 packages: /@babel/code-frame/7.5.5: @@ -821,14 +822,14 @@ packages: dev: true resolution: integrity: sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ== - /@rollup/plugin-commonjs/11.0.0_rollup@1.27.13: + /@rollup/plugin-commonjs/11.0.0_rollup@1.27.14: dependencies: - '@rollup/pluginutils': 3.0.1_rollup@1.27.13 + '@rollup/pluginutils': 3.0.1_rollup@1.27.14 estree-walker: 0.6.1 is-reference: 1.1.4 magic-string: 0.25.4 resolve: 1.14.1 - rollup: 1.27.13 + rollup: 1.27.14 dev: true engines: node: '>= 8.0.0' @@ -836,14 +837,14 @@ packages: rollup: ^1.20.0 resolution: integrity: sha512-jnm//T5ZWOZ6zmJ61fReSCBOif+Ax8dHVoVggA+d2NA7T4qCWgQ3KYr+zN2faGEYLpe1wa03IzvhR+sqVLxUWg== - /@rollup/plugin-node-resolve/6.0.0_rollup@1.27.13: + /@rollup/plugin-node-resolve/6.0.0_rollup@1.27.14: dependencies: - '@rollup/pluginutils': 3.0.1_rollup@1.27.13 + '@rollup/pluginutils': 3.0.1_rollup@1.27.14 '@types/resolve': 0.0.8 builtin-modules: 3.1.0 is-module: 1.0.0 resolve: 1.14.1 - rollup: 1.27.13 + rollup: 1.27.14 dev: true engines: node: '>= 8.0.0' @@ -851,10 +852,10 @@ packages: rollup: ^1.20.0 resolution: integrity: sha512-GqWz1CfXOsqpeVMcoM315+O7zMxpRsmhWyhJoxLFHVSp9S64/u02i7len/FnbTNbmgYs+sZyilasijH8UiuboQ== - /@rollup/pluginutils/3.0.1_rollup@1.27.13: + /@rollup/pluginutils/3.0.1_rollup@1.27.14: dependencies: estree-walker: 0.6.1 - rollup: 1.27.13 + rollup: 1.27.14 dev: true engines: node: '>= 8.0.0' @@ -1034,7 +1035,7 @@ packages: node: '>=8.0.0' resolution: integrity: sha512-Ba1Q36FZhe1KrLWDkxUetrWCEIdmyPvndKp4zTirWHYnTfNyvr4adDIrQaIq1h49DkPDgQEkBw7PcMRSvuFA3g== - /@wessberg/rollup-plugin-ts/1.1.83_rollup@1.27.13+typescript@3.7.4: + /@wessberg/rollup-plugin-ts/1.1.83_rollup@1.27.14+typescript@3.7.4: dependencies: '@babel/core': 7.7.7 '@babel/plugin-transform-runtime': 7.7.6_@babel+core@7.7.7 @@ -1051,7 +1052,7 @@ packages: magic-string: 0.25.4 mkdirp: 0.5.1 resolve: 1.14.1 - rollup: 1.27.13 + rollup: 1.27.14 rollup-pluginutils: 2.8.2 slash: 3.0.0 tslib: 1.10.0 @@ -1630,7 +1631,7 @@ packages: human-signals: 1.1.1 is-stream: 2.0.0 merge-stream: 2.0.0 - npm-run-path: 4.0.0 + npm-run-path: 4.0.1 onetime: 5.1.0 p-finally: 2.0.1 signal-exit: 3.0.2 @@ -2421,14 +2422,14 @@ packages: node: '>=4' resolution: integrity: sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - /npm-run-path/4.0.0: + /npm-run-path/4.0.1: dependencies: path-key: 3.1.1 dev: true engines: node: '>=8' resolution: - integrity: sha512-8eyAOAH+bYXFPSnNnKr3J+yoybe8O87Is5rtAQ8qRczJz1ajcsjg8l2oZqP+Ppx15Ii3S1vUTjQN2h4YO2tWWQ== + integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== /npm/6.13.4: bundledDependencies: - abbrev @@ -3023,11 +3024,11 @@ packages: hasBin: true resolution: integrity: sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== - /rollup-plugin-terser/5.1.3_rollup@1.27.13: + /rollup-plugin-terser/5.1.3_rollup@1.27.14: dependencies: '@babel/code-frame': 7.5.5 jest-worker: 24.9.0 - rollup: 1.27.13 + rollup: 1.27.14 rollup-pluginutils: 2.8.2 serialize-javascript: 2.1.2 terser: 4.4.3 @@ -3042,7 +3043,7 @@ packages: dev: true resolution: integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== - /rollup/1.27.13: + /rollup/1.27.14: dependencies: '@types/estree': 0.0.40 '@types/node': 12.12.21 @@ -3050,7 +3051,7 @@ packages: dev: true hasBin: true resolution: - integrity: sha512-hDi7M07MpmNSDE8YVwGVFA8L7n8jTLJ4lG65nMAijAyqBe//rtu4JdxjUBE7JqXfdpqxqDTbCDys9WcqdpsQvw== + integrity: sha512-DuDjEyn8Y79ALYXMt+nH/EI58L5pEw5HU9K38xXdRnxQhvzUTI/nxAawhkAHUQeudANQ//8iyrhVRHJBuR6DSQ== /run-parallel/1.1.9: dev: true resolution: @@ -3514,6 +3515,12 @@ packages: dev: true resolution: integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + /utility-types/3.10.0: + dev: true + engines: + node: '>= 4' + resolution: + integrity: sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== /validate-npm-package-license/3.0.4: dependencies: spdx-correct: 3.1.0 @@ -3626,7 +3633,8 @@ specifiers: '@types/node': ^12.12.21 '@wessberg/rollup-plugin-ts': ^1.1.83 rimraf: ^3.0.0 - rollup: ^1.27.13 + rollup: ^1.27.14 rollup-plugin-terser: ^5.1.3 semantic-release: ^15.14.0 typescript: ^3.7.4 + utility-types: ^3.10.0 diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts index 68c35c3..1a989d9 100644 --- a/typescript/option/src/helpers.ts +++ b/typescript/option/src/helpers.ts @@ -9,16 +9,16 @@ import { } from './internalTypes' import { identity, none, some } from './internals' -export const isSome = (option: Option) => option._type === some -export const isNothing = (option: Option) => option._type === none +export const isSome = (option: Option) => option.__brand === some +export const isNothing = (option: Option) => option.__brand === none const match = ( caseSome: Mapper, _default: U, option: Option ) => { - if (option._type === some) { - return caseSome(option.value) + if (option.__brand === some) { + return caseSome(option as T) } return _default @@ -69,16 +69,16 @@ export const forall = (predicate: Predicate, option: Option) => { } export const get = (option: Option): T => { - if (option._type === some) { - return option.value + if (option.__brand === some) { + return option as T } throw new Error(`Cannot get value of None`) } export const iter = (mapper: Mapper, option: Option) => { - if (option._type === some) { - mapper(option.value) + if (option.__brand === some) { + mapper(option as T) } } diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index 83ff10e..e95dca5 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,21 +1,10 @@ import { some, none } from './internals' +import { Brand } from 'utility-types' -type NominalTyped = { - _type: T - value: U -} - -type None = NominalTyped -type Some = NominalTyped +type None = Brand +type Some = Brand export type Option = Some | None -export const None: Option = { - _type: none, - value: null -} - -export const Some = (value: T): Option => ({ - _type: some, - value -}) +export const None = undefined as None +export const Some = (value: T): Option => value as Some From 467198921dd90974905bc52ce39cd62ed96e391c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:17:51 +0200 Subject: [PATCH 30/80] typescript(option): refactor: split heplers in different files Signed-off-by: prescientmoon --- typescript/option/src/helpers.ts | 107 ------------------ typescript/option/src/helpers/bind.ts | 10 ++ typescript/option/src/helpers/count.ts | 4 + typescript/option/src/helpers/exists.ts | 7 ++ typescript/option/src/helpers/external.ts | 18 +++ typescript/option/src/helpers/filter.ts | 7 ++ typescript/option/src/helpers/flat.ts | 7 ++ typescript/option/src/helpers/fold.ts | 11 ++ typescript/option/src/helpers/foldback.ts | 11 ++ typescript/option/src/helpers/forall.ts | 7 ++ typescript/option/src/helpers/fromArray.ts | 5 + typescript/option/src/helpers/fromNullable.ts | 6 + typescript/option/src/helpers/get.ts | 10 ++ typescript/option/src/helpers/isNone.ts | 4 + typescript/option/src/helpers/isSome.ts | 4 + typescript/option/src/helpers/iter.ts | 9 ++ typescript/option/src/helpers/map.ts | 10 ++ typescript/option/src/helpers/match.ts | 15 +++ typescript/option/src/helpers/toArray.ts | 6 + typescript/option/src/helpers/toNullable.ts | 7 ++ typescript/option/src/helpers/withDefault.ts | 7 ++ typescript/option/src/index.ts | 2 +- 22 files changed, 166 insertions(+), 108 deletions(-) delete mode 100644 typescript/option/src/helpers.ts create mode 100644 typescript/option/src/helpers/bind.ts create mode 100644 typescript/option/src/helpers/count.ts create mode 100644 typescript/option/src/helpers/exists.ts create mode 100644 typescript/option/src/helpers/external.ts create mode 100644 typescript/option/src/helpers/filter.ts create mode 100644 typescript/option/src/helpers/flat.ts create mode 100644 typescript/option/src/helpers/fold.ts create mode 100644 typescript/option/src/helpers/foldback.ts create mode 100644 typescript/option/src/helpers/forall.ts create mode 100644 typescript/option/src/helpers/fromArray.ts create mode 100644 typescript/option/src/helpers/fromNullable.ts create mode 100644 typescript/option/src/helpers/get.ts create mode 100644 typescript/option/src/helpers/isNone.ts create mode 100644 typescript/option/src/helpers/isSome.ts create mode 100644 typescript/option/src/helpers/iter.ts create mode 100644 typescript/option/src/helpers/map.ts create mode 100644 typescript/option/src/helpers/match.ts create mode 100644 typescript/option/src/helpers/toArray.ts create mode 100644 typescript/option/src/helpers/toNullable.ts create mode 100644 typescript/option/src/helpers/withDefault.ts diff --git a/typescript/option/src/helpers.ts b/typescript/option/src/helpers.ts deleted file mode 100644 index 1a989d9..0000000 --- a/typescript/option/src/helpers.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { Option, Some, None } from './types' -import { - Binder, - Folder, - Mapper, - Predicate, - BackFolder, - Nullable -} from './internalTypes' -import { identity, none, some } from './internals' - -export const isSome = (option: Option) => option.__brand === some -export const isNothing = (option: Option) => option.__brand === none - -const match = ( - caseSome: Mapper, - _default: U, - option: Option -) => { - if (option.__brand === some) { - return caseSome(option as T) - } - - return _default -} - -export const bind = ( - binder: Binder, - option: Option -): Option => { - return match(binder, None, option) -} - -export const map = ( - mapper: Mapper, - option: Option -): Option => { - return match(v => Some(mapper(v)), None, option) -} - -export const count = (option: Option) => Number(isSome(option)) - -export const exists = (predicate: Predicate, option: Option) => { - return match(predicate, false, option) -} - -export const filter = (predicate: Predicate, option: Option) => { - return match(v => (predicate(v) ? Some(v) : None), None, option) -} - -export const fold = ( - folder: Folder, - initial: U, - option: Option -) => { - return match(v => folder(initial, v), initial, option) -} - -export const foldback = ( - folder: BackFolder, - option: Option, - initial: U -) => { - return match(v => folder(v, initial), initial, option) -} - -export const forall = (predicate: Predicate, option: Option) => { - return match(predicate, true, option) -} - -export const get = (option: Option): T => { - if (option.__brand === some) { - return option as T - } - - throw new Error(`Cannot get value of None`) -} - -export const iter = (mapper: Mapper, option: Option) => { - if (option.__brand === some) { - mapper(option as T) - } -} - -export const toArray = (option: Option) => { - return match(v => [v], [], option) -} - -export const toNullable = (option: Option) => { - return match(identity, null, option) -} - -export const withDefault = (_default: T, option: Option) => { - return match(identity, _default, option) -} - -export const flat = (option: Option>): Option => { - return bind(identity, option) -} - -export const fromNullable = (value: Nullable): Option => { - return value === null ? None : Some(value) -} - -export const fromArray = (value: [T] | []): Option => { - return value[0] === undefined ? None : Some(value[0]) -} diff --git a/typescript/option/src/helpers/bind.ts b/typescript/option/src/helpers/bind.ts new file mode 100644 index 0000000..8dd234d --- /dev/null +++ b/typescript/option/src/helpers/bind.ts @@ -0,0 +1,10 @@ +import { Binder } from '../internalTypes' +import { Option, None } from '../types' +import { match } from './match' + +export const bind = ( + binder: Binder, + option: Option +): Option => { + return match(binder, None, option) +} diff --git a/typescript/option/src/helpers/count.ts b/typescript/option/src/helpers/count.ts new file mode 100644 index 0000000..4f8c017 --- /dev/null +++ b/typescript/option/src/helpers/count.ts @@ -0,0 +1,4 @@ +import { Option } from '../types' +import { isSome } from './isSome' + +export const count = (option: Option) => Number(isSome(option)) diff --git a/typescript/option/src/helpers/exists.ts b/typescript/option/src/helpers/exists.ts new file mode 100644 index 0000000..9b70af7 --- /dev/null +++ b/typescript/option/src/helpers/exists.ts @@ -0,0 +1,7 @@ +import { match } from './match' +import { Predicate } from '../internalTypes' +import { Option } from '../types' + +export const exists = (predicate: Predicate, option: Option) => { + return match(predicate, false, option) +} diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts new file mode 100644 index 0000000..7995d8d --- /dev/null +++ b/typescript/option/src/helpers/external.ts @@ -0,0 +1,18 @@ +export * from './bind' +export * from './count' +export * from './exists' +export * from './filter' +export * from './flat' +export * from './fold' +export * from './foldback' +export * from './forall' +export * from './fromArray' +export * from './fromNullable' +export * from './get' +export * from './isNone' +export * from './isSome' +export * from './iter' +export * from './map' +export * from './toArray' +export * from './toNullable' +export * from './withDefault' diff --git a/typescript/option/src/helpers/filter.ts b/typescript/option/src/helpers/filter.ts new file mode 100644 index 0000000..592b60d --- /dev/null +++ b/typescript/option/src/helpers/filter.ts @@ -0,0 +1,7 @@ +import { match } from './match' +import { Some, None, Option } from '../types' +import { Predicate } from '../internalTypes' + +export const filter = (predicate: Predicate, option: Option) => { + return match(v => (predicate(v) ? Some(v) : None), None, option) +} diff --git a/typescript/option/src/helpers/flat.ts b/typescript/option/src/helpers/flat.ts new file mode 100644 index 0000000..e23283b --- /dev/null +++ b/typescript/option/src/helpers/flat.ts @@ -0,0 +1,7 @@ +import { bind } from './bind' +import { identity } from '../internals' +import { Option } from '../types' + +export const flat = (option: Option>): Option => { + return bind(identity, option) +} diff --git a/typescript/option/src/helpers/fold.ts b/typescript/option/src/helpers/fold.ts new file mode 100644 index 0000000..99f67b8 --- /dev/null +++ b/typescript/option/src/helpers/fold.ts @@ -0,0 +1,11 @@ +import { match } from './match' +import { Option } from '../types' +import { Folder } from '../internalTypes' + +export const fold = ( + folder: Folder, + initial: U, + option: Option +) => { + return match(v => folder(initial, v), initial, option) +} diff --git a/typescript/option/src/helpers/foldback.ts b/typescript/option/src/helpers/foldback.ts new file mode 100644 index 0000000..564dda4 --- /dev/null +++ b/typescript/option/src/helpers/foldback.ts @@ -0,0 +1,11 @@ +import { match } from './match' +import { Option } from '../types' +import { BackFolder } from '../internalTypes' + +export const foldback = ( + folder: BackFolder, + option: Option, + initial: U +) => { + return match(v => folder(v, initial), initial, option) +} diff --git a/typescript/option/src/helpers/forall.ts b/typescript/option/src/helpers/forall.ts new file mode 100644 index 0000000..6321261 --- /dev/null +++ b/typescript/option/src/helpers/forall.ts @@ -0,0 +1,7 @@ +import { match } from './match' +import { Predicate } from '../internalTypes' +import { Option } from '../types' + +export const forall = (predicate: Predicate, option: Option) => { + return match(predicate, true, option) +} diff --git a/typescript/option/src/helpers/fromArray.ts b/typescript/option/src/helpers/fromArray.ts new file mode 100644 index 0000000..0d29b1e --- /dev/null +++ b/typescript/option/src/helpers/fromArray.ts @@ -0,0 +1,5 @@ +import { None, Some, Option } from '../types' + +export const fromArray = (value: [T] | []): Option => { + return value[0] === undefined ? None : Some(value[0]) +} diff --git a/typescript/option/src/helpers/fromNullable.ts b/typescript/option/src/helpers/fromNullable.ts new file mode 100644 index 0000000..6ebb984 --- /dev/null +++ b/typescript/option/src/helpers/fromNullable.ts @@ -0,0 +1,6 @@ +import { Nullable } from '../internalTypes' +import { Some, None, Option } from '../types' + +export const fromNullable = (value: Nullable): Option => { + return value === null ? None : Some(value) +} diff --git a/typescript/option/src/helpers/get.ts b/typescript/option/src/helpers/get.ts new file mode 100644 index 0000000..7ed7e2a --- /dev/null +++ b/typescript/option/src/helpers/get.ts @@ -0,0 +1,10 @@ +import { some } from '../internals' +import { Option } from '../types' + +export const get = (option: Option): T => { + if (option.__brand === some) { + return option as T + } + + throw new Error(`Cannot get value of None`) +} diff --git a/typescript/option/src/helpers/isNone.ts b/typescript/option/src/helpers/isNone.ts new file mode 100644 index 0000000..a55f27a --- /dev/null +++ b/typescript/option/src/helpers/isNone.ts @@ -0,0 +1,4 @@ +import { Option } from '../types' +import { none } from '../internals' + +export const isNothing = (option: Option) => option.__brand === none diff --git a/typescript/option/src/helpers/isSome.ts b/typescript/option/src/helpers/isSome.ts new file mode 100644 index 0000000..cbc07ca --- /dev/null +++ b/typescript/option/src/helpers/isSome.ts @@ -0,0 +1,4 @@ +import { Option } from '../types' +import { some } from '../internals' + +export const isSome = (option: Option) => option.__brand === some diff --git a/typescript/option/src/helpers/iter.ts b/typescript/option/src/helpers/iter.ts new file mode 100644 index 0000000..8788b09 --- /dev/null +++ b/typescript/option/src/helpers/iter.ts @@ -0,0 +1,9 @@ +import { some } from '../internals' +import { Mapper } from '../internalTypes' +import { Option } from '../types' + +export const iter = (mapper: Mapper, option: Option) => { + if (option.__brand === some) { + mapper(option as T) + } +} diff --git a/typescript/option/src/helpers/map.ts b/typescript/option/src/helpers/map.ts new file mode 100644 index 0000000..672b6a8 --- /dev/null +++ b/typescript/option/src/helpers/map.ts @@ -0,0 +1,10 @@ +import { match } from './match' +import { Mapper } from '../internalTypes' +import { Option, Some, None } from '../types' + +export const map = ( + mapper: Mapper, + option: Option +): Option => { + return match(v => Some(mapper(v)), None, option) +} diff --git a/typescript/option/src/helpers/match.ts b/typescript/option/src/helpers/match.ts new file mode 100644 index 0000000..4e3e4d2 --- /dev/null +++ b/typescript/option/src/helpers/match.ts @@ -0,0 +1,15 @@ +import { Option } from '../types' +import { Mapper } from '../internalTypes' +import { some } from '../internals' + +export const match = ( + caseSome: Mapper, + _default: U, + option: Option +) => { + if (option.__brand === some) { + return caseSome(option as T) + } + + return _default +} diff --git a/typescript/option/src/helpers/toArray.ts b/typescript/option/src/helpers/toArray.ts new file mode 100644 index 0000000..e135960 --- /dev/null +++ b/typescript/option/src/helpers/toArray.ts @@ -0,0 +1,6 @@ +import { match } from './match' +import { Option } from '../types' + +export const toArray = (option: Option) => { + return match(v => [v], [], option) +} diff --git a/typescript/option/src/helpers/toNullable.ts b/typescript/option/src/helpers/toNullable.ts new file mode 100644 index 0000000..07baa84 --- /dev/null +++ b/typescript/option/src/helpers/toNullable.ts @@ -0,0 +1,7 @@ +import { match } from './match' +import { identity } from '../internals' +import { Option } from '../types' + +export const toNullable = (option: Option) => { + return match(identity, null, option) +} diff --git a/typescript/option/src/helpers/withDefault.ts b/typescript/option/src/helpers/withDefault.ts new file mode 100644 index 0000000..b9c0f6d --- /dev/null +++ b/typescript/option/src/helpers/withDefault.ts @@ -0,0 +1,7 @@ +import { match } from './match' +import { identity } from '../internals' +import { Option } from '../types' + +export const withDefault = (_default: T, option: Option) => { + return match(identity, _default, option) +} diff --git a/typescript/option/src/index.ts b/typescript/option/src/index.ts index 493732d..37d7557 100644 --- a/typescript/option/src/index.ts +++ b/typescript/option/src/index.ts @@ -1,2 +1,2 @@ -export * from './helpers' +export * from './helpers/external' export * from './types' From 9236bade0ca99c3d580ddba91a2cf74c5c165c7e Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:29:38 +0200 Subject: [PATCH 31/80] typescript(option): feat: added a mapAsync helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/mapAsync.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 typescript/option/src/helpers/mapAsync.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 7995d8d..408312a 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -16,3 +16,4 @@ export * from './map' export * from './toArray' export * from './toNullable' export * from './withDefault' +export * from './mapAsync' diff --git a/typescript/option/src/helpers/mapAsync.ts b/typescript/option/src/helpers/mapAsync.ts new file mode 100644 index 0000000..05b8ea4 --- /dev/null +++ b/typescript/option/src/helpers/mapAsync.ts @@ -0,0 +1,18 @@ +import { Option, None, Some } from '../types' +import { Mapper } from '../internalTypes' +import { match } from './match' + +export const mapAsync = ( + mapper: Mapper>, + option: Option +) => { + return match( + async value => { + const output = await mapper(value) + + return Some(output) + }, + Promise.resolve(None), + option + ) +} From b16272a3aa2a4404a3f11d70ce2cc2c217069f36 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:31:56 +0200 Subject: [PATCH 32/80] typescript(option): feat: added a bindAsync helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/bindAsync.ts | 10 ++++++++++ typescript/option/src/helpers/external.ts | 1 + 2 files changed, 11 insertions(+) create mode 100644 typescript/option/src/helpers/bindAsync.ts diff --git a/typescript/option/src/helpers/bindAsync.ts b/typescript/option/src/helpers/bindAsync.ts new file mode 100644 index 0000000..30f8955 --- /dev/null +++ b/typescript/option/src/helpers/bindAsync.ts @@ -0,0 +1,10 @@ +import { Mapper } from '../internalTypes' +import { Option, None } from '../types' +import { match } from './match' + +export const bindAsync = ( + binder: Mapper>>, + option: Option +): Promise> => { + return match(binder, Promise.resolve(None), option) +} diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 408312a..25ca3d8 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -17,3 +17,4 @@ export * from './toArray' export * from './toNullable' export * from './withDefault' export * from './mapAsync' +export * from './bindAsync' From c56f734d82249974f581321429561cbe16447b29 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:35:04 +0200 Subject: [PATCH 33/80] typescript(option): fix: fixed tslib not beeing installed Signed-off-by: prescientmoon --- typescript/option/package.json | 5 ++++- typescript/option/pnpm-lock.yaml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index e2e31cd..3883c57 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -36,5 +36,8 @@ "utility-types": "^3.10.0" }, "author": "Matei Adriel", - "license": "SEE LICENSE IN LICENSE" + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "tslib": "^1.10.0" + } } diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 7d955d7..79b59ec 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,3 +1,5 @@ +dependencies: + tslib: 1.10.0 devDependencies: '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.14 '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.14 @@ -3417,7 +3419,6 @@ packages: resolution: integrity: sha1-n5up2e+odkw4dpi8v+sshI8RrbM= /tslib/1.10.0: - dev: true resolution: integrity: sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== /type-fest/0.3.1: @@ -3636,5 +3637,6 @@ specifiers: rollup: ^1.27.14 rollup-plugin-terser: ^5.1.3 semantic-release: ^15.14.0 + tslib: ^1.10.0 typescript: ^3.7.4 utility-types: ^3.10.0 From 729b901bc5b8da14819b48ce2877317f56eec36d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 13:53:54 +0200 Subject: [PATCH 34/80] typescript(option): refactor: .then(Some) looks better than async await Signed-off-by: prescientmoon --- typescript/option/src/helpers/mapAsync.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/typescript/option/src/helpers/mapAsync.ts b/typescript/option/src/helpers/mapAsync.ts index 05b8ea4..ebf7989 100644 --- a/typescript/option/src/helpers/mapAsync.ts +++ b/typescript/option/src/helpers/mapAsync.ts @@ -7,11 +7,7 @@ export const mapAsync = ( option: Option ) => { return match( - async value => { - const output = await mapper(value) - - return Some(output) - }, + value => mapper(value).then(Some), Promise.resolve(None), option ) From e2e085cbc35a0c076270705a2a92b411ca5d88fd Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 14:04:52 +0200 Subject: [PATCH 35/80] typescript(option): fix: fied broken brand equality Signed-off-by: prescientmoon --- typescript/option/src/helpers/get.ts | 4 ++-- typescript/option/src/helpers/isSome.ts | 4 ++-- typescript/option/src/helpers/iter.ts | 4 ++-- typescript/option/src/helpers/match.ts | 4 ++-- typescript/option/src/types.ts | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/typescript/option/src/helpers/get.ts b/typescript/option/src/helpers/get.ts index 7ed7e2a..72fc4de 100644 --- a/typescript/option/src/helpers/get.ts +++ b/typescript/option/src/helpers/get.ts @@ -1,8 +1,8 @@ -import { some } from '../internals' import { Option } from '../types' +import { isSome } from './isSome' export const get = (option: Option): T => { - if (option.__brand === some) { + if (isSome(option)) { return option as T } diff --git a/typescript/option/src/helpers/isSome.ts b/typescript/option/src/helpers/isSome.ts index cbc07ca..51fd00c 100644 --- a/typescript/option/src/helpers/isSome.ts +++ b/typescript/option/src/helpers/isSome.ts @@ -1,4 +1,4 @@ import { Option } from '../types' -import { some } from '../internals' +import { isNothing } from './isNone' -export const isSome = (option: Option) => option.__brand === some +export const isSome = (option: Option) => !isNothing(option) diff --git a/typescript/option/src/helpers/iter.ts b/typescript/option/src/helpers/iter.ts index 8788b09..6c8108f 100644 --- a/typescript/option/src/helpers/iter.ts +++ b/typescript/option/src/helpers/iter.ts @@ -1,9 +1,9 @@ -import { some } from '../internals' import { Mapper } from '../internalTypes' import { Option } from '../types' +import { isSome } from './isSome' export const iter = (mapper: Mapper, option: Option) => { - if (option.__brand === some) { + if (isSome(option)) { mapper(option as T) } } diff --git a/typescript/option/src/helpers/match.ts b/typescript/option/src/helpers/match.ts index 4e3e4d2..dda77b6 100644 --- a/typescript/option/src/helpers/match.ts +++ b/typescript/option/src/helpers/match.ts @@ -1,13 +1,13 @@ import { Option } from '../types' import { Mapper } from '../internalTypes' -import { some } from '../internals' +import { isSome } from './isSome' export const match = ( caseSome: Mapper, _default: U, option: Option ) => { - if (option.__brand === some) { + if (isSome(option)) { return caseSome(option as T) } diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index e95dca5..ae443bb 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -6,5 +6,5 @@ type Some = Brand export type Option = Some | None -export const None = undefined as None -export const Some = (value: T): Option => value as Some +export const None = { __brand: none } as None +export const Some = (value: T) => value as Option From d02031e41690dee6f50118f0cc2417e6ac5a7f15 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 14:05:26 +0200 Subject: [PATCH 36/80] typescript(option): feat: readded the .toString() method on None Signed-off-by: prescientmoon --- typescript/option/src/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index ae443bb..ab6120b 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -6,5 +6,8 @@ type Some = Brand export type Option = Some | None -export const None = { __brand: none } as None +export const None = { + __brand: none, + toString: () => 'None' +} as None export const Some = (value: T) => value as Option From f46ef3dbf889e3e1cc9603e437dd5ae1e957ce4c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 14:16:32 +0200 Subject: [PATCH 37/80] typescript(option): fix: Fixed the name of isNone typescript(option): typescript(option): Previously the name was isNothing bu isNone makes more sense typescript(option): typescript(option): BREAKING CHANGE: Changed the name of isNothing to isNone Signed-off-by: prescientmoon --- typescript/option/src/helpers/isNone.ts | 2 +- typescript/option/src/helpers/isSome.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/option/src/helpers/isNone.ts b/typescript/option/src/helpers/isNone.ts index a55f27a..b2a90e0 100644 --- a/typescript/option/src/helpers/isNone.ts +++ b/typescript/option/src/helpers/isNone.ts @@ -1,4 +1,4 @@ import { Option } from '../types' import { none } from '../internals' -export const isNothing = (option: Option) => option.__brand === none +export const isNone = (option: Option) => option.__brand === none diff --git a/typescript/option/src/helpers/isSome.ts b/typescript/option/src/helpers/isSome.ts index 51fd00c..7839bb6 100644 --- a/typescript/option/src/helpers/isSome.ts +++ b/typescript/option/src/helpers/isSome.ts @@ -1,4 +1,4 @@ import { Option } from '../types' -import { isNothing } from './isNone' +import { isNone } from './isNone' -export const isSome = (option: Option) => !isNothing(option) +export const isSome = (option: Option) => !isNone(option) From 445bab939e64b4915a1e59f51a9c6a06cb791508 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 14:24:23 +0200 Subject: [PATCH 38/80] typescript(option): refactor: no longer using the useless some symbol typescript(option): typescript(option): The symbol was never actually used so declaring it is good enough Signed-off-by: prescientmoon --- typescript/option/src/internals.ts | 1 - typescript/option/src/types.ts | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 0e16212..54e7cd7 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -1,4 +1,3 @@ export const identity = (v: T) => v -export const some = Symbol('some') export const none = Symbol('none') diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index ab6120b..016853e 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,6 +1,9 @@ -import { some, none } from './internals' +import { none } from './internals' import { Brand } from 'utility-types' +// This is never actually used outside of typing so we can just declare it +declare const some: unique symbol + type None = Brand type Some = Brand From ff81096e6f47749386b65e15db20bd00950a1c64 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 14:25:10 +0200 Subject: [PATCH 39/80] typescript(option): refactor: rewrote Some as a typecasted identity typescript(option): typescript(option): The Some function did nothing at runtime so a typecasted identity did the job Signed-off-by: prescientmoon --- typescript/option/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index 016853e..005e415 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,4 +1,4 @@ -import { none } from './internals' +import { none, identity } from './internals' import { Brand } from 'utility-types' // This is never actually used outside of typing so we can just declare it @@ -13,4 +13,4 @@ export const None = { __brand: none, toString: () => 'None' } as None -export const Some = (value: T) => value as Option +export const Some = identity as (value: T) => Option From 0abd53917b122c2b834857fe29a1376af84d0fd6 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 15:00:29 +0200 Subject: [PATCH 40/80] typescript(option): fix: fixed wrong types for bind, bindAsync, and probably other helpers as well Signed-off-by: prescientmoon --- typescript/option/lib/index.amd.d.ts | 36 +++++++++++++++++++++++ typescript/option/lib/index.amd.d.ts.map | 1 + typescript/option/lib/index.amd.js | 2 ++ typescript/option/lib/index.amd.js.map | 1 + typescript/option/lib/index.cjs.d.ts | 36 +++++++++++++++++++++++ typescript/option/lib/index.cjs.d.ts.map | 1 + typescript/option/lib/index.cjs.js | 2 ++ typescript/option/lib/index.cjs.js.map | 1 + typescript/option/lib/index.d.ts | 34 +++++++++++++++++++++ typescript/option/lib/index.esm.d.ts | 34 +++++++++++++++++++++ typescript/option/lib/index.esm.js | 2 ++ typescript/option/lib/index.esm.js.map | 1 + typescript/option/lib/index.js | 2 ++ typescript/option/lib/index.js.map | 1 + typescript/option/lib/tsdoc-metadata.json | 11 +++++++ typescript/option/src/helpers/external.ts | 4 +-- typescript/option/src/internalTypes.ts | 4 +-- 17 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 typescript/option/lib/index.amd.d.ts create mode 100644 typescript/option/lib/index.amd.d.ts.map create mode 100644 typescript/option/lib/index.amd.js create mode 100644 typescript/option/lib/index.amd.js.map create mode 100644 typescript/option/lib/index.cjs.d.ts create mode 100644 typescript/option/lib/index.cjs.d.ts.map create mode 100644 typescript/option/lib/index.cjs.js create mode 100644 typescript/option/lib/index.cjs.js.map create mode 100644 typescript/option/lib/index.d.ts create mode 100644 typescript/option/lib/index.esm.d.ts create mode 100644 typescript/option/lib/index.esm.js create mode 100644 typescript/option/lib/index.esm.js.map create mode 100644 typescript/option/lib/index.js create mode 100644 typescript/option/lib/index.js.map create mode 100644 typescript/option/lib/tsdoc-metadata.json diff --git a/typescript/option/lib/index.amd.d.ts b/typescript/option/lib/index.amd.d.ts new file mode 100644 index 0000000..cccb910 --- /dev/null +++ b/typescript/option/lib/index.amd.d.ts @@ -0,0 +1,36 @@ +import { Brand } from "utility-types"; +declare const none: unique symbol; +declare const some: unique symbol; +declare type None = Brand; +declare type Some = Brand; +declare type Option = Some | None; +declare const None: Brand; +declare const Some: (value: T) => Option; +declare const isNone: (option: Option) => boolean; +declare const isSome: (option: Option) => boolean; +declare type Mapper = (v: T) => U; +declare type Binder = (v: T) => Option; +declare type Predicate = (v: T) => boolean; +declare type Folder = (s: U, v: T) => U; +declare type BackFolder = (v: T, s: U) => U; +declare type Nullable = T | null; +declare const bind: (binder: Binder, option: Option) => Option; +declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; +declare const count: (option: Option) => number; +declare const exists: (predicate: Predicate, option: Option) => boolean; +declare const filter: (predicate: Predicate, option: Option) => Option; +declare const flat: (option: Option>) => Option; +declare const fold: (folder: Folder, initial: U, option: Option) => U; +declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; +declare const forall: (predicate: Predicate, option: Option) => boolean; +declare const fromArray: (value: [T] | []) => Option; +declare const fromNullable: (value: Nullable) => Option; +declare const get: (option: Option) => T; +declare const iter: (mapper: Mapper, option: Option) => void; +declare const map: (mapper: Mapper, option: Option) => Option; +declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; +declare const toArray: (option: Option) => T[]; +declare const toNullable: (option: Option) => T | null; +declare const withDefault: (_default: T, option: Option) => T; +export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; +//# sourceMappingURL=index.amd.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.amd.d.ts.map b/typescript/option/lib/index.amd.d.ts.map new file mode 100644 index 0000000..4f43cc4 --- /dev/null +++ b/typescript/option/lib/index.amd.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.amd.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.amd.js b/typescript/option/lib/index.amd.js new file mode 100644 index 0000000..2cf8aa0 --- /dev/null +++ b/typescript/option/lib/index.amd.js @@ -0,0 +1,2 @@ +define(["exports"],(function(e){"use strict";const o=e=>e,r=Symbol("none"),n={__brand:r,toString:()=>"None"},t=o,l=e=>e.__brand===r,i=e=>!l(e),a=(e,o,r)=>i(r)?e(r):o,s=(e,o)=>a(e,n,o);e.None=n,e.Some=t,e.bind=s,e.bindAsync=(e,o)=>a(e,Promise.resolve(n),o),e.count=e=>Number(i(e)),e.exists=(e,o)=>a(e,!1,o),e.filter=(e,o)=>a(o=>e(o)?t(o):n,n,o),e.flat=e=>s(o,e),e.fold=(e,o,r)=>a(r=>e(o,r),o,r),e.foldback=(e,o,r)=>a(o=>e(o,r),r,o),e.forall=(e,o)=>a(e,!0,o),e.fromArray=e=>void 0===e[0]?n:t(e[0]),e.fromNullable=e=>null===e?n:t(e),e.get=e=>{if(i(e))return e;throw new Error("Cannot get value of None")},e.isNone=l,e.isSome=i,e.iter=(e,o)=>{i(o)&&e(o)},e.map=(e,o)=>a(o=>t(e(o)),n,o),e.mapAsync=(e,o)=>a(o=>e(o).then(t),Promise.resolve(n),o),e.toArray=e=>a(e=>[e],[],e),e.toNullable=e=>a(o,null,e),e.withDefault=(e,r)=>a(o,e,r),Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=index.amd.js.map diff --git a/typescript/option/lib/index.amd.js.map b/typescript/option/lib/index.amd.js.map new file mode 100644 index 0000000..5aa1aed --- /dev/null +++ b/typescript/option/lib/index.amd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.amd.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","Promise","resolve","Number","predicate","folder","initial","value","undefined","Error","mapper","then"],"mappings":"6CAAO,MAAMA,EAAeC,GAASA,EAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,IAAM,QAEPC,EAAOP,ECZPQ,EAAaC,GAAsBA,EAAOJ,UAAYH,ECAtDQ,EAAaD,IAAuBD,EAAOC,GCC3CE,EAAQ,CACjBC,EACAC,EACAJ,IAEIC,EAAOD,GACAG,EAASH,GAGbI,ECTEC,EAAO,CAChBC,EACAN,IAEOE,EAAMI,EAAQX,EAAMK,0CCJN,CACrBM,EACAN,IAEOE,EAAMI,EAAQC,QAAQC,QAAQb,GAAOK,WCLvBA,GAAsBS,OAAOR,EAAOD,aCCvC,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAOV,YCDb,CAAIU,EAAyBV,IACxCE,EAAMV,GAAMkB,EAAUlB,GAAKM,EAAKN,GAAKG,EAAOA,EAAMK,UCDrCA,GACbK,EAAKd,EAAUS,UCDN,CAChBW,EACAC,EACAZ,IAEOE,EAAMV,GAAKmB,EAAOC,EAASpB,GAAIoB,EAASZ,cCL3B,CACpBW,EACAX,EACAY,IAEOV,EAAMV,GAAKmB,EAAOnB,EAAGoB,GAAUA,EAASZ,YCL7B,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAMV,eCHLa,QACLC,IAAbD,EAAM,GAAmBlB,EAAOG,EAAKe,EAAM,mBCAtBA,GACX,OAAVA,EAAiBlB,EAAOG,EAAKe,SCDjBb,IACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAIe,MAAM,0DCJA,CAAIC,EAAyBhB,KACzCC,EAAOD,IACPgB,EAAOhB,UCFI,CACfgB,EACAhB,IAEOE,EAAMV,GAAKM,EAAKkB,EAAOxB,IAAKG,EAAMK,cCJrB,CACpBgB,EACAhB,IAEOE,EACHW,GAASG,EAAOH,GAAOI,KAAKnB,GAC5BS,QAAQC,QAAQb,GAChBK,aCRmBA,GAChBE,EAAMV,GAAK,CAACA,GAAI,GAAIQ,gBCADA,GACnBE,EAAMX,EAAU,KAAMS,iBCDN,CAAII,EAAaJ,IACjCE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts b/typescript/option/lib/index.cjs.d.ts new file mode 100644 index 0000000..c401bc5 --- /dev/null +++ b/typescript/option/lib/index.cjs.d.ts @@ -0,0 +1,36 @@ +import { Brand } from "utility-types"; +declare const none: unique symbol; +declare const some: unique symbol; +declare type None = Brand; +declare type Some = Brand; +declare type Option = Some | None; +declare const None: Brand; +declare const Some: (value: T) => Option; +declare const isNone: (option: Option) => boolean; +declare const isSome: (option: Option) => boolean; +declare type Mapper = (v: T) => U; +declare type Binder = (v: T) => Option; +declare type Predicate = (v: T) => boolean; +declare type Folder = (s: U, v: T) => U; +declare type BackFolder = (v: T, s: U) => U; +declare type Nullable = T | null; +declare const bind: (binder: Binder, option: Option) => Option; +declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; +declare const count: (option: Option) => number; +declare const exists: (predicate: Predicate, option: Option) => boolean; +declare const filter: (predicate: Predicate, option: Option) => Option; +declare const flat: (option: Option>) => Option; +declare const fold: (folder: Folder, initial: U, option: Option) => U; +declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; +declare const forall: (predicate: Predicate, option: Option) => boolean; +declare const fromArray: (value: [T] | []) => Option; +declare const fromNullable: (value: Nullable) => Option; +declare const get: (option: Option) => T; +declare const iter: (mapper: Mapper, option: Option) => void; +declare const map: (mapper: Mapper, option: Option) => Option; +declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; +declare const toArray: (option: Option) => T[]; +declare const toNullable: (option: Option) => T | null; +declare const withDefault: (_default: T, option: Option) => T; +export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; +//# sourceMappingURL=index.cjs.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts.map b/typescript/option/lib/index.cjs.d.ts.map new file mode 100644 index 0000000..f11f2c2 --- /dev/null +++ b/typescript/option/lib/index.cjs.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.cjs.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.js b/typescript/option/lib/index.cjs.js new file mode 100644 index 0000000..d54edff --- /dev/null +++ b/typescript/option/lib/index.cjs.js @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const identity=e=>e,none=Symbol("none"),None={__brand:none,toString:()=>"None"},Some=identity,isNone=e=>e.__brand===none,isSome=e=>!isNone(e),match=(e,o,t)=>isSome(t)?e(t):o,bind=(e,o)=>match(e,None,o),bindAsync=(e,o)=>match(e,Promise.resolve(None),o),count=e=>Number(isSome(e)),exists=(e,o)=>match(e,!1,o),filter=(e,o)=>match(o=>e(o)?Some(o):None,None,o),flat=e=>bind(identity,e),fold=(e,o,t)=>match(t=>e(o,t),o,t),foldback=(e,o,t)=>match(o=>e(o,t),t,o),forall=(e,o)=>match(e,!0,o),fromArray=e=>void 0===e[0]?None:Some(e[0]),fromNullable=e=>null===e?None:Some(e),get=e=>{if(isSome(e))return e;throw new Error("Cannot get value of None")},iter=(e,o)=>{isSome(o)&&e(o)},map=(e,o)=>match(o=>Some(e(o)),None,o),mapAsync=(e,o)=>match(o=>e(o).then(Some),Promise.resolve(None),o),toArray=e=>match(e=>[e],[],e),toNullable=e=>match(identity,null,e),withDefault=(e,o)=>match(identity,e,o);exports.None=None,exports.Some=Some,exports.bind=bind,exports.bindAsync=bindAsync,exports.count=count,exports.exists=exists,exports.filter=filter,exports.flat=flat,exports.fold=fold,exports.foldback=foldback,exports.forall=forall,exports.fromArray=fromArray,exports.fromNullable=fromNullable,exports.get=get,exports.isNone=isNone,exports.isSome=isSome,exports.iter=iter,exports.map=map,exports.mapAsync=mapAsync,exports.toArray=toArray,exports.toNullable=toNullable,exports.withDefault=withDefault; +//# sourceMappingURL=index.cjs.js.map diff --git a/typescript/option/lib/index.cjs.js.map b/typescript/option/lib/index.cjs.js.map new file mode 100644 index 0000000..5015f9b --- /dev/null +++ b/typescript/option/lib/index.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.cjs.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"oEAAO,MAAMA,SAAeC,GAASA,EAExBC,KAAOC,OAAO,QCSdC,KAAO,CAChBC,QAASH,KACTI,SAAU,IAAM,QAEPC,KAAOP,SCZPQ,OAAaC,GAAsBA,EAAOJ,UAAYH,KCAtDQ,OAAaD,IAAuBD,OAAOC,GCC3CE,MAAQ,CACjBC,EACAC,EACAJ,IAEIC,OAAOD,GACAG,EAASH,GAGbI,ECTEC,KAAO,CAChBC,EACAN,IAEOE,MAAMI,EAAQX,KAAMK,GCJlBO,UAAY,CACrBD,EACAN,IAEOE,MAAMI,EAAQE,QAAQC,QAAQd,MAAOK,GCLnCU,MAAYV,GAAsBW,OAAOV,OAAOD,ICChDY,OAAS,CAAIC,EAAyBb,IACxCE,MAAMW,GAAW,EAAOb,GCDtBc,OAAS,CAAID,EAAyBb,IACxCE,MAAMV,GAAMqB,EAAUrB,GAAKM,KAAKN,GAAKG,KAAOA,KAAMK,GCDhDe,KAAWf,GACbK,KAAKd,SAAUS,GCDbgB,KAAO,CAChBC,EACAC,EACAlB,IAEOE,MAAMV,GAAKyB,EAAOC,EAAS1B,GAAI0B,EAASlB,GCLtCmB,SAAW,CACpBF,EACAjB,EACAkB,IAEOhB,MAAMV,GAAKyB,EAAOzB,EAAG0B,GAAUA,EAASlB,GCLtCoB,OAAS,CAAIP,EAAyBb,IACxCE,MAAMW,GAAW,EAAMb,GCHrBqB,UAAgBC,QACLC,IAAbD,EAAM,GAAmB3B,KAAOG,KAAKwB,EAAM,ICAzCE,aAAmBF,GACX,OAAVA,EAAiB3B,KAAOG,KAAKwB,GCD3BG,IAAUzB,IACnB,GAAIC,OAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,KAAO,CAAIC,EAAyB5B,KACzCC,OAAOD,IACP4B,EAAO5B,ICFF6B,IAAM,CACfD,EACA5B,IAEOE,MAAMV,GAAKM,KAAK8B,EAAOpC,IAAKG,KAAMK,GCJhC8B,SAAW,CACpBF,EACA5B,IAEOE,MACHoB,GAASM,EAAON,GAAOS,KAAKjC,MAC5BU,QAAQC,QAAQd,MAChBK,GCRKgC,QAAchC,GAChBE,MAAMV,GAAK,CAACA,GAAI,GAAIQ,GCAlBiC,WAAiBjC,GACnBE,MAAMX,SAAU,KAAMS,GCDpBkC,YAAc,CAAI9B,EAAaJ,IACjCE,MAAMX,SAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.d.ts b/typescript/option/lib/index.d.ts new file mode 100644 index 0000000..0bf8d85 --- /dev/null +++ b/typescript/option/lib/index.d.ts @@ -0,0 +1,34 @@ +import { Brand } from "utility-types"; +declare const none: unique symbol; +declare const some: unique symbol; +declare type None = Brand; +declare type Some = Brand; +declare type Option = Some | None; +declare const None: Brand; +declare const Some: (value: T) => Option; +declare const isNone: (option: Option) => boolean; +declare const isSome: (option: Option) => boolean; +declare type Mapper = (v: T) => U; +declare type Binder = (v: T) => Option; +declare type Predicate = (v: T) => boolean; +declare type Folder = (s: U, v: T) => U; +declare type BackFolder = (v: T, s: U) => U; +declare const bind: (binder: Binder, option: Option) => Option; +declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; +declare const count: (option: Option) => number; +declare const exists: (predicate: Predicate, option: Option) => boolean; +declare const filter: (predicate: Predicate, option: Option) => Option; +declare const flat: (option: Option>) => Option; +declare const fold: (folder: Folder, initial: U, option: Option) => U; +declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; +declare const forall: (predicate: Predicate, option: Option) => boolean; +declare const fromArray: (value: [T] | []) => Option; +declare const fromNullable: (value: T) => Option; +declare const get: (option: Option) => T; +declare const iter: (mapper: Mapper, option: Option) => void; +declare const map: (mapper: Mapper, option: Option) => Option; +declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; +declare const toArray: (option: Option) => T[]; +declare const toNullable: (option: Option) => T; +declare const withDefault: (_default: T, option: Option) => T; +export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.d.ts b/typescript/option/lib/index.esm.d.ts new file mode 100644 index 0000000..0bf8d85 --- /dev/null +++ b/typescript/option/lib/index.esm.d.ts @@ -0,0 +1,34 @@ +import { Brand } from "utility-types"; +declare const none: unique symbol; +declare const some: unique symbol; +declare type None = Brand; +declare type Some = Brand; +declare type Option = Some | None; +declare const None: Brand; +declare const Some: (value: T) => Option; +declare const isNone: (option: Option) => boolean; +declare const isSome: (option: Option) => boolean; +declare type Mapper = (v: T) => U; +declare type Binder = (v: T) => Option; +declare type Predicate = (v: T) => boolean; +declare type Folder = (s: U, v: T) => U; +declare type BackFolder = (v: T, s: U) => U; +declare const bind: (binder: Binder, option: Option) => Option; +declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; +declare const count: (option: Option) => number; +declare const exists: (predicate: Predicate, option: Option) => boolean; +declare const filter: (predicate: Predicate, option: Option) => Option; +declare const flat: (option: Option>) => Option; +declare const fold: (folder: Folder, initial: U, option: Option) => U; +declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; +declare const forall: (predicate: Predicate, option: Option) => boolean; +declare const fromArray: (value: [T] | []) => Option; +declare const fromNullable: (value: T) => Option; +declare const get: (option: Option) => T; +declare const iter: (mapper: Mapper, option: Option) => void; +declare const map: (mapper: Mapper, option: Option) => Option; +declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; +declare const toArray: (option: Option) => T[]; +declare const toNullable: (option: Option) => T; +declare const withDefault: (_default: T, option: Option) => T; +export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.js b/typescript/option/lib/index.esm.js new file mode 100644 index 0000000..474fb75 --- /dev/null +++ b/typescript/option/lib/index.esm.js @@ -0,0 +1,2 @@ +var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; +//# sourceMappingURL=index.esm.js.map diff --git a/typescript/option/lib/index.esm.js.map b/typescript/option/lib/index.esm.js.map new file mode 100644 index 0000000..acd8820 --- /dev/null +++ b/typescript/option/lib/index.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.esm.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.js b/typescript/option/lib/index.js new file mode 100644 index 0000000..f83d25c --- /dev/null +++ b/typescript/option/lib/index.js @@ -0,0 +1,2 @@ +var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; +//# sourceMappingURL=index.js.map diff --git a/typescript/option/lib/index.js.map b/typescript/option/lib/index.js.map new file mode 100644 index 0000000..85facf1 --- /dev/null +++ b/typescript/option/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/tsdoc-metadata.json b/typescript/option/lib/tsdoc-metadata.json new file mode 100644 index 0000000..65d0a8d --- /dev/null +++ b/typescript/option/lib/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.7.0" + } + ] +} diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 25ca3d8..e2c7a4e 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -1,4 +1,5 @@ export * from './bind' +export * from './bindAsync' export * from './count' export * from './exists' export * from './filter' @@ -13,8 +14,7 @@ export * from './isNone' export * from './isSome' export * from './iter' export * from './map' +export * from './mapAsync' export * from './toArray' export * from './toNullable' export * from './withDefault' -export * from './mapAsync' -export * from './bindAsync' diff --git a/typescript/option/src/internalTypes.ts b/typescript/option/src/internalTypes.ts index 091ab91..339d971 100644 --- a/typescript/option/src/internalTypes.ts +++ b/typescript/option/src/internalTypes.ts @@ -1,8 +1,8 @@ import { Option } from './types' export type Mapper = (v: T) => U -export type Binder = Mapper> -export type Predicate = Mapper +export type Binder = (v: T) => Option +export type Predicate = (v: T) => boolean export type Folder = (s: U, v: T) => U export type BackFolder = (v: T, s: U) => U export type Nullable = T | null From 0ef7baa73961615aaec5087b8f450a12e7c67656 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 15:08:36 +0200 Subject: [PATCH 41/80] typescript(option): refactor: now using @thi.ng/compose Signed-off-by: prescientmoon --- typescript/option/package.json | 1 + typescript/option/pnpm-lock.yaml | 17 +++++++++++++++++ typescript/option/src/helpers/count.ts | 4 ++-- typescript/option/src/helpers/flat.ts | 2 +- typescript/option/src/helpers/map.ts | 3 ++- typescript/option/src/helpers/toNullable.ts | 2 +- typescript/option/src/helpers/withDefault.ts | 2 +- typescript/option/src/internals.ts | 2 -- typescript/option/src/types.ts | 3 ++- 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index 3883c57..c98aa4e 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -38,6 +38,7 @@ "author": "Matei Adriel", "license": "SEE LICENSE IN LICENSE", "dependencies": { + "@thi.ng/compose": "^1.3.6", "tslib": "^1.10.0" } } diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 79b59ec..3271d76 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,4 +1,5 @@ dependencies: + '@thi.ng/compose': 1.3.6 tslib: 1.10.0 devDependencies: '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.14 @@ -953,6 +954,21 @@ packages: semantic-release: '>=15.8.0 <16.0.0 || >=16.0.0-beta <17.0.0' resolution: integrity: sha512-LGjgPBGjjmjap/76O0Md3wc04Y7IlLnzZceLsAkcYRwGQdRPTTFUJKqDQTuieWTs7zfHzQoZqsqPfFxEN+g2+Q== + /@thi.ng/api/6.6.0: + dev: false + resolution: + integrity: sha512-CG4jxoidxdTNAVdGEGj9nLwOts37BszTWSl3RejFL/K2yOxEkB77c0zfvz19sSZVfUWv5dDWgXewbYwBnHvKlA== + /@thi.ng/compose/1.3.6: + dependencies: + '@thi.ng/api': 6.6.0 + '@thi.ng/errors': 1.2.2 + dev: false + resolution: + integrity: sha512-anCFAQqnfOjPXGkkAptJE9gMBtD4jMJc/2sETLl09M3BUMCj3i6We1tCJ9ljcoXwO+jgscTAaMOopiOwslO0SA== + /@thi.ng/errors/1.2.2: + dev: false + resolution: + integrity: sha512-M0T8m+H+FDAFi6Oe8FTYQWTBgx+xrwsstiH4KzSUGjDGmJ7Hi/FSfwmBPIslrRVnrnJKwBk41aYQ1tk3J6CNKw== /@types/color-name/1.1.1: dev: true resolution: @@ -3631,6 +3647,7 @@ packages: specifiers: '@rollup/plugin-commonjs': ^11.0.0 '@rollup/plugin-node-resolve': ^6.0.0 + '@thi.ng/compose': ^1.3.6 '@types/node': ^12.12.21 '@wessberg/rollup-plugin-ts': ^1.1.83 rimraf: ^3.0.0 diff --git a/typescript/option/src/helpers/count.ts b/typescript/option/src/helpers/count.ts index 4f8c017..6cdb30d 100644 --- a/typescript/option/src/helpers/count.ts +++ b/typescript/option/src/helpers/count.ts @@ -1,4 +1,4 @@ -import { Option } from '../types' import { isSome } from './isSome' +import { compL } from '@thi.ng/compose' -export const count = (option: Option) => Number(isSome(option)) +export const count = compL(isSome, Number) diff --git a/typescript/option/src/helpers/flat.ts b/typescript/option/src/helpers/flat.ts index e23283b..0d5f1f2 100644 --- a/typescript/option/src/helpers/flat.ts +++ b/typescript/option/src/helpers/flat.ts @@ -1,5 +1,5 @@ import { bind } from './bind' -import { identity } from '../internals' +import { identity } from '@thi.ng/compose' import { Option } from '../types' export const flat = (option: Option>): Option => { diff --git a/typescript/option/src/helpers/map.ts b/typescript/option/src/helpers/map.ts index 672b6a8..01f850b 100644 --- a/typescript/option/src/helpers/map.ts +++ b/typescript/option/src/helpers/map.ts @@ -1,10 +1,11 @@ import { match } from './match' import { Mapper } from '../internalTypes' import { Option, Some, None } from '../types' +import { compL } from '@thi.ng/compose' export const map = ( mapper: Mapper, option: Option ): Option => { - return match(v => Some(mapper(v)), None, option) + return match(compL(mapper, Some), None, option) } diff --git a/typescript/option/src/helpers/toNullable.ts b/typescript/option/src/helpers/toNullable.ts index 07baa84..7a7d072 100644 --- a/typescript/option/src/helpers/toNullable.ts +++ b/typescript/option/src/helpers/toNullable.ts @@ -1,5 +1,5 @@ import { match } from './match' -import { identity } from '../internals' +import { identity } from '@thi.ng/compose' import { Option } from '../types' export const toNullable = (option: Option) => { diff --git a/typescript/option/src/helpers/withDefault.ts b/typescript/option/src/helpers/withDefault.ts index b9c0f6d..b1c9934 100644 --- a/typescript/option/src/helpers/withDefault.ts +++ b/typescript/option/src/helpers/withDefault.ts @@ -1,5 +1,5 @@ import { match } from './match' -import { identity } from '../internals' +import { identity } from '@thi.ng/compose' import { Option } from '../types' export const withDefault = (_default: T, option: Option) => { diff --git a/typescript/option/src/internals.ts b/typescript/option/src/internals.ts index 54e7cd7..09b8392 100644 --- a/typescript/option/src/internals.ts +++ b/typescript/option/src/internals.ts @@ -1,3 +1 @@ -export const identity = (v: T) => v - export const none = Symbol('none') diff --git a/typescript/option/src/types.ts b/typescript/option/src/types.ts index 005e415..397841e 100644 --- a/typescript/option/src/types.ts +++ b/typescript/option/src/types.ts @@ -1,5 +1,6 @@ -import { none, identity } from './internals' +import { identity } from '@thi.ng/compose' import { Brand } from 'utility-types' +import { none } from './internals' // This is never actually used outside of typing so we can just declare it declare const some: unique symbol From a32f62cfc6c6a8ae19410148ad684feb4a6a093d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 15:12:48 +0200 Subject: [PATCH 42/80] typescript(option): fix: fixed the type definition for count Signed-off-by: prescientmoon --- typescript/option/src/helpers/count.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/helpers/count.ts b/typescript/option/src/helpers/count.ts index 6cdb30d..b47ef46 100644 --- a/typescript/option/src/helpers/count.ts +++ b/typescript/option/src/helpers/count.ts @@ -1,4 +1,4 @@ import { isSome } from './isSome' -import { compL } from '@thi.ng/compose' +import { Option } from '../types' -export const count = compL(isSome, Number) +export const count = (option: Option) => Number(isSome(option)) From dcd55c50476b445673657450fe41ed51667aaa50 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 15:17:09 +0200 Subject: [PATCH 43/80] typescript(option): fix: compL was only used once so it wasn't worth the bundle sacrifice Signed-off-by: prescientmoon --- typescript/option/src/helpers/map.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/typescript/option/src/helpers/map.ts b/typescript/option/src/helpers/map.ts index 01f850b..672b6a8 100644 --- a/typescript/option/src/helpers/map.ts +++ b/typescript/option/src/helpers/map.ts @@ -1,11 +1,10 @@ import { match } from './match' import { Mapper } from '../internalTypes' import { Option, Some, None } from '../types' -import { compL } from '@thi.ng/compose' export const map = ( mapper: Mapper, option: Option ): Option => { - return match(compL(mapper, Some), None, option) + return match(v => Some(mapper(v)), None, option) } From 1fc2ef32e490816911b3d89c4e1ca40c8e511aef Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 15:59:19 +0200 Subject: [PATCH 44/80] typescript(option): test: added tests for bind Signed-off-by: prescientmoon --- typescript/option/package.json | 8 +- typescript/option/pnpm-lock.yaml | 459 ++++++++++++++++++++- typescript/option/src/helpers/bind.test.ts | 32 ++ typescript/option/tsconfig.json | 1 + 4 files changed, 498 insertions(+), 2 deletions(-) create mode 100644 typescript/option/src/helpers/bind.test.ts diff --git a/typescript/option/package.json b/typescript/option/package.json index c98aa4e..af5d47f 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -7,7 +7,8 @@ "typings": "dist/index.esm.d.ts", "scripts": { "prebuild": "rimraf dist", - "build": "rollup -c rollup.config.ts" + "build": "rollup -c rollup.config.ts", + "test": "mocha -r ts-node/register src/**/*.test.ts" }, "publishConfig": { "access": "public" @@ -26,12 +27,17 @@ "devDependencies": { "@rollup/plugin-commonjs": "^11.0.0", "@rollup/plugin-node-resolve": "^6.0.0", + "@types/chai": "^4.2.7", + "@types/mocha": "^5.2.7", "@types/node": "^12.12.21", "@wessberg/rollup-plugin-ts": "^1.1.83", + "chai": "^4.2.0", + "mocha": "^6.2.2", "rimraf": "^3.0.0", "rollup": "^1.27.14", "rollup-plugin-terser": "^5.1.3", "semantic-release": "^15.14.0", + "ts-node": "^8.5.4", "typescript": "^3.7.4", "utility-types": "^3.10.0" }, diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 3271d76..0fbc0cd 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -4,12 +4,17 @@ dependencies: devDependencies: '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.14 '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.14 + '@types/chai': 4.2.7 + '@types/mocha': 5.2.7 '@types/node': 12.12.21 '@wessberg/rollup-plugin-ts': 1.1.83_rollup@1.27.14+typescript@3.7.4 + chai: 4.2.0 + mocha: 6.2.2 rimraf: 3.0.0 rollup: 1.27.14 rollup-plugin-terser: 5.1.3_rollup@1.27.14 semantic-release: 15.14.0_semantic-release@15.14.0 + ts-node: 8.5.4_typescript@3.7.4 typescript: 3.7.4 utility-types: 3.10.0 lockfileVersion: 5.1 @@ -969,6 +974,10 @@ packages: dev: false resolution: integrity: sha512-M0T8m+H+FDAFi6Oe8FTYQWTBgx+xrwsstiH4KzSUGjDGmJ7Hi/FSfwmBPIslrRVnrnJKwBk41aYQ1tk3J6CNKw== + /@types/chai/4.2.7: + dev: true + resolution: + integrity: sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g== /@types/color-name/1.1.1: dev: true resolution: @@ -1003,6 +1012,10 @@ packages: dev: true resolution: integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== + /@types/mocha/5.2.7: + dev: true + resolution: + integrity: sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== /@types/node/12.12.21: dev: true resolution: @@ -1130,12 +1143,30 @@ packages: node: '>=8' resolution: integrity: sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + /ansi-colors/3.2.3: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== /ansi-escapes/3.2.0: dev: true engines: node: '>=4' resolution: integrity: sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + /ansi-regex/3.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + /ansi-regex/4.1.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== /ansi-regex/5.0.0: dev: true engines: @@ -1163,6 +1194,16 @@ packages: dev: true resolution: integrity: sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk= + /arg/4.1.2: + dev: true + resolution: + integrity: sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg== + /argparse/1.0.10: + dependencies: + sprintf-js: 1.0.3 + dev: true + resolution: + integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== /argv-formatter/1.0.0: dev: true resolution: @@ -1189,6 +1230,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + /assertion-error/1.1.0: + dev: true + resolution: + integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== /atob-lite/2.0.0: dev: true resolution: @@ -1226,6 +1271,10 @@ packages: node: '>=8' resolution: integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + /browser-stdout/1.3.1: + dev: true + resolution: + integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== /browserslist/4.7.2: dependencies: caniuse-lite: 1.0.30001016 @@ -1298,6 +1347,19 @@ packages: hasBin: true resolution: integrity: sha1-fMEFXYItISlU0HsIXeolHMe8VQU= + /chai/4.2.0: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.2 + deep-eql: 3.0.1 + get-func-name: 2.0.0 + pathval: 1.1.0 + type-detect: 4.0.8 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== /chalk/2.4.2: dependencies: ansi-styles: 3.2.1 @@ -1308,6 +1370,10 @@ packages: node: '>=4' resolution: integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + /check-error/1.0.2: + dev: true + resolution: + integrity: sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= /clean-stack/2.2.0: dev: true engines: @@ -1322,6 +1388,14 @@ packages: node: '>= 0.2.0' resolution: integrity: sha1-9TsFJmqLGguTSz0IIebi3FkUriM= + /cliui/5.0.0: + dependencies: + string-width: 3.1.0 + strip-ansi: 5.2.0 + wrap-ansi: 5.1.0 + dev: true + resolution: + integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== /cliui/6.0.0: dependencies: string-width: 4.2.0 @@ -1501,7 +1575,7 @@ packages: integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== /debug/3.2.6: dependencies: - ms: 2.1.2 + ms: 2.1.1 dev: true resolution: integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -1526,6 +1600,14 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + /deep-eql/3.0.1: + dependencies: + type-detect: 4.0.8 + dev: true + engines: + node: '>=0.12' + resolution: + integrity: sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== /deep-extend/0.6.0: dev: true engines: @@ -1544,6 +1626,18 @@ packages: dev: true resolution: integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + /diff/3.5.0: + dev: true + engines: + node: '>=0.3.1' + resolution: + integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + /diff/4.0.1: + dev: true + engines: + node: '>=0.3.1' + resolution: + integrity: sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== /dir-glob/3.0.1: dependencies: path-type: 4.0.0 @@ -1570,6 +1664,10 @@ packages: dev: true resolution: integrity: sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== + /emoji-regex/7.0.3: + dev: true + resolution: + integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== /emoji-regex/8.0.0: dev: true resolution: @@ -1595,6 +1693,34 @@ packages: dev: true resolution: integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + /es-abstract/1.17.0: + dependencies: + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.1 + is-callable: 1.1.5 + is-regex: 1.0.5 + object-inspect: 1.7.0 + object-keys: 1.1.1 + object.assign: 4.1.0 + string.prototype.trimleft: 2.1.1 + string.prototype.trimright: 2.1.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug== + /es-to-primitive/1.2.1: + dependencies: + is-callable: 1.1.5 + is-date-object: 1.0.2 + is-symbol: 1.0.3 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== /es6-promise/4.2.8: dev: true resolution: @@ -1713,6 +1839,14 @@ packages: node: '>=4' resolution: integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + /find-up/3.0.0: + dependencies: + locate-path: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== /find-up/4.1.0: dependencies: locate-path: 5.0.0 @@ -1730,6 +1864,13 @@ packages: node: '>=6' resolution: integrity: sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== + /flat/4.1.0: + dependencies: + is-buffer: 2.0.4 + dev: true + hasBin: true + resolution: + integrity: sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== /from2/2.3.0: dependencies: inherits: 2.0.4 @@ -1761,6 +1902,10 @@ packages: node: 6.* || 8.* || >= 10.* resolution: integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + /get-func-name/2.0.0: + dev: true + resolution: + integrity: sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= /get-stream/4.1.0: dependencies: pump: 3.0.0 @@ -1796,6 +1941,17 @@ packages: node: '>= 6' resolution: integrity: sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== + /glob/7.1.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.0.4 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + resolution: + integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== /glob/7.1.6: dependencies: fs.realpath: 1.0.0 @@ -1832,6 +1988,12 @@ packages: dev: true resolution: integrity: sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + /growl/1.10.5: + dev: true + engines: + node: '>=4.x' + resolution: + integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== /handlebars/4.5.3: dependencies: neo-async: 2.6.1 @@ -1863,6 +2025,19 @@ packages: node: '>= 0.4' resolution: integrity: sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + /has/1.0.3: + dependencies: + function-bind: 1.1.1 + dev: true + engines: + node: '>= 0.4.0' + resolution: + integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + /he/1.2.0: + dev: true + hasBin: true + resolution: + integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== /hook-std/2.0.0: dev: true engines: @@ -1972,12 +2147,36 @@ packages: dev: true resolution: integrity: sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + /is-buffer/2.0.4: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== + /is-callable/1.1.5: + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + /is-date-object/1.0.2: + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== /is-extglob/2.1.1: dev: true engines: node: '>=0.10.0' resolution: integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + /is-fullwidth-code-point/2.0.0: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= /is-fullwidth-code-point/3.0.0: dev: true engines: @@ -2028,6 +2227,14 @@ packages: dev: true resolution: integrity: sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + /is-regex/1.0.5: + dependencies: + has: 1.0.3 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== /is-stream/1.1.0: dev: true engines: @@ -2040,6 +2247,14 @@ packages: node: '>=8' resolution: integrity: sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + /is-symbol/1.0.3: + dependencies: + has-symbols: 1.0.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== /is-text-path/1.0.1: dependencies: text-extensions: 1.9.0 @@ -2099,6 +2314,14 @@ packages: dev: true resolution: integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + /js-yaml/3.13.1: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + hasBin: true + resolution: + integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== /jsesc/0.5.0: dev: true hasBin: true @@ -2164,6 +2387,15 @@ packages: node: '>=4' resolution: integrity: sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + /locate-path/3.0.0: + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== /locate-path/5.0.0: dependencies: p-locate: 4.1.0 @@ -2216,6 +2448,14 @@ packages: dev: true resolution: integrity: sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + /log-symbols/2.2.0: + dependencies: + chalk: 2.4.2 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== /loose-envify/1.4.0: dependencies: js-tokens: 4.0.0 @@ -2250,6 +2490,10 @@ packages: dev: true resolution: integrity: sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== + /make-error/1.3.5: + dev: true + resolution: + integrity: sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== /map-obj/1.0.1: dev: true engines: @@ -2373,6 +2617,37 @@ packages: hasBin: true resolution: integrity: sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + /mocha/6.2.2: + dependencies: + ansi-colors: 3.2.3 + browser-stdout: 1.3.1 + debug: 3.2.6 + diff: 3.5.0 + escape-string-regexp: 1.0.5 + find-up: 3.0.0 + glob: 7.1.3 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 3.13.1 + log-symbols: 2.2.0 + minimatch: 3.0.4 + mkdirp: 0.5.1 + ms: 2.1.1 + node-environment-flags: 1.0.5 + object.assign: 4.1.0 + strip-json-comments: 2.0.1 + supports-color: 6.0.0 + which: 1.3.1 + wide-align: 1.1.3 + yargs: 13.3.0 + yargs-parser: 13.1.1 + yargs-unparser: 1.6.0 + dev: true + engines: + node: '>= 6.0.0' + hasBin: true + resolution: + integrity: sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A== /modify-values/1.0.1: dev: true engines: @@ -2383,6 +2658,10 @@ packages: dev: true resolution: integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + /ms/2.1.1: + dev: true + resolution: + integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== /ms/2.1.2: dev: true resolution: @@ -2405,6 +2684,13 @@ packages: dev: true resolution: integrity: sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== + /node-environment-flags/1.0.5: + dependencies: + object.getownpropertydescriptors: 2.1.0 + semver: 5.7.1 + dev: true + resolution: + integrity: sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== /node-fetch/2.6.0: dev: true engines: @@ -2577,6 +2863,10 @@ packages: hasBin: true resolution: integrity: sha512-vTcUL4SCg3AzwInWTbqg1OIaOXlzKSS8Mb8kc5avwrJpcvevDA5J9BhYSuei+fNs3pwOp4lzA5x2FVDXACvoXA== + /object-inspect/1.7.0: + dev: true + resolution: + integrity: sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== /object-keys/1.1.1: dev: true engines: @@ -2600,6 +2890,15 @@ packages: node: '>= 0.4' resolution: integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + /object.getownpropertydescriptors/2.1.0: + dependencies: + define-properties: 1.1.3 + es-abstract: 1.17.0 + dev: true + engines: + node: '>= 0.8' + resolution: + integrity: sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== /octokit-pagination-methods/1.1.0: dev: true resolution: @@ -2684,6 +2983,14 @@ packages: node: '>=4' resolution: integrity: sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + /p-locate/3.0.0: + dependencies: + p-limit: 2.2.1 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== /p-locate/4.1.0: dependencies: p-limit: 2.2.1 @@ -2801,6 +3108,10 @@ packages: node: '>=8' resolution: integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + /pathval/1.1.0: + dev: true + resolution: + integrity: sha1-uULm1L3mUwBe9rcTYd74cn0GReA= /picomatch/2.1.1: dev: true engines: @@ -3262,6 +3573,10 @@ packages: dev: true resolution: integrity: sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== + /sprintf-js/1.0.3: + dev: true + resolution: + integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= /stream-combiner2/1.1.1: dependencies: duplexer2: 0.1.4 @@ -3269,6 +3584,25 @@ packages: dev: true resolution: integrity: sha1-+02KFCDqNidk4hrUeAOXvry0HL4= + /string-width/2.1.1: + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + /string-width/3.1.0: + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== /string-width/4.2.0: dependencies: emoji-regex: 8.0.0 @@ -3279,6 +3613,24 @@ packages: node: '>=8' resolution: integrity: sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + /string.prototype.trimleft/2.1.1: + dependencies: + define-properties: 1.1.3 + function-bind: 1.1.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== + /string.prototype.trimright/2.1.1: + dependencies: + define-properties: 1.1.3 + function-bind: 1.1.1 + dev: true + engines: + node: '>= 0.4' + resolution: + integrity: sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== /string_decoder/1.1.1: dependencies: safe-buffer: 5.1.2 @@ -3291,6 +3643,22 @@ packages: dev: true resolution: integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + /strip-ansi/4.0.0: + dependencies: + ansi-regex: 3.0.0 + dev: true + engines: + node: '>=4' + resolution: + integrity: sha1-qEeQIusaw2iocTibY1JixQXuNo8= + /strip-ansi/5.2.0: + dependencies: + ansi-regex: 4.1.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== /strip-ansi/6.0.0: dependencies: ansi-regex: 5.0.0 @@ -3337,6 +3705,14 @@ packages: node: '>=4' resolution: integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + /supports-color/6.0.0: + dependencies: + has-flag: 3.0.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== /supports-color/6.1.0: dependencies: has-flag: 3.0.0 @@ -3434,9 +3810,31 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-n5up2e+odkw4dpi8v+sshI8RrbM= + /ts-node/8.5.4_typescript@3.7.4: + dependencies: + arg: 4.1.2 + diff: 4.0.1 + make-error: 1.3.5 + source-map-support: 0.5.16 + typescript: 3.7.4 + yn: 3.1.1 + dev: true + engines: + node: '>=4.2.0' + hasBin: true + peerDependencies: + typescript: '>=2.0' + resolution: + integrity: sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw== /tslib/1.10.0: resolution: integrity: sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + /type-detect/4.0.8: + dev: true + engines: + node: '>=4' + resolution: + integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== /type-fest/0.3.1: dev: true engines: @@ -3565,6 +3963,12 @@ packages: hasBin: true resolution: integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + /wide-align/1.1.3: + dependencies: + string-width: 2.1.1 + dev: true + resolution: + integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== /windows-release/3.2.0: dependencies: execa: 1.0.0 @@ -3579,6 +3983,16 @@ packages: node: '>=0.4.0' resolution: integrity: sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + /wrap-ansi/5.1.0: + dependencies: + ansi-styles: 3.2.1 + string-width: 3.1.0 + strip-ansi: 5.2.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== /wrap-ansi/6.2.0: dependencies: ansi-styles: 4.2.0 @@ -3621,6 +4035,13 @@ packages: dev: true resolution: integrity: sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== + /yargs-parser/13.1.1: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: true + resolution: + integrity: sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== /yargs-parser/16.1.0: dependencies: camelcase: 5.3.1 @@ -3628,6 +4049,31 @@ packages: dev: true resolution: integrity: sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== + /yargs-unparser/1.6.0: + dependencies: + flat: 4.1.0 + lodash: 4.17.15 + yargs: 13.3.0 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== + /yargs/13.3.0: + dependencies: + cliui: 5.0.0 + find-up: 3.0.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 3.1.0 + which-module: 2.0.0 + y18n: 4.0.0 + yargs-parser: 13.1.1 + dev: true + resolution: + integrity: sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== /yargs/15.0.2: dependencies: cliui: 6.0.0 @@ -3644,16 +4090,27 @@ packages: dev: true resolution: integrity: sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q== + /yn/3.1.1: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== specifiers: '@rollup/plugin-commonjs': ^11.0.0 '@rollup/plugin-node-resolve': ^6.0.0 '@thi.ng/compose': ^1.3.6 + '@types/chai': ^4.2.7 + '@types/mocha': ^5.2.7 '@types/node': ^12.12.21 '@wessberg/rollup-plugin-ts': ^1.1.83 + chai: ^4.2.0 + mocha: ^6.2.2 rimraf: ^3.0.0 rollup: ^1.27.14 rollup-plugin-terser: ^5.1.3 semantic-release: ^15.14.0 + ts-node: ^8.5.4 tslib: ^1.10.0 typescript: ^3.7.4 utility-types: ^3.10.0 diff --git a/typescript/option/src/helpers/bind.test.ts b/typescript/option/src/helpers/bind.test.ts new file mode 100644 index 0000000..d20ca4f --- /dev/null +++ b/typescript/option/src/helpers/bind.test.ts @@ -0,0 +1,32 @@ +import { expect } from 'chai' +import { bind } from './bind' +import { Some, None } from '../types' +import { constantly } from '@thi.ng/compose' + +describe('The bind helper', () => { + it('should return none for any callback when given None', () => { + // act + const result = bind(Some, None) + + // assert + expect(result).to.equal(None) + }) + + describe('When given Some', () => { + it('should return None if the callback returns None', () => { + // act + const result = bind(constantly(None), Some(3)) + + // assert + expect(result).to.equal(None) + }) + + it('should return Some if the callback returns Some', () => { + // act + const result = bind(x => Some(x + 1), Some(3)) + + // assert + expect(result).to.equal(Some(4)) + }) + }) +}) diff --git a/typescript/option/tsconfig.json b/typescript/option/tsconfig.json index ee2ac52..fe39ee0 100644 --- a/typescript/option/tsconfig.json +++ b/typescript/option/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "module": "CommonJS", "lib": ["esnext", "dom", "es2015.iterable"], "moduleResolution": "node", "strictNullChecks": true, From 1a443ee3492a5fd8db4e8e7e9623df78b5215ad7 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:01:51 +0200 Subject: [PATCH 45/80] typescript(option): test: added tests for bindAsync Signed-off-by: prescientmoon --- typescript/option/src/helpers/bind.test.ts | 2 +- .../option/src/helpers/bindAsync.test.ts | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 typescript/option/src/helpers/bindAsync.test.ts diff --git a/typescript/option/src/helpers/bind.test.ts b/typescript/option/src/helpers/bind.test.ts index d20ca4f..d462e70 100644 --- a/typescript/option/src/helpers/bind.test.ts +++ b/typescript/option/src/helpers/bind.test.ts @@ -4,7 +4,7 @@ import { Some, None } from '../types' import { constantly } from '@thi.ng/compose' describe('The bind helper', () => { - it('should return none for any callback when given None', () => { + it('should return None for any callback when given None', () => { // act const result = bind(Some, None) diff --git a/typescript/option/src/helpers/bindAsync.test.ts b/typescript/option/src/helpers/bindAsync.test.ts new file mode 100644 index 0000000..2ec2bfe --- /dev/null +++ b/typescript/option/src/helpers/bindAsync.test.ts @@ -0,0 +1,32 @@ +import { expect } from 'chai' +import { Some, None } from '../types' +import { constantly } from '@thi.ng/compose' +import { bindAsync } from './bindAsync' + +describe('The bindAsync helper', () => { + it('should return None for any callback when given None', async () => { + // act + const result = await bindAsync(async v => Some(v), None) + + // assert + expect(result).to.equal(None) + }) + + describe('When given Some', () => { + it('should return None if the callback returns None', async () => { + // act + const result = await bindAsync(async _ => None, Some(3)) + + // assert + expect(result).to.equal(None) + }) + + it('should return Some if the callback returns Some', async () => { + // act + const result = await bindAsync(async x => Some(x + 1), Some(3)) + + // assert + expect(result).to.equal(Some(4)) + }) + }) +}) From d905e05a19c236eff204e85eef17996da4d73fbf Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:05:22 +0200 Subject: [PATCH 46/80] typescript(option): test: added tests for count Signed-off-by: prescientmoon --- .../option/src/helpers/bindAsync.test.ts | 1 - typescript/option/src/helpers/count.test.ts | 22 +++++++++++++++++++ typescript/option/test/constants.ts | 2 ++ typescript/option/tsconfig.json | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 typescript/option/src/helpers/count.test.ts create mode 100644 typescript/option/test/constants.ts diff --git a/typescript/option/src/helpers/bindAsync.test.ts b/typescript/option/src/helpers/bindAsync.test.ts index 2ec2bfe..8610cf6 100644 --- a/typescript/option/src/helpers/bindAsync.test.ts +++ b/typescript/option/src/helpers/bindAsync.test.ts @@ -1,6 +1,5 @@ import { expect } from 'chai' import { Some, None } from '../types' -import { constantly } from '@thi.ng/compose' import { bindAsync } from './bindAsync' describe('The bindAsync helper', () => { diff --git a/typescript/option/src/helpers/count.test.ts b/typescript/option/src/helpers/count.test.ts new file mode 100644 index 0000000..7450a03 --- /dev/null +++ b/typescript/option/src/helpers/count.test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai' +import { Some, None } from '../types' +import { count } from './count' +import { x } from '../../test/constants' + +describe('The count helper', () => { + it('should return 1 when given Some', () => { + // act + const result = count(Some(x)) + + // assert + expect(result).to.equal(1) + }) + + it('should return 0 when given None', () => { + // act + const result = count(None) + + // assert + expect(result).to.equal(0) + }) +}) diff --git a/typescript/option/test/constants.ts b/typescript/option/test/constants.ts new file mode 100644 index 0000000..329bc93 --- /dev/null +++ b/typescript/option/test/constants.ts @@ -0,0 +1,2 @@ +// general value to pass around +export const x = Symbol('x') diff --git a/typescript/option/tsconfig.json b/typescript/option/tsconfig.json index fe39ee0..46c5041 100644 --- a/typescript/option/tsconfig.json +++ b/typescript/option/tsconfig.json @@ -8,5 +8,5 @@ "downlevelIteration": true, "target": "es6" }, - "include": ["src", "sandbox"] + "include": ["src", "sandbox", "test"] } From bf2022b56e3e118f63590896fee35e98d6ae8f12 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:06:26 +0200 Subject: [PATCH 47/80] typescript(option): chore: WHY WASNT LIB GITIGNORED Signed-off-by: prescientmoon --- typescript/option/lib/index.amd.d.ts | 36 ----------------------- typescript/option/lib/index.amd.d.ts.map | 1 - typescript/option/lib/index.amd.js | 2 -- typescript/option/lib/index.amd.js.map | 1 - typescript/option/lib/index.cjs.d.ts | 36 ----------------------- typescript/option/lib/index.cjs.d.ts.map | 1 - typescript/option/lib/index.cjs.js | 2 -- typescript/option/lib/index.cjs.js.map | 1 - typescript/option/lib/index.d.ts | 34 --------------------- typescript/option/lib/index.esm.d.ts | 34 --------------------- typescript/option/lib/index.esm.js | 2 -- typescript/option/lib/index.esm.js.map | 1 - typescript/option/lib/index.js | 2 -- typescript/option/lib/index.js.map | 1 - typescript/option/lib/tsdoc-metadata.json | 11 ------- 15 files changed, 165 deletions(-) delete mode 100644 typescript/option/lib/index.amd.d.ts delete mode 100644 typescript/option/lib/index.amd.d.ts.map delete mode 100644 typescript/option/lib/index.amd.js delete mode 100644 typescript/option/lib/index.amd.js.map delete mode 100644 typescript/option/lib/index.cjs.d.ts delete mode 100644 typescript/option/lib/index.cjs.d.ts.map delete mode 100644 typescript/option/lib/index.cjs.js delete mode 100644 typescript/option/lib/index.cjs.js.map delete mode 100644 typescript/option/lib/index.d.ts delete mode 100644 typescript/option/lib/index.esm.d.ts delete mode 100644 typescript/option/lib/index.esm.js delete mode 100644 typescript/option/lib/index.esm.js.map delete mode 100644 typescript/option/lib/index.js delete mode 100644 typescript/option/lib/index.js.map delete mode 100644 typescript/option/lib/tsdoc-metadata.json diff --git a/typescript/option/lib/index.amd.d.ts b/typescript/option/lib/index.amd.d.ts deleted file mode 100644 index cccb910..0000000 --- a/typescript/option/lib/index.amd.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare type Nullable = T | null; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: Nullable) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T | null; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; -//# sourceMappingURL=index.amd.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.amd.d.ts.map b/typescript/option/lib/index.amd.d.ts.map deleted file mode 100644 index 4f43cc4..0000000 --- a/typescript/option/lib/index.amd.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.amd.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.amd.js b/typescript/option/lib/index.amd.js deleted file mode 100644 index 2cf8aa0..0000000 --- a/typescript/option/lib/index.amd.js +++ /dev/null @@ -1,2 +0,0 @@ -define(["exports"],(function(e){"use strict";const o=e=>e,r=Symbol("none"),n={__brand:r,toString:()=>"None"},t=o,l=e=>e.__brand===r,i=e=>!l(e),a=(e,o,r)=>i(r)?e(r):o,s=(e,o)=>a(e,n,o);e.None=n,e.Some=t,e.bind=s,e.bindAsync=(e,o)=>a(e,Promise.resolve(n),o),e.count=e=>Number(i(e)),e.exists=(e,o)=>a(e,!1,o),e.filter=(e,o)=>a(o=>e(o)?t(o):n,n,o),e.flat=e=>s(o,e),e.fold=(e,o,r)=>a(r=>e(o,r),o,r),e.foldback=(e,o,r)=>a(o=>e(o,r),r,o),e.forall=(e,o)=>a(e,!0,o),e.fromArray=e=>void 0===e[0]?n:t(e[0]),e.fromNullable=e=>null===e?n:t(e),e.get=e=>{if(i(e))return e;throw new Error("Cannot get value of None")},e.isNone=l,e.isSome=i,e.iter=(e,o)=>{i(o)&&e(o)},e.map=(e,o)=>a(o=>t(e(o)),n,o),e.mapAsync=(e,o)=>a(o=>e(o).then(t),Promise.resolve(n),o),e.toArray=e=>a(e=>[e],[],e),e.toNullable=e=>a(o,null,e),e.withDefault=(e,r)=>a(o,e,r),Object.defineProperty(e,"__esModule",{value:!0})})); -//# sourceMappingURL=index.amd.js.map diff --git a/typescript/option/lib/index.amd.js.map b/typescript/option/lib/index.amd.js.map deleted file mode 100644 index 5aa1aed..0000000 --- a/typescript/option/lib/index.amd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.amd.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","Promise","resolve","Number","predicate","folder","initial","value","undefined","Error","mapper","then"],"mappings":"6CAAO,MAAMA,EAAeC,GAASA,EAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,IAAM,QAEPC,EAAOP,ECZPQ,EAAaC,GAAsBA,EAAOJ,UAAYH,ECAtDQ,EAAaD,IAAuBD,EAAOC,GCC3CE,EAAQ,CACjBC,EACAC,EACAJ,IAEIC,EAAOD,GACAG,EAASH,GAGbI,ECTEC,EAAO,CAChBC,EACAN,IAEOE,EAAMI,EAAQX,EAAMK,0CCJN,CACrBM,EACAN,IAEOE,EAAMI,EAAQC,QAAQC,QAAQb,GAAOK,WCLvBA,GAAsBS,OAAOR,EAAOD,aCCvC,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAOV,YCDb,CAAIU,EAAyBV,IACxCE,EAAMV,GAAMkB,EAAUlB,GAAKM,EAAKN,GAAKG,EAAOA,EAAMK,UCDrCA,GACbK,EAAKd,EAAUS,UCDN,CAChBW,EACAC,EACAZ,IAEOE,EAAMV,GAAKmB,EAAOC,EAASpB,GAAIoB,EAASZ,cCL3B,CACpBW,EACAX,EACAY,IAEOV,EAAMV,GAAKmB,EAAOnB,EAAGoB,GAAUA,EAASZ,YCL7B,CAAIU,EAAyBV,IACxCE,EAAMQ,GAAW,EAAMV,eCHLa,QACLC,IAAbD,EAAM,GAAmBlB,EAAOG,EAAKe,EAAM,mBCAtBA,GACX,OAAVA,EAAiBlB,EAAOG,EAAKe,SCDjBb,IACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAIe,MAAM,0DCJA,CAAIC,EAAyBhB,KACzCC,EAAOD,IACPgB,EAAOhB,UCFI,CACfgB,EACAhB,IAEOE,EAAMV,GAAKM,EAAKkB,EAAOxB,IAAKG,EAAMK,cCJrB,CACpBgB,EACAhB,IAEOE,EACHW,GAASG,EAAOH,GAAOI,KAAKnB,GAC5BS,QAAQC,QAAQb,GAChBK,aCRmBA,GAChBE,EAAMV,GAAK,CAACA,GAAI,GAAIQ,gBCADA,GACnBE,EAAMX,EAAU,KAAMS,iBCDN,CAAII,EAAaJ,IACjCE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts b/typescript/option/lib/index.cjs.d.ts deleted file mode 100644 index c401bc5..0000000 --- a/typescript/option/lib/index.cjs.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare type Nullable = T | null; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: Nullable) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T | null; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; -//# sourceMappingURL=index.cjs.d.ts.map \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.d.ts.map b/typescript/option/lib/index.cjs.d.ts.map deleted file mode 100644 index f11f2c2..0000000 --- a/typescript/option/lib/index.cjs.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.cjs.d.ts","sourceRoot":"","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/internalTypes.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts","../src/helpers/external.ts","../src/index.ts"],"names":[],"mappings":"AAAA,QAAO,MAAM,QAAQ,gBAAiB,CAAA;AAEtC,QAAO,MAAM,IAAI,eAAiB,CAAAAAIA,OAAO,CAAC,MAAM,IAAI,EAAE,OAAO,MAAM,CAAA;AAEjC,aAAK,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,IAAI,CAAC,CAAA;AACpC,aAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAA;AAEpC,aAAY,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;AAEtC,QAAO,MAAM,IAAI,0BAGR,CAAA;AACT,QAAO,MAAM,IAAI,4BAAyC,CAAAAAGA,QAAO,MAAM,MAAM,mCAAoD,CAAAAAGA,QAAO,MAAM,MAAM,mCAA4C,CAAAAAEA,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AACtC,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AAC9C,aAAY,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAA;AAC5C,aAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAC5C,aAAY,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;AAChD,aAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAAAAIA,QAAO,MAAM,KAAK,qEAUjB,CAAAAAIA,QAAO,MAAM,IAAI,8DAKhB,CAAAAAIA,QAAO,MAAM,SAAS,wFAKrB,CAAAAAGA,QAAO,MAAM,KAAK,kCAAmD,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAIA,QAAO,MAAM,MAAM,8DAElB,CAAAAAIA,QAAO,MAAM,IAAI,6CAEhB,CAAAAAIA,QAAO,MAAM,IAAI,kEAMhB,CAAAAAIA,QAAO,MAAM,QAAQ,sEAMpB,CAAAAAIA,QAAO,MAAM,MAAM,4DAElB,CAAAAAEA,QAAO,MAAM,SAAS,mCAErB,CAAAAAGA,QAAO,MAAM,YAAY,sCAExB,CAAAAAGA,QAAO,MAAM,GAAG,6BAMf,CAAAAAIA,QAAO,MAAM,IAAI,yDAIhB,CAAAAAIA,QAAO,MAAM,GAAG,8DAKf,CAAAAAIA,QAAO,MAAM,QAAQ,gFASpB,CAAAAAGA,QAAO,MAAM,OAAO,+BAEnB,CAAAAAIA,QAAO,MAAM,UAAU,oCAEtB,CAAAAAIA,QAAO,MAAM,WAAW,0CAEvB,CAAA"} \ No newline at end of file diff --git a/typescript/option/lib/index.cjs.js b/typescript/option/lib/index.cjs.js deleted file mode 100644 index d54edff..0000000 --- a/typescript/option/lib/index.cjs.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const identity=e=>e,none=Symbol("none"),None={__brand:none,toString:()=>"None"},Some=identity,isNone=e=>e.__brand===none,isSome=e=>!isNone(e),match=(e,o,t)=>isSome(t)?e(t):o,bind=(e,o)=>match(e,None,o),bindAsync=(e,o)=>match(e,Promise.resolve(None),o),count=e=>Number(isSome(e)),exists=(e,o)=>match(e,!1,o),filter=(e,o)=>match(o=>e(o)?Some(o):None,None,o),flat=e=>bind(identity,e),fold=(e,o,t)=>match(t=>e(o,t),o,t),foldback=(e,o,t)=>match(o=>e(o,t),t,o),forall=(e,o)=>match(e,!0,o),fromArray=e=>void 0===e[0]?None:Some(e[0]),fromNullable=e=>null===e?None:Some(e),get=e=>{if(isSome(e))return e;throw new Error("Cannot get value of None")},iter=(e,o)=>{isSome(o)&&e(o)},map=(e,o)=>match(o=>Some(e(o)),None,o),mapAsync=(e,o)=>match(o=>e(o).then(Some),Promise.resolve(None),o),toArray=e=>match(e=>[e],[],e),toNullable=e=>match(identity,null,e),withDefault=(e,o)=>match(identity,e,o);exports.None=None,exports.Some=Some,exports.bind=bind,exports.bindAsync=bindAsync,exports.count=count,exports.exists=exists,exports.filter=filter,exports.flat=flat,exports.fold=fold,exports.foldback=foldback,exports.forall=forall,exports.fromArray=fromArray,exports.fromNullable=fromNullable,exports.get=get,exports.isNone=isNone,exports.isSome=isSome,exports.iter=iter,exports.map=map,exports.mapAsync=mapAsync,exports.toArray=toArray,exports.toNullable=toNullable,exports.withDefault=withDefault; -//# sourceMappingURL=index.cjs.js.map diff --git a/typescript/option/lib/index.cjs.js.map b/typescript/option/lib/index.cjs.js.map deleted file mode 100644 index 5015f9b..0000000 --- a/typescript/option/lib/index.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.cjs.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"oEAAO,MAAMA,SAAeC,GAASA,EAExBC,KAAOC,OAAO,QCSdC,KAAO,CAChBC,QAASH,KACTI,SAAU,IAAM,QAEPC,KAAOP,SCZPQ,OAAaC,GAAsBA,EAAOJ,UAAYH,KCAtDQ,OAAaD,IAAuBD,OAAOC,GCC3CE,MAAQ,CACjBC,EACAC,EACAJ,IAEIC,OAAOD,GACAG,EAASH,GAGbI,ECTEC,KAAO,CAChBC,EACAN,IAEOE,MAAMI,EAAQX,KAAMK,GCJlBO,UAAY,CACrBD,EACAN,IAEOE,MAAMI,EAAQE,QAAQC,QAAQd,MAAOK,GCLnCU,MAAYV,GAAsBW,OAAOV,OAAOD,ICChDY,OAAS,CAAIC,EAAyBb,IACxCE,MAAMW,GAAW,EAAOb,GCDtBc,OAAS,CAAID,EAAyBb,IACxCE,MAAMV,GAAMqB,EAAUrB,GAAKM,KAAKN,GAAKG,KAAOA,KAAMK,GCDhDe,KAAWf,GACbK,KAAKd,SAAUS,GCDbgB,KAAO,CAChBC,EACAC,EACAlB,IAEOE,MAAMV,GAAKyB,EAAOC,EAAS1B,GAAI0B,EAASlB,GCLtCmB,SAAW,CACpBF,EACAjB,EACAkB,IAEOhB,MAAMV,GAAKyB,EAAOzB,EAAG0B,GAAUA,EAASlB,GCLtCoB,OAAS,CAAIP,EAAyBb,IACxCE,MAAMW,GAAW,EAAMb,GCHrBqB,UAAgBC,QACLC,IAAbD,EAAM,GAAmB3B,KAAOG,KAAKwB,EAAM,ICAzCE,aAAmBF,GACX,OAAVA,EAAiB3B,KAAOG,KAAKwB,GCD3BG,IAAUzB,IACnB,GAAIC,OAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,KAAO,CAAIC,EAAyB5B,KACzCC,OAAOD,IACP4B,EAAO5B,ICFF6B,IAAM,CACfD,EACA5B,IAEOE,MAAMV,GAAKM,KAAK8B,EAAOpC,IAAKG,KAAMK,GCJhC8B,SAAW,CACpBF,EACA5B,IAEOE,MACHoB,GAASM,EAAON,GAAOS,KAAKjC,MAC5BU,QAAQC,QAAQd,MAChBK,GCRKgC,QAAchC,GAChBE,MAAMV,GAAK,CAACA,GAAI,GAAIQ,GCAlBiC,WAAiBjC,GACnBE,MAAMX,SAAU,KAAMS,GCDpBkC,YAAc,CAAI9B,EAAaJ,IACjCE,MAAMX,SAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.d.ts b/typescript/option/lib/index.d.ts deleted file mode 100644 index 0bf8d85..0000000 --- a/typescript/option/lib/index.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: T) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.d.ts b/typescript/option/lib/index.esm.d.ts deleted file mode 100644 index 0bf8d85..0000000 --- a/typescript/option/lib/index.esm.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Brand } from "utility-types"; -declare const none: unique symbol; -declare const some: unique symbol; -declare type None = Brand; -declare type Some = Brand; -declare type Option = Some | None; -declare const None: Brand; -declare const Some: (value: T) => Option; -declare const isNone: (option: Option) => boolean; -declare const isSome: (option: Option) => boolean; -declare type Mapper = (v: T) => U; -declare type Binder = (v: T) => Option; -declare type Predicate = (v: T) => boolean; -declare type Folder = (s: U, v: T) => U; -declare type BackFolder = (v: T, s: U) => U; -declare const bind: (binder: Binder, option: Option) => Option; -declare const bindAsync: (binder: Mapper>>, option: Option) => Promise>; -declare const count: (option: Option) => number; -declare const exists: (predicate: Predicate, option: Option) => boolean; -declare const filter: (predicate: Predicate, option: Option) => Option; -declare const flat: (option: Option>) => Option; -declare const fold: (folder: Folder, initial: U, option: Option) => U; -declare const foldback: (folder: BackFolder, option: Option, initial: U) => U; -declare const forall: (predicate: Predicate, option: Option) => boolean; -declare const fromArray: (value: [T] | []) => Option; -declare const fromNullable: (value: T) => Option; -declare const get: (option: Option) => T; -declare const iter: (mapper: Mapper, option: Option) => void; -declare const map: (mapper: Mapper, option: Option) => Option; -declare const mapAsync: (mapper: Mapper>, option: Option) => Promise>; -declare const toArray: (option: Option) => T[]; -declare const toNullable: (option: Option) => T; -declare const withDefault: (_default: T, option: Option) => T; -export { bind, bindAsync, count, exists, filter, flat, fold, foldback, forall, fromArray, fromNullable, get, isNone, isSome, iter, map, mapAsync, toArray, toNullable, withDefault, Option, None, Some }; diff --git a/typescript/option/lib/index.esm.js b/typescript/option/lib/index.esm.js deleted file mode 100644 index 474fb75..0000000 --- a/typescript/option/lib/index.esm.js +++ /dev/null @@ -1,2 +0,0 @@ -var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; -//# sourceMappingURL=index.esm.js.map diff --git a/typescript/option/lib/index.esm.js.map b/typescript/option/lib/index.esm.js.map deleted file mode 100644 index acd8820..0000000 --- a/typescript/option/lib/index.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.esm.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/index.js b/typescript/option/lib/index.js deleted file mode 100644 index f83d25c..0000000 --- a/typescript/option/lib/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var n=function(n){return n},r=Symbol("none"),t={__brand:r,toString:function(){return"None"}},u=n,o=function(n){return n.__brand===r},e=function(n){return!o(n)},i=function(n,r,t){return e(t)?n(t):r},f=function(n,r){return i(n,t,r)},c=function(n,r){return i(n,Promise.resolve(t),r)},l=function(n){return Number(e(n))},a=function(n,r){return i(n,!1,r)},v=function(n,r){return i((function(r){return n(r)?u(r):t}),t,r)},b=function(r){return f(n,r)},m=function(n,r,t){return i((function(t){return n(r,t)}),r,t)},s=function(n,r,t){return i((function(r){return n(r,t)}),t,r)},_=function(n,r){return i(n,!0,r)},d=function(n){return void 0===n[0]?t:u(n[0])},N=function(n){return null===n?t:u(n)},g=function(n){if(e(n))return n;throw new Error("Cannot get value of None")},h=function(n,r){e(r)&&n(r)},w=function(n,r){return i((function(r){return u(n(r))}),t,r)},P=function(n,r){return i((function(r){return n(r).then(u)}),Promise.resolve(t),r)},S=function(n){return i((function(n){return[n]}),[],n)},p=function(r){return i(n,null,r)},x=function(r,t){return i(n,r,t)};export{t as None,u as Some,f as bind,c as bindAsync,l as count,a as exists,v as filter,b as flat,m as fold,s as foldback,_ as forall,d as fromArray,N as fromNullable,g as get,o as isNone,e as isSome,h as iter,w as map,P as mapAsync,S as toArray,p as toNullable,x as withDefault}; -//# sourceMappingURL=index.js.map diff --git a/typescript/option/lib/index.js.map b/typescript/option/lib/index.js.map deleted file mode 100644 index 85facf1..0000000 --- a/typescript/option/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/internals.ts","../src/types.ts","../src/helpers/isNone.ts","../src/helpers/isSome.ts","../src/helpers/match.ts","../src/helpers/bind.ts","../src/helpers/bindAsync.ts","../src/helpers/count.ts","../src/helpers/exists.ts","../src/helpers/filter.ts","../src/helpers/flat.ts","../src/helpers/fold.ts","../src/helpers/foldback.ts","../src/helpers/forall.ts","../src/helpers/fromArray.ts","../src/helpers/fromNullable.ts","../src/helpers/get.ts","../src/helpers/iter.ts","../src/helpers/map.ts","../src/helpers/mapAsync.ts","../src/helpers/toArray.ts","../src/helpers/toNullable.ts","../src/helpers/withDefault.ts"],"sourcesContent":["export const identity = (v: T) => v\n\nexport const none = Symbol('none')\n","import { none, identity } from './internals'\nimport { Brand } from 'utility-types'\n\n// This is never actually used outside of typing so we can just declare it\ndeclare const some: unique symbol\n\ntype None = Brand\ntype Some = Brand\n\nexport type Option = Some | None\n\nexport const None = {\n __brand: none,\n toString: () => 'None'\n} as None\nexport const Some = identity as (value: T) => Option\n","import { Option } from '../types'\nimport { none } from '../internals'\n\nexport const isNone = (option: Option) => option.__brand === none\n","import { Option } from '../types'\nimport { isNone } from './isNone'\n\nexport const isSome = (option: Option) => !isNone(option)\n","import { Option } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { isSome } from './isSome'\n\nexport const match = (\n caseSome: Mapper,\n _default: U,\n option: Option\n) => {\n if (isSome(option)) {\n return caseSome(option as T)\n }\n\n return _default\n}\n","import { Binder } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bind = (\n binder: Binder,\n option: Option\n): Option => {\n return match(binder, None, option)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option, None } from '../types'\nimport { match } from './match'\n\nexport const bindAsync = (\n binder: Mapper>>,\n option: Option\n): Promise> => {\n return match(binder, Promise.resolve(None), option)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const count = (option: Option) => Number(isSome(option))\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const exists = (predicate: Predicate, option: Option) => {\n return match(predicate, false, option)\n}\n","import { match } from './match'\nimport { Some, None, Option } from '../types'\nimport { Predicate } from '../internalTypes'\n\nexport const filter = (predicate: Predicate, option: Option) => {\n return match(v => (predicate(v) ? Some(v) : None), None, option)\n}\n","import { bind } from './bind'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const flat = (option: Option>): Option => {\n return bind(identity, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { Folder } from '../internalTypes'\n\nexport const fold = (\n folder: Folder,\n initial: U,\n option: Option\n) => {\n return match(v => folder(initial, v), initial, option)\n}\n","import { match } from './match'\nimport { Option } from '../types'\nimport { BackFolder } from '../internalTypes'\n\nexport const foldback = (\n folder: BackFolder,\n option: Option,\n initial: U\n) => {\n return match(v => folder(v, initial), initial, option)\n}\n","import { match } from './match'\nimport { Predicate } from '../internalTypes'\nimport { Option } from '../types'\n\nexport const forall = (predicate: Predicate, option: Option) => {\n return match(predicate, true, option)\n}\n","import { None, Some, Option } from '../types'\n\nexport const fromArray = (value: [T] | []): Option => {\n return value[0] === undefined ? None : Some(value[0])\n}\n","import { Nullable } from '../internalTypes'\nimport { Some, None, Option } from '../types'\n\nexport const fromNullable = (value: Nullable): Option => {\n return value === null ? None : Some(value)\n}\n","import { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const get = (option: Option): T => {\n if (isSome(option)) {\n return option as T\n }\n\n throw new Error(`Cannot get value of None`)\n}\n","import { Mapper } from '../internalTypes'\nimport { Option } from '../types'\nimport { isSome } from './isSome'\n\nexport const iter = (mapper: Mapper, option: Option) => {\n if (isSome(option)) {\n mapper(option as T)\n }\n}\n","import { match } from './match'\nimport { Mapper } from '../internalTypes'\nimport { Option, Some, None } from '../types'\n\nexport const map = (\n mapper: Mapper,\n option: Option\n): Option => {\n return match(v => Some(mapper(v)), None, option)\n}\n","import { Option, None, Some } from '../types'\nimport { Mapper } from '../internalTypes'\nimport { match } from './match'\n\nexport const mapAsync = (\n mapper: Mapper>,\n option: Option\n) => {\n return match(\n value => mapper(value).then(Some),\n Promise.resolve(None),\n option\n )\n}\n","import { match } from './match'\nimport { Option } from '../types'\n\nexport const toArray = (option: Option) => {\n return match(v => [v], [], option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const toNullable = (option: Option) => {\n return match(identity, null, option)\n}\n","import { match } from './match'\nimport { identity } from '../internals'\nimport { Option } from '../types'\n\nexport const withDefault = (_default: T, option: Option) => {\n return match(identity, _default, option)\n}\n"],"names":["identity","v","none","Symbol","None","__brand","toString","Some","isNone","option","isSome","match","caseSome","_default","bind","binder","bindAsync","Promise","resolve","count","Number","exists","predicate","filter","flat","fold","folder","initial","foldback","forall","fromArray","value","undefined","fromNullable","get","Error","iter","mapper","map","mapAsync","then","toArray","toNullable","withDefault"],"mappings":"AAAO,IAAMA,EAAW,SAAIC,GAAS,OAAAA,GAExBC,EAAOC,OAAO,QCSdC,EAAO,CAChBC,QAASH,EACTI,SAAU,WAAM,MAAA,SAEPC,EAAOP,ECZPQ,EAAS,SAAIC,GAAsB,OAAAA,EAAOJ,UAAYH,GCAtDQ,EAAS,SAAID,GAAsB,OAACD,EAAOC,ICC3CE,EAAQ,SACjBC,EACAC,EACAJ,GAEA,OAAIC,EAAOD,GACAG,EAASH,GAGbI,GCTEC,EAAO,SAChBC,EACAN,GAEA,OAAOE,EAAMI,EAAQX,EAAMK,ICJlBO,EAAY,SACrBD,EACAN,GAEA,OAAOE,EAAMI,EAAQE,QAAQC,QAAQd,GAAOK,ICLnCU,EAAQ,SAAIV,GAAsB,OAAAW,OAAOV,EAAOD,KCChDY,EAAS,SAAIC,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAOb,ICDtBc,EAAS,SAAID,EAAyBb,GAC/C,OAAOE,GAAM,SAAAV,GAAK,OAACqB,EAAUrB,GAAKM,EAAKN,GAAKG,IAAOA,EAAMK,ICDhDe,EAAO,SAAIf,GACpB,OAAOK,EAAKd,EAAUS,ICDbgB,EAAO,SAChBC,EACAC,EACAlB,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAyB,EAAOC,EAAS1B,KAAI0B,EAASlB,ICLtCmB,EAAW,SACpBF,EACAjB,EACAkB,GAEA,OAAOhB,GAAM,SAAAV,GAAK,OAAAyB,EAAOzB,EAAG0B,KAAUA,EAASlB,ICLtCoB,EAAS,SAAIP,EAAyBb,GAC/C,OAAOE,EAAMW,GAAW,EAAMb,ICHrBqB,EAAY,SAAIC,GACzB,YAAoBC,IAAbD,EAAM,GAAmB3B,EAAOG,EAAKwB,EAAM,KCAzCE,EAAe,SAAIF,GAC5B,OAAiB,OAAVA,EAAiB3B,EAAOG,EAAKwB,ICD3BG,EAAM,SAAIzB,GACnB,GAAIC,EAAOD,GACP,OAAOA,EAGX,MAAM,IAAI0B,MAAM,6BCJPC,EAAO,SAAIC,EAAyB5B,GACzCC,EAAOD,IACP4B,EAAO5B,ICFF6B,EAAM,SACfD,EACA5B,GAEA,OAAOE,GAAM,SAAAV,GAAK,OAAAM,EAAK8B,EAAOpC,MAAKG,EAAMK,ICJhC8B,EAAW,SACpBF,EACA5B,GAEA,OAAOE,GACH,SAAAoB,GAAS,OAAAM,EAAON,GAAOS,KAAKjC,KAC5BU,QAAQC,QAAQd,GAChBK,ICRKgC,EAAU,SAAIhC,GACvB,OAAOE,GAAM,SAAAV,GAAK,MAAA,CAACA,KAAI,GAAIQ,ICAlBiC,EAAa,SAAIjC,GAC1B,OAAOE,EAAMX,EAAU,KAAMS,ICDpBkC,EAAc,SAAI9B,EAAaJ,GACxC,OAAOE,EAAMX,EAAUa,EAAUJ"} \ No newline at end of file diff --git a/typescript/option/lib/tsdoc-metadata.json b/typescript/option/lib/tsdoc-metadata.json deleted file mode 100644 index 65d0a8d..0000000 --- a/typescript/option/lib/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.7.0" - } - ] -} From ca91cd20f8bd3e7c0b76a06fe4e6c4ce4b95ab7c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:07:00 +0200 Subject: [PATCH 48/80] typescript(option): chore: added lib to gitignore Signed-off-by: prescientmoon --- typescript/option/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/typescript/option/.gitignore b/typescript/option/.gitignore index 25d4951..e7a5d37 100644 --- a/typescript/option/.gitignore +++ b/typescript/option/.gitignore @@ -1,3 +1,4 @@ node_modules dist -sandbox \ No newline at end of file +sandbox +lib \ No newline at end of file From 2b681bfa7f86ecb03e175f1002cabd87e9500d13 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 23 Dec 2019 16:11:20 +0200 Subject: [PATCH 49/80] typescript(option): test: added tests for exists Signed-off-by: prescientmoon --- typescript/option/src/helpers/exists.test.ts | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 typescript/option/src/helpers/exists.test.ts diff --git a/typescript/option/src/helpers/exists.test.ts b/typescript/option/src/helpers/exists.test.ts new file mode 100644 index 0000000..32f8494 --- /dev/null +++ b/typescript/option/src/helpers/exists.test.ts @@ -0,0 +1,33 @@ +import { expect } from 'chai' +import { exists } from './exists' +import { constantly } from '@thi.ng/compose' +import { None, Some } from '../types' +import { x } from '../../test/constants' + +describe('The exists helper', () => { + it('should return false when given None', () => { + // act + const result = exists(constantly(true), None) + + // assert + expect(result).to.equal(false) + }) + + describe('When given Some', () => { + it('should return true if the callback returns true', () => { + // act + const result = exists(constantly(true), Some(x)) + + // assert + expect(result).to.equal(true) + }) + + it('should return false if the callback returns false', () => { + // act + const result = exists(constantly(false), Some(x)) + + // assert + expect(result).to.equal(false) + }) + }) +}) From 7e2e25263c88bf5a9c907b442198bd6e11824f6e Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 14:46:33 +0200 Subject: [PATCH 50/80] typescript(option): ci: run tests before releasing Signed-off-by: prescientmoon --- typescript/option/.github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/option/.github/workflows/release.yml b/typescript/option/.github/workflows/release.yml index 7ee9048..1509c61 100644 --- a/typescript/option/.github/workflows/release.yml +++ b/typescript/option/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: # install dependencies and run semantic-release - run: npm i -g pnpm - run: pnpm install + - run: pnpm test - run: pnpm run build - run: pnpx semantic-release env: From f8e501b8766078c136886e009a9e77c84572ee14 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 14:58:29 +0200 Subject: [PATCH 51/80] typescript(option): test: wrote tests for filter Signed-off-by: prescientmoon --- typescript/option/src/helpers/filter.test.ts | 47 ++++++++++++++++++++ typescript/option/test/constants.ts | 5 +++ typescript/option/tsconfig.json | 3 +- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 typescript/option/src/helpers/filter.test.ts diff --git a/typescript/option/src/helpers/filter.test.ts b/typescript/option/src/helpers/filter.test.ts new file mode 100644 index 0000000..5a38f88 --- /dev/null +++ b/typescript/option/src/helpers/filter.test.ts @@ -0,0 +1,47 @@ +import { expect } from 'chai' +import { constantly } from '@thi.ng/compose' +import { filter } from './filter' +import { None, Some } from '../types' +import { someX } from '../../test/constants' + +describe('The filter helper', () => { + describe('When the predicate returns true', () => { + const predicate = constantly(true) + + it('should return None when given None', () => { + // act + const result = filter(predicate, None) + + // assert + expect(result).to.equal(None) + }) + + it('should return Some(x) when given Some(x)', () => { + // act + const result = filter(predicate, someX) + + // assert + expect(result).to.equal(someX) + }) + }) + + describe('When the predicate returns false', () => { + const predicate = constantly(false) + + it('should return None when given Some', () => { + // act + const result = filter(predicate, someX) + + // assert + expect(result).to.equal(None) + }) + + it('should return None when given None', () => { + // act + const result = filter(predicate, None) + + // assert + expect(result).to.equal(None) + }) + }) +}) diff --git a/typescript/option/test/constants.ts b/typescript/option/test/constants.ts index 329bc93..1ebdc08 100644 --- a/typescript/option/test/constants.ts +++ b/typescript/option/test/constants.ts @@ -1,2 +1,7 @@ +import { Some } from '../src' + // general value to pass around export const x = Symbol('x') + +// same as x but for some +export const someX = Some(x) diff --git a/typescript/option/tsconfig.json b/typescript/option/tsconfig.json index 46c5041..6e4fb37 100644 --- a/typescript/option/tsconfig.json +++ b/typescript/option/tsconfig.json @@ -8,5 +8,6 @@ "downlevelIteration": true, "target": "es6" }, - "include": ["src", "sandbox", "test"] + "include": ["src", "sandbox", "test"], + "exclude": ["dist"] } From e241784601eaf44cd7e118e97832e96619e81763 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:01:44 +0200 Subject: [PATCH 52/80] typescript(option): test: wrote tests for flat Signed-off-by: prescientmoon --- typescript/option/src/helpers/flat.test.ts | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 typescript/option/src/helpers/flat.test.ts diff --git a/typescript/option/src/helpers/flat.test.ts b/typescript/option/src/helpers/flat.test.ts new file mode 100644 index 0000000..2f52ec2 --- /dev/null +++ b/typescript/option/src/helpers/flat.test.ts @@ -0,0 +1,25 @@ +import { expect } from 'chai' +import { flat } from './flat' +import { None, Some } from '../types' +import { someX } from '../../test/constants' + +describe('The flat helper', () => { + it('should return None when given None', () => { + // act + const result = flat(None) + + // assert + expect(result).to.equal(None) + }) + + it('should return the inner Some(x) when given Some(Some(x))', () => { + // arrange + const value = Some(someX) + + // act + const result = flat(value) + + // assert + expect(result).to.equal(someX) + }) +}) From 941263e82bfee42f58aca6d9d65e5c5c28e2eb41 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:04:23 +0200 Subject: [PATCH 53/80] typescript(option): test: wrote tests for get Signed-off-by: prescientmoon --- typescript/option/src/helpers/get.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 typescript/option/src/helpers/get.test.ts diff --git a/typescript/option/src/helpers/get.test.ts b/typescript/option/src/helpers/get.test.ts new file mode 100644 index 0000000..b0a21ba --- /dev/null +++ b/typescript/option/src/helpers/get.test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai' +import { get } from './get' +import { None } from '../types' +import { someX, x } from '../../test/constants' + +describe('The get helper', () => { + it('should throw when given None', () => { + // act + const callable = () => get(None) + + // assert + expect(callable).to.throw() + }) + + it('should return the innter value when given Some', () => { + // act + const result = get(someX) + + // assert + expect(result).to.equal(x) + }) +}) From a649904d4ec20d36c8674f1d584aa4e696a0447a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:06:19 +0200 Subject: [PATCH 54/80] typescript(option): test: wrote tests for isNone Signed-off-by: prescientmoon --- typescript/option/src/helpers/isNone.test.ts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 typescript/option/src/helpers/isNone.test.ts diff --git a/typescript/option/src/helpers/isNone.test.ts b/typescript/option/src/helpers/isNone.test.ts new file mode 100644 index 0000000..40558b2 --- /dev/null +++ b/typescript/option/src/helpers/isNone.test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai' +import { isNone } from './isNone' +import { None } from '../types' +import { someX } from '../../test/constants' + +describe('The isNone helper', () => { + it('should return false when given Some', () => { + // act + const result = isNone(someX) + + // assert + expect(result).to.equal(false) + }) + + it('should return true when given None', () => { + // act + const result = isNone(None) + + // assert + expect(result).to.equal(true) + }) +}) From aade2d23d712b5fc7cd33c099b01d81ab4c4fe1a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:07:04 +0200 Subject: [PATCH 55/80] typescript(option): test: wrote tests for isSome Signed-off-by: prescientmoon --- typescript/option/src/helpers/isSome.test.ts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 typescript/option/src/helpers/isSome.test.ts diff --git a/typescript/option/src/helpers/isSome.test.ts b/typescript/option/src/helpers/isSome.test.ts new file mode 100644 index 0000000..b1f2361 --- /dev/null +++ b/typescript/option/src/helpers/isSome.test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai' +import { None } from '../types' +import { someX } from '../../test/constants' +import { isSome } from './isSome' + +describe('The isSome helper', () => { + it('should return true when given Some', () => { + // act + const result = isSome(someX) + + // assert + expect(result).to.equal(true) + }) + + it('should return false when given None', () => { + // act + const result = isSome(None) + + // assert + expect(result).to.equal(false) + }) +}) From cd4aba143c3fa1ce734b7f6db44a7f56e4080aed Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:17:22 +0200 Subject: [PATCH 56/80] typescript(option): feat: added an optionify helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/optionify.test.ts | 17 +++++++++++++++++ typescript/option/src/helpers/optionify.ts | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 typescript/option/src/helpers/optionify.test.ts create mode 100644 typescript/option/src/helpers/optionify.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index e2c7a4e..7152985 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -15,6 +15,7 @@ export * from './isSome' export * from './iter' export * from './map' export * from './mapAsync' +export * from './optionify' export * from './toArray' export * from './toNullable' export * from './withDefault' diff --git a/typescript/option/src/helpers/optionify.test.ts b/typescript/option/src/helpers/optionify.test.ts new file mode 100644 index 0000000..04e6e9e --- /dev/null +++ b/typescript/option/src/helpers/optionify.test.ts @@ -0,0 +1,17 @@ +import { expect } from 'chai' +import { optionify } from './optionify' +import { fromNullable } from './fromNullable' + +describe('The optionify helper', () => { + it('should create a function which returns an option instead of a nullable', () => { + // arrange + const func = (a: number, b: number) => (a > b ? a + b : null) + + // act + const result = optionify(func) + + // assert + expect(result(1, 2)).to.equal(fromNullable(func(1, 2))) + expect(result(2, 1)).to.equal(fromNullable(func(2, 1))) + }) +}) diff --git a/typescript/option/src/helpers/optionify.ts b/typescript/option/src/helpers/optionify.ts new file mode 100644 index 0000000..d617f30 --- /dev/null +++ b/typescript/option/src/helpers/optionify.ts @@ -0,0 +1,15 @@ +import { fromNullable } from './fromNullable' + +/** + * Takes a function which returns a nullable and creates + * a function which returns an Option. + * In functional programming this would be the same as + * composing the function with fromNullable. + * + * @param f The function to optionify + */ +export const optionify = ( + f: (...args: T) => U | null +) => { + return (...args: T) => fromNullable(f(...args)) +} From 9989591593ed77cb3d0d77b9ca38dbe87dcb8574 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:31:43 +0200 Subject: [PATCH 57/80] typescript(option): feat: added an or helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/or.test.ts | 26 +++++++++++++++++++++++ typescript/option/src/helpers/or.ts | 20 +++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 typescript/option/src/helpers/or.test.ts create mode 100644 typescript/option/src/helpers/or.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 7152985..36a2cc5 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -16,6 +16,7 @@ export * from './iter' export * from './map' export * from './mapAsync' export * from './optionify' +export * from './or' export * from './toArray' export * from './toNullable' export * from './withDefault' diff --git a/typescript/option/src/helpers/or.test.ts b/typescript/option/src/helpers/or.test.ts new file mode 100644 index 0000000..a7205d0 --- /dev/null +++ b/typescript/option/src/helpers/or.test.ts @@ -0,0 +1,26 @@ +import { expect } from 'chai' +import { or } from './or' +import { someX } from '../../test/constants' +import { None } from '../types' + +describe('The or helper', () => { + describe('When the first argument is None', () => { + it('should return the second argument', () => { + // act + const orSome = or(None, someX) + const orNone = or(None, None) + + // assert + expect(orSome).to.equal(someX) + expect(orNone).to.equal(None) + }) + }) + + it("should return the first argument when it's not None", () => { + // act + const result = or(someX, None) + + // assert + expect(result).to.equal(someX) + }) +}) diff --git a/typescript/option/src/helpers/or.ts b/typescript/option/src/helpers/or.ts new file mode 100644 index 0000000..b717565 --- /dev/null +++ b/typescript/option/src/helpers/or.ts @@ -0,0 +1,20 @@ +import { Option } from '../types' +import { isSome } from './isSome' + +/** + * Returns the first value that is present, like the boolean ||. + * Both values will be computed. + * There is no short-circuiting. + * If your second argument is expensive to calculate and + * you need short circuiting, use orLazy instead. + * + * @param a The first argument. + * @param b The second argument. + */ +export const or = (a: Option, b: Option): Option => { + if (isSome(a)) { + return a + } else { + return b + } +} From a525a46bca42cb8f58116f6043919d15fd52712a Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:40:47 +0200 Subject: [PATCH 58/80] typescript(option): feat: added a first helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/first.test.ts | 32 +++++++++++++++++++++ typescript/option/src/helpers/first.ts | 17 +++++++++++ 3 files changed, 50 insertions(+) create mode 100644 typescript/option/src/helpers/first.test.ts create mode 100644 typescript/option/src/helpers/first.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 36a2cc5..a08193e 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -3,6 +3,7 @@ export * from './bindAsync' export * from './count' export * from './exists' export * from './filter' +export * from './first' export * from './flat' export * from './fold' export * from './foldback' diff --git a/typescript/option/src/helpers/first.test.ts b/typescript/option/src/helpers/first.test.ts new file mode 100644 index 0000000..3a410cf --- /dev/null +++ b/typescript/option/src/helpers/first.test.ts @@ -0,0 +1,32 @@ +import { constantly } from '@thi.ng/compose' +import { expect } from 'chai' +import { someX } from '../../test/constants' +import { None, Option } from '../types' +import { first } from './first' + +describe('The first helper', () => { + it('should return the first Some if there is any', () => { + // act + const head = first([someX, None]) + const middle = first([None, someX, None]) + const tail = first([None, someX]) + + // assert + expect(head).to.equal(someX) + expect(middle).to.equal(someX) + expect(tail).to.equal(someX) + }) + + it("should return None if there isn't any Some", () => { + // arrange + const array: Option[] = Array(50) + .fill(1) + .map(constantly(None)) + + // act + const result = first(array) + + // assert + expect(result).to.equal(None) + }) +}) diff --git a/typescript/option/src/helpers/first.ts b/typescript/option/src/helpers/first.ts new file mode 100644 index 0000000..9a03d12 --- /dev/null +++ b/typescript/option/src/helpers/first.ts @@ -0,0 +1,17 @@ +import { isSome } from './isSome' +import { Option, None } from '../types' + +/** + * Returns the first Some in an iterable. If there isn't any returns None. + * + * @param elemenets The elements to find the first Some in. + */ +export const first = (elemenets: Iterable>) => { + for (const option of elemenets) { + if (isSome(option)) { + return option + } + } + + return None +} From 6a8191cc348d6e5b8f77c20ca8250e1afc8afba3 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 15:51:56 +0200 Subject: [PATCH 59/80] typescript(option): feat: added the 'orLazy' helper Signed-off-by: prescientmoon --- typescript/option/package.json | 2 + typescript/option/pnpm-lock.yaml | 94 ++++++++++++++++++++ typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/orLazy.test.ts | 48 ++++++++++ typescript/option/src/helpers/orLazy.ts | 17 ++++ 5 files changed, 162 insertions(+) create mode 100644 typescript/option/src/helpers/orLazy.test.ts create mode 100644 typescript/option/src/helpers/orLazy.ts diff --git a/typescript/option/package.json b/typescript/option/package.json index af5d47f..156a506 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -30,6 +30,7 @@ "@types/chai": "^4.2.7", "@types/mocha": "^5.2.7", "@types/node": "^12.12.21", + "@types/sinon": "^7.5.1", "@wessberg/rollup-plugin-ts": "^1.1.83", "chai": "^4.2.0", "mocha": "^6.2.2", @@ -37,6 +38,7 @@ "rollup": "^1.27.14", "rollup-plugin-terser": "^5.1.3", "semantic-release": "^15.14.0", + "sinon": "^8.0.1", "ts-node": "^8.5.4", "typescript": "^3.7.4", "utility-types": "^3.10.0" diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index 0fbc0cd..e5d1f82 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -7,6 +7,7 @@ devDependencies: '@types/chai': 4.2.7 '@types/mocha': 5.2.7 '@types/node': 12.12.21 + '@types/sinon': 7.5.1 '@wessberg/rollup-plugin-ts': 1.1.83_rollup@1.27.14+typescript@3.7.4 chai: 4.2.0 mocha: 6.2.2 @@ -14,6 +15,7 @@ devDependencies: rollup: 1.27.14 rollup-plugin-terser: 5.1.3_rollup@1.27.14 semantic-release: 15.14.0_semantic-release@15.14.0 + sinon: 8.0.1 ts-node: 8.5.4_typescript@3.7.4 typescript: 3.7.4 utility-types: 3.10.0 @@ -959,6 +961,31 @@ packages: semantic-release: '>=15.8.0 <16.0.0 || >=16.0.0-beta <17.0.0' resolution: integrity: sha512-LGjgPBGjjmjap/76O0Md3wc04Y7IlLnzZceLsAkcYRwGQdRPTTFUJKqDQTuieWTs7zfHzQoZqsqPfFxEN+g2+Q== + /@sinonjs/commons/1.7.0: + dependencies: + type-detect: 4.0.8 + dev: true + resolution: + integrity: sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg== + /@sinonjs/formatio/4.0.1: + dependencies: + '@sinonjs/commons': 1.7.0 + '@sinonjs/samsam': 4.2.0 + dev: true + resolution: + integrity: sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw== + /@sinonjs/samsam/4.2.0: + dependencies: + '@sinonjs/commons': 1.7.0 + array-from: 2.1.1 + lodash.get: 4.4.2 + dev: true + resolution: + integrity: sha512-yG7QbUz38ZPIegfuSMEcbOo0kkLGmPa8a0Qlz4dk7+cXYALDScWjIZzAm/u2+Frh+bcdZF6wZJZwwuJjY0WAjA== + /@sinonjs/text-encoding/0.7.1: + dev: true + resolution: + integrity: sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== /@thi.ng/api/6.6.0: dev: false resolution: @@ -1046,6 +1073,10 @@ packages: dev: true resolution: integrity: sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA== + /@types/sinon/7.5.1: + dev: true + resolution: + integrity: sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ== /@types/ua-parser-js/0.7.33: dev: true resolution: @@ -1214,6 +1245,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= + /array-from/2.1.1: + dev: true + resolution: + integrity: sha1-z+nYwmYoudxa7MYqn12PHzUsEZU= /array-ify/1.0.0: dev: true resolution: @@ -2019,6 +2054,12 @@ packages: node: '>=4' resolution: integrity: sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + /has-flag/4.0.0: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== /has-symbols/1.0.1: dev: true engines: @@ -2263,6 +2304,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= + /isarray/0.0.1: + dev: true + resolution: + integrity: sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= /isarray/1.0.0: dev: true resolution: @@ -2363,6 +2408,10 @@ packages: '0': node >= 0.2.0 resolution: integrity: sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + /just-extend/4.0.2: + dev: true + resolution: + integrity: sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw== /lines-and-columns/1.1.6: dev: true resolution: @@ -2456,6 +2505,12 @@ packages: node: '>=4' resolution: integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + /lolex/5.1.2: + dependencies: + '@sinonjs/commons': 1.7.0 + dev: true + resolution: + integrity: sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== /loose-envify/1.4.0: dependencies: js-tokens: 4.0.0 @@ -2678,6 +2733,17 @@ packages: dev: true resolution: integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + /nise/3.0.0: + dependencies: + '@sinonjs/commons': 1.7.0 + '@sinonjs/formatio': 4.0.1 + '@sinonjs/text-encoding': 0.7.1 + just-extend: 4.0.2 + lolex: 5.1.2 + path-to-regexp: 1.8.0 + dev: true + resolution: + integrity: sha512-EObFx5tioBMePHpU/gGczaY2YDqL255iwjmZwswu2CiwEW8xIGrr3E2xij+efIppS1nLQo9NyXSIUySGHUOhHQ== /node-emoji/1.10.0: dependencies: lodash.toarray: 4.4.0 @@ -3094,6 +3160,12 @@ packages: dev: true resolution: integrity: sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + /path-to-regexp/1.8.0: + dependencies: + isarray: 0.0.1 + dev: true + resolution: + integrity: sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== /path-type/3.0.0: dependencies: pify: 3.0.0 @@ -3500,6 +3572,18 @@ packages: node: '>=6' resolution: integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w== + /sinon/8.0.1: + dependencies: + '@sinonjs/commons': 1.7.0 + '@sinonjs/formatio': 4.0.1 + '@sinonjs/samsam': 4.2.0 + diff: 4.0.1 + lolex: 5.1.2 + nise: 3.0.0 + supports-color: 7.1.0 + dev: true + resolution: + integrity: sha512-vbXMHBszVioyPsuRDLEiPEgvkZnbjfdCFvLYV4jONNJqZNLWTwZ/gYSNh3SuiT1w9MRXUz+S7aX0B4Ar2XI8iw== /slash/3.0.0: dev: true engines: @@ -3721,6 +3805,14 @@ packages: node: '>=6' resolution: integrity: sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + /supports-color/7.1.0: + dependencies: + has-flag: 4.0.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== /supports-hyperlinks/1.0.1: dependencies: has-flag: 2.0.0 @@ -4103,6 +4195,7 @@ specifiers: '@types/chai': ^4.2.7 '@types/mocha': ^5.2.7 '@types/node': ^12.12.21 + '@types/sinon': ^7.5.1 '@wessberg/rollup-plugin-ts': ^1.1.83 chai: ^4.2.0 mocha: ^6.2.2 @@ -4110,6 +4203,7 @@ specifiers: rollup: ^1.27.14 rollup-plugin-terser: ^5.1.3 semantic-release: ^15.14.0 + sinon: ^8.0.1 ts-node: ^8.5.4 tslib: ^1.10.0 typescript: ^3.7.4 diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index a08193e..9b60b88 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -18,6 +18,7 @@ export * from './map' export * from './mapAsync' export * from './optionify' export * from './or' +export * from './orLazy' export * from './toArray' export * from './toNullable' export * from './withDefault' diff --git a/typescript/option/src/helpers/orLazy.test.ts b/typescript/option/src/helpers/orLazy.test.ts new file mode 100644 index 0000000..3cdb4c8 --- /dev/null +++ b/typescript/option/src/helpers/orLazy.test.ts @@ -0,0 +1,48 @@ +import { expect } from 'chai' +import { constantly } from '@thi.ng/compose' +import { orLazy } from './orLazy' +import { someX } from '../../test/constants' +import { None } from '../types' +import { spy } from 'sinon' + +describe('The orLazy helper', () => { + it("should return the first argument if it's Some", () => { + // act + const result = orLazy(someX, constantly(None)) + + // asser + expect(result).to.equal(someX) + }) + + it('should return the return of the second argument if the first is None', () => { + // act + const orSome = orLazy(None, constantly(someX)) + const orNone = orLazy(None, constantly(None)) + + // assert + expect(orSome).to.equal(someX) + expect(orNone).to.equal(None) + }) + + it('should not evaluate the second argument if the first one is Some', () => { + // arrange + const func = spy(constantly(someX)) + + // act + orLazy(someX, func) + + // assert + expect(func.called).to.be.false + }) + + it('should evaluate the second argument if the first one is None', () => { + // arrange + const func = spy(constantly(someX)) + + // act + orLazy(None, func) + + // assert + expect(func.called).to.be.true + }) +}) diff --git a/typescript/option/src/helpers/orLazy.ts b/typescript/option/src/helpers/orLazy.ts new file mode 100644 index 0000000..a4d83e9 --- /dev/null +++ b/typescript/option/src/helpers/orLazy.ts @@ -0,0 +1,17 @@ +import { isSome } from './isSome' +import { Option } from '../types' + +/** + * Lazy version of or. + * The second argument will only be evaluated if the first argument is Nothing. + * + * @param a The first argument. + * @param b The second argument. + */ +export const orLazy = (a: Option, b: () => Option) => { + if (isSome(a)) { + return a + } + + return b() +} From 470574fdadc8d389e1a5d59a943c2ede68bba73f Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 16:09:18 +0200 Subject: [PATCH 60/80] typescript(option): feat: added the 'oneOf' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/oneOf.test.ts | 55 +++++++++++++++++++++ typescript/option/src/helpers/oneOf.ts | 23 +++++++++ typescript/option/test/constants.ts | 3 ++ 4 files changed, 82 insertions(+) create mode 100644 typescript/option/src/helpers/oneOf.test.ts create mode 100644 typescript/option/src/helpers/oneOf.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 9b60b88..889f6de 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -16,6 +16,7 @@ export * from './isSome' export * from './iter' export * from './map' export * from './mapAsync' +export * from './oneOf' export * from './optionify' export * from './or' export * from './orLazy' diff --git a/typescript/option/src/helpers/oneOf.test.ts b/typescript/option/src/helpers/oneOf.test.ts new file mode 100644 index 0000000..d7e91ef --- /dev/null +++ b/typescript/option/src/helpers/oneOf.test.ts @@ -0,0 +1,55 @@ +import { constantly } from '@thi.ng/compose' +import { expect } from 'chai' +import { spy } from 'sinon' +import { x, alwaysSomeX } from '../../test/constants' +import { None, Some } from '../types' +import { oneOf } from './oneOf' + +const alwaysSome = (v: T) => constantly(Some(v)) + +describe('The oneOf helper', () => { + it('should return None on an empty array', () => { + // act + const result = oneOf(x, []) + + // assert + expect(result).to.equal(None) + }) + + it('should return the result of the first function which evaluates to Some', () => { + // arrange + const alwaysNone = constantly(None) + + // act + const head = oneOf(x, [alwaysSome('head'), alwaysNone]) + const middle = oneOf(x, [alwaysNone, alwaysSome('middle'), alwaysNone]) + const tail = oneOf(x, [alwaysNone, alwaysSome('tail')]) + + // assert + expect(head).to.equal(Some('head')) + expect(middle).to.equal(Some('middle')) + expect(tail).to.equal(Some('tail')) + }) + + it('should not evaluate any more functions after it found the result', () => { + // arrange + const func = spy(alwaysSomeX) + + // act + oneOf(x, [alwaysSomeX, func]) + + // assert + expect(func.called).to.be.false + }) + + it('should pass the provided input to the functions', () => { + // arrange + const func = spy(alwaysSomeX) + + // act + oneOf(x, [func]) + + // assert + expect(func.calledWith(x)).to.be.true + }) +}) diff --git a/typescript/option/src/helpers/oneOf.ts b/typescript/option/src/helpers/oneOf.ts new file mode 100644 index 0000000..99fb6a8 --- /dev/null +++ b/typescript/option/src/helpers/oneOf.ts @@ -0,0 +1,23 @@ +import { Binder } from '../internalTypes' +import { isSome } from './isSome' +import { None } from '../types' + +/** + * Try a list of functions against a value. + * Return the value of the first call that succeeds (aka returns Some). + * If no function retursn Some this will default to None. + * + * @param input The input to pass to the functions. + * @param functions Iterable of functions to try against the input. + */ +export const oneOf = (input: T, functions: Binder[]) => { + for (const func of functions) { + const result = func(input) + + if (isSome(result)) { + return result + } + } + + return None +} diff --git a/typescript/option/test/constants.ts b/typescript/option/test/constants.ts index 1ebdc08..e6f1b1b 100644 --- a/typescript/option/test/constants.ts +++ b/typescript/option/test/constants.ts @@ -1,3 +1,4 @@ +import { constantly } from '@thi.ng/compose' import { Some } from '../src' // general value to pass around @@ -5,3 +6,5 @@ export const x = Symbol('x') // same as x but for some export const someX = Some(x) + +export const alwaysSomeX = constantly(someX) From 664a46319dd6700b1adad9a959a868341ca0960f Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 16:25:30 +0200 Subject: [PATCH 61/80] typescript(option): chore: updated readme Signed-off-by: prescientmoon --- typescript/option/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/typescript/option/README.md b/typescript/option/README.md index cf3f23c..4300434 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -4,6 +4,35 @@ # Option +Probably the most opinionated implementation of the Option type for typescript. + +## Features: + +- Large amount of helpers (curently 25), more than f#'s and elm's core libraries combined. +- Typesafe: + ```ts + const foo0: Option = None // works + const foo1: Option = Some('foo1') // works + const foo2: Option = 'foo2' // errors out + const foo3: Option = null // errors out + const foo4: Option = Some(4) // errors out + ``` +- Native equality: + ```ts + Some(7) === Some(7) // true + Some(7) === Some(5) // false + Some(7) === None // false + ``` + +## Limitations + +Both limitaions bellow come from the lack of nominal-typing offered by typescript and are inherited from the `Brand` type offered by the [utility-types](https://github.com/piotrwitek/utility-types) library + +- Due to the way the library works (using the `Brand` + type from [utility-types](https://github.com/piotrwitezutility-types)) `Some(4) === 4` will return true, similarly to how `4 == "4"` returns true (except in this libraries case the `===` operator will behave the same way). +- The inner value of `Option` cannot have a `__brand` prop + (well, tehnically it can but it would be overwritten by the `Brand` type from [utility-types](https://github.com/piotrwitek/utility-types)) + ## Installation ```sh @@ -16,6 +45,8 @@ npm install @adrielus/option For detailed usage read [the docs](https://github.com/Mateiadrielrafael/option/tree/master/docs/main.md) +> Note: The docs are still work in progress. Contributions are welcome:) + # Contributing First, clone this repo: From 0350517b71ec0a18c0e5594ca0577dd091a6a67e Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 16:33:05 +0200 Subject: [PATCH 62/80] typescript(option): build: fixed rollup not reading tsconfig.json while emiting the declarations Signed-off-by: prescientmoon --- typescript/option/rollup.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index 2d1c5a9..bad4d26 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -42,7 +42,10 @@ export default [ plugins: [ ts({ tsconfig: { - declaration: true + declaration: true, + ...require(resolve(__dirname, 'tsconfig.json'))[ + 'compilerOptions' + ] } }), !dev && terser() From 1d2e49fb02577a7557c668919fe780321cdf2a06 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 16:52:20 +0200 Subject: [PATCH 63/80] typescript(option): chore: proper capitalisation for typescript typescript(option): typescript(option): BlueGhost told me I'm supposed to write TypeScript, not typescript, so here I am making a commit for modifying 4 characters =) Signed-off-by: prescientmoon --- typescript/option/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/README.md b/typescript/option/README.md index 4300434..6d20bf3 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -4,7 +4,7 @@ # Option -Probably the most opinionated implementation of the Option type for typescript. +Probably the most opinionated implementation of the Option type for TypeScript. ## Features: @@ -26,7 +26,7 @@ Probably the most opinionated implementation of the Option type for typescript. ## Limitations -Both limitaions bellow come from the lack of nominal-typing offered by typescript and are inherited from the `Brand` type offered by the [utility-types](https://github.com/piotrwitek/utility-types) library +Both limitaions bellow come from the lack of nominal-typing offered by TypeScript and are inherited from the `Brand` type offered by the [utility-types](https://github.com/piotrwitek/utility-types) library - Due to the way the library works (using the `Brand` type from [utility-types](https://github.com/piotrwitezutility-types)) `Some(4) === 4` will return true, similarly to how `4 == "4"` returns true (except in this libraries case the `===` operator will behave the same way). From 5ea670e3b934ceb8ee53a78fc45c67173529fa9d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 25 Dec 2019 17:05:11 +0200 Subject: [PATCH 64/80] typescript(option): chore: updated tags Signed-off-by: prescientmoon --- typescript/option/package.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/typescript/option/package.json b/typescript/option/package.json index 156a506..0e2dbd1 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -19,7 +19,21 @@ "keywords": [ "typescript", "fsharp", + "fp", + "functional-programming", + "monad", + "immutable", + "stateless", + "classless", "option", + "typesafe", + "functor", + "pure", + "option", + "some", + "just", + "none", + "nothing", "maybe", "nullable" ], From 668c33b9fb60ecb5890c44bb72a90200b3a5e227 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 15:52:15 +0200 Subject: [PATCH 65/80] typescript(option): feat: added the 'unwrap' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/unwrap.test.ts | 37 ++++++++++++++++++++ typescript/option/src/helpers/unwrap.ts | 20 +++++++++++ 3 files changed, 58 insertions(+) create mode 100644 typescript/option/src/helpers/unwrap.test.ts create mode 100644 typescript/option/src/helpers/unwrap.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 889f6de..ee8e2cb 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -22,4 +22,5 @@ export * from './or' export * from './orLazy' export * from './toArray' export * from './toNullable' +export * from './unwrap' export * from './withDefault' diff --git a/typescript/option/src/helpers/unwrap.test.ts b/typescript/option/src/helpers/unwrap.test.ts new file mode 100644 index 0000000..5f2ee43 --- /dev/null +++ b/typescript/option/src/helpers/unwrap.test.ts @@ -0,0 +1,37 @@ +import { constantly, identity } from '@thi.ng/compose' +import { expect } from 'chai' +import { spy } from 'sinon' +import { someX, x } from '../../test/constants' +import { None } from '../types' +import { unwrap } from './unwrap' + +describe('The unwrap helper', () => { + it('should return the default when given None', () => { + // act + const result = unwrap(0, constantly(1), None) + + // assert + expect(result).to.equal(0) + }) + + describe('When given Some', () => { + it('should return the result of the mapper ', () => { + // act + const result = unwrap(0, constantly(1), someX) + + // assert + expect(result).to.equal(1) + }) + + it('should pass the inner value to the mapper', () => { + // arrange + const mapper = spy(identity) + + // act + unwrap(0, mapper, someX) + + // assert + expect(mapper.calledWith(x)).to.be.true + }) + }) +}) diff --git a/typescript/option/src/helpers/unwrap.ts b/typescript/option/src/helpers/unwrap.ts new file mode 100644 index 0000000..4757468 --- /dev/null +++ b/typescript/option/src/helpers/unwrap.ts @@ -0,0 +1,20 @@ +import { Mapper } from '../internalTypes' +import { Option } from '../types' +import { withDefault } from './withDefault' +import { map } from './map' + +/** + * Apply the function to the value in the Maybe and return it unwrapped. + * If the Maybe is Nothing, use the default value instead. + * + * @param _default The default value to use. + * @param mapper Function to apply to the inner value. + * @param option Option to unwrap. + */ +export const unwrap = ( + _default: U, + mapper: Mapper, + option: Option +) => { + return withDefault(_default, map(mapper, option)) +} From 089ba6148fc16f2290026c083e557c7c71301a8b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:04:09 +0200 Subject: [PATCH 66/80] typescript(option): docs: wrote docs for the 'withDefault' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/withDefault.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/typescript/option/src/helpers/withDefault.ts b/typescript/option/src/helpers/withDefault.ts index b1c9934..ca855db 100644 --- a/typescript/option/src/helpers/withDefault.ts +++ b/typescript/option/src/helpers/withDefault.ts @@ -2,6 +2,12 @@ import { match } from './match' import { identity } from '@thi.ng/compose' import { Option } from '../types' +/** + * Provide a default value, turning an optional value into a normal value. + * + * @param _default The default value to use. + * @param option The option to get the default of. + */ export const withDefault = (_default: T, option: Option) => { return match(identity, _default, option) } From 6f36c3d82692e628d1da729418601df3035315bf Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:04:36 +0200 Subject: [PATCH 67/80] typescript(option): test: wrote tests for the 'withDefault' helper Signed-off-by: prescientmoon --- .../option/src/helpers/withDefault.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 typescript/option/src/helpers/withDefault.test.ts diff --git a/typescript/option/src/helpers/withDefault.test.ts b/typescript/option/src/helpers/withDefault.test.ts new file mode 100644 index 0000000..a661b2a --- /dev/null +++ b/typescript/option/src/helpers/withDefault.test.ts @@ -0,0 +1,22 @@ +import { expect } from 'chai' +import { withDefault } from './withDefault' +import { x } from '../../test/constants' +import { None, Some } from '../types' + +describe('The withDefault helper', () => { + it('should return the default when given None', () => { + // act + const result = withDefault(x, None) + + // assert + expect(result).to.equal(x) + }) + + it('should return x when given Some(x)', () => { + // act + const result = withDefault(0, Some(1)) + + // assert + expect(result).to.equal(1) + }) +}) From 6dc868c5fbee76bd770c86beee8fcef433a8f964 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:16:09 +0200 Subject: [PATCH 68/80] typescript(option): feat: added the 'withDefaultLazy' helper Signed-off-by: prescientmoon --- .../src/helpers/withDefaultLazy.test.ts | 50 +++++++++++++++++++ .../option/src/helpers/withDefaultLazy.ts | 16 ++++++ typescript/option/src/internalTypes.ts | 1 + typescript/option/test/constants.ts | 1 + 4 files changed, 68 insertions(+) create mode 100644 typescript/option/src/helpers/withDefaultLazy.test.ts create mode 100644 typescript/option/src/helpers/withDefaultLazy.ts diff --git a/typescript/option/src/helpers/withDefaultLazy.test.ts b/typescript/option/src/helpers/withDefaultLazy.test.ts new file mode 100644 index 0000000..5ec7d97 --- /dev/null +++ b/typescript/option/src/helpers/withDefaultLazy.test.ts @@ -0,0 +1,50 @@ +import { expect } from 'chai' +import { withDefaultLazy } from './withDefaultLazy' +import { None, Some } from '../types' +import { alwaysX, x, someX } from '../../test/constants' +import { constantly } from '@thi.ng/compose' +import { spy } from 'sinon' + +describe('The withDefaultLazy helper', () => { + describe('When given None', () => { + it('should return the default when given None', () => { + // act + const result = withDefaultLazy(alwaysX, None) + + // assert + expect(result).to.equal(x) + }) + + it('should call the lazy default', () => { + // arrange + const func = spy(constantly(x)) + + // act + withDefaultLazy(func, None) + + // assert + expect(func.called).to.be.true + }) + }) + + describe('When given Some', () => { + it('should return the inner value', () => { + // act + const result = withDefaultLazy(constantly(0), Some(1)) + + // assert + expect(result).to.equal(1) + }) + + it('should not call the lazy default', () => { + // arrange + const func = spy(constantly(x)) + + // act + withDefaultLazy(func, someX) + + // assert + expect(func.called).to.be.false + }) + }) +}) diff --git a/typescript/option/src/helpers/withDefaultLazy.ts b/typescript/option/src/helpers/withDefaultLazy.ts new file mode 100644 index 0000000..da46a15 --- /dev/null +++ b/typescript/option/src/helpers/withDefaultLazy.ts @@ -0,0 +1,16 @@ +import { Option } from '../types' +import { isSome } from './isSome' +import { Lazy } from '../internalTypes' +import { get } from './get' + +/** + * Same as withDefault but the default is only evaluated when the option is None. + * + * @param _default Function returning the default value to use. + * @param option The option to get the default of. + */ +export const withDefaultLazy = (_default: Lazy, option: Option) => { + if (isSome(option)) { + return get(option) + } else return _default() +} diff --git a/typescript/option/src/internalTypes.ts b/typescript/option/src/internalTypes.ts index 339d971..bbe0938 100644 --- a/typescript/option/src/internalTypes.ts +++ b/typescript/option/src/internalTypes.ts @@ -6,3 +6,4 @@ export type Predicate = (v: T) => boolean export type Folder = (s: U, v: T) => U export type BackFolder = (v: T, s: U) => U export type Nullable = T | null +export type Lazy = () => T diff --git a/typescript/option/test/constants.ts b/typescript/option/test/constants.ts index e6f1b1b..31bd9c5 100644 --- a/typescript/option/test/constants.ts +++ b/typescript/option/test/constants.ts @@ -7,4 +7,5 @@ export const x = Symbol('x') // same as x but for some export const someX = Some(x) +export const alwaysX = constantly(x) export const alwaysSomeX = constantly(someX) From 69dcaa5e919da5946c8e384e4cb0b6a82f9a0b10 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:22:10 +0200 Subject: [PATCH 69/80] typescript(option): refactor: refactored everything to use unwrap instead of match Signed-off-by: prescientmoon --- typescript/option/src/helpers/bind.ts | 4 ++-- typescript/option/src/helpers/bindAsync.ts | 4 ++-- typescript/option/src/helpers/exists.ts | 4 ++-- typescript/option/src/helpers/filter.ts | 4 ++-- typescript/option/src/helpers/fold.ts | 4 ++-- typescript/option/src/helpers/foldback.ts | 4 ++-- typescript/option/src/helpers/forall.ts | 4 ++-- typescript/option/src/helpers/map.ts | 4 ++-- typescript/option/src/helpers/mapAsync.ts | 6 +++--- typescript/option/src/helpers/match.ts | 15 --------------- typescript/option/src/helpers/toArray.ts | 4 ++-- typescript/option/src/helpers/toNullable.ts | 4 ++-- typescript/option/src/helpers/unwrap.ts | 13 ++++++++----- typescript/option/src/helpers/withDefault.ts | 4 ++-- 14 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 typescript/option/src/helpers/match.ts diff --git a/typescript/option/src/helpers/bind.ts b/typescript/option/src/helpers/bind.ts index 8dd234d..8f16419 100644 --- a/typescript/option/src/helpers/bind.ts +++ b/typescript/option/src/helpers/bind.ts @@ -1,10 +1,10 @@ import { Binder } from '../internalTypes' import { Option, None } from '../types' -import { match } from './match' +import { unwrap } from './unwrap' export const bind = ( binder: Binder, option: Option ): Option => { - return match(binder, None, option) + return unwrap(None, binder, option) } diff --git a/typescript/option/src/helpers/bindAsync.ts b/typescript/option/src/helpers/bindAsync.ts index 30f8955..32d55df 100644 --- a/typescript/option/src/helpers/bindAsync.ts +++ b/typescript/option/src/helpers/bindAsync.ts @@ -1,10 +1,10 @@ import { Mapper } from '../internalTypes' import { Option, None } from '../types' -import { match } from './match' +import { unwrap } from './unwrap' export const bindAsync = ( binder: Mapper>>, option: Option ): Promise> => { - return match(binder, Promise.resolve(None), option) + return unwrap(Promise.resolve(None), binder, option) } diff --git a/typescript/option/src/helpers/exists.ts b/typescript/option/src/helpers/exists.ts index 9b70af7..c984532 100644 --- a/typescript/option/src/helpers/exists.ts +++ b/typescript/option/src/helpers/exists.ts @@ -1,7 +1,7 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Predicate } from '../internalTypes' import { Option } from '../types' export const exists = (predicate: Predicate, option: Option) => { - return match(predicate, false, option) + return unwrap(false, predicate, option) } diff --git a/typescript/option/src/helpers/filter.ts b/typescript/option/src/helpers/filter.ts index 592b60d..04891a6 100644 --- a/typescript/option/src/helpers/filter.ts +++ b/typescript/option/src/helpers/filter.ts @@ -1,7 +1,7 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Some, None, Option } from '../types' import { Predicate } from '../internalTypes' export const filter = (predicate: Predicate, option: Option) => { - return match(v => (predicate(v) ? Some(v) : None), None, option) + return unwrap(None, v => (predicate(v) ? Some(v) : None), option) } diff --git a/typescript/option/src/helpers/fold.ts b/typescript/option/src/helpers/fold.ts index 99f67b8..7ddb023 100644 --- a/typescript/option/src/helpers/fold.ts +++ b/typescript/option/src/helpers/fold.ts @@ -1,4 +1,4 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Option } from '../types' import { Folder } from '../internalTypes' @@ -7,5 +7,5 @@ export const fold = ( initial: U, option: Option ) => { - return match(v => folder(initial, v), initial, option) + return unwrap(initial, v => folder(initial, v), option) } diff --git a/typescript/option/src/helpers/foldback.ts b/typescript/option/src/helpers/foldback.ts index 564dda4..dedcf88 100644 --- a/typescript/option/src/helpers/foldback.ts +++ b/typescript/option/src/helpers/foldback.ts @@ -1,4 +1,4 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Option } from '../types' import { BackFolder } from '../internalTypes' @@ -7,5 +7,5 @@ export const foldback = ( option: Option, initial: U ) => { - return match(v => folder(v, initial), initial, option) + return unwrap(initial, v => folder(v, initial), option) } diff --git a/typescript/option/src/helpers/forall.ts b/typescript/option/src/helpers/forall.ts index 6321261..634d0d2 100644 --- a/typescript/option/src/helpers/forall.ts +++ b/typescript/option/src/helpers/forall.ts @@ -1,7 +1,7 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Predicate } from '../internalTypes' import { Option } from '../types' export const forall = (predicate: Predicate, option: Option) => { - return match(predicate, true, option) + return unwrap(true, predicate, option) } diff --git a/typescript/option/src/helpers/map.ts b/typescript/option/src/helpers/map.ts index 672b6a8..5c53f16 100644 --- a/typescript/option/src/helpers/map.ts +++ b/typescript/option/src/helpers/map.ts @@ -1,4 +1,4 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Mapper } from '../internalTypes' import { Option, Some, None } from '../types' @@ -6,5 +6,5 @@ export const map = ( mapper: Mapper, option: Option ): Option => { - return match(v => Some(mapper(v)), None, option) + return unwrap(None, v => Some(mapper(v)), option) } diff --git a/typescript/option/src/helpers/mapAsync.ts b/typescript/option/src/helpers/mapAsync.ts index ebf7989..08c124c 100644 --- a/typescript/option/src/helpers/mapAsync.ts +++ b/typescript/option/src/helpers/mapAsync.ts @@ -1,14 +1,14 @@ import { Option, None, Some } from '../types' import { Mapper } from '../internalTypes' -import { match } from './match' +import { unwrap } from './unwrap' export const mapAsync = ( mapper: Mapper>, option: Option ) => { - return match( - value => mapper(value).then(Some), + return unwrap( Promise.resolve(None), + value => mapper(value).then(Some), option ) } diff --git a/typescript/option/src/helpers/match.ts b/typescript/option/src/helpers/match.ts deleted file mode 100644 index dda77b6..0000000 --- a/typescript/option/src/helpers/match.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Option } from '../types' -import { Mapper } from '../internalTypes' -import { isSome } from './isSome' - -export const match = ( - caseSome: Mapper, - _default: U, - option: Option -) => { - if (isSome(option)) { - return caseSome(option as T) - } - - return _default -} diff --git a/typescript/option/src/helpers/toArray.ts b/typescript/option/src/helpers/toArray.ts index e135960..d704e2d 100644 --- a/typescript/option/src/helpers/toArray.ts +++ b/typescript/option/src/helpers/toArray.ts @@ -1,6 +1,6 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { Option } from '../types' export const toArray = (option: Option) => { - return match(v => [v], [], option) + return unwrap([], v => [v], option) } diff --git a/typescript/option/src/helpers/toNullable.ts b/typescript/option/src/helpers/toNullable.ts index 7a7d072..2275211 100644 --- a/typescript/option/src/helpers/toNullable.ts +++ b/typescript/option/src/helpers/toNullable.ts @@ -1,7 +1,7 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { identity } from '@thi.ng/compose' import { Option } from '../types' export const toNullable = (option: Option) => { - return match(identity, null, option) + return unwrap(null, identity, option) } diff --git a/typescript/option/src/helpers/unwrap.ts b/typescript/option/src/helpers/unwrap.ts index 4757468..75ddaee 100644 --- a/typescript/option/src/helpers/unwrap.ts +++ b/typescript/option/src/helpers/unwrap.ts @@ -1,7 +1,6 @@ -import { Mapper } from '../internalTypes' import { Option } from '../types' -import { withDefault } from './withDefault' -import { map } from './map' +import { Mapper } from '../internalTypes' +import { isSome } from './isSome' /** * Apply the function to the value in the Maybe and return it unwrapped. @@ -13,8 +12,12 @@ import { map } from './map' */ export const unwrap = ( _default: U, - mapper: Mapper, + caseSome: Mapper, option: Option ) => { - return withDefault(_default, map(mapper, option)) + if (isSome(option)) { + return caseSome(option as T) + } + + return _default } diff --git a/typescript/option/src/helpers/withDefault.ts b/typescript/option/src/helpers/withDefault.ts index ca855db..9a6db91 100644 --- a/typescript/option/src/helpers/withDefault.ts +++ b/typescript/option/src/helpers/withDefault.ts @@ -1,4 +1,4 @@ -import { match } from './match' +import { unwrap } from './unwrap' import { identity } from '@thi.ng/compose' import { Option } from '../types' @@ -9,5 +9,5 @@ import { Option } from '../types' * @param option The option to get the default of. */ export const withDefault = (_default: T, option: Option) => { - return match(identity, _default, option) + return unwrap(_default, identity, option) } From 09a788f8ffd950af89269ac6fbd68dea40afee6f Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:23:59 +0200 Subject: [PATCH 70/80] typescript(option): fix: fixed withDefaultLazy not being exported Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index ee8e2cb..d607755 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -24,3 +24,4 @@ export * from './toArray' export * from './toNullable' export * from './unwrap' export * from './withDefault' +export * from './withDefaultLazy' From cd5dc00dbd013c927cf56b933aef3344446ae024 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:28:38 +0200 Subject: [PATCH 71/80] typescript(option): docs: fixed all the comments where I called Option Maybe and None Nothing Signed-off-by: prescientmoon --- typescript/option/src/helpers/unwrap.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/helpers/unwrap.ts b/typescript/option/src/helpers/unwrap.ts index 75ddaee..062a676 100644 --- a/typescript/option/src/helpers/unwrap.ts +++ b/typescript/option/src/helpers/unwrap.ts @@ -3,8 +3,8 @@ import { Mapper } from '../internalTypes' import { isSome } from './isSome' /** - * Apply the function to the value in the Maybe and return it unwrapped. - * If the Maybe is Nothing, use the default value instead. + * Apply the function to the value in the Option and return it unwrapped. + * If the Option is None, use the default value instead. * * @param _default The default value to use. * @param mapper Function to apply to the inner value. From ab5e468375be6a3c4a194821232a27b4135e6513 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:36:05 +0200 Subject: [PATCH 72/80] typescript(option): feat: added the 'unpack' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/unpack.test.ts | 61 ++++++++++++++++++++ typescript/option/src/helpers/unpack.ts | 20 +++++++ 3 files changed, 82 insertions(+) create mode 100644 typescript/option/src/helpers/unpack.test.ts create mode 100644 typescript/option/src/helpers/unpack.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index d607755..851a146 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -22,6 +22,7 @@ export * from './or' export * from './orLazy' export * from './toArray' export * from './toNullable' +export * from './unpack' export * from './unwrap' export * from './withDefault' export * from './withDefaultLazy' diff --git a/typescript/option/src/helpers/unpack.test.ts b/typescript/option/src/helpers/unpack.test.ts new file mode 100644 index 0000000..f3ebec1 --- /dev/null +++ b/typescript/option/src/helpers/unpack.test.ts @@ -0,0 +1,61 @@ +import { expect } from 'chai' +import { None } from '../types' +import { alwaysX, x, someX } from '../../test/constants' +import { constantly } from '@thi.ng/compose' +import { spy } from 'sinon' +import { unpack } from './unpack' + +describe('The unpack helper', () => { + describe('When given None', () => { + it('should return the default when given None', () => { + // act + const result = unpack(constantly(0), constantly(1), None) + + // assert + expect(result).to.equal(0) + }) + + it('should call the lazy default', () => { + // arrange + const func = spy(alwaysX) + + // act + unpack(func, alwaysX, None) + + // assert + expect(func.called).to.be.true + }) + }) + + describe('When given Some', () => { + it('should return the return of the mapper', () => { + // act + const result = unpack(constantly(0), constantly(1), someX) + + // assert + expect(result).to.equal(1) + }) + + it('should not call the lazy default', () => { + // arrange + const func = spy(constantly(x)) + + // act + unpack(func, constantly(x), someX) + + // assert + expect(func.called).to.be.false + }) + + it('should pass the inner value to the mapper', () => { + // arrange + const mapper = spy(alwaysX) + + // act + unpack(alwaysX, mapper, someX) + + // assert + expect(mapper.calledWith(x)).to.be.true + }) + }) +}) diff --git a/typescript/option/src/helpers/unpack.ts b/typescript/option/src/helpers/unpack.ts new file mode 100644 index 0000000..07c2562 --- /dev/null +++ b/typescript/option/src/helpers/unpack.ts @@ -0,0 +1,20 @@ +import { Lazy, Mapper } from '../internalTypes' +import { Option } from '../types' +import { withDefaultLazy } from './withDefaultLazy' +import { map } from './map' + +/** + * Like unwrap, but the default value is lazy, + * and will only be computed if the Option is None. + * + * @param _default The lazy value to use in case option is None. + * @param mapper The function to pass the inner value to. + * @param option The option to unpack. + */ +export const unpack = ( + _default: Lazy, + mapper: Mapper, + option: Option +) => { + return withDefaultLazy(_default, map(mapper, option)) +} From bf3fc154e3a1741f1fe4d41291a7e8d56a208d9d Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:37:04 +0200 Subject: [PATCH 73/80] typescript(option): test: refactored tests to use alwaysX instead of constantly(x) Signed-off-by: prescientmoon --- typescript/option/src/helpers/unpack.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/option/src/helpers/unpack.test.ts b/typescript/option/src/helpers/unpack.test.ts index f3ebec1..802f6aa 100644 --- a/typescript/option/src/helpers/unpack.test.ts +++ b/typescript/option/src/helpers/unpack.test.ts @@ -38,10 +38,10 @@ describe('The unpack helper', () => { it('should not call the lazy default', () => { // arrange - const func = spy(constantly(x)) + const func = spy(alwaysX) // act - unpack(func, constantly(x), someX) + unpack(func, alwaysX, someX) // assert expect(func.called).to.be.false From 08b28804e0d2962219f31d32d453f1b4c2c137c2 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 16:53:20 +0200 Subject: [PATCH 74/80] typescript(option): feat: added the 'values' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/external.ts | 1 + typescript/option/src/helpers/values.test.ts | 19 +++++++++++++++++++ typescript/option/src/helpers/values.ts | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 typescript/option/src/helpers/values.test.ts create mode 100644 typescript/option/src/helpers/values.ts diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 851a146..9cddd76 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -26,3 +26,4 @@ export * from './unpack' export * from './unwrap' export * from './withDefault' export * from './withDefaultLazy' +export * from './values' diff --git a/typescript/option/src/helpers/values.test.ts b/typescript/option/src/helpers/values.test.ts new file mode 100644 index 0000000..ceb78c1 --- /dev/null +++ b/typescript/option/src/helpers/values.test.ts @@ -0,0 +1,19 @@ +import { expect } from 'chai' +import { values } from './values' +import { Some, None } from '../types' + +describe('The values helper', () => { + it('should ignore all None values', () => { + // arrange + const items = Array(50) + .fill(1) + .map((_, i) => (i % 2 ? Some(i) : None)) + + // act + const result = values(items) + + // assert + expect(result).to.not.contain(None) + expect(result, "ensure it didn't clear everything").to.not.be.empty + }) +}) diff --git a/typescript/option/src/helpers/values.ts b/typescript/option/src/helpers/values.ts new file mode 100644 index 0000000..c973b65 --- /dev/null +++ b/typescript/option/src/helpers/values.ts @@ -0,0 +1,11 @@ +import { Option } from '../types' +import { toArray } from './toArray' + +/** + * Take all the values that are present, throwing away any None + * + * @param iterable The iterable to collect the values from. + */ +export const values = (iterable: Iterable>) => { + return Array.from(iterable).flatMap(toArray) +} From 457f1ee53ebd011bce3e41e34dd2be885a1ac3ec Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 17:05:16 +0200 Subject: [PATCH 75/80] typescript(option): feat: added the 'combine' helper Signed-off-by: prescientmoon --- typescript/option/src/helpers/combine.test.ts | 26 +++++++++++++++++++ typescript/option/src/helpers/combine.ts | 19 ++++++++++++++ typescript/option/src/helpers/external.ts | 3 ++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 typescript/option/src/helpers/combine.test.ts create mode 100644 typescript/option/src/helpers/combine.ts diff --git a/typescript/option/src/helpers/combine.test.ts b/typescript/option/src/helpers/combine.test.ts new file mode 100644 index 0000000..cd96495 --- /dev/null +++ b/typescript/option/src/helpers/combine.test.ts @@ -0,0 +1,26 @@ +import { expect } from 'chai' +import { combine } from './combine' +import { someX } from '../../test/constants' +import { None } from '../types' +import { isSome } from './isSome' + +describe('The combine helepr', () => { + it('should return None if the iterable contains any Nones', () => { + // act + const result = combine([someX, someX, None, someX, someX]) + + // assert + expect(result).to.equal(None) + }) + + it("should return Some when the iterable doesn't contain any None", () => { + // arrange + const items = Array(50).fill(someX) + + // act + const result = combine(items) + + // act + expect(isSome(result)).to.be.true + }) +}) diff --git a/typescript/option/src/helpers/combine.ts b/typescript/option/src/helpers/combine.ts new file mode 100644 index 0000000..b922a57 --- /dev/null +++ b/typescript/option/src/helpers/combine.ts @@ -0,0 +1,19 @@ +import { Option, None, Some } from '../types' +import { isNone } from './isNone' + +/** + * If every Option in the list is present, return all of the values unwrapped. + * If there are any Nones, the whole function fails and returns None. + * + * @param iterable The iterable to combine. + */ +export const combine = (iterable: Iterable>) => { + const set = new Set(iterable) + + if (set.has(None)) { + return None + } + + const array = Array.from(set) as T[] + return array as Option +} diff --git a/typescript/option/src/helpers/external.ts b/typescript/option/src/helpers/external.ts index 9cddd76..a992f59 100644 --- a/typescript/option/src/helpers/external.ts +++ b/typescript/option/src/helpers/external.ts @@ -1,5 +1,6 @@ export * from './bind' export * from './bindAsync' +export * from './combine' export * from './count' export * from './exists' export * from './filter' @@ -24,6 +25,6 @@ export * from './toArray' export * from './toNullable' export * from './unpack' export * from './unwrap' +export * from './values' export * from './withDefault' export * from './withDefaultLazy' -export * from './values' From 0fd6baac815cb1fe00cdf12da0855a9ca1a6c478 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 17:07:40 +0200 Subject: [PATCH 76/80] typescript(option): chore: updated readme Signed-off-by: prescientmoon --- typescript/option/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/typescript/option/README.md b/typescript/option/README.md index 6d20bf3..658cd54 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -8,7 +8,9 @@ Probably the most opinionated implementation of the Option type for TypeScript. ## Features: -- Large amount of helpers (curently 25), more than f#'s and elm's core libraries combined. +- Lazy and async versions of helpers: + One of the goals of this lib is to provide variations of helpers which are lazy (don't compute something if it's not needed) or async (make mixing Promises and Options easier). If there is any function you want one of those variations of, be sure to open an issue:) +- Large amount of helpers (curently 30), more than f#'s and elm's core libraries combined. - Typesafe: ```ts const foo0: Option = None // works @@ -17,7 +19,7 @@ Probably the most opinionated implementation of the Option type for TypeScript. const foo3: Option = null // errors out const foo4: Option = Some(4) // errors out ``` -- Native equality: +- Reference equality: ```ts Some(7) === Some(7) // true Some(7) === Some(5) // false From 63ce76a552aa387277ed5a86e886e4c4243e0a3b Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 17:19:26 +0200 Subject: [PATCH 77/80] typescript(option): fix: fixed lib not beeing tree-shakeable Signed-off-by: prescientmoon --- typescript/option/rollup.config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index bad4d26..3e67884 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -1,19 +1,19 @@ import { terser } from 'rollup-plugin-terser' import { resolve } from 'path' import ts from '@wessberg/rollup-plugin-ts' +import nodeResolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' const outputDirectory = resolve(__dirname, 'dist') const inputFile = resolve(__dirname, 'src/index.ts') -const npmConfig = require(resolve(__dirname, `package.json`)) - -const external = Object.keys(npmConfig.dependencies || {}) const dev = Boolean(process.env.ROLLUP_WATCH) +const commonPlugins = [commonjs(), nodeResolve()] + export default [ { input: inputFile, - external, output: [ { file: `${outputDirectory}/index.cjs.js`, @@ -27,11 +27,10 @@ export default [ name: 'Option' } ], - plugins: [ts(), !dev && terser()] + plugins: [...commonPlugins, ts(), !dev && terser()] }, { input: inputFile, - external, output: [ { file: `${outputDirectory}/index.esm.js`, @@ -40,6 +39,7 @@ export default [ } ], plugins: [ + ...commonPlugins, ts({ tsconfig: { declaration: true, From b02a3f887fba5d203c0ddfb7a380412beed87077 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 18:13:37 +0200 Subject: [PATCH 78/80] typescript(option): build: edited the rollup config to read paths from package.json and show the filesize of the esm bundle Signed-off-by: prescientmoon --- typescript/option/README.md | 2 +- typescript/option/package.json | 2 + typescript/option/pnpm-lock.yaml | 107 +++++++++++++++++++++++++++++ typescript/option/rollup.config.ts | 17 +++-- typescript/option/tsconfig.json | 6 +- 5 files changed, 125 insertions(+), 9 deletions(-) diff --git a/typescript/option/README.md b/typescript/option/README.md index 658cd54..5e5486f 100644 --- a/typescript/option/README.md +++ b/typescript/option/README.md @@ -41,7 +41,7 @@ Both limitaions bellow come from the lack of nominal-typing offered by TypeScrip npm install @adrielus/option ``` -(There is also an amd build at `/dist/bundle.amd.js` which uses the `Option` namespace) +(There is also an amd build at `/dist/bundle.umd.js` which uses the `Option` namespace) ## Usage diff --git a/typescript/option/package.json b/typescript/option/package.json index 0e2dbd1..dbbbf11 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -5,6 +5,7 @@ "main": "dist/bundle.cjs.js", "module": "dist/index.esm.js", "typings": "dist/index.esm.d.ts", + "browser": "dist/bundle.umd.js", "scripts": { "prebuild": "rimraf dist", "build": "rollup -c rollup.config.ts", @@ -50,6 +51,7 @@ "mocha": "^6.2.2", "rimraf": "^3.0.0", "rollup": "^1.27.14", + "rollup-plugin-filesize": "^6.2.1", "rollup-plugin-terser": "^5.1.3", "semantic-release": "^15.14.0", "sinon": "^8.0.1", diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index e5d1f82..a1c5047 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -13,6 +13,7 @@ devDependencies: mocha: 6.2.2 rimraf: 3.0.0 rollup: 1.27.14 + rollup-plugin-filesize: 6.2.1 rollup-plugin-terser: 5.1.3_rollup@1.27.14 semantic-release: 15.14.0_semantic-release@15.14.0 sinon: 8.0.1 @@ -1174,6 +1175,12 @@ packages: node: '>=8' resolution: integrity: sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + /ansi-align/3.0.0: + dependencies: + string-width: 3.1.0 + dev: true + resolution: + integrity: sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== /ansi-colors/3.2.3: dev: true engines: @@ -1291,6 +1298,21 @@ packages: dev: true resolution: integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw== + /boxen/4.2.0: + dependencies: + ansi-align: 3.0.0 + camelcase: 5.3.1 + chalk: 3.0.0 + cli-boxes: 2.2.0 + string-width: 4.2.0 + term-size: 2.1.1 + type-fest: 0.8.1 + widest-line: 3.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== /brace-expansion/1.1.11: dependencies: balanced-match: 1.0.0 @@ -1306,6 +1328,14 @@ packages: node: '>=8' resolution: integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + /brotli-size/4.0.0: + dependencies: + duplexer: 0.1.1 + dev: true + engines: + node: '>= 10.16.0' + resolution: + integrity: sha512-uA9fOtlTRC0iqKfzff1W34DXUA3GyVqbUaeo3Rw3d4gd1eavKVCETXrn3NzO74W+UVkG3UHu8WxUi+XvKI/huA== /browser-stdout/1.3.1: dev: true resolution: @@ -1405,6 +1435,15 @@ packages: node: '>=4' resolution: integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + /chalk/3.0.0: + dependencies: + ansi-styles: 4.2.0 + supports-color: 7.1.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== /check-error/1.0.2: dev: true resolution: @@ -1415,6 +1454,12 @@ packages: node: '>=6' resolution: integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + /cli-boxes/2.2.0: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w== /cli-table/0.3.1: dependencies: colors: 1.0.3 @@ -1467,6 +1512,12 @@ packages: node: '>=0.1.90' resolution: integrity: sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= + /colors/1.4.0: + dev: true + engines: + node: '>=0.1.90' + resolution: + integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== /commander/2.20.3: dev: true resolution: @@ -1689,6 +1740,10 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-G3CK8JSknJoOfbyteQq6U52sEXc= + /duplexer/0.1.1: + dev: true + resolution: + integrity: sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= /duplexer2/0.1.4: dependencies: readable-stream: 2.3.6 @@ -1858,6 +1913,12 @@ packages: node: '>=8' resolution: integrity: sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + /filesize/4.2.1: + dev: true + engines: + node: '>= 0.4.0' + resolution: + integrity: sha512-bP82Hi8VRZX/TUBKfE24iiUGsB/sfm2WUrwTQyAzQrhO3V9IhcBBNBXMyzLY5orACxRyYJ3d2HeRVX+eFv4lmA== /fill-range/7.0.1: dependencies: to-regex-range: 5.0.1 @@ -2029,6 +2090,15 @@ packages: node: '>=4.x' resolution: integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + /gzip-size/5.1.1: + dependencies: + duplexer: 0.1.1 + pify: 4.0.1 + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== /handlebars/4.5.3: dependencies: neo-async: 2.6.1 @@ -2477,6 +2547,10 @@ packages: dev: true resolution: integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + /lodash.merge/4.6.2: + dev: true + resolution: + integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== /lodash.set/4.3.2: dev: true resolution: @@ -3196,6 +3270,12 @@ packages: node: '>=4' resolution: integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + /pify/4.0.1: + dev: true + engines: + node: '>=6' + resolution: + integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== /pkg-conf/2.1.0: dependencies: find-up: 2.1.0 @@ -3425,6 +3505,18 @@ packages: hasBin: true resolution: integrity: sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== + /rollup-plugin-filesize/6.2.1: + dependencies: + boxen: 4.2.0 + brotli-size: 4.0.0 + colors: 1.4.0 + filesize: 4.2.1 + gzip-size: 5.1.1 + lodash.merge: 4.6.2 + terser: 4.4.3 + dev: true + resolution: + integrity: sha512-JQ2+NMoka81lCR2caGWyngqMKpvJCl7EkFYU7A+T0dA7U1Aml13FW5Ky0aiZIeU3/13cjsKQLRr35SQVmk6i/A== /rollup-plugin-terser/5.1.3_rollup@1.27.14: dependencies: '@babel/code-frame': 7.5.5 @@ -3838,6 +3930,12 @@ packages: node: '>=8' resolution: integrity: sha512-WrH/pui8YCwmeiAoxV+lpRH9HpRtgBhSR2ViBPgpGb/wnYDzp21R4MN45fsCGvLROvY67o3byhJRYRONJyImVQ== + /term-size/2.1.1: + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-UqvQSch04R+69g4RDhrslmGvGL3ucDRX/U+snYW0Mab4uCAyKSndUksaoqlJ81QKSpRnIsuOYQCbC2ZWx2896A== /terser/4.4.3: dependencies: commander: 2.20.3 @@ -4061,6 +4159,14 @@ packages: dev: true resolution: integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + /widest-line/3.1.0: + dependencies: + string-width: 4.2.0 + dev: true + engines: + node: '>=8' + resolution: + integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== /windows-release/3.2.0: dependencies: execa: 1.0.0 @@ -4201,6 +4307,7 @@ specifiers: mocha: ^6.2.2 rimraf: ^3.0.0 rollup: ^1.27.14 + rollup-plugin-filesize: ^6.2.1 rollup-plugin-terser: ^5.1.3 semantic-release: ^15.14.0 sinon: ^8.0.1 diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index 3e67884..d31b128 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -3,27 +3,29 @@ import { resolve } from 'path' import ts from '@wessberg/rollup-plugin-ts' import nodeResolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' +import _package from './package.json' +import filesize from 'rollup-plugin-filesize' const outputDirectory = resolve(__dirname, 'dist') const inputFile = resolve(__dirname, 'src/index.ts') const dev = Boolean(process.env.ROLLUP_WATCH) -const commonPlugins = [commonjs(), nodeResolve()] +const commonPlugins = [nodeResolve(), commonjs()] export default [ { input: inputFile, output: [ { - file: `${outputDirectory}/index.cjs.js`, + file: _package.main, format: 'cjs', sourcemap: true }, { - file: `${outputDirectory}/index.amd.js`, + file: _package.browser, sourcemap: true, - format: 'amd', + format: 'umd', name: 'Option' } ], @@ -33,7 +35,7 @@ export default [ input: inputFile, output: [ { - file: `${outputDirectory}/index.esm.js`, + file: _package.module, format: 'esm', sourcemap: true } @@ -48,7 +50,10 @@ export default [ ] } }), - !dev && terser() + !dev && terser(), + filesize({ + showBrotliSize: true + }) ] } ] diff --git a/typescript/option/tsconfig.json b/typescript/option/tsconfig.json index 6e4fb37..2e31f4d 100644 --- a/typescript/option/tsconfig.json +++ b/typescript/option/tsconfig.json @@ -6,8 +6,10 @@ "strictNullChecks": true, "sourceMap": true, "downlevelIteration": true, - "target": "es6" + "target": "es6", + + "resolveJsonModule": true }, - "include": ["src", "sandbox", "test"], + "include": ["src", "sandbox", "test", "package.json"], "exclude": ["dist"] } From dd0c29a340c4fe68655259f959b9a93c70fe40b9 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 26 Dec 2019 18:17:29 +0200 Subject: [PATCH 79/80] typescript(option): build: removed unused variables from rollup config Signed-off-by: prescientmoon --- typescript/option/rollup.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/typescript/option/rollup.config.ts b/typescript/option/rollup.config.ts index d31b128..485f384 100644 --- a/typescript/option/rollup.config.ts +++ b/typescript/option/rollup.config.ts @@ -6,7 +6,6 @@ import commonjs from '@rollup/plugin-commonjs' import _package from './package.json' import filesize from 'rollup-plugin-filesize' -const outputDirectory = resolve(__dirname, 'dist') const inputFile = resolve(__dirname, 'src/index.ts') const dev = Boolean(process.env.ROLLUP_WATCH) From 4ef32c05c322c515f8246063b90527484a73ffe8 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Fri, 27 Dec 2019 13:28:42 +0200 Subject: [PATCH 80/80] typescript(option): fix: fixed declaration containnig a bunch of anys Signed-off-by: prescientmoon --- typescript/option/package.json | 6 +++--- typescript/option/pnpm-lock.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/option/package.json b/typescript/option/package.json index dbbbf11..fb968ed 100644 --- a/typescript/option/package.json +++ b/typescript/option/package.json @@ -56,13 +56,13 @@ "semantic-release": "^15.14.0", "sinon": "^8.0.1", "ts-node": "^8.5.4", - "typescript": "^3.7.4", - "utility-types": "^3.10.0" + "typescript": "^3.7.4" }, "author": "Matei Adriel", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@thi.ng/compose": "^1.3.6", - "tslib": "^1.10.0" + "tslib": "^1.10.0", + "utility-types": "^3.10.0" } } diff --git a/typescript/option/pnpm-lock.yaml b/typescript/option/pnpm-lock.yaml index a1c5047..f8b0d92 100644 --- a/typescript/option/pnpm-lock.yaml +++ b/typescript/option/pnpm-lock.yaml @@ -1,6 +1,7 @@ dependencies: '@thi.ng/compose': 1.3.6 tslib: 1.10.0 + utility-types: 3.10.0 devDependencies: '@rollup/plugin-commonjs': 11.0.0_rollup@1.27.14 '@rollup/plugin-node-resolve': 6.0.0_rollup@1.27.14 @@ -19,7 +20,6 @@ devDependencies: sinon: 8.0.1 ts-node: 8.5.4_typescript@3.7.4 typescript: 3.7.4 - utility-types: 3.10.0 lockfileVersion: 5.1 packages: /@babel/code-frame/7.5.5: @@ -4121,7 +4121,7 @@ packages: resolution: integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= /utility-types/3.10.0: - dev: true + dev: false engines: node: '>= 4' resolution: