This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
parent 596a6da241
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

2
node_modules/ts-jest/.gitattributes generated vendored Normal file
View file

@ -0,0 +1,2 @@
package-lock.json -diff -merge
package-lock.json linguist-generated=true

1
node_modules/ts-jest/.ts-jest-digest generated vendored Normal file
View file

@ -0,0 +1 @@
0aceab77a1f613fedb22a0395a65327e834ef35c

475
node_modules/ts-jest/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,475 @@
<a name="24.0.2"></a>
## [24.0.2](https://github.com/kulshekhar/ts-jest/compare/v24.0.1...v24.0.2) (2019-04-05)
<a name="24.0.1"></a>
## [24.0.1](https://github.com/kulshekhar/ts-jest/compare/v24.0.0...v24.0.1) (2019-03-30)
### Bug Fixes
* update call to globIgnore ([#1002](https://github.com/kulshekhar/ts-jest/issues/1002)) ([#1003](https://github.com/kulshekhar/ts-jest/issues/1003)) ([05b63af](https://github.com/kulshekhar/ts-jest/commit/05b63af))
### Features
* **config:** specify package.json location ([#823](https://github.com/kulshekhar/ts-jest/issues/823)) ([#1013](https://github.com/kulshekhar/ts-jest/issues/1013)) ([fb7dd55](https://github.com/kulshekhar/ts-jest/commit/fb7dd55))
<a name="24.0.0"></a>
# [24.0.0](https://github.com/kulshekhar/ts-jest/compare/v23.10.5...v24.0.0) (2019-02-18)
### Bug Fixes
* cli test ([1d67101](https://github.com/kulshekhar/ts-jest/commit/1d67101))
* module tests and some snapshots ([999f889](https://github.com/kulshekhar/ts-jest/commit/999f889))
* remove unused snapshots ([108b08b](https://github.com/kulshekhar/ts-jest/commit/108b08b))
* some tests ([d0f2231](https://github.com/kulshekhar/ts-jest/commit/d0f2231))
* test command ([8372b5e](https://github.com/kulshekhar/ts-jest/commit/8372b5e))
* test path for windows (attempt 1) ([6824ac4](https://github.com/kulshekhar/ts-jest/commit/6824ac4))
* test path for windows (attempt 2) ([eb2fc8a](https://github.com/kulshekhar/ts-jest/commit/eb2fc8a))
### Features
* **jest:** bump to 24 ([defcb77](https://github.com/kulshekhar/ts-jest/commit/defcb77))
<a name="23.10.4"></a>
## [23.10.4](https://github.com/kulshekhar/ts-jest/compare/v23.10.3...v23.10.4) (2018-10-06)
### Bug Fixes
* **cache:** adds project's dep versions to cache key ([6cacbea](https://github.com/kulshekhar/ts-jest/commit/6cacbea)), closes [#785](https://github.com/kulshekhar/ts-jest/issues/785)
* **cli:** change options to better reflect the new presets ([68abcfb](https://github.com/kulshekhar/ts-jest/commit/68abcfb))
* **helpers:** deprecate import from ts-jest, now ts-jest/utils ([33ff29f](https://github.com/kulshekhar/ts-jest/commit/33ff29f)), closes [#782](https://github.com/kulshekhar/ts-jest/issues/782)
* **typings:** typo in presets definition file ([53767ab](https://github.com/kulshekhar/ts-jest/commit/53767ab))
* **typings:** wrong import in preset typings + test ([94dc4e7](https://github.com/kulshekhar/ts-jest/commit/94dc4e7))
<a name="23.10.3"></a>
## [23.10.3](https://github.com/kulshekhar/ts-jest/compare/v23.10.2...v23.10.3) (2018-09-30)
### Bug Fixes
* **compiler:** do not force module kind if piping babel ([acebc8c](https://github.com/kulshekhar/ts-jest/commit/acebc8c)), closes [#767](https://github.com/kulshekhar/ts-jest/issues/767)
### Features
* **helpers:** adds a mocked test helper for mock typings ([f976135](https://github.com/kulshekhar/ts-jest/commit/f976135)), closes [#576](https://github.com/kulshekhar/ts-jest/issues/576)
<a name="23.10.2"></a>
## [23.10.2](https://github.com/kulshekhar/ts-jest/compare/v23.10.1...v23.10.2) (2018-09-26)
### Bug Fixes
* **cache:** resolved tsconfig in cache key + pkg digest ([e891608](https://github.com/kulshekhar/ts-jest/commit/e891608)), closes [#749](https://github.com/kulshekhar/ts-jest/issues/749)
* **cli:** resets testMatch if using testRegex option ([31ad0aa](https://github.com/kulshekhar/ts-jest/commit/31ad0aa)), closes [#756](https://github.com/kulshekhar/ts-jest/issues/756)
* **diagnostics:** throws only for category warning and error ([bb28849](https://github.com/kulshekhar/ts-jest/commit/bb28849)), closes [#748](https://github.com/kulshekhar/ts-jest/issues/748)
* **import:** wrong error message when a module exists but fails ([e0d6c57](https://github.com/kulshekhar/ts-jest/commit/e0d6c57))
* **preset:** createJestPreset fails with base and no array ([3c325e8](https://github.com/kulshekhar/ts-jest/commit/3c325e8))
### Features
* **cli:** CLI 'config:migrate' now detects best preset ([febd8d3](https://github.com/kulshekhar/ts-jest/commit/febd8d3))
* **preset:** adds 2 presets along the default one ([9f3d759](https://github.com/kulshekhar/ts-jest/commit/9f3d759))
* **preset:** adds presets typings and export all presets ([f55d895](https://github.com/kulshekhar/ts-jest/commit/f55d895))
* **typings:** emit declaration files, filtering out internals ([4f10f7e](https://github.com/kulshekhar/ts-jest/commit/4f10f7e)), closes [#745](https://github.com/kulshekhar/ts-jest/issues/745)
<a name="23.10.1"></a>
## [23.10.1](https://github.com/kulshekhar/ts-jest/compare/v23.10.0...v23.10.1) (2018-09-20)
### Bug Fixes
* **compile:** js files were never transpiled thru TS ([374dca1](https://github.com/kulshekhar/ts-jest/commit/374dca1)), closes [#740](https://github.com/kulshekhar/ts-jest/issues/740)
* **config:** warn instead of forcing ESM interoperability ([a2a4be2](https://github.com/kulshekhar/ts-jest/commit/a2a4be2))
* **windows:** normalize paths ([c12dfff](https://github.com/kulshekhar/ts-jest/commit/c12dfff))
<a name="23.10.0"></a>
# [23.10.0](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.6...v23.10.0) (2018-09-19)
### Bug Fixes
* **babel:** fixes the babel 6 hack ([c8d51cf](https://github.com/kulshekhar/ts-jest/commit/c8d51cf))
* **config:** jsx should also be considered as js files ([6c32a93](https://github.com/kulshekhar/ts-jest/commit/6c32a93))
### Features
* **hints:** warns if transform matches js without allowJs ([952cc87](https://github.com/kulshekhar/ts-jest/commit/952cc87))
<a name="23.10.0-beta.6"></a>
# [23.10.0-beta.6](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.5...v23.10.0-beta.6) (2018-09-13)
### Bug Fixes
* **babel:** instrumentation was done twice when using babel ([659a7fb](https://github.com/kulshekhar/ts-jest/commit/659a7fb)), closes [#713](https://github.com/kulshekhar/ts-jest/issues/713)
* **cache:** includes all parameters in cache key computing ([70e1867](https://github.com/kulshekhar/ts-jest/commit/70e1867))
* **e2e:** fixes the eval tool (not used yet) ([939d13a](https://github.com/kulshekhar/ts-jest/commit/939d13a))
<a name="23.10.0-beta.5"></a>
# [23.10.0-beta.5](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.4...v23.10.0-beta.5) (2018-09-12)
### Bug Fixes
* **package:** fixes the outdated package-lock ([c5a5b7a](https://github.com/kulshekhar/ts-jest/commit/c5a5b7a))
### Features
* **diagnostics:** add option to enable/disable first-TS-error-throws ([2c840c2](https://github.com/kulshekhar/ts-jest/commit/2c840c2))
<a name="23.10.0-beta.4"></a>
# [23.10.0-beta.4](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.3...v23.10.0-beta.4) (2018-09-06)
### Bug Fixes
* **config:** fixes a bug in the tsconfig file resolver ([3910f2c](https://github.com/kulshekhar/ts-jest/commit/3910f2c))
<a name="23.10.0-beta.3"></a>
# [23.10.0-beta.3](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.2...v23.10.0-beta.3) (2018-09-06)
### Bug Fixes
* **config:** fixes a bug in path resolver ([ceb0424](https://github.com/kulshekhar/ts-jest/commit/ceb0424))
### Features
* **cli:** adds a cli tool to migrate old config ([714f5f0](https://github.com/kulshekhar/ts-jest/commit/714f5f0))
* **cli:** ads a simple config:init helper + tests ([6700522](https://github.com/kulshekhar/ts-jest/commit/6700522))
* **config:** exposes custom transformers to config for presets ([885bc44](https://github.com/kulshekhar/ts-jest/commit/885bc44))
* **logger:** adds ts-jest version in the logger's context ([bb0c06e](https://github.com/kulshekhar/ts-jest/commit/bb0c06e))
### Performance Improvements
* **bundle:** improves bundle size ([34eedc3](https://github.com/kulshekhar/ts-jest/commit/34eedc3))
<a name="23.10.0-beta.2"></a>
# [23.10.0-beta.2](https://github.com/kulshekhar/ts-jest/compare/v23.10.0-beta.1...v23.10.0-beta.2) (2018-09-02)
### Bug Fixes
* **caching:** fixes a possible cache collision ([9c38694](https://github.com/kulshekhar/ts-jest/commit/9c38694))
* **testing:** change logging level for some utility ([16f125a](https://github.com/kulshekhar/ts-jest/commit/16f125a))
### Features
* **config:** typeCheck default to true (langauge service) ([623b2f4](https://github.com/kulshekhar/ts-jest/commit/623b2f4))
### BREAKING CHANGES
* **config:** Language service will be used by default from now on
<a name="23.10.0-beta.1"></a>
# [23.10.0-beta.1](https://github.com/kulshekhar/ts-jest/compare/v23.1.4...v23.10.0-beta.1) (2018-09-01)
### Bug Fixes
* typos + node 6 compat ([0ed1587](https://github.com/kulshekhar/ts-jest/commit/0ed1587))
* **ci:** can't use runInBand for e2e: cache collision ([db650f4](https://github.com/kulshekhar/ts-jest/commit/db650f4))
* jest 22 did not have default config ([cbaddc3](https://github.com/kulshekhar/ts-jest/commit/cbaddc3))
* **ci:** do not run e2e sub-tests in band ([18ad865](https://github.com/kulshekhar/ts-jest/commit/18ad865))
* **ci:** ensure npm is present with ci ([edb6eda](https://github.com/kulshekhar/ts-jest/commit/edb6eda))
* **logger:** removes cyclic imports ([5ef980f](https://github.com/kulshekhar/ts-jest/commit/5ef980f))
* babel-config + adds test ([12146c3](https://github.com/kulshekhar/ts-jest/commit/12146c3))
* **tests:** CI fixes ([34a41ea](https://github.com/kulshekhar/ts-jest/commit/34a41ea))
* fixes js style to be node < 10 compatible ([83d7517](https://github.com/kulshekhar/ts-jest/commit/83d7517))
* hoisting per level + memoize fix ([31847b0](https://github.com/kulshekhar/ts-jest/commit/31847b0))
* makes node6 happy ([f170285](https://github.com/kulshekhar/ts-jest/commit/f170285))
* node 6 unhappy again... ([703ad0b](https://github.com/kulshekhar/ts-jest/commit/703ad0b))
* normalizes bundle hash on any node version ([ce7afaf](https://github.com/kulshekhar/ts-jest/commit/ce7afaf))
* source maps ([89a30c9](https://github.com/kulshekhar/ts-jest/commit/89a30c9))
* updates templates ([f2e1da2](https://github.com/kulshekhar/ts-jest/commit/f2e1da2))
* uses cross-platform spawn + fix pkg versions ([ac1599c](https://github.com/kulshekhar/ts-jest/commit/ac1599c))
* we are not writing files, use normalized EOL ([47fff43](https://github.com/kulshekhar/ts-jest/commit/47fff43))
* **tests:** detect npm version to use or not ci ([683a1e5](https://github.com/kulshekhar/ts-jest/commit/683a1e5))
* **tests:** do not use babel in our tests + new API for simple ([3e4de3e](https://github.com/kulshekhar/ts-jest/commit/3e4de3e))
* **tests:** more sanitizing for windows compat ([faae274](https://github.com/kulshekhar/ts-jest/commit/faae274))
### Features
* diagnostics, different compilers, ... ([f26ebf0](https://github.com/kulshekhar/ts-jest/commit/f26ebf0))
* **config:** adds a helper to build moduleNameMapper from paths ([7b8598e](https://github.com/kulshekhar/ts-jest/commit/7b8598e)), closes [#364](https://github.com/kulshekhar/ts-jest/issues/364)
* **logging:** improves log messages + tests ([5d03c4d](https://github.com/kulshekhar/ts-jest/commit/5d03c4d))
* jest preset ([beb50b5](https://github.com/kulshekhar/ts-jest/commit/beb50b5))
* **test:** jest serializers ([dfa9c0f](https://github.com/kulshekhar/ts-jest/commit/dfa9c0f))
* adds logging + better hashing ([4322701](https://github.com/kulshekhar/ts-jest/commit/4322701))
* **tests:** more test tools + adds test related to debuggin issues ([8dcafca](https://github.com/kulshekhar/ts-jest/commit/8dcafca))
* allow env var to add diagnostic codes to ignore ([777edf5](https://github.com/kulshekhar/ts-jest/commit/777edf5))
* cache key + tests ([bd55448](https://github.com/kulshekhar/ts-jest/commit/bd55448))
* directly writes to stdio so jest does not swallow ([6a7f01f](https://github.com/kulshekhar/ts-jest/commit/6a7f01f))
* handles stringifyContentPathRegex ([3fcb4bd](https://github.com/kulshekhar/ts-jest/commit/3fcb4bd))
* hoisting + tests + many other things ([6186e84](https://github.com/kulshekhar/ts-jest/commit/6186e84))
* io serializer + other test utils ([d03e0e7](https://github.com/kulshekhar/ts-jest/commit/d03e0e7))
* warn about unsupported versions ([1103071](https://github.com/kulshekhar/ts-jest/commit/1103071))
### Performance Improvements
* detects changes in templates and bundle ([2a3da21](https://github.com/kulshekhar/ts-jest/commit/2a3da21))
* **babel:** uses babel-jest cache key as part of ours ([f51c4a7](https://github.com/kulshekhar/ts-jest/commit/f51c4a7))
* do not type check if fileName doesn't match ([cc45adc](https://github.com/kulshekhar/ts-jest/commit/cc45adc))
* faster tests ([37a0187](https://github.com/kulshekhar/ts-jest/commit/37a0187))
* more cleaning ([c48f7b8](https://github.com/kulshekhar/ts-jest/commit/c48f7b8))
* trying to improve travis-ci conf ([e4b4d95](https://github.com/kulshekhar/ts-jest/commit/e4b4d95))
* **cache:** share config-sets for parallel test running ([090ca7b](https://github.com/kulshekhar/ts-jest/commit/090ca7b))
* **tests:** run e2e tests in band ([b3e94ff](https://github.com/kulshekhar/ts-jest/commit/b3e94ff))
<a name="23.1.3"></a>
## [23.1.3](https://github.com/kulshekhar/ts-jest/compare/v23.1.2...v23.1.3) (2018-08-06)
### Bug Fixes
* **html:** correctly transforms html source when needed ([9a2d74f](https://github.com/kulshekhar/ts-jest/commit/9a2d74f))
* **lint:** fixes tslint script & lint issues ([60ab36e](https://github.com/kulshekhar/ts-jest/commit/60ab36e))
* **package:** update fs-extra to version 6.0.1 ([7e73536](https://github.com/kulshekhar/ts-jest/commit/7e73536))
* **package:** update pkg-dir to version 3.0.0 ([3fb8f9f](https://github.com/kulshekhar/ts-jest/commit/3fb8f9f))
* **package:** update yargs to version 12.0.1 ([390ffcd](https://github.com/kulshekhar/ts-jest/commit/390ffcd))
* **source-maps:** fix source maps options/calls ([76e27c1](https://github.com/kulshekhar/ts-jest/commit/76e27c1))
* allow (but deprecate) use of old preprocessor.js ([a65079f](https://github.com/kulshekhar/ts-jest/commit/a65079f))
* big refactor + fixes (mainly cache key + coverage) ([e46caae](https://github.com/kulshekhar/ts-jest/commit/e46caae))
* fixes coverage and tests ([09500c2](https://github.com/kulshekhar/ts-jest/commit/09500c2))
* gracefully load [@babel](https://github.com/babel)/core or babel-core ([98b2410](https://github.com/kulshekhar/ts-jest/commit/98b2410))
* hack for babel < 6 so that breakpoints do work ([90c74ef](https://github.com/kulshekhar/ts-jest/commit/90c74ef)), closes [#627](https://github.com/kulshekhar/ts-jest/issues/627)
* makes node 6 happy ([f6f82b8](https://github.com/kulshekhar/ts-jest/commit/f6f82b8))
* makes window happy ([36fbebe](https://github.com/kulshekhar/ts-jest/commit/36fbebe))
* npm coming with node 6 doesn't talk `ci` ([b87198d](https://github.com/kulshekhar/ts-jest/commit/b87198d))
* resolves correctly config file path (fix [#636](https://github.com/kulshekhar/ts-jest/issues/636)) ([5ab100c](https://github.com/kulshekhar/ts-jest/commit/5ab100c))
* test rootDir to handle preset-angular ([8a6a8f7](https://github.com/kulshekhar/ts-jest/commit/8a6a8f7))
* Typo in utils.ts ([#534](https://github.com/kulshekhar/ts-jest/issues/534)) ([a650260](https://github.com/kulshekhar/ts-jest/commit/a650260))
* wrong error message ([c955083](https://github.com/kulshekhar/ts-jest/commit/c955083))
### Performance Improvements
* do not hash cache key, jest does it underneath ([fbe4f1f](https://github.com/kulshekhar/ts-jest/commit/fbe4f1f))
* improves speed of local test after 1st run ([cc04021](https://github.com/kulshekhar/ts-jest/commit/cc04021))
<a name="22.4.5"></a>
## [22.4.5](https://github.com/kulshekhar/ts-jest/compare/v22.4.4...v22.4.5) (2018-05-05)
<a name="22.4.1"></a>
## [22.4.1](https://github.com/kulshekhar/ts-jest/compare/v22.4.0...v22.4.1) (2018-03-02)
### Bug Fixes
* **package:** update source-map-support to version 0.5.0 ([f0aab12](https://github.com/kulshekhar/ts-jest/commit/f0aab12))
* add startDir to if-clause ([eed5311](https://github.com/kulshekhar/ts-jest/commit/eed5311))
* **package:** update yargs to version 10.0.3 ([5cdf969](https://github.com/kulshekhar/ts-jest/commit/5cdf969))
* **package:** update yargs to version 11.0.0 ([7e9ce40](https://github.com/kulshekhar/ts-jest/commit/7e9ce40))
* **package:** update yargs to version 9.0.1 ([#326](https://github.com/kulshekhar/ts-jest/issues/326)) ([8bf9924](https://github.com/kulshekhar/ts-jest/commit/8bf9924))
### Features
* add option to run TypeScript diagnostics ([13b77d9](https://github.com/kulshekhar/ts-jest/commit/13b77d9))
<a name="21.0.1"></a>
## [21.0.1](https://github.com/kulshekhar/ts-jest/compare/v21.0.0...v21.0.1) (2017-09-14)
<a name="21.0.0"></a>
# [21.0.0](https://github.com/kulshekhar/ts-jest/compare/v20.0.14...v21.0.0) (2017-09-05)
<a name="20.0.14"></a>
## [20.0.14](https://github.com/kulshekhar/ts-jest/compare/v20.0.13...v20.0.14) (2017-09-01)
<a name="20.0.13"></a>
## [20.0.13](https://github.com/kulshekhar/ts-jest/compare/v20.0.12...v20.0.13) (2017-08-30)
<a name="20.0.12"></a>
## [20.0.12](https://github.com/kulshekhar/ts-jest/compare/v20.0.11...v20.0.12) (2017-08-30)
<a name="20.0.11"></a>
## [20.0.11](https://github.com/kulshekhar/ts-jest/compare/v20.0.9...v20.0.11) (2017-08-29)
<a name="20.0.9"></a>
## [20.0.9](https://github.com/kulshekhar/ts-jest/compare/20.0.9...v20.0.9) (2017-08-04)
### Bug Fixes
* **package:** update fs-extra to version 4.0.0 ([5be18fb](https://github.com/kulshekhar/ts-jest/commit/5be18fb))
<a name="20.0.7"></a>
## [20.0.7](https://github.com/kulshekhar/ts-jest/compare/17.0.3...20.0.7) (2017-07-07)
### Bug Fixes
* **package:** update fs-extra to version 3.0.0 ([906be12](https://github.com/kulshekhar/ts-jest/commit/906be12))
* **package:** update yargs to version 8.0.1 ([0b2ea98](https://github.com/kulshekhar/ts-jest/commit/0b2ea98))
* peer dependency against Typescript 2.x ([cb08128](https://github.com/kulshekhar/ts-jest/commit/cb08128))
* remove outDir when collecting coverage ([c076956](https://github.com/kulshekhar/ts-jest/commit/c076956))
### Features
* export transpileIfTypescript ([6f835af](https://github.com/kulshekhar/ts-jest/commit/6f835af))
<a name="17.0.3"></a>
## [17.0.3](https://github.com/kulshekhar/ts-jest/compare/17.0.2...17.0.3) (2016-12-01)
<a name="17.0.2"></a>
## [17.0.2](https://github.com/kulshekhar/ts-jest/compare/17.0.1...17.0.2) (2016-12-01)
<a name="17.0.1"></a>
## [17.0.1](https://github.com/kulshekhar/ts-jest/compare/17.0.0...17.0.1) (2016-11-30)
<a name="17.0.0"></a>
# [17.0.0](https://github.com/kulshekhar/ts-jest/compare/0.1.13...17.0.0) (2016-11-09)
<a name="0.1.13"></a>
## [0.1.13](https://github.com/kulshekhar/ts-jest/compare/0.1.12...0.1.13) (2016-11-07)
<a name="0.1.12"></a>
## [0.1.12](https://github.com/kulshekhar/ts-jest/compare/0.1.11...0.1.12) (2016-11-03)
<a name="0.1.11"></a>
## [0.1.11](https://github.com/kulshekhar/ts-jest/compare/0.1.10...0.1.11) (2016-10-27)
<a name="0.1.10"></a>
## [0.1.10](https://github.com/kulshekhar/ts-jest/compare/0.1.9...0.1.10) (2016-10-26)
<a name="0.1.9"></a>
## [0.1.9](https://github.com/kulshekhar/ts-jest/compare/0.1.8...0.1.9) (2016-10-24)
<a name="0.1.8"></a>
## [0.1.8](https://github.com/kulshekhar/ts-jest/compare/0.1.7...0.1.8) (2016-10-14)
<a name="0.1.7"></a>
## [0.1.7](https://github.com/kulshekhar/ts-jest/compare/0.1.6...0.1.7) (2016-10-10)
<a name="0.1.6"></a>
## [0.1.6](https://github.com/kulshekhar/ts-jest/compare/0.1.5...0.1.6) (2016-10-08)
<a name="0.1.5"></a>
## [0.1.5](https://github.com/kulshekhar/ts-jest/compare/0.1.4...0.1.5) (2016-09-22)
<a name="0.1.4"></a>
## [0.1.4](https://github.com/kulshekhar/ts-jest/compare/0.1.3...0.1.4) (2016-09-16)
<a name="0.1.3"></a>
## [0.1.3](https://github.com/kulshekhar/ts-jest/compare/0.1.2...0.1.3) (2016-08-31)
<a name="0.1.2"></a>
## [0.1.2](https://github.com/kulshekhar/ts-jest/compare/0.1.1...0.1.2) (2016-08-31)
<a name="0.1.1"></a>
## [0.1.1](https://github.com/kulshekhar/ts-jest/compare/0.1.0...0.1.1) (2016-08-31)
<a name="0.1.0"></a>
# [0.1.0](https://github.com/kulshekhar/ts-jest/compare/0.0.1...0.1.0) (2016-08-31)
<a name="0.0.1"></a>
## [0.0.1](https://github.com/kulshekhar/ts-jest/compare/0.0.0...0.0.1) (2016-08-30)
<a name="0.0.0"></a>
# 0.0.0 (2016-08-30)

67
node_modules/ts-jest/CONTRIBUTING.md generated vendored Normal file
View file

@ -0,0 +1,67 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [slack](https://bit.ly/ts-jest-slack) or [issue](https://github.com/kulshekhar/ts-jest/issues) with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure the tests are passing and that you have latest `master` branch merged in.
2. Update the `docs/` with details of your changes if required.
3. If possible, squash your commits. There must be only one commit in your PR (until a review). Then after each review requesting changes, DO NOT squash your commits with the one before the review, so that we can see intermediate modifications.
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at kulshekhar@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

21
node_modules/ts-jest/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2018
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62
node_modules/ts-jest/README.md generated vendored Normal file
View file

@ -0,0 +1,62 @@
# ts-jest [![npm version](https://badge.fury.io/js/ts-jest.svg)](https://badge.fury.io/js/ts-jest) [![NPM downloads](https://img.shields.io/npm/dm/ts-jest.svg?style=flat)](https://npmjs.org/package/ts-jest) [![Known Vulnerabilities](https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg)](https://snyk.io/test/github/kulshekhar/ts-jest) [![Coverage Status](https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master)](https://coveralls.io/github/kulshekhar/ts-jest?branch=master) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=kulshekhar/ts-jest)](https://dependabot.com) [![Build Status for linux](https://travis-ci.org/kulshekhar/ts-jest.svg?branch=master)](https://travis-ci.org/kulshekhar/ts-jest) [![Build Status for Windows](https://ci.appveyor.com/api/projects/status/g8tt9qd7usv0tolb/branch/master?svg=true)](https://ci.appveyor.com/project/kulshekhar/ts-jest/branch/master)
<img src="./icon.png" align="right" title="ts-jest Logo" width="128" height="128">
**`ts-jest`** is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript.
It supports all features of TypeScript including type-checking. [Read more about Babel7 + `preset-typescript` **vs** TypeScript (and `ts-jest`)](https://kulshekhar.github.io/ts-jest/user/babel7-or-ts).
---
| We are not doing semantic versioning and `23.10` is a re-write, run `npm i -D ts-jest@"<23.10.0"` to go back to the previous version |
|---|
[<img src="./docs/assets/img/documentation.png" align="left" height="24"> View the online documentation (usage & technical)](https://kulshekhar.github.io/ts-jest)
[<img src="./docs/assets/img/slack.png" align="left" height="24"> Ask for some help in the `ts-jest` community of Slack](https://bit.ly/ts-jest-slack)
<!--
[<img src="./docs/assets/img/troubleshooting.png" align="left" height="24"> Before reporting any issue, be sure to check the troubleshooting page](https://kulshekhar.github.io/ts-jest/user/troubleshooting)
-->
[<img src="./docs/assets/img/pull-request.png" align="left" height="24"> We're looking for collaborators! Want to help improve `ts-jest`?](https://github.com/kulshekhar/ts-jest/issues/223)
---
## Getting Started
These instructions will get you setup to use `ts-jest` in your project. For more detailed documentation, please check [online documentation](https://kulshekhar.github.io/ts-jest).
| | using npm | using yarn |
|---:|---|---|
| **Prerequisites** | `npm i -D jest typescript` | `yarn add --dev jest typescript` |
| **Installing** | `npm i -D ts-jest @types/jest` | `yarn add --dev ts-jest @types/jest` |
| **Creating config** | `npx ts-jest config:init` | `yarn ts-jest config:init` |
| **Running tests** | `npm t` or `npx jest` | `yarn test` or `yarn jest` |
## Built With
* [TypeScript](https://www.typescriptlang.org/) - JavaScript that scales
* [Jest](https://jestjs.io/) - Delightful JavaScript Testing
* [`ts-jest`](https://kulshekhar.github.io/ts-jest) - Jest processor for TypeScript _(yes, `ts-jest` uses itself for its tests)_
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
We **DO NOT** use [SemVer](http://semver.org/) for versioning. Tho you can think about SemVer when reading our version, except our major number follows the one of Jest. For the versions available, see the [tags on this repository](https://github.com/kulshekhar/ts-jest/tags).
## Authors/maintainers
* **Kulshekhar Kabra** - [kulshekhar](https://github.com/kulshekhar)
* **Gustav Wengel** - [GeeWee](https://github.com/GeeWee)
* **Ahn** - [ahnpnl](https://github.com/ahnpnl)
* **Huafu Gandon** - [huafu](https://github.com/huafu)
See also the list of [contributors](https://github.com/kulshekhar/ts-jest/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

3
node_modules/ts-jest/cli.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env node
require('./dist/cli').processArgv()

1
node_modules/ts-jest/dist/cli/config/init.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

152
node_modules/ts-jest/dist/cli/config/init.js generated vendored Normal file
View file

@ -0,0 +1,152 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var json5_1 = require("json5");
var path_1 = require("path");
var presets_1 = require("../helpers/presets");
exports.run = function (args) { return __awaiter(_this, void 0, void 0, function () {
var file, filePath, name, isPackage, exists, pkgFile, hasPackage, _a, jestPreset, askedTsconfig, force, jsdom, tsconfig, pkgJson, jsFilesProcessor, shouldPostProcessWithBabel, preset, body, base, tsJestConf, content;
return __generator(this, function (_b) {
file = args._[0] || 'jest.config.js';
filePath = path_1.join(process.cwd(), file);
name = path_1.basename(file);
isPackage = name === 'package.json';
exists = fs_1.existsSync(filePath);
pkgFile = isPackage ? filePath : path_1.join(process.cwd(), 'package.json');
hasPackage = isPackage || fs_1.existsSync(pkgFile);
_a = args.jestPreset, jestPreset = _a === void 0 ? true : _a, askedTsconfig = args.tsconfig, force = args.force, jsdom = args.jsdom;
tsconfig = askedTsconfig === 'tsconfig.json' ? undefined : askedTsconfig;
pkgJson = hasPackage ? JSON.parse(fs_1.readFileSync(pkgFile, 'utf8')) : {};
jsFilesProcessor = args.js, shouldPostProcessWithBabel = args.babel;
if (jsFilesProcessor == null) {
jsFilesProcessor = shouldPostProcessWithBabel ? 'babel' : undefined;
}
else if (shouldPostProcessWithBabel == null) {
shouldPostProcessWithBabel = jsFilesProcessor === 'babel';
}
if (jsFilesProcessor === 'babel') {
preset = presets_1.jsWIthBabel;
}
else if (jsFilesProcessor === 'ts') {
preset = presets_1.jsWithTs;
}
else {
preset = presets_1.defaults;
}
if (isPackage && !exists) {
throw new Error("File " + file + " does not exists.");
}
else if (!isPackage && exists && !force) {
throw new Error("Configuration file " + file + " already exists.");
}
if (!isPackage && !name.endsWith('.js')) {
throw new TypeError("Configuration file " + file + " must be a .js file or the package.json.");
}
if (hasPackage && pkgJson.jest) {
if (force && !isPackage) {
delete pkgJson.jest;
fs_1.writeFileSync(pkgFile, JSON.stringify(pkgJson, undefined, ' '));
}
else if (!force) {
throw new Error("A Jest configuration is already set in " + pkgFile + ".");
}
}
if (isPackage) {
base = jestPreset ? { preset: preset.name } : __assign({}, preset.value);
if (!jsdom)
base.testEnvironment = 'node';
if (tsconfig || shouldPostProcessWithBabel) {
tsJestConf = {};
base.globals = { 'ts-jest': tsJestConf };
if (tsconfig)
tsJestConf.tsconfig = tsconfig;
if (shouldPostProcessWithBabel)
tsJestConf.babelConfig = true;
}
body = JSON.stringify(__assign({}, pkgJson, { jest: base }), undefined, ' ');
}
else {
content = [];
if (!jestPreset) {
content.push(preset.jsImport('tsjPreset') + ";", '');
}
content.push('module.exports = {');
if (jestPreset) {
content.push(" preset: '" + preset.name + "',");
}
else {
content.push(" ...tsjPreset,");
}
if (!jsdom)
content.push(" testEnvironment: 'node',");
if (tsconfig || shouldPostProcessWithBabel) {
content.push(" globals: {");
content.push(" 'ts-jest': {");
if (tsconfig)
content.push(" tsconfig: " + json5_1.stringify(tsconfig) + ",");
if (shouldPostProcessWithBabel)
content.push(" babelConfig: true,");
content.push(" },");
content.push(" },");
}
content.push('};');
body = content.join('\n');
}
fs_1.writeFileSync(filePath, body);
process.stderr.write("\nJest configuration written to \"" + filePath + "\".\n");
return [2];
});
}); };
exports.help = function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest config:init [options] [<config-file>]\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n Default: jest.config.js\n\nOptions:\n --force Discard any existing Jest config\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n --tsconfig <file> Path to the tsconfig.json file\n --babel Pipe babel-jest after ts-jest\n --jsdom Use jsdom as test environment instead of node\n");
return [2];
});
}); };

1
node_modules/ts-jest/dist/cli/config/migrate.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

220
node_modules/ts-jest/dist/cli/config/migrate.js generated vendored Normal file
View file

@ -0,0 +1,220 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify"));
var fs_1 = require("fs");
var json5_1 = require("json5");
var path_1 = require("path");
var backports_1 = require("../../util/backports");
var presets_1 = require("../helpers/presets");
exports.run = function (args) { return __awaiter(_this, void 0, void 0, function () {
var nullLogger, file, filePath, footNotes, name, isPackage, actualConfig, migratedConfig, presetName, preset, jsTransformers, jsWithTs, jsWithBabel, presetValue, migratedValue, presetValue, migratedValue, before, after, stringify, prefix;
return __generator(this, function (_a) {
nullLogger = bs_logger_1.createLogger({ targets: [] });
file = args._[0];
filePath = path_1.resolve(process.cwd(), file);
footNotes = [];
if (!fs_1.existsSync(filePath)) {
throw new Error("Configuration file " + file + " does not exists.");
}
name = path_1.basename(file);
isPackage = name === 'package.json';
if (!/\.(js|json)$/.test(name)) {
throw new TypeError("Configuration file " + file + " must be a JavaScript or JSON file.");
}
actualConfig = require(filePath);
if (isPackage) {
actualConfig = actualConfig.jest;
}
if (!actualConfig)
actualConfig = {};
migratedConfig = backports_1.backportJestConfig(nullLogger, actualConfig);
if (!migratedConfig.preset && args.jestPreset) {
if (args.js) {
presetName = args.js === 'babel' ? presets_1.JestPresetNames.jsWIthBabel : presets_1.JestPresetNames.jsWithTs;
}
else {
jsTransformers = Object.keys(migratedConfig.transform || {}).reduce(function (list, pattern) {
if (RegExp(pattern.replace(/^<rootDir>\/?/, '/dummy-project/')).test('/dummy-project/src/foo.js')) {
var transformer = migratedConfig.transform[pattern];
if (/\bbabel-jest\b/.test(transformer))
transformer = 'babel-jest';
else if (/\ts-jest\b/.test(transformer))
transformer = 'ts-jest';
return __spread(list, [transformer]);
}
return list;
}, []);
jsWithTs = jsTransformers.includes('ts-jest');
jsWithBabel = jsTransformers.includes('babel-jest');
if (jsWithBabel && !jsWithTs) {
presetName = presets_1.JestPresetNames.jsWIthBabel;
}
else if (jsWithTs && !jsWithBabel) {
presetName = presets_1.JestPresetNames.jsWithTs;
}
else {
presetName = presets_1.JestPresetNames.default;
}
}
presetName = presetName || presets_1.JestPresetNames.default;
preset = presets_1.allPresets[presetName];
footNotes.push("Detected preset '" + preset.label + "' as the best matching preset for your configuration.\nVisit https://kulshekhar.github.io/ts-jest/user/config/#jest-preset for more information about presets.\n");
}
else if (migratedConfig.preset && migratedConfig.preset.startsWith('ts-jest')) {
if (args.jestPreset === false) {
delete migratedConfig.preset;
}
else {
preset = presets_1.allPresets[migratedConfig.preset] || presets_1.defaults;
}
}
if (preset)
migratedConfig.preset = preset.name;
if (migratedConfig.moduleFileExtensions && migratedConfig.moduleFileExtensions.length && preset) {
presetValue = dedupSort(preset.value.moduleFileExtensions || []).join('::');
migratedValue = dedupSort(migratedConfig.moduleFileExtensions).join('::');
if (presetValue === migratedValue) {
delete migratedConfig.moduleFileExtensions;
}
}
if (migratedConfig.testRegex && preset) {
migratedConfig.testMatch = null;
}
else if (migratedConfig.testMatch && migratedConfig.testMatch.length && preset) {
presetValue = dedupSort(preset.value.testMatch || []).join('::');
migratedValue = dedupSort(migratedConfig.testMatch).join('::');
if (presetValue === migratedValue) {
delete migratedConfig.testMatch;
}
}
if (migratedConfig.transform) {
Object.keys(migratedConfig.transform).forEach(function (key) {
var val = migratedConfig.transform[key];
if (typeof val === 'string' && /\/?ts-jest(?:\/preprocessor\.js)?$/.test(val)) {
;
migratedConfig.transform[key] = 'ts-jest';
}
});
}
if (preset &&
migratedConfig.transform &&
fast_json_stable_stringify_1.default(migratedConfig.transform) === fast_json_stable_stringify_1.default(preset.value.transform)) {
delete migratedConfig.transform;
}
cleanupConfig(actualConfig);
cleanupConfig(migratedConfig);
before = fast_json_stable_stringify_1.default(actualConfig);
after = fast_json_stable_stringify_1.default(migratedConfig);
if (after === before) {
process.stderr.write("\nNo migration needed for given Jest configuration\n ");
return [2];
}
stringify = /\.json$/.test(file) ? JSON.stringify : json5_1.stringify;
prefix = /\.json$/.test(file) ? '"jest": ' : 'module.exports = ';
if (preset && migratedConfig.transform) {
footNotes.push("\nI couldn't check if your \"transform\" value is the same as mine which is: " + stringify(preset.value.transform, undefined, ' ') + "\nIf it is the case, you can safely remove the \"transform\" from what I've migrated.\n");
}
process.stderr.write("\nMigrated Jest configuration:\n");
process.stdout.write("" + prefix + stringify(migratedConfig, undefined, ' ') + "\n");
if (footNotes.length) {
process.stderr.write("\n" + footNotes.join('\n') + "\n");
}
return [2];
});
}); };
function cleanupConfig(config) {
if (config.globals) {
if (config.globals['ts-jest'] && Object.keys(config.globals['ts-jest']).length === 0) {
delete config.globals['ts-jest'];
}
if (Object.keys(config.globals).length === 0) {
delete config.globals;
}
}
if (config.transform && Object.keys(config.transform).length === 0) {
delete config.transform;
}
if (config.moduleFileExtensions) {
config.moduleFileExtensions = dedupSort(config.moduleFileExtensions);
if (config.moduleFileExtensions.length === 0)
delete config.moduleFileExtensions;
}
if (config.testMatch) {
config.testMatch = dedupSort(config.testMatch);
if (config.testMatch.length === 0)
delete config.testMatch;
}
if (config.preset === presets_1.JestPresetNames.default)
config.preset = presets_1.defaults.name;
}
function dedupSort(arr) {
return arr
.filter(function (s, i, a) { return a.findIndex(function (e) { return s.toString() === e.toString(); }) === i; })
.sort(function (a, b) { return (a.toString() > b.toString() ? 1 : a.toString() < b.toString() ? -1 : 0); });
}
exports.help = function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest config:migrate [options] <config-file>\n\nArguments:\n <config-file> Can be a js or json Jest config file. If it is a\n package.json file, the configuration will be read from\n the \"jest\" property.\n\nOptions:\n --js ts|babel Process .js files with ts-jest if 'ts' or with\n babel-jest if 'babel'\n --no-jest-preset Disable the use of Jest presets\n");
return [2];
});
}); };

1
node_modules/ts-jest/dist/cli/help.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

45
node_modules/ts-jest/dist/cli/help.js generated vendored Normal file
View file

@ -0,0 +1,45 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = function (_) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
process.stdout.write("\nUsage:\n ts-jest command [options] [...args]\n\nCommands:\n config:init Creates initial Jest configuration\n config:migrate Migrates a given Jest configuration\n help [command] Show this help, or help about a command\n\nExample:\n ts-jest help config:migrate\n");
return [2];
});
}); };
exports.help = exports.run;

1
node_modules/ts-jest/dist/cli/helpers/presets.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

39
node_modules/ts-jest/dist/cli/helpers/presets.js generated vendored Normal file
View file

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var JestPresetNames;
(function (JestPresetNames) {
JestPresetNames["default"] = "ts-jest/presets/default";
JestPresetNames["jsWithTs"] = "ts-jest/presets/js-with-ts";
JestPresetNames["jsWIthBabel"] = "ts-jest/presets/js-with-babel";
})(JestPresetNames = exports.JestPresetNames || (exports.JestPresetNames = {}));
var definePreset = function (fullName) { return ({
fullName: fullName,
get name() {
return this.isDefault ? 'ts-jest' : fullName;
},
get label() {
return fullName.split('/').pop();
},
get jsVarName() {
return this.isDefault
? 'defaults'
: fullName
.split('/')
.pop()
.replace(/\-([a-z])/g, function (_, l) { return l.toUpperCase(); });
},
get value() {
return require("../../../" + fullName.replace(/^ts-jest\//, '') + "/jest-preset");
},
jsImport: function (varName) {
if (varName === void 0) { varName = 'tsjPreset'; }
return "const { " + this.jsVarName + ": " + varName + " } = require('ts-jest/presets')";
},
get isDefault() {
return fullName === JestPresetNames.default;
},
}); };
exports.allPresets = {};
exports.defaults = (exports.allPresets[JestPresetNames.default] = definePreset(JestPresetNames.default));
exports.jsWithTs = (exports.allPresets[JestPresetNames.jsWithTs] = definePreset(JestPresetNames.jsWithTs));
exports.jsWIthBabel = (exports.allPresets[JestPresetNames.jsWIthBabel] = definePreset(JestPresetNames.jsWIthBabel));

1
node_modules/ts-jest/dist/cli/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

105
node_modules/ts-jest/dist/cli/index.js generated vendored Normal file
View file

@ -0,0 +1,105 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a;
var bs_logger_1 = require("bs-logger");
var yargs_parser_1 = __importDefault(require("yargs-parser"));
var logger_1 = require("../util/logger");
var VALID_COMMANDS = ['help', 'config:migrate', 'config:init'];
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'cli', _a[bs_logger_1.LogContexts.application] = 'ts-jest', _a));
function cli(args) {
return __awaiter(this, void 0, void 0, function () {
var parsedArgv, command, isHelp, _a, run, help, cmd;
return __generator(this, function (_b) {
parsedArgv = yargs_parser_1.default(args, {
boolean: ['dry-run', 'jest-preset', 'allow-js', 'diff', 'babel', 'force', 'jsdom'],
string: ['tsconfig', 'js'],
count: ['verbose'],
alias: { verbose: ['v'] },
default: { jestPreset: true, verbose: 0 },
coerce: {
js: function (val) {
var res = val.trim().toLowerCase();
if (!['babel', 'ts'].includes(res))
throw new Error("The 'js' option must be 'babel' or 'ts', given: '" + val + "'.");
return res;
},
},
});
if (parsedArgv.allowJs != null) {
if (parsedArgv.js)
throw new Error("The 'allowJs' and 'js' options cannot be set together.");
parsedArgv.js = parsedArgv.allowJs ? 'ts' : undefined;
}
command = parsedArgv._.shift();
isHelp = command === 'help';
if (isHelp)
command = parsedArgv._.shift();
if (!VALID_COMMANDS.includes(command))
command = 'help';
_a = require("./" + command.replace(/:/g, '/')), run = _a.run, help = _a.help;
cmd = isHelp && command !== 'help' ? help : run;
return [2, cmd(parsedArgv, logger)];
});
});
}
function processArgv() {
return __awaiter(this, void 0, void 0, function () {
var err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4, cli(process.argv.slice(2))];
case 1:
_a.sent();
process.exit(0);
return [3, 3];
case 2:
err_1 = _a.sent();
logger.fatal(err_1.message);
process.exit(1);
return [3, 3];
case 3: return [2];
}
});
});
}
exports.processArgv = processArgv;

1
node_modules/ts-jest/dist/compiler.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

233
node_modules/ts-jest/dist/compiler.js generated vendored Normal file
View file

@ -0,0 +1,233 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var buffer_from_1 = __importDefault(require("buffer-from"));
var stableStringify = require("fast-json-stable-stringify");
var fs_1 = require("fs");
var mkdirp = require("mkdirp");
var path_1 = require("path");
var messages_1 = require("./util/messages");
var sha1_1 = require("./util/sha1");
var hasOwn = Object.prototype.hasOwnProperty;
function createCompiler(configs) {
var e_1, _a, _b, _c;
var logger = configs.logger.child({ namespace: 'ts-compiler' });
logger.debug('creating typescript compiler', configs.tsJest.isolatedModules ? '(isolated modules)' : '(language service)');
var cachedir = configs.tsCacheDir;
var memoryCache = {
contents: Object.create(null),
versions: Object.create(null),
outputs: Object.create(null),
};
var ts = configs.compilerModule;
var cwd = configs.cwd;
var extensions = ['.ts', '.tsx'];
var _d = configs.typescript, compilerOptions = _d.options, fileNames = _d.fileNames;
if (compilerOptions.allowJs) {
extensions.push('.js');
extensions.push('.jsx');
}
try {
for (var fileNames_1 = __values(fileNames), fileNames_1_1 = fileNames_1.next(); !fileNames_1_1.done; fileNames_1_1 = fileNames_1.next()) {
var path = fileNames_1_1.value;
memoryCache.versions[path] = 1;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (fileNames_1_1 && !fileNames_1_1.done && (_a = fileNames_1.return)) _a.call(fileNames_1);
}
finally { if (e_1) throw e_1.error; }
}
var getExtension = compilerOptions.jsx === ts.JsxEmit.Preserve
? function (path) { return (/\.[tj]sx$/.test(path) ? '.jsx' : '.js'); }
: function (_) { return '.js'; };
var transformers = configs.tsCustomTransformers;
var getOutput = function (code, fileName) {
logger.debug({ fileName: fileName }, 'getOutput(): compiling as isolated module');
var result = ts.transpileModule(code, {
fileName: fileName,
transformers: transformers,
compilerOptions: compilerOptions,
reportDiagnostics: configs.shouldReportDiagnostic(fileName),
});
if (result.diagnostics)
configs.raiseDiagnostics(result.diagnostics, fileName, logger);
return [result.outputText, result.sourceMapText];
};
var getTypeInfo = function (_code, _fileName, _position) {
throw new TypeError(messages_1.Errors.TypesUnavailableWithoutTypeCheck);
};
if (!configs.tsJest.isolatedModules) {
var updateMemoryCache_1 = function (code, fileName) {
logger.debug({ fileName: fileName }, "updateMemoryCache()");
if (memoryCache.contents[fileName] !== code) {
memoryCache.contents[fileName] = code;
memoryCache.versions[fileName] = (memoryCache.versions[fileName] || 0) + 1;
}
};
var serviceHostDebugCtx = (_b = {},
_b[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.debug,
_b.namespace = 'ts:serviceHost',
_b.call = null,
_b);
var serviceHostTraceCtx = __assign({}, serviceHostDebugCtx, (_c = {}, _c[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace, _c));
var serviceHost = {
getScriptFileNames: function () { return Object.keys(memoryCache.versions); },
getScriptVersion: function (fileName) {
var version = memoryCache.versions[fileName];
return version === undefined ? undefined : String(version);
},
getScriptSnapshot: function (fileName) {
var hit = hasOwn.call(memoryCache.contents, fileName);
logger.trace({ fileName: fileName, cacheHit: hit }, "getScriptSnapshot():", 'cache', hit ? 'hit' : 'miss');
if (!hit) {
memoryCache.contents[fileName] = ts.sys.readFile(fileName);
}
var contents = memoryCache.contents[fileName];
if (contents === undefined) {
return;
}
return ts.ScriptSnapshot.fromString(contents);
},
fileExists: ts.sys.fileExists,
readFile: logger.wrap(serviceHostTraceCtx, 'readFile', ts.sys.readFile),
readDirectory: ts.sys.readDirectory,
getDirectories: ts.sys.getDirectories,
directoryExists: ts.sys.directoryExists,
getNewLine: function () { return '\n'; },
getCurrentDirectory: function () { return cwd; },
getCompilationSettings: function () { return compilerOptions; },
getDefaultLibFileName: function () { return ts.getDefaultLibFilePath(compilerOptions); },
getCustomTransformers: function () { return transformers; },
};
logger.debug('creating language service');
var service_1 = ts.createLanguageService(serviceHost);
getOutput = function (code, fileName) {
logger.debug({ fileName: fileName }, 'getOutput(): compiling using language service');
updateMemoryCache_1(code, fileName);
var output = service_1.getEmitOutput(fileName);
if (configs.shouldReportDiagnostic(fileName)) {
logger.debug({ fileName: fileName }, 'getOutput(): computing diagnostics');
var diagnostics = service_1
.getCompilerOptionsDiagnostics()
.concat(service_1.getSyntacticDiagnostics(fileName))
.concat(service_1.getSemanticDiagnostics(fileName));
configs.raiseDiagnostics(diagnostics, fileName, logger);
}
if (output.emitSkipped) {
throw new TypeError(path_1.relative(cwd, fileName) + ": Emit skipped");
}
if (output.outputFiles.length === 0) {
throw new TypeError(messages_1.interpolate(messages_1.Errors.UnableToRequireDefinitionFile, {
file: path_1.basename(fileName),
}));
}
return [output.outputFiles[1].text, output.outputFiles[0].text];
};
getTypeInfo = function (code, fileName, position) {
updateMemoryCache_1(code, fileName);
var info = service_1.getQuickInfoAtPosition(fileName, position);
var name = ts.displayPartsToString(info ? info.displayParts : []);
var comment = ts.displayPartsToString(info ? info.documentation : []);
return { name: name, comment: comment };
};
}
var compile = readThrough(cachedir, memoryCache, getOutput, getExtension, cwd, logger);
return { cwd: cwd, compile: compile, getTypeInfo: getTypeInfo, extensions: extensions, cachedir: cachedir, ts: ts };
}
exports.createCompiler = createCompiler;
function readThrough(cachedir, memoryCache, compile, getExtension, cwd, logger) {
if (!cachedir) {
return function (code, fileName, lineOffset) {
logger.debug({ fileName: fileName }, 'readThrough(): no cache');
var _a = __read(compile(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
var output = updateOutput(value, fileName, sourceMap, getExtension, cwd);
memoryCache.outputs[fileName] = output;
return output;
};
}
mkdirp.sync(cachedir);
return function (code, fileName, lineOffset) {
var cachePath = path_1.join(cachedir, getCacheName(code, fileName));
var extension = getExtension(fileName);
var outputPath = "" + cachePath + extension;
try {
var output_1 = fs_1.readFileSync(outputPath, 'utf8');
if (isValidCacheContent(output_1)) {
logger.debug({ fileName: fileName }, 'readThrough(): cache hit');
memoryCache.outputs[fileName] = output_1;
return output_1;
}
}
catch (err) { }
logger.debug({ fileName: fileName }, 'readThrough(): cache miss');
var _a = __read(compile(code, fileName, lineOffset), 2), value = _a[0], sourceMap = _a[1];
var output = updateOutput(value, fileName, sourceMap, getExtension, cwd);
logger.debug({ fileName: fileName, outputPath: outputPath }, 'readThrough(): writing caches');
memoryCache.outputs[fileName] = output;
fs_1.writeFileSync(outputPath, output);
return output;
};
}
function updateOutput(outputText, fileName, sourceMap, getExtension, sourceRoot) {
var base = path_1.basename(fileName);
var base64Map = buffer_from_1.default(updateSourceMap(sourceMap, fileName, sourceRoot), 'utf8').toString('base64');
var sourceMapContent = "data:application/json;charset=utf-8;base64," + base64Map;
var sourceMapLength = (base + ".map").length + (getExtension(fileName).length - path_1.extname(fileName).length);
return outputText.slice(0, -sourceMapLength) + sourceMapContent;
}
function updateSourceMap(sourceMapText, fileName, _sourceRoot) {
var sourceMap = JSON.parse(sourceMapText);
sourceMap.file = fileName;
sourceMap.sources = [fileName];
delete sourceMap.sourceRoot;
return stableStringify(sourceMap);
}
function getCacheName(sourceCode, fileName) {
return sha1_1.sha1(path_1.extname(fileName), '\x00', sourceCode);
}
function isValidCacheContent(contents) {
return /(?:9|0=|Q==)$/.test(contents.slice(-3));
}

36
node_modules/ts-jest/dist/config/config-set.d.ts generated vendored Normal file
View file

@ -0,0 +1,36 @@
/// <reference types="jest" />
import { Logger } from 'bs-logger';
import { CompilerOptions, CustomTransformers, ParsedCommandLine } from 'typescript';
import { AstTransformerDesc, BabelConfig, BabelJestTransformer, TTypeScript, TsCompiler, TsJestConfig, TsJestGlobalOptions, TsJestHooksMap } from '../types';
export declare class ConfigSet {
readonly parentOptions?: TsJestGlobalOptions | undefined;
readonly projectPackageJson: Record<string, any>;
readonly projectDependencies: Record<string, string>;
readonly jest: jest.ProjectConfig;
readonly tsJest: TsJestConfig;
readonly typescript: ParsedCommandLine;
readonly tsconfig: any;
readonly versions: Record<string, string>;
private static loadConfig;
readonly babel: BabelConfig | undefined;
readonly compilerModule: TTypeScript;
readonly babelJestTransformer: BabelJestTransformer | undefined;
readonly tsCompiler: TsCompiler;
readonly astTransformers: AstTransformerDesc[];
readonly tsCustomTransformers: CustomTransformers;
readonly hooks: TsJestHooksMap;
readonly shouldReportDiagnostic: (filePath: string) => boolean;
readonly shouldStringifyContent: (filePath: string) => boolean;
readonly tsCacheDir: string | undefined;
readonly overriddenCompilerOptions: Partial<CompilerOptions>;
readonly rootDir: string;
readonly cwd: string;
readonly tsJestDigest: string;
readonly cacheKey: string;
readonly logger: Logger;
constructor(jestConfig: jest.ProjectConfig, parentOptions?: TsJestGlobalOptions | undefined, parentLogger?: Logger);
resolvePath(inputPath: string, { throwIfMissing, nodeResolve }?: {
throwIfMissing?: boolean;
nodeResolve?: boolean;
}): string;
}

794
node_modules/ts-jest/dist/config/config-set.js generated vendored Normal file
View file

@ -0,0 +1,794 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var fs_1 = require("fs");
var json5_1 = __importDefault(require("json5"));
var path_1 = require("path");
var semver_1 = __importDefault(require("semver"));
var __1 = require("..");
var compiler_1 = require("../compiler");
var transformers_1 = require("../transformers");
var backports_1 = require("../util/backports");
var get_package_version_1 = require("../util/get-package-version");
var importer_1 = require("../util/importer");
var json_1 = require("../util/json");
var jsonable_value_1 = require("../util/jsonable-value");
var logger_1 = require("../util/logger");
var memoize_1 = require("../util/memoize");
var messages_1 = require("../util/messages");
var normalize_slashes_1 = require("../util/normalize-slashes");
var sha1_1 = require("../util/sha1");
var ts_error_1 = require("../util/ts-error");
var logger = logger_1.rootLogger.child({ namespace: 'config' });
exports.MATCH_NOTHING = /a^/;
exports.IGNORE_DIAGNOSTIC_CODES = [
6059,
18002,
18003,
];
var DiagnosticCodes;
(function (DiagnosticCodes) {
DiagnosticCodes[DiagnosticCodes["TsJest"] = 151000] = "TsJest";
DiagnosticCodes[DiagnosticCodes["ConfigModuleOption"] = 151001] = "ConfigModuleOption";
})(DiagnosticCodes = exports.DiagnosticCodes || (exports.DiagnosticCodes = {}));
var normalizeRegex = function (pattern) {
return pattern ? (typeof pattern === 'string' ? pattern : pattern.source) : undefined;
};
var toDiagnosticCode = function (code) {
return code ? parseInt(("" + code).trim().replace(/^TS/, ''), 10) || undefined : undefined;
};
var toDiagnosticCodeList = function (items, into) {
if (into === void 0) { into = []; }
var e_1, _a;
if (!Array.isArray(items))
items = [items];
try {
for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
var item = items_1_1.value;
if (!item)
continue;
if (Array.isArray(item)) {
toDiagnosticCodeList(item, into);
continue;
}
else if (typeof item === 'string') {
var children = item.trim().split(/\s*,\s*/g);
if (children.length > 1) {
toDiagnosticCodeList(children, into);
continue;
}
item = children[0];
}
if (!item)
continue;
var code = toDiagnosticCode(item);
if (code && !into.includes(code))
into.push(code);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
}
finally { if (e_1) throw e_1.error; }
}
return into;
};
var ConfigSet = (function () {
function ConfigSet(jestConfig, parentOptions, parentLogger) {
var _a;
this.parentOptions = parentOptions;
this._jestConfig = jestConfig;
this.logger = parentLogger ? parentLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'config', _a)) : logger;
}
Object.defineProperty(ConfigSet.prototype, "projectPackageJson", {
get: function () {
var packageJson = this.tsJest.packageJson;
if (packageJson && packageJson.kind === 'inline') {
return packageJson.value;
}
if (packageJson && packageJson.kind === 'file' && packageJson.value) {
var path = this.resolvePath(packageJson.value);
if (fs_1.existsSync(path)) {
return require(path);
}
this.logger.warn(messages_1.Errors.UnableToFindProjectRoot);
return {};
}
var tsJestRoot = path_1.resolve(__dirname, '..', '..');
var pkgPath = path_1.resolve(tsJestRoot, '..', '..', 'package.json');
if (fs_1.existsSync(pkgPath)) {
return require(pkgPath);
}
if (fs_1.realpathSync(this.rootDir) === fs_1.realpathSync(tsJestRoot)) {
pkgPath = path_1.resolve(tsJestRoot, 'package.json');
if (fs_1.existsSync(pkgPath)) {
return require(pkgPath);
}
}
this.logger.warn(messages_1.Errors.UnableToFindProjectRoot);
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "projectDependencies", {
get: function () {
var pkg = this.projectPackageJson;
var names = Object.keys(__assign({}, pkg.optionalDependencies, pkg.peerDependencies, pkg.devDependencies, pkg.dependencies));
return names.reduce(function (map, name) {
var version = get_package_version_1.getPackageVersion(name);
if (version)
map[name] = version;
return map;
}, {});
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "jest", {
get: function () {
var config = backports_1.backportJestConfig(this.logger, this._jestConfig);
if (this.parentOptions) {
var globals = config.globals || (config.globals = {});
globals['ts-jest'] = __assign({}, this.parentOptions, globals['ts-jest']);
}
this.logger.debug({ jestConfig: config }, 'normalized jest config');
return config;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsJest", {
get: function () {
var _this = this;
var parsedConfig = this.jest;
var _a = parsedConfig.globals, globals = _a === void 0 ? {} : _a;
var options = __assign({}, globals['ts-jest']);
var tsConfigOpt = options.tsConfig;
var tsConfig;
if (typeof tsConfigOpt === 'string' || tsConfigOpt == null || tsConfigOpt === true) {
tsConfig = {
kind: 'file',
value: typeof tsConfigOpt === 'string' ? this.resolvePath(tsConfigOpt) : undefined,
};
}
else if (typeof tsConfigOpt === 'object') {
tsConfig = {
kind: 'inline',
value: tsConfigOpt,
};
}
var packageJsonOpt = options.packageJson;
var packageJson;
if (typeof packageJsonOpt === 'string' || packageJsonOpt == null || packageJsonOpt === true) {
packageJson = {
kind: 'file',
value: typeof packageJsonOpt === 'string' ? this.resolvePath(packageJsonOpt) : undefined,
};
}
else if (typeof packageJsonOpt === 'object') {
packageJson = {
kind: 'inline',
value: packageJsonOpt,
};
}
var transformers = (options.astTransformers || []).map(function (mod) { return _this.resolvePath(mod, { nodeResolve: true }); });
var babelConfigOpt = options.babelConfig;
var babelConfig;
if (typeof babelConfigOpt === 'string' || babelConfigOpt === true) {
babelConfig = {
kind: 'file',
value: babelConfigOpt === true ? undefined : this.resolvePath(babelConfigOpt),
};
}
else if (babelConfigOpt) {
babelConfig = {
kind: 'inline',
value: babelConfigOpt,
};
}
var diagnostics;
var _b = options.diagnostics, diagnosticsOpt = _b === void 0 ? true : _b;
var ignoreList = [exports.IGNORE_DIAGNOSTIC_CODES, process.env.TS_JEST_IGNORE_DIAGNOSTICS];
if (diagnosticsOpt === true || diagnosticsOpt == null) {
diagnostics = { ignoreCodes: [], pretty: true, throws: true };
}
else if (diagnosticsOpt === false) {
diagnostics = {
throws: false,
pretty: true,
ignoreCodes: [],
pathRegex: exports.MATCH_NOTHING.source,
};
}
else {
ignoreList.push(diagnosticsOpt.ignoreCodes);
diagnostics = {
pretty: diagnosticsOpt.pretty == null ? true : !!diagnosticsOpt.pretty,
ignoreCodes: [],
pathRegex: normalizeRegex(diagnosticsOpt.pathRegex),
throws: !diagnosticsOpt.warnOnly,
};
}
diagnostics.ignoreCodes = toDiagnosticCodeList(ignoreList);
var stringifyContentPathRegex = normalizeRegex(options.stringifyContentPathRegex);
var res = {
tsConfig: tsConfig,
packageJson: packageJson,
babelConfig: babelConfig,
diagnostics: diagnostics,
isolatedModules: !!options.isolatedModules,
compiler: options.compiler || 'typescript',
transformers: transformers,
stringifyContentPathRegex: stringifyContentPathRegex,
};
this.logger.debug({ tsJestConfig: res }, 'normalized ts-jest config');
return res;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "typescript", {
get: function () {
return this._typescript.resolved;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsconfig", {
get: function () {
return this._typescript.input;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "versions", {
get: function () {
var modules = ['jest', this.tsJest.compiler];
if (this.tsJest.babelConfig) {
modules.push('@babel/core', 'babel-jest');
}
return modules.reduce(function (map, name) {
map[name] = get_package_version_1.getPackageVersion(name) || '-';
return map;
}, { 'ts-jest': __1.version });
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "_typescript", {
get: function () {
var tsConfig = this.tsJest.tsConfig;
var configFilePath = tsConfig && tsConfig.kind === 'file' ? tsConfig.value : undefined;
var result = this.readTsConfig(tsConfig && tsConfig.kind === 'inline' ? tsConfig.value : undefined, configFilePath, tsConfig == null);
this.raiseDiagnostics(result.resolved.errors, configFilePath);
this.logger.debug({ tsconfig: result }, 'normalized typescript config');
return result;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "raiseDiagnostics", {
get: function () {
var _this = this;
var _a = this, createTsError = _a.createTsError, filterDiagnostics = _a.filterDiagnostics, throws = _a.tsJest.diagnostics.throws, DiagnosticCategory = _a.compilerModule.DiagnosticCategory;
return function (diagnostics, filePath, logger) {
if (logger === void 0) { logger = _this.logger; }
var filteredDiagnostics = filterDiagnostics(diagnostics, filePath);
if (filteredDiagnostics.length === 0)
return;
var error = createTsError(filteredDiagnostics);
var importantCategories = [DiagnosticCategory.Warning, DiagnosticCategory.Error];
if (throws && filteredDiagnostics.some(function (d) { return importantCategories.includes(d.category); })) {
throw error;
}
logger.warn({ error: error }, error.message);
};
},
enumerable: true,
configurable: true
});
ConfigSet.loadConfig = function (base) {
var _a = importer_1.importer.babelCore(messages_1.ImportReasons.BabelJest), OptionManager = _a.OptionManager, loadPartialConfig = _a.loadPartialConfig, version = _a.version;
if (version && semver_1.default.satisfies(version, '>=6 <7')) {
delete base.cwd;
}
if (typeof loadPartialConfig === 'function') {
var partialConfig = loadPartialConfig(base);
if (partialConfig) {
return partialConfig.options;
}
}
return new OptionManager().init(base);
};
Object.defineProperty(ConfigSet.prototype, "babel", {
get: function () {
var babelConfig = this.tsJest.babelConfig;
if (babelConfig == null) {
this.logger.debug('babel is disabled');
return;
}
var base = { cwd: this.cwd };
if (babelConfig.kind === 'file') {
if (babelConfig.value) {
base = __assign({}, base, json5_1.default.parse(fs_1.readFileSync(babelConfig.value, 'utf8')));
}
}
else if (babelConfig.kind === 'inline') {
base = __assign({}, base, babelConfig.value);
}
var config = ConfigSet.loadConfig(base);
this.logger.debug({ babelConfig: config }, 'normalized babel config');
return config;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "compilerModule", {
get: function () {
return importer_1.importer.typescript(messages_1.ImportReasons.TsJest, this.tsJest.compiler);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "babelJestTransformer", {
get: function () {
var babel = this.babel;
if (!babel)
return;
this.logger.debug('creating babel-jest transformer');
return importer_1.importer.babelJest(messages_1.ImportReasons.BabelJest).createTransformer(babel);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCompiler", {
get: function () {
return compiler_1.createCompiler(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "astTransformers", {
get: function () {
return __spread(transformers_1.internals, this.tsJest.transformers.map(function (m) { return require(m); }));
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCustomTransformers", {
get: function () {
var _this = this;
return {
before: this.astTransformers.map(function (t) { return t.factory(_this); }),
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "hooks", {
get: function () {
var hooksFile = process.env.TS_JEST_HOOKS;
if (hooksFile) {
hooksFile = path_1.resolve(this.cwd, hooksFile);
return importer_1.importer.tryTheseOr(hooksFile, {});
}
return {};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "filterDiagnostics", {
get: function () {
var _a = this, ignoreCodes = _a.tsJest.diagnostics.ignoreCodes, shouldReportDiagnostic = _a.shouldReportDiagnostic;
return function (diagnostics, filePath) {
if (filePath && !shouldReportDiagnostic(filePath))
return [];
return diagnostics.filter(function (diagnostic) {
if (diagnostic.file && diagnostic.file.fileName && !shouldReportDiagnostic(diagnostic.file.fileName)) {
return false;
}
return ignoreCodes.indexOf(diagnostic.code) === -1;
});
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "shouldReportDiagnostic", {
get: function () {
var pathRegex = this.tsJest.diagnostics.pathRegex;
if (pathRegex) {
var regex_1 = new RegExp(pathRegex);
return function (file) { return regex_1.test(file); };
}
else {
return function () { return true; };
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "shouldStringifyContent", {
get: function () {
var stringifyContentPathRegex = this.tsJest.stringifyContentPathRegex;
if (stringifyContentPathRegex) {
var regex_2 = new RegExp(stringifyContentPathRegex);
return function (file) { return regex_2.test(file); };
}
else {
return function () { return false; };
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "createTsError", {
get: function () {
var _this = this;
var pretty = this.tsJest.diagnostics.pretty;
var formatDiagnostics = pretty
? this.compilerModule.formatDiagnosticsWithColorAndContext
: this.compilerModule.formatDiagnostics;
var diagnosticHost = {
getNewLine: function () { return '\n'; },
getCurrentDirectory: function () { return _this.cwd; },
getCanonicalFileName: function (path) { return path; },
};
return function (diagnostics) {
var diagnosticText = formatDiagnostics(diagnostics, diagnosticHost);
var diagnosticCodes = diagnostics.map(function (x) { return x.code; });
return new ts_error_1.TSError(diagnosticText, diagnosticCodes);
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsCacheDir", {
get: function () {
if (!this.jest.cache) {
logger.debug('file caching disabled');
return;
}
var cacheSuffix = sha1_1.sha1(json_1.stringify({
version: this.compilerModule.version,
digest: this.tsJestDigest,
dependencies: this.projectDependencies,
compiler: this.tsJest.compiler,
compilerOptions: this.typescript.options,
isolatedModules: this.tsJest.isolatedModules,
diagnostics: this.tsJest.diagnostics,
}));
var res = path_1.join(this.jest.cacheDirectory, 'ts-jest', cacheSuffix.substr(0, 2), cacheSuffix.substr(2));
logger.debug({ cacheDirectory: res }, 'will use file caching');
return res;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "overriddenCompilerOptions", {
get: function () {
var options = {
sourceMap: true,
inlineSourceMap: false,
inlineSources: true,
declaration: false,
noEmit: false,
outDir: '$$ts-jest$$',
removeComments: false,
out: undefined,
outFile: undefined,
composite: undefined,
declarationDir: undefined,
declarationMap: undefined,
emitDeclarationOnly: undefined,
sourceRoot: undefined,
};
if (!this.tsJest.babelConfig) {
options.module = this.compilerModule.ModuleKind.CommonJS;
}
return options;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "rootDir", {
get: function () {
return path_1.normalize(this.jest.rootDir || this.cwd);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "cwd", {
get: function () {
return path_1.normalize(this.jest.cwd || process.cwd());
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "isDoctoring", {
get: function () {
return !!process.env.TS_JEST_DOCTOR;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "tsJestDigest", {
get: function () {
return __1.digest;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "jsonValue", {
get: function () {
var jest = __assign({}, this.jest);
var globals = (jest.globals = __assign({}, jest.globals));
delete jest.name;
delete jest.cacheDirectory;
delete globals['ts-jest'];
return new jsonable_value_1.JsonableValue({
versions: this.versions,
projectDepVersions: this.projectDependencies,
digest: this.tsJestDigest,
transformers: this.astTransformers.map(function (t) { return t.name + "@" + t.version; }),
jest: jest,
tsJest: this.tsJest,
babel: this.babel,
tsconfig: this.typescript.options,
});
},
enumerable: true,
configurable: true
});
Object.defineProperty(ConfigSet.prototype, "cacheKey", {
get: function () {
return this.jsonValue.serialized;
},
enumerable: true,
configurable: true
});
ConfigSet.prototype.makeDiagnostic = function (code, messageText, options) {
if (options === void 0) { options = {}; }
var _a = options.category, category = _a === void 0 ? this.compilerModule.DiagnosticCategory.Warning : _a, file = options.file, start = options.start, length = options.length;
return {
code: code,
messageText: messageText,
category: category,
file: file,
start: start,
length: length,
};
};
ConfigSet.prototype.readTsConfig = function (compilerOptions, resolvedConfigFile, noProject) {
var e_2, _a;
var config = { compilerOptions: {} };
var basePath = normalize_slashes_1.normalizeSlashes(this.rootDir);
var configFileName;
var ts = this.compilerModule;
var input;
if (noProject) {
input = { compilerOptions: __assign({}, compilerOptions) };
}
else {
configFileName = resolvedConfigFile
? normalize_slashes_1.normalizeSlashes(resolvedConfigFile)
: ts.findConfigFile(normalize_slashes_1.normalizeSlashes(this.rootDir), ts.sys.fileExists);
if (configFileName) {
this.logger.debug({ tsConfigFileName: configFileName }, 'readTsConfig(): reading', configFileName);
var result_1 = ts.readConfigFile(configFileName, ts.sys.readFile);
if (result_1.error) {
return {
resolved: { errors: [result_1.error], fileNames: [], options: {} },
};
}
config = result_1.config;
input = __assign({}, result_1.config, { compilerOptions: __assign({}, (result_1.config && result_1.config.compilerOptions), compilerOptions) });
basePath = normalize_slashes_1.normalizeSlashes(path_1.dirname(configFileName));
}
}
config.compilerOptions = __assign({}, config.compilerOptions, compilerOptions);
var result = ts.parseJsonConfigFileContent(config, ts.sys, basePath, undefined, configFileName);
var forcedOptions = this.overriddenCompilerOptions;
var finalOptions = result.options;
if (finalOptions.target === undefined) {
finalOptions.target = ts.ScriptTarget.ES5;
}
var target = finalOptions.target;
var defaultModule = [ts.ScriptTarget.ES3, ts.ScriptTarget.ES5].includes(target)
? ts.ModuleKind.CommonJS
: ts.ModuleKind.ESNext;
var moduleValue = finalOptions.module == null ? defaultModule : finalOptions.module;
if ('module' in forcedOptions &&
moduleValue !== forcedOptions.module &&
!(finalOptions.esModuleInterop || finalOptions.allowSyntheticDefaultImports)) {
result.errors.push(this.makeDiagnostic(DiagnosticCodes.ConfigModuleOption, messages_1.Errors.ConfigNoModuleInterop, {
category: ts.DiagnosticCategory.Message,
}));
if (!('allowSyntheticDefaultImports' in config.compilerOptions)) {
finalOptions.allowSyntheticDefaultImports = true;
}
}
try {
for (var _b = __values(Object.keys(forcedOptions)), _c = _b.next(); !_c.done; _c = _b.next()) {
var key = _c.value;
var val = forcedOptions[key];
if (val === undefined) {
delete finalOptions[key];
}
else {
finalOptions[key] = val;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
return { input: input, resolved: result };
};
ConfigSet.prototype.resolvePath = function (inputPath, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.throwIfMissing, throwIfMissing = _c === void 0 ? true : _c, _d = _b.nodeResolve, nodeResolve = _d === void 0 ? false : _d;
var path = inputPath;
var nodeResolved = false;
if (path.startsWith('<rootDir>')) {
path = path_1.resolve(path_1.join(this.rootDir, path.substr(9)));
}
else if (!path_1.isAbsolute(path)) {
if (!path.startsWith('.') && nodeResolve) {
try {
path = require.resolve(path);
nodeResolved = true;
}
catch (_) { }
}
if (!nodeResolved) {
path = path_1.resolve(this.cwd, path);
}
}
if (!nodeResolved && nodeResolve) {
try {
path = require.resolve(path);
nodeResolved = true;
}
catch (_) { }
}
if (throwIfMissing && !fs_1.existsSync(path)) {
throw new Error(messages_1.interpolate(messages_1.Errors.FileNotFound, { inputPath: inputPath, resolvedPath: path }));
}
this.logger.debug({ fromPath: inputPath, toPath: path }, 'resolved path from', inputPath, 'to', path);
return path;
};
ConfigSet.prototype.toJSON = function () {
return this.jsonValue.value;
};
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "projectPackageJson", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "projectDependencies", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "jest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsJest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "versions", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "_typescript", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "raiseDiagnostics", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "babel", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "compilerModule", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "babelJestTransformer", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCompiler", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "astTransformers", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCustomTransformers", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "hooks", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "filterDiagnostics", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "shouldReportDiagnostic", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "shouldStringifyContent", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "createTsError", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsCacheDir", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "overriddenCompilerOptions", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "rootDir", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "cwd", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "tsJestDigest", null);
__decorate([
memoize_1.Memoize()
], ConfigSet.prototype, "jsonValue", null);
return ConfigSet;
}());
exports.ConfigSet = ConfigSet;

View file

@ -0,0 +1,10 @@
/// <reference types="jest" />
export interface TsJestPresets {
transform: Record<string, string>;
testMatch?: string[];
moduleFileExtensions?: string[];
}
export interface CreateJestPresetOptions {
allowJs?: boolean;
}
export declare function createJestPreset({ allowJs }?: CreateJestPresetOptions, from?: jest.InitialOptions): TsJestPresets;

23
node_modules/ts-jest/dist/config/create-jest-preset.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("../util/logger");
var logger = logger_1.rootLogger.child({ namespace: 'jest-preset' });
function createJestPreset(_a, from) {
var _b = (_a === void 0 ? {} : _a).allowJs, allowJs = _b === void 0 ? false : _b;
if (from === void 0) { from = {}; }
var _c;
logger.debug({ allowJs: allowJs }, 'creating jest presets', allowJs ? 'handling' : 'not handling', 'JavaScript files');
return __assign({ transform: __assign({}, from.transform, (_c = {}, _c[allowJs ? '^.+\\.[tj]sx?$' : '^.+\\.tsx?$'] = 'ts-jest', _c)) }, (from.testMatch ? { testMatch: from.testMatch } : undefined), (from.moduleFileExtensions ? { moduleFileExtensions: from.moduleFileExtensions } : undefined));
}
exports.createJestPreset = createJestPreset;

View file

@ -0,0 +1,5 @@
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
prefix?: string | undefined;
}) => {
[key: string]: string;
} | undefined;

View file

@ -0,0 +1,62 @@
"use strict";
var __values = (this && this.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a;
var bs_logger_1 = require("bs-logger");
var logger_1 = require("../util/logger");
var messages_1 = require("../util/messages");
var escapeRegex = function (str) { return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); };
var logger = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'path-mapper', _a));
exports.pathsToModuleNameMapper = function (mapping, _a) {
var _b = (_a === void 0 ? {} : _a).prefix, prefix = _b === void 0 ? '' : _b;
var e_1, _c;
var jestMap = {};
try {
for (var _d = __values(Object.keys(mapping)), _e = _d.next(); !_e.done; _e = _d.next()) {
var fromPath = _e.value;
var pattern = void 0;
var toPaths = mapping[fromPath];
if (toPaths.length === 0) {
logger.warn(messages_1.interpolate(messages_1.Errors.NotMappingPathWithEmptyMap, { path: fromPath }));
continue;
}
else if (toPaths.length > 1) {
logger.warn(messages_1.interpolate(messages_1.Errors.MappingOnlyFirstTargetOfPath, {
path: fromPath,
count: toPaths.length,
}));
}
var target = toPaths[0];
var segments = fromPath.split(/\*/g);
if (segments.length === 1) {
pattern = "^" + escapeRegex(fromPath) + "$";
jestMap[pattern] = "" + prefix + target;
}
else if (segments.length === 2) {
pattern = "^" + escapeRegex(segments[0]) + "(.*)" + escapeRegex(segments[1]) + "$";
jestMap[pattern] = "" + prefix + target.replace(/\*/g, '$1');
}
else {
logger.warn(messages_1.interpolate(messages_1.Errors.NotMappingMultiStarPath, { path: fromPath }));
continue;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
}
finally { if (e_1) throw e_1.error; }
}
return jestMap;
};

16
node_modules/ts-jest/dist/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,16 @@
import { createJestPreset as createJestPresetCore } from './config/create-jest-preset';
import { TsJestTransformer } from './ts-jest-transformer';
import { TsJestGlobalOptions } from './types';
import { mocked as mockedCore } from './util/testing';
export declare const mocked: typeof mockedCore;
export declare const createJestPreset: typeof createJestPresetCore;
export declare const pathsToModuleNameMapper: (mapping: import("typescript").MapLike<string[]>, { prefix }?: {
prefix?: string | undefined;
}) => {
[key: string]: string;
} | undefined;
export declare const version: string;
export declare const digest: string;
export declare function createTransformer(baseConfig?: TsJestGlobalOptions): TsJestTransformer;
declare const jestPreset: import("./config/create-jest-preset").TsJestPresets;
export { jestPreset, };

74
node_modules/ts-jest/dist/index.js generated vendored Normal file
View file

@ -0,0 +1,74 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a;
var bs_logger_1 = require("bs-logger");
var fs_1 = require("fs");
var path_1 = require("path");
var create_jest_preset_1 = require("./config/create-jest-preset");
var paths_to_module_name_mapper_1 = require("./config/paths-to-module-name-mapper");
var ts_jest_transformer_1 = require("./ts-jest-transformer");
var logger_1 = require("./util/logger");
var messages_1 = require("./util/messages");
var testing_1 = require("./util/testing");
var version_checkers_1 = require("./util/version-checkers");
var warn = logger_1.rootLogger.child((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.warn, _a));
var helperMoved = function (name, helper) {
return warn.wrap(messages_1.interpolate(messages_1.Deprecateds.HelperMovedToUtils, { helper: name }), helper);
};
exports.mocked = helperMoved('mocked', testing_1.mocked);
exports.createJestPreset = helperMoved('createJestPreset', create_jest_preset_1.createJestPreset);
exports.pathsToModuleNameMapper = helperMoved('pathsToModuleNameMapper', paths_to_module_name_mapper_1.pathsToModuleNameMapper);
exports.version = require('../package.json').version;
exports.digest = fs_1.readFileSync(path_1.resolve(__dirname, '..', '.ts-jest-digest'), 'utf8');
var transformer;
function defaultTransformer() {
return transformer || (transformer = createTransformer());
}
function createTransformer(baseConfig) {
version_checkers_1.VersionCheckers.jest.warn();
return new ts_jest_transformer_1.TsJestTransformer(baseConfig);
}
exports.createTransformer = createTransformer;
function process() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _a;
return (_a = defaultTransformer()).process.apply(_a, __spread(args));
}
exports.process = process;
function getCacheKey() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var _a;
return (_a = defaultTransformer()).getCacheKey.apply(_a, __spread(args));
}
exports.getCacheKey = getCacheKey;
exports.canInstrument = false;
var jestPreset = create_jest_preset_1.createJestPreset();
exports.jestPreset = jestPreset;
exports.__singleton = function () { return transformer; };
exports.__resetModule = function () { return (transformer = undefined); };

View file

@ -0,0 +1 @@
export {};

80
node_modules/ts-jest/dist/transformers/hoist-jest.js generated vendored Normal file
View file

@ -0,0 +1,80 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var HOIST_METHODS = ['mock', 'unmock'];
exports.name = 'hoisting-jest-mock';
exports.version = 1;
function factory(cs) {
var logger = cs.logger.child({ namespace: 'ts-hoisting' });
var ts = cs.compilerModule;
function shouldHoistNode(node) {
return (ts.isExpressionStatement(node) &&
ts.isCallExpression(node.expression) &&
ts.isPropertyAccessExpression(node.expression.expression) &&
ts.isIdentifier(node.expression.expression.expression) &&
node.expression.expression.expression.text === 'jest' &&
ts.isIdentifier(node.expression.expression.name) &&
HOIST_METHODS.includes(node.expression.expression.name.text));
}
function createVisitor(ctx, _) {
var level = 0;
var hoisted = [];
var enter = function () {
level++;
if (hoisted[level]) {
hoisted[level].splice(0, hoisted[level].length);
}
};
var exit = function () { return level--; };
var hoist = function (node) {
if (hoisted[level]) {
hoisted[level].push(node);
}
else {
hoisted[level] = [node];
}
};
var visitor = function (node) {
enter();
var resultNode = ts.visitEachChild(node, visitor, ctx);
if (hoisted[level] && hoisted[level].length) {
var hoistedStmts_1 = hoisted[level];
var otherStmts = resultNode.statements.filter(function (s) { return !hoistedStmts_1.includes(s); });
var newNode = ts.getMutableClone(resultNode);
newNode.statements = ts.createNodeArray(__spread(hoistedStmts_1, otherStmts));
resultNode = newNode;
}
exit();
if (shouldHoistNode(resultNode)) {
hoist(resultNode);
}
return resultNode;
};
return visitor;
}
return function (ctx) {
var _a;
return logger.wrap((_a = {}, _a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.debug, _a.call = null, _a), 'visitSourceFileNode(): hoisting', function (sf) { return ts.visitNode(sf, createVisitor(ctx, sf)); });
};
}
exports.factory = factory;

1
node_modules/ts-jest/dist/transformers/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

11
node_modules/ts-jest/dist/transformers/index.js generated vendored Normal file
View file

@ -0,0 +1,11 @@
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var hoisting = __importStar(require("./hoist-jest"));
exports.internals = [hoisting];

17
node_modules/ts-jest/dist/ts-jest-transformer.d.ts generated vendored Normal file
View file

@ -0,0 +1,17 @@
/// <reference types="jest" />
import { Logger } from 'bs-logger';
import { ConfigSet } from './config/config-set';
import { TsJestGlobalOptions } from './types';
export declare class TsJestTransformer implements jest.Transformer {
static readonly lastTransformerId: number;
readonly logger: Logger;
readonly id: number;
readonly options: TsJestGlobalOptions;
constructor(baseOptions?: TsJestGlobalOptions);
configsFor(jestConfig: jest.ProjectConfig | string): ConfigSet;
process(input: string, filePath: jest.Path, jestConfig: jest.ProjectConfig, transformOptions?: jest.TransformOptions): jest.TransformedSource | string;
getCacheKey(fileContent: string, filePath: string, jestConfigStr: string, transformOptions?: {
instrument?: boolean;
rootDir?: string;
}): string;
}

132
node_modules/ts-jest/dist/ts-jest-transformer.js generated vendored Normal file
View file

@ -0,0 +1,132 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("util");
var config_set_1 = require("./config/config-set");
var json_1 = require("./util/json");
var jsonable_value_1 = require("./util/jsonable-value");
var logger_1 = require("./util/logger");
var messages_1 = require("./util/messages");
var sha1_1 = require("./util/sha1");
exports.INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
var TsJestTransformer = (function () {
function TsJestTransformer(baseOptions) {
if (baseOptions === void 0) { baseOptions = {}; }
this.options = __assign({}, baseOptions);
this.id = TsJestTransformer._nextTransformerId;
this.logger = logger_1.rootLogger.child({
transformerId: this.id,
namespace: 'jest-transformer',
});
this.logger.debug({ baseOptions: baseOptions }, 'created new transformer');
}
Object.defineProperty(TsJestTransformer, "lastTransformerId", {
get: function () {
return TsJestTransformer._lastTransformerId;
},
enumerable: true,
configurable: true
});
Object.defineProperty(TsJestTransformer, "_nextTransformerId", {
get: function () {
return ++TsJestTransformer._lastTransformerId;
},
enumerable: true,
configurable: true
});
TsJestTransformer.prototype[exports.INSPECT_CUSTOM] = function () {
return "[object TsJestTransformer<#" + this.id + ">]";
};
TsJestTransformer.prototype.configsFor = function (jestConfig) {
var csi;
var jestConfigObj;
if (typeof jestConfig === 'string') {
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.serialized === jestConfig; });
if (csi)
return csi.configSet;
jestConfigObj = json_1.parse(jestConfig);
}
else {
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.value === jestConfig; });
if (csi)
return csi.configSet;
var serialized_1 = json_1.stringify(jestConfig);
csi = TsJestTransformer._configSetsIndex.find(function (cs) { return cs.jestConfig.serialized === serialized_1; });
if (csi) {
csi.jestConfig.value = jestConfig;
return csi.configSet;
}
jestConfigObj = jestConfig;
}
this.logger.info("no matching config-set found, creating a new one");
var configSet = new config_set_1.ConfigSet(jestConfigObj, this.options, this.logger);
TsJestTransformer._configSetsIndex.push({
jestConfig: new jsonable_value_1.JsonableValue(jestConfigObj),
configSet: configSet,
});
return configSet;
};
TsJestTransformer.prototype.process = function (input, filePath, jestConfig, transformOptions) {
this.logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'processing', filePath);
var result;
var source = input;
var configs = this.configsFor(jestConfig);
var hooks = configs.hooks;
var stringify = configs.shouldStringifyContent(filePath);
var babelJest = stringify ? undefined : configs.babelJestTransformer;
var isDefinitionFile = filePath.endsWith('.d.ts');
var isJsFile = !isDefinitionFile && /\.jsx?$/.test(filePath);
var isTsFile = isDefinitionFile || /\.tsx?$/.test(filePath);
if (stringify) {
result = "module.exports=" + JSON.stringify(source);
}
else if (isDefinitionFile) {
result = '';
}
else if (!configs.typescript.options.allowJs && isJsFile) {
this.logger.warn({ fileName: filePath }, messages_1.interpolate(messages_1.Errors.GotJsFileButAllowJsFalse, { path: filePath }));
result = source;
}
else if (isJsFile || isTsFile) {
result = configs.tsCompiler.compile(source, filePath);
}
else {
var message = babelJest ? messages_1.Errors.GotUnknownFileTypeWithBabel : messages_1.Errors.GotUnknownFileTypeWithoutBabel;
this.logger.warn({ fileName: filePath }, messages_1.interpolate(message, { path: filePath }));
result = source;
}
if (babelJest) {
this.logger.debug({ fileName: filePath }, 'calling babel-jest processor');
result = babelJest.process(result, filePath, jestConfig, __assign({}, transformOptions, { instrument: false }));
}
if (hooks.afterProcess) {
this.logger.debug({ fileName: filePath, hookName: 'afterProcess' }, 'calling afterProcess hook');
var newResult = hooks.afterProcess([input, filePath, jestConfig, transformOptions], result);
if (newResult !== undefined) {
return newResult;
}
}
return result;
};
TsJestTransformer.prototype.getCacheKey = function (fileContent, filePath, jestConfigStr, transformOptions) {
if (transformOptions === void 0) { transformOptions = {}; }
this.logger.debug({ fileName: filePath, transformOptions: transformOptions }, 'computing cache key for', filePath);
var configs = this.configsFor(jestConfigStr);
var _a = transformOptions.instrument, instrument = _a === void 0 ? false : _a, _b = transformOptions.rootDir, rootDir = _b === void 0 ? configs.rootDir : _b;
return sha1_1.sha1(configs.cacheKey, '\x00', rootDir, '\x00', "instrument:" + (instrument ? 'on' : 'off'), '\x00', fileContent, '\x00', filePath);
};
TsJestTransformer._configSetsIndex = [];
TsJestTransformer._lastTransformerId = 0;
return TsJestTransformer;
}());
exports.TsJestTransformer = TsJestTransformer;

112
node_modules/ts-jest/dist/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,112 @@
/// <reference types="jest" />
import * as _babel from 'babel__core';
import _ts, { CompilerOptions, SourceFile, TransformerFactory } from 'typescript';
import { ConfigSet } from './config/config-set';
export declare type TBabelCore = typeof _babel;
export declare type TTypeScript = typeof _ts;
export declare type TBabelJest = Required<jest.Transformer>;
export declare type BabelJestTransformer = {
[K in Exclude<keyof jest.Transformer, 'createTransformer'>]: Exclude<jest.Transformer[K], undefined>;
};
export declare type BabelConfig = _babel.TransformOptions;
export interface TsJestGlobalOptions {
tsConfig?: boolean | string | CompilerOptions;
packageJson?: boolean | string | object;
isolatedModules?: boolean;
compiler?: string;
astTransformers?: string[];
diagnostics?: boolean | {
pretty?: boolean;
ignoreCodes?: number | string | Array<number | string>;
pathRegex?: RegExp | string;
warnOnly?: boolean;
};
babelConfig?: boolean | string | BabelConfig;
stringifyContentPathRegex?: string | RegExp;
}
interface TsJestConfig$tsConfig$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$tsConfig$inline {
kind: 'inline';
value: CompilerOptions;
}
declare type TsJestConfig$tsConfig = TsJestConfig$tsConfig$file | TsJestConfig$tsConfig$inline | undefined;
interface TsJestConfig$diagnostics {
pretty: boolean;
ignoreCodes: number[];
pathRegex?: string | undefined;
throws: boolean;
}
interface TsJestConfig$babelConfig$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$babelConfig$inline {
kind: 'inline';
value: BabelConfig;
}
declare type TsJestConfig$babelConfig = TsJestConfig$babelConfig$file | TsJestConfig$babelConfig$inline | undefined;
interface TsJestConfig$packageJson$file {
kind: 'file';
value: string | undefined;
}
interface TsJestConfig$packageJson$inline {
kind: 'inline';
value: any;
}
declare type TsJestConfig$packageJson = TsJestConfig$packageJson$file | TsJestConfig$packageJson$inline | undefined;
declare type TsJestConfig$stringifyContentPathRegex = string | undefined;
export interface TsJestConfig {
tsConfig: TsJestConfig$tsConfig;
packageJson: TsJestConfig$packageJson;
isolatedModules: boolean;
compiler: string;
diagnostics: TsJestConfig$diagnostics;
babelConfig: TsJestConfig$babelConfig;
transformers: string[];
stringifyContentPathRegex: TsJestConfig$stringifyContentPathRegex;
}
export interface TsJestHooksMap {
afterProcess?(args: any[], result: string | jest.TransformedSource): string | jest.TransformedSource | void;
}
export interface TSCommon {
version: typeof _ts.version;
sys: typeof _ts.sys;
ScriptSnapshot: typeof _ts.ScriptSnapshot;
displayPartsToString: typeof _ts.displayPartsToString;
createLanguageService: typeof _ts.createLanguageService;
getDefaultLibFilePath: typeof _ts.getDefaultLibFilePath;
getPreEmitDiagnostics: typeof _ts.getPreEmitDiagnostics;
flattenDiagnosticMessageText: typeof _ts.flattenDiagnosticMessageText;
transpileModule: typeof _ts.transpileModule;
ModuleKind: typeof _ts.ModuleKind;
ScriptTarget: typeof _ts.ScriptTarget;
findConfigFile: typeof _ts.findConfigFile;
readConfigFile: typeof _ts.readConfigFile;
parseJsonConfigFileContent: typeof _ts.parseJsonConfigFileContent;
formatDiagnostics: typeof _ts.formatDiagnostics;
formatDiagnosticsWithColorAndContext: typeof _ts.formatDiagnosticsWithColorAndContext;
}
export interface TypeInfo {
name: string;
comment: string;
}
export interface TsCompiler {
cwd: string;
extensions: string[];
cachedir: string | undefined;
ts: TSCommon;
compile(code: string, fileName: string, lineOffset?: number): string;
getTypeInfo(code: string, fileName: string, position: number): TypeInfo;
}
export interface AstTransformerDesc {
name: string;
version: number;
factory(cs: ConfigSet): TransformerFactory<SourceFile>;
}
export interface IPackageJson {
main: string;
}
export {};

2
node_modules/ts-jest/dist/types.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

1
node_modules/ts-jest/dist/util/backports.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

101
node_modules/ts-jest/dist/util/backports.js generated vendored Normal file
View file

@ -0,0 +1,101 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a;
var bs_logger_1 = require("bs-logger");
var messages_1 = require("./messages");
var context = (_a = {}, _a[bs_logger_1.LogContexts.namespace] = 'backports', _a);
exports.backportJestConfig = function (logger, config) {
logger.debug(__assign({}, context, { config: config }), 'backporting config');
var _a = (config || {}).globals, globals = _a === void 0 ? {} : _a;
var _b = globals["ts-jest"], tsJest = _b === void 0 ? {} : _b;
var mergeTsJest = {};
var hadWarnings = false;
var warnConfig = function (oldPath, newPath, note) {
hadWarnings = true;
logger.warn(context, messages_1.interpolate(note ? messages_1.Deprecateds.ConfigOptionWithNote : messages_1.Deprecateds.ConfigOption, {
oldPath: oldPath,
newPath: newPath,
note: note,
}));
};
if ('__TS_CONFIG__' in globals) {
warnConfig('globals.__TS_CONFIG__', 'globals.ts-jest.tsConfig');
if (typeof globals.__TS_CONFIG__ === 'object') {
mergeTsJest.tsConfig = globals.__TS_CONFIG__;
}
delete globals.__TS_CONFIG__;
}
if ('__TRANSFORM_HTML__' in globals) {
warnConfig('globals.__TRANSFORM_HTML__', 'globals.ts-jest.stringifyContentPathRegex');
if (globals.__TRANSFORM_HTML__) {
mergeTsJest.stringifyContentPathRegex = '\\.html?$';
}
delete globals.__TRANSFORM_HTML__;
}
if ('typeCheck' in tsJest) {
warnConfig('globals.ts-jest.typeCheck', 'globals.ts-jest.isolatedModules');
mergeTsJest.isolatedModules = !tsJest.typeCheck;
delete tsJest.typeCheck;
}
if ('tsConfigFile' in tsJest) {
warnConfig('globals.ts-jest.tsConfigFile', 'globals.ts-jest.tsConfig');
if (tsJest.tsConfigFile) {
mergeTsJest.tsConfig = tsJest.tsConfigFile;
}
delete tsJest.tsConfigFile;
}
if ('enableTsDiagnostics' in tsJest) {
warnConfig('globals.ts-jest.enableTsDiagnostics', 'globals.ts-jest.diagnostics');
if (tsJest.enableTsDiagnostics) {
mergeTsJest.diagnostics = { warnOnly: true };
if (typeof tsJest.enableTsDiagnostics === 'string')
mergeTsJest.diagnostics.pathRegex = tsJest.enableTsDiagnostics;
}
else {
mergeTsJest.diagnostics = false;
}
delete tsJest.enableTsDiagnostics;
}
if ('useBabelrc' in tsJest) {
warnConfig('globals.ts-jest.useBabelrc', 'globals.ts-jest.babelConfig', messages_1.Deprecateds.ConfigOptionUseBabelRcNote);
if (tsJest.useBabelrc != null) {
mergeTsJest.babelConfig = tsJest.useBabelrc ? true : {};
}
delete tsJest.useBabelrc;
}
if ('skipBabel' in tsJest) {
warnConfig('globals.ts-jest.skipBabel', 'globals.ts-jest.babelConfig');
if (tsJest.skipBabel === false && !mergeTsJest.babelConfig) {
mergeTsJest.babelConfig = true;
}
delete tsJest.skipBabel;
}
if (hadWarnings) {
logger.warn(context, messages_1.Helps.MigrateConfigUsingCLI);
}
return __assign({}, config, { globals: __assign({}, globals, { 'ts-jest': __assign({}, mergeTsJest, tsJest) }) });
};
exports.backportTsJestDebugEnvVar = function (logger) {
if ('TS_JEST_DEBUG' in process.env) {
var shouldLog = !/^\s*(?:0|f(?:alse)?|no?|disabled?|off|)\s*$/i.test(process.env.TS_JEST_DEBUG || '');
delete process.env.TS_JEST_DEBUG;
if (shouldLog) {
process.env.TS_JEST_LOG = "ts-jest.log,stderr:warn";
}
logger.warn(context, messages_1.interpolate(messages_1.Deprecateds.EnvVar, {
old: 'TS_JEST_DEBUG',
new: 'TS_JEST_LOG',
}));
}
};

3
node_modules/ts-jest/dist/util/exported.d.ts generated vendored Normal file
View file

@ -0,0 +1,3 @@
export { mocked } from './testing';
export { createJestPreset } from '../config/create-jest-preset';
export { pathsToModuleNameMapper } from '../config/paths-to-module-name-mapper';

8
node_modules/ts-jest/dist/util/exported.js generated vendored Normal file
View file

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var testing_1 = require("./testing");
exports.mocked = testing_1.mocked;
var create_jest_preset_1 = require("../config/create-jest-preset");
exports.createJestPreset = create_jest_preset_1.createJestPreset;
var paths_to_module_name_mapper_1 = require("../config/paths-to-module-name-mapper");
exports.pathsToModuleNameMapper = paths_to_module_name_mapper_1.pathsToModuleNameMapper;

View file

@ -0,0 +1 @@
export {};

10
node_modules/ts-jest/dist/util/get-package-version.js generated vendored Normal file
View file

@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getPackageVersion(moduleName) {
try {
return require(moduleName + "/package.json").version;
}
catch (err) { }
return;
}
exports.getPackageVersion = getPackageVersion;

1
node_modules/ts-jest/dist/util/importer.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

193
node_modules/ts-jest/dist/util/importer.js generated vendored Normal file
View file

@ -0,0 +1,193 @@
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("./logger");
var memoize_1 = require("./memoize");
var messages_1 = require("./messages");
var version_checkers_1 = require("./version-checkers");
var logger = logger_1.rootLogger.child({ namespace: 'Importer' });
var passThru = function (action) { return function (input) {
action();
return input;
}; };
var Importer = (function () {
function Importer(_patches) {
if (_patches === void 0) { _patches = {}; }
this._patches = _patches;
}
Object.defineProperty(Importer, "instance", {
get: function () {
logger.debug('creating Importer singleton');
return new Importer({
'@babel/core': [passThru(version_checkers_1.VersionCheckers.babelCore.warn)],
'babel-jest': [passThru(version_checkers_1.VersionCheckers.babelJest.warn)],
typescript: [passThru(version_checkers_1.VersionCheckers.typescript.warn)],
jest: [passThru(version_checkers_1.VersionCheckers.jest.warn)],
});
},
enumerable: true,
configurable: true
});
Importer.prototype.babelJest = function (why) {
return this._import(why, 'babel-jest');
};
Importer.prototype.babelCore = function (why) {
return this._import(why, '@babel/core');
};
Importer.prototype.typescript = function (why, which) {
return this._import(why, which);
};
Importer.prototype.tryThese = function (moduleName) {
var fallbacks = [];
for (var _i = 1; _i < arguments.length; _i++) {
fallbacks[_i - 1] = arguments[_i];
}
var name;
var loaded;
var tries = __spread([moduleName], fallbacks);
while ((name = tries.shift()) !== undefined) {
var req = requireWrapper(name);
var contextReq = __assign({}, req);
delete contextReq.exports;
if (req.exists) {
loaded = req;
if (loaded.error) {
logger.error({ requireResult: contextReq }, "failed loading module '" + name + "'", loaded.error.message);
}
else {
logger.debug({ requireResult: contextReq }, 'loaded module', name);
loaded.exports = this._patch(name, loaded.exports);
}
break;
}
else {
logger.debug({ requireResult: contextReq }, "module '" + name + "' not found");
continue;
}
}
return loaded;
};
Importer.prototype.tryTheseOr = function (moduleNames, missingResult, allowLoadError) {
if (allowLoadError === void 0) { allowLoadError = false; }
var args = Array.isArray(moduleNames) ? moduleNames : [moduleNames];
var result = this.tryThese.apply(this, __spread(args));
if (!result)
return missingResult;
if (!result.error)
return result.exports;
if (allowLoadError)
return missingResult;
throw result.error;
};
Importer.prototype._patch = function (name, unpatched) {
if (name in this._patches) {
logger.debug('patching', name);
return this._patches[name].reduce(function (mod, patcher) { return patcher(mod); }, unpatched);
}
return unpatched;
};
Importer.prototype._import = function (why, moduleName, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.alternatives, alternatives = _c === void 0 ? [] : _c, _d = _b.installTip, installTip = _d === void 0 ? moduleName : _d;
var res = this.tryThese.apply(this, __spread([moduleName], alternatives));
if (res && res.exists) {
if (!res.error)
return res.exports;
throw new Error(messages_1.interpolate(messages_1.Errors.LoadingModuleFailed, { module: res.given, error: res.error.message }));
}
var msg = alternatives.length ? messages_1.Errors.UnableToLoadAnyModule : messages_1.Errors.UnableToLoadOneModule;
var loadModule = __spread([moduleName], alternatives).map(function (m) { return "\"" + m + "\""; }).join(', ');
if (typeof installTip === 'string') {
installTip = [{ module: installTip, label: "install \"" + installTip + "\"" }];
}
var fix = installTip
.map(function (tip) {
return " " + (installTip.length === 1 ? '↳' : '•') + " " + messages_1.interpolate(messages_1.Helps.FixMissingModule, tip);
})
.join('\n');
throw new Error(messages_1.interpolate(msg, {
module: loadModule,
reason: why,
fix: fix,
}));
};
__decorate([
memoize_1.Memoize(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return args.join(':');
})
], Importer.prototype, "tryThese", null);
__decorate([
memoize_1.Memoize(function (name) { return name; })
], Importer.prototype, "_patch", null);
__decorate([
memoize_1.Memoize()
], Importer, "instance", null);
return Importer;
}());
exports.Importer = Importer;
exports.importer = Importer.instance;
function requireWrapper(moduleName) {
var path;
var exists = false;
try {
path = resolveModule(moduleName);
exists = true;
}
catch (error) {
return { error: error, exists: exists, given: moduleName };
}
var result = { exists: exists, path: path, given: moduleName };
try {
result.exports = requireModule(moduleName);
}
catch (error) {
result.error = error;
}
return result;
}
var requireModule = function (mod) { return require(mod); };
var resolveModule = function (mod) { return require.resolve(mod); };
function __requireModule(localRequire, localResolve) {
requireModule = localRequire;
resolveModule = localResolve;
}
exports.__requireModule = __requireModule;

1
node_modules/ts-jest/dist/util/json.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

31
node_modules/ts-jest/dist/util/json.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var stableStringify = require("fast-json-stable-stringify");
var UNDEFINED = 'undefined';
function stringify(input) {
return input === undefined ? UNDEFINED : stableStringify(input);
}
exports.stringify = stringify;
function parse(input) {
return input === UNDEFINED ? undefined : JSON.parse(input);
}
exports.parse = parse;
function normalize(input, _a) {
var _b = (_a === void 0 ? {} : _a).parse, parser = _b === void 0 ? parse : _b;
var result;
if (normalize.cache.has(input)) {
result = normalize.cache.get(input);
}
else {
var data = parser(input);
result = stringify(data);
if (result === input)
result = undefined;
normalize.cache.set(input, result);
}
return result === undefined ? input : result;
}
exports.normalize = normalize;
(function (normalize) {
normalize.cache = new Map();
})(normalize = exports.normalize || (exports.normalize = {}));

1
node_modules/ts-jest/dist/util/jsonable-value.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

34
node_modules/ts-jest/dist/util/jsonable-value.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var json_1 = require("./json");
var JsonableValue = (function () {
function JsonableValue(value) {
this.value = value;
}
Object.defineProperty(JsonableValue.prototype, "value", {
get: function () {
return this._value;
},
set: function (value) {
this._value = value;
this._serialized = json_1.stringify(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(JsonableValue.prototype, "serialized", {
get: function () {
return this._serialized;
},
enumerable: true,
configurable: true
});
JsonableValue.prototype.valueOf = function () {
return this._value;
};
JsonableValue.prototype.toString = function () {
return this._serialized;
};
return JsonableValue;
}());
exports.JsonableValue = JsonableValue;

1
node_modules/ts-jest/dist/util/logger.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

21
node_modules/ts-jest/dist/util/logger.js generated vendored Normal file
View file

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bs_logger_1 = require("bs-logger");
var backports_1 = require("./backports");
var original = process.env.TS_JEST_LOG;
var buildOptions = function () {
var _a;
return ({
context: (_a = {},
_a[bs_logger_1.LogContexts.package] = 'ts-jest',
_a[bs_logger_1.LogContexts.logLevel] = bs_logger_1.LogLevels.trace,
_a.version = require('../../package.json').version,
_a),
targets: process.env.TS_JEST_LOG || undefined,
});
};
exports.rootLogger = bs_logger_1.createLogger(buildOptions());
backports_1.backportTsJestDebugEnvVar(exports.rootLogger);
if (original !== process.env.TS_JEST_LOG) {
exports.rootLogger = bs_logger_1.createLogger(buildOptions());
}

1
node_modules/ts-jest/dist/util/memoize.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

47
node_modules/ts-jest/dist/util/memoize.js generated vendored Normal file
View file

@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cacheProp = Symbol.for('[memoize]');
function Memoize(keyBuilder) {
return function (_, propertyKey, descriptor) {
if (descriptor.value != null) {
descriptor.value = memoize(propertyKey, descriptor.value, keyBuilder || (function (v) { return v; }));
}
else if (descriptor.get != null) {
descriptor.get = memoize(propertyKey, descriptor.get, keyBuilder || (function () { return propertyKey; }));
}
};
}
exports.Memoize = Memoize;
function ensureCache(target, reset) {
if (reset === void 0) { reset = false; }
if (reset || !target[cacheProp]) {
Object.defineProperty(target, cacheProp, {
value: Object.create(null),
configurable: true,
});
}
return target[cacheProp];
}
function ensureChildCache(target, key, reset) {
if (reset === void 0) { reset = false; }
var dict = ensureCache(target);
if (reset || !dict[key]) {
dict[key] = new Map();
}
return dict[key];
}
function memoize(namespace, func, keyBuilder) {
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var cache = ensureChildCache(this, namespace);
var key = keyBuilder.apply(this, args);
if (cache.has(key))
return cache.get(key);
var res = func.apply(this, args);
cache.set(key, res);
return res;
};
}

1
node_modules/ts-jest/dist/util/messages.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

47
node_modules/ts-jest/dist/util/messages.js generated vendored Normal file
View file

@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Errors;
(function (Errors) {
Errors["LoadingModuleFailed"] = "Loading module {{module}} failed with error: {{error}}";
Errors["UnableToLoadOneModule"] = "Unable to load the module {{module}}. {{reason}} To fix it:\n{{fix}}";
Errors["UnableToLoadAnyModule"] = "Unable to load any of these modules: {{module}}. {{reason}}. To fix it:\n{{fix}}";
Errors["TypesUnavailableWithoutTypeCheck"] = "Type information is unavailable with \"isolatedModules\"";
Errors["UnableToRequireDefinitionFile"] = "Unable to require `.d.ts` file.\nThis is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or another executable extension available alongside `{{file}}`.";
Errors["FileNotFound"] = "File not found: {{inputPath}} (resolved as: {{resolvedPath}})";
Errors["UntestedDependencyVersion"] = "Version {{actualVersion}} of {{module}} installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version ({{expectedVersion}}). Please do not report issues in ts-jest if you are using unsupported versions.";
Errors["MissingDependency"] = "Module {{module}} is not installed. If you're experiencing issues, consider installing a supported version ({{expectedVersion}}).";
Errors["UnableToCompileTypeScript"] = "TypeScript diagnostics ({{help}}):\n{{diagnostics}}";
Errors["NotMappingMultiStarPath"] = "Not mapping \"{{path}}\" because it has more than one star (`*`).";
Errors["NotMappingPathWithEmptyMap"] = "Not mapping \"{{path}}\" because it has no target.";
Errors["MappingOnlyFirstTargetOfPath"] = "Mapping only to first target of \"{{path}}\" because it has more than one ({{count}}).";
Errors["GotJsFileButAllowJsFalse"] = "Got a `.js` file to compile while `allowJs` option is not set to `true` (file: {{path}}). To fix this:\n - if you want TypeScript to process JS files, set `allowJs` to `true` in your TypeScript config (usually tsconfig.json)\n - if you do not want TypeScript to process your `.js` files, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match `.js` files anymore";
Errors["GotUnknownFileTypeWithoutBabel"] = "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore.";
Errors["GotUnknownFileTypeWithBabel"] = "Got a unknown file type to compile (file: {{path}}). To fix this, in your Jest config change the `transform` key which value is `ts-jest` so that it does not match this kind of files anymore. If you still want Babel to process it, add another entry to the `transform` option with value `babel-jest` which key matches this type of files.";
Errors["ConfigNoModuleInterop"] = "If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.";
Errors["UnableToFindProjectRoot"] = "Unable to find the root of the project where ts-jest has been installed.";
Errors["UnableToResolveJestConfig"] = "Unable to resolve jest-config. Ensure Jest is properly installed.";
})(Errors = exports.Errors || (exports.Errors = {}));
var Helps;
(function (Helps) {
Helps["FixMissingModule"] = "{{label}}: `npm i -D {{module}}` (or `yarn add --dev {{module}}`)";
Helps["IgnoreDiagnosticCode"] = "customize using `[jest-config].globals.ts-jest.diagnostics` option";
Helps["MigrateConfigUsingCLI"] = "Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate <config-file>.";
})(Helps = exports.Helps || (exports.Helps = {}));
var Deprecateds;
(function (Deprecateds) {
Deprecateds["EnvVar"] = "Using env. var \"{{old}}\" is deprecated, use \"{{new}}\" instead.";
Deprecateds["ConfigOption"] = "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.";
Deprecateds["ConfigOptionWithNote"] = "\"[jest-config].{{oldPath}}\" is deprecated, use \"[jest-config].{{newPath}}\" instead.\n \u21B3 {{note}}";
Deprecateds["ConfigOptionUseBabelRcNote"] = "See `babel-jest` related issue: https://github.com/facebook/jest/issues/3845";
Deprecateds["HelperMovedToUtils"] = "The `{{helper}}` helper has been moved to `ts-jest/utils`. Use `import { {{helper}} } from 'ts-jest/utils'` instead.";
})(Deprecateds = exports.Deprecateds || (exports.Deprecateds = {}));
var ImportReasons;
(function (ImportReasons) {
ImportReasons["TsJest"] = "Using \"ts-jest\" requires this package to be installed.";
ImportReasons["BabelJest"] = "Using \"babel-jest\" requires this package to be installed.";
})(ImportReasons = exports.ImportReasons || (exports.ImportReasons = {}));
function interpolate(msg, vars) {
if (vars === void 0) { vars = {}; }
return msg.replace(/\{\{([^\}]+)\}\}/g, function (_, key) { return (key in vars ? vars[key] : _); });
}
exports.interpolate = interpolate;

View file

@ -0,0 +1 @@
export {};

6
node_modules/ts-jest/dist/util/normalize-slashes.js generated vendored Normal file
View file

@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function normalizeSlashes(value) {
return value.replace(/\\/g, '/');
}
exports.normalizeSlashes = normalizeSlashes;

1
node_modules/ts-jest/dist/util/sha1.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

31
node_modules/ts-jest/dist/util/sha1.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var crypto_1 = require("crypto");
exports.cache = Object.create(null);
function sha1() {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
var canCache = data.length === 1 && typeof data[0] === 'string';
var cacheKey;
if (canCache) {
cacheKey = data[0];
if (cacheKey in exports.cache) {
return exports.cache[cacheKey];
}
}
var hash = crypto_1.createHash('sha1');
data.forEach(function (item) {
if (typeof item === 'string')
hash.update(item, 'utf8');
else
hash.update(item);
});
var res = hash.digest('hex').toString();
if (canCache) {
exports.cache[cacheKey] = res;
}
return res;
}
exports.sha1 = sha1;

34
node_modules/ts-jest/dist/util/testing.d.ts generated vendored Normal file
View file

@ -0,0 +1,34 @@
/// <reference types="jest" />
declare type MockableFunction = (...args: any[]) => any;
declare type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends MockableFunction ? K : never;
}[keyof T];
declare type PropertyKeysOf<T> = {
[K in keyof T]: T[K] extends MockableFunction ? never : K;
}[keyof T];
declare type ArgumentsOf<T> = T extends (...args: infer A) => any ? A : never;
declare type ConstructorArgumentsOf<T> = T extends new (...args: infer A) => any ? A : never;
interface MockWithArgs<T extends MockableFunction> extends jest.MockInstance<ReturnType<T>, ArgumentsOf<T>> {
new (...args: ConstructorArgumentsOf<T>): T;
(...args: ArgumentsOf<T>): ReturnType<T>;
}
declare type MaybeMockedConstructor<T> = T extends new (...args: any[]) => infer R ? jest.MockInstance<R, ConstructorArgumentsOf<T>> : {};
declare type MockedFunction<T extends MockableFunction> = MockWithArgs<T> & {
[K in keyof T]: T[K];
};
declare type MockedFunctionDeep<T extends MockableFunction> = MockWithArgs<T> & MockedObjectDeep<T>;
declare type MockedObject<T> = MaybeMockedConstructor<T> & {
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunction<T[K]> : T[K];
} & {
[K in PropertyKeysOf<T>]: T[K];
};
declare type MockedObjectDeep<T> = MaybeMockedConstructor<T> & {
[K in MethodKeysOf<T>]: T[K] extends MockableFunction ? MockedFunctionDeep<T[K]> : T[K];
} & {
[K in PropertyKeysOf<T>]: MaybeMockedDeep<T[K]>;
};
export declare type MaybeMockedDeep<T> = T extends MockableFunction ? MockedFunctionDeep<T> : T extends object ? MockedObjectDeep<T> : T;
export declare type MaybeMocked<T> = T extends MockableFunction ? MockedFunction<T> : T extends object ? MockedObject<T> : T;
export declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
export declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
export {};

7
node_modules/ts-jest/dist/util/testing.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function mocked(item, _deep) {
if (_deep === void 0) { _deep = false; }
return item;
}
exports.mocked = mocked;

1
node_modules/ts-jest/dist/util/ts-error.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

41
node_modules/ts-jest/dist/util/ts-error.js generated vendored Normal file
View file

@ -0,0 +1,41 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var make_error_1 = require("make-error");
var util_1 = require("util");
var logger_1 = require("./logger");
var messages_1 = require("./messages");
var logger = logger_1.rootLogger.child({ namespace: 'TSError' });
exports.INSPECT_CUSTOM = util_1.inspect.custom || 'inspect';
var TSError = (function (_super) {
__extends(TSError, _super);
function TSError(diagnosticText, diagnosticCodes) {
var _this = _super.call(this, messages_1.interpolate(messages_1.Errors.UnableToCompileTypeScript, {
diagnostics: diagnosticText.trim(),
help: messages_1.Helps.IgnoreDiagnosticCode,
})) || this;
_this.diagnosticText = diagnosticText;
_this.diagnosticCodes = diagnosticCodes;
_this.name = 'TSError';
logger.debug({ diagnosticCodes: diagnosticCodes, diagnosticText: diagnosticText }, 'created new TSError');
Object.defineProperty(_this, 'stack', { value: '' });
return _this;
}
TSError.prototype[exports.INSPECT_CUSTOM] = function () {
return this.diagnosticText;
};
return TSError;
}(make_error_1.BaseError));
exports.TSError = TSError;

1
node_modules/ts-jest/dist/util/version-checkers.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

63
node_modules/ts-jest/dist/util/version-checkers.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var semver_1 = require("semver");
var get_package_version_1 = require("./get-package-version");
var logger_1 = require("./logger");
var messages_1 = require("./messages");
var logger = logger_1.rootLogger.child({ namespace: 'versions' });
var ExpectedVersions;
(function (ExpectedVersions) {
ExpectedVersions["Jest"] = ">=24 <25";
ExpectedVersions["TypeScript"] = ">=2.7 <4";
ExpectedVersions["BabelJest"] = ">=24 <25";
ExpectedVersions["BabelCore"] = ">=7.0.0-beta.0 <8";
})(ExpectedVersions = exports.ExpectedVersions || (exports.ExpectedVersions = {}));
exports.VersionCheckers = {
jest: createVersionChecker('jest', ExpectedVersions.Jest),
typescript: createVersionChecker('typescript', ExpectedVersions.TypeScript),
babelJest: createVersionChecker('babel-jest', ExpectedVersions.BabelJest),
babelCore: createVersionChecker('@babel/core', ExpectedVersions.BabelCore),
};
function checkVersion(name, expectedRange, action) {
if (action === void 0) { action = 'warn'; }
var version = get_package_version_1.getPackageVersion(name);
var success = !!version && semver_1.satisfies(version, expectedRange);
logger.debug({
actualVersion: version,
expectedVersion: expectedRange,
}, 'checking version of %s: %s', name, success ? 'OK' : 'NOT OK');
if (!action || success)
return success;
var message = messages_1.interpolate(version ? messages_1.Errors.UntestedDependencyVersion : messages_1.Errors.MissingDependency, {
module: name,
actualVersion: version || '??',
expectedVersion: rangeToHumanString(expectedRange),
});
if (action === 'warn') {
logger.warn(message);
}
else if (action === 'throw') {
logger.fatal(message);
throw new RangeError(message);
}
return success;
}
function rangeToHumanString(versionRange) {
return new semver_1.Range(versionRange).toString();
}
function createVersionChecker(moduleName, expectedVersion) {
var memo;
var warn = function () {
if (memo !== undefined)
return memo;
return (memo = checkVersion(moduleName, expectedVersion, 'warn'));
};
var raise = function () { return checkVersion(moduleName, expectedVersion, 'throw'); };
return {
raise: raise,
warn: warn,
forget: function () {
memo = undefined;
},
};
}

BIN
node_modules/ts-jest/icon.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

1
node_modules/ts-jest/jest-preset.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('./presets/default/jest-preset')

15
node_modules/ts-jest/node_modules/.bin/semver generated vendored Normal file
View file

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../semver/bin/semver" "$@"
ret=$?
else
node "$basedir/../semver/bin/semver" "$@"
ret=$?
fi
exit $ret

7
node_modules/ts-jest/node_modules/.bin/semver.cmd generated vendored Normal file
View file

@ -0,0 +1,7 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\semver\bin\semver" %*
)

64
node_modules/ts-jest/node_modules/camelcase/index.js generated vendored Normal file
View file

@ -0,0 +1,64 @@
'use strict';
function preserveCamelCase(str) {
let isLastCharLower = false;
let isLastCharUpper = false;
let isLastLastCharUpper = false;
for (let i = 0; i < str.length; i++) {
const c = str[i];
if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
str = str.substr(0, i) + '-' + str.substr(i);
isLastCharLower = false;
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = true;
i++;
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
str = str.substr(0, i - 1) + '-' + str.substr(i - 1);
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = false;
isLastCharLower = true;
} else {
isLastCharLower = c.toLowerCase() === c;
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = c.toUpperCase() === c;
}
}
return str;
}
module.exports = function (str) {
if (arguments.length > 1) {
str = Array.from(arguments)
.map(x => x.trim())
.filter(x => x.length)
.join('-');
} else {
str = str.trim();
}
if (str.length === 0) {
return '';
}
if (str.length === 1) {
return str.toLowerCase();
}
if (/^[a-z0-9]+$/.test(str)) {
return str;
}
const hasUpperCase = str !== str.toLowerCase();
if (hasUpperCase) {
str = preserveCamelCase(str);
}
return str
.replace(/^[_.\- ]+/, '')
.toLowerCase()
.replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase());
};

21
node_modules/ts-jest/node_modules/camelcase/license generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,74 @@
{
"_from": "camelcase@^4.1.0",
"_id": "camelcase@4.1.0",
"_inBundle": false,
"_integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
"_location": "/ts-jest/camelcase",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "camelcase@^4.1.0",
"name": "camelcase",
"escapedName": "camelcase",
"rawSpec": "^4.1.0",
"saveSpec": null,
"fetchSpec": "^4.1.0"
},
"_requiredBy": [
"/ts-jest/yargs-parser"
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
"_shasum": "d545635be1e33c542649c69173e5de6acfae34dd",
"_spec": "camelcase@^4.1.0",
"_where": "E:\\github\\setup-java\\node_modules\\ts-jest\\node_modules\\yargs-parser",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/camelcase#readme",
"keywords": [
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert"
],
"license": "MIT",
"name": "camelcase",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "4.1.0",
"xo": {
"esnext": true
}
}

57
node_modules/ts-jest/node_modules/camelcase/readme.md generated vendored Normal file
View file

@ -0,0 +1,57 @@
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar``fooBar`
## Install
```
$ npm install --save camelcase
```
## Usage
```js
const camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('--foo.bar');
//=> 'fooBar'
camelCase('__foo__bar__');
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase('foo', 'bar');
//=> 'fooBar'
camelCase('__foo__', '--bar');
//=> 'fooBar'
```
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

39
node_modules/ts-jest/node_modules/semver/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,39 @@
# changes log
## 5.7
* Add `minVersion` method
## 5.6
* Move boolean `loose` param to an options object, with
backwards-compatibility protection.
* Add ability to opt out of special prerelease version handling with
the `includePrerelease` option flag.
## 5.5
* Add version coercion capabilities
## 5.4
* Add intersection checking
## 5.3
* Add `minSatisfying` method
## 5.2
* Add `prerelease(v)` that returns prerelease components
## 5.1
* Add Backus-Naur for ranges
* Remove excessively cute inspection methods
## 5.0
* Remove AMD/Browserified build artifacts
* Fix ltr and gtr when using the `*` range
* Fix for range `*` with a prerelease identifier

15
node_modules/ts-jest/node_modules/semver/LICENSE generated vendored Normal file
View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

411
node_modules/ts-jest/node_modules/semver/README.md generated vendored Normal file
View file

@ -0,0 +1,411 @@
semver(1) -- The semantic versioner for npm
===========================================
## Install
```bash
npm install --save semver
````
## Usage
As a node module:
```js
const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```
As a command-line utility:
```
$ semver -h
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```
## Versions
A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
## Ranges
A `version range` is a set of `comparators` which specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional, but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version. The
version `3.4.5` *would* satisfy the range, because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose for this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range matching
semantics.
Second, a user who has opted into using a prerelease version has
clearly indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for the purpose of range
matching) by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any version satisfies)
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero digit in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0`
* `^0.2.3` := `>=0.2.3 <0.3.0`
* `^0.0.3` := `>=0.0.3 <0.0.4`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0`
* `^0.0.x` := `>=0.0.0 <0.1.0`
* `^0.0` := `>=0.0.0 <0.1.0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0`
* `^0.x` := `>=0.0.0 <1.0.0`
### Range Grammar
Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:
```bnf
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
```
## Functions
All methods and classes take a final `options` object argument. All
options in this object are `false` by default. The options supported
are:
- `loose` Be more forgiving about not-quite-valid semver strings.
(Any resulting output will always be 100% strict compliant, of
course.) For backwards compatibility reasons, if the `options`
argument is a boolean value instead of an object, it is interpreted
to be the `loose` param.
- `includePrerelease` Set to suppress the [default
behavior](https://github.com/npm/node-semver#prerelease-tags) of
excluding prerelease tagged versions from ranges unless they are
explicitly opted into.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, release)`: Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, or `prerelease`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, the `prerelease` will work the
same as `prepatch`. It increments the patch version, then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `prerelease(v)`: Returns an array of prerelease components, or null
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
a `SemVer` object or `null`.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the exact same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `diff(v1, v2)`: Returns difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Comparators
* `intersects(comparator)`: Return true if the comparators intersect
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can possibly match
the given range.
* `gtr(version, range)`: Return `true` if version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the ranges comparators intersect
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so the version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.
### Coercion
* `coerce(version)`: Coerces a string to semver if possible
This aims to provide a very forgiving translation of a non-semver
string to semver. It looks for the first digit in a string, and
consumes all remaining characters which satisfy at least a partial semver
(e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters).
Longer versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).
All surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`).
Only text which lacks digits will fail coercion (`version one` is not valid).
The maximum length for any semver component considered for coercion is 16 characters;
longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`).
The maximum value for any semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`;
higher value components are invalid (`9999999999999999.4.7.4` is likely invalid).

160
node_modules/ts-jest/node_modules/semver/bin/semver generated vendored Normal file
View file

@ -0,0 +1,160 @@
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.
var argv = process.argv.slice(2)
var versions = []
var range = []
var inc = null
var version = require('../package.json').version
var loose = false
var includePrerelease = false
var coerce = false
var identifier
var semver = require('../semver')
var reverse = false
var options = {}
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
var a = argv.shift()
var indexOfEqualSign = a.indexOf('=')
if (indexOfEqualSign !== -1) {
a = a.slice(0, indexOfEqualSign)
argv.unshift(a.slice(indexOfEqualSign + 1))
}
switch (a) {
case '-rv': case '-rev': case '--rev': case '--reverse':
reverse = true
break
case '-l': case '--loose':
loose = true
break
case '-p': case '--include-prerelease':
includePrerelease = true
break
case '-v': case '--version':
versions.push(argv.shift())
break
case '-i': case '--inc': case '--increment':
switch (argv[0]) {
case 'major': case 'minor': case 'patch': case 'prerelease':
case 'premajor': case 'preminor': case 'prepatch':
inc = argv.shift()
break
default:
inc = 'patch'
break
}
break
case '--preid':
identifier = argv.shift()
break
case '-r': case '--range':
range.push(argv.shift())
break
case '-c': case '--coerce':
coerce = true
break
case '-h': case '--help': case '-?':
return help()
default:
versions.push(a)
break
}
}
var options = { loose: loose, includePrerelease: includePrerelease }
versions = versions.map(function (v) {
return coerce ? (semver.coerce(v) || { version: v }).version : v
}).filter(function (v) {
return semver.valid(v)
})
if (!versions.length) return fail()
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
for (var i = 0, l = range.length; i < l; i++) {
versions = versions.filter(function (v) {
return semver.satisfies(v, range[i], options)
})
if (!versions.length) return fail()
}
return success(versions)
}
function failInc () {
console.error('--inc can only be used on a single version with no range')
fail()
}
function fail () { process.exit(1) }
function success () {
var compare = reverse ? 'rcompare' : 'compare'
versions.sort(function (a, b) {
return semver[compare](a, b, options)
}).map(function (v) {
return semver.clean(v, options)
}).map(function (v) {
return inc ? semver.inc(v, inc, options, identifier) : v
}).forEach(function (v, i, _) { console.log(v) })
}
function help () {
console.log(['SemVer ' + version,
'',
'A JavaScript implementation of the https://semver.org/ specification',
'Copyright Isaac Z. Schlueter',
'',
'Usage: semver [options] <version> [<version> [...]]',
'Prints valid versions sorted by SemVer precedence',
'',
'Options:',
'-r --range <range>',
' Print versions that match the specified range.',
'',
'-i --increment [<level>]',
' Increment a version by the specified level. Level can',
' be one of: major, minor, patch, premajor, preminor,',
" prepatch, or prerelease. Default level is 'patch'.",
' Only one version may be specified.',
'',
'--preid <identifier>',
' Identifier to be used to prefix premajor, preminor,',
' prepatch or prerelease version increments.',
'',
'-l --loose',
' Interpret versions and ranges loosely',
'',
'-p --include-prerelease',
' Always include prerelease versions in range matching',
'',
'-c --coerce',
' Coerce a string into SemVer if possible',
' (does not imply --loose)',
'',
'Program exits successfully if any valid version satisfies',
'all supplied ranges, and prints all satisfying versions.',
'',
'If no satisfying versions are found, then exits failure.',
'',
'Versions are printed in ascending order, so supplying',
'multiple versions to the utility will just sort them.'
].join('\n'))
}

60
node_modules/ts-jest/node_modules/semver/package.json generated vendored Normal file
View file

@ -0,0 +1,60 @@
{
"_from": "semver@^5.5",
"_id": "semver@5.7.0",
"_inBundle": false,
"_integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"_location": "/ts-jest/semver",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "semver@^5.5",
"name": "semver",
"escapedName": "semver",
"rawSpec": "^5.5",
"saveSpec": null,
"fetchSpec": "^5.5"
},
"_requiredBy": [
"/ts-jest"
],
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"_shasum": "790a7cf6fea5459bac96110b29b60412dc8ff96b",
"_spec": "semver@^5.5",
"_where": "E:\\github\\setup-java\\node_modules\\ts-jest",
"bin": {
"semver": "./bin/semver"
},
"bugs": {
"url": "https://github.com/npm/node-semver/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "The semantic version parser used by npm.",
"devDependencies": {
"tap": "^13.0.0-rc.18"
},
"files": [
"bin",
"range.bnf",
"semver.js"
],
"homepage": "https://github.com/npm/node-semver#readme",
"license": "ISC",
"main": "semver.js",
"name": "semver",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/node-semver.git"
},
"scripts": {
"postpublish": "git push origin --all; git push origin --tags",
"postversion": "npm publish",
"preversion": "npm test",
"test": "tap"
},
"tap": {
"check-coverage": true
},
"version": "5.7.0"
}

16
node_modules/ts-jest/node_modules/semver/range.bnf generated vendored Normal file
View file

@ -0,0 +1,16 @@
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | [1-9] ( [0-9] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+

1483
node_modules/ts-jest/node_modules/semver/semver.js generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,353 @@
# Change Log
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<a name="10.1.0"></a>
# [10.1.0](https://github.com/yargs/yargs-parser/compare/v10.0.0...v10.1.0) (2018-06-29)
### Features
* add `set-placeholder-key` configuration ([#123](https://github.com/yargs/yargs-parser/issues/123)) ([19386ee](https://github.com/yargs/yargs-parser/commit/19386ee))
<a name="10.0.0"></a>
# [10.0.0](https://github.com/yargs/yargs-parser/compare/v9.0.2...v10.0.0) (2018-04-04)
### Bug Fixes
* do not set boolean flags if not defined in `argv` ([#119](https://github.com/yargs/yargs-parser/issues/119)) ([f6e6599](https://github.com/yargs/yargs-parser/commit/f6e6599))
### BREAKING CHANGES
* `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg.
Previous behavior:
```js
var parse = require('yargs-parser');
parse('--flag', {boolean: ['flag']});
// => { _: [], flag: true }
parse('--no-flag', {boolean: ['flag']});
// => { _: [], flag: false }
parse('', {boolean: ['flag']});
// => { _: [], flag: false }
```
New behavior:
```js
var parse = require('yargs-parser');
parse('--flag', {boolean: ['flag']});
// => { _: [], flag: true }
parse('--no-flag', {boolean: ['flag']});
// => { _: [], flag: false }
parse('', {boolean: ['flag']});
// => { _: [] } => flag not set similarly to other option type
```
<a name="9.0.2"></a>
## [9.0.2](https://github.com/yargs/yargs-parser/compare/v9.0.1...v9.0.2) (2018-01-20)
### Bug Fixes
* nargs was still aggressively consuming too many arguments ([9b28aad](https://github.com/yargs/yargs-parser/commit/9b28aad))
<a name="9.0.1"></a>
## [9.0.1](https://github.com/yargs/yargs-parser/compare/v9.0.0...v9.0.1) (2018-01-20)
### Bug Fixes
* nargs was consuming too many arguments ([4fef206](https://github.com/yargs/yargs-parser/commit/4fef206))
<a name="9.0.0"></a>
# [9.0.0](https://github.com/yargs/yargs-parser/compare/v8.1.0...v9.0.0) (2018-01-20)
### Features
* narg arguments no longer consume flag arguments ([#114](https://github.com/yargs/yargs-parser/issues/114)) ([60bb9b3](https://github.com/yargs/yargs-parser/commit/60bb9b3))
### BREAKING CHANGES
* arguments of form --foo, -abc, will no longer be consumed by nargs
<a name="8.1.0"></a>
# [8.1.0](https://github.com/yargs/yargs-parser/compare/v8.0.0...v8.1.0) (2017-12-20)
### Bug Fixes
* allow null config values ([#108](https://github.com/yargs/yargs-parser/issues/108)) ([d8b14f9](https://github.com/yargs/yargs-parser/commit/d8b14f9))
* ensure consistent parsing of dot-notation arguments ([#102](https://github.com/yargs/yargs-parser/issues/102)) ([c9bd79c](https://github.com/yargs/yargs-parser/commit/c9bd79c))
* implement [@antoniom](https://github.com/antoniom)'s fix for camel-case expansion ([3087e1d](https://github.com/yargs/yargs-parser/commit/3087e1d))
* only run coercion functions once, despite aliases. ([#76](https://github.com/yargs/yargs-parser/issues/76)) ([#103](https://github.com/yargs/yargs-parser/issues/103)) ([507aaef](https://github.com/yargs/yargs-parser/commit/507aaef))
* scientific notation circumvented bounds check ([#110](https://github.com/yargs/yargs-parser/issues/110)) ([3571f57](https://github.com/yargs/yargs-parser/commit/3571f57))
* tokenizer should ignore spaces at the beginning of the argString ([#106](https://github.com/yargs/yargs-parser/issues/106)) ([f34ead9](https://github.com/yargs/yargs-parser/commit/f34ead9))
### Features
* make combining arrays a configurable option ([#111](https://github.com/yargs/yargs-parser/issues/111)) ([c8bf536](https://github.com/yargs/yargs-parser/commit/c8bf536))
* merge array from arguments with array from config ([#83](https://github.com/yargs/yargs-parser/issues/83)) ([806ddd6](https://github.com/yargs/yargs-parser/commit/806ddd6))
<a name="8.0.0"></a>
# [8.0.0](https://github.com/yargs/yargs-parser/compare/v7.0.0...v8.0.0) (2017-10-05)
### Bug Fixes
* Ignore multiple spaces between arguments. ([#100](https://github.com/yargs/yargs-parser/issues/100)) ([d137227](https://github.com/yargs/yargs-parser/commit/d137227))
### Features
* allow configuration of prefix for boolean negation ([#94](https://github.com/yargs/yargs-parser/issues/94)) ([00bde7d](https://github.com/yargs/yargs-parser/commit/00bde7d))
* reworking how numbers are parsed ([#104](https://github.com/yargs/yargs-parser/issues/104)) ([fba00eb](https://github.com/yargs/yargs-parser/commit/fba00eb))
### BREAKING CHANGES
* strings that fail `Number.isSafeInteger()` are no longer coerced into numbers.
<a name="7.0.0"></a>
# [7.0.0](https://github.com/yargs/yargs-parser/compare/v6.0.1...v7.0.0) (2017-05-02)
### Chores
* revert populate-- logic ([#91](https://github.com/yargs/yargs-parser/issues/91)) ([6003e6d](https://github.com/yargs/yargs-parser/commit/6003e6d))
### BREAKING CHANGES
* populate-- now defaults to false.
<a name="6.0.1"></a>
## [6.0.1](https://github.com/yargs/yargs-parser/compare/v6.0.0...v6.0.1) (2017-05-01)
### Bug Fixes
* default '--' to undefined when not provided; this is closer to the array API ([#90](https://github.com/yargs/yargs-parser/issues/90)) ([4e739cc](https://github.com/yargs/yargs-parser/commit/4e739cc))
<a name="6.0.0"></a>
# [6.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v6.0.0) (2017-05-01)
### Bug Fixes
* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f))
* parsing hints should apply for dot notation keys ([#86](https://github.com/yargs/yargs-parser/issues/86)) ([3e47d62](https://github.com/yargs/yargs-parser/commit/3e47d62))
### Chores
* upgrade to newest version of camelcase ([#87](https://github.com/yargs/yargs-parser/issues/87)) ([f1903aa](https://github.com/yargs/yargs-parser/commit/f1903aa))
### Features
* add -- option which allows arguments after the -- flag to be returned separated from positional arguments ([#84](https://github.com/yargs/yargs-parser/issues/84)) ([2572ca8](https://github.com/yargs/yargs-parser/commit/2572ca8))
* when parsing stops, we now populate "--" by default ([#88](https://github.com/yargs/yargs-parser/issues/88)) ([cd666db](https://github.com/yargs/yargs-parser/commit/cd666db))
### BREAKING CHANGES
* rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default.
* camelcase now requires Node 4+.
* environment variables will now override config files (args, env, config-file, config-object)
<a name="5.0.0"></a>
# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18)
### Bug Fixes
* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f))
### BREAKING CHANGES
* environment variables will now override config files (args, env, config-file, config-object)
<a name="4.2.1"></a>
## [4.2.1](https://github.com/yargs/yargs-parser/compare/v4.2.0...v4.2.1) (2017-01-02)
### Bug Fixes
* flatten/duplicate regression ([#75](https://github.com/yargs/yargs-parser/issues/75)) ([68d68a0](https://github.com/yargs/yargs-parser/commit/68d68a0))
<a name="4.2.0"></a>
# [4.2.0](https://github.com/yargs/yargs-parser/compare/v4.1.0...v4.2.0) (2016-12-01)
### Bug Fixes
* inner objects in configs had their keys appended to top-level key when dot-notation was disabled ([#72](https://github.com/yargs/yargs-parser/issues/72)) ([0b1b5f9](https://github.com/yargs/yargs-parser/commit/0b1b5f9))
### Features
* allow multiple arrays to be provided, rather than always combining ([#71](https://github.com/yargs/yargs-parser/issues/71)) ([0f0fb2d](https://github.com/yargs/yargs-parser/commit/0f0fb2d))
<a name="4.1.0"></a>
# [4.1.0](https://github.com/yargs/yargs-parser/compare/v4.0.2...v4.1.0) (2016-11-07)
### Features
* apply coercions to default options ([#65](https://github.com/yargs/yargs-parser/issues/65)) ([c79052b](https://github.com/yargs/yargs-parser/commit/c79052b))
* handle dot notation boolean options ([#63](https://github.com/yargs/yargs-parser/issues/63)) ([02c3545](https://github.com/yargs/yargs-parser/commit/02c3545))
<a name="4.0.2"></a>
## [4.0.2](https://github.com/yargs/yargs-parser/compare/v4.0.1...v4.0.2) (2016-09-30)
### Bug Fixes
* whoops, let's make the assign not change the Object key order ([29d069a](https://github.com/yargs/yargs-parser/commit/29d069a))
<a name="4.0.1"></a>
## [4.0.1](https://github.com/yargs/yargs-parser/compare/v4.0.0...v4.0.1) (2016-09-30)
### Bug Fixes
* lodash.assign was deprecated ([#59](https://github.com/yargs/yargs-parser/issues/59)) ([5e7eb11](https://github.com/yargs/yargs-parser/commit/5e7eb11))
<a name="4.0.0"></a>
# [4.0.0](https://github.com/yargs/yargs-parser/compare/v3.2.0...v4.0.0) (2016-09-26)
### Bug Fixes
* coerce should be applied to the final objects and arrays created ([#57](https://github.com/yargs/yargs-parser/issues/57)) ([4ca69da](https://github.com/yargs/yargs-parser/commit/4ca69da))
### BREAKING CHANGES
* coerce is no longer applied to individual arguments in an implicit array.
<a name="3.2.0"></a>
# [3.2.0](https://github.com/yargs/yargs-parser/compare/v3.1.0...v3.2.0) (2016-08-13)
### Features
* coerce full array instead of each element ([#51](https://github.com/yargs/yargs-parser/issues/51)) ([cc4dc56](https://github.com/yargs/yargs-parser/commit/cc4dc56))
<a name="3.1.0"></a>
# [3.1.0](https://github.com/yargs/yargs-parser/compare/v3.0.0...v3.1.0) (2016-08-09)
### Bug Fixes
* address pkgConf parsing bug outlined in [#37](https://github.com/yargs/yargs-parser/issues/37) ([#45](https://github.com/yargs/yargs-parser/issues/45)) ([be76ee6](https://github.com/yargs/yargs-parser/commit/be76ee6))
* better parsing of negative values ([#44](https://github.com/yargs/yargs-parser/issues/44)) ([2e43692](https://github.com/yargs/yargs-parser/commit/2e43692))
* check aliases when guessing defaults for arguments fixes [#41](https://github.com/yargs/yargs-parser/issues/41) ([#43](https://github.com/yargs/yargs-parser/issues/43)) ([f3e4616](https://github.com/yargs/yargs-parser/commit/f3e4616))
### Features
* added coerce option, for providing specialized argument parsing ([#42](https://github.com/yargs/yargs-parser/issues/42)) ([7b49cd2](https://github.com/yargs/yargs-parser/commit/7b49cd2))
<a name="3.0.0"></a>
# [3.0.0](https://github.com/yargs/yargs-parser/compare/v2.4.1...v3.0.0) (2016-08-07)
### Bug Fixes
* parsing issue with numeric character in group of options ([#19](https://github.com/yargs/yargs-parser/issues/19)) ([f743236](https://github.com/yargs/yargs-parser/commit/f743236))
* upgraded lodash.assign ([5d7fdf4](https://github.com/yargs/yargs-parser/commit/5d7fdf4))
### BREAKING CHANGES
* subtle change to how values are parsed in a group of single-character arguments.
* _first released in 3.1.0, better handling of negative values should be considered a breaking change._
<a name="2.4.1"></a>
## [2.4.1](https://github.com/yargs/yargs-parser/compare/v2.4.0...v2.4.1) (2016-07-16)
### Bug Fixes
* **count:** do not increment a default value ([#39](https://github.com/yargs/yargs-parser/issues/39)) ([b04a189](https://github.com/yargs/yargs-parser/commit/b04a189))
<a name="2.4.0"></a>
# [2.4.0](https://github.com/yargs/yargs-parser/compare/v2.3.0...v2.4.0) (2016-04-11)
### Features
* **environment:** Support nested options in environment variables ([#26](https://github.com/yargs/yargs-parser/issues/26)) thanks [@elas7](https://github.com/elas7) \o/ ([020778b](https://github.com/yargs/yargs-parser/commit/020778b))
<a name="2.3.0"></a>
# [2.3.0](https://github.com/yargs/yargs-parser/compare/v2.2.0...v2.3.0) (2016-04-09)
### Bug Fixes
* **boolean:** fix for boolean options with non boolean defaults (#20) ([2dbe86b](https://github.com/yargs/yargs-parser/commit/2dbe86b)), closes [(#20](https://github.com/(/issues/20)
* **package:** remove tests from tarball ([0353c0d](https://github.com/yargs/yargs-parser/commit/0353c0d))
* **parsing:** handle calling short option with an empty string as the next value. ([a867165](https://github.com/yargs/yargs-parser/commit/a867165))
* boolean flag when next value contains the strings 'true' or 'false'. ([69941a6](https://github.com/yargs/yargs-parser/commit/69941a6))
* update dependencies; add standard-version bin for next release (#24) ([822d9d5](https://github.com/yargs/yargs-parser/commit/822d9d5))
### Features
* **configuration:** Allow to pass configuration objects to yargs-parser ([0780900](https://github.com/yargs/yargs-parser/commit/0780900))
* **normalize:** allow normalize to work with arrays ([e0eaa1a](https://github.com/yargs/yargs-parser/commit/e0eaa1a))

View file

@ -0,0 +1,14 @@
Copyright (c) 2016, Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -0,0 +1,329 @@
# yargs-parser
[![Build Status](https://travis-ci.org/yargs/yargs-parser.png)](https://travis-ci.org/yargs/yargs-parser)
[![Coverage Status](https://coveralls.io/repos/yargs/yargs-parser/badge.svg?branch=)](https://coveralls.io/r/yargs/yargs-parser?branch=master)
[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser)
[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/yargs-parser/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/yargs-parser)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
The mighty option parser used by [yargs](https://github.com/yargs/yargs).
visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png">
## Example
```sh
npm i yargs-parser --save
```
```js
var argv = require('yargs-parser')(process.argv.slice(2))
console.log(argv)
```
```sh
node example.js --foo=33 --bar hello
{ _: [], foo: 33, bar: 'hello' }
```
_or parse a string!_
```js
var argv = require('./')('--foo=99 --bar=33')
console.log(argv)
```
```sh
{ _: [], foo: 99, bar: 33 }
```
Convert an array of mixed types before passing to `yargs-parser`:
```js
var parse = require('yargs-parser')
parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string
parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings
```
## API
### require('yargs-parser')(args, opts={})
Parses command line arguments returning a simple mapping of keys and values.
**expects:**
* `args`: a string or array of strings representing the options to parse.
* `opts`: provide a set of hints indicating how `args` should be parsed:
* `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`.
* `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
* `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`.
* `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed).
* `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided
(or throws an error), e.g. `{coerce: {foo: function (arg) {return modifiedArg}}}`.
* `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`.
* `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`.
* `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed.
* `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`.
* `opts.normalize`: `path.normalize()` will be applied to values set to this key.
* `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
* `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
* `opts.number`: keys should be treated as numbers.
* `opts['--']`: arguments after the end-of-options flag `--` will be set to the `argv.['--']` array instead of being set to the `argv._` array.
**returns:**
* `obj`: an object representing the parsed value of `args`
* `key/value`: key value pairs for each argument and their aliases.
* `_`: an array representing the positional arguments.
* [optional] `--`: an array with arguments after the end-of-options flag `--`.
### require('yargs-parser').detailed(args, opts={})
Parses a command line string, returning detailed information required by the
yargs engine.
**expects:**
* `args`: a string or array of strings representing options to parse.
* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`.
**returns:**
* `argv`: an object representing the parsed value of `args`
* `key/value`: key value pairs for each argument and their aliases.
* `_`: an array representing the positional arguments.
* `error`: populated with an error object if an exception occurred during parsing.
* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`.
* `newAliases`: any new aliases added via camel-case expansion.
* `configuration`: the configuration loaded from the `yargs` stanza in package.json.
<a name="configuration"></a>
### Configuration
The yargs-parser applies several automated transformations on the keys provided
in `args`. These features can be turned on and off using the `configuration` field
of `opts`.
```js
var parsed = parser(['--no-dice'], {
configuration: {
'boolean-negation': false
}
})
```
### short option groups
* default: `true`.
* key: `short-option-groups`.
Should a group of short-options be treated as boolean flags?
```sh
node example.js -abc
{ _: [], a: true, b: true, c: true }
```
_if disabled:_
```sh
node example.js -abc
{ _: [], abc: true }
```
### camel-case expansion
* default: `true`.
* key: `camel-case-expansion`.
Should hyphenated arguments be expanded into camel-case aliases?
```sh
node example.js --foo-bar
{ _: [], 'foo-bar': true, fooBar: true }
```
_if disabled:_
```sh
node example.js --foo-bar
{ _: [], 'foo-bar': true }
```
### dot-notation
* default: `true`
* key: `dot-notation`
Should keys that contain `.` be treated as objects?
```sh
node example.js --foo.bar
{ _: [], foo: { bar: true } }
```
_if disabled:_
```sh
node example.js --foo.bar
{ _: [], "foo.bar": true }
```
### parse numbers
* default: `true`
* key: `parse-numbers`
Should keys that look like numbers be treated as such?
```sh
node example.js --foo=99.3
{ _: [], foo: 99.3 }
```
_if disabled:_
```sh
node example.js --foo=99.3
{ _: [], foo: "99.3" }
```
### boolean negation
* default: `true`
* key: `boolean-negation`
Should variables prefixed with `--no` be treated as negations?
```sh
node example.js --no-foo
{ _: [], foo: false }
```
_if disabled:_
```sh
node example.js --no-foo
{ _: [], "no-foo": true }
```
### combine arrays
* default: `false`
* key: `combine-arrays`
Should arrays be combined when provided by both command line arguments and
a configuration file.
### duplicate arguments array
* default: `true`
* key: `duplicate-arguments-array`
Should arguments be coerced into an array when duplicated:
```sh
node example.js -x 1 -x 2
{ _: [], x: [1, 2] }
```
_if disabled:_
```sh
node example.js -x 1 -x 2
{ _: [], x: 2 }
```
### flatten duplicate arrays
* default: `true`
* key: `flatten-duplicate-arrays`
Should array arguments be coerced into a single array when duplicated:
```sh
node example.js -x 1 2 -x 3 4
{ _: [], x: [1, 2, 3, 4] }
```
_if disabled:_
```sh
node example.js -x 1 2 -x 3 4
{ _: [], x: [[1, 2], [3, 4]] }
```
### negation prefix
* default: `no-`
* key: `negation-prefix`
The prefix to use for negated boolean variables.
```sh
node example.js --no-foo
{ _: [], foo: false }
```
_if set to `quux`:_
```sh
node example.js --quuxfoo
{ _: [], foo: false }
```
### populate --
* default: `false`.
* key: `populate--`
Should unparsed flags be stored in `--` or `_`.
_If disabled:_
```sh
node example.js a -b -- x y
{ _: [ 'a', 'x', 'y' ], b: true }
```
_If enabled:_
```sh
node example.js a -b -- x y
{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
```
### set placeholder key
* default: `false`.
* key: `set-placeholder-key`.
Should a placeholder be added for keys not set via the corresponding CLI argument?
_If disabled:_
```sh
node example.js -a 1 -c 2
{ _: [], a: 1, c: 2 }
```
_If enabled:_
```sh
node example.js -a 1 -c 2
{ _: [], a: 1, b: undefined, c: 2 }
```
## Special Thanks
The yargs project evolves from optimist and minimist. It owes its
existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/
## License
ISC

833
node_modules/ts-jest/node_modules/yargs-parser/index.js generated vendored Normal file
View file

@ -0,0 +1,833 @@
var camelCase = require('camelcase')
var path = require('path')
var tokenizeArgString = require('./lib/tokenize-arg-string')
var util = require('util')
function parse (args, opts) {
if (!opts) opts = {}
// allow a string argument to be passed in rather
// than an argv array.
args = tokenizeArgString(args)
// aliases might have transitive relationships, normalize this.
var aliases = combineAliases(opts.alias || {})
var configuration = assign({
'short-option-groups': true,
'camel-case-expansion': true,
'dot-notation': true,
'parse-numbers': true,
'boolean-negation': true,
'negation-prefix': 'no-',
'duplicate-arguments-array': true,
'flatten-duplicate-arrays': true,
'populate--': false,
'combine-arrays': false,
'set-placeholder-key': false
}, opts.configuration)
var defaults = opts.default || {}
var configObjects = opts.configObjects || []
var envPrefix = opts.envPrefix
var notFlagsOption = configuration['populate--']
var notFlagsArgv = notFlagsOption ? '--' : '_'
var newAliases = {}
// allow a i18n handler to be passed in, default to a fake one (util.format).
var __ = opts.__ || function (str) {
return util.format.apply(util, Array.prototype.slice.call(arguments))
}
var error = null
var flags = {
aliases: {},
arrays: {},
bools: {},
strings: {},
numbers: {},
counts: {},
normalize: {},
configs: {},
defaulted: {},
nargs: {},
coercions: {},
keys: []
}
var negative = /^-[0-9]+(\.[0-9]+)?/
var negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)')
;[].concat(opts.array).filter(Boolean).forEach(function (key) {
flags.arrays[key] = true
flags.keys.push(key)
})
;[].concat(opts.boolean).filter(Boolean).forEach(function (key) {
flags.bools[key] = true
flags.keys.push(key)
})
;[].concat(opts.string).filter(Boolean).forEach(function (key) {
flags.strings[key] = true
flags.keys.push(key)
})
;[].concat(opts.number).filter(Boolean).forEach(function (key) {
flags.numbers[key] = true
flags.keys.push(key)
})
;[].concat(opts.count).filter(Boolean).forEach(function (key) {
flags.counts[key] = true
flags.keys.push(key)
})
;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
flags.normalize[key] = true
flags.keys.push(key)
})
Object.keys(opts.narg || {}).forEach(function (k) {
flags.nargs[k] = opts.narg[k]
flags.keys.push(k)
})
Object.keys(opts.coerce || {}).forEach(function (k) {
flags.coercions[k] = opts.coerce[k]
flags.keys.push(k)
})
if (Array.isArray(opts.config) || typeof opts.config === 'string') {
;[].concat(opts.config).filter(Boolean).forEach(function (key) {
flags.configs[key] = true
})
} else {
Object.keys(opts.config || {}).forEach(function (k) {
flags.configs[k] = opts.config[k]
})
}
// create a lookup table that takes into account all
// combinations of aliases: {f: ['foo'], foo: ['f']}
extendAliases(opts.key, aliases, opts.default, flags.arrays)
// apply default values to all aliases.
Object.keys(defaults).forEach(function (key) {
(flags.aliases[key] || []).forEach(function (alias) {
defaults[alias] = defaults[key]
})
})
var argv = { _: [] }
Object.keys(flags.bools).forEach(function (key) {
if (Object.prototype.hasOwnProperty.call(defaults, key)) {
setArg(key, defaults[key])
setDefaulted(key)
}
})
var notFlags = []
if (args.indexOf('--') !== -1) {
notFlags = args.slice(args.indexOf('--') + 1)
args = args.slice(0, args.indexOf('--'))
}
for (var i = 0; i < args.length; i++) {
var arg = args[i]
var broken
var key
var letters
var m
var next
var value
// -- seperated by =
if (arg.match(/^--.+=/) || (
!configuration['short-option-groups'] && arg.match(/^-.+=/)
)) {
// Using [\s\S] instead of . because js doesn't support the
// 'dotall' regex modifier. See:
// http://stackoverflow.com/a/1068308/13216
m = arg.match(/^--?([^=]+)=([\s\S]*)$/)
// nargs format = '--f=monkey washing cat'
if (checkAllAliases(m[1], flags.nargs)) {
args.splice(i + 1, 0, m[2])
i = eatNargs(i, m[1], args)
// arrays format = '--f=a b c'
} else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
args.splice(i + 1, 0, m[2])
i = eatArray(i, m[1], args)
} else {
setArg(m[1], m[2])
}
} else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
key = arg.match(negatedBoolean)[1]
setArg(key, false)
// -- seperated by space.
} else if (arg.match(/^--.+/) || (
!configuration['short-option-groups'] && arg.match(/^-.+/)
)) {
key = arg.match(/^--?(.+)/)[1]
// nargs format = '--foo a b c'
if (checkAllAliases(key, flags.nargs)) {
i = eatNargs(i, key, args)
// array format = '--foo a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
i = eatArray(i, key, args)
} else {
next = args[i + 1]
if (next !== undefined && (!next.match(/^-/) ||
next.match(negative)) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, next)
i++
} else if (/^(true|false)$/.test(next)) {
setArg(key, next)
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
}
// dot-notation flag seperated by '='.
} else if (arg.match(/^-.\..+=/)) {
m = arg.match(/^-([^=]+)=([\s\S]*)$/)
setArg(m[1], m[2])
// dot-notation flag seperated by space.
} else if (arg.match(/^-.\..+/)) {
next = args[i + 1]
key = arg.match(/^-(.\..+)/)[1]
if (next !== undefined && !next.match(/^-/) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, next)
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
} else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
letters = arg.slice(1, -1).split('')
broken = false
for (var j = 0; j < letters.length; j++) {
next = arg.slice(j + 2)
if (letters[j + 1] && letters[j + 1] === '=') {
value = arg.slice(j + 3)
key = letters[j]
// nargs format = '-f=monkey washing cat'
if (checkAllAliases(key, flags.nargs)) {
args.splice(i + 1, 0, value)
i = eatNargs(i, key, args)
// array format = '-f=a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
args.splice(i + 1, 0, value)
i = eatArray(i, key, args)
} else {
setArg(key, value)
}
broken = true
break
}
if (next === '-') {
setArg(letters[j], next)
continue
}
// current letter is an alphabetic character and next value is a number
if (/[A-Za-z]/.test(letters[j]) &&
/^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
setArg(letters[j], next)
broken = true
break
}
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
setArg(letters[j], next)
broken = true
break
} else {
setArg(letters[j], defaultForType(guessType(letters[j], flags)))
}
}
key = arg.slice(-1)[0]
if (!broken && key !== '-') {
// nargs format = '-f a b c'
if (checkAllAliases(key, flags.nargs)) {
i = eatNargs(i, key, args)
// array format = '-f a b c'
} else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
i = eatArray(i, key, args)
} else {
next = args[i + 1]
if (next !== undefined && (!/^(-|--)[^-]/.test(next) ||
next.match(negative)) &&
!checkAllAliases(key, flags.bools) &&
!checkAllAliases(key, flags.counts)) {
setArg(key, next)
i++
} else if (/^(true|false)$/.test(next)) {
setArg(key, next)
i++
} else {
setArg(key, defaultForType(guessType(key, flags)))
}
}
}
} else {
argv._.push(maybeCoerceNumber('_', arg))
}
}
// order of precedence:
// 1. command line arg
// 2. value from env var
// 3. value from config file
// 4. value from config objects
// 5. configured default value
applyEnvVars(argv, true) // special case: check env vars that point to config file
applyEnvVars(argv, false)
setConfig(argv)
setConfigObjects()
applyDefaultsAndAliases(argv, flags.aliases, defaults)
applyCoercions(argv)
if (configuration['set-placeholder-key']) setPlaceholderKeys(argv)
// for any counts either not in args or without an explicit default, set to 0
Object.keys(flags.counts).forEach(function (key) {
if (!hasKey(argv, key.split('.'))) setArg(key, 0)
})
// '--' defaults to undefined.
if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []
notFlags.forEach(function (key) {
argv[notFlagsArgv].push(key)
})
// how many arguments should we consume, based
// on the nargs option?
function eatNargs (i, key, args) {
var ii
const toEat = checkAllAliases(key, flags.nargs)
// nargs will not consume flag arguments, e.g., -abc, --foo,
// and terminates when one is observed.
var available = 0
for (ii = i + 1; ii < args.length; ii++) {
if (!args[ii].match(/^-[^0-9]/)) available++
else break
}
if (available < toEat) error = Error(__('Not enough arguments following: %s', key))
const consumed = Math.min(available, toEat)
for (ii = i + 1; ii < (consumed + i + 1); ii++) {
setArg(key, args[ii])
}
return (i + consumed)
}
// if an option is an array, eat all non-hyphenated arguments
// following it... YUM!
// e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
function eatArray (i, key, args) {
var start = i + 1
var argsToSet = []
var multipleArrayFlag = i > 0
for (var ii = i + 1; ii < args.length; ii++) {
if (/^-/.test(args[ii]) && !negative.test(args[ii])) {
if (ii === start) {
setArg(key, defaultForType('array'))
}
multipleArrayFlag = true
break
}
i = ii
argsToSet.push(args[ii])
}
if (multipleArrayFlag) {
setArg(key, argsToSet.map(function (arg) {
return processValue(key, arg)
}))
} else {
argsToSet.forEach(function (arg) {
setArg(key, arg)
})
}
return i
}
function setArg (key, val) {
unsetDefaulted(key)
if (/-/.test(key) && configuration['camel-case-expansion']) {
addNewAlias(key, camelCase(key))
}
var value = processValue(key, val)
var splitKey = key.split('.')
setKey(argv, splitKey, value)
// handle populating aliases of the full key
if (flags.aliases[key]) {
flags.aliases[key].forEach(function (x) {
x = x.split('.')
setKey(argv, x, value)
})
}
// handle populating aliases of the first element of the dot-notation key
if (splitKey.length > 1 && configuration['dot-notation']) {
;(flags.aliases[splitKey[0]] || []).forEach(function (x) {
x = x.split('.')
// expand alias with nested objects in key
var a = [].concat(splitKey)
a.shift() // nuke the old key.
x = x.concat(a)
setKey(argv, x, value)
})
}
// Set normalize getter and setter when key is in 'normalize' but isn't an array
if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
var keys = [key].concat(flags.aliases[key] || [])
keys.forEach(function (key) {
argv.__defineSetter__(key, function (v) {
val = path.normalize(v)
})
argv.__defineGetter__(key, function () {
return typeof val === 'string' ? path.normalize(val) : val
})
})
}
}
function addNewAlias (key, alias) {
if (!(flags.aliases[key] && flags.aliases[key].length)) {
flags.aliases[key] = [alias]
newAliases[alias] = true
}
if (!(flags.aliases[alias] && flags.aliases[alias].length)) {
addNewAlias(alias, key)
}
}
function processValue (key, val) {
// handle parsing boolean arguments --foo=true --bar false.
if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
if (typeof val === 'string') val = val === 'true'
}
var value = maybeCoerceNumber(key, val)
// increment a count given as arg (either no value or value parsed as boolean)
if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) {
value = increment
}
// Set normalized value when key is in 'normalize' and in 'arrays'
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
if (Array.isArray(val)) value = val.map(path.normalize)
else value = path.normalize(val)
}
return value
}
function maybeCoerceNumber (key, value) {
if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.coercions)) {
const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && (
Number.isSafeInteger(Math.floor(value))
)
if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) value = Number(value)
}
return value
}
// set args from config.json file, this should be
// applied last so that defaults can be applied.
function setConfig (argv) {
var configLookup = {}
// expand defaults/aliases, in-case any happen to reference
// the config.json file.
applyDefaultsAndAliases(configLookup, flags.aliases, defaults)
Object.keys(flags.configs).forEach(function (configKey) {
var configPath = argv[configKey] || configLookup[configKey]
if (configPath) {
try {
var config = null
var resolvedConfigPath = path.resolve(process.cwd(), configPath)
if (typeof flags.configs[configKey] === 'function') {
try {
config = flags.configs[configKey](resolvedConfigPath)
} catch (e) {
config = e
}
if (config instanceof Error) {
error = config
return
}
} else {
config = require(resolvedConfigPath)
}
setConfigObject(config)
} catch (ex) {
if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
}
}
})
}
// set args from config object.
// it recursively checks nested objects.
function setConfigObject (config, prev) {
Object.keys(config).forEach(function (key) {
var value = config[key]
var fullKey = prev ? prev + '.' + key : key
// if the value is an inner object and we have dot-notation
// enabled, treat inner objects in config the same as
// heavily nested dot notations (foo.bar.apple).
if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
// if the value is an object but not an array, check nested object
setConfigObject(value, fullKey)
} else {
// setting arguments via CLI takes precedence over
// values within the config file.
if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
setArg(fullKey, value)
}
}
})
}
// set all config objects passed in opts
function setConfigObjects () {
if (typeof configObjects === 'undefined') return
configObjects.forEach(function (configObject) {
setConfigObject(configObject)
})
}
function applyEnvVars (argv, configOnly) {
if (typeof envPrefix === 'undefined') return
var prefix = typeof envPrefix === 'string' ? envPrefix : ''
Object.keys(process.env).forEach(function (envVar) {
if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
// get array of nested keys and convert them to camel case
var keys = envVar.split('__').map(function (key, i) {
if (i === 0) {
key = key.substring(prefix.length)
}
return camelCase(key)
})
if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && (!hasKey(argv, keys) || flags.defaulted[keys.join('.')])) {
setArg(keys.join('.'), process.env[envVar])
}
}
})
}
function applyCoercions (argv) {
var coerce
var applied = {}
Object.keys(argv).forEach(function (key) {
if (!applied.hasOwnProperty(key)) { // If we haven't already coerced this option via one of its aliases
coerce = checkAllAliases(key, flags.coercions)
if (typeof coerce === 'function') {
try {
var value = coerce(argv[key])
;([].concat(flags.aliases[key] || [], key)).forEach(ali => {
applied[ali] = argv[ali] = value
})
} catch (err) {
error = err
}
}
}
})
}
function setPlaceholderKeys (argv) {
flags.keys.forEach((key) => {
// don't set placeholder keys for dot notation options 'foo.bar'.
if (~key.indexOf('.')) return
if (typeof argv[key] === 'undefined') argv[key] = undefined
})
return argv
}
function applyDefaultsAndAliases (obj, aliases, defaults) {
Object.keys(defaults).forEach(function (key) {
if (!hasKey(obj, key.split('.'))) {
setKey(obj, key.split('.'), defaults[key])
;(aliases[key] || []).forEach(function (x) {
if (hasKey(obj, x.split('.'))) return
setKey(obj, x.split('.'), defaults[key])
})
}
})
}
function hasKey (obj, keys) {
var o = obj
if (!configuration['dot-notation']) keys = [keys.join('.')]
keys.slice(0, -1).forEach(function (key) {
o = (o[key] || {})
})
var key = keys[keys.length - 1]
if (typeof o !== 'object') return false
else return key in o
}
function setKey (obj, keys, value) {
var o = obj
if (!configuration['dot-notation']) keys = [keys.join('.')]
keys.slice(0, -1).forEach(function (key, index) {
if (typeof o === 'object' && o[key] === undefined) {
o[key] = {}
}
if (typeof o[key] !== 'object' || Array.isArray(o[key])) {
// ensure that o[key] is an array, and that the last item is an empty object.
if (Array.isArray(o[key])) {
o[key].push({})
} else {
o[key] = [o[key], {}]
}
// we want to update the empty object at the end of the o[key] array, so set o to that object
o = o[key][o[key].length - 1]
} else {
o = o[key]
}
})
var key = keys[keys.length - 1]
var isTypeArray = checkAllAliases(keys.join('.'), flags.arrays)
var isValueArray = Array.isArray(value)
var duplicate = configuration['duplicate-arguments-array']
if (value === increment) {
o[key] = increment(o[key])
} else if (Array.isArray(o[key])) {
if (duplicate && isTypeArray && isValueArray) {
o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : [o[key]].concat([value])
} else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
o[key] = value
} else {
o[key] = o[key].concat([value])
}
} else if (o[key] === undefined && isTypeArray) {
o[key] = isValueArray ? value : [value]
} else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.bools) || checkAllAliases(keys.join('.'), flags.bools) || checkAllAliases(key, flags.counts))) {
o[key] = [ o[key], value ]
} else {
o[key] = value
}
}
// extend the aliases list with inferred aliases.
function extendAliases () {
Array.prototype.slice.call(arguments).forEach(function (obj) {
Object.keys(obj || {}).forEach(function (key) {
// short-circuit if we've already added a key
// to the aliases array, for example it might
// exist in both 'opts.default' and 'opts.key'.
if (flags.aliases[key]) return
flags.aliases[key] = [].concat(aliases[key] || [])
// For "--option-name", also set argv.optionName
flags.aliases[key].concat(key).forEach(function (x) {
if (/-/.test(x) && configuration['camel-case-expansion']) {
var c = camelCase(x)
if (c !== key && flags.aliases[key].indexOf(c) === -1) {
flags.aliases[key].push(c)
newAliases[c] = true
}
}
})
flags.aliases[key].forEach(function (x) {
flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) {
return x !== y
}))
})
})
})
}
// check if a flag is set for any of a key's aliases.
function checkAllAliases (key, flag) {
var isSet = false
var toCheck = [].concat(flags.aliases[key] || [], key)
toCheck.forEach(function (key) {
if (flag[key]) isSet = flag[key]
})
return isSet
}
function setDefaulted (key) {
[].concat(flags.aliases[key] || [], key).forEach(function (k) {
flags.defaulted[k] = true
})
}
function unsetDefaulted (key) {
[].concat(flags.aliases[key] || [], key).forEach(function (k) {
delete flags.defaulted[k]
})
}
// return a default value, given the type of a flag.,
// e.g., key of type 'string' will default to '', rather than 'true'.
function defaultForType (type) {
var def = {
boolean: true,
string: '',
number: undefined,
array: []
}
return def[type]
}
// given a flag, enforce a default type.
function guessType (key, flags) {
var type = 'boolean'
if (checkAllAliases(key, flags.strings)) type = 'string'
else if (checkAllAliases(key, flags.numbers)) type = 'number'
else if (checkAllAliases(key, flags.arrays)) type = 'array'
return type
}
function isNumber (x) {
if (typeof x === 'number') return true
if (/^0x[0-9a-f]+$/i.test(x)) return true
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
}
function isUndefined (num) {
return num === undefined
}
return {
argv: argv,
error: error,
aliases: flags.aliases,
newAliases: newAliases,
configuration: configuration
}
}
// if any aliases reference each other, we should
// merge them together.
function combineAliases (aliases) {
var aliasArrays = []
var change = true
var combined = {}
// turn alias lookup hash {key: ['alias1', 'alias2']} into
// a simple array ['key', 'alias1', 'alias2']
Object.keys(aliases).forEach(function (key) {
aliasArrays.push(
[].concat(aliases[key], key)
)
})
// combine arrays until zero changes are
// made in an iteration.
while (change) {
change = false
for (var i = 0; i < aliasArrays.length; i++) {
for (var ii = i + 1; ii < aliasArrays.length; ii++) {
var intersect = aliasArrays[i].filter(function (v) {
return aliasArrays[ii].indexOf(v) !== -1
})
if (intersect.length) {
aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii])
aliasArrays.splice(ii, 1)
change = true
break
}
}
}
}
// map arrays back to the hash-lookup (de-dupe while
// we're at it).
aliasArrays.forEach(function (aliasArray) {
aliasArray = aliasArray.filter(function (v, i, self) {
return self.indexOf(v) === i
})
combined[aliasArray.pop()] = aliasArray
})
return combined
}
function assign (defaults, configuration) {
var o = {}
configuration = configuration || {}
Object.keys(defaults).forEach(function (k) {
o[k] = defaults[k]
})
Object.keys(configuration).forEach(function (k) {
o[k] = configuration[k]
})
return o
}
// this function should only be called when a count is given as an arg
// it is NOT called to set a default value
// thus we can start the count at 1 instead of 0
function increment (orig) {
return orig !== undefined ? orig + 1 : 1
}
function Parser (args, opts) {
var result = parse(args.slice(), opts)
return result.argv
}
// parse arguments and return detailed
// meta information, aliases, etc.
Parser.detailed = function (args, opts) {
return parse(args.slice(), opts)
}
module.exports = Parser

View file

@ -0,0 +1,40 @@
// take an un-split argv string and tokenize it.
module.exports = function (argString) {
if (Array.isArray(argString)) return argString
argString = argString.trim()
var i = 0
var prevC = null
var c = null
var opening = null
var args = []
for (var ii = 0; ii < argString.length; ii++) {
prevC = c
c = argString.charAt(ii)
// split on spaces unless we're in quotes.
if (c === ' ' && !opening) {
if (!(prevC === ' ')) {
i++
}
continue
}
// don't split the string if we're in matching
// opening or closing single and double quotes.
if (c === opening) {
opening = null
continue
} else if ((c === "'" || c === '"') && !opening) {
opening = c
continue
}
if (!args[i]) args[i] = ''
args[i] += c
}
return args
}

View file

@ -0,0 +1,75 @@
{
"_from": "yargs-parser@10.x",
"_id": "yargs-parser@10.1.0",
"_inBundle": false,
"_integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
"_location": "/ts-jest/yargs-parser",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "yargs-parser@10.x",
"name": "yargs-parser",
"escapedName": "yargs-parser",
"rawSpec": "10.x",
"saveSpec": null,
"fetchSpec": "10.x"
},
"_requiredBy": [
"/ts-jest"
],
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
"_shasum": "7202265b89f7e9e9f2e5765e0fe735a905edbaa8",
"_spec": "yargs-parser@10.x",
"_where": "E:\\github\\setup-java\\node_modules\\ts-jest",
"author": {
"name": "Ben Coe",
"email": "ben@npmjs.com"
},
"bugs": {
"url": "https://github.com/yargs/yargs-parser/issues"
},
"bundleDependencies": false,
"dependencies": {
"camelcase": "^4.1.0"
},
"deprecated": false,
"description": "the mighty option parser used by yargs",
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^2.11.12",
"mocha": "^3.0.1",
"nyc": "^11.4.1",
"standard": "^10.0.2",
"standard-version": "^4.3.0"
},
"files": [
"lib",
"index.js"
],
"homepage": "https://github.com/yargs/yargs-parser#readme",
"keywords": [
"argument",
"parser",
"yargs",
"command",
"cli",
"parsing",
"option",
"args",
"argument"
],
"license": "ISC",
"main": "index.js",
"name": "yargs-parser",
"repository": {
"url": "git+ssh://git@github.com/yargs/yargs-parser.git"
},
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"posttest": "standard",
"release": "standard-version",
"test": "nyc mocha test/*.js"
},
"version": "10.1.0"
}

167
node_modules/ts-jest/package.json generated vendored Normal file
View file

@ -0,0 +1,167 @@
{
"_from": "ts-jest@^24.0.2",
"_id": "ts-jest@24.0.2",
"_inBundle": false,
"_integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==",
"_location": "/ts-jest",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ts-jest@^24.0.2",
"name": "ts-jest",
"escapedName": "ts-jest",
"rawSpec": "^24.0.2",
"saveSpec": null,
"fetchSpec": "^24.0.2"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz",
"_shasum": "8dde6cece97c31c03e80e474c749753ffd27194d",
"_spec": "ts-jest@^24.0.2",
"_where": "E:\\github\\setup-java",
"author": {
"name": "Kulshekhar Kabra",
"email": "kulshekhar@users.noreply.github.com",
"url": "https://github.com/kulshekhar"
},
"bin": {
"ts-jest": "cli.js"
},
"bugs": {
"url": "https://github.com/kulshekhar/ts-jest/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Huafu Gandon",
"email": "huafu.gandon@gmail.com",
"url": "https://github.com/huafu"
}
],
"dependencies": {
"bs-logger": "0.x",
"buffer-from": "1.x",
"fast-json-stable-stringify": "2.x",
"json5": "2.x",
"make-error": "1.x",
"mkdirp": "0.x",
"resolve": "1.x",
"semver": "^5.5",
"yargs-parser": "10.x"
},
"deprecated": false,
"description": "A preprocessor with source maps support to help use TypeScript with Jest",
"devDependencies": {
"@commitlint/cli": "7.x",
"@commitlint/config-conventional": "7.x",
"@types/babel__core": "7.x",
"@types/buffer-from": "latest",
"@types/cross-spawn": "latest",
"@types/fs-extra": "latest",
"@types/jest": "23.x",
"@types/js-yaml": "latest",
"@types/json5": "latest",
"@types/lodash.memoize": "4.x",
"@types/lodash.merge": "4.x",
"@types/lodash.set": "4.x",
"@types/mkdirp": "latest",
"@types/node": "10.x",
"@types/resolve": "latest",
"@types/semver": "latest",
"@types/yargs": "latest",
"conventional-changelog-cli": "2.x",
"cross-spawn": "latest",
"eslint": "latest",
"fs-extra": "latest",
"glob-gitignore": "latest",
"husky": "1.x",
"jest": "24.x",
"js-yaml": "latest",
"lint-staged": "latest",
"lodash.memoize": "4.x",
"lodash.merge": "4.x",
"lodash.set": "4.x",
"npm-run-all": "latest",
"prettier": "latest",
"source-map": "latest",
"tslint": "latest",
"tslint-config-prettier": "latest",
"tslint-plugin-prettier": "latest",
"typescript": "3.x"
},
"engines": {
"node": ">= 6"
},
"homepage": "https://kulshekhar.github.io/ts-jest",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-commit": "git reset"
}
},
"keywords": [
"jest",
"typescript",
"sourcemap",
"react",
"testing"
],
"license": "MIT",
"lint-staged": {
"linters": {
"*.{ts,tsx}": [
"tslint --fix",
"git add"
],
"*.{js,jsx}": [
"eslint --fix",
"git add"
]
}
},
"main": "dist/index.js",
"name": "ts-jest",
"peerDependencies": {
"jest": ">=24 <25"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kulshekhar/ts-jest.git"
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"build:watch": "tsc -p tsconfig.build.json -w",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"clean": "node scripts/clean.js",
"doc": "cd docs && bundle exec jekyll serve --livereload",
"doc:build": "cd docs && bundle exec jekyll build",
"doc:build-commit": "npm run doc:build && cd docs/_site && git add --all && git commit -m \"Updates github pages\"",
"doc:link": "git worktree add docs/_site gh-pages",
"doc:unlink": "git worktree prune",
"lint": "run-s lint:ts lint:js",
"lint:fix": "run-s lint:fix:ts lint:fix:js",
"lint:fix:js": "eslint . --fix",
"lint:fix:ts": "tslint --fix --project .",
"lint:js": "eslint . -f stylish",
"lint:ts": "tslint -t stylish --project .",
"postbuild": "node scripts/post-build.js",
"prebuild": "node scripts/clean-dist.js",
"prepare": "npm run build",
"prepublishOnly": "npm run test",
"pretest": "npm run lint",
"preversion": "npm run test",
"test": "run-s -s test:e2e \"test:unit -- {@}\" --",
"test:e2e": "node scripts/e2e.js",
"test:external": "node scripts/test-external-project.js",
"test:prepare": "npm run test:e2e -- --prepareOnly",
"test:unit": "jest",
"typecheck": "tsc -p .",
"version": "npm run changelog && git add CHANGELOG.md"
},
"types": "dist/index.d.ts",
"version": "24.0.2"
}

7
node_modules/ts-jest/preprocessor.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
console.warn(
'ts-jest[main] (WARN) Replace any occurrences of "ts-jest/dist/preprocessor.js" or ' +
' "<rootDir>/node_modules/ts-jest/preprocessor.js"' +
' in the \'transform\' section of your Jest config with just "ts-jest".'
)
module.exports = require('./dist')

1
node_modules/ts-jest/presets/create.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/config/create-jest-preset').createJestPreset

1
node_modules/ts-jest/presets/default/jest-preset.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('..').defaults

5
node_modules/ts-jest/presets/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,5 @@
import { TsJestPresets } from '../dist/config/create-jest-preset'
export const defaults: TsJestPresets
export const jsWithTs: TsJestPresets
export const jsWithBabel: TsJestPresets

13
node_modules/ts-jest/presets/index.js generated vendored Normal file
View file

@ -0,0 +1,13 @@
const create = require('./create')
module.exports = {
get defaults() { return create() },
get jsWithTs() { return create({ allowJs: true }) },
get jsWithBabel() {
return create({ allowJs: false }, {
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
})
},
}

View file

@ -0,0 +1 @@
module.exports = require('..').jsWithBabel

View file

@ -0,0 +1 @@
module.exports = require('..').jsWithTs

1
node_modules/ts-jest/utils/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export * from '../dist/util/exported'

1
node_modules/ts-jest/utils/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
module.exports = require('../dist/util/exported')