├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── docs └── hyper.md ├── package-lock.json ├── package.json ├── src ├── hkt.spec.ts ├── hkt.ts ├── hyper.spec.ts ├── hyper.ts ├── index.ts ├── list.spec.ts ├── list.ts ├── logical.spec.ts ├── logical.ts ├── math.spec.ts ├── math.ts ├── object-access.spec.ts ├── object-access.ts ├── phantom.spec.ts ├── phantom.ts ├── pipe.spec.ts ├── pipe.ts ├── string-to-number.spec.ts ├── string-to-number.ts ├── test.spec.ts ├── test.ts ├── unvalue.ts ├── util.spec.ts └── util.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /.vscode/ 3 | /dist/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | *.pid.lock 11 | .env 12 | .DS_Store 13 | 14 | # Config 15 | .travis.yml 16 | tsconfig.json 17 | 18 | # Source code 19 | src/ 20 | 21 | # Documentations 22 | docs/ 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: "8.9.4" 3 | before_script: 4 | - "npm i" 5 | script: "npm test" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 tkr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Type Park 2 | [![Build Status](https://travis-ci.org/kgtkr/typepark.svg?branch=master)](https://travis-ci.org/kgtkr/typepark) 3 | 4 | ## Install 5 | 6 | ``` 7 | $ npm i typepark typescript@3.1 8 | ``` 9 | 10 | ## Feature 11 | * [tuple operation](https://github.com/kgtkr/typepark/blob/master/src/list.spec.ts) 12 | * [testing](https://github.com/kgtkr/typepark/blob/master/src/test.spec.ts) 13 | * [logical](https://github.com/kgtkr/typepark/blob/master/src/logical.spec.ts) 14 | * [pipeline](https://github.com/kgtkr/typepark/blob/master/src/pipe.spec.ts) 15 | 16 | ## Usage 17 | Look `./src/**/*.spec.ts` -------------------------------------------------------------------------------- /docs/hyper.md: -------------------------------------------------------------------------------- 1 | # Hyper Operation 2 | 3 | ## What is Hyper Operation 4 | [Wikipedia](https://en.wikipedia.org/wiki/Hyperoperation) 5 | 6 | ``` 7 | hyper(1,a,b)=a+b 8 | hyper(2,a,b)=a*b 9 | hyper(3,a,b)=a^b 10 | ︙ 11 | ``` 12 | 13 | ``` 14 | hyper(1,a,b)=a+b 15 | hyper(_,a,1)=a 16 | hyper(i,a,1)=hyper(i-1,a,hyper(i,a,b-1)) 17 | ``` 18 | 19 | ## Example 20 | 21 | ```ts 22 | Hyper<1, 1, 4>//5 23 | Hyper<2, 5, 4>//20 24 | Hyper<3, 2, 4>//16 25 | Hyper<1, 100, 200>//Error(number is too large) 26 | ``` 27 | 28 | ## Explanation 29 | Internally treats numbers as tuple. 30 | example: 31 | 32 | ``` 33 | 1=[any] 34 | 2=[any,any] 35 | 3=[any,any,any] 36 | ︙ 37 | ``` 38 | 39 | ### Mutual conversion 40 | 41 | ```ts 42 | // number to tuple: 43 | Repeat 44 | ``` 45 | 46 | ```ts 47 | // tuple to number 48 | T["length"] 49 | ``` 50 | 51 | ### It is possible to do this 52 | 53 | ```ts 54 | // A+B 55 | Concat 56 | ``` 57 | 58 | ```ts 59 | // X-1 60 | Tail 61 | ``` -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typepark", 3 | "version": "0.8.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "3.4.2", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", 10 | "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==", 11 | "dev": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typepark", 3 | "version": "0.8.0", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "typings": "dist/index.d.ts", 7 | "scripts": { 8 | "test": "tsc --noEmit", 9 | "build": "tsc" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/kgtkr/typepark.git" 14 | }, 15 | "author": "kgtkr", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/kgtkr/typepark/issues" 19 | }, 20 | "homepage": "https://github.com/kgtkr/typepark#readme", 21 | "devDependencies": { 22 | "typescript": "^3.4.2" 23 | } 24 | } -------------------------------------------------------------------------------- /src/hkt.spec.ts: -------------------------------------------------------------------------------- 1 | import { ToType, ToType2, ToType3 } from "./hkt"; 2 | import { assertType, TypeEq } from "./test"; 3 | 4 | const sym = Symbol(); 5 | 6 | declare module "./hkt" { 7 | interface HKT { 8 | [sym]: { a: A } 9 | } 10 | 11 | interface HKT2 { 12 | [sym]: { a: A, b: B } 13 | } 14 | 15 | interface HKT3 { 16 | [sym]: { a: A, b: B, c: C } 17 | } 18 | } 19 | 20 | assertType, { a: 1 }>>(); 21 | assertType, { a: 1, b: 2 }>>(); 22 | assertType, { a: 1, b: 2, c: 3 }>>(); -------------------------------------------------------------------------------- /src/hkt.ts: -------------------------------------------------------------------------------- 1 | export interface HKT { } 2 | export type ToType, A> = HKT[K]; 3 | 4 | export interface HKT2 { } 5 | export type ToType2, A, B> = HKT2[K]; 6 | 7 | export interface HKT3 { } 8 | export type ToType3, A, B, C> = HKT3[K]; -------------------------------------------------------------------------------- /src/hyper.spec.ts: -------------------------------------------------------------------------------- 1 | import { assertType, TypeEq } from "./test"; 2 | import { 3 | Hyper 4 | } from "./hyper"; 5 | 6 | assertType, 5>>(); 7 | assertType, 20>>(); 8 | assertType, 16>>(); -------------------------------------------------------------------------------- /src/hyper.ts: -------------------------------------------------------------------------------- 1 | import { Tail, Repeat, Concat } from "./list"; 2 | import { Cast } from "./util"; 3 | 4 | type _Hyper = { 5 | 0: Concat, 6 | 1: A, 7 | 2: _Hyper, A, _Hyper> extends infer X ? Cast : never>, 8 | }[I extends [any] ? 0 : (B extends [any] ? 1 : 2)]; 9 | 10 | export type Hyper 11 | = _Hyper extends infer X ? Cast : never, Repeat extends infer X ? Cast : never, Repeat extends infer X ? Cast : never> extends infer X ? Cast["length"] : never; -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./list"; 2 | export * from "./pipe"; 3 | export * from "./util"; 4 | export * from "./test"; 5 | export * from "./logical"; 6 | export * from "./unvalue"; 7 | export * from "./hkt"; 8 | export * from "./hyper"; 9 | -------------------------------------------------------------------------------- /src/list.spec.ts: -------------------------------------------------------------------------------- 1 | import { assertType, TypeEq } from "./test"; 2 | import { 3 | Head, 4 | Tail, 5 | Last, 6 | Cons, 7 | Reverse, 8 | Concat, 9 | Zip, 10 | Take, 11 | Group, 12 | Drop, 13 | Flat, 14 | Repeat, 15 | Range 16 | } from "./list"; 17 | 18 | assertType, 1>>(); 19 | assertType, 1>>(); 20 | assertType, 1>>(); 21 | assertType, never>>(); 22 | assertType, null>>(); 23 | 24 | assertType, []>>(); 25 | assertType, []>>(); 26 | assertType, [2, 3]>>(); 27 | 28 | assertType, 1>>(); 29 | assertType, 3>>(); 30 | assertType, 3>>(); 31 | assertType, never>>(); 32 | assertType, null>>(); 33 | 34 | assertType, [1]>>(); 35 | assertType, [1, 2, 3]>>(); 36 | 37 | assertType, []>>(); 38 | assertType, [1]>>(); 39 | assertType, [3, 2, 1]>>(); 40 | 41 | assertType, []>>(); 42 | assertType, [1]>>(); 43 | assertType, [1]>>(); 44 | assertType, [1, 2, 3, 4, 5]>>(); 45 | 46 | assertType, []>>(); 47 | assertType, []>>(); 48 | assertType, []>>(); 49 | assertType, [[1, 4], [2, 5]]>>(); 50 | assertType, [[1, 4], [2, 5]]>>(); 51 | 52 | assertType, []>>(); 53 | assertType, []>>(); 54 | assertType, []>>(); 55 | assertType, [1, 2]>>(); 56 | assertType, [1, 2, 3]>>(); 57 | assertType, [1, 2, 3]>>(); 58 | 59 | assertType, []>>(); 60 | assertType, [[1]]>>(); 61 | assertType, [[1, 2], [3, 4]]>>(); 62 | assertType, [[1, 2, 3], [4]]>>(); 63 | 64 | assertType, []>>(); 65 | assertType, [1]>>(); 66 | assertType, []>>(); 67 | assertType, [3]>>(); 68 | assertType, []>>(); 69 | assertType, []>>(); 70 | 71 | assertType, []>>(); 72 | assertType, []>>(); 73 | assertType, [1]>>(); 74 | assertType, [1]>>(); 75 | assertType, [1, 2, 3, 4, 5]>>(); 76 | assertType, [1, 2, 3, 4]>>(); 77 | assertType, [1, 2, 3, 4]>>(); 78 | 79 | assertType, []>>(); 80 | assertType, [1]>>(); 81 | assertType, [1, 1, 1, 1, 1]>>(); 82 | 83 | assertType, [0]>>(); 84 | assertType, [2, 3, 4, 5]>>(); -------------------------------------------------------------------------------- /src/list.ts: -------------------------------------------------------------------------------- 1 | import { Inc } from "./math"; 2 | 3 | export type Head = T extends [infer X, ...any[]] ? X : D; 4 | export type Tail = ((...x: T) => void) extends ((x: any, ...xs: infer XS) => void) ? XS : never 5 | export type Last = { 6 | 0: D, 7 | 1: Head, 8 | 2: Last>, 9 | }[T extends [] ? 0 : T extends [any] ? 1 : 2]; 10 | export type Cons = ((h: X, ...args: XS) => void) extends ((...args: infer R) => void) ? R : []; 11 | export type Reverse = { 12 | 0: X, 13 | 1: Reverse, Cons, X>> 14 | }[L extends [] ? 0 : 1] 15 | export type Concat = { 16 | 0: Reverse, 17 | 1: Concat, B, Cons, R>> 18 | 2: Concat, Cons, R>> 19 | }[A extends [] ? B extends [] ? 0 : 2 : 1]; 20 | export type Zip = { 21 | 0: Reverse, 22 | 1: Zip, Tail, Cons<[Head, Head], R>> 23 | }[A extends [] ? 0 : B extends [] ? 0 : 1]; 24 | export type Take = { 25 | 0: Reverse, 26 | 1: Take, Cons, R>> 27 | }[T extends [] ? 0 : R["length"] extends N ? 0 : 1]; 28 | export type Group = { 29 | 0: Reverse, 30 | 1: Group, R2>>, 31 | 2: Group, Cons, R1>, R2> 32 | }[T extends [] ? R1 extends [] ? 0 : 1 : (R1["length"] extends N ? 1 : 2)]; 33 | export type Drop = { 34 | 0: T, 35 | 1: Drop, Cons, R>> 36 | }[T extends [] ? 0 : R["length"] extends N ? 0 : 1]; 37 | export type Flat = { 38 | 0: Reverse, 39 | 1: Flat, Head, R2>, 40 | 2: Flat, Cons, R2>> 41 | }[T extends [] ? R1 extends [] ? 0 : 2 : (R1 extends [] ? 1 : 2)]; 42 | export type Repeat = { 43 | 0: R, 44 | 1: Repeat> 45 | }[R["length"] extends N ? 0 : 1]; 46 | 47 | export type Range = { 48 | 0: Reverse>, 49 | 1: Range, B, Cons> 50 | }[A extends B ? 0 : 1]; -------------------------------------------------------------------------------- /src/logical.spec.ts: -------------------------------------------------------------------------------- 1 | import { And, Or, Xor, Not } from "./logical"; 2 | import { TypeEq, assertType } from "./test"; 3 | 4 | assertType, true>>(); 5 | assertType, false>>(); 6 | assertType, false>>(); 7 | assertType, false>>(); 8 | assertType, boolean>>(); 9 | assertType, boolean>>(); 10 | assertType, false>>(); 11 | assertType, false>>(); 12 | assertType, boolean>>(); 13 | 14 | assertType, true>>(); 15 | assertType, true>>(); 16 | assertType, true>>(); 17 | assertType, false>>(); 18 | assertType, true>>(); 19 | assertType, true>>(); 20 | assertType, boolean>>(); 21 | assertType, boolean>>(); 22 | assertType, boolean>>(); 23 | 24 | assertType, false>>(); 25 | assertType, true>>(); 26 | assertType, true>>(); 27 | assertType, false>>(); 28 | assertType, boolean>>(); 29 | assertType, boolean>>(); 30 | assertType, boolean>>(); 31 | assertType, boolean>>(); 32 | assertType, boolean>>(); 33 | 34 | assertType, false>>(); 35 | assertType, true>>(); 36 | assertType, boolean>>(); -------------------------------------------------------------------------------- /src/logical.ts: -------------------------------------------------------------------------------- 1 | export type And = A extends true ? (B extends true ? true : false) : false; 2 | export type Or = A extends true ? true : (B extends true ? true : false); 3 | export type Xor = A extends true ? (B extends true ? false : true) : (B extends true ? true : false); 4 | export type Not = X extends true ? false : true; -------------------------------------------------------------------------------- /src/math.spec.ts: -------------------------------------------------------------------------------- 1 | import { TypeEq, assertType } from "./test"; 2 | import { Add, Mul, Pow, Sub, Inc, Dec } from "./math"; 3 | 4 | assertType, 0>>(); 5 | assertType, 3>>(); 6 | assertType, 3>>(); 7 | assertType, 5>>(); 8 | 9 | assertType, 0>>(); 10 | assertType, 0>>(); 11 | assertType, 0>>(); 12 | assertType, 6>>(); 13 | 14 | assertType, 1>>(); 15 | assertType, 0>>(); 16 | assertType, 1>>(); 17 | assertType, 9>>(); 18 | 19 | assertType, 0>>(); 20 | assertType, 3>>(); 21 | assertType, 1>>(); 22 | 23 | assertType, 1>>(); 24 | assertType, 4>>(); 25 | 26 | assertType, 0>>(); 27 | assertType, 2>>(); 28 | -------------------------------------------------------------------------------- /src/math.ts: -------------------------------------------------------------------------------- 1 | import { Hyper } from "./hyper"; 2 | import { Tail, Repeat } from "./list"; 3 | import { Cast } from "./util"; 4 | 5 | export type Add 6 | = A extends 0 ? B 7 | : B extends 0 ? A 8 | : Hyper<1, A, B>; 9 | 10 | export type Mul 11 | = A extends 0 ? 0 12 | : B extends 0 ? 0 13 | : Hyper<2, A, B>; 14 | 15 | export type Pow 16 | = B extends 0 ? 1 17 | : A extends 0 ? 0 18 | : Hyper<3, A, B>; 19 | 20 | type _Sub = { 21 | 0: A, 22 | 1: _Sub, Tail> 23 | }[B extends [] ? 0 : 1]; 24 | 25 | export type Sub 26 | = _Sub extends infer X ? Cast : never, Repeat extends infer X ? Cast : never> extends infer X ? Cast["length"] : never; 27 | 28 | export type Inc = Add; 29 | export type Dec = Sub; -------------------------------------------------------------------------------- /src/object-access.spec.ts: -------------------------------------------------------------------------------- 1 | import { ObjectAccessParam, ObjectAccessResult } from "./object-access"; 2 | import { assertType, TypeEq } from "./test"; 3 | 4 | interface Foo { 5 | foo: { 6 | bar: { 7 | baz: { 8 | yay: number 9 | } 10 | }, 11 | x: string 12 | } 13 | } 14 | 15 | assertType, []>>(); 16 | assertType, [] | ["foo"] | ["foo", "bar"] | ["foo", "bar", "baz"] | ["foo", "bar", "baz", "yay"] | ["foo", "x"]>>(); 17 | 18 | assertType, Foo>>(); 19 | assertType, Foo["foo"]>>(); 20 | assertType, Foo["foo"]["bar"]>>(); 21 | -------------------------------------------------------------------------------- /src/object-access.ts: -------------------------------------------------------------------------------- 1 | import { Concat, Tail, Head } from "./list"; 2 | import { Cast } from "./util"; 3 | 4 | export type ObjectAccessFunctionExample = >(path: K) => ObjectAccessResult>; 5 | 6 | export type ObjectAccessParam = _ObjectAccessParam extends infer X ? Cast : never; 7 | 8 | type _ObjectAccessParam = { 9 | 0: R | (Key extends infer P ? _ObjectAccessParam], Concat extends infer X ? Cast : never> : never), 10 | 1: R 11 | }[T extends object ? 0 : 1]; 12 | 13 | export type ObjectAccessResult = { 14 | 0: T, 15 | 1: ObjectAccessResult, keyof T>], Tail> 16 | }[C extends [] ? 0 : 1]; 17 | -------------------------------------------------------------------------------- /src/phantom.spec.ts: -------------------------------------------------------------------------------- 1 | import { PhantomType, PhantomTypeUnwrap } from "./phantom"; 2 | import { TypeEq, assertType } from "./test"; 3 | 4 | assertType>, 1>>(); 5 | assertType>, {}>>(); 6 | assertType>, never>>(); 7 | -------------------------------------------------------------------------------- /src/phantom.ts: -------------------------------------------------------------------------------- 1 | import { Unvalue } from "./unvalue"; 2 | 3 | export type PhantomType = (x: T, damy: Unvalue) => T[]; 4 | const phantomType: PhantomType = () => []; 5 | export function PhantomType(): PhantomType { 6 | return phantomType; 7 | } 8 | export type PhantomTypeUnwrap> = T extends PhantomType ? P : never; -------------------------------------------------------------------------------- /src/pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { TypeEq, assertType } from "./test"; 2 | import { PipeParams, PipeResult } from "./pipe"; 3 | 4 | assertType, [(x: 1) => 2, (x: 2) => 3, (x: 3) => 4]>>(); 5 | assertType, (x: 1) => 4>>(); 6 | -------------------------------------------------------------------------------- /src/pipe.ts: -------------------------------------------------------------------------------- 1 | import { Zip, Tail, Head, Last } from "./list"; 2 | import { Cast } from "./util"; 3 | import { assertType, TypeEq } from "./test"; 4 | 5 | type ShiftZip = Zip>; 6 | 7 | assertType, [[1, 2], [2, 3]]>>(); 8 | 9 | 10 | type Tuple2Fn = T extends [infer A, infer B] ? (x: A) => B : never; 11 | 12 | assertType, (x: 1) => 2>>(); 13 | 14 | type _Pipe = { [P in keyof T]: Tuple2Fn }; 15 | 16 | assertType, [(x: 1) => 2, (x: 2) => 3]>>(); 17 | 18 | export type PipeParams = Cast<_Pipe extends infer X ? Cast : never>, any[], []>; 19 | export type PipeResult = (x: Head) => Last; 20 | export type PipeFunctionExample = (...f: PipeParams) => PipeResult; 21 | -------------------------------------------------------------------------------- /src/string-to-number.spec.ts: -------------------------------------------------------------------------------- 1 | import { TypeEq, assertType } from "./test"; 2 | import { StringToNumber } from "./string-to-number"; 3 | 4 | assertType, 0>>(); 5 | assertType, 10>>(); 6 | -------------------------------------------------------------------------------- /src/string-to-number.ts: -------------------------------------------------------------------------------- 1 | import { Cons } from "./list"; 2 | 3 | type NumberObject = { [P in T]: P }; 4 | 5 | export type StringToNumber = { 6 | 0: R["length"], 7 | 1: StringToNumber> 8 | }[{ [P in T]: any } extends NumberObject ? 0 : 1]; 9 | -------------------------------------------------------------------------------- /src/test.spec.ts: -------------------------------------------------------------------------------- 1 | import { TypeEq, assertType, assertNotType } from "./test"; 2 | 3 | assertType, true>>(); 4 | 5 | assertType, false>>(); 6 | assertType, false>>(); 7 | 8 | assertType, false>>(); 9 | assertType, false>>(); 10 | 11 | assertType, false>>(); 12 | assertType, false>>(); 13 | 14 | assertType, false>>(); 15 | assertType, false>>(); 16 | 17 | assertType, true>>(); 18 | 19 | assertType, false>>(); 20 | assertType, false>>(); 21 | 22 | assertType, true>>(); 23 | 24 | assertType, false>>(); 25 | assertType, false>>(); 26 | 27 | assertType, true>>(); 28 | 29 | assertNotType(); -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | export type TypeEq = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false; 2 | 3 | export function assertType<_T extends true>() { } 4 | export function assertNotType<_T extends false>() { } -------------------------------------------------------------------------------- /src/unvalue.ts: -------------------------------------------------------------------------------- 1 | const unvalue = Symbol(); 2 | export type Unvalue = typeof unvalue; -------------------------------------------------------------------------------- /src/util.spec.ts: -------------------------------------------------------------------------------- 1 | import { TypeEq, assertType } from "./test"; 2 | import { Cast } from "./util"; 3 | 4 | assertType, 1>>(); 5 | assertType, string>>(); 6 | assertType, "a">>(); 7 | -------------------------------------------------------------------------------- /src/util.ts: -------------------------------------------------------------------------------- 1 | export type Cast = T extends P ? T : D; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "rootDir": "src", 6 | "lib": [ 7 | "es2015" 8 | ], 9 | "outDir": "dist", 10 | "declaration": true 11 | } 12 | } --------------------------------------------------------------------------------