├── .editorconfig ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .travis.yml ├── README.md ├── package.json ├── src ├── index.ts └── tests.ts ├── tsconfig.json ├── tslint.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # Note: prettier inherits from `indent_style`, `indent_size`/`tab_width`, and `max_line_length` 2 | # https://github.com/prettier/prettier/blob/cecf0657a521fa265b713274ed67ca39be4142cf/docs/api.md#prettierresolveconfigfilepath--options 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.{js,ts}] 11 | # https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length 12 | max_line_length = 100 13 | 14 | [package.json] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # https://prettier.io/docs/en/ignore.html 2 | 3 | /target/ 4 | 5 | # CLI ignores Node modules by default https://github.com/prettier/prettier/pull/1683, VSCode 6 | # extension does not https://github.com/prettier/prettier-vscode/issues/198, 7 | # https://github.com/prettier/prettier-vscode/issues/548. 8 | node_modules/ 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 10.8.0 3 | script: npm run lint && npm test 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pipe-ts 2 | 3 | [What is `pipe`?](https://dev.to/benlesh/a-simple-explanation-of-functional-pipe-in-javascript-2hbj) 4 | 5 | ## Installation 6 | 7 | ```sh 8 | yarn add pipe-ts 9 | 10 | npm install pipe-ts 11 | ``` 12 | 13 | ## `pipe` 14 | 15 | Create a new function which pipes its value through the list functions. 16 | 17 | ```ts 18 | const add1 = (n: number) => n + 1; 19 | const times2 = (n: number) => n * 2; 20 | 21 | const add1ThenTimes2 = pipe( 22 | add1, 23 | times2, 24 | ); 25 | const result: number = add1ThenTimes2(1); 26 | 27 | assert.strictEqual(result, 4); 28 | ``` 29 | 30 | Allows first function to have any number of parameters (0+), [thanks to TypeScript's generic rest parameters](https://github.com/Microsoft/TypeScript/issues/29904#issuecomment-471334674) 31 | 32 | ```ts 33 | // First function has multiple parameters 34 | 35 | const difference = (a: number, b: number) => a - b; 36 | const add1 = (n: number) => n + 1; 37 | 38 | const differenceThenAdd1 = pipe( 39 | difference, 40 | add1, 41 | ); 42 | const result: number = differenceThenAdd1(5, 4); 43 | 44 | assert.strictEqual(result, 2); 45 | ``` 46 | 47 | ```ts 48 | // First function has 0 parameters 49 | 50 | const getNumber = () => 1; 51 | const add1 = (n: number) => n + 1; 52 | 53 | const getNumberThenAdd1 = pipe( 54 | getNumber, 55 | add1, 56 | ); 57 | const result: number = getNumberThenAdd1(); 58 | 59 | assert.strictEqual(result, 2); 60 | ``` 61 | 62 | ## `pipeWith` 63 | 64 | Transform a value by piping it through the listed functions. Sugar syntax for `pipe(f, g)(value)`. 65 | 66 | ```ts 67 | const add1 = (n: number) => n + 1; 68 | const times2 = (n: number) => n * 2; 69 | 70 | const result: number = pipeWith(1, add1, times2); 71 | 72 | assert.strictEqual(result, 4); 73 | ``` 74 | 75 | ## Note about number of functions 76 | 77 | `pipe` and `pipeWith` currently support up to 9 functions. If need be, we are open to adding more overloads to increase this limit. 78 | 79 | We are [also open to adding an array overload](https://github.com/unsplash/pipe-ts/issues/5), so any number of funtions can be passed. 80 | 81 | ## When `this` matters 82 | 83 | If a function passed to `pipe` or `pipeWith` relies on a specific context of execution ([`this`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)), you cannot call it by passing the reference (_point-free style_). 84 | 85 | Use an anonymous function instead. 86 | 87 | **Bad** 88 | 89 | ```ts 90 | pipeWith('foo', localStorage.getItem); 91 | ``` 92 | 93 | **Good** 94 | 95 | ```ts 96 | pipeWith('foo', key => localStorage.getItem(key)); 97 | ``` 98 | 99 | **Also good** 100 | 101 | ```ts 102 | pipeWith('foo', localStorage.getItem.bind(localStorage)), 103 | ``` 104 | 105 | ## Development 106 | 107 | ``` 108 | yarn 109 | npm run start 110 | ``` 111 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pipe-ts", 3 | "main": "./target/index.js", 4 | "typings": "./target/index.d.ts", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/unsplash/pipe-ts.git" 8 | }, 9 | "keywords": [ 10 | "typescript", 11 | "ts", 12 | "pipe", 13 | "functional", 14 | "fp" 15 | ], 16 | "version": "0.0.9", 17 | "scripts": { 18 | "lint": "tslint --project ./tsconfig.json", 19 | "compile": "rm -rf ./target/ && tsc", 20 | "test": "npm run compile && node --require source-map-support/register ./target/tests.js", 21 | "format": "prettier --write './**/*.{ts,tsx,js,json,md}' '.prettierrc'", 22 | "prepublishOnly": "npm run test && npm run lint && npm run compile" 23 | }, 24 | "files": [ 25 | "src", 26 | "target" 27 | ], 28 | "devDependencies": { 29 | "@types/node": "^12.0.10", 30 | "prettier": "^1.18.2", 31 | "source-map-support": "^0.5.12", 32 | "tslint": "^5.18.0", 33 | "tslint-language-service": "^0.9.9", 34 | "tslint-no-unused": "^0.2.0-alpha.1", 35 | "typescript": "^3.5.2" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | type UnknownFunction = (...params: unknown[]) => unknown; 2 | 3 | // Copied from https://github.com/gcanti/fp-ts/blob/1.15.0/src/function.ts#L209 with some 4 | // modifications to make the first function allow multiple parameters. 5 | export function pipe(ab: (this: void, ...a: A) => B): (...args: A) => B; 6 | export function pipe( 7 | ab: (this: void, ...a: A) => B, 8 | bc: (this: void, b: B) => C, 9 | ): (...args: A) => C; 10 | export function pipe( 11 | ab: (this: void, ...a: A) => B, 12 | bc: (this: void, b: B) => C, 13 | cd: (this: void, c: C) => D, 14 | ): (...args: A) => D; 15 | export function pipe( 16 | ab: (this: void, ...a: A) => B, 17 | bc: (this: void, b: B) => C, 18 | cd: (this: void, c: C) => D, 19 | de: (this: void, d: D) => E, 20 | ): (...args: A) => E; 21 | export function pipe( 22 | ab: (this: void, ...a: A) => B, 23 | bc: (this: void, b: B) => C, 24 | cd: (this: void, c: C) => D, 25 | de: (this: void, d: D) => E, 26 | ef: (this: void, e: E) => F, 27 | ): (...args: A) => F; 28 | export function pipe( 29 | ab: (this: void, ...a: A) => B, 30 | bc: (this: void, b: B) => C, 31 | cd: (this: void, c: C) => D, 32 | de: (this: void, d: D) => E, 33 | ef: (this: void, e: E) => F, 34 | fg: (this: void, f: F) => G, 35 | ): (...args: A) => G; 36 | export function pipe( 37 | ab: (this: void, ...a: A) => B, 38 | bc: (this: void, b: B) => C, 39 | cd: (this: void, c: C) => D, 40 | de: (this: void, d: D) => E, 41 | ef: (this: void, e: E) => F, 42 | fg: (this: void, f: F) => G, 43 | gh: (this: void, g: G) => H, 44 | ): (...args: A) => H; 45 | export function pipe( 46 | ab: (this: void, ...a: A) => B, 47 | bc: (this: void, b: B) => C, 48 | cd: (this: void, c: C) => D, 49 | de: (this: void, d: D) => E, 50 | ef: (this: void, e: E) => F, 51 | fg: (this: void, f: F) => G, 52 | gh: (this: void, g: G) => H, 53 | hi: (this: void, h: H) => I, 54 | ): (...args: A) => I; 55 | export function pipe( 56 | ab: (this: void, ...a: A) => B, 57 | bc: (this: void, b: B) => C, 58 | cd: (this: void, c: C) => D, 59 | de: (this: void, d: D) => E, 60 | ef: (this: void, e: E) => F, 61 | fg: (this: void, f: F) => G, 62 | gh: (this: void, g: G) => H, 63 | hi: (this: void, h: H) => I, 64 | ij: (this: void, i: I) => J, 65 | ): (...args: A) => J; 66 | export function pipe(...fns: UnknownFunction[]): UnknownFunction { 67 | return (...initialParams: unknown[]): unknown => 68 | fns.reduce((value, fn, index) => { 69 | const params = index === 0 ? (value as unknown[]) : [value]; 70 | return fn(...params); 71 | }, initialParams); 72 | } 73 | 74 | export function pipeWith(a: A, ab: (this: void, a: A) => B): B; 75 | export function pipeWith( 76 | a: A, 77 | ab: (this: void, a: A) => B, 78 | bc: (this: void, b: B) => C, 79 | ): C; 80 | export function pipeWith( 81 | a: A, 82 | ab: (this: void, a: A) => B, 83 | bc: (this: void, b: B) => C, 84 | cd: (this: void, c: C) => D, 85 | ): D; 86 | export function pipeWith( 87 | a: A, 88 | ab: (this: void, a: A) => B, 89 | bc: (this: void, b: B) => C, 90 | cd: (this: void, c: C) => D, 91 | de: (this: void, d: D) => E, 92 | ): E; 93 | export function pipeWith( 94 | a: A, 95 | ab: (this: void, a: A) => B, 96 | bc: (this: void, b: B) => C, 97 | cd: (this: void, c: C) => D, 98 | de: (this: void, d: D) => E, 99 | ef: (this: void, e: E) => F, 100 | ): F; 101 | export function pipeWith( 102 | a: A, 103 | ab: (this: void, a: A) => B, 104 | bc: (this: void, b: B) => C, 105 | cd: (this: void, c: C) => D, 106 | de: (this: void, d: D) => E, 107 | ef: (this: void, e: E) => F, 108 | fg: (this: void, f: F) => G, 109 | ): G; 110 | export function pipeWith( 111 | a: A, 112 | ab: (this: void, a: A) => B, 113 | bc: (this: void, b: B) => C, 114 | cd: (this: void, c: C) => D, 115 | de: (this: void, d: D) => E, 116 | ef: (this: void, e: E) => F, 117 | fg: (this: void, f: F) => G, 118 | gh: (this: void, g: G) => H, 119 | ): H; 120 | export function pipeWith( 121 | a: A, 122 | ab: (this: void, a: A) => B, 123 | bc: (this: void, b: B) => C, 124 | cd: (this: void, c: C) => D, 125 | de: (this: void, d: D) => E, 126 | ef: (this: void, e: E) => F, 127 | fg: (this: void, f: F) => G, 128 | gh: (this: void, g: G) => H, 129 | hi: (this: void, h: H) => I, 130 | ): I; 131 | export function pipeWith( 132 | a: A, 133 | ab: (this: void, a: A) => B, 134 | bc: (this: void, b: B) => C, 135 | cd: (this: void, c: C) => D, 136 | de: (this: void, d: D) => E, 137 | ef: (this: void, e: E) => F, 138 | fg: (this: void, f: F) => G, 139 | gh: (this: void, g: G) => H, 140 | hi: (this: void, h: H) => I, 141 | ij: (this: void, i: I) => J, 142 | ): J; 143 | export function pipeWith(value: unknown, ...fns: UnknownFunction[]): unknown { 144 | return pipe( 145 | // Our overloads do not currently support arrays 146 | // @ts-ignore 147 | ...fns, 148 | )(value); 149 | } 150 | -------------------------------------------------------------------------------- /src/tests.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | import { pipe, pipeWith } from './index'; 3 | 4 | const zeroParamGetNumber = () => 1; 5 | const singleParamFnAdd1 = (n: number) => n + 1; 6 | const singleParamFnTimes2 = (n: number) => n * 2; 7 | const multipleParamFnDifference = (a: number, b: number) => a - b; 8 | 9 | // We should really bring in a test framework to help here. 10 | const describe = (name: string, fn: () => void) => { 11 | console.log(name); 12 | fn(); 13 | }; 14 | const it = (name: string, fn: () => void) => { 15 | console.log(name); 16 | fn(); 17 | }; 18 | 19 | describe('pipe', () => { 20 | it('works when first function has 0 params', () => { 21 | assert.strictEqual( 22 | pipe( 23 | zeroParamGetNumber, 24 | singleParamFnAdd1, 25 | )(), 26 | 2, 27 | ); 28 | }); 29 | 30 | it('works when first function has single param', () => { 31 | // One test for each overload 32 | assert.strictEqual(pipe(singleParamFnAdd1)(1), 2); 33 | assert.strictEqual( 34 | pipe( 35 | singleParamFnAdd1, 36 | singleParamFnTimes2, 37 | )(1), 38 | 4, 39 | ); 40 | assert.strictEqual( 41 | pipe( 42 | singleParamFnAdd1, 43 | singleParamFnTimes2, 44 | singleParamFnAdd1, 45 | )(1), 46 | 5, 47 | ); 48 | assert.strictEqual( 49 | pipe( 50 | singleParamFnAdd1, 51 | singleParamFnTimes2, 52 | singleParamFnAdd1, 53 | singleParamFnTimes2, 54 | )(1), 55 | 10, 56 | ); 57 | assert.strictEqual( 58 | pipe( 59 | singleParamFnAdd1, 60 | singleParamFnTimes2, 61 | singleParamFnAdd1, 62 | singleParamFnTimes2, 63 | singleParamFnAdd1, 64 | )(1), 65 | 11, 66 | ); 67 | assert.strictEqual( 68 | pipe( 69 | singleParamFnAdd1, 70 | singleParamFnTimes2, 71 | singleParamFnAdd1, 72 | singleParamFnTimes2, 73 | singleParamFnAdd1, 74 | singleParamFnTimes2, 75 | )(1), 76 | 22, 77 | ); 78 | assert.strictEqual( 79 | pipe( 80 | singleParamFnAdd1, 81 | singleParamFnTimes2, 82 | singleParamFnAdd1, 83 | singleParamFnTimes2, 84 | singleParamFnAdd1, 85 | singleParamFnTimes2, 86 | singleParamFnAdd1, 87 | )(1), 88 | 23, 89 | ); 90 | assert.strictEqual( 91 | pipe( 92 | singleParamFnAdd1, 93 | singleParamFnTimes2, 94 | singleParamFnAdd1, 95 | singleParamFnTimes2, 96 | singleParamFnAdd1, 97 | singleParamFnTimes2, 98 | singleParamFnAdd1, 99 | singleParamFnTimes2, 100 | )(1), 101 | 46, 102 | ); 103 | assert.strictEqual( 104 | pipe( 105 | singleParamFnAdd1, 106 | singleParamFnTimes2, 107 | singleParamFnAdd1, 108 | singleParamFnTimes2, 109 | singleParamFnAdd1, 110 | singleParamFnTimes2, 111 | singleParamFnAdd1, 112 | singleParamFnTimes2, 113 | singleParamFnAdd1, 114 | )(1), 115 | 47, 116 | ); 117 | }); 118 | 119 | it('works when first function has multiple params', () => { 120 | assert.strictEqual( 121 | pipe( 122 | multipleParamFnDifference, 123 | singleParamFnAdd1, 124 | )(5, 4), 125 | 2, 126 | ); 127 | }); 128 | }); 129 | 130 | describe(pipeWith.name, () => { 131 | it('works', () => { 132 | // One test for each overload 133 | assert.strictEqual(pipeWith(1, singleParamFnAdd1), 2); 134 | assert.strictEqual(pipeWith(1, singleParamFnAdd1, singleParamFnTimes2), 4); 135 | assert.strictEqual( 136 | pipeWith(1, singleParamFnAdd1, singleParamFnTimes2, singleParamFnAdd1), 137 | 5, 138 | ); 139 | assert.strictEqual( 140 | pipeWith( 141 | 1, 142 | singleParamFnAdd1, 143 | singleParamFnTimes2, 144 | singleParamFnAdd1, 145 | singleParamFnTimes2, 146 | ), 147 | 10, 148 | ); 149 | assert.strictEqual( 150 | pipeWith( 151 | 1, 152 | singleParamFnAdd1, 153 | singleParamFnTimes2, 154 | singleParamFnAdd1, 155 | singleParamFnTimes2, 156 | singleParamFnAdd1, 157 | ), 158 | 11, 159 | ); 160 | assert.strictEqual( 161 | pipeWith( 162 | 1, 163 | singleParamFnAdd1, 164 | singleParamFnTimes2, 165 | singleParamFnAdd1, 166 | singleParamFnTimes2, 167 | singleParamFnAdd1, 168 | singleParamFnTimes2, 169 | ), 170 | 22, 171 | ); 172 | assert.strictEqual( 173 | pipeWith( 174 | 1, 175 | singleParamFnAdd1, 176 | singleParamFnTimes2, 177 | singleParamFnAdd1, 178 | singleParamFnTimes2, 179 | singleParamFnAdd1, 180 | singleParamFnTimes2, 181 | singleParamFnAdd1, 182 | ), 183 | 23, 184 | ); 185 | assert.strictEqual( 186 | pipeWith( 187 | 1, 188 | singleParamFnAdd1, 189 | singleParamFnTimes2, 190 | singleParamFnAdd1, 191 | singleParamFnTimes2, 192 | singleParamFnAdd1, 193 | singleParamFnTimes2, 194 | singleParamFnAdd1, 195 | singleParamFnTimes2, 196 | ), 197 | 46, 198 | ); 199 | assert.strictEqual( 200 | pipeWith( 201 | 1, 202 | singleParamFnAdd1, 203 | singleParamFnTimes2, 204 | singleParamFnAdd1, 205 | singleParamFnTimes2, 206 | singleParamFnAdd1, 207 | singleParamFnTimes2, 208 | singleParamFnAdd1, 209 | singleParamFnTimes2, 210 | singleParamFnAdd1, 211 | ), 212 | 47, 213 | ); 214 | }); 215 | }); 216 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "strict": true, 6 | "noImplicitReturns": true, 7 | "sourceMap": true, 8 | "outDir": "./target/", 9 | "rootDir": "./src/", 10 | "plugins": [{ "name": "tslint-language-service" }], 11 | "declaration": true 12 | }, 13 | "files": ["./src/index.ts", "./src/tests.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint-no-unused"], 3 | "linterOptions": { 4 | "exclude": ["**/node_modules/**/*"] 5 | }, 6 | "rules": { 7 | "no-unused": true, 8 | "no-any": true, 9 | "no-unsafe-any": true, 10 | "strict-boolean-expressions": true, 11 | "ordered-imports": [true], 12 | "no-inferrable-types": [true, "ignore-properties"], 13 | "no-switch-case-fall-through": true, 14 | "arrow-return-shorthand": [true, "multiline"], 15 | "no-use-before-declare": true, 16 | "no-inferred-empty-object-type": true, 17 | "unified-signatures": true, 18 | "no-conditional-assignment": true, 19 | "no-floating-promises": true, 20 | "no-object-literal-type-assertion": true, 21 | "no-shadowed-variable": true, 22 | "no-unbound-method": [true, "ignore-static"], 23 | "no-unused-expression": true, 24 | "no-var-keyword": true, 25 | "no-void-expression": true, 26 | "prefer-object-spread": true, 27 | "radix": true, 28 | "restrict-plus-operands": true, 29 | "triple-equals": true, 30 | "use-default-type-parameter": true, 31 | "use-isnan": true, 32 | "deprecation": true, 33 | "max-file-line-count": [true, 400], 34 | // Rationale: https://github.com/palantir/tslint/issues/1182#issue-151780453 35 | "no-default-export": true, 36 | "prefer-const": true, 37 | "class-name": true, 38 | "match-default-export-name": true, 39 | "no-boolean-literal-compare": true, 40 | "no-consecutive-blank-lines": true, 41 | "no-irregular-whitespace": true, 42 | "no-unnecessary-callback-wrapper": true, 43 | "object-literal-shorthand": true, 44 | "prefer-switch": true, 45 | "prefer-template": true, 46 | "quotemark": [true, "single", "avoid-escape"], 47 | "variable-name": [ 48 | true, 49 | "ban-keywords", 50 | "check-format", 51 | // e.g. for whitelisting unused function parameters 52 | "allow-leading-underscore", 53 | // e.g. for io-ts types 54 | "allow-pascal-case" 55 | ], 56 | "no-import-side-effect": true, 57 | "no-duplicate-imports": true, 58 | "no-implicit-dependencies": [true, "dev"], 59 | "array-type": [true, "array-simple"] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.0.0": 6 | version "7.0.0" 7 | resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" 8 | integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== 9 | dependencies: 10 | "@babel/highlight" "^7.0.0" 11 | 12 | "@babel/highlight@^7.0.0": 13 | version "7.0.0" 14 | resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" 15 | integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== 16 | dependencies: 17 | chalk "^2.0.0" 18 | esutils "^2.0.2" 19 | js-tokens "^4.0.0" 20 | 21 | "@types/node@^12.0.10": 22 | version "12.0.10" 23 | resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.10.tgz#51babf9c7deadd5343620055fc8aff7995c8b031" 24 | integrity sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ== 25 | 26 | ansi-styles@^3.2.1: 27 | version "3.2.1" 28 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 29 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 30 | dependencies: 31 | color-convert "^1.9.0" 32 | 33 | argparse@^1.0.7: 34 | version "1.0.10" 35 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" 36 | integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== 37 | dependencies: 38 | sprintf-js "~1.0.2" 39 | 40 | balanced-match@^1.0.0: 41 | version "1.0.0" 42 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 43 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 44 | 45 | brace-expansion@^1.1.7: 46 | version "1.1.11" 47 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 48 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 49 | dependencies: 50 | balanced-match "^1.0.0" 51 | concat-map "0.0.1" 52 | 53 | buffer-from@^1.0.0: 54 | version "1.1.1" 55 | resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 56 | integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 57 | 58 | builtin-modules@^1.1.1: 59 | version "1.1.1" 60 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" 61 | integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= 62 | 63 | caller-id@^0.1.0: 64 | version "0.1.0" 65 | resolved "https://registry.yarnpkg.com/caller-id/-/caller-id-0.1.0.tgz#59bdac0893d12c3871408279231f97458364f07b" 66 | integrity sha1-Wb2sCJPRLDhxQIJ5Ix+XRYNk8Hs= 67 | dependencies: 68 | stack-trace "~0.0.7" 69 | 70 | chalk@^2.0.0, chalk@^2.3.0: 71 | version "2.4.2" 72 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 73 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 74 | dependencies: 75 | ansi-styles "^3.2.1" 76 | escape-string-regexp "^1.0.5" 77 | supports-color "^5.3.0" 78 | 79 | color-convert@^1.9.0: 80 | version "1.9.3" 81 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 82 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 83 | dependencies: 84 | color-name "1.1.3" 85 | 86 | color-name@1.1.3: 87 | version "1.1.3" 88 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 89 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 90 | 91 | commander@^2.12.1: 92 | version "2.20.0" 93 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" 94 | integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== 95 | 96 | concat-map@0.0.1: 97 | version "0.0.1" 98 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 99 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 100 | 101 | diff@^3.2.0: 102 | version "3.5.0" 103 | resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" 104 | integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== 105 | 106 | escape-string-regexp@^1.0.5: 107 | version "1.0.5" 108 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 109 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 110 | 111 | esprima@^4.0.0: 112 | version "4.0.1" 113 | resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" 114 | integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== 115 | 116 | esutils@^2.0.2: 117 | version "2.0.2" 118 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 119 | integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= 120 | 121 | fs.realpath@^1.0.0: 122 | version "1.0.0" 123 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 124 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 125 | 126 | glob@^7.1.1: 127 | version "7.1.4" 128 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" 129 | integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== 130 | dependencies: 131 | fs.realpath "^1.0.0" 132 | inflight "^1.0.4" 133 | inherits "2" 134 | minimatch "^3.0.4" 135 | once "^1.3.0" 136 | path-is-absolute "^1.0.0" 137 | 138 | has-flag@^3.0.0: 139 | version "3.0.0" 140 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 141 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 142 | 143 | inflight@^1.0.4: 144 | version "1.0.6" 145 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 146 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 147 | dependencies: 148 | once "^1.3.0" 149 | wrappy "1" 150 | 151 | inherits@2: 152 | version "2.0.4" 153 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 154 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 155 | 156 | js-tokens@^4.0.0: 157 | version "4.0.0" 158 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 159 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== 160 | 161 | js-yaml@^3.13.1: 162 | version "3.13.1" 163 | resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" 164 | integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== 165 | dependencies: 166 | argparse "^1.0.7" 167 | esprima "^4.0.0" 168 | 169 | minimatch@^3.0.4: 170 | version "3.0.4" 171 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 172 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 173 | dependencies: 174 | brace-expansion "^1.1.7" 175 | 176 | minimist@0.0.8: 177 | version "0.0.8" 178 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 179 | integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= 180 | 181 | mkdirp@^0.5.1: 182 | version "0.5.1" 183 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 184 | integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= 185 | dependencies: 186 | minimist "0.0.8" 187 | 188 | mock-require@^2.0.2: 189 | version "2.0.2" 190 | resolved "https://registry.yarnpkg.com/mock-require/-/mock-require-2.0.2.tgz#1eaa71aad23013773d127dc7e91a3fbb4837d60d" 191 | integrity sha1-HqpxqtIwE3c9En3H6Ro/u0g31g0= 192 | dependencies: 193 | caller-id "^0.1.0" 194 | 195 | once@^1.3.0: 196 | version "1.4.0" 197 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 198 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 199 | dependencies: 200 | wrappy "1" 201 | 202 | path-is-absolute@^1.0.0: 203 | version "1.0.1" 204 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 205 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 206 | 207 | path-parse@^1.0.6: 208 | version "1.0.6" 209 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 210 | integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== 211 | 212 | prettier@^1.18.2: 213 | version "1.18.2" 214 | resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" 215 | integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== 216 | 217 | resolve@^1.3.2: 218 | version "1.11.1" 219 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" 220 | integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== 221 | dependencies: 222 | path-parse "^1.0.6" 223 | 224 | semver@^5.3.0: 225 | version "5.7.0" 226 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" 227 | integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== 228 | 229 | source-map-support@^0.5.12: 230 | version "0.5.12" 231 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" 232 | integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== 233 | dependencies: 234 | buffer-from "^1.0.0" 235 | source-map "^0.6.0" 236 | 237 | source-map@^0.6.0: 238 | version "0.6.1" 239 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 240 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 241 | 242 | sprintf-js@~1.0.2: 243 | version "1.0.3" 244 | resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" 245 | integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= 246 | 247 | stack-trace@~0.0.7: 248 | version "0.0.10" 249 | resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" 250 | integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= 251 | 252 | supports-color@^5.3.0: 253 | version "5.5.0" 254 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 255 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 256 | dependencies: 257 | has-flag "^3.0.0" 258 | 259 | tslib@^1.8.0, tslib@^1.8.1: 260 | version "1.10.0" 261 | resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" 262 | integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== 263 | 264 | tslint-language-service@^0.9.9: 265 | version "0.9.9" 266 | resolved "https://registry.yarnpkg.com/tslint-language-service/-/tslint-language-service-0.9.9.tgz#f546dc38483979e6fb3cfa59584ad8525b3ad4da" 267 | integrity sha1-9UbcOEg5eeb7PPpZWErYUls61No= 268 | dependencies: 269 | mock-require "^2.0.2" 270 | 271 | tslint-no-unused@^0.2.0-alpha.1: 272 | version "0.2.0-alpha.1" 273 | resolved "https://registry.yarnpkg.com/tslint-no-unused/-/tslint-no-unused-0.2.0-alpha.1.tgz#4e1d1597660a6ba4259bca48daa566641d0d58b8" 274 | integrity sha1-Th0Vl2YKa6Qlm8pI2qVmZB0NWLg= 275 | 276 | tslint@^5.18.0: 277 | version "5.18.0" 278 | resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" 279 | integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== 280 | dependencies: 281 | "@babel/code-frame" "^7.0.0" 282 | builtin-modules "^1.1.1" 283 | chalk "^2.3.0" 284 | commander "^2.12.1" 285 | diff "^3.2.0" 286 | glob "^7.1.1" 287 | js-yaml "^3.13.1" 288 | minimatch "^3.0.4" 289 | mkdirp "^0.5.1" 290 | resolve "^1.3.2" 291 | semver "^5.3.0" 292 | tslib "^1.8.0" 293 | tsutils "^2.29.0" 294 | 295 | tsutils@^2.29.0: 296 | version "2.29.0" 297 | resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" 298 | integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== 299 | dependencies: 300 | tslib "^1.8.1" 301 | 302 | typescript@^3.5.2: 303 | version "3.5.2" 304 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" 305 | integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== 306 | 307 | wrappy@1: 308 | version "1.0.2" 309 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 310 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 311 | --------------------------------------------------------------------------------