From cd3c7d588b182154f48b8565c0785e28c21d0054 Mon Sep 17 00:00:00 2001 From: dyminlee <2528879525@qq.com> Date: Wed, 1 Jul 2020 15:59:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?clone=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "day1/\345\255\246\344\271\240\346\227\245\350\256\260.md" | 1 + 1 file changed, 1 insertion(+) diff --git "a/day1/\345\255\246\344\271\240\346\227\245\350\256\260.md" "b/day1/\345\255\246\344\271\240\346\227\245\350\256\260.md" index e69de29..72f8cf0 100644 --- "a/day1/\345\255\246\344\271\240\346\227\245\350\256\260.md" +++ "b/day1/\345\255\246\344\271\240\346\227\245\350\256\260.md" @@ -0,0 +1 @@ +## day1学习日记 \ No newline at end of file -- Gitee From 6a44c2083a8610bdf991881d44330a3f3bc86028 Mon Sep 17 00:00:00 2001 From: dyminlee <2528879525@qq.com> Date: Thu, 2 Jul 2020 14:00:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4day1=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- day1/cli-study/.eslintrc.js | 16 + day1/cli-study/bin/www | 3 + day1/cli-study/node_modules/.bin/_metalsmith | 15 + .../node_modules/.bin/_metalsmith.cmd | 17 + .../node_modules/.bin/_metalsmith.ps1 | 18 + day1/cli-study/node_modules/.bin/acorn | 15 + day1/cli-study/node_modules/.bin/acorn.cmd | 17 + day1/cli-study/node_modules/.bin/acorn.ps1 | 18 + day1/cli-study/node_modules/.bin/cake | 15 + day1/cli-study/node_modules/.bin/cake.cmd | 17 + day1/cli-study/node_modules/.bin/cake.ps1 | 18 + day1/cli-study/node_modules/.bin/coffee | 15 + day1/cli-study/node_modules/.bin/coffee.cmd | 17 + day1/cli-study/node_modules/.bin/coffee.ps1 | 18 + day1/cli-study/node_modules/.bin/ejs | 15 + day1/cli-study/node_modules/.bin/ejs.cmd | 17 + day1/cli-study/node_modules/.bin/ejs.ps1 | 18 + day1/cli-study/node_modules/.bin/eslint | 15 + day1/cli-study/node_modules/.bin/eslint.cmd | 17 + day1/cli-study/node_modules/.bin/eslint.ps1 | 18 + day1/cli-study/node_modules/.bin/esparse | 15 + day1/cli-study/node_modules/.bin/esparse.cmd | 17 + day1/cli-study/node_modules/.bin/esparse.ps1 | 18 + day1/cli-study/node_modules/.bin/esvalidate | 15 + .../node_modules/.bin/esvalidate.cmd | 17 + .../node_modules/.bin/esvalidate.ps1 | 18 + day1/cli-study/node_modules/.bin/jake | 15 + day1/cli-study/node_modules/.bin/jake.cmd | 17 + day1/cli-study/node_modules/.bin/jake.ps1 | 18 + day1/cli-study/node_modules/.bin/js-yaml | 15 + day1/cli-study/node_modules/.bin/js-yaml.cmd | 17 + day1/cli-study/node_modules/.bin/js-yaml.ps1 | 18 + day1/cli-study/node_modules/.bin/json5 | 15 + day1/cli-study/node_modules/.bin/json5.cmd | 17 + day1/cli-study/node_modules/.bin/json5.ps1 | 18 + day1/cli-study/node_modules/.bin/metalsmith | 15 + .../node_modules/.bin/metalsmith.cmd | 17 + .../node_modules/.bin/metalsmith.ps1 | 18 + day1/cli-study/node_modules/.bin/mkdirp | 15 + day1/cli-study/node_modules/.bin/mkdirp.cmd | 17 + day1/cli-study/node_modules/.bin/mkdirp.ps1 | 18 + day1/cli-study/node_modules/.bin/ncp | 15 + day1/cli-study/node_modules/.bin/ncp.cmd | 17 + day1/cli-study/node_modules/.bin/ncp.ps1 | 18 + day1/cli-study/node_modules/.bin/node-which | 15 + .../node_modules/.bin/node-which.cmd | 17 + .../node_modules/.bin/node-which.ps1 | 18 + day1/cli-study/node_modules/.bin/rimraf | 15 + day1/cli-study/node_modules/.bin/rimraf.cmd | 17 + day1/cli-study/node_modules/.bin/rimraf.ps1 | 18 + day1/cli-study/node_modules/.bin/seek-bunzip | 15 + .../node_modules/.bin/seek-bunzip.cmd | 17 + .../node_modules/.bin/seek-bunzip.ps1 | 18 + day1/cli-study/node_modules/.bin/seek-table | 15 + .../node_modules/.bin/seek-table.cmd | 17 + .../node_modules/.bin/seek-table.ps1 | 18 + day1/cli-study/node_modules/.bin/semver | 15 + day1/cli-study/node_modules/.bin/semver.cmd | 17 + day1/cli-study/node_modules/.bin/semver.ps1 | 18 + day1/cli-study/node_modules/.bin/win-fork | 15 + day1/cli-study/node_modules/.bin/win-fork.cmd | 17 + day1/cli-study/node_modules/.bin/win-fork.ps1 | 18 + .../node_modules/.bin/win-line-endings | 15 + .../node_modules/.bin/win-line-endings.cmd | 17 + .../node_modules/.bin/win-line-endings.ps1 | 18 + day1/cli-study/node_modules/.bin/win-spawn | 15 + .../cli-study/node_modules/.bin/win-spawn.cmd | 17 + .../cli-study/node_modules/.bin/win-spawn.ps1 | 18 + .../node_modules/@babel/code-frame/LICENSE | 22 + .../node_modules/@babel/code-frame/README.md | 19 + .../@babel/code-frame/lib/index.js | 167 + .../@babel/code-frame/package.json | 57 + .../helper-validator-identifier/LICENSE | 22 + .../helper-validator-identifier/README.md | 19 + .../lib/identifier.js | 77 + .../helper-validator-identifier/lib/index.js | 57 + .../lib/keyword.js | 38 + .../helper-validator-identifier/package.json | 51 + .../scripts/generate-identifier-regex.js | 75 + .../node_modules/@babel/highlight/LICENSE | 22 + .../node_modules/@babel/highlight/README.md | 19 + .../@babel/highlight/lib/index.js | 107 + .../highlight/node_modules/chalk/index.js | 228 + .../node_modules/chalk/index.js.flow | 93 + .../highlight/node_modules/chalk/license | 9 + .../highlight/node_modules/chalk/package.json | 103 + .../highlight/node_modules/chalk/readme.md | 314 + .../highlight/node_modules/chalk/templates.js | 128 + .../node_modules/chalk/types/index.d.ts | 97 + .../@babel/highlight/package.json | 62 + .../@sindresorhus/is/dist/example.d.ts | 0 .../@sindresorhus/is/dist/example.js | 3 + .../@sindresorhus/is/dist/example.js.map | 1 + .../@sindresorhus/is/dist/index.d.ts | 95 + .../@sindresorhus/is/dist/index.js | 215 + .../@sindresorhus/is/dist/index.js.map | 1 + .../@sindresorhus/is/dist/source/index.d.ts | 59 + .../@sindresorhus/is/dist/source/index.js | 182 + .../@sindresorhus/is/dist/source/index.js.map | 1 + .../is/dist/source/tests/test.d.ts | 0 .../is/dist/source/tests/test.js | 622 + .../is/dist/source/tests/test.js.map | 1 + .../node_modules/@sindresorhus/is/license | 9 + .../@sindresorhus/is/package.json | 95 + .../node_modules/@sindresorhus/is/readme.md | 323 + .../node_modules/@types/color-name/LICENSE | 21 + .../node_modules/@types/color-name/README.md | 16 + .../node_modules/@types/color-name/index.d.ts | 161 + .../@types/color-name/package.json | 52 + .../node_modules/@types/json5/README.md | 18 + .../node_modules/@types/json5/index.d.ts | 44 + .../node_modules/@types/json5/package.json | 49 + .../@types/json5/types-metadata.json | 25 + .../node_modules/absolute/.npmignore | 1 + .../cli-study/node_modules/absolute/README.md | 33 + .../node_modules/absolute/absolute.js | 7 + .../node_modules/absolute/package.json | 49 + .../node_modules/absolute/test/test.js | 7 + day1/cli-study/node_modules/acorn-jsx/LICENSE | 19 + .../node_modules/acorn-jsx/README.md | 40 + .../cli-study/node_modules/acorn-jsx/index.js | 488 + .../node_modules/acorn-jsx/package.json | 55 + .../cli-study/node_modules/acorn-jsx/xhtml.js | 255 + .../cli-study/node_modules/acorn/CHANGELOG.md | 612 + day1/cli-study/node_modules/acorn/LICENSE | 19 + day1/cli-study/node_modules/acorn/README.md | 270 + day1/cli-study/node_modules/acorn/bin/acorn | 4 + .../node_modules/acorn/dist/acorn.d.ts | 209 + .../node_modules/acorn/dist/acorn.js | 5138 +++++ .../node_modules/acorn/dist/acorn.js.map | 1 + .../node_modules/acorn/dist/acorn.mjs | 5107 +++++ .../node_modules/acorn/dist/acorn.mjs.d.ts | 2 + .../node_modules/acorn/dist/acorn.mjs.map | 1 + day1/cli-study/node_modules/acorn/dist/bin.js | 64 + .../cli-study/node_modules/acorn/package.json | 67 + .../node_modules/ajv/.tonic_example.js | 20 + day1/cli-study/node_modules/ajv/LICENSE | 22 + day1/cli-study/node_modules/ajv/README.md | 1452 ++ .../node_modules/ajv/dist/ajv.bundle.js | 7165 +++++++ .../node_modules/ajv/dist/ajv.min.js | 3 + .../node_modules/ajv/dist/ajv.min.js.map | 1 + day1/cli-study/node_modules/ajv/lib/ajv.d.ts | 395 + day1/cli-study/node_modules/ajv/lib/ajv.js | 506 + day1/cli-study/node_modules/ajv/lib/cache.js | 26 + .../node_modules/ajv/lib/compile/async.js | 90 + .../node_modules/ajv/lib/compile/equal.js | 5 + .../ajv/lib/compile/error_classes.js | 34 + .../node_modules/ajv/lib/compile/formats.js | 142 + .../node_modules/ajv/lib/compile/index.js | 387 + .../node_modules/ajv/lib/compile/resolve.js | 270 + .../node_modules/ajv/lib/compile/rules.js | 66 + .../ajv/lib/compile/schema_obj.js | 9 + .../ajv/lib/compile/ucs2length.js | 20 + .../node_modules/ajv/lib/compile/util.js | 274 + day1/cli-study/node_modules/ajv/lib/data.js | 49 + .../node_modules/ajv/lib/definition_schema.js | 37 + .../node_modules/ajv/lib/dot/_limit.jst | 104 + .../node_modules/ajv/lib/dot/_limitItems.jst | 10 + .../node_modules/ajv/lib/dot/_limitLength.jst | 10 + .../ajv/lib/dot/_limitProperties.jst | 10 + .../node_modules/ajv/lib/dot/allOf.jst | 34 + .../node_modules/ajv/lib/dot/anyOf.jst | 48 + .../node_modules/ajv/lib/dot/coerce.def | 61 + .../node_modules/ajv/lib/dot/comment.jst | 9 + .../node_modules/ajv/lib/dot/const.jst | 11 + .../node_modules/ajv/lib/dot/contains.jst | 57 + .../node_modules/ajv/lib/dot/custom.jst | 191 + .../node_modules/ajv/lib/dot/defaults.def | 47 + .../node_modules/ajv/lib/dot/definitions.def | 201 + .../node_modules/ajv/lib/dot/dependencies.jst | 80 + .../node_modules/ajv/lib/dot/enum.jst | 30 + .../node_modules/ajv/lib/dot/errors.def | 194 + .../node_modules/ajv/lib/dot/format.jst | 106 + .../cli-study/node_modules/ajv/lib/dot/if.jst | 75 + .../node_modules/ajv/lib/dot/items.jst | 100 + .../node_modules/ajv/lib/dot/missing.def | 39 + .../node_modules/ajv/lib/dot/multipleOf.jst | 20 + .../node_modules/ajv/lib/dot/not.jst | 43 + .../node_modules/ajv/lib/dot/oneOf.jst | 54 + .../node_modules/ajv/lib/dot/pattern.jst | 14 + .../node_modules/ajv/lib/dot/properties.jst | 244 + .../ajv/lib/dot/propertyNames.jst | 54 + .../node_modules/ajv/lib/dot/ref.jst | 85 + .../node_modules/ajv/lib/dot/required.jst | 108 + .../node_modules/ajv/lib/dot/uniqueItems.jst | 62 + .../node_modules/ajv/lib/dot/validate.jst | 282 + .../node_modules/ajv/lib/dotjs/README.md | 3 + .../node_modules/ajv/lib/dotjs/_limit.js | 157 + .../node_modules/ajv/lib/dotjs/_limitItems.js | 77 + .../ajv/lib/dotjs/_limitLength.js | 82 + .../ajv/lib/dotjs/_limitProperties.js | 77 + .../node_modules/ajv/lib/dotjs/allOf.js | 43 + .../node_modules/ajv/lib/dotjs/anyOf.js | 74 + .../node_modules/ajv/lib/dotjs/comment.js | 14 + .../node_modules/ajv/lib/dotjs/const.js | 56 + .../node_modules/ajv/lib/dotjs/contains.js | 82 + .../node_modules/ajv/lib/dotjs/custom.js | 228 + .../ajv/lib/dotjs/dependencies.js | 168 + .../node_modules/ajv/lib/dotjs/enum.js | 66 + .../node_modules/ajv/lib/dotjs/format.js | 150 + .../node_modules/ajv/lib/dotjs/if.js | 104 + .../node_modules/ajv/lib/dotjs/index.js | 33 + .../node_modules/ajv/lib/dotjs/items.js | 141 + .../node_modules/ajv/lib/dotjs/multipleOf.js | 77 + .../node_modules/ajv/lib/dotjs/not.js | 84 + .../node_modules/ajv/lib/dotjs/oneOf.js | 73 + .../node_modules/ajv/lib/dotjs/pattern.js | 75 + .../node_modules/ajv/lib/dotjs/properties.js | 330 + .../ajv/lib/dotjs/propertyNames.js | 82 + .../node_modules/ajv/lib/dotjs/ref.js | 124 + .../node_modules/ajv/lib/dotjs/required.js | 270 + .../node_modules/ajv/lib/dotjs/uniqueItems.js | 86 + .../node_modules/ajv/lib/dotjs/validate.js | 494 + .../cli-study/node_modules/ajv/lib/keyword.js | 146 + .../node_modules/ajv/lib/refs/data.json | 17 + .../ajv/lib/refs/json-schema-draft-04.json | 149 + .../ajv/lib/refs/json-schema-draft-06.json | 154 + .../ajv/lib/refs/json-schema-draft-07.json | 168 + .../ajv/lib/refs/json-schema-secure.json | 94 + day1/cli-study/node_modules/ajv/package.json | 130 + .../node_modules/ajv/scripts/.eslintrc.yml | 3 + .../node_modules/ajv/scripts/bundle.js | 61 + .../node_modules/ajv/scripts/compile-dots.js | 73 + day1/cli-study/node_modules/ajv/scripts/info | 10 + .../node_modules/ajv/scripts/prepare-tests | 12 + .../ajv/scripts/publish-built-version | 32 + .../node_modules/ajv/scripts/travis-gh-pages | 23 + .../node_modules/ansi-colors/LICENSE | 21 + .../node_modules/ansi-colors/README.md | 279 + .../node_modules/ansi-colors/index.js | 117 + .../node_modules/ansi-colors/package.json | 152 + .../node_modules/ansi-colors/symbols.js | 46 + .../node_modules/ansi-colors/types/index.d.ts | 161 + .../node_modules/ansi-escapes/index.d.ts | 248 + .../node_modules/ansi-escapes/index.js | 157 + .../node_modules/ansi-escapes/license | 9 + .../node_modules/type-fest/index.d.ts | 26 + .../node_modules/type-fest/license | 9 + .../node_modules/type-fest/package.json | 86 + .../node_modules/type-fest/readme.md | 637 + .../type-fest/source/async-return-type.d.ts | 23 + .../node_modules/type-fest/source/basic.d.ts | 67 + .../type-fest/source/conditional-except.d.ts | 43 + .../type-fest/source/conditional-keys.d.ts | 43 + .../type-fest/source/conditional-pick.d.ts | 42 + .../node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + .../node_modules/type-fest/source/merge.d.ts | 22 + .../type-fest/source/mutable.d.ts | 22 + .../node_modules/type-fest/source/opaque.d.ts | 65 + .../type-fest/source/package-json.d.ts | 585 + .../type-fest/source/partial-deep.d.ts | 72 + .../type-fest/source/promisable.d.ts | 23 + .../type-fest/source/promise-value.d.ts | 20 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 32 + .../type-fest/source/require-exactly-one.d.ts | 36 + .../type-fest/source/set-optional.d.ts | 32 + .../type-fest/source/set-required.d.ts | 32 + .../type-fest/source/tsconfig-json.d.ts | 872 + .../node_modules/ansi-escapes/package.json | 89 + .../node_modules/ansi-escapes/readme.md | 245 + day1/cli-study/node_modules/ansi-red/LICENSE | 21 + day1/cli-study/node_modules/ansi-red/index.js | 14 + .../node_modules/ansi-red/package.json | 86 + .../cli-study/node_modules/ansi-red/readme.md | 74 + .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../cli-study/node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 87 + .../node_modules/ansi-regex/readme.md | 78 + .../node_modules/ansi-styles/index.js | 165 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 89 + .../node_modules/ansi-styles/readme.md | 147 + day1/cli-study/node_modules/ansi-wrap/LICENSE | 21 + .../node_modules/ansi-wrap/README.md | 89 + .../cli-study/node_modules/ansi-wrap/index.js | 5 + .../node_modules/ansi-wrap/package.json | 59 + .../node_modules/archive-type/index.js | 18 + .../node_modules/archive-type/license | 21 + .../node_modules/file-type/index.js | 545 + .../node_modules/file-type/license | 21 + .../node_modules/file-type/package.json | 139 + .../node_modules/file-type/readme.md | 154 + .../node_modules/archive-type/package.json | 77 + .../node_modules/archive-type/readme.md | 62 + .../node_modules/argparse/CHANGELOG.md | 185 + day1/cli-study/node_modules/argparse/LICENSE | 21 + .../cli-study/node_modules/argparse/README.md | 257 + day1/cli-study/node_modules/argparse/index.js | 3 + .../node_modules/argparse/lib/action.js | 146 + .../argparse/lib/action/append.js | 53 + .../argparse/lib/action/append/constant.js | 47 + .../node_modules/argparse/lib/action/count.js | 40 + .../node_modules/argparse/lib/action/help.js | 47 + .../node_modules/argparse/lib/action/store.js | 50 + .../argparse/lib/action/store/constant.js | 43 + .../argparse/lib/action/store/false.js | 27 + .../argparse/lib/action/store/true.js | 26 + .../argparse/lib/action/subparsers.js | 149 + .../argparse/lib/action/version.js | 47 + .../argparse/lib/action_container.js | 482 + .../node_modules/argparse/lib/argparse.js | 14 + .../argparse/lib/argument/error.js | 50 + .../argparse/lib/argument/exclusive.js | 54 + .../argparse/lib/argument/group.js | 75 + .../argparse/lib/argument_parser.js | 1161 ++ .../node_modules/argparse/lib/const.js | 21 + .../argparse/lib/help/added_formatters.js | 87 + .../argparse/lib/help/formatter.js | 795 + .../node_modules/argparse/lib/namespace.js | 76 + .../node_modules/argparse/lib/utils.js | 57 + .../node_modules/argparse/package.json | 70 + .../node_modules/array-includes/.editorconfig | 13 + .../node_modules/array-includes/.eslintrc | 22 + .../array-includes/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + .../node_modules/array-includes/.travis.yml | 12 + .../node_modules/array-includes/CHANGELOG.md | 101 + .../node_modules/array-includes/LICENSE | 21 + .../node_modules/array-includes/README.md | 94 + .../node_modules/array-includes/auto.js | 3 + .../array-includes/implementation.js | 35 + .../node_modules/array-includes/index.js | 26 + .../node_modules/array-includes/package.json | 118 + .../node_modules/array-includes/polyfill.js | 7 + .../node_modules/array-includes/shim.js | 14 + .../node_modules/array-includes/test.html | 14606 +++++++++++++ .../node_modules/array-includes/test/index.js | 17 + .../array-includes/test/shimmed.js | 36 + .../node_modules/array-includes/test/tests.js | 94 + .../array.prototype.flat/.editorconfig | 20 + .../array.prototype.flat/.eslintrc | 40 + .../array.prototype.flat/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + .../node_modules/array.prototype.flat/.nycrc | 13 + .../array.prototype.flat/.travis.yml | 9 + .../array.prototype.flat/CHANGELOG.md | 53 + .../node_modules/array.prototype.flat/LICENSE | 21 + .../array.prototype.flat/README.md | 72 + .../node_modules/array.prototype.flat/auto.js | 3 + .../array.prototype.flat/implementation.js | 22 + .../array.prototype.flat/index.js | 19 + .../array.prototype.flat/package.json | 125 + .../array.prototype.flat/polyfill.js | 7 + .../node_modules/array.prototype.flat/shim.js | 14 + .../array.prototype.flat/test/index.js | 17 + .../array.prototype.flat/test/shimmed.js | 36 + .../array.prototype.flat/test/tests.js | 30 + .../node_modules/astral-regex/index.js | 4 + .../node_modules/astral-regex/license | 9 + .../node_modules/astral-regex/package.json | 64 + .../node_modules/astral-regex/readme.md | 43 + day1/cli-study/node_modules/async/.travis.yml | 5 + day1/cli-study/node_modules/async/LICENSE | 19 + day1/cli-study/node_modules/async/README.md | 1647 ++ day1/cli-study/node_modules/async/bower.json | 38 + .../node_modules/async/component.json | 16 + .../cli-study/node_modules/async/lib/async.js | 1123 + .../cli-study/node_modules/async/package.json | 82 + .../async/support/sync-package-managers.js | 53 + .../cli-study/node_modules/axios/CHANGELOG.md | 413 + day1/cli-study/node_modules/axios/LICENSE | 19 + day1/cli-study/node_modules/axios/README.md | 709 + .../node_modules/axios/UPGRADE_GUIDE.md | 162 + .../node_modules/axios/dist/axios.js | 1715 ++ .../node_modules/axios/dist/axios.map | 1 + .../node_modules/axios/dist/axios.min.js | 3 + .../node_modules/axios/dist/axios.min.map | 1 + day1/cli-study/node_modules/axios/index.d.ts | 157 + day1/cli-study/node_modules/axios/index.js | 1 + .../node_modules/axios/lib/adapters/README.md | 37 + .../node_modules/axios/lib/adapters/http.js | 279 + .../node_modules/axios/lib/adapters/xhr.js | 180 + .../cli-study/node_modules/axios/lib/axios.js | 53 + .../node_modules/axios/lib/cancel/Cancel.js | 19 + .../axios/lib/cancel/CancelToken.js | 57 + .../node_modules/axios/lib/cancel/isCancel.js | 5 + .../node_modules/axios/lib/core/Axios.js | 94 + .../axios/lib/core/InterceptorManager.js | 52 + .../node_modules/axios/lib/core/README.md | 7 + .../axios/lib/core/buildFullPath.js | 20 + .../axios/lib/core/createError.js | 18 + .../axios/lib/core/dispatchRequest.js | 79 + .../axios/lib/core/enhanceError.js | 42 + .../axios/lib/core/mergeConfig.js | 73 + .../node_modules/axios/lib/core/settle.js | 25 + .../axios/lib/core/transformData.js | 20 + .../node_modules/axios/lib/defaults.js | 97 + .../node_modules/axios/lib/helpers/README.md | 7 + .../node_modules/axios/lib/helpers/bind.js | 11 + .../axios/lib/helpers/buildURL.js | 71 + .../axios/lib/helpers/combineURLs.js | 14 + .../node_modules/axios/lib/helpers/cookies.js | 53 + .../axios/lib/helpers/deprecatedMethod.js | 24 + .../axios/lib/helpers/isAbsoluteURL.js | 14 + .../axios/lib/helpers/isURLSameOrigin.js | 68 + .../axios/lib/helpers/normalizeHeaderName.js | 12 + .../axios/lib/helpers/parseHeaders.js | 53 + .../node_modules/axios/lib/helpers/spread.js | 27 + .../cli-study/node_modules/axios/lib/utils.js | 344 + .../cli-study/node_modules/axios/package.json | 112 + .../node_modules/balanced-match/.npmignore | 5 + .../node_modules/balanced-match/LICENSE.md | 21 + .../node_modules/balanced-match/README.md | 91 + .../node_modules/balanced-match/index.js | 59 + .../node_modules/balanced-match/package.json | 77 + day1/cli-study/node_modules/base64-js/LICENSE | 21 + .../node_modules/base64-js/README.md | 32 + .../node_modules/base64-js/base64js.min.js | 1 + .../cli-study/node_modules/base64-js/index.js | 152 + .../node_modules/base64-js/package.json | 60 + day1/cli-study/node_modules/bl/.jshintrc | 59 + day1/cli-study/node_modules/bl/.travis.yml | 16 + day1/cli-study/node_modules/bl/LICENSE.md | 13 + day1/cli-study/node_modules/bl/README.md | 208 + day1/cli-study/node_modules/bl/bl.js | 281 + day1/cli-study/node_modules/bl/package.json | 63 + day1/cli-study/node_modules/bl/test/test.js | 702 + day1/cli-study/node_modules/bluebird/LICENSE | 21 + .../cli-study/node_modules/bluebird/README.md | 57 + .../node_modules/bluebird/changelog.md | 1 + .../bluebird/js/browser/bluebird.core.js | 3914 ++++ .../bluebird/js/browser/bluebird.core.min.js | 31 + .../bluebird/js/browser/bluebird.js | 5778 ++++++ .../bluebird/js/browser/bluebird.min.js | 31 + .../node_modules/bluebird/js/release/any.js | 21 + .../bluebird/js/release/assert.js | 55 + .../node_modules/bluebird/js/release/async.js | 120 + .../node_modules/bluebird/js/release/bind.js | 67 + .../bluebird/js/release/bluebird.js | 11 + .../bluebird/js/release/call_get.js | 123 + .../bluebird/js/release/cancel.js | 129 + .../bluebird/js/release/catch_filter.js | 42 + .../bluebird/js/release/context.js | 69 + .../bluebird/js/release/debuggability.js | 1009 + .../bluebird/js/release/direct_resolve.js | 46 + .../node_modules/bluebird/js/release/each.js | 30 + .../bluebird/js/release/errors.js | 116 + .../node_modules/bluebird/js/release/es5.js | 80 + .../bluebird/js/release/filter.js | 12 + .../bluebird/js/release/finally.js | 146 + .../bluebird/js/release/generators.js | 223 + .../node_modules/bluebird/js/release/join.js | 165 + .../node_modules/bluebird/js/release/map.js | 175 + .../bluebird/js/release/method.js | 55 + .../bluebird/js/release/nodeback.js | 51 + .../bluebird/js/release/nodeify.js | 58 + .../bluebird/js/release/promise.js | 819 + .../bluebird/js/release/promise_array.js | 186 + .../bluebird/js/release/promisify.js | 314 + .../node_modules/bluebird/js/release/props.js | 118 + .../node_modules/bluebird/js/release/queue.js | 73 + .../node_modules/bluebird/js/release/race.js | 49 + .../bluebird/js/release/reduce.js | 183 + .../bluebird/js/release/schedule.js | 62 + .../bluebird/js/release/settle.js | 47 + .../node_modules/bluebird/js/release/some.js | 148 + .../js/release/synchronous_inspection.js | 103 + .../bluebird/js/release/thenables.js | 86 + .../bluebird/js/release/timers.js | 93 + .../node_modules/bluebird/js/release/using.js | 226 + .../node_modules/bluebird/js/release/util.js | 421 + .../node_modules/bluebird/package.json | 102 + .../node_modules/brace-expansion/LICENSE | 21 + .../node_modules/brace-expansion/README.md | 129 + .../node_modules/brace-expansion/index.js | 201 + .../node_modules/brace-expansion/package.json | 75 + .../node_modules/buffer-alloc-unsafe/index.js | 17 + .../buffer-alloc-unsafe/package.json | 57 + .../buffer-alloc-unsafe/readme.md | 46 + .../node_modules/buffer-alloc/index.js | 32 + .../node_modules/buffer-alloc/package.json | 59 + .../node_modules/buffer-alloc/readme.md | 43 + .../node_modules/buffer-crc32/LICENSE | 19 + .../node_modules/buffer-crc32/README.md | 47 + .../node_modules/buffer-crc32/index.js | 111 + .../node_modules/buffer-crc32/package.json | 69 + .../node_modules/buffer-fill/index.js | 113 + .../node_modules/buffer-fill/package.json | 49 + .../node_modules/buffer-fill/readme.md | 54 + day1/cli-study/node_modules/buffer/AUTHORS.md | 62 + day1/cli-study/node_modules/buffer/LICENSE | 21 + day1/cli-study/node_modules/buffer/README.md | 416 + day1/cli-study/node_modules/buffer/index.d.ts | 186 + day1/cli-study/node_modules/buffer/index.js | 1794 ++ .../node_modules/buffer/package.json | 113 + .../node_modules/cacheable-request/LICENSE | 21 + .../node_modules/cacheable-request/README.md | 190 + .../node_modules/lowercase-keys/index.js | 11 + .../node_modules/lowercase-keys/package.json | 67 + .../node_modules/lowercase-keys/readme.md | 33 + .../cacheable-request/package.json | 86 + .../cacheable-request/src/index.js | 155 + .../node_modules/callsites/index.d.ts | 96 + .../cli-study/node_modules/callsites/index.js | 13 + day1/cli-study/node_modules/callsites/license | 9 + .../node_modules/callsites/package.json | 71 + .../node_modules/callsites/readme.md | 48 + day1/cli-study/node_modules/caw/index.js | 37 + day1/cli-study/node_modules/caw/license | 9 + day1/cli-study/node_modules/caw/package.json | 81 + day1/cli-study/node_modules/caw/readme.md | 51 + day1/cli-study/node_modules/chalk/index.d.ts | 415 + day1/cli-study/node_modules/chalk/license | 9 + .../chalk/node_modules/ansi-styles/index.d.ts | 197 + .../chalk/node_modules/ansi-styles/index.js | 163 + .../chalk/node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 89 + .../chalk/node_modules/ansi-styles/readme.md | 158 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../chalk/node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 + .../chalk/node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 83 + .../chalk/node_modules/color-convert/route.js | 97 + .../chalk/node_modules/color-name/LICENSE | 8 + .../chalk/node_modules/color-name/README.md | 11 + .../chalk/node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 56 + .../chalk/node_modules/has-flag/index.d.ts | 39 + .../chalk/node_modules/has-flag/index.js | 8 + .../chalk/node_modules/has-flag/license | 9 + .../chalk/node_modules/has-flag/package.json | 78 + .../chalk/node_modules/has-flag/readme.md | 89 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 139 + .../chalk/node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../node_modules/supports-color/readme.md | 76 + .../cli-study/node_modules/chalk/package.json | 102 + day1/cli-study/node_modules/chalk/readme.md | 293 + .../node_modules/chalk/source/index.js | 229 + .../node_modules/chalk/source/templates.js | 134 + .../node_modules/chalk/source/util.js | 39 + .../node_modules/chardet/.travis.yml | 5 + day1/cli-study/node_modules/chardet/LICENSE | 19 + day1/cli-study/node_modules/chardet/README.md | 81 + .../node_modules/chardet/encoding/iso2022.js | 141 + .../node_modules/chardet/encoding/mbcs.js | 502 + .../node_modules/chardet/encoding/sbcs.js | 907 + .../node_modules/chardet/encoding/unicode.js | 112 + .../node_modules/chardet/encoding/utf8.js | 84 + day1/cli-study/node_modules/chardet/index.js | 151 + day1/cli-study/node_modules/chardet/match.js | 6 + .../node_modules/chardet/package.json | 83 + .../node_modules/cli-cursor/index.d.ts | 45 + .../node_modules/cli-cursor/index.js | 35 + .../cli-study/node_modules/cli-cursor/license | 9 + .../node_modules/cli-cursor/package.json | 78 + .../node_modules/cli-cursor/readme.md | 55 + .../node_modules/cli-spinners/index.d.ts | 109 + .../node_modules/cli-spinners/index.js | 7 + .../node_modules/cli-spinners/license | 9 + .../node_modules/cli-spinners/package.json | 79 + .../node_modules/cli-spinners/readme.md | 61 + .../node_modules/cli-spinners/spinners.json | 1185 ++ .../00ef1b3d-3687-482b-8d03-de2f76b58f54.json | 1 + .../00ef1b3d-3687-482b-8d03-de2f76b58f54.json | 1 + .../.nyc_output/processinfo/index.json | 1 + .../node_modules/cli-width/.travis.yml | 14 + .../node_modules/cli-width/CHANGELOG.md | 25 + day1/cli-study/node_modules/cli-width/LICENSE | 13 + .../node_modules/cli-width/README.md | 72 + .../cli-study/node_modules/cli-width/index.js | 49 + .../node_modules/cli-width/package.json | 57 + .../node_modules/clone-response/LICENSE | 21 + .../node_modules/clone-response/README.md | 62 + .../node_modules/clone-response/package.json | 73 + .../node_modules/clone-response/src/index.js | 17 + day1/cli-study/node_modules/clone/.npmignore | 4 + day1/cli-study/node_modules/clone/LICENSE | 18 + day1/cli-study/node_modules/clone/README.md | 126 + day1/cli-study/node_modules/clone/clone.iml | 10 + day1/cli-study/node_modules/clone/clone.js | 166 + .../cli-study/node_modules/clone/package.json | 137 + .../node_modules/co-from-stream/.npmignore | 1 + .../node_modules/co-from-stream/History.md | 5 + .../node_modules/co-from-stream/Makefile | 5 + .../node_modules/co-from-stream/Readme.md | 36 + .../node_modules/co-from-stream/example.js | 10 + .../node_modules/co-from-stream/index.js | 26 + .../node_modules/co-from-stream/package.json | 49 + .../node_modules/co-from-stream/test.js | 16 + .../node_modules/co-fs-extra/.npmignore | 2 + .../node_modules/co-fs-extra/History.md | 16 + .../node_modules/co-fs-extra/Makefile | 17 + .../node_modules/co-fs-extra/README.md | 28 + .../node_modules/co-fs-extra/generator.js | 25 + .../node_modules/co-fs-extra/index.js | 32 + .../node_modules/co-fs-extra/methods.js | 84 + .../node_modules/co-fs-extra/package.json | 59 + .../co-fs-extra/test/fixtures/msg.json | 3 + .../node_modules/co-fs-extra/test/index.js | 21 + .../cli-study/node_modules/co-read/.npmignore | 1 + .../node_modules/co-read/.travis.yml | 3 + day1/cli-study/node_modules/co-read/README.md | 76 + .../cli-study/node_modules/co-read/example.js | 48 + day1/cli-study/node_modules/co-read/index.js | 118 + .../node_modules/co-read/package.json | 61 + .../co-read/test/stream1-backpressure.js | 30 + .../co-read/test/stream1-error.js | 22 + .../node_modules/co-read/test/stream1-read.js | 29 + .../node_modules/co-read/test/stream2-end.js | 21 + .../co-read/test/stream2-error.js | 21 + .../node_modules/co-read/test/stream2-read.js | 29 + .../co-read/test/stream2-read2.js | 30 + day1/cli-study/node_modules/co/Readme.md | 371 + day1/cli-study/node_modules/co/index.js | 294 + day1/cli-study/node_modules/co/package.json | 61 + .../node_modules/coffee-script/LICENSE | 22 + .../node_modules/coffee-script/README.md | 57 + .../node_modules/coffee-script/bin/cake | 18 + .../node_modules/coffee-script/bin/coffee | 18 + .../lib/coffee-script/browser.js | 132 + .../coffee-script/lib/coffee-script/cake.js | 114 + .../lib/coffee-script/coffee-script.js | 426 + .../lib/coffee-script/command.js | 610 + .../lib/coffee-script/grammar.js | 816 + .../lib/coffee-script/helpers.js | 249 + .../coffee-script/lib/coffee-script/index.js | 11 + .../coffee-script/lib/coffee-script/lexer.js | 1166 ++ .../coffee-script/lib/coffee-script/nodes.js | 3899 ++++ .../lib/coffee-script/optparse.js | 139 + .../coffee-script/lib/coffee-script/parser.js | 891 + .../lib/coffee-script/register.js | 66 + .../coffee-script/lib/coffee-script/repl.js | 203 + .../lib/coffee-script/rewriter.js | 537 + .../coffee-script/lib/coffee-script/scope.js | 165 + .../lib/coffee-script/sourcemap.js | 161 + .../node_modules/coffee-script/package.json | 77 + .../node_modules/coffee-script/register.js | 1 + .../node_modules/coffee-script/repl.js | 1 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 868 + .../node_modules/color-convert/index.js | 78 + .../node_modules/color-convert/package.json | 81 + .../node_modules/color-convert/route.js | 97 + .../node_modules/color-name/.eslintrc.json | 43 + .../node_modules/color-name/.npmignore | 107 + .../cli-study/node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 53 + .../cli-study/node_modules/color-name/test.js | 7 + .../node_modules/commander/CHANGELOG.md | 385 + day1/cli-study/node_modules/commander/LICENSE | 22 + .../node_modules/commander/Readme.md | 737 + .../cli-study/node_modules/commander/index.js | 1756 ++ .../node_modules/commander/package.json | 81 + .../node_modules/commander/typings/index.d.ts | 386 + .../node_modules/concat-map/.travis.yml | 4 + .../cli-study/node_modules/concat-map/LICENSE | 18 + .../node_modules/concat-map/README.markdown | 62 + .../node_modules/concat-map/example/map.js | 6 + .../node_modules/concat-map/index.js | 13 + .../node_modules/concat-map/package.json | 88 + .../node_modules/concat-map/test/map.js | 39 + .../node_modules/config-chain/LICENCE | 22 + .../node_modules/config-chain/index.js | 282 + .../node_modules/config-chain/package.json | 62 + .../node_modules/config-chain/readme.markdown | 257 + .../confusing-browser-globals/LICENSE | 21 + .../confusing-browser-globals/README.md | 45 + .../confusing-browser-globals/index.js | 69 + .../confusing-browser-globals/package.json | 55 + .../node_modules/consolidate/History.md | 132 + .../node_modules/consolidate/Readme.md | 210 + .../node_modules/consolidate/index.js | 1 + .../consolidate/lib/consolidate.js | 1679 ++ .../node_modules/consolidate/package.json | 122 + .../node_modules/contains-path/LICENSE | 21 + .../node_modules/contains-path/README.md | 83 + .../node_modules/contains-path/index.js | 33 + .../node_modules/contains-path/package.json | 86 + .../content-disposition/HISTORY.md | 55 + .../node_modules/content-disposition/LICENSE | 22 + .../content-disposition/README.md | 148 + .../node_modules/content-disposition/index.js | 458 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 62 + .../content-disposition/package.json | 79 + .../node_modules/core-util-is/LICENSE | 19 + .../node_modules/core-util-is/README.md | 3 + .../node_modules/core-util-is/float.patch | 604 + .../node_modules/core-util-is/lib/util.js | 107 + .../node_modules/core-util-is/package.json | 62 + .../node_modules/core-util-is/test.js | 68 + .../node_modules/cross-spawn/CHANGELOG.md | 130 + .../node_modules/cross-spawn/LICENSE | 21 + .../node_modules/cross-spawn/README.md | 96 + .../node_modules/cross-spawn/index.js | 39 + .../node_modules/cross-spawn/lib/enoent.js | 59 + .../node_modules/cross-spawn/lib/parse.js | 91 + .../cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + .../node_modules/cross-spawn/package.json | 104 + .../cli-study/node_modules/debug/CHANGELOG.md | 395 + day1/cli-study/node_modules/debug/LICENSE | 19 + day1/cli-study/node_modules/debug/README.md | 455 + .../node_modules/debug/dist/debug.js | 912 + .../cli-study/node_modules/debug/package.json | 102 + .../node_modules/debug/src/browser.js | 264 + .../node_modules/debug/src/common.js | 266 + .../cli-study/node_modules/debug/src/index.js | 10 + day1/cli-study/node_modules/debug/src/node.js | 257 + .../decode-uri-component/index.js | 94 + .../node_modules/decode-uri-component/license | 21 + .../decode-uri-component/package.json | 69 + .../decode-uri-component/readme.md | 70 + .../node_modules/decompress-response/index.js | 29 + .../node_modules/decompress-response/license | 21 + .../decompress-response/package.json | 85 + .../decompress-response/readme.md | 31 + .../node_modules/decompress-tar/index.js | 59 + .../node_modules/decompress-tar/license | 9 + .../node_modules/file-type/index.js | 559 + .../node_modules/file-type/license | 21 + .../node_modules/file-type/package.json | 141 + .../node_modules/file-type/readme.md | 156 + .../node_modules/decompress-tar/package.json | 72 + .../node_modules/decompress-tar/readme.md | 44 + .../node_modules/decompress-tarbz2/index.js | 22 + .../node_modules/decompress-tarbz2/license | 9 + .../node_modules/file-type/index.js | 599 + .../node_modules/file-type/license | 9 + .../node_modules/file-type/package.json | 142 + .../node_modules/file-type/readme.md | 165 + .../decompress-tarbz2/package.json | 74 + .../node_modules/decompress-tarbz2/readme.md | 44 + .../node_modules/decompress-targz/index.js | 26 + .../node_modules/decompress-targz/license | 9 + .../node_modules/file-type/index.js | 559 + .../node_modules/file-type/license | 21 + .../node_modules/file-type/package.json | 141 + .../node_modules/file-type/readme.md | 156 + .../decompress-targz/package.json | 71 + .../node_modules/decompress-targz/readme.md | 44 + .../node_modules/decompress-unzip/index.js | 86 + .../node_modules/decompress-unzip/license | 21 + .../node_modules/file-type/index.js | 452 + .../node_modules/file-type/license | 21 + .../node_modules/file-type/package.json | 135 + .../node_modules/file-type/readme.md | 149 + .../node_modules/get-stream/buffer-stream.js | 54 + .../node_modules/get-stream/index.js | 59 + .../node_modules/get-stream/license | 21 + .../node_modules/get-stream/package.json | 81 + .../node_modules/get-stream/readme.md | 115 + .../node_modules/pify/index.js | 68 + .../node_modules/pify/license | 21 + .../node_modules/pify/package.json | 80 + .../node_modules/pify/readme.md | 119 + .../decompress-unzip/package.json | 76 + .../node_modules/decompress-unzip/readme.md | 42 + .../node_modules/decompress/index.js | 151 + .../cli-study/node_modules/decompress/license | 9 + .../decompress/node_modules/pify/index.js | 68 + .../decompress/node_modules/pify/license | 21 + .../decompress/node_modules/pify/package.json | 80 + .../decompress/node_modules/pify/readme.md | 119 + .../node_modules/decompress/package.json | 93 + .../node_modules/decompress/readme.md | 105 + .../cli-study/node_modules/deep-is/.npmignore | 1 + .../node_modules/deep-is/.travis.yml | 6 + day1/cli-study/node_modules/deep-is/LICENSE | 22 + .../node_modules/deep-is/README.markdown | 70 + .../node_modules/deep-is/example/cmp.js | 11 + day1/cli-study/node_modules/deep-is/index.js | 102 + .../node_modules/deep-is/package.json | 90 + .../node_modules/deep-is/test/NaN.js | 16 + .../node_modules/deep-is/test/cmp.js | 23 + .../node_modules/deep-is/test/neg-vs-pos-0.js | 15 + .../node_modules/defaults/.npmignore | 1 + day1/cli-study/node_modules/defaults/LICENSE | 21 + .../cli-study/node_modules/defaults/README.md | 43 + day1/cli-study/node_modules/defaults/index.js | 13 + .../node_modules/defaults/package.json | 57 + day1/cli-study/node_modules/defaults/test.js | 34 + .../define-properties/.editorconfig | 13 + .../node_modules/define-properties/.eslintrc | 12 + .../node_modules/define-properties/.jscs.json | 175 + .../define-properties/.travis.yml | 233 + .../define-properties/CHANGELOG.md | 44 + .../node_modules/define-properties/LICENSE | 21 + .../node_modules/define-properties/README.md | 86 + .../node_modules/define-properties/index.js | 58 + .../define-properties/package.json | 102 + .../define-properties/test/index.js | 125 + .../node_modules/doctrine/CHANGELOG.md | 101 + day1/cli-study/node_modules/doctrine/LICENSE | 177 + .../doctrine/LICENSE.closure-compiler | 202 + .../node_modules/doctrine/LICENSE.esprima | 19 + .../cli-study/node_modules/doctrine/README.md | 165 + .../node_modules/doctrine/lib/doctrine.js | 898 + .../node_modules/doctrine/lib/typed.js | 1305 ++ .../node_modules/doctrine/lib/utility.js | 35 + .../node_modules/doctrine/package.json | 89 + .../download-git-repo/.gitlab-ci.yml | 19 + .../node_modules/download-git-repo/Makefile | 8 + .../node_modules/download-git-repo/README.md | 105 + .../node_modules/download-git-repo/index.js | 167 + .../node_modules/.bin/rimraf | 15 + .../node_modules/.bin/rimraf.cmd | 17 + .../node_modules/.bin/rimraf.ps1 | 18 + .../node_modules/rimraf/CHANGELOG.md | 65 + .../node_modules/rimraf/LICENSE | 15 + .../node_modules/rimraf/README.md | 101 + .../node_modules/rimraf/bin.js | 68 + .../node_modules/rimraf/package.json | 70 + .../node_modules/rimraf/rimraf.js | 360 + .../download-git-repo/package.json | 76 + .../test/fixtures/bitbucket/master/README.md | 1 + .../fixtures/bitbucket/master/bar/README.md | 1 + .../bitbucket/master/bitbucket-only-file.md | 1 + .../fixtures/bitbucket/master/foo/README.md | 1 + .../my-branch-with-slashes/README.md | 1 + .../my-branch-with-slashes/bar/README.md | 1 + .../bitbucket-only-file.md | 1 + .../branch-with-slashes-only-file.md | 1 + .../my-branch-with-slashes/foo/README.md | 1 + .../fixtures/bitbucket/my-branch/README.md | 1 + .../bitbucket/my-branch/bar/README.md | 1 + .../my-branch/bitbucket-only-file.md | 1 + .../bitbucket/my-branch/branch-only-file.md | 1 + .../bitbucket/my-branch/foo/README.md | 1 + .../test/fixtures/github/master/README.md | 1 + .../test/fixtures/github/master/bar/README.md | 1 + .../test/fixtures/github/master/foo/README.md | 1 + .../github/master/github-only-file.md | 1 + .../github/my-branch-with-slashes/README.md | 1 + .../my-branch-with-slashes/bar/README.md | 1 + .../branch-with-slashes-only-file.md | 1 + .../my-branch-with-slashes/foo/README.md | 1 + .../github-only-file.md | 1 + .../test/fixtures/github/my-branch/README.md | 1 + .../fixtures/github/my-branch/bar/README.md | 1 + .../github/my-branch/branch-only-file.md | 1 + .../fixtures/github/my-branch/foo/README.md | 1 + .../github/my-branch/github-only-file.md | 1 + .../fixtures/gitlab/master-only-md/README.md | 1 + .../gitlab/master-only-md/bar/README.md | 1 + .../gitlab/master-only-md/foo/README.md | 1 + .../gitlab/master-only-md/gitlab-only-file.md | 1 + .../test/fixtures/gitlab/master/README.md | 1 + .../test/fixtures/gitlab/master/UNLICENSE | 24 + .../test/fixtures/gitlab/master/bar/README.md | 1 + .../test/fixtures/gitlab/master/foo/README.md | 1 + .../gitlab/master/gitlab-only-file.md | 1 + .../gitlab/my-branch-with-slashes/README.md | 1 + .../my-branch-with-slashes/bar/README.md | 1 + .../branch-with-slashes-only-file.md | 1 + .../my-branch-with-slashes/foo/README.md | 1 + .../gitlab-only-file.md | 1 + .../test/fixtures/gitlab/my-branch/README.md | 1 + .../fixtures/gitlab/my-branch/bar/README.md | 1 + .../gitlab/my-branch/branch-only-file.md | 1 + .../fixtures/gitlab/my-branch/foo/README.md | 1 + .../gitlab/my-branch/gitlab-only-file.md | 1 + .../download-git-repo/test/index.js | 189 + day1/cli-study/node_modules/download/index.js | 119 + day1/cli-study/node_modules/download/license | 9 + .../node_modules/download/package.json | 83 + .../cli-study/node_modules/download/readme.md | 86 + .../node_modules/duplexer3/LICENSE.md | 26 + .../node_modules/duplexer3/README.md | 115 + .../cli-study/node_modules/duplexer3/index.js | 76 + .../node_modules/duplexer3/package.json | 64 + day1/cli-study/node_modules/ejs/LICENSE | 202 + day1/cli-study/node_modules/ejs/README.md | 341 + day1/cli-study/node_modules/ejs/bin/cli.js | 208 + day1/cli-study/node_modules/ejs/ejs.js | 1650 ++ day1/cli-study/node_modules/ejs/ejs.min.js | 1 + day1/cli-study/node_modules/ejs/jakefile.js | 76 + day1/cli-study/node_modules/ejs/lib/ejs.js | 938 + day1/cli-study/node_modules/ejs/lib/utils.js | 167 + day1/cli-study/node_modules/ejs/package.json | 75 + .../cli-study/node_modules/ejs/postinstall.js | 17 + day1/cli-study/node_modules/ejs/usage.txt | 24 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 5 + .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 78 + .../node_modules/emoji-regex/text.js | 6 + .../node_modules/enable/.editorconfig | 12 + day1/cli-study/node_modules/enable/.npmignore | 8 + day1/cli-study/node_modules/enable/AUTHORS | 8 + day1/cli-study/node_modules/enable/History.md | 42 + day1/cli-study/node_modules/enable/LICENSE | 22 + day1/cli-study/node_modules/enable/README.md | 118 + day1/cli-study/node_modules/enable/index.js | 107 + .../node_modules/enable/package.json | 95 + .../node_modules/end-of-stream/LICENSE | 21 + .../node_modules/end-of-stream/README.md | 54 + .../node_modules/end-of-stream/index.js | 94 + .../node_modules/end-of-stream/package.json | 65 + .../node_modules/enquirer/CHANGELOG.md | 129 + day1/cli-study/node_modules/enquirer/LICENSE | 21 + .../cli-study/node_modules/enquirer/README.md | 1752 ++ .../node_modules/enquirer/index.d.ts | 151 + day1/cli-study/node_modules/enquirer/index.js | 250 + .../node_modules/enquirer/lib/ansi.js | 116 + .../node_modules/enquirer/lib/combos.js | 75 + .../node_modules/enquirer/lib/completer.js | 52 + .../node_modules/enquirer/lib/interpolate.js | 266 + .../node_modules/enquirer/lib/keypress.js | 243 + .../node_modules/enquirer/lib/placeholder.js | 63 + .../node_modules/enquirer/lib/prompt.js | 485 + .../enquirer/lib/prompts/autocomplete.js | 113 + .../enquirer/lib/prompts/basicauth.js | 41 + .../enquirer/lib/prompts/confirm.js | 13 + .../enquirer/lib/prompts/editable.js | 136 + .../node_modules/enquirer/lib/prompts/form.js | 196 + .../enquirer/lib/prompts/index.js | 28 + .../enquirer/lib/prompts/input.js | 55 + .../enquirer/lib/prompts/invisible.js | 11 + .../node_modules/enquirer/lib/prompts/list.js | 36 + .../enquirer/lib/prompts/multiselect.js | 11 + .../enquirer/lib/prompts/numeral.js | 1 + .../enquirer/lib/prompts/password.js | 18 + .../node_modules/enquirer/lib/prompts/quiz.js | 37 + .../enquirer/lib/prompts/scale.js | 237 + .../enquirer/lib/prompts/select.js | 139 + .../enquirer/lib/prompts/snippet.js | 185 + .../node_modules/enquirer/lib/prompts/sort.js | 37 + .../enquirer/lib/prompts/survey.js | 163 + .../node_modules/enquirer/lib/prompts/text.js | 1 + .../enquirer/lib/prompts/toggle.js | 109 + .../node_modules/enquirer/lib/render.js | 33 + .../node_modules/enquirer/lib/roles.js | 46 + .../node_modules/enquirer/lib/state.js | 69 + .../node_modules/enquirer/lib/styles.js | 144 + .../node_modules/enquirer/lib/symbols.js | 66 + .../node_modules/enquirer/lib/theme.js | 11 + .../node_modules/enquirer/lib/timer.js | 38 + .../node_modules/enquirer/lib/types/array.js | 658 + .../node_modules/enquirer/lib/types/auth.js | 29 + .../enquirer/lib/types/boolean.js | 88 + .../node_modules/enquirer/lib/types/index.js | 7 + .../node_modules/enquirer/lib/types/number.js | 86 + .../node_modules/enquirer/lib/types/string.js | 185 + .../node_modules/enquirer/lib/utils.js | 268 + .../node_modules/enquirer/package.json | 148 + day1/cli-study/node_modules/error-ex/LICENSE | 21 + .../cli-study/node_modules/error-ex/README.md | 144 + day1/cli-study/node_modules/error-ex/index.js | 141 + .../node_modules/error-ex/package.json | 86 + .../node_modules/es-abstract/.editorconfig | 13 + .../node_modules/es-abstract/.eslintignore | 1 + .../node_modules/es-abstract/.eslintrc | 66 + .../node_modules/es-abstract/.gitattributes | 472 + .../es-abstract/.github/FUNDING.yml | 12 + .../.github/workflows/codeql-analysis.yml | 52 + .../es-abstract/.github/workflows/rebase.yml | 15 + .../cli-study/node_modules/es-abstract/.nycrc | 14 + .../node_modules/es-abstract/.travis.yml | 32 + .../2015/AbstractEqualityComparison.js | 37 + .../2015/AbstractRelationalComparison.js | 66 + .../es-abstract/2015/AdvanceStringIndex.js | 45 + .../es-abstract/2015/ArrayCreate.js | 53 + .../es-abstract/2015/ArraySetLength.js | 85 + .../es-abstract/2015/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2015/Call.js | 13 + .../2015/CanonicalNumericIndexString.js | 22 + .../2015/CompletePropertyDescriptor.js | 39 + .../es-abstract/2015/CreateDataProperty.js | 45 + .../2015/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2015/CreateHTML.js | 30 + .../2015/CreateIterResultObject.js | 19 + .../2015/CreateListFromArrayLike.js | 43 + .../es-abstract/2015/CreateMethodProperty.js | 40 + .../es-abstract/2015/DateFromTime.js | 54 + .../node_modules/es-abstract/2015/Day.js | 13 + .../es-abstract/2015/DayFromYear.js | 12 + .../es-abstract/2015/DayWithinYear.js | 11 + .../es-abstract/2015/DaysInYear.js | 18 + .../es-abstract/2015/DefinePropertyOrThrow.js | 50 + .../es-abstract/2015/DeletePropertyOrThrow.js | 27 + .../es-abstract/2015/EnumerableOwnNames.js | 19 + .../2015/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2015/Get.js | 30 + .../es-abstract/2015/GetIterator.js | 35 + .../es-abstract/2015/GetMethod.js | 42 + .../es-abstract/2015/GetOwnPropertyKeys.js | 31 + .../2015/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2015/GetSubstitution.js | 104 + .../node_modules/es-abstract/2015/GetV.js | 29 + .../es-abstract/2015/HasOwnProperty.js | 22 + .../es-abstract/2015/HasProperty.js | 20 + .../es-abstract/2015/HourFromTime.js | 16 + .../es-abstract/2015/InLeapYear.js | 21 + .../es-abstract/2015/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2015/Invoke.js | 22 + .../es-abstract/2015/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2015/IsArray.js | 14 + .../es-abstract/2015/IsCallable.js | 5 + .../es-abstract/2015/IsConcatSpreadable.js | 25 + .../es-abstract/2015/IsConstructor.js | 40 + .../es-abstract/2015/IsDataDescriptor.js | 23 + .../es-abstract/2015/IsExtensible.js | 20 + .../es-abstract/2015/IsGenericDescriptor.js | 23 + .../es-abstract/2015/IsInteger.js | 21 + .../es-abstract/2015/IsPromise.js | 24 + .../es-abstract/2015/IsPropertyDescriptor.js | 17 + .../es-abstract/2015/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2015/IsRegExp.js | 24 + .../es-abstract/2015/IteratorClose.js | 50 + .../es-abstract/2015/IteratorComplete.js | 18 + .../es-abstract/2015/IteratorNext.js | 18 + .../es-abstract/2015/IteratorStep.js | 13 + .../es-abstract/2015/IteratorValue.js | 18 + .../node_modules/es-abstract/2015/MakeDate.js | 13 + .../node_modules/es-abstract/2015/MakeDay.js | 33 + .../node_modules/es-abstract/2015/MakeTime.js | 23 + .../es-abstract/2015/MinFromTime.js | 16 + .../es-abstract/2015/MonthFromTime.js | 47 + .../es-abstract/2015/ObjectCreate.js | 37 + .../2015/OrdinaryDefineOwnProperty.js | 61 + .../2015/OrdinaryGetOwnProperty.js | 44 + .../es-abstract/2015/OrdinaryHasInstance.js | 25 + .../es-abstract/2015/OrdinaryHasProperty.js | 20 + .../es-abstract/2015/RegExpExec.js | 32 + .../2015/RequireObjectCoercible.js | 3 + .../es-abstract/2015/SameValue.js | 13 + .../es-abstract/2015/SameValueZero.js | 9 + .../es-abstract/2015/SecFromTime.js | 16 + .../node_modules/es-abstract/2015/Set.js | 47 + .../es-abstract/2015/SetFunctionName.js | 44 + .../es-abstract/2015/SetIntegrityLevel.js | 57 + .../es-abstract/2015/SpeciesConstructor.js | 32 + .../2015/StrictEqualityComparison.js | 17 + .../2015/SymbolDescriptiveString.js | 20 + .../es-abstract/2015/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2015/TimeClip.js | 21 + .../es-abstract/2015/TimeFromYear.js | 11 + .../es-abstract/2015/TimeWithinDay.js | 11 + .../es-abstract/2015/ToBoolean.js | 5 + .../es-abstract/2015/ToDateString.js | 22 + .../node_modules/es-abstract/2015/ToInt16.js | 10 + .../node_modules/es-abstract/2015/ToInt32.js | 9 + .../node_modules/es-abstract/2015/ToInt8.js | 10 + .../es-abstract/2015/ToInteger.js | 12 + .../node_modules/es-abstract/2015/ToLength.js | 12 + .../node_modules/es-abstract/2015/ToNumber.js | 59 + .../node_modules/es-abstract/2015/ToObject.js | 14 + .../es-abstract/2015/ToPrimitive.js | 12 + .../es-abstract/2015/ToPropertyDescriptor.js | 52 + .../es-abstract/2015/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2015/ToString.js | 15 + .../node_modules/es-abstract/2015/ToUint16.js | 24 + .../node_modules/es-abstract/2015/ToUint32.js | 9 + .../node_modules/es-abstract/2015/ToUint8.js | 22 + .../es-abstract/2015/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2015/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2015/WeekDay.js | 11 + .../es-abstract/2015/YearFromTime.js | 16 + .../node_modules/es-abstract/2015/modulo.js | 9 + .../es-abstract/2015/msFromTime.js | 10 + .../es-abstract/2015/thisBooleanValue.js | 15 + .../es-abstract/2015/thisNumberValue.js | 18 + .../es-abstract/2015/thisStringValue.js | 15 + .../es-abstract/2015/thisTimeValue.js | 9 + .../2016/AbstractEqualityComparison.js | 37 + .../2016/AbstractRelationalComparison.js | 66 + .../es-abstract/2016/AdvanceStringIndex.js | 45 + .../es-abstract/2016/ArrayCreate.js | 53 + .../es-abstract/2016/ArraySetLength.js | 85 + .../es-abstract/2016/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2016/Call.js | 13 + .../2016/CanonicalNumericIndexString.js | 22 + .../2016/CompletePropertyDescriptor.js | 39 + .../es-abstract/2016/CreateDataProperty.js | 45 + .../2016/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2016/CreateHTML.js | 30 + .../2016/CreateIterResultObject.js | 19 + .../2016/CreateListFromArrayLike.js | 43 + .../es-abstract/2016/CreateMethodProperty.js | 40 + .../es-abstract/2016/DateFromTime.js | 54 + .../node_modules/es-abstract/2016/Day.js | 13 + .../es-abstract/2016/DayFromYear.js | 12 + .../es-abstract/2016/DayWithinYear.js | 11 + .../es-abstract/2016/DaysInYear.js | 18 + .../es-abstract/2016/DefinePropertyOrThrow.js | 50 + .../es-abstract/2016/DeletePropertyOrThrow.js | 27 + .../es-abstract/2016/EnumerableOwnNames.js | 19 + .../2016/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2016/Get.js | 30 + .../es-abstract/2016/GetIterator.js | 35 + .../es-abstract/2016/GetMethod.js | 42 + .../es-abstract/2016/GetOwnPropertyKeys.js | 31 + .../2016/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2016/GetSubstitution.js | 104 + .../node_modules/es-abstract/2016/GetV.js | 29 + .../es-abstract/2016/HasOwnProperty.js | 22 + .../es-abstract/2016/HasProperty.js | 20 + .../es-abstract/2016/HourFromTime.js | 16 + .../es-abstract/2016/InLeapYear.js | 21 + .../es-abstract/2016/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2016/Invoke.js | 22 + .../es-abstract/2016/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2016/IsArray.js | 14 + .../es-abstract/2016/IsCallable.js | 5 + .../es-abstract/2016/IsConcatSpreadable.js | 25 + .../es-abstract/2016/IsConstructor.js | 40 + .../es-abstract/2016/IsDataDescriptor.js | 23 + .../es-abstract/2016/IsExtensible.js | 20 + .../es-abstract/2016/IsGenericDescriptor.js | 23 + .../es-abstract/2016/IsInteger.js | 21 + .../es-abstract/2016/IsPromise.js | 24 + .../es-abstract/2016/IsPropertyDescriptor.js | 17 + .../es-abstract/2016/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2016/IsRegExp.js | 24 + .../es-abstract/2016/IterableToArrayLike.js | 56 + .../es-abstract/2016/IteratorClose.js | 50 + .../es-abstract/2016/IteratorComplete.js | 18 + .../es-abstract/2016/IteratorNext.js | 18 + .../es-abstract/2016/IteratorStep.js | 13 + .../es-abstract/2016/IteratorValue.js | 18 + .../node_modules/es-abstract/2016/MakeDate.js | 13 + .../node_modules/es-abstract/2016/MakeDay.js | 33 + .../node_modules/es-abstract/2016/MakeTime.js | 23 + .../es-abstract/2016/MinFromTime.js | 16 + .../es-abstract/2016/MonthFromTime.js | 47 + .../es-abstract/2016/ObjectCreate.js | 37 + .../2016/OrdinaryDefineOwnProperty.js | 61 + .../2016/OrdinaryGetOwnProperty.js | 44 + .../2016/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2016/OrdinaryHasInstance.js | 25 + .../es-abstract/2016/OrdinaryHasProperty.js | 20 + .../2016/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2016/RegExpExec.js | 32 + .../2016/RequireObjectCoercible.js | 3 + .../es-abstract/2016/SameValue.js | 13 + .../es-abstract/2016/SameValueNonNumber.js | 16 + .../es-abstract/2016/SameValueZero.js | 9 + .../es-abstract/2016/SecFromTime.js | 16 + .../node_modules/es-abstract/2016/Set.js | 47 + .../es-abstract/2016/SetFunctionName.js | 44 + .../es-abstract/2016/SetIntegrityLevel.js | 57 + .../es-abstract/2016/SpeciesConstructor.js | 32 + .../2016/StrictEqualityComparison.js | 17 + .../2016/SymbolDescriptiveString.js | 20 + .../es-abstract/2016/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2016/TimeClip.js | 21 + .../es-abstract/2016/TimeFromYear.js | 11 + .../es-abstract/2016/TimeWithinDay.js | 11 + .../es-abstract/2016/ToBoolean.js | 5 + .../es-abstract/2016/ToDateString.js | 22 + .../node_modules/es-abstract/2016/ToInt16.js | 10 + .../node_modules/es-abstract/2016/ToInt32.js | 9 + .../node_modules/es-abstract/2016/ToInt8.js | 10 + .../es-abstract/2016/ToInteger.js | 12 + .../node_modules/es-abstract/2016/ToLength.js | 12 + .../node_modules/es-abstract/2016/ToNumber.js | 59 + .../node_modules/es-abstract/2016/ToObject.js | 14 + .../es-abstract/2016/ToPrimitive.js | 12 + .../es-abstract/2016/ToPropertyDescriptor.js | 52 + .../es-abstract/2016/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2016/ToString.js | 15 + .../node_modules/es-abstract/2016/ToUint16.js | 24 + .../node_modules/es-abstract/2016/ToUint32.js | 9 + .../node_modules/es-abstract/2016/ToUint8.js | 22 + .../es-abstract/2016/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2016/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2016/WeekDay.js | 11 + .../es-abstract/2016/YearFromTime.js | 16 + .../node_modules/es-abstract/2016/modulo.js | 9 + .../es-abstract/2016/msFromTime.js | 10 + .../es-abstract/2016/thisBooleanValue.js | 15 + .../es-abstract/2016/thisNumberValue.js | 18 + .../es-abstract/2016/thisStringValue.js | 15 + .../es-abstract/2016/thisTimeValue.js | 9 + .../2017/AbstractEqualityComparison.js | 37 + .../2017/AbstractRelationalComparison.js | 66 + .../es-abstract/2017/AdvanceStringIndex.js | 45 + .../es-abstract/2017/ArrayCreate.js | 53 + .../es-abstract/2017/ArraySetLength.js | 85 + .../es-abstract/2017/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2017/Call.js | 13 + .../2017/CanonicalNumericIndexString.js | 22 + .../2017/CompletePropertyDescriptor.js | 39 + .../es-abstract/2017/CreateDataProperty.js | 45 + .../2017/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2017/CreateHTML.js | 30 + .../2017/CreateIterResultObject.js | 19 + .../2017/CreateListFromArrayLike.js | 43 + .../es-abstract/2017/CreateMethodProperty.js | 40 + .../es-abstract/2017/DateFromTime.js | 54 + .../node_modules/es-abstract/2017/Day.js | 13 + .../es-abstract/2017/DayFromYear.js | 12 + .../es-abstract/2017/DayWithinYear.js | 11 + .../es-abstract/2017/DaysInYear.js | 18 + .../es-abstract/2017/DefinePropertyOrThrow.js | 50 + .../es-abstract/2017/DeletePropertyOrThrow.js | 27 + .../2017/EnumerableOwnProperties.js | 43 + .../2017/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2017/Get.js | 30 + .../es-abstract/2017/GetIterator.js | 35 + .../es-abstract/2017/GetMethod.js | 42 + .../es-abstract/2017/GetOwnPropertyKeys.js | 31 + .../2017/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2017/GetSubstitution.js | 104 + .../node_modules/es-abstract/2017/GetV.js | 29 + .../es-abstract/2017/HasOwnProperty.js | 22 + .../es-abstract/2017/HasProperty.js | 20 + .../es-abstract/2017/HourFromTime.js | 16 + .../es-abstract/2017/InLeapYear.js | 21 + .../es-abstract/2017/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2017/Invoke.js | 22 + .../es-abstract/2017/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2017/IsArray.js | 14 + .../es-abstract/2017/IsCallable.js | 5 + .../es-abstract/2017/IsConcatSpreadable.js | 25 + .../es-abstract/2017/IsConstructor.js | 40 + .../es-abstract/2017/IsDataDescriptor.js | 23 + .../es-abstract/2017/IsExtensible.js | 20 + .../es-abstract/2017/IsGenericDescriptor.js | 23 + .../es-abstract/2017/IsInteger.js | 21 + .../es-abstract/2017/IsPromise.js | 24 + .../es-abstract/2017/IsPropertyDescriptor.js | 17 + .../es-abstract/2017/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2017/IsRegExp.js | 24 + .../es-abstract/2017/IterableToList.js | 24 + .../es-abstract/2017/IteratorClose.js | 50 + .../es-abstract/2017/IteratorComplete.js | 18 + .../es-abstract/2017/IteratorNext.js | 18 + .../es-abstract/2017/IteratorStep.js | 13 + .../es-abstract/2017/IteratorValue.js | 18 + .../node_modules/es-abstract/2017/MakeDate.js | 13 + .../node_modules/es-abstract/2017/MakeDay.js | 33 + .../node_modules/es-abstract/2017/MakeTime.js | 23 + .../es-abstract/2017/MinFromTime.js | 16 + .../es-abstract/2017/MonthFromTime.js | 47 + .../es-abstract/2017/ObjectCreate.js | 37 + .../2017/OrdinaryDefineOwnProperty.js | 61 + .../2017/OrdinaryGetOwnProperty.js | 44 + .../2017/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2017/OrdinaryHasInstance.js | 25 + .../es-abstract/2017/OrdinaryHasProperty.js | 20 + .../2017/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2017/RegExpExec.js | 32 + .../2017/RequireObjectCoercible.js | 3 + .../es-abstract/2017/SameValue.js | 13 + .../es-abstract/2017/SameValueNonNumber.js | 16 + .../es-abstract/2017/SameValueZero.js | 9 + .../es-abstract/2017/SecFromTime.js | 16 + .../node_modules/es-abstract/2017/Set.js | 47 + .../es-abstract/2017/SetFunctionName.js | 44 + .../es-abstract/2017/SetIntegrityLevel.js | 57 + .../es-abstract/2017/SpeciesConstructor.js | 32 + .../2017/StrictEqualityComparison.js | 17 + .../2017/SymbolDescriptiveString.js | 20 + .../es-abstract/2017/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2017/TimeClip.js | 21 + .../es-abstract/2017/TimeFromYear.js | 11 + .../es-abstract/2017/TimeWithinDay.js | 11 + .../es-abstract/2017/ToBoolean.js | 5 + .../es-abstract/2017/ToDateString.js | 22 + .../node_modules/es-abstract/2017/ToIndex.js | 26 + .../node_modules/es-abstract/2017/ToInt16.js | 10 + .../node_modules/es-abstract/2017/ToInt32.js | 9 + .../node_modules/es-abstract/2017/ToInt8.js | 10 + .../es-abstract/2017/ToInteger.js | 12 + .../node_modules/es-abstract/2017/ToLength.js | 12 + .../node_modules/es-abstract/2017/ToNumber.js | 59 + .../node_modules/es-abstract/2017/ToObject.js | 14 + .../es-abstract/2017/ToPrimitive.js | 12 + .../es-abstract/2017/ToPropertyDescriptor.js | 52 + .../es-abstract/2017/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2017/ToString.js | 15 + .../node_modules/es-abstract/2017/ToUint16.js | 24 + .../node_modules/es-abstract/2017/ToUint32.js | 9 + .../node_modules/es-abstract/2017/ToUint8.js | 22 + .../es-abstract/2017/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2017/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2017/WeekDay.js | 11 + .../es-abstract/2017/YearFromTime.js | 16 + .../node_modules/es-abstract/2017/modulo.js | 9 + .../es-abstract/2017/msFromTime.js | 10 + .../es-abstract/2017/thisBooleanValue.js | 15 + .../es-abstract/2017/thisNumberValue.js | 18 + .../es-abstract/2017/thisStringValue.js | 15 + .../es-abstract/2017/thisTimeValue.js | 9 + .../2018/AbstractEqualityComparison.js | 37 + .../2018/AbstractRelationalComparison.js | 66 + .../es-abstract/2018/AdvanceStringIndex.js | 45 + .../es-abstract/2018/ArrayCreate.js | 53 + .../es-abstract/2018/ArraySetLength.js | 85 + .../es-abstract/2018/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2018/Call.js | 13 + .../2018/CanonicalNumericIndexString.js | 22 + .../2018/CompletePropertyDescriptor.js | 39 + .../es-abstract/2018/CopyDataProperties.js | 64 + .../es-abstract/2018/CreateDataProperty.js | 45 + .../2018/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2018/CreateHTML.js | 30 + .../2018/CreateIterResultObject.js | 19 + .../2018/CreateListFromArrayLike.js | 43 + .../es-abstract/2018/CreateMethodProperty.js | 40 + .../es-abstract/2018/DateFromTime.js | 54 + .../es-abstract/2018/DateString.js | 30 + .../node_modules/es-abstract/2018/Day.js | 13 + .../es-abstract/2018/DayFromYear.js | 12 + .../es-abstract/2018/DayWithinYear.js | 11 + .../es-abstract/2018/DaysInYear.js | 18 + .../es-abstract/2018/DefinePropertyOrThrow.js | 50 + .../es-abstract/2018/DeletePropertyOrThrow.js | 27 + .../2018/EnumerableOwnPropertyNames.js | 43 + .../2018/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2018/Get.js | 30 + .../es-abstract/2018/GetIterator.js | 35 + .../es-abstract/2018/GetMethod.js | 42 + .../es-abstract/2018/GetOwnPropertyKeys.js | 31 + .../2018/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2018/GetSubstitution.js | 128 + .../node_modules/es-abstract/2018/GetV.js | 29 + .../es-abstract/2018/HasOwnProperty.js | 22 + .../es-abstract/2018/HasProperty.js | 20 + .../es-abstract/2018/HourFromTime.js | 16 + .../es-abstract/2018/InLeapYear.js | 21 + .../es-abstract/2018/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2018/Invoke.js | 22 + .../es-abstract/2018/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2018/IsArray.js | 14 + .../es-abstract/2018/IsCallable.js | 5 + .../es-abstract/2018/IsConcatSpreadable.js | 25 + .../es-abstract/2018/IsConstructor.js | 40 + .../es-abstract/2018/IsDataDescriptor.js | 23 + .../es-abstract/2018/IsExtensible.js | 20 + .../es-abstract/2018/IsGenericDescriptor.js | 23 + .../es-abstract/2018/IsInteger.js | 21 + .../es-abstract/2018/IsPromise.js | 24 + .../es-abstract/2018/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2018/IsRegExp.js | 24 + .../es-abstract/2018/IsStringPrefix.js | 47 + .../es-abstract/2018/IterableToList.js | 24 + .../es-abstract/2018/IteratorClose.js | 50 + .../es-abstract/2018/IteratorComplete.js | 18 + .../es-abstract/2018/IteratorNext.js | 18 + .../es-abstract/2018/IteratorStep.js | 13 + .../es-abstract/2018/IteratorValue.js | 18 + .../node_modules/es-abstract/2018/MakeDate.js | 13 + .../node_modules/es-abstract/2018/MakeDay.js | 33 + .../node_modules/es-abstract/2018/MakeTime.js | 23 + .../es-abstract/2018/MinFromTime.js | 16 + .../es-abstract/2018/MonthFromTime.js | 47 + .../es-abstract/2018/NumberToString.js | 18 + .../es-abstract/2018/ObjectCreate.js | 37 + .../2018/OrdinaryDefineOwnProperty.js | 61 + .../2018/OrdinaryGetOwnProperty.js | 44 + .../2018/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2018/OrdinaryHasInstance.js | 25 + .../es-abstract/2018/OrdinaryHasProperty.js | 20 + .../2018/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2018/PromiseResolve.js | 15 + .../es-abstract/2018/RegExpExec.js | 32 + .../2018/RequireObjectCoercible.js | 3 + .../es-abstract/2018/SameValue.js | 13 + .../es-abstract/2018/SameValueNonNumber.js | 16 + .../es-abstract/2018/SameValueZero.js | 9 + .../es-abstract/2018/SecFromTime.js | 16 + .../node_modules/es-abstract/2018/Set.js | 47 + .../es-abstract/2018/SetFunctionName.js | 44 + .../es-abstract/2018/SetIntegrityLevel.js | 57 + .../es-abstract/2018/SpeciesConstructor.js | 32 + .../2018/StrictEqualityComparison.js | 17 + .../2018/SymbolDescriptiveString.js | 20 + .../es-abstract/2018/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2018/TimeClip.js | 21 + .../es-abstract/2018/TimeFromYear.js | 11 + .../es-abstract/2018/TimeString.js | 25 + .../es-abstract/2018/TimeWithinDay.js | 11 + .../es-abstract/2018/ToBoolean.js | 5 + .../es-abstract/2018/ToDateString.js | 22 + .../node_modules/es-abstract/2018/ToIndex.js | 26 + .../node_modules/es-abstract/2018/ToInt16.js | 10 + .../node_modules/es-abstract/2018/ToInt32.js | 9 + .../node_modules/es-abstract/2018/ToInt8.js | 10 + .../es-abstract/2018/ToInteger.js | 12 + .../node_modules/es-abstract/2018/ToLength.js | 12 + .../node_modules/es-abstract/2018/ToNumber.js | 59 + .../node_modules/es-abstract/2018/ToObject.js | 14 + .../es-abstract/2018/ToPrimitive.js | 12 + .../es-abstract/2018/ToPropertyDescriptor.js | 52 + .../es-abstract/2018/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2018/ToString.js | 15 + .../node_modules/es-abstract/2018/ToUint16.js | 24 + .../node_modules/es-abstract/2018/ToUint32.js | 9 + .../node_modules/es-abstract/2018/ToUint8.js | 22 + .../es-abstract/2018/ToUint8Clamp.js | 24 + .../node_modules/es-abstract/2018/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2018/WeekDay.js | 11 + .../es-abstract/2018/YearFromTime.js | 16 + .../node_modules/es-abstract/2018/modulo.js | 9 + .../es-abstract/2018/msFromTime.js | 10 + .../es-abstract/2018/thisBooleanValue.js | 15 + .../es-abstract/2018/thisNumberValue.js | 18 + .../es-abstract/2018/thisStringValue.js | 15 + .../es-abstract/2018/thisSymbolValue.js | 19 + .../es-abstract/2018/thisTimeValue.js | 9 + .../2019/AbstractEqualityComparison.js | 37 + .../2019/AbstractRelationalComparison.js | 66 + .../2019/AddEntriesFromIterable.js | 52 + .../es-abstract/2019/AdvanceStringIndex.js | 45 + .../es-abstract/2019/ArrayCreate.js | 53 + .../es-abstract/2019/ArraySetLength.js | 85 + .../es-abstract/2019/ArraySpeciesCreate.js | 46 + .../node_modules/es-abstract/2019/Call.js | 13 + .../2019/CanonicalNumericIndexString.js | 22 + .../2019/CompletePropertyDescriptor.js | 39 + .../es-abstract/2019/CopyDataProperties.js | 64 + .../es-abstract/2019/CreateDataProperty.js | 45 + .../2019/CreateDataPropertyOrThrow.js | 25 + .../es-abstract/2019/CreateHTML.js | 30 + .../2019/CreateIterResultObject.js | 19 + .../2019/CreateListFromArrayLike.js | 43 + .../es-abstract/2019/CreateMethodProperty.js | 40 + .../es-abstract/2019/DateFromTime.js | 54 + .../es-abstract/2019/DateString.js | 30 + .../node_modules/es-abstract/2019/Day.js | 13 + .../es-abstract/2019/DayFromYear.js | 12 + .../es-abstract/2019/DayWithinYear.js | 11 + .../es-abstract/2019/DaysInYear.js | 18 + .../es-abstract/2019/DefinePropertyOrThrow.js | 50 + .../es-abstract/2019/DeletePropertyOrThrow.js | 27 + .../2019/EnumerableOwnPropertyNames.js | 43 + .../es-abstract/2019/FlattenIntoArray.js | 58 + .../2019/FromPropertyDescriptor.js | 36 + .../node_modules/es-abstract/2019/Get.js | 30 + .../es-abstract/2019/GetIterator.js | 35 + .../es-abstract/2019/GetMethod.js | 42 + .../es-abstract/2019/GetOwnPropertyKeys.js | 31 + .../2019/GetPrototypeFromConstructor.js | 28 + .../es-abstract/2019/GetSubstitution.js | 128 + .../node_modules/es-abstract/2019/GetV.js | 29 + .../es-abstract/2019/HasOwnProperty.js | 22 + .../es-abstract/2019/HasProperty.js | 20 + .../es-abstract/2019/HourFromTime.js | 16 + .../es-abstract/2019/InLeapYear.js | 21 + .../es-abstract/2019/InstanceofOperator.js | 30 + .../node_modules/es-abstract/2019/Invoke.js | 22 + .../es-abstract/2019/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/2019/IsArray.js | 14 + .../es-abstract/2019/IsCallable.js | 5 + .../es-abstract/2019/IsConcatSpreadable.js | 25 + .../es-abstract/2019/IsConstructor.js | 40 + .../es-abstract/2019/IsDataDescriptor.js | 23 + .../es-abstract/2019/IsExtensible.js | 20 + .../es-abstract/2019/IsGenericDescriptor.js | 23 + .../es-abstract/2019/IsInteger.js | 21 + .../es-abstract/2019/IsPromise.js | 24 + .../es-abstract/2019/IsPropertyKey.js | 7 + .../node_modules/es-abstract/2019/IsRegExp.js | 24 + .../es-abstract/2019/IsStringPrefix.js | 47 + .../es-abstract/2019/IterableToList.js | 24 + .../es-abstract/2019/IteratorClose.js | 50 + .../es-abstract/2019/IteratorComplete.js | 18 + .../es-abstract/2019/IteratorNext.js | 18 + .../es-abstract/2019/IteratorStep.js | 13 + .../es-abstract/2019/IteratorValue.js | 18 + .../node_modules/es-abstract/2019/MakeDate.js | 13 + .../node_modules/es-abstract/2019/MakeDay.js | 33 + .../node_modules/es-abstract/2019/MakeTime.js | 23 + .../es-abstract/2019/MinFromTime.js | 16 + .../es-abstract/2019/MonthFromTime.js | 47 + .../es-abstract/2019/NumberToString.js | 18 + .../es-abstract/2019/ObjectCreate.js | 37 + .../2019/OrdinaryDefineOwnProperty.js | 61 + .../2019/OrdinaryGetOwnProperty.js | 44 + .../2019/OrdinaryGetPrototypeOf.js | 21 + .../es-abstract/2019/OrdinaryHasInstance.js | 25 + .../es-abstract/2019/OrdinaryHasProperty.js | 20 + .../2019/OrdinarySetPrototypeOf.js | 53 + .../es-abstract/2019/PromiseResolve.js | 15 + .../es-abstract/2019/RegExpExec.js | 32 + .../2019/RequireObjectCoercible.js | 3 + .../es-abstract/2019/SameValue.js | 13 + .../es-abstract/2019/SameValueNonNumber.js | 16 + .../es-abstract/2019/SameValueZero.js | 9 + .../es-abstract/2019/SecFromTime.js | 16 + .../node_modules/es-abstract/2019/Set.js | 47 + .../es-abstract/2019/SetFunctionName.js | 44 + .../es-abstract/2019/SetIntegrityLevel.js | 57 + .../es-abstract/2019/SpeciesConstructor.js | 32 + .../2019/StrictEqualityComparison.js | 17 + .../2019/SymbolDescriptiveString.js | 20 + .../es-abstract/2019/TestIntegrityLevel.js | 42 + .../node_modules/es-abstract/2019/TimeClip.js | 21 + .../es-abstract/2019/TimeFromYear.js | 11 + .../es-abstract/2019/TimeString.js | 25 + .../es-abstract/2019/TimeWithinDay.js | 11 + .../es-abstract/2019/ToBoolean.js | 5 + .../es-abstract/2019/ToDateString.js | 22 + .../node_modules/es-abstract/2019/ToIndex.js | 26 + .../node_modules/es-abstract/2019/ToInt16.js | 10 + .../node_modules/es-abstract/2019/ToInt32.js | 9 + .../node_modules/es-abstract/2019/ToInt8.js | 10 + .../es-abstract/2019/ToInteger.js | 12 + .../node_modules/es-abstract/2019/ToLength.js | 12 + .../node_modules/es-abstract/2019/ToNumber.js | 59 + .../node_modules/es-abstract/2019/ToObject.js | 14 + .../es-abstract/2019/ToPrimitive.js | 12 + .../es-abstract/2019/ToPropertyDescriptor.js | 52 + .../es-abstract/2019/ToPropertyKey.js | 15 + .../node_modules/es-abstract/2019/ToString.js | 15 + .../node_modules/es-abstract/2019/ToUint16.js | 24 + .../node_modules/es-abstract/2019/ToUint32.js | 9 + .../node_modules/es-abstract/2019/ToUint8.js | 22 + .../es-abstract/2019/ToUint8Clamp.js | 24 + .../es-abstract/2019/TrimString.js | 29 + .../node_modules/es-abstract/2019/Type.js | 12 + .../ValidateAndApplyPropertyDescriptor.js | 170 + .../node_modules/es-abstract/2019/WeekDay.js | 11 + .../es-abstract/2019/YearFromTime.js | 16 + .../node_modules/es-abstract/2019/modulo.js | 9 + .../es-abstract/2019/msFromTime.js | 10 + .../es-abstract/2019/thisBooleanValue.js | 15 + .../es-abstract/2019/thisNumberValue.js | 18 + .../es-abstract/2019/thisStringValue.js | 15 + .../es-abstract/2019/thisSymbolValue.js | 19 + .../es-abstract/2019/thisTimeValue.js | 3 + .../5/AbstractEqualityComparison.js | 37 + .../5/AbstractRelationalComparison.js | 66 + .../es-abstract/5/CheckObjectCoercible.js | 14 + .../es-abstract/5/DateFromTime.js | 54 + .../node_modules/es-abstract/5/Day.js | 13 + .../node_modules/es-abstract/5/DayFromYear.js | 12 + .../es-abstract/5/DayWithinYear.js | 11 + .../node_modules/es-abstract/5/DaysInYear.js | 18 + .../es-abstract/5/FromPropertyDescriptor.js | 39 + .../es-abstract/5/HourFromTime.js | 16 + .../node_modules/es-abstract/5/InLeapYear.js | 21 + .../es-abstract/5/IsAccessorDescriptor.js | 23 + .../node_modules/es-abstract/5/IsCallable.js | 5 + .../es-abstract/5/IsDataDescriptor.js | 23 + .../es-abstract/5/IsGenericDescriptor.js | 23 + .../es-abstract/5/IsPropertyDescriptor.js | 17 + .../node_modules/es-abstract/5/MakeDate.js | 13 + .../node_modules/es-abstract/5/MakeDay.js | 33 + .../node_modules/es-abstract/5/MakeTime.js | 23 + .../node_modules/es-abstract/5/MinFromTime.js | 16 + .../es-abstract/5/MonthFromTime.js | 47 + .../node_modules/es-abstract/5/SameValue.js | 13 + .../node_modules/es-abstract/5/SecFromTime.js | 16 + .../es-abstract/5/StrictEqualityComparison.js | 17 + .../node_modules/es-abstract/5/TimeClip.js | 21 + .../es-abstract/5/TimeFromYear.js | 11 + .../es-abstract/5/TimeWithinDay.js | 11 + .../node_modules/es-abstract/5/ToBoolean.js | 5 + .../node_modules/es-abstract/5/ToInt32.js | 9 + .../node_modules/es-abstract/5/ToInteger.js | 22 + .../node_modules/es-abstract/5/ToNumber.js | 7 + .../node_modules/es-abstract/5/ToObject.js | 14 + .../node_modules/es-abstract/5/ToPrimitive.js | 5 + .../es-abstract/5/ToPropertyDescriptor.js | 52 + .../node_modules/es-abstract/5/ToString.js | 12 + .../node_modules/es-abstract/5/ToUint16.js | 24 + .../node_modules/es-abstract/5/ToUint32.js | 9 + .../node_modules/es-abstract/5/Type.js | 24 + .../node_modules/es-abstract/5/WeekDay.js | 11 + .../es-abstract/5/YearFromTime.js | 16 + .../node_modules/es-abstract/5/modulo.js | 9 + .../node_modules/es-abstract/5/msFromTime.js | 10 + .../node_modules/es-abstract/CHANGELOG.md | 357 + .../node_modules/es-abstract/GetIntrinsic.js | 218 + .../node_modules/es-abstract/LICENSE | 21 + .../node_modules/es-abstract/README.md | 48 + .../node_modules/es-abstract/es2015.js | 115 + .../node_modules/es-abstract/es2016.js | 119 + .../node_modules/es-abstract/es2017.js | 120 + .../node_modules/es-abstract/es2018.js | 126 + .../node_modules/es-abstract/es2019.js | 129 + .../cli-study/node_modules/es-abstract/es5.js | 49 + .../cli-study/node_modules/es-abstract/es6.js | 3 + .../cli-study/node_modules/es-abstract/es7.js | 3 + .../es-abstract/helpers/DefineOwnProperty.js | 45 + .../es-abstract/helpers/OwnPropertyKeys.js | 22 + .../es-abstract/helpers/assertRecord.js | 48 + .../es-abstract/helpers/assign.js | 22 + .../es-abstract/helpers/callBind.js | 17 + .../es-abstract/helpers/callBound.js | 15 + .../node_modules/es-abstract/helpers/every.js | 10 + .../es-abstract/helpers/forEach.js | 7 + .../es-abstract/helpers/getInferredName.js | 10 + .../es-abstract/helpers/getIteratorMethod.js | 45 + .../helpers/getOwnPropertyDescriptor.js | 15 + .../es-abstract/helpers/getProto.js | 15 + .../helpers/getSymbolDescription.js | 41 + .../es-abstract/helpers/isFinite.js | 5 + .../node_modules/es-abstract/helpers/isNaN.js | 5 + .../es-abstract/helpers/isPrefixOf.js | 13 + .../es-abstract/helpers/isPrimitive.js | 5 + .../helpers/isPropertyDescriptor.js | 31 + .../helpers/isSamePropertyDescriptor.js | 20 + .../es-abstract/helpers/maxSafeInteger.js | 8 + .../node_modules/es-abstract/helpers/mod.js | 8 + .../es-abstract/helpers/padTimeComponent.js | 9 + .../es-abstract/helpers/regexTester.js | 11 + .../es-abstract/helpers/setProto.js | 16 + .../node_modules/es-abstract/helpers/sign.js | 5 + .../es-abstract/helpers/timeConstants.js | 19 + .../node_modules/es-abstract/index.js | 26 + .../es-abstract/operations/.eslintrc | 5 + .../es-abstract/operations/2015.js | 249 + .../es-abstract/operations/2016.js | 276 + .../es-abstract/operations/2017.js | 324 + .../es-abstract/operations/2018.js | 350 + .../es-abstract/operations/2019.js | 355 + .../node_modules/es-abstract/package.json | 144 + .../es-abstract/test/GetIntrinsic.js | 94 + .../node_modules/es-abstract/test/diffOps.js | 27 + .../node_modules/es-abstract/test/es2015.js | 150 + .../node_modules/es-abstract/test/es2016.js | 173 + .../node_modules/es-abstract/test/es2017.js | 220 + .../node_modules/es-abstract/test/es2018.js | 241 + .../node_modules/es-abstract/test/es2019.js | 246 + .../node_modules/es-abstract/test/es5.js | 786 + .../node_modules/es-abstract/test/es6.js | 18 + .../node_modules/es-abstract/test/es7.js | 18 + .../test/helpers/OwnPropertyKeys.js | 42 + .../es-abstract/test/helpers/assertRecord.js | 60 + .../test/helpers/createBoundESNamespace.js | 21 + .../test/helpers/defineProperty.js | 22 + .../test/helpers/getSymbolDescription.js | 67 + .../test/helpers/runManifestTest.js | 27 + .../es-abstract/test/helpers/values.js | 121 + .../node_modules/es-abstract/test/index.js | 35 + .../node_modules/es-abstract/test/tests.js | 4193 ++++ .../node_modules/es-to-primitive/.eslintrc | 22 + .../es-to-primitive/.github/FUNDING.yml | 12 + .../node_modules/es-to-primitive/.travis.yml | 15 + .../node_modules/es-to-primitive/CHANGELOG.md | 49 + .../node_modules/es-to-primitive/LICENSE | 22 + .../node_modules/es-to-primitive/Makefile | 61 + .../node_modules/es-to-primitive/README.md | 49 + .../node_modules/es-to-primitive/es2015.js | 75 + .../node_modules/es-to-primitive/es5.js | 45 + .../node_modules/es-to-primitive/es6.js | 3 + .../es-to-primitive/helpers/isPrimitive.js | 5 + .../node_modules/es-to-primitive/index.js | 17 + .../node_modules/es-to-primitive/package.json | 113 + .../es-to-primitive/test/es2015.js | 151 + .../node_modules/es-to-primitive/test/es5.js | 118 + .../node_modules/es-to-primitive/test/es6.js | 151 + .../es-to-primitive/test/index.js | 20 + .../escape-string-regexp/index.js | 11 + .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 81 + .../escape-string-regexp/readme.md | 27 + .../eslint-config-airbnb-base/.babelrc | 3 + .../eslint-config-airbnb-base/.eslintrc | 8 + .../eslint-config-airbnb-base/CHANGELOG.md | 347 + .../eslint-config-airbnb-base/LICENSE.md | 21 + .../eslint-config-airbnb-base/README.md | 99 + .../eslint-config-airbnb-base/index.js | 17 + .../eslint-config-airbnb-base/legacy.js | 34 + .../eslint-config-airbnb-base/package.json | 108 + .../rules/best-practices.js | 361 + .../eslint-config-airbnb-base/rules/errors.js | 165 + .../eslint-config-airbnb-base/rules/es6.js | 186 + .../rules/imports.js | 262 + .../eslint-config-airbnb-base/rules/node.js | 43 + .../eslint-config-airbnb-base/rules/strict.js | 6 + .../eslint-config-airbnb-base/rules/style.js | 528 + .../rules/variables.js | 44 + .../eslint-config-airbnb-base/test/.eslintrc | 8 + .../test/requires.js | 13 + .../test/test-base.js | 32 + .../eslint-config-airbnb-base/whitespace.js | 91 + .../eslint-import-resolver-node/CHANGELOG.md | 63 + .../eslint-import-resolver-node/LICENSE | 22 + .../eslint-import-resolver-node/README.md | 44 + .../eslint-import-resolver-node/index.js | 47 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../eslint-import-resolver-node/package.json | 75 + .../eslint-module-utils/.eslintrc.yml | 3 + .../eslint-module-utils/CHANGELOG.md | 103 + .../node_modules/eslint-module-utils/LICENSE | 22 + .../eslint-module-utils/ModuleCache.js | 47 + .../eslint-module-utils/declaredScope.js | 14 + .../node_modules/eslint-module-utils/hash.js | 59 + .../eslint-module-utils/ignore.js | 60 + .../eslint-module-utils/module-require.js | 30 + .../eslint-module-utils/moduleVisitor.js | 141 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../eslint-module-utils/package.json | 60 + .../node_modules/eslint-module-utils/parse.js | 82 + .../eslint-module-utils/resolve.js | 241 + .../eslint-module-utils/unambiguous.js | 30 + .../eslint-plugin-import/CHANGELOG.md | 1258 ++ .../eslint-plugin-import/CONTRIBUTING.md | 116 + .../node_modules/eslint-plugin-import/LICENSE | 22 + .../eslint-plugin-import/README.md | 505 + .../eslint-plugin-import/RELEASE.md | 54 + .../eslint-plugin-import/SECURITY.md | 11 + .../eslint-plugin-import/config/electron.js | 8 + .../eslint-plugin-import/config/errors.js | 14 + .../config/react-native.js | 13 + .../eslint-plugin-import/config/react.js | 18 + .../config/recommended.js | 28 + .../eslint-plugin-import/config/stage-0.js | 12 + .../eslint-plugin-import/config/typescript.js | 28 + .../eslint-plugin-import/config/warnings.js | 12 + .../docs/rules/default.md | 71 + .../docs/rules/dynamic-import-chunkname.md | 85 + .../eslint-plugin-import/docs/rules/export.md | 32 + .../docs/rules/exports-last.md | 50 + .../docs/rules/extensions.md | 167 + .../eslint-plugin-import/docs/rules/first.md | 70 + .../docs/rules/group-exports.md | 117 + .../docs/rules/imports-first.md | 3 + .../docs/rules/max-dependencies.md | 44 + .../eslint-plugin-import/docs/rules/named.md | 98 + .../docs/rules/namespace.md | 99 + .../docs/rules/newline-after-import.md | 87 + .../docs/rules/no-absolute-path.md | 48 + .../eslint-plugin-import/docs/rules/no-amd.md | 35 + .../docs/rules/no-anonymous-default-export.md | 73 + .../docs/rules/no-commonjs.md | 95 + .../docs/rules/no-cycle.md | 92 + .../docs/rules/no-default-export.md | 63 + .../docs/rules/no-deprecated.md | 61 + .../docs/rules/no-duplicates.md | 69 + .../docs/rules/no-dynamic-require.md | 23 + .../docs/rules/no-extraneous-dependencies.md | 124 + .../docs/rules/no-internal-modules.md | 70 + .../docs/rules/no-mutable-exports.md | 52 + .../docs/rules/no-named-as-default-member.md | 47 + .../docs/rules/no-named-as-default.md | 46 + .../docs/rules/no-named-default.md | 27 + .../docs/rules/no-named-export.md | 77 + .../docs/rules/no-namespace.md | 30 + .../docs/rules/no-nodejs-modules.md | 40 + .../docs/rules/no-relative-parent-imports.md | 120 + .../docs/rules/no-restricted-paths.md | 80 + .../docs/rules/no-self-import.md | 30 + .../docs/rules/no-unassigned-import.md | 59 + .../docs/rules/no-unresolved.md | 91 + .../docs/rules/no-unused-modules.md | 107 + .../docs/rules/no-useless-path-segments.md | 79 + .../docs/rules/no-webpack-loader-syntax.md | 36 + .../eslint-plugin-import/docs/rules/order.md | 264 + .../docs/rules/prefer-default-export.md | 58 + .../docs/rules/unambiguous.md | 54 + .../eslint-plugin-import/lib/ExportMap.js | 735 + .../lib/core/importType.js | 102 + .../lib/core/staticRequire.js | 11 + .../eslint-plugin-import/lib/docsUrl.js | 8 + .../lib/importDeclaration.js | 5 + .../eslint-plugin-import/lib/index.js | 67 + .../eslint-plugin-import/lib/rules/default.js | 40 + .../lib/rules/dynamic-import-chunkname.js | 119 + .../eslint-plugin-import/lib/rules/export.js | 170 + .../lib/rules/exports-last.js | 41 + .../lib/rules/extensions.js | 189 + .../eslint-plugin-import/lib/rules/first.js | 132 + .../lib/rules/group-exports.js | 153 + .../lib/rules/imports-first.js | 13 + .../lib/rules/max-dependencies.js | 58 + .../eslint-plugin-import/lib/rules/named.js | 72 + .../lib/rules/namespace.js | 217 + .../lib/rules/newline-after-import.js | 179 + .../lib/rules/no-absolute-path.js | 24 + .../eslint-plugin-import/lib/rules/no-amd.js | 46 + .../lib/rules/no-anonymous-default-export.js | 104 + .../lib/rules/no-commonjs.js | 135 + .../lib/rules/no-cycle.js | 105 + .../lib/rules/no-default-export.js | 41 + .../lib/rules/no-deprecated.js | 143 + .../lib/rules/no-duplicates.js | 288 + .../lib/rules/no-dynamic-require.js | 37 + .../lib/rules/no-extraneous-dependencies.js | 207 + .../lib/rules/no-internal-modules.js | 110 + .../lib/rules/no-mutable-exports.js | 57 + .../lib/rules/no-named-as-default-member.js | 107 + .../lib/rules/no-named-as-default.js | 43 + .../lib/rules/no-named-default.js | 25 + .../lib/rules/no-named-export.js | 35 + .../lib/rules/no-namespace.js | 160 + .../lib/rules/no-nodejs-modules.js | 49 + .../lib/rules/no-relative-parent-imports.js | 49 + .../lib/rules/no-restricted-paths.js | 125 + .../lib/rules/no-self-import.js | 45 + .../lib/rules/no-unassigned-import.js | 76 + .../lib/rules/no-unresolved.js | 49 + .../lib/rules/no-unused-modules.js | 907 + .../lib/rules/no-useless-path-segments.js | 145 + .../lib/rules/no-webpack-loader-syntax.js | 33 + .../eslint-plugin-import/lib/rules/order.js | 686 + .../lib/rules/prefer-default-export.js | 96 + .../lib/rules/unambiguous.js | 36 + .../eslint-plugin-import/memo-parser/LICENSE | 22 + .../memo-parser/README.md | 23 + .../eslint-plugin-import/memo-parser/index.js | 41 + .../memo-parser/package.json | 34 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/doctrine/CHANGELOG.md | 70 + .../node_modules/doctrine/LICENSE.BSD | 22 + .../doctrine/LICENSE.closure-compiler | 202 + .../node_modules/doctrine/LICENSE.esprima | 19 + .../node_modules/doctrine/README.md | 174 + .../node_modules/doctrine/lib/doctrine.js | 897 + .../node_modules/doctrine/lib/typed.js | 1283 ++ .../node_modules/doctrine/lib/utility.js | 35 + .../node_modules/doctrine/package.json | 96 + .../node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../eslint-plugin-import/package.json | 157 + .../node_modules/eslint-scope/CHANGELOG.md | 64 + .../node_modules/eslint-scope/LICENSE | 22 + .../node_modules/eslint-scope/README.md | 54 + .../eslint-scope/lib/definition.js | 86 + .../node_modules/eslint-scope/lib/index.js | 165 + .../eslint-scope/lib/pattern-visitor.js | 152 + .../eslint-scope/lib/reference.js | 167 + .../eslint-scope/lib/referencer.js | 629 + .../eslint-scope/lib/scope-manager.js | 247 + .../node_modules/eslint-scope/lib/scope.js | 748 + .../node_modules/eslint-scope/lib/variable.js | 88 + .../node_modules/eslint-scope/package.json | 76 + .../node_modules/eslint-utils/LICENSE | 21 + .../node_modules/eslint-utils/README.md | 38 + .../node_modules/eslint-utils/index.js | 1880 ++ .../node_modules/eslint-utils/index.js.map | 1 + .../node_modules/eslint-utils/index.mjs | 1838 ++ .../node_modules/eslint-utils/index.mjs.map | 1 + .../node_modules/eslint-utils/package.json | 92 + .../eslint-visitor-keys/CHANGELOG.md | 25 + .../node_modules/eslint-visitor-keys/LICENSE | 201 + .../eslint-visitor-keys/README.md | 98 + .../eslint-visitor-keys/lib/index.js | 81 + .../eslint-visitor-keys/lib/visitor-keys.json | 284 + .../eslint-visitor-keys/package.json | 73 + .../node_modules/eslint/CHANGELOG.md | 6069 ++++++ day1/cli-study/node_modules/eslint/LICENSE | 19 + day1/cli-study/node_modules/eslint/README.md | 264 + .../node_modules/eslint/bin/eslint.js | 146 + .../eslint/conf/category-list.json | 39 + .../node_modules/eslint/conf/config-schema.js | 81 + .../eslint/conf/default-cli-options.js | 31 + .../node_modules/eslint/conf/environments.js | 168 + .../node_modules/eslint/conf/eslint-all.js | 31 + .../eslint/conf/eslint-recommended.js | 72 + .../eslint/conf/replacements.json | 22 + day1/cli-study/node_modules/eslint/lib/api.js | 34 + .../cascading-config-array-factory.js | 490 + .../eslint/lib/cli-engine/cli-engine.js | 1026 + .../lib/cli-engine/config-array-factory.js | 1106 + .../cli-engine/config-array/config-array.js | 524 + .../config-array/config-dependency.js | 116 + .../config-array/extracted-config.js | 146 + .../cli-engine/config-array/ignore-pattern.js | 237 + .../lib/cli-engine/config-array/index.js | 20 + .../config-array/override-tester.js | 223 + .../eslint/lib/cli-engine/file-enumerator.js | 528 + .../lib/cli-engine/formatters/checkstyle.js | 60 + .../lib/cli-engine/formatters/codeframe.js | 138 + .../lib/cli-engine/formatters/compact.js | 60 + .../formatters/html-template-message.html | 8 + .../formatters/html-template-page.html | 115 + .../formatters/html-template-result.html | 6 + .../eslint/lib/cli-engine/formatters/html.js | 140 + .../lib/cli-engine/formatters/jslint-xml.js | 41 + .../formatters/json-with-metadata.js | 16 + .../eslint/lib/cli-engine/formatters/json.js | 13 + .../eslint/lib/cli-engine/formatters/junit.js | 82 + .../lib/cli-engine/formatters/stylish.js | 101 + .../eslint/lib/cli-engine/formatters/table.js | 159 + .../eslint/lib/cli-engine/formatters/tap.js | 95 + .../eslint/lib/cli-engine/formatters/unix.js | 58 + .../lib/cli-engine/formatters/visualstudio.js | 63 + .../eslint/lib/cli-engine/hash.js | 35 + .../eslint/lib/cli-engine/index.js | 7 + .../lib/cli-engine/lint-result-cache.js | 142 + .../eslint/lib/cli-engine/load-rules.js | 46 + .../eslint/lib/cli-engine/xml-escape.js | 34 + day1/cli-study/node_modules/eslint/lib/cli.js | 326 + .../node_modules/eslint/lib/eslint/eslint.js | 656 + .../node_modules/eslint/lib/eslint/index.js | 7 + .../eslint/lib/init/autoconfig.js | 348 + .../eslint/lib/init/config-file.js | 143 + .../eslint/lib/init/config-initializer.js | 690 + .../eslint/lib/init/config-rule.js | 317 + .../node_modules/eslint/lib/init/npm-utils.js | 178 + .../eslint/lib/init/source-code-utils.js | 109 + .../lib/linter/apply-disable-directives.js | 167 + .../code-path-analysis/code-path-analyzer.js | 684 + .../code-path-analysis/code-path-segment.js | 237 + .../code-path-analysis/code-path-state.js | 1421 ++ .../linter/code-path-analysis/code-path.js | 238 + .../code-path-analysis/debug-helpers.js | 196 + .../linter/code-path-analysis/fork-context.js | 249 + .../linter/code-path-analysis/id-generator.js | 46 + .../lib/linter/config-comment-parser.js | 141 + .../node_modules/eslint/lib/linter/index.js | 13 + .../eslint/lib/linter/interpolate.js | 28 + .../node_modules/eslint/lib/linter/linter.js | 1464 ++ .../eslint/lib/linter/node-event-generator.js | 311 + .../eslint/lib/linter/report-translator.js | 347 + .../eslint/lib/linter/rule-fixer.js | 140 + .../node_modules/eslint/lib/linter/rules.js | 77 + .../eslint/lib/linter/safe-emitter.js | 52 + .../eslint/lib/linter/source-code-fixer.js | 152 + .../node_modules/eslint/lib/linter/timing.js | 139 + .../node_modules/eslint/lib/options.js | 262 + .../eslint/lib/rule-tester/index.js | 5 + .../eslint/lib/rule-tester/rule-tester.js | 893 + .../eslint/lib/rules/accessor-pairs.js | 367 + .../eslint/lib/rules/array-bracket-newline.js | 258 + .../eslint/lib/rules/array-bracket-spacing.js | 241 + .../eslint/lib/rules/array-callback-return.js | 287 + .../eslint/lib/rules/array-element-newline.js | 301 + .../eslint/lib/rules/arrow-body-style.js | 251 + .../eslint/lib/rules/arrow-parens.js | 200 + .../eslint/lib/rules/arrow-spacing.js | 161 + .../eslint/lib/rules/block-scoped-var.js | 122 + .../eslint/lib/rules/block-spacing.js | 164 + .../eslint/lib/rules/brace-style.js | 188 + .../eslint/lib/rules/callback-return.js | 186 + .../eslint/lib/rules/camelcase.js | 278 + .../eslint/lib/rules/capitalized-comments.js | 300 + .../lib/rules/class-methods-use-this.js | 125 + .../eslint/lib/rules/comma-dangle.js | 341 + .../eslint/lib/rules/comma-spacing.js | 195 + .../eslint/lib/rules/comma-style.js | 310 + .../eslint/lib/rules/complexity.js | 160 + .../lib/rules/computed-property-spacing.js | 204 + .../eslint/lib/rules/consistent-return.js | 196 + .../eslint/lib/rules/consistent-this.js | 151 + .../eslint/lib/rules/constructor-super.js | 395 + .../node_modules/eslint/lib/rules/curly.js | 495 + .../eslint/lib/rules/default-case-last.js | 44 + .../eslint/lib/rules/default-case.js | 97 + .../eslint/lib/rules/default-param-last.js | 62 + .../eslint/lib/rules/dot-location.js | 99 + .../eslint/lib/rules/dot-notation.js | 173 + .../node_modules/eslint/lib/rules/eol-last.js | 112 + .../node_modules/eslint/lib/rules/eqeqeq.js | 174 + .../eslint/lib/rules/for-direction.js | 126 + .../eslint/lib/rules/func-call-spacing.js | 194 + .../eslint/lib/rules/func-name-matching.js | 252 + .../eslint/lib/rules/func-names.js | 190 + .../eslint/lib/rules/func-style.js | 98 + .../rules/function-call-argument-newline.js | 122 + .../lib/rules/function-paren-newline.js | 281 + .../lib/rules/generator-star-spacing.js | 206 + .../eslint/lib/rules/getter-return.js | 173 + .../eslint/lib/rules/global-require.js | 85 + .../lib/rules/grouped-accessor-pairs.js | 224 + .../eslint/lib/rules/guard-for-in.js | 76 + .../eslint/lib/rules/handle-callback-err.js | 99 + .../eslint/lib/rules/id-blacklist.js | 230 + .../eslint/lib/rules/id-length.js | 132 + .../node_modules/eslint/lib/rules/id-match.js | 226 + .../lib/rules/implicit-arrow-linebreak.js | 81 + .../eslint/lib/rules/indent-legacy.js | 1125 + .../node_modules/eslint/lib/rules/indent.js | 1686 ++ .../node_modules/eslint/lib/rules/index.js | 296 + .../eslint/lib/rules/init-declarations.js | 139 + .../eslint/lib/rules/jsx-quotes.js | 95 + .../eslint/lib/rules/key-spacing.js | 674 + .../eslint/lib/rules/keyword-spacing.js | 573 + .../eslint/lib/rules/line-comment-position.js | 122 + .../eslint/lib/rules/linebreak-style.js | 105 + .../eslint/lib/rules/lines-around-comment.js | 404 + .../lib/rules/lines-around-directive.js | 201 + .../lib/rules/lines-between-class-members.js | 133 + .../eslint/lib/rules/max-classes-per-file.js | 65 + .../eslint/lib/rules/max-depth.js | 154 + .../node_modules/eslint/lib/rules/max-len.js | 422 + .../lib/rules/max-lines-per-function.js | 214 + .../eslint/lib/rules/max-lines.js | 174 + .../eslint/lib/rules/max-nested-callbacks.js | 117 + .../eslint/lib/rules/max-params.js | 103 + .../lib/rules/max-statements-per-line.js | 196 + .../eslint/lib/rules/max-statements.js | 175 + .../lib/rules/multiline-comment-style.js | 435 + .../eslint/lib/rules/multiline-ternary.js | 114 + .../node_modules/eslint/lib/rules/new-cap.js | 279 + .../eslint/lib/rules/new-parens.js | 99 + .../eslint/lib/rules/newline-after-var.js | 255 + .../eslint/lib/rules/newline-before-return.js | 217 + .../lib/rules/newline-per-chained-call.js | 113 + .../node_modules/eslint/lib/rules/no-alert.js | 129 + .../eslint/lib/rules/no-array-constructor.js | 54 + .../lib/rules/no-async-promise-executor.js | 39 + .../eslint/lib/rules/no-await-in-loop.js | 106 + .../eslint/lib/rules/no-bitwise.js | 119 + .../eslint/lib/rules/no-buffer-constructor.js | 49 + .../eslint/lib/rules/no-caller.js | 46 + .../eslint/lib/rules/no-case-declarations.js | 64 + .../eslint/lib/rules/no-catch-shadow.js | 80 + .../eslint/lib/rules/no-class-assign.js | 61 + .../eslint/lib/rules/no-compare-neg-zero.js | 60 + .../eslint/lib/rules/no-cond-assign.js | 159 + .../eslint/lib/rules/no-confusing-arrow.js | 85 + .../eslint/lib/rules/no-console.js | 134 + .../eslint/lib/rules/no-const-assign.js | 54 + .../eslint/lib/rules/no-constant-condition.js | 253 + .../eslint/lib/rules/no-constructor-return.js | 62 + .../eslint/lib/rules/no-continue.js | 39 + .../eslint/lib/rules/no-control-regex.js | 113 + .../eslint/lib/rules/no-debugger.js | 43 + .../eslint/lib/rules/no-delete-var.js | 42 + .../eslint/lib/rules/no-div-regex.js | 53 + .../eslint/lib/rules/no-dupe-args.js | 80 + .../eslint/lib/rules/no-dupe-class-members.js | 103 + .../eslint/lib/rules/no-dupe-else-if.js | 122 + .../eslint/lib/rules/no-dupe-keys.js | 143 + .../eslint/lib/rules/no-duplicate-case.js | 52 + .../eslint/lib/rules/no-duplicate-imports.js | 142 + .../eslint/lib/rules/no-else-return.js | 404 + .../lib/rules/no-empty-character-class.js | 64 + .../eslint/lib/rules/no-empty-function.js | 167 + .../eslint/lib/rules/no-empty-pattern.js | 43 + .../node_modules/eslint/lib/rules/no-empty.js | 86 + .../eslint/lib/rules/no-eq-null.js | 46 + .../node_modules/eslint/lib/rules/no-eval.js | 307 + .../eslint/lib/rules/no-ex-assign.js | 52 + .../eslint/lib/rules/no-extend-native.js | 181 + .../eslint/lib/rules/no-extra-bind.js | 173 + .../eslint/lib/rules/no-extra-boolean-cast.js | 309 + .../eslint/lib/rules/no-extra-label.js | 149 + .../eslint/lib/rules/no-extra-parens.js | 1139 + .../eslint/lib/rules/no-extra-semi.js | 126 + .../eslint/lib/rules/no-fallthrough.js | 142 + .../eslint/lib/rules/no-floating-decimal.js | 70 + .../eslint/lib/rules/no-func-assign.js | 76 + .../eslint/lib/rules/no-global-assign.js | 94 + .../eslint/lib/rules/no-implicit-coercion.js | 300 + .../eslint/lib/rules/no-implicit-globals.js | 140 + .../eslint/lib/rules/no-implied-eval.js | 152 + .../eslint/lib/rules/no-import-assign.js | 238 + .../eslint/lib/rules/no-inline-comments.js | 89 + .../eslint/lib/rules/no-inner-declarations.js | 88 + .../eslint/lib/rules/no-invalid-regexp.js | 130 + .../eslint/lib/rules/no-invalid-this.js | 145 + .../lib/rules/no-irregular-whitespace.js | 251 + .../eslint/lib/rules/no-iterator.js | 52 + .../eslint/lib/rules/no-label-var.js | 79 + .../eslint/lib/rules/no-labels.js | 149 + .../eslint/lib/rules/no-lone-blocks.js | 128 + .../eslint/lib/rules/no-lonely-if.js | 89 + .../eslint/lib/rules/no-loop-func.js | 204 + .../eslint/lib/rules/no-loss-of-precision.js | 198 + .../eslint/lib/rules/no-magic-numbers.js | 213 + .../rules/no-misleading-character-class.js | 200 + .../eslint/lib/rules/no-mixed-operators.js | 243 + .../eslint/lib/rules/no-mixed-requires.js | 237 + .../lib/rules/no-mixed-spaces-and-tabs.js | 113 + .../eslint/lib/rules/no-multi-assign.js | 49 + .../eslint/lib/rules/no-multi-spaces.js | 138 + .../eslint/lib/rules/no-multi-str.js | 65 + .../lib/rules/no-multiple-empty-lines.js | 151 + .../eslint/lib/rules/no-native-reassign.js | 97 + .../eslint/lib/rules/no-negated-condition.js | 95 + .../eslint/lib/rules/no-negated-in-lhs.js | 46 + .../eslint/lib/rules/no-nested-ternary.js | 44 + .../eslint/lib/rules/no-new-func.js | 58 + .../eslint/lib/rules/no-new-object.js | 57 + .../eslint/lib/rules/no-new-require.js | 49 + .../eslint/lib/rules/no-new-symbol.js | 54 + .../eslint/lib/rules/no-new-wrappers.js | 48 + .../node_modules/eslint/lib/rules/no-new.js | 43 + .../eslint/lib/rules/no-obj-calls.js | 81 + .../eslint/lib/rules/no-octal-escape.js | 56 + .../node_modules/eslint/lib/rules/no-octal.js | 45 + .../eslint/lib/rules/no-param-reassign.js | 229 + .../eslint/lib/rules/no-path-concat.js | 63 + .../eslint/lib/rules/no-plusplus.js | 105 + .../eslint/lib/rules/no-process-env.js | 50 + .../eslint/lib/rules/no-process-exit.js | 46 + .../lib/rules/no-promise-executor-return.js | 121 + .../node_modules/eslint/lib/rules/no-proto.js | 48 + .../eslint/lib/rules/no-prototype-builtins.js | 61 + .../eslint/lib/rules/no-redeclare.js | 172 + .../eslint/lib/rules/no-regex-spaces.js | 180 + .../eslint/lib/rules/no-restricted-exports.js | 90 + .../eslint/lib/rules/no-restricted-globals.js | 122 + .../eslint/lib/rules/no-restricted-imports.js | 268 + .../eslint/lib/rules/no-restricted-modules.js | 214 + .../lib/rules/no-restricted-properties.js | 181 + .../eslint/lib/rules/no-restricted-syntax.js | 70 + .../eslint/lib/rules/no-return-assign.js | 80 + .../eslint/lib/rules/no-return-await.js | 103 + .../eslint/lib/rules/no-script-url.js | 48 + .../eslint/lib/rules/no-self-assign.js | 233 + .../eslint/lib/rules/no-self-compare.js | 60 + .../eslint/lib/rules/no-sequences.js | 119 + .../eslint/lib/rules/no-setter-return.js | 227 + .../lib/rules/no-shadow-restricted-names.js | 64 + .../eslint/lib/rules/no-shadow.js | 192 + .../eslint/lib/rules/no-spaced-func.js | 83 + .../eslint/lib/rules/no-sparse-arrays.js | 50 + .../node_modules/eslint/lib/rules/no-sync.js | 65 + .../node_modules/eslint/lib/rules/no-tabs.js | 78 + .../lib/rules/no-template-curly-in-string.js | 44 + .../eslint/lib/rules/no-ternary.js | 41 + .../eslint/lib/rules/no-this-before-super.js | 304 + .../eslint/lib/rules/no-throw-literal.js | 51 + .../eslint/lib/rules/no-trailing-spaces.js | 190 + .../eslint/lib/rules/no-undef-init.js | 75 + .../node_modules/eslint/lib/rules/no-undef.js | 78 + .../eslint/lib/rules/no-undefined.js | 84 + .../eslint/lib/rules/no-underscore-dangle.js | 232 + .../lib/rules/no-unexpected-multiline.js | 120 + .../lib/rules/no-unmodified-loop-condition.js | 360 + .../eslint/lib/rules/no-unneeded-ternary.js | 168 + .../eslint/lib/rules/no-unreachable-loop.js | 150 + .../eslint/lib/rules/no-unreachable.js | 218 + .../eslint/lib/rules/no-unsafe-finally.js | 111 + .../eslint/lib/rules/no-unsafe-negation.js | 127 + .../eslint/lib/rules/no-unused-expressions.js | 140 + .../eslint/lib/rules/no-unused-labels.js | 110 + .../eslint/lib/rules/no-unused-vars.js | 648 + .../eslint/lib/rules/no-use-before-define.js | 233 + .../lib/rules/no-useless-backreference.js | 193 + .../eslint/lib/rules/no-useless-call.js | 87 + .../eslint/lib/rules/no-useless-catch.js | 57 + .../lib/rules/no-useless-computed-key.js | 103 + .../eslint/lib/rules/no-useless-concat.js | 115 + .../lib/rules/no-useless-constructor.js | 181 + .../eslint/lib/rules/no-useless-escape.js | 252 + .../eslint/lib/rules/no-useless-rename.js | 168 + .../eslint/lib/rules/no-useless-return.js | 305 + .../node_modules/eslint/lib/rules/no-var.js | 334 + .../node_modules/eslint/lib/rules/no-void.js | 64 + .../eslint/lib/rules/no-warning-comments.js | 163 + .../rules/no-whitespace-before-property.js | 101 + .../node_modules/eslint/lib/rules/no-with.js | 39 + .../rules/nonblock-statement-body-position.js | 124 + .../eslint/lib/rules/object-curly-newline.js | 306 + .../eslint/lib/rules/object-curly-spacing.js | 308 + .../lib/rules/object-property-newline.js | 99 + .../eslint/lib/rules/object-shorthand.js | 508 + .../lib/rules/one-var-declaration-per-line.js | 92 + .../node_modules/eslint/lib/rules/one-var.js | 535 + .../eslint/lib/rules/operator-assignment.js | 243 + .../eslint/lib/rules/operator-linebreak.js | 247 + .../eslint/lib/rules/padded-blocks.js | 298 + .../rules/padding-line-between-statements.js | 632 + .../eslint/lib/rules/prefer-arrow-callback.js | 314 + .../eslint/lib/rules/prefer-const.js | 476 + .../eslint/lib/rules/prefer-destructuring.js | 272 + .../rules/prefer-exponentiation-operator.js | 189 + .../lib/rules/prefer-named-capture-group.js | 110 + .../lib/rules/prefer-numeric-literals.js | 147 + .../eslint/lib/rules/prefer-object-spread.js | 299 + .../lib/rules/prefer-promise-reject-errors.js | 133 + .../eslint/lib/rules/prefer-reflect.js | 127 + .../eslint/lib/rules/prefer-regex-literals.js | 125 + .../eslint/lib/rules/prefer-rest-params.js | 115 + .../eslint/lib/rules/prefer-spread.js | 91 + .../eslint/lib/rules/prefer-template.js | 283 + .../eslint/lib/rules/quote-props.js | 307 + .../node_modules/eslint/lib/rules/quotes.js | 332 + .../node_modules/eslint/lib/rules/radix.js | 178 + .../lib/rules/require-atomic-updates.js | 283 + .../eslint/lib/rules/require-await.js | 113 + .../eslint/lib/rules/require-jsdoc.js | 121 + .../lib/rules/require-unicode-regexp.js | 69 + .../eslint/lib/rules/require-yield.js | 78 + .../eslint/lib/rules/rest-spread-spacing.js | 120 + .../eslint/lib/rules/semi-spacing.js | 244 + .../eslint/lib/rules/semi-style.js | 151 + .../node_modules/eslint/lib/rules/semi.js | 336 + .../eslint/lib/rules/sort-imports.js | 213 + .../eslint/lib/rules/sort-keys.js | 187 + .../eslint/lib/rules/sort-vars.js | 104 + .../eslint/lib/rules/space-before-blocks.js | 164 + .../lib/rules/space-before-function-paren.js | 164 + .../eslint/lib/rules/space-in-parens.js | 282 + .../eslint/lib/rules/space-infix-ops.js | 169 + .../eslint/lib/rules/space-unary-ops.js | 321 + .../eslint/lib/rules/spaced-comment.js | 382 + .../node_modules/eslint/lib/rules/strict.js | 277 + .../eslint/lib/rules/switch-colon-spacing.js | 141 + .../eslint/lib/rules/symbol-description.js | 71 + .../lib/rules/template-curly-spacing.js | 141 + .../eslint/lib/rules/template-tag-spacing.js | 90 + .../eslint/lib/rules/unicode-bom.js | 73 + .../eslint/lib/rules/use-isnan.js | 138 + .../eslint/lib/rules/utils/ast-utils.js | 1594 ++ .../eslint/lib/rules/utils/fix-tracker.js | 114 + .../eslint/lib/rules/utils/keywords.js | 67 + .../lib/rules/utils/lazy-loading-rule-map.js | 115 + .../lib/rules/utils/patterns/letters.js | 36 + .../eslint/lib/rules/utils/unicode/index.js | 11 + .../utils/unicode/is-combining-character.js | 13 + .../rules/utils/unicode/is-emoji-modifier.js | 13 + .../unicode/is-regional-indicator-symbol.js | 13 + .../rules/utils/unicode/is-surrogate-pair.js | 14 + .../eslint/lib/rules/valid-jsdoc.js | 515 + .../eslint/lib/rules/valid-typeof.js | 85 + .../eslint/lib/rules/vars-on-top.js | 144 + .../eslint/lib/rules/wrap-iife.js | 197 + .../eslint/lib/rules/wrap-regex.js | 59 + .../eslint/lib/rules/yield-star-spacing.js | 127 + .../node_modules/eslint/lib/rules/yoda.js | 405 + .../node_modules/eslint/lib/shared/ajv.js | 34 + .../eslint/lib/shared/ast-utils.js | 29 + .../eslint/lib/shared/config-ops.js | 130 + .../eslint/lib/shared/config-validator.js | 326 + .../eslint/lib/shared/deprecation-warnings.js | 56 + .../node_modules/eslint/lib/shared/logging.js | 30 + .../node_modules/eslint/lib/shared/naming.js | 97 + .../lib/shared/relative-module-resolver.js | 44 + .../eslint/lib/shared/runtime-info.js | 163 + .../eslint/lib/shared/traverser.js | 195 + .../node_modules/eslint/lib/shared/types.js | 150 + .../eslint/lib/source-code/index.js | 5 + .../eslint/lib/source-code/source-code.js | 586 + .../backward-token-comment-cursor.js | 57 + .../token-store/backward-token-cursor.js | 58 + .../lib/source-code/token-store/cursor.js | 76 + .../lib/source-code/token-store/cursors.js | 90 + .../token-store/decorative-cursor.js | 39 + .../source-code/token-store/filter-cursor.js | 43 + .../forward-token-comment-cursor.js | 57 + .../token-store/forward-token-cursor.js | 63 + .../lib/source-code/token-store/index.js | 627 + .../source-code/token-store/limit-cursor.js | 40 + .../token-store/padded-token-cursor.js | 38 + .../source-code/token-store/skip-cursor.js | 42 + .../lib/source-code/token-store/utils.js | 100 + .../eslint/messages/all-files-ignored.txt | 8 + .../eslint/messages/extend-config-missing.txt | 5 + .../eslint/messages/failed-to-read-json.txt | 3 + .../eslint/messages/file-not-found.txt | 2 + .../eslint/messages/no-config-found.txt | 7 + .../eslint/messages/plugin-conflict.txt | 7 + .../eslint/messages/plugin-missing.txt | 11 + .../print-config-with-directory-path.txt | 2 + .../eslint/messages/whitespace-found.txt | 3 + .../node_modules/eslint/package.json | 180 + .../node_modules/espree/CHANGELOG.md | 492 + day1/cli-study/node_modules/espree/LICENSE | 22 + day1/cli-study/node_modules/espree/README.md | 251 + day1/cli-study/node_modules/espree/espree.js | 177 + .../node_modules/espree/lib/ast-node-types.js | 96 + .../node_modules/espree/lib/espree.js | 286 + .../node_modules/espree/lib/features.js | 29 + .../node_modules/espree/lib/options.js | 105 + .../espree/lib/token-translator.js | 262 + .../node_modules/espree/lib/visitor-keys.js | 123 + .../node_modules/espree/package.json | 95 + day1/cli-study/node_modules/esprima/ChangeLog | 235 + .../node_modules/esprima/LICENSE.BSD | 21 + day1/cli-study/node_modules/esprima/README.md | 46 + .../node_modules/esprima/bin/esparse.js | 139 + .../node_modules/esprima/bin/esvalidate.js | 236 + .../node_modules/esprima/dist/esprima.js | 6709 ++++++ .../node_modules/esprima/package.json | 137 + day1/cli-study/node_modules/esquery/README.md | 27 + .../node_modules/esquery/dist/esquery.esm.js | 4545 ++++ .../esquery/dist/esquery.esm.min.js | 2 + .../esquery/dist/esquery.esm.min.js.map | 1 + .../node_modules/esquery/dist/esquery.js | 4553 ++++ .../node_modules/esquery/dist/esquery.min.js | 2 + .../esquery/dist/esquery.min.js.map | 1 + .../node_modules/esquery/license.txt | 24 + .../esquery/node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../esquery/node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 799 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 68 + .../node_modules/esquery/package.json | 108 + day1/cli-study/node_modules/esquery/parser.js | 2572 +++ .../cli-study/node_modules/esrecurse/.babelrc | 3 + .../node_modules/esrecurse/README.md | 171 + .../node_modules/esrecurse/esrecurse.js | 117 + .../node_modules/esrecurse/gulpfile.babel.js | 92 + .../node_modules/esrecurse/package.json | 80 + .../node_modules/estraverse/.jshintrc | 16 + .../node_modules/estraverse/LICENSE.BSD | 19 + .../node_modules/estraverse/README.md | 153 + .../node_modules/estraverse/estraverse.js | 782 + .../node_modules/estraverse/gulpfile.js | 70 + .../node_modules/estraverse/package.json | 69 + .../node_modules/esutils/LICENSE.BSD | 19 + day1/cli-study/node_modules/esutils/README.md | 174 + .../cli-study/node_modules/esutils/lib/ast.js | 144 + .../node_modules/esutils/lib/code.js | 135 + .../node_modules/esutils/lib/keyword.js | 165 + .../node_modules/esutils/lib/utils.js | 33 + .../node_modules/esutils/package.json | 73 + day1/cli-study/node_modules/ext-list/index.js | 18 + day1/cli-study/node_modules/ext-list/license | 21 + .../node_modules/ext-list/package.json | 64 + .../cli-study/node_modules/ext-list/readme.md | 25 + day1/cli-study/node_modules/ext-name/index.js | 31 + day1/cli-study/node_modules/ext-name/license | 21 + .../node_modules/ext-name/package.json | 66 + .../cli-study/node_modules/ext-name/readme.md | 57 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../node_modules/external-editor/LICENSE | 21 + .../node_modules/external-editor/README.md | 171 + .../external-editor/example_async.js | 40 + .../external-editor/example_sync.js | 38 + .../main/errors/CreateFileError.d.ts | 10 + .../main/errors/CreateFileError.js | 39 + .../main/errors/LaunchEditorError.d.ts | 10 + .../main/errors/LaunchEditorError.js | 39 + .../main/errors/ReadFileError.d.ts | 10 + .../main/errors/ReadFileError.js | 39 + .../main/errors/RemoveFileError.d.ts | 10 + .../main/errors/RemoveFileError.js | 39 + .../external-editor/main/index.d.ts | 46 + .../external-editor/main/index.js | 193 + .../node_modules/external-editor/package.json | 90 + .../node_modules/fast-deep-equal/LICENSE | 21 + .../node_modules/fast-deep-equal/README.md | 96 + .../fast-deep-equal/es6/index.d.ts | 2 + .../node_modules/fast-deep-equal/es6/index.js | 72 + .../fast-deep-equal/es6/react.d.ts | 2 + .../node_modules/fast-deep-equal/es6/react.js | 79 + .../node_modules/fast-deep-equal/index.d.ts | 4 + .../node_modules/fast-deep-equal/index.js | 46 + .../node_modules/fast-deep-equal/package.json | 88 + .../node_modules/fast-deep-equal/react.d.ts | 2 + .../node_modules/fast-deep-equal/react.js | 53 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 21 + .../fast-json-stable-stringify/README.md | 131 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 80 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + .../node_modules/fast-levenshtein/LICENSE.md | 25 + .../node_modules/fast-levenshtein/README.md | 104 + .../fast-levenshtein/levenshtein.js | 136 + .../fast-levenshtein/package.json | 72 + .../node_modules/fd-slicer/.npmignore | 2 + .../node_modules/fd-slicer/.travis.yml | 7 + .../node_modules/fd-slicer/CHANGELOG.md | 49 + day1/cli-study/node_modules/fd-slicer/LICENSE | 21 + .../node_modules/fd-slicer/README.md | 199 + .../cli-study/node_modules/fd-slicer/index.js | 296 + .../node_modules/fd-slicer/package.json | 65 + .../node_modules/fd-slicer/test/test.js | 350 + .../cli-study/node_modules/figures/index.d.ts | 96 + day1/cli-study/node_modules/figures/index.js | 151 + day1/cli-study/node_modules/figures/license | 9 + .../node_modules/figures/package.json | 77 + day1/cli-study/node_modules/figures/readme.md | 139 + .../node_modules/file-entry-cache/LICENSE | 22 + .../node_modules/file-entry-cache/README.md | 112 + .../node_modules/file-entry-cache/cache.js | 286 + .../file-entry-cache/changelog.md | 141 + .../file-entry-cache/package.json | 116 + .../cli-study/node_modules/file-type/index.js | 809 + day1/cli-study/node_modules/file-type/license | 9 + .../node_modules/file-type/package.json | 155 + .../node_modules/file-type/readme.md | 186 + day1/cli-study/node_modules/filelist/Jakefile | 14 + .../cli-study/node_modules/filelist/README.md | 84 + day1/cli-study/node_modules/filelist/index.js | 484 + .../node_modules/filelist/package.json | 56 + .../filename-reserved-regex/index.js | 5 + .../filename-reserved-regex/license | 21 + .../filename-reserved-regex/package.json | 68 + .../filename-reserved-regex/readme.md | 49 + .../node_modules/filenamify/index.js | 46 + .../cli-study/node_modules/filenamify/license | 9 + .../node_modules/filenamify/package.json | 75 + .../node_modules/filenamify/readme.md | 64 + day1/cli-study/node_modules/find-up/index.js | 48 + day1/cli-study/node_modules/find-up/license | 21 + .../node_modules/find-up/package.json | 86 + day1/cli-study/node_modules/find-up/readme.md | 85 + .../cli-study/node_modules/flat-cache/LICENSE | 22 + .../node_modules/flat-cache/README.md | 73 + .../node_modules/flat-cache/cache.js | 197 + .../node_modules/flat-cache/changelog.md | 300 + day1/cli-study/node_modules/flat-cache/del.js | 13 + .../node_modules/flat-cache/package.json | 119 + .../node_modules/flat-cache/utils.js | 39 + .../node_modules/flatted/.github/FUNDING.yml | 8 + day1/cli-study/node_modules/flatted/LICENSE | 15 + day1/cli-study/node_modules/flatted/README.md | 65 + day1/cli-study/node_modules/flatted/SPECS.md | 94 + .../node_modules/flatted/cjs/index.js | 114 + .../node_modules/flatted/esm/index.js | 116 + day1/cli-study/node_modules/flatted/index.js | 113 + day1/cli-study/node_modules/flatted/min.js | 2 + .../node_modules/flatted/package.json | 71 + .../cli-study/node_modules/flatted/types.d.ts | 19 + .../node_modules/follow-redirects/LICENSE | 18 + .../node_modules/follow-redirects/README.md | 155 + .../node_modules/follow-redirects/http.js | 1 + .../node_modules/follow-redirects/https.js | 1 + .../node_modules/follow-redirects/index.js | 322 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 14 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 20 + .../node_modules/debug/CHANGELOG.md | 395 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 58 + .../node_modules/debug/README.md | 368 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 82 + .../node_modules/debug/src/browser.js | 195 + .../node_modules/debug/src/debug.js | 225 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/node.js | 186 + .../follow-redirects/node_modules/ms/index.js | 152 + .../node_modules/ms/license.md | 21 + .../node_modules/ms/package.json | 69 + .../node_modules/ms/readme.md | 51 + .../follow-redirects/package.json | 96 + day1/cli-study/node_modules/from2/.travis.yml | 8 + day1/cli-study/node_modules/from2/LICENSE.md | 21 + day1/cli-study/node_modules/from2/README.md | 70 + day1/cli-study/node_modules/from2/index.js | 103 + .../cli-study/node_modules/from2/package.json | 69 + day1/cli-study/node_modules/from2/test.js | 123 + .../node_modules/fs-constants/LICENSE | 21 + .../node_modules/fs-constants/README.md | 26 + .../node_modules/fs-constants/browser.js | 1 + .../node_modules/fs-constants/index.js | 1 + .../node_modules/fs-constants/package.json | 47 + .../node_modules/fs-extra/.npmignore | 8 + .../node_modules/fs-extra/CHANGELOG.md | 726 + day1/cli-study/node_modules/fs-extra/LICENSE | 15 + .../cli-study/node_modules/fs-extra/README.md | 586 + .../fs-extra/lib/copy-sync/copy-file-sync.js | 39 + .../fs-extra/lib/copy-sync/copy-sync.js | 47 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 44 + .../node_modules/fs-extra/lib/copy/index.js | 3 + .../node_modules/fs-extra/lib/copy/ncp.js | 243 + .../node_modules/fs-extra/lib/empty/index.js | 47 + .../node_modules/fs-extra/lib/ensure/file.js | 43 + .../node_modules/fs-extra/lib/ensure/index.js | 21 + .../node_modules/fs-extra/lib/ensure/link.js | 58 + .../fs-extra/lib/ensure/symlink-paths.js | 97 + .../fs-extra/lib/ensure/symlink-type.js | 27 + .../fs-extra/lib/ensure/symlink.js | 62 + .../node_modules/fs-extra/lib/index.js | 38 + .../node_modules/fs-extra/lib/json/index.js | 9 + .../fs-extra/lib/json/jsonfile.js | 14 + .../fs-extra/lib/json/output-json-sync.js | 16 + .../fs-extra/lib/json/output-json.js | 24 + .../node_modules/fs-extra/lib/mkdirs/index.js | 9 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 49 + .../fs-extra/lib/mkdirs/mkdirs.js | 54 + .../node_modules/fs-extra/lib/move/index.js | 161 + .../node_modules/fs-extra/lib/output/index.js | 35 + .../node_modules/fs-extra/lib/remove/index.js | 14 + .../lib/streams/create-output-stream.js | 43 + .../fs-extra/lib/streams/index.js | 3 + .../node_modules/fs-extra/lib/util/assign.js | 14 + .../node_modules/fs-extra/lib/util/utimes.js | 69 + .../node_modules/fs-extra/lib/walk/index.js | 5 + .../node_modules/fs-extra/package.json | 90 + .../node_modules/fs.realpath/LICENSE | 43 + .../node_modules/fs.realpath/README.md | 33 + .../node_modules/fs.realpath/index.js | 66 + .../cli-study/node_modules/fs.realpath/old.js | 303 + .../node_modules/fs.realpath/package.json | 59 + .../node_modules/function-bind/.editorconfig | 20 + .../node_modules/function-bind/.eslintrc | 15 + .../node_modules/function-bind/.jscs.json | 176 + .../node_modules/function-bind/.npmignore | 22 + .../node_modules/function-bind/.travis.yml | 168 + .../node_modules/function-bind/LICENSE | 20 + .../node_modules/function-bind/README.md | 48 + .../function-bind/implementation.js | 52 + .../node_modules/function-bind/index.js | 5 + .../node_modules/function-bind/package.json | 97 + .../node_modules/function-bind/test/.eslintrc | 9 + .../node_modules/function-bind/test/index.js | 252 + .../functional-red-black-tree/.npmignore | 16 + .../functional-red-black-tree/LICENSE | 22 + .../functional-red-black-tree/README.md | 237 + .../functional-red-black-tree/bench/test.js | 11 + .../functional-red-black-tree/package.json | 68 + .../functional-red-black-tree/rbtree.js | 996 + .../functional-red-black-tree/test/test.js | 479 + .../cli-study/node_modules/get-proxy/index.js | 13 + day1/cli-study/node_modules/get-proxy/license | 9 + .../node_modules/get-proxy/package.json | 65 + .../node_modules/get-proxy/readme.md | 25 + .../node_modules/get-stream/buffer-stream.js | 51 + .../node_modules/get-stream/index.js | 51 + .../cli-study/node_modules/get-stream/license | 21 + .../node_modules/get-stream/package.json | 82 + .../node_modules/get-stream/readme.md | 117 + .../node_modules/git-clone/README.md | 31 + .../cli-study/node_modules/git-clone/index.js | 49 + .../node_modules/git-clone/package.json | 53 + .../node_modules/git-clone/test/.npmignore | 1 + .../node_modules/git-clone/test/test.js | 8 + .../node_modules/glob-parent/LICENSE | 15 + .../node_modules/glob-parent/README.md | 137 + .../node_modules/glob-parent/index.js | 41 + .../node_modules/glob-parent/package.json | 90 + day1/cli-study/node_modules/glob/LICENSE | 21 + day1/cli-study/node_modules/glob/README.md | 375 + day1/cli-study/node_modules/glob/changelog.md | 67 + day1/cli-study/node_modules/glob/common.js | 240 + day1/cli-study/node_modules/glob/glob.js | 790 + day1/cli-study/node_modules/glob/package.json | 79 + day1/cli-study/node_modules/glob/sync.js | 486 + .../node_modules/globals/globals.json | 1586 ++ .../cli-study/node_modules/globals/index.d.ts | 6 + day1/cli-study/node_modules/globals/index.js | 2 + day1/cli-study/node_modules/globals/license | 9 + .../node_modules/globals/package.json | 84 + day1/cli-study/node_modules/globals/readme.md | 56 + day1/cli-study/node_modules/got/errors.js | 92 + day1/cli-study/node_modules/got/index.js | 675 + day1/cli-study/node_modules/got/license | 9 + day1/cli-study/node_modules/got/package.json | 127 + day1/cli-study/node_modules/got/readme.md | 650 + .../node_modules/graceful-fs/LICENSE | 15 + .../node_modules/graceful-fs/README.md | 133 + .../node_modules/graceful-fs/clone.js | 19 + .../node_modules/graceful-fs/graceful-fs.js | 354 + .../graceful-fs/legacy-streams.js | 118 + .../node_modules/graceful-fs/package.json | 82 + .../node_modules/graceful-fs/polyfills.js | 342 + .../node_modules/graceful-readlink/.npmignore | 3 + .../graceful-readlink/.travis.yml | 5 + .../node_modules/graceful-readlink/LICENSE | 22 + .../node_modules/graceful-readlink/README.md | 17 + .../node_modules/graceful-readlink/index.js | 12 + .../graceful-readlink/package.json | 50 + .../node_modules/gray-matter/LICENSE | 21 + .../node_modules/gray-matter/README.md | 347 + .../node_modules/gray-matter/gray-matter.d.ts | 20 + .../node_modules/gray-matter/index.js | 213 + .../node_modules/gray-matter/lib/parsers.js | 208 + .../node_modules/gray-matter/package.json | 168 + day1/cli-study/node_modules/has-ansi/index.js | 4 + day1/cli-study/node_modules/has-ansi/license | 21 + .../has-ansi/node_modules/ansi-regex/index.js | 4 + .../has-ansi/node_modules/ansi-regex/license | 21 + .../node_modules/ansi-regex/package.json | 108 + .../node_modules/ansi-regex/readme.md | 39 + .../node_modules/has-ansi/package.json | 95 + .../cli-study/node_modules/has-ansi/readme.md | 36 + day1/cli-study/node_modules/has-flag/index.js | 8 + day1/cli-study/node_modules/has-flag/license | 9 + .../node_modules/has-flag/package.json | 76 + .../cli-study/node_modules/has-flag/readme.md | 70 + .../has-generators/.README.md.un~ | Bin 0 -> 13904 bytes .../has-generators/.package.json.un~ | Bin 0 -> 1025 bytes .../node_modules/has-generators/README.md | 20 + .../node_modules/has-generators/index.js | 8 + .../node_modules/has-generators/package.json | 48 + .../has-symbol-support-x/.editorconfig | 26 + .../has-symbol-support-x/.eslintignore | 1 + .../has-symbol-support-x/.eslintrc.json | 6 + .../node_modules/has-symbol-support-x/.nvmrc | 1 + .../has-symbol-support-x/.travis.yml | 111 + .../has-symbol-support-x/.uglifyjsrc.json | 17 + .../node_modules/has-symbol-support-x/LICENSE | 21 + .../has-symbol-support-x/README.md | 36 + .../has-symbol-support-x/badges.html | 20 + .../has-symbol-support-x/index.js | 18 + .../lib/has-symbol-support-x.js | 22 + .../lib/has-symbol-support-x.min.js | 10 + .../lib/has-symbol-support-x.min.js.map | 1 + .../has-symbol-support-x/package.json | 111 + .../has-symbol-support-x/tests/index.html | 34 + .../has-symbol-support-x/tests/run.js | 25 + .../has-symbol-support-x/tests/spec/test.js | 29 + .../node_modules/has-symbols/.eslintrc | 11 + .../has-symbols/.github/FUNDING.yml | 12 + .../has-symbols/.github/workflows/rebase.yml | 15 + .../node_modules/has-symbols/.travis.yml | 12 + .../node_modules/has-symbols/CHANGELOG.md | 34 + .../node_modules/has-symbols/LICENSE | 21 + .../node_modules/has-symbols/README.md | 45 + .../node_modules/has-symbols/index.js | 13 + .../node_modules/has-symbols/package.json | 121 + .../node_modules/has-symbols/shams.js | 42 + .../node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + .../node_modules/has-symbols/test/tests.js | 54 + .../has-to-string-tag-x/.editorconfig | 26 + .../has-to-string-tag-x/.eslintignore | 1 + .../has-to-string-tag-x/.eslintrc.json | 6 + .../node_modules/has-to-string-tag-x/.nvmrc | 1 + .../has-to-string-tag-x/.travis.yml | 93 + .../has-to-string-tag-x/.uglifyjsrc.json | 17 + .../node_modules/has-to-string-tag-x/LICENSE | 21 + .../has-to-string-tag-x/README.md | 37 + .../has-to-string-tag-x/badges.html | 20 + .../node_modules/has-to-string-tag-x/index.js | 19 + .../lib/has-to-string-tag-x.js | 43 + .../lib/has-to-string-tag-x.min.js | 18 + .../lib/has-to-string-tag-x.min.js.map | 1 + .../has-to-string-tag-x/package.json | 112 + day1/cli-study/node_modules/has/LICENSE-MIT | 22 + day1/cli-study/node_modules/has/README.md | 18 + day1/cli-study/node_modules/has/package.json | 76 + day1/cli-study/node_modules/has/src/index.js | 5 + day1/cli-study/node_modules/has/test/index.js | 10 + .../node_modules/hosted-git-info/CHANGELOG.md | 141 + .../node_modules/hosted-git-info/LICENSE | 13 + .../node_modules/hosted-git-info/README.md | 133 + .../hosted-git-info/git-host-info.js | 79 + .../node_modules/hosted-git-info/git-host.js | 156 + .../node_modules/hosted-git-info/index.js | 148 + .../node_modules/hosted-git-info/package.json | 69 + .../http-cache-semantics/README.md | 177 + .../http-cache-semantics/node4/index.js | 559 + .../http-cache-semantics/package.json | 58 + .../node_modules/iconv-lite/Changelog.md | 162 + .../cli-study/node_modules/iconv-lite/LICENSE | 21 + .../node_modules/iconv-lite/README.md | 156 + .../iconv-lite/encodings/dbcs-codec.js | 555 + .../iconv-lite/encodings/dbcs-data.js | 176 + .../iconv-lite/encodings/index.js | 22 + .../iconv-lite/encodings/internal.js | 188 + .../iconv-lite/encodings/sbcs-codec.js | 72 + .../encodings/sbcs-data-generated.js | 451 + .../iconv-lite/encodings/sbcs-data.js | 174 + .../encodings/tables/big5-added.json | 122 + .../iconv-lite/encodings/tables/cp936.json | 264 + .../iconv-lite/encodings/tables/cp949.json | 273 + .../iconv-lite/encodings/tables/cp950.json | 177 + .../iconv-lite/encodings/tables/eucjp.json | 182 + .../encodings/tables/gb18030-ranges.json | 1 + .../encodings/tables/gbk-added.json | 55 + .../iconv-lite/encodings/tables/shiftjis.json | 125 + .../iconv-lite/encodings/utf16.js | 177 + .../node_modules/iconv-lite/encodings/utf7.js | 290 + .../iconv-lite/lib/bom-handling.js | 52 + .../iconv-lite/lib/extend-node.js | 217 + .../node_modules/iconv-lite/lib/index.d.ts | 24 + .../node_modules/iconv-lite/lib/index.js | 153 + .../node_modules/iconv-lite/lib/streams.js | 121 + .../node_modules/iconv-lite/package.json | 76 + day1/cli-study/node_modules/ieee754/LICENSE | 11 + day1/cli-study/node_modules/ieee754/README.md | 53 + day1/cli-study/node_modules/ieee754/index.js | 84 + .../node_modules/ieee754/package.json | 69 + .../node_modules/ignore/CHANGELOG.md | 19 + .../cli-study/node_modules/ignore/LICENSE-MIT | 21 + day1/cli-study/node_modules/ignore/README.md | 307 + day1/cli-study/node_modules/ignore/index.d.ts | 45 + day1/cli-study/node_modules/ignore/index.js | 463 + day1/cli-study/node_modules/ignore/legacy.js | 466 + .../node_modules/ignore/package.json | 92 + .../node_modules/import-fresh/index.d.ts | 28 + .../node_modules/import-fresh/index.js | 32 + .../node_modules/import-fresh/license | 9 + .../node_modules/import-fresh/package.json | 74 + .../node_modules/import-fresh/readme.md | 52 + .../node_modules/imurmurhash/README.md | 122 + .../node_modules/imurmurhash/imurmurhash.js | 138 + .../imurmurhash/imurmurhash.min.js | 12 + .../node_modules/imurmurhash/package.json | 63 + day1/cli-study/node_modules/inflight/LICENSE | 15 + .../cli-study/node_modules/inflight/README.md | 37 + .../node_modules/inflight/inflight.js | 54 + .../node_modules/inflight/package.json | 58 + day1/cli-study/node_modules/inherits/LICENSE | 16 + .../cli-study/node_modules/inherits/README.md | 42 + .../node_modules/inherits/inherits.js | 9 + .../node_modules/inherits/inherits_browser.js | 27 + .../node_modules/inherits/package.json | 61 + day1/cli-study/node_modules/ini/LICENSE | 15 + day1/cli-study/node_modules/ini/README.md | 102 + day1/cli-study/node_modules/ini/ini.js | 194 + day1/cli-study/node_modules/ini/package.json | 63 + day1/cli-study/node_modules/inquirer/LICENSE | 22 + .../cli-study/node_modules/inquirer/README.md | 480 + .../node_modules/inquirer/lib/inquirer.js | 93 + .../inquirer/lib/objects/choice.js | 43 + .../inquirer/lib/objects/choices.js | 123 + .../inquirer/lib/objects/separator.js | 37 + .../node_modules/inquirer/lib/prompts/base.js | 151 + .../inquirer/lib/prompts/checkbox.js | 258 + .../inquirer/lib/prompts/confirm.js | 102 + .../inquirer/lib/prompts/editor.js | 100 + .../inquirer/lib/prompts/expand.js | 281 + .../inquirer/lib/prompts/input.js | 113 + .../node_modules/inquirer/lib/prompts/list.js | 188 + .../inquirer/lib/prompts/number.js | 29 + .../inquirer/lib/prompts/password.js | 113 + .../inquirer/lib/prompts/rawlist.js | 220 + .../node_modules/inquirer/lib/ui/baseUI.js | 99 + .../inquirer/lib/ui/bottom-bar.js | 102 + .../node_modules/inquirer/lib/ui/prompt.js | 138 + .../node_modules/inquirer/lib/utils/events.js | 54 + .../inquirer/lib/utils/paginator.js | 57 + .../inquirer/lib/utils/readline.js | 51 + .../inquirer/lib/utils/screen-manager.js | 145 + .../node_modules/inquirer/lib/utils/utils.js | 28 + .../node_modules/ansi-styles/index.d.ts | 197 + .../node_modules/ansi-styles/index.js | 163 + .../inquirer/node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 89 + .../node_modules/ansi-styles/readme.md | 158 + .../inquirer/node_modules/chalk/index.d.ts | 411 + .../inquirer/node_modules/chalk/license | 9 + .../inquirer/node_modules/chalk/package.json | 95 + .../inquirer/node_modules/chalk/readme.md | 304 + .../node_modules/chalk/source/index.js | 233 + .../node_modules/chalk/source/templates.js | 134 + .../node_modules/chalk/source/util.js | 39 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 + .../node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 83 + .../node_modules/color-convert/route.js | 97 + .../inquirer/node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../inquirer/node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 56 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + .../node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + .../node_modules/emoji-regex/index.d.ts | 23 + .../node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 77 + .../inquirer/node_modules/emoji-regex/text.js | 6 + .../inquirer/node_modules/has-flag/index.d.ts | 39 + .../inquirer/node_modules/has-flag/index.js | 8 + .../inquirer/node_modules/has-flag/license | 9 + .../node_modules/has-flag/package.json | 78 + .../inquirer/node_modules/has-flag/readme.md | 89 + .../is-fullwidth-code-point/index.d.ts | 17 + .../is-fullwidth-code-point/index.js | 50 + .../is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 74 + .../is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/index.d.ts | 29 + .../node_modules/string-width/index.js | 43 + .../node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 88 + .../node_modules/string-width/readme.md | 50 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 139 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../node_modules/supports-color/readme.md | 76 + .../node_modules/inquirer/package.json | 94 + .../node_modules/into-stream/index.js | 79 + .../node_modules/into-stream/license | 21 + .../node_modules/into-stream/package.json | 82 + .../node_modules/into-stream/readme.md | 42 + .../node_modules/is-arrayish/.editorconfig | 18 + .../node_modules/is-arrayish/.istanbul.yml | 4 + .../node_modules/is-arrayish/.npmignore | 5 + .../node_modules/is-arrayish/.travis.yml | 17 + .../node_modules/is-arrayish/LICENSE | 21 + .../node_modules/is-arrayish/README.md | 16 + .../node_modules/is-arrayish/index.js | 10 + .../node_modules/is-arrayish/package.json | 66 + .../node_modules/is-callable/.editorconfig | 20 + .../node_modules/is-callable/.eslintrc | 12 + .../is-callable/.github/FUNDING.yml | 12 + .../is-callable/.github/main.workflow | 14 + .../is-callable/.github/workflows/lint.yml | 11 + .../is-callable/.github/workflows/rebase.yml | 15 + .../node_modules/is-callable/.istanbul.yml | 47 + .../node_modules/is-callable/.travis.yml | 12 + .../node_modules/is-callable/CHANGELOG.md | 75 + .../node_modules/is-callable/LICENSE | 22 + .../node_modules/is-callable/README.md | 68 + .../node_modules/is-callable/index.js | 66 + .../node_modules/is-callable/package.json | 130 + .../node_modules/is-callable/test/index.js | 183 + .../node_modules/is-date-object/.eslintrc | 9 + .../is-date-object/.github/FUNDING.yml | 12 + .../.github/workflows/rebase.yml | 15 + .../node_modules/is-date-object/.jscs.json | 176 + .../node_modules/is-date-object/.travis.yml | 12 + .../node_modules/is-date-object/CHANGELOG.md | 76 + .../node_modules/is-date-object/LICENSE | 22 + .../node_modules/is-date-object/README.md | 53 + .../node_modules/is-date-object/index.js | 22 + .../node_modules/is-date-object/package.json | 104 + .../node_modules/is-date-object/test/index.js | 36 + .../node_modules/is-extendable/LICENSE | 21 + .../node_modules/is-extendable/README.md | 72 + .../node_modules/is-extendable/index.js | 13 + .../node_modules/is-extendable/package.json | 82 + .../cli-study/node_modules/is-extglob/LICENSE | 21 + .../node_modules/is-extglob/README.md | 107 + .../node_modules/is-extglob/index.js | 20 + .../node_modules/is-extglob/package.json | 100 + .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 78 + .../is-fullwidth-code-point/readme.md | 39 + day1/cli-study/node_modules/is-glob/LICENSE | 21 + day1/cli-study/node_modules/is-glob/README.md | 206 + day1/cli-study/node_modules/is-glob/index.js | 48 + .../node_modules/is-glob/package.json | 122 + .../node_modules/is-interactive/index.d.ts | 31 + .../node_modules/is-interactive/index.js | 9 + .../node_modules/is-interactive/license | 9 + .../node_modules/is-interactive/package.json | 70 + .../node_modules/is-interactive/readme.md | 51 + .../node_modules/is-natural-number/LICENSE | 20 + .../node_modules/is-natural-number/README.md | 76 + .../node_modules/is-natural-number/index.js | 31 + .../is-natural-number/index.jsnext.js | 29 + .../is-natural-number/package.json | 74 + .../node_modules/is-object/.jscs.json | 55 + .../node_modules/is-object/.npmignore | 15 + .../node_modules/is-object/.testem.json | 14 + .../node_modules/is-object/.travis.yml | 18 + day1/cli-study/node_modules/is-object/LICENSE | 19 + .../node_modules/is-object/README.md | 55 + .../cli-study/node_modules/is-object/index.js | 5 + .../node_modules/is-object/package.json | 90 + .../node_modules/is-object/test/index.js | 23 + .../node_modules/is-plain-obj/index.js | 7 + .../node_modules/is-plain-obj/license | 21 + .../node_modules/is-plain-obj/package.json | 69 + .../node_modules/is-plain-obj/readme.md | 35 + .../node_modules/is-regex/.editorconfig | 20 + .../cli-study/node_modules/is-regex/.eslintrc | 19 + .../is-regex/.github/workflows/rebase.yml | 15 + .../node_modules/is-regex/.travis.yml | 12 + .../node_modules/is-regex/CHANGELOG.md | 158 + day1/cli-study/node_modules/is-regex/LICENSE | 20 + .../cli-study/node_modules/is-regex/README.md | 54 + day1/cli-study/node_modules/is-regex/index.js | 49 + .../node_modules/is-regex/package.json | 110 + .../node_modules/is-regex/test/index.js | 105 + .../node_modules/is-retry-allowed/index.js | 62 + .../node_modules/is-retry-allowed/license | 21 + .../is-retry-allowed/package.json | 59 + .../node_modules/is-retry-allowed/readme.md | 42 + .../cli-study/node_modules/is-stream/index.js | 21 + day1/cli-study/node_modules/is-stream/license | 21 + .../node_modules/is-stream/package.json | 72 + .../node_modules/is-stream/readme.md | 42 + .../node_modules/is-string/.eslintrc | 19 + .../is-string/.github/FUNDING.yml | 12 + .../is-string/.github/workflows/rebase.yml | 15 + .../node_modules/is-string/.travis.yml | 12 + .../node_modules/is-string/CHANGELOG.md | 84 + day1/cli-study/node_modules/is-string/LICENSE | 22 + .../node_modules/is-string/README.md | 57 + .../cli-study/node_modules/is-string/index.js | 24 + .../node_modules/is-string/package.json | 108 + .../node_modules/is-string/test/index.js | 39 + .../node_modules/is-symbol/.editorconfig | 13 + .../node_modules/is-symbol/.eslintrc | 14 + .../is-symbol/.github/FUNDING.yml | 12 + .../is-symbol/.github/workflows/rebase.yml | 15 + day1/cli-study/node_modules/is-symbol/.nvmrc | 1 + .../node_modules/is-symbol/.travis.yml | 12 + .../node_modules/is-symbol/CHANGELOG.md | 86 + day1/cli-study/node_modules/is-symbol/LICENSE | 22 + .../cli-study/node_modules/is-symbol/Makefile | 61 + .../node_modules/is-symbol/README.md | 44 + .../cli-study/node_modules/is-symbol/index.js | 35 + .../node_modules/is-symbol/package.json | 105 + .../node_modules/is-symbol/test/index.js | 92 + day1/cli-study/node_modules/is-utf8/LICENSE | 9 + day1/cli-study/node_modules/is-utf8/README.md | 16 + .../cli-study/node_modules/is-utf8/is-utf8.js | 76 + .../node_modules/is-utf8/package.json | 53 + day1/cli-study/node_modules/is/CHANGELOG.md | 124 + day1/cli-study/node_modules/is/LICENSE.md | 23 + day1/cli-study/node_modules/is/Makefile | 17 + day1/cli-study/node_modules/is/README.md | 142 + day1/cli-study/node_modules/is/component.json | 8 + day1/cli-study/node_modules/is/index.js | 818 + day1/cli-study/node_modules/is/package.json | 97 + day1/cli-study/node_modules/is/test/index.js | 729 + .../cli-study/node_modules/isarray/.npmignore | 1 + .../node_modules/isarray/.travis.yml | 4 + day1/cli-study/node_modules/isarray/Makefile | 6 + day1/cli-study/node_modules/isarray/README.md | 60 + .../node_modules/isarray/component.json | 19 + day1/cli-study/node_modules/isarray/index.js | 5 + .../node_modules/isarray/package.json | 73 + day1/cli-study/node_modules/isarray/test.js | 20 + day1/cli-study/node_modules/isexe/.npmignore | 2 + day1/cli-study/node_modules/isexe/LICENSE | 15 + day1/cli-study/node_modules/isexe/README.md | 51 + day1/cli-study/node_modules/isexe/index.js | 57 + day1/cli-study/node_modules/isexe/mode.js | 41 + .../cli-study/node_modules/isexe/package.json | 60 + .../node_modules/isexe/test/basic.js | 221 + day1/cli-study/node_modules/isexe/windows.js | 42 + day1/cli-study/node_modules/isurl/LICENSE | 21 + day1/cli-study/node_modules/isurl/README.md | 39 + day1/cli-study/node_modules/isurl/index.js | 58 + .../cli-study/node_modules/isurl/package.json | 69 + day1/cli-study/node_modules/jake/Makefile | 44 + day1/cli-study/node_modules/jake/README.md | 17 + .../node_modules/jake/bin/bash_completion.sh | 41 + day1/cli-study/node_modules/jake/bin/cli.js | 31 + day1/cli-study/node_modules/jake/jakefile.js | 105 + day1/cli-study/node_modules/jake/lib/api.js | 409 + day1/cli-study/node_modules/jake/lib/jake.js | 319 + .../cli-study/node_modules/jake/lib/loader.js | 165 + .../node_modules/jake/lib/namespace.js | 115 + .../node_modules/jake/lib/package_task.js | 406 + .../node_modules/jake/lib/parseargs.js | 134 + .../node_modules/jake/lib/program.js | 282 + .../node_modules/jake/lib/publish_task.js | 290 + day1/cli-study/node_modules/jake/lib/rule.js | 311 + .../jake/lib/task/directory_task.js | 30 + .../node_modules/jake/lib/task/file_task.js | 124 + .../node_modules/jake/lib/task/index.js | 9 + .../node_modules/jake/lib/task/task.js | 439 + .../node_modules/jake/lib/test_task.js | 270 + .../node_modules/jake/lib/utils/file.js | 286 + .../node_modules/jake/lib/utils/index.js | 297 + .../node_modules/jake/lib/utils/logger.js | 24 + .../jake/node_modules/chalk/index.js | 228 + .../jake/node_modules/chalk/index.js.flow | 93 + .../jake/node_modules/chalk/license | 9 + .../jake/node_modules/chalk/package.json | 103 + .../jake/node_modules/chalk/readme.md | 314 + .../jake/node_modules/chalk/templates.js | 128 + .../jake/node_modules/chalk/types/index.d.ts | 97 + day1/cli-study/node_modules/jake/package.json | 79 + .../jake/test/integration/concurrent.js | 42 + .../jake/test/integration/file.js | 228 + .../jake/test/integration/file_task.js | 125 + .../jake/test/integration/helpers.js | 80 + .../jake/test/integration/jakefile.js | 337 + .../integration/jakelib/concurrent.jake.js | 113 + .../test/integration/jakelib/publish.jake.js | 49 + .../jakelib/required_module.jake.js | 10 + .../test/integration/jakelib/rule.jake.js | 222 + .../jake/test/integration/publish_task.js | 24 + .../jake/test/integration/rule.js | 216 + .../jake/test/integration/selfdep.js | 39 + .../jake/test/integration/task_base.js | 164 + .../node_modules/jake/test/unit/jakefile.js | 36 + .../node_modules/jake/test/unit/namespace.js | 77 + .../node_modules/jake/test/unit/parseargs.js | 169 + day1/cli-study/node_modules/jake/usage.txt | 16 + .../node_modules/js-tokens/CHANGELOG.md | 151 + day1/cli-study/node_modules/js-tokens/LICENSE | 21 + .../node_modules/js-tokens/README.md | 240 + .../cli-study/node_modules/js-tokens/index.js | 23 + .../node_modules/js-tokens/package.json | 64 + .../node_modules/js-yaml/CHANGELOG.md | 551 + day1/cli-study/node_modules/js-yaml/LICENSE | 21 + day1/cli-study/node_modules/js-yaml/README.md | 299 + .../node_modules/js-yaml/bin/js-yaml.js | 132 + .../node_modules/js-yaml/dist/js-yaml.js | 3989 ++++ .../node_modules/js-yaml/dist/js-yaml.min.js | 1 + day1/cli-study/node_modules/js-yaml/index.js | 7 + .../node_modules/js-yaml/lib/js-yaml.js | 39 + .../js-yaml/lib/js-yaml/common.js | 59 + .../js-yaml/lib/js-yaml/dumper.js | 850 + .../js-yaml/lib/js-yaml/exception.js | 43 + .../js-yaml/lib/js-yaml/loader.js | 1644 ++ .../node_modules/js-yaml/lib/js-yaml/mark.js | 76 + .../js-yaml/lib/js-yaml/schema.js | 108 + .../js-yaml/lib/js-yaml/schema/core.js | 18 + .../lib/js-yaml/schema/default_full.js | 25 + .../lib/js-yaml/schema/default_safe.js | 28 + .../js-yaml/lib/js-yaml/schema/failsafe.js | 17 + .../js-yaml/lib/js-yaml/schema/json.js | 25 + .../node_modules/js-yaml/lib/js-yaml/type.js | 61 + .../js-yaml/lib/js-yaml/type/binary.js | 138 + .../js-yaml/lib/js-yaml/type/bool.js | 35 + .../js-yaml/lib/js-yaml/type/float.js | 116 + .../js-yaml/lib/js-yaml/type/int.js | 173 + .../js-yaml/lib/js-yaml/type/js/function.js | 93 + .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 + .../js-yaml/lib/js-yaml/type/js/undefined.js | 28 + .../js-yaml/lib/js-yaml/type/map.js | 8 + .../js-yaml/lib/js-yaml/type/merge.js | 12 + .../js-yaml/lib/js-yaml/type/null.js | 34 + .../js-yaml/lib/js-yaml/type/omap.js | 44 + .../js-yaml/lib/js-yaml/type/pairs.js | 53 + .../js-yaml/lib/js-yaml/type/seq.js | 8 + .../js-yaml/lib/js-yaml/type/set.js | 29 + .../js-yaml/lib/js-yaml/type/str.js | 8 + .../js-yaml/lib/js-yaml/type/timestamp.js | 88 + .../node_modules/js-yaml/package.json | 95 + .../node_modules/json-buffer/.npmignore | 3 + .../node_modules/json-buffer/.travis.yml | 3 + .../node_modules/json-buffer/LICENSE | 22 + .../node_modules/json-buffer/README.md | 24 + .../node_modules/json-buffer/index.js | 58 + .../node_modules/json-buffer/package.json | 66 + .../node_modules/json-buffer/test/index.js | 63 + .../json-schema-traverse/.eslintrc.yml | 27 + .../json-schema-traverse/.travis.yml | 8 + .../node_modules/json-schema-traverse/LICENSE | 21 + .../json-schema-traverse/README.md | 83 + .../json-schema-traverse/index.js | 89 + .../json-schema-traverse/package.json | 70 + .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../spec/fixtures/schema.js | 125 + .../json-schema-traverse/spec/index.spec.js | 171 + .../.npmignore | 1 + .../.travis.yml | 4 + .../LICENSE | 18 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../example/str.js | 3 + .../example/value_cmp.js | 7 + .../index.js | 82 + .../package.json | 72 + .../readme.markdown | 132 + .../test/cmp.js | 11 + .../test/nested.js | 42 + .../test/replacer.js | 74 + .../test/space.js | 59 + .../test/str.js | 32 + .../test/to-json.js | 20 + .../cli-study/node_modules/json5/CHANGELOG.md | 274 + day1/cli-study/node_modules/json5/LICENSE.md | 23 + day1/cli-study/node_modules/json5/README.md | 234 + .../node_modules/json5/dist/index.js | 1 + day1/cli-study/node_modules/json5/lib/cli.js | 2 + .../cli-study/node_modules/json5/lib/index.js | 1 + .../cli-study/node_modules/json5/lib/parse.js | 1 + .../node_modules/json5/lib/register.js | 1 + .../node_modules/json5/lib/require.js | 1 + .../node_modules/json5/lib/stringify.js | 1 + .../node_modules/json5/lib/unicode.js | 1 + day1/cli-study/node_modules/json5/lib/util.js | 1 + .../cli-study/node_modules/json5/package.json | 115 + .../node_modules/jsonfile/.npmignore | 2 + .../node_modules/jsonfile/CHANGELOG.md | 126 + day1/cli-study/node_modules/jsonfile/LICENSE | 15 + .../cli-study/node_modules/jsonfile/README.md | 162 + .../node_modules/jsonfile/appveyor.yml | 28 + day1/cli-study/node_modules/jsonfile/index.js | 133 + .../node_modules/jsonfile/package.json | 69 + day1/cli-study/node_modules/keyv/LICENSE | 21 + day1/cli-study/node_modules/keyv/README.md | 243 + day1/cli-study/node_modules/keyv/package.json | 78 + day1/cli-study/node_modules/keyv/src/index.js | 99 + day1/cli-study/node_modules/klaw/.npmignore | 3 + day1/cli-study/node_modules/klaw/CHANGELOG.md | 42 + day1/cli-study/node_modules/klaw/LICENSE | 15 + day1/cli-study/node_modules/klaw/README.md | 270 + day1/cli-study/node_modules/klaw/package.json | 70 + .../cli-study/node_modules/klaw/src/assign.js | 16 + day1/cli-study/node_modules/klaw/src/index.js | 57 + day1/cli-study/node_modules/levn/LICENSE | 22 + day1/cli-study/node_modules/levn/README.md | 196 + day1/cli-study/node_modules/levn/lib/cast.js | 327 + day1/cli-study/node_modules/levn/lib/index.js | 22 + .../node_modules/levn/lib/parse-string.js | 113 + day1/cli-study/node_modules/levn/package.json | 77 + .../node_modules/load-json-file/index.js | 11 + .../node_modules/load-json-file/license | 21 + .../load-json-file/node_modules/pify/index.js | 68 + .../load-json-file/node_modules/pify/license | 21 + .../node_modules/pify/package.json | 80 + .../node_modules/pify/readme.md | 119 + .../node_modules/load-json-file/package.json | 75 + .../node_modules/load-json-file/readme.md | 45 + .../node_modules/locate-path/index.js | 24 + .../node_modules/locate-path/license | 21 + .../node_modules/locate-path/package.json | 79 + .../node_modules/locate-path/readme.md | 99 + day1/cli-study/node_modules/lodash/LICENSE | 47 + day1/cli-study/node_modules/lodash/README.md | 39 + .../node_modules/lodash/_DataView.js | 7 + day1/cli-study/node_modules/lodash/_Hash.js | 32 + .../node_modules/lodash/_LazyWrapper.js | 28 + .../node_modules/lodash/_ListCache.js | 32 + .../node_modules/lodash/_LodashWrapper.js | 22 + day1/cli-study/node_modules/lodash/_Map.js | 7 + .../node_modules/lodash/_MapCache.js | 32 + .../cli-study/node_modules/lodash/_Promise.js | 7 + day1/cli-study/node_modules/lodash/_Set.js | 7 + .../node_modules/lodash/_SetCache.js | 27 + day1/cli-study/node_modules/lodash/_Stack.js | 27 + day1/cli-study/node_modules/lodash/_Symbol.js | 6 + .../node_modules/lodash/_Uint8Array.js | 6 + .../cli-study/node_modules/lodash/_WeakMap.js | 7 + day1/cli-study/node_modules/lodash/_apply.js | 21 + .../node_modules/lodash/_arrayAggregator.js | 22 + .../node_modules/lodash/_arrayEach.js | 22 + .../node_modules/lodash/_arrayEachRight.js | 21 + .../node_modules/lodash/_arrayEvery.js | 23 + .../node_modules/lodash/_arrayFilter.js | 25 + .../node_modules/lodash/_arrayIncludes.js | 17 + .../node_modules/lodash/_arrayIncludesWith.js | 22 + .../node_modules/lodash/_arrayLikeKeys.js | 49 + .../node_modules/lodash/_arrayMap.js | 21 + .../node_modules/lodash/_arrayPush.js | 20 + .../node_modules/lodash/_arrayReduce.js | 26 + .../node_modules/lodash/_arrayReduceRight.js | 24 + .../node_modules/lodash/_arraySample.js | 15 + .../node_modules/lodash/_arraySampleSize.js | 17 + .../node_modules/lodash/_arrayShuffle.js | 15 + .../node_modules/lodash/_arraySome.js | 23 + .../node_modules/lodash/_asciiSize.js | 12 + .../node_modules/lodash/_asciiToArray.js | 12 + .../node_modules/lodash/_asciiWords.js | 15 + .../node_modules/lodash/_assignMergeValue.js | 20 + .../node_modules/lodash/_assignValue.js | 28 + .../node_modules/lodash/_assocIndexOf.js | 21 + .../node_modules/lodash/_baseAggregator.js | 21 + .../node_modules/lodash/_baseAssign.js | 17 + .../node_modules/lodash/_baseAssignIn.js | 17 + .../node_modules/lodash/_baseAssignValue.js | 25 + day1/cli-study/node_modules/lodash/_baseAt.js | 23 + .../node_modules/lodash/_baseClamp.js | 22 + .../node_modules/lodash/_baseClone.js | 165 + .../node_modules/lodash/_baseConforms.js | 18 + .../node_modules/lodash/_baseConformsTo.js | 27 + .../node_modules/lodash/_baseCreate.js | 30 + .../node_modules/lodash/_baseDelay.js | 21 + .../node_modules/lodash/_baseDifference.js | 67 + .../node_modules/lodash/_baseEach.js | 14 + .../node_modules/lodash/_baseEachRight.js | 14 + .../node_modules/lodash/_baseEvery.js | 21 + .../node_modules/lodash/_baseExtremum.js | 32 + .../node_modules/lodash/_baseFill.js | 32 + .../node_modules/lodash/_baseFilter.js | 21 + .../node_modules/lodash/_baseFindIndex.js | 24 + .../node_modules/lodash/_baseFindKey.js | 23 + .../node_modules/lodash/_baseFlatten.js | 38 + .../cli-study/node_modules/lodash/_baseFor.js | 16 + .../node_modules/lodash/_baseForOwn.js | 16 + .../node_modules/lodash/_baseForOwnRight.js | 16 + .../node_modules/lodash/_baseForRight.js | 15 + .../node_modules/lodash/_baseFunctions.js | 19 + .../cli-study/node_modules/lodash/_baseGet.js | 24 + .../node_modules/lodash/_baseGetAllKeys.js | 20 + .../node_modules/lodash/_baseGetTag.js | 28 + day1/cli-study/node_modules/lodash/_baseGt.js | 14 + .../cli-study/node_modules/lodash/_baseHas.js | 19 + .../node_modules/lodash/_baseHasIn.js | 13 + .../node_modules/lodash/_baseInRange.js | 18 + .../node_modules/lodash/_baseIndexOf.js | 20 + .../node_modules/lodash/_baseIndexOfWith.js | 23 + .../node_modules/lodash/_baseIntersection.js | 74 + .../node_modules/lodash/_baseInverter.js | 21 + .../node_modules/lodash/_baseInvoke.js | 24 + .../node_modules/lodash/_baseIsArguments.js | 18 + .../node_modules/lodash/_baseIsArrayBuffer.js | 17 + .../node_modules/lodash/_baseIsDate.js | 18 + .../node_modules/lodash/_baseIsEqual.js | 28 + .../node_modules/lodash/_baseIsEqualDeep.js | 83 + .../node_modules/lodash/_baseIsMap.js | 18 + .../node_modules/lodash/_baseIsMatch.js | 62 + .../node_modules/lodash/_baseIsNaN.js | 12 + .../node_modules/lodash/_baseIsNative.js | 47 + .../node_modules/lodash/_baseIsRegExp.js | 18 + .../node_modules/lodash/_baseIsSet.js | 18 + .../node_modules/lodash/_baseIsTypedArray.js | 60 + .../node_modules/lodash/_baseIteratee.js | 31 + .../node_modules/lodash/_baseKeys.js | 30 + .../node_modules/lodash/_baseKeysIn.js | 33 + .../node_modules/lodash/_baseLodash.js | 10 + day1/cli-study/node_modules/lodash/_baseLt.js | 14 + .../cli-study/node_modules/lodash/_baseMap.js | 22 + .../node_modules/lodash/_baseMatches.js | 22 + .../lodash/_baseMatchesProperty.js | 33 + .../node_modules/lodash/_baseMean.js | 20 + .../node_modules/lodash/_baseMerge.js | 42 + .../node_modules/lodash/_baseMergeDeep.js | 94 + .../cli-study/node_modules/lodash/_baseNth.js | 20 + .../node_modules/lodash/_baseOrderBy.js | 34 + .../node_modules/lodash/_basePick.js | 19 + .../node_modules/lodash/_basePickBy.js | 30 + .../node_modules/lodash/_baseProperty.js | 14 + .../node_modules/lodash/_basePropertyDeep.js | 16 + .../node_modules/lodash/_basePropertyOf.js | 14 + .../node_modules/lodash/_basePullAll.js | 51 + .../node_modules/lodash/_basePullAt.js | 37 + .../node_modules/lodash/_baseRandom.js | 18 + .../node_modules/lodash/_baseRange.js | 28 + .../node_modules/lodash/_baseReduce.js | 23 + .../node_modules/lodash/_baseRepeat.js | 35 + .../node_modules/lodash/_baseRest.js | 17 + .../node_modules/lodash/_baseSample.js | 15 + .../node_modules/lodash/_baseSampleSize.js | 18 + .../cli-study/node_modules/lodash/_baseSet.js | 47 + .../node_modules/lodash/_baseSetData.js | 17 + .../node_modules/lodash/_baseSetToString.js | 22 + .../node_modules/lodash/_baseShuffle.js | 15 + .../node_modules/lodash/_baseSlice.js | 31 + .../node_modules/lodash/_baseSome.js | 22 + .../node_modules/lodash/_baseSortBy.js | 21 + .../node_modules/lodash/_baseSortedIndex.js | 42 + .../node_modules/lodash/_baseSortedIndexBy.js | 64 + .../node_modules/lodash/_baseSortedUniq.js | 30 + .../cli-study/node_modules/lodash/_baseSum.js | 24 + .../node_modules/lodash/_baseTimes.js | 20 + .../node_modules/lodash/_baseToNumber.js | 24 + .../node_modules/lodash/_baseToPairs.js | 18 + .../node_modules/lodash/_baseToString.js | 37 + .../node_modules/lodash/_baseUnary.js | 14 + .../node_modules/lodash/_baseUniq.js | 72 + .../node_modules/lodash/_baseUnset.js | 20 + .../node_modules/lodash/_baseUpdate.js | 18 + .../node_modules/lodash/_baseValues.js | 19 + .../node_modules/lodash/_baseWhile.js | 26 + .../node_modules/lodash/_baseWrapperValue.js | 25 + .../cli-study/node_modules/lodash/_baseXor.js | 36 + .../node_modules/lodash/_baseZipObject.js | 23 + .../node_modules/lodash/_cacheHas.js | 13 + .../lodash/_castArrayLikeObject.js | 14 + .../node_modules/lodash/_castFunction.js | 14 + .../node_modules/lodash/_castPath.js | 21 + .../node_modules/lodash/_castRest.js | 14 + .../node_modules/lodash/_castSlice.js | 18 + .../node_modules/lodash/_charsEndIndex.js | 19 + .../node_modules/lodash/_charsStartIndex.js | 20 + .../node_modules/lodash/_cloneArrayBuffer.js | 16 + .../node_modules/lodash/_cloneBuffer.js | 35 + .../node_modules/lodash/_cloneDataView.js | 16 + .../node_modules/lodash/_cloneRegExp.js | 17 + .../node_modules/lodash/_cloneSymbol.js | 18 + .../node_modules/lodash/_cloneTypedArray.js | 16 + .../node_modules/lodash/_compareAscending.js | 41 + .../node_modules/lodash/_compareMultiple.js | 44 + .../node_modules/lodash/_composeArgs.js | 39 + .../node_modules/lodash/_composeArgsRight.js | 41 + .../node_modules/lodash/_copyArray.js | 20 + .../node_modules/lodash/_copyObject.js | 40 + .../node_modules/lodash/_copySymbols.js | 16 + .../node_modules/lodash/_copySymbolsIn.js | 16 + .../node_modules/lodash/_coreJsData.js | 6 + .../node_modules/lodash/_countHolders.js | 21 + .../node_modules/lodash/_createAggregator.js | 23 + .../node_modules/lodash/_createAssigner.js | 37 + .../node_modules/lodash/_createBaseEach.js | 32 + .../node_modules/lodash/_createBaseFor.js | 25 + .../node_modules/lodash/_createBind.js | 28 + .../node_modules/lodash/_createCaseFirst.js | 33 + .../node_modules/lodash/_createCompounder.js | 24 + .../node_modules/lodash/_createCtor.js | 37 + .../node_modules/lodash/_createCurry.js | 46 + .../node_modules/lodash/_createFind.js | 25 + .../node_modules/lodash/_createFlow.js | 78 + .../node_modules/lodash/_createHybrid.js | 92 + .../node_modules/lodash/_createInverter.js | 17 + .../lodash/_createMathOperation.js | 38 + .../node_modules/lodash/_createOver.js | 27 + .../node_modules/lodash/_createPadding.js | 33 + .../node_modules/lodash/_createPartial.js | 43 + .../node_modules/lodash/_createRange.js | 30 + .../node_modules/lodash/_createRecurry.js | 56 + .../lodash/_createRelationalOperation.js | 20 + .../node_modules/lodash/_createRound.js | 35 + .../node_modules/lodash/_createSet.js | 19 + .../node_modules/lodash/_createToPairs.js | 30 + .../node_modules/lodash/_createWrap.js | 106 + .../lodash/_customDefaultsAssignIn.js | 29 + .../lodash/_customDefaultsMerge.js | 28 + .../node_modules/lodash/_customOmitClone.js | 16 + .../node_modules/lodash/_deburrLetter.js | 71 + .../node_modules/lodash/_defineProperty.js | 11 + .../node_modules/lodash/_equalArrays.js | 83 + .../node_modules/lodash/_equalByTag.js | 112 + .../node_modules/lodash/_equalObjects.js | 89 + .../node_modules/lodash/_escapeHtmlChar.js | 21 + .../node_modules/lodash/_escapeStringChar.js | 22 + .../node_modules/lodash/_flatRest.js | 16 + .../node_modules/lodash/_freeGlobal.js | 4 + .../node_modules/lodash/_getAllKeys.js | 16 + .../node_modules/lodash/_getAllKeysIn.js | 17 + .../cli-study/node_modules/lodash/_getData.js | 15 + .../node_modules/lodash/_getFuncName.js | 31 + .../node_modules/lodash/_getHolder.js | 13 + .../node_modules/lodash/_getMapData.js | 18 + .../node_modules/lodash/_getMatchData.js | 24 + .../node_modules/lodash/_getNative.js | 17 + .../node_modules/lodash/_getPrototype.js | 6 + .../node_modules/lodash/_getRawTag.js | 46 + .../node_modules/lodash/_getSymbols.js | 30 + .../node_modules/lodash/_getSymbolsIn.js | 25 + day1/cli-study/node_modules/lodash/_getTag.js | 58 + .../node_modules/lodash/_getValue.js | 13 + .../cli-study/node_modules/lodash/_getView.js | 33 + .../node_modules/lodash/_getWrapDetails.js | 17 + .../cli-study/node_modules/lodash/_hasPath.js | 39 + .../node_modules/lodash/_hasUnicode.js | 26 + .../node_modules/lodash/_hasUnicodeWord.js | 15 + .../node_modules/lodash/_hashClear.js | 15 + .../node_modules/lodash/_hashDelete.js | 17 + .../cli-study/node_modules/lodash/_hashGet.js | 30 + .../cli-study/node_modules/lodash/_hashHas.js | 23 + .../cli-study/node_modules/lodash/_hashSet.js | 23 + .../node_modules/lodash/_initCloneArray.js | 26 + .../node_modules/lodash/_initCloneByTag.js | 77 + .../node_modules/lodash/_initCloneObject.js | 18 + .../node_modules/lodash/_insertWrapDetails.js | 23 + .../node_modules/lodash/_isFlattenable.js | 20 + .../cli-study/node_modules/lodash/_isIndex.js | 25 + .../node_modules/lodash/_isIterateeCall.js | 30 + day1/cli-study/node_modules/lodash/_isKey.js | 29 + .../node_modules/lodash/_isKeyable.js | 15 + .../node_modules/lodash/_isLaziable.js | 28 + .../node_modules/lodash/_isMaskable.js | 14 + .../node_modules/lodash/_isMasked.js | 20 + .../node_modules/lodash/_isPrototype.js | 18 + .../lodash/_isStrictComparable.js | 15 + .../node_modules/lodash/_iteratorToArray.js | 18 + .../node_modules/lodash/_lazyClone.js | 23 + .../node_modules/lodash/_lazyReverse.js | 23 + .../node_modules/lodash/_lazyValue.js | 69 + .../node_modules/lodash/_listCacheClear.js | 13 + .../node_modules/lodash/_listCacheDelete.js | 35 + .../node_modules/lodash/_listCacheGet.js | 19 + .../node_modules/lodash/_listCacheHas.js | 16 + .../node_modules/lodash/_listCacheSet.js | 26 + .../node_modules/lodash/_mapCacheClear.js | 21 + .../node_modules/lodash/_mapCacheDelete.js | 18 + .../node_modules/lodash/_mapCacheGet.js | 16 + .../node_modules/lodash/_mapCacheHas.js | 16 + .../node_modules/lodash/_mapCacheSet.js | 22 + .../node_modules/lodash/_mapToArray.js | 18 + .../lodash/_matchesStrictComparable.js | 20 + .../node_modules/lodash/_memoizeCapped.js | 26 + .../node_modules/lodash/_mergeData.js | 90 + .../cli-study/node_modules/lodash/_metaMap.js | 6 + .../node_modules/lodash/_nativeCreate.js | 6 + .../node_modules/lodash/_nativeKeys.js | 6 + .../node_modules/lodash/_nativeKeysIn.js | 20 + .../node_modules/lodash/_nodeUtil.js | 30 + .../node_modules/lodash/_objectToString.js | 22 + .../cli-study/node_modules/lodash/_overArg.js | 15 + .../node_modules/lodash/_overRest.js | 36 + day1/cli-study/node_modules/lodash/_parent.js | 16 + .../node_modules/lodash/_reEscape.js | 4 + .../node_modules/lodash/_reEvaluate.js | 4 + .../node_modules/lodash/_reInterpolate.js | 4 + .../node_modules/lodash/_realNames.js | 4 + .../cli-study/node_modules/lodash/_reorder.js | 29 + .../node_modules/lodash/_replaceHolders.js | 29 + day1/cli-study/node_modules/lodash/_root.js | 9 + .../cli-study/node_modules/lodash/_safeGet.js | 21 + .../node_modules/lodash/_setCacheAdd.js | 19 + .../node_modules/lodash/_setCacheHas.js | 14 + .../cli-study/node_modules/lodash/_setData.js | 20 + .../node_modules/lodash/_setToArray.js | 18 + .../node_modules/lodash/_setToPairs.js | 18 + .../node_modules/lodash/_setToString.js | 14 + .../node_modules/lodash/_setWrapToString.js | 21 + .../node_modules/lodash/_shortOut.js | 37 + .../node_modules/lodash/_shuffleSelf.js | 28 + .../node_modules/lodash/_stackClear.js | 15 + .../node_modules/lodash/_stackDelete.js | 18 + .../node_modules/lodash/_stackGet.js | 14 + .../node_modules/lodash/_stackHas.js | 14 + .../node_modules/lodash/_stackSet.js | 34 + .../node_modules/lodash/_strictIndexOf.js | 23 + .../node_modules/lodash/_strictLastIndexOf.js | 21 + .../node_modules/lodash/_stringSize.js | 18 + .../node_modules/lodash/_stringToArray.js | 18 + .../node_modules/lodash/_stringToPath.js | 27 + day1/cli-study/node_modules/lodash/_toKey.js | 21 + .../node_modules/lodash/_toSource.js | 26 + .../node_modules/lodash/_unescapeHtmlChar.js | 21 + .../node_modules/lodash/_unicodeSize.js | 44 + .../node_modules/lodash/_unicodeToArray.js | 40 + .../node_modules/lodash/_unicodeWords.js | 69 + .../node_modules/lodash/_updateWrapDetails.js | 46 + .../node_modules/lodash/_wrapperClone.js | 23 + day1/cli-study/node_modules/lodash/add.js | 22 + day1/cli-study/node_modules/lodash/after.js | 42 + day1/cli-study/node_modules/lodash/array.js | 67 + day1/cli-study/node_modules/lodash/ary.js | 29 + day1/cli-study/node_modules/lodash/assign.js | 58 + .../cli-study/node_modules/lodash/assignIn.js | 40 + .../node_modules/lodash/assignInWith.js | 38 + .../node_modules/lodash/assignWith.js | 37 + day1/cli-study/node_modules/lodash/at.js | 23 + day1/cli-study/node_modules/lodash/attempt.js | 35 + day1/cli-study/node_modules/lodash/before.js | 40 + day1/cli-study/node_modules/lodash/bind.js | 57 + day1/cli-study/node_modules/lodash/bindAll.js | 41 + day1/cli-study/node_modules/lodash/bindKey.js | 68 + .../node_modules/lodash/camelCase.js | 29 + .../node_modules/lodash/capitalize.js | 23 + .../node_modules/lodash/castArray.js | 44 + day1/cli-study/node_modules/lodash/ceil.js | 26 + day1/cli-study/node_modules/lodash/chain.js | 38 + day1/cli-study/node_modules/lodash/chunk.js | 50 + day1/cli-study/node_modules/lodash/clamp.js | 39 + day1/cli-study/node_modules/lodash/clone.js | 36 + .../node_modules/lodash/cloneDeep.js | 29 + .../node_modules/lodash/cloneDeepWith.js | 40 + .../node_modules/lodash/cloneWith.js | 42 + .../node_modules/lodash/collection.js | 30 + day1/cli-study/node_modules/lodash/commit.js | 33 + day1/cli-study/node_modules/lodash/compact.js | 31 + day1/cli-study/node_modules/lodash/concat.js | 43 + day1/cli-study/node_modules/lodash/cond.js | 60 + .../cli-study/node_modules/lodash/conforms.js | 35 + .../node_modules/lodash/conformsTo.js | 32 + .../cli-study/node_modules/lodash/constant.js | 26 + day1/cli-study/node_modules/lodash/core.js | 3854 ++++ .../cli-study/node_modules/lodash/core.min.js | 29 + day1/cli-study/node_modules/lodash/countBy.js | 40 + day1/cli-study/node_modules/lodash/create.js | 43 + day1/cli-study/node_modules/lodash/curry.js | 57 + .../node_modules/lodash/curryRight.js | 54 + day1/cli-study/node_modules/lodash/date.js | 3 + .../cli-study/node_modules/lodash/debounce.js | 191 + day1/cli-study/node_modules/lodash/deburr.js | 45 + .../node_modules/lodash/defaultTo.js | 25 + .../cli-study/node_modules/lodash/defaults.js | 64 + .../node_modules/lodash/defaultsDeep.js | 30 + day1/cli-study/node_modules/lodash/defer.js | 26 + day1/cli-study/node_modules/lodash/delay.js | 28 + .../node_modules/lodash/difference.js | 33 + .../node_modules/lodash/differenceBy.js | 44 + .../node_modules/lodash/differenceWith.js | 40 + day1/cli-study/node_modules/lodash/divide.js | 22 + day1/cli-study/node_modules/lodash/drop.js | 38 + .../node_modules/lodash/dropRight.js | 39 + .../node_modules/lodash/dropRightWhile.js | 45 + .../node_modules/lodash/dropWhile.js | 45 + day1/cli-study/node_modules/lodash/each.js | 1 + .../node_modules/lodash/eachRight.js | 1 + .../cli-study/node_modules/lodash/endsWith.js | 43 + day1/cli-study/node_modules/lodash/entries.js | 1 + .../node_modules/lodash/entriesIn.js | 1 + day1/cli-study/node_modules/lodash/eq.js | 37 + day1/cli-study/node_modules/lodash/escape.js | 43 + .../node_modules/lodash/escapeRegExp.js | 32 + day1/cli-study/node_modules/lodash/every.js | 56 + day1/cli-study/node_modules/lodash/extend.js | 1 + .../node_modules/lodash/extendWith.js | 1 + day1/cli-study/node_modules/lodash/fill.js | 45 + day1/cli-study/node_modules/lodash/filter.js | 48 + day1/cli-study/node_modules/lodash/find.js | 42 + .../node_modules/lodash/findIndex.js | 55 + day1/cli-study/node_modules/lodash/findKey.js | 44 + .../cli-study/node_modules/lodash/findLast.js | 25 + .../node_modules/lodash/findLastIndex.js | 59 + .../node_modules/lodash/findLastKey.js | 44 + day1/cli-study/node_modules/lodash/first.js | 1 + day1/cli-study/node_modules/lodash/flatMap.js | 29 + .../node_modules/lodash/flatMapDeep.js | 31 + .../node_modules/lodash/flatMapDepth.js | 31 + day1/cli-study/node_modules/lodash/flatten.js | 22 + .../node_modules/lodash/flattenDeep.js | 25 + .../node_modules/lodash/flattenDepth.js | 33 + day1/cli-study/node_modules/lodash/flip.js | 28 + day1/cli-study/node_modules/lodash/floor.js | 26 + day1/cli-study/node_modules/lodash/flow.js | 27 + .../node_modules/lodash/flowRight.js | 26 + day1/cli-study/node_modules/lodash/forEach.js | 41 + .../node_modules/lodash/forEachRight.js | 31 + day1/cli-study/node_modules/lodash/forIn.js | 39 + .../node_modules/lodash/forInRight.js | 37 + day1/cli-study/node_modules/lodash/forOwn.js | 36 + .../node_modules/lodash/forOwnRight.js | 34 + day1/cli-study/node_modules/lodash/fp.js | 2 + day1/cli-study/node_modules/lodash/fp/F.js | 1 + day1/cli-study/node_modules/lodash/fp/T.js | 1 + day1/cli-study/node_modules/lodash/fp/__.js | 1 + .../node_modules/lodash/fp/_baseConvert.js | 569 + .../node_modules/lodash/fp/_convertBrowser.js | 18 + .../node_modules/lodash/fp/_falseOptions.js | 7 + .../node_modules/lodash/fp/_mapping.js | 358 + .../cli-study/node_modules/lodash/fp/_util.js | 16 + day1/cli-study/node_modules/lodash/fp/add.js | 5 + .../cli-study/node_modules/lodash/fp/after.js | 5 + day1/cli-study/node_modules/lodash/fp/all.js | 1 + .../node_modules/lodash/fp/allPass.js | 1 + .../node_modules/lodash/fp/always.js | 1 + day1/cli-study/node_modules/lodash/fp/any.js | 1 + .../node_modules/lodash/fp/anyPass.js | 1 + .../cli-study/node_modules/lodash/fp/apply.js | 1 + .../cli-study/node_modules/lodash/fp/array.js | 2 + day1/cli-study/node_modules/lodash/fp/ary.js | 5 + .../node_modules/lodash/fp/assign.js | 5 + .../node_modules/lodash/fp/assignAll.js | 5 + .../node_modules/lodash/fp/assignAllWith.js | 5 + .../node_modules/lodash/fp/assignIn.js | 5 + .../node_modules/lodash/fp/assignInAll.js | 5 + .../node_modules/lodash/fp/assignInAllWith.js | 5 + .../node_modules/lodash/fp/assignInWith.js | 5 + .../node_modules/lodash/fp/assignWith.js | 5 + .../cli-study/node_modules/lodash/fp/assoc.js | 1 + .../node_modules/lodash/fp/assocPath.js | 1 + day1/cli-study/node_modules/lodash/fp/at.js | 5 + .../node_modules/lodash/fp/attempt.js | 5 + .../node_modules/lodash/fp/before.js | 5 + day1/cli-study/node_modules/lodash/fp/bind.js | 5 + .../node_modules/lodash/fp/bindAll.js | 5 + .../node_modules/lodash/fp/bindKey.js | 5 + .../node_modules/lodash/fp/camelCase.js | 5 + .../node_modules/lodash/fp/capitalize.js | 5 + .../node_modules/lodash/fp/castArray.js | 5 + day1/cli-study/node_modules/lodash/fp/ceil.js | 5 + .../cli-study/node_modules/lodash/fp/chain.js | 5 + .../cli-study/node_modules/lodash/fp/chunk.js | 5 + .../cli-study/node_modules/lodash/fp/clamp.js | 5 + .../cli-study/node_modules/lodash/fp/clone.js | 5 + .../node_modules/lodash/fp/cloneDeep.js | 5 + .../node_modules/lodash/fp/cloneDeepWith.js | 5 + .../node_modules/lodash/fp/cloneWith.js | 5 + .../node_modules/lodash/fp/collection.js | 2 + .../node_modules/lodash/fp/commit.js | 5 + .../node_modules/lodash/fp/compact.js | 5 + .../node_modules/lodash/fp/complement.js | 1 + .../node_modules/lodash/fp/compose.js | 1 + .../node_modules/lodash/fp/concat.js | 5 + day1/cli-study/node_modules/lodash/fp/cond.js | 5 + .../node_modules/lodash/fp/conforms.js | 1 + .../node_modules/lodash/fp/conformsTo.js | 5 + .../node_modules/lodash/fp/constant.js | 5 + .../node_modules/lodash/fp/contains.js | 1 + .../node_modules/lodash/fp/convert.js | 18 + .../node_modules/lodash/fp/countBy.js | 5 + .../node_modules/lodash/fp/create.js | 5 + .../cli-study/node_modules/lodash/fp/curry.js | 5 + .../node_modules/lodash/fp/curryN.js | 5 + .../node_modules/lodash/fp/curryRight.js | 5 + .../node_modules/lodash/fp/curryRightN.js | 5 + day1/cli-study/node_modules/lodash/fp/date.js | 2 + .../node_modules/lodash/fp/debounce.js | 5 + .../node_modules/lodash/fp/deburr.js | 5 + .../node_modules/lodash/fp/defaultTo.js | 5 + .../node_modules/lodash/fp/defaults.js | 5 + .../node_modules/lodash/fp/defaultsAll.js | 5 + .../node_modules/lodash/fp/defaultsDeep.js | 5 + .../node_modules/lodash/fp/defaultsDeepAll.js | 5 + .../cli-study/node_modules/lodash/fp/defer.js | 5 + .../cli-study/node_modules/lodash/fp/delay.js | 5 + .../node_modules/lodash/fp/difference.js | 5 + .../node_modules/lodash/fp/differenceBy.js | 5 + .../node_modules/lodash/fp/differenceWith.js | 5 + .../node_modules/lodash/fp/dissoc.js | 1 + .../node_modules/lodash/fp/dissocPath.js | 1 + .../node_modules/lodash/fp/divide.js | 5 + day1/cli-study/node_modules/lodash/fp/drop.js | 5 + .../node_modules/lodash/fp/dropLast.js | 1 + .../node_modules/lodash/fp/dropLastWhile.js | 1 + .../node_modules/lodash/fp/dropRight.js | 5 + .../node_modules/lodash/fp/dropRightWhile.js | 5 + .../node_modules/lodash/fp/dropWhile.js | 5 + day1/cli-study/node_modules/lodash/fp/each.js | 1 + .../node_modules/lodash/fp/eachRight.js | 1 + .../node_modules/lodash/fp/endsWith.js | 5 + .../node_modules/lodash/fp/entries.js | 1 + .../node_modules/lodash/fp/entriesIn.js | 1 + day1/cli-study/node_modules/lodash/fp/eq.js | 5 + .../node_modules/lodash/fp/equals.js | 1 + .../node_modules/lodash/fp/escape.js | 5 + .../node_modules/lodash/fp/escapeRegExp.js | 5 + .../cli-study/node_modules/lodash/fp/every.js | 5 + .../node_modules/lodash/fp/extend.js | 1 + .../node_modules/lodash/fp/extendAll.js | 1 + .../node_modules/lodash/fp/extendAllWith.js | 1 + .../node_modules/lodash/fp/extendWith.js | 1 + day1/cli-study/node_modules/lodash/fp/fill.js | 5 + .../node_modules/lodash/fp/filter.js | 5 + day1/cli-study/node_modules/lodash/fp/find.js | 5 + .../node_modules/lodash/fp/findFrom.js | 5 + .../node_modules/lodash/fp/findIndex.js | 5 + .../node_modules/lodash/fp/findIndexFrom.js | 5 + .../node_modules/lodash/fp/findKey.js | 5 + .../node_modules/lodash/fp/findLast.js | 5 + .../node_modules/lodash/fp/findLastFrom.js | 5 + .../node_modules/lodash/fp/findLastIndex.js | 5 + .../lodash/fp/findLastIndexFrom.js | 5 + .../node_modules/lodash/fp/findLastKey.js | 5 + .../cli-study/node_modules/lodash/fp/first.js | 1 + .../node_modules/lodash/fp/flatMap.js | 5 + .../node_modules/lodash/fp/flatMapDeep.js | 5 + .../node_modules/lodash/fp/flatMapDepth.js | 5 + .../node_modules/lodash/fp/flatten.js | 5 + .../node_modules/lodash/fp/flattenDeep.js | 5 + .../node_modules/lodash/fp/flattenDepth.js | 5 + day1/cli-study/node_modules/lodash/fp/flip.js | 5 + .../cli-study/node_modules/lodash/fp/floor.js | 5 + day1/cli-study/node_modules/lodash/fp/flow.js | 5 + .../node_modules/lodash/fp/flowRight.js | 5 + .../node_modules/lodash/fp/forEach.js | 5 + .../node_modules/lodash/fp/forEachRight.js | 5 + .../cli-study/node_modules/lodash/fp/forIn.js | 5 + .../node_modules/lodash/fp/forInRight.js | 5 + .../node_modules/lodash/fp/forOwn.js | 5 + .../node_modules/lodash/fp/forOwnRight.js | 5 + .../node_modules/lodash/fp/fromPairs.js | 5 + .../node_modules/lodash/fp/function.js | 2 + .../node_modules/lodash/fp/functions.js | 5 + .../node_modules/lodash/fp/functionsIn.js | 5 + day1/cli-study/node_modules/lodash/fp/get.js | 5 + .../cli-study/node_modules/lodash/fp/getOr.js | 5 + .../node_modules/lodash/fp/groupBy.js | 5 + day1/cli-study/node_modules/lodash/fp/gt.js | 5 + day1/cli-study/node_modules/lodash/fp/gte.js | 5 + day1/cli-study/node_modules/lodash/fp/has.js | 5 + .../cli-study/node_modules/lodash/fp/hasIn.js | 5 + day1/cli-study/node_modules/lodash/fp/head.js | 5 + .../node_modules/lodash/fp/identical.js | 1 + .../node_modules/lodash/fp/identity.js | 5 + .../node_modules/lodash/fp/inRange.js | 5 + .../node_modules/lodash/fp/includes.js | 5 + .../node_modules/lodash/fp/includesFrom.js | 5 + .../node_modules/lodash/fp/indexBy.js | 1 + .../node_modules/lodash/fp/indexOf.js | 5 + .../node_modules/lodash/fp/indexOfFrom.js | 5 + day1/cli-study/node_modules/lodash/fp/init.js | 1 + .../node_modules/lodash/fp/initial.js | 5 + .../node_modules/lodash/fp/intersection.js | 5 + .../node_modules/lodash/fp/intersectionBy.js | 5 + .../lodash/fp/intersectionWith.js | 5 + .../node_modules/lodash/fp/invert.js | 5 + .../node_modules/lodash/fp/invertBy.js | 5 + .../node_modules/lodash/fp/invertObj.js | 1 + .../node_modules/lodash/fp/invoke.js | 5 + .../node_modules/lodash/fp/invokeArgs.js | 5 + .../node_modules/lodash/fp/invokeArgsMap.js | 5 + .../node_modules/lodash/fp/invokeMap.js | 5 + .../node_modules/lodash/fp/isArguments.js | 5 + .../node_modules/lodash/fp/isArray.js | 5 + .../node_modules/lodash/fp/isArrayBuffer.js | 5 + .../node_modules/lodash/fp/isArrayLike.js | 5 + .../lodash/fp/isArrayLikeObject.js | 5 + .../node_modules/lodash/fp/isBoolean.js | 5 + .../node_modules/lodash/fp/isBuffer.js | 5 + .../node_modules/lodash/fp/isDate.js | 5 + .../node_modules/lodash/fp/isElement.js | 5 + .../node_modules/lodash/fp/isEmpty.js | 5 + .../node_modules/lodash/fp/isEqual.js | 5 + .../node_modules/lodash/fp/isEqualWith.js | 5 + .../node_modules/lodash/fp/isError.js | 5 + .../node_modules/lodash/fp/isFinite.js | 5 + .../node_modules/lodash/fp/isFunction.js | 5 + .../node_modules/lodash/fp/isInteger.js | 5 + .../node_modules/lodash/fp/isLength.js | 5 + .../cli-study/node_modules/lodash/fp/isMap.js | 5 + .../node_modules/lodash/fp/isMatch.js | 5 + .../node_modules/lodash/fp/isMatchWith.js | 5 + .../cli-study/node_modules/lodash/fp/isNaN.js | 5 + .../node_modules/lodash/fp/isNative.js | 5 + .../cli-study/node_modules/lodash/fp/isNil.js | 5 + .../node_modules/lodash/fp/isNull.js | 5 + .../node_modules/lodash/fp/isNumber.js | 5 + .../node_modules/lodash/fp/isObject.js | 5 + .../node_modules/lodash/fp/isObjectLike.js | 5 + .../node_modules/lodash/fp/isPlainObject.js | 5 + .../node_modules/lodash/fp/isRegExp.js | 5 + .../node_modules/lodash/fp/isSafeInteger.js | 5 + .../cli-study/node_modules/lodash/fp/isSet.js | 5 + .../node_modules/lodash/fp/isString.js | 5 + .../node_modules/lodash/fp/isSymbol.js | 5 + .../node_modules/lodash/fp/isTypedArray.js | 5 + .../node_modules/lodash/fp/isUndefined.js | 5 + .../node_modules/lodash/fp/isWeakMap.js | 5 + .../node_modules/lodash/fp/isWeakSet.js | 5 + .../node_modules/lodash/fp/iteratee.js | 5 + day1/cli-study/node_modules/lodash/fp/join.js | 5 + day1/cli-study/node_modules/lodash/fp/juxt.js | 1 + .../node_modules/lodash/fp/kebabCase.js | 5 + .../cli-study/node_modules/lodash/fp/keyBy.js | 5 + day1/cli-study/node_modules/lodash/fp/keys.js | 5 + .../node_modules/lodash/fp/keysIn.js | 5 + day1/cli-study/node_modules/lodash/fp/lang.js | 2 + day1/cli-study/node_modules/lodash/fp/last.js | 5 + .../node_modules/lodash/fp/lastIndexOf.js | 5 + .../node_modules/lodash/fp/lastIndexOfFrom.js | 5 + .../node_modules/lodash/fp/lowerCase.js | 5 + .../node_modules/lodash/fp/lowerFirst.js | 5 + day1/cli-study/node_modules/lodash/fp/lt.js | 5 + day1/cli-study/node_modules/lodash/fp/lte.js | 5 + day1/cli-study/node_modules/lodash/fp/map.js | 5 + .../node_modules/lodash/fp/mapKeys.js | 5 + .../node_modules/lodash/fp/mapValues.js | 5 + .../node_modules/lodash/fp/matches.js | 1 + .../node_modules/lodash/fp/matchesProperty.js | 5 + day1/cli-study/node_modules/lodash/fp/math.js | 2 + day1/cli-study/node_modules/lodash/fp/max.js | 5 + .../cli-study/node_modules/lodash/fp/maxBy.js | 5 + day1/cli-study/node_modules/lodash/fp/mean.js | 5 + .../node_modules/lodash/fp/meanBy.js | 5 + .../node_modules/lodash/fp/memoize.js | 5 + .../cli-study/node_modules/lodash/fp/merge.js | 5 + .../node_modules/lodash/fp/mergeAll.js | 5 + .../node_modules/lodash/fp/mergeAllWith.js | 5 + .../node_modules/lodash/fp/mergeWith.js | 5 + .../node_modules/lodash/fp/method.js | 5 + .../node_modules/lodash/fp/methodOf.js | 5 + day1/cli-study/node_modules/lodash/fp/min.js | 5 + .../cli-study/node_modules/lodash/fp/minBy.js | 5 + .../cli-study/node_modules/lodash/fp/mixin.js | 5 + .../node_modules/lodash/fp/multiply.js | 5 + day1/cli-study/node_modules/lodash/fp/nAry.js | 1 + .../node_modules/lodash/fp/negate.js | 5 + day1/cli-study/node_modules/lodash/fp/next.js | 5 + day1/cli-study/node_modules/lodash/fp/noop.js | 5 + day1/cli-study/node_modules/lodash/fp/now.js | 5 + day1/cli-study/node_modules/lodash/fp/nth.js | 5 + .../node_modules/lodash/fp/nthArg.js | 5 + .../node_modules/lodash/fp/number.js | 2 + .../node_modules/lodash/fp/object.js | 2 + day1/cli-study/node_modules/lodash/fp/omit.js | 5 + .../node_modules/lodash/fp/omitAll.js | 1 + .../node_modules/lodash/fp/omitBy.js | 5 + day1/cli-study/node_modules/lodash/fp/once.js | 5 + .../node_modules/lodash/fp/orderBy.js | 5 + day1/cli-study/node_modules/lodash/fp/over.js | 5 + .../node_modules/lodash/fp/overArgs.js | 5 + .../node_modules/lodash/fp/overEvery.js | 5 + .../node_modules/lodash/fp/overSome.js | 5 + day1/cli-study/node_modules/lodash/fp/pad.js | 5 + .../node_modules/lodash/fp/padChars.js | 5 + .../node_modules/lodash/fp/padCharsEnd.js | 5 + .../node_modules/lodash/fp/padCharsStart.js | 5 + .../node_modules/lodash/fp/padEnd.js | 5 + .../node_modules/lodash/fp/padStart.js | 5 + .../node_modules/lodash/fp/parseInt.js | 5 + .../node_modules/lodash/fp/partial.js | 5 + .../node_modules/lodash/fp/partialRight.js | 5 + .../node_modules/lodash/fp/partition.js | 5 + day1/cli-study/node_modules/lodash/fp/path.js | 1 + .../node_modules/lodash/fp/pathEq.js | 1 + .../node_modules/lodash/fp/pathOr.js | 1 + .../cli-study/node_modules/lodash/fp/paths.js | 1 + day1/cli-study/node_modules/lodash/fp/pick.js | 5 + .../node_modules/lodash/fp/pickAll.js | 1 + .../node_modules/lodash/fp/pickBy.js | 5 + day1/cli-study/node_modules/lodash/fp/pipe.js | 1 + .../node_modules/lodash/fp/placeholder.js | 6 + .../cli-study/node_modules/lodash/fp/plant.js | 5 + .../cli-study/node_modules/lodash/fp/pluck.js | 1 + day1/cli-study/node_modules/lodash/fp/prop.js | 1 + .../node_modules/lodash/fp/propEq.js | 1 + .../node_modules/lodash/fp/propOr.js | 1 + .../node_modules/lodash/fp/property.js | 1 + .../node_modules/lodash/fp/propertyOf.js | 5 + .../cli-study/node_modules/lodash/fp/props.js | 1 + day1/cli-study/node_modules/lodash/fp/pull.js | 5 + .../node_modules/lodash/fp/pullAll.js | 5 + .../node_modules/lodash/fp/pullAllBy.js | 5 + .../node_modules/lodash/fp/pullAllWith.js | 5 + .../node_modules/lodash/fp/pullAt.js | 5 + .../node_modules/lodash/fp/random.js | 5 + .../cli-study/node_modules/lodash/fp/range.js | 5 + .../node_modules/lodash/fp/rangeRight.js | 5 + .../node_modules/lodash/fp/rangeStep.js | 5 + .../node_modules/lodash/fp/rangeStepRight.js | 5 + .../cli-study/node_modules/lodash/fp/rearg.js | 5 + .../node_modules/lodash/fp/reduce.js | 5 + .../node_modules/lodash/fp/reduceRight.js | 5 + .../node_modules/lodash/fp/reject.js | 5 + .../node_modules/lodash/fp/remove.js | 5 + .../node_modules/lodash/fp/repeat.js | 5 + .../node_modules/lodash/fp/replace.js | 5 + day1/cli-study/node_modules/lodash/fp/rest.js | 5 + .../node_modules/lodash/fp/restFrom.js | 5 + .../node_modules/lodash/fp/result.js | 5 + .../node_modules/lodash/fp/reverse.js | 5 + .../cli-study/node_modules/lodash/fp/round.js | 5 + .../node_modules/lodash/fp/sample.js | 5 + .../node_modules/lodash/fp/sampleSize.js | 5 + day1/cli-study/node_modules/lodash/fp/seq.js | 2 + day1/cli-study/node_modules/lodash/fp/set.js | 5 + .../node_modules/lodash/fp/setWith.js | 5 + .../node_modules/lodash/fp/shuffle.js | 5 + day1/cli-study/node_modules/lodash/fp/size.js | 5 + .../cli-study/node_modules/lodash/fp/slice.js | 5 + .../node_modules/lodash/fp/snakeCase.js | 5 + day1/cli-study/node_modules/lodash/fp/some.js | 5 + .../node_modules/lodash/fp/sortBy.js | 5 + .../node_modules/lodash/fp/sortedIndex.js | 5 + .../node_modules/lodash/fp/sortedIndexBy.js | 5 + .../node_modules/lodash/fp/sortedIndexOf.js | 5 + .../node_modules/lodash/fp/sortedLastIndex.js | 5 + .../lodash/fp/sortedLastIndexBy.js | 5 + .../lodash/fp/sortedLastIndexOf.js | 5 + .../node_modules/lodash/fp/sortedUniq.js | 5 + .../node_modules/lodash/fp/sortedUniqBy.js | 5 + .../cli-study/node_modules/lodash/fp/split.js | 5 + .../node_modules/lodash/fp/spread.js | 5 + .../node_modules/lodash/fp/spreadFrom.js | 5 + .../node_modules/lodash/fp/startCase.js | 5 + .../node_modules/lodash/fp/startsWith.js | 5 + .../node_modules/lodash/fp/string.js | 2 + .../node_modules/lodash/fp/stubArray.js | 5 + .../node_modules/lodash/fp/stubFalse.js | 5 + .../node_modules/lodash/fp/stubObject.js | 5 + .../node_modules/lodash/fp/stubString.js | 5 + .../node_modules/lodash/fp/stubTrue.js | 5 + .../node_modules/lodash/fp/subtract.js | 5 + day1/cli-study/node_modules/lodash/fp/sum.js | 5 + .../cli-study/node_modules/lodash/fp/sumBy.js | 5 + .../lodash/fp/symmetricDifference.js | 1 + .../lodash/fp/symmetricDifferenceBy.js | 1 + .../lodash/fp/symmetricDifferenceWith.js | 1 + day1/cli-study/node_modules/lodash/fp/tail.js | 5 + day1/cli-study/node_modules/lodash/fp/take.js | 5 + .../node_modules/lodash/fp/takeLast.js | 1 + .../node_modules/lodash/fp/takeLastWhile.js | 1 + .../node_modules/lodash/fp/takeRight.js | 5 + .../node_modules/lodash/fp/takeRightWhile.js | 5 + .../node_modules/lodash/fp/takeWhile.js | 5 + day1/cli-study/node_modules/lodash/fp/tap.js | 5 + .../node_modules/lodash/fp/template.js | 5 + .../lodash/fp/templateSettings.js | 5 + .../node_modules/lodash/fp/throttle.js | 5 + day1/cli-study/node_modules/lodash/fp/thru.js | 5 + .../cli-study/node_modules/lodash/fp/times.js | 5 + .../node_modules/lodash/fp/toArray.js | 5 + .../node_modules/lodash/fp/toFinite.js | 5 + .../node_modules/lodash/fp/toInteger.js | 5 + .../node_modules/lodash/fp/toIterator.js | 5 + .../node_modules/lodash/fp/toJSON.js | 5 + .../node_modules/lodash/fp/toLength.js | 5 + .../node_modules/lodash/fp/toLower.js | 5 + .../node_modules/lodash/fp/toNumber.js | 5 + .../node_modules/lodash/fp/toPairs.js | 5 + .../node_modules/lodash/fp/toPairsIn.js | 5 + .../node_modules/lodash/fp/toPath.js | 5 + .../node_modules/lodash/fp/toPlainObject.js | 5 + .../node_modules/lodash/fp/toSafeInteger.js | 5 + .../node_modules/lodash/fp/toString.js | 5 + .../node_modules/lodash/fp/toUpper.js | 5 + .../node_modules/lodash/fp/transform.js | 5 + day1/cli-study/node_modules/lodash/fp/trim.js | 5 + .../node_modules/lodash/fp/trimChars.js | 5 + .../node_modules/lodash/fp/trimCharsEnd.js | 5 + .../node_modules/lodash/fp/trimCharsStart.js | 5 + .../node_modules/lodash/fp/trimEnd.js | 5 + .../node_modules/lodash/fp/trimStart.js | 5 + .../node_modules/lodash/fp/truncate.js | 5 + .../node_modules/lodash/fp/unapply.js | 1 + .../cli-study/node_modules/lodash/fp/unary.js | 5 + .../node_modules/lodash/fp/unescape.js | 5 + .../cli-study/node_modules/lodash/fp/union.js | 5 + .../node_modules/lodash/fp/unionBy.js | 5 + .../node_modules/lodash/fp/unionWith.js | 5 + day1/cli-study/node_modules/lodash/fp/uniq.js | 5 + .../node_modules/lodash/fp/uniqBy.js | 5 + .../node_modules/lodash/fp/uniqWith.js | 5 + .../node_modules/lodash/fp/uniqueId.js | 5 + .../node_modules/lodash/fp/unnest.js | 1 + .../cli-study/node_modules/lodash/fp/unset.js | 5 + .../cli-study/node_modules/lodash/fp/unzip.js | 5 + .../node_modules/lodash/fp/unzipWith.js | 5 + .../node_modules/lodash/fp/update.js | 5 + .../node_modules/lodash/fp/updateWith.js | 5 + .../node_modules/lodash/fp/upperCase.js | 5 + .../node_modules/lodash/fp/upperFirst.js | 5 + .../node_modules/lodash/fp/useWith.js | 1 + day1/cli-study/node_modules/lodash/fp/util.js | 2 + .../cli-study/node_modules/lodash/fp/value.js | 5 + .../node_modules/lodash/fp/valueOf.js | 5 + .../node_modules/lodash/fp/values.js | 5 + .../node_modules/lodash/fp/valuesIn.js | 5 + .../cli-study/node_modules/lodash/fp/where.js | 1 + .../node_modules/lodash/fp/whereEq.js | 1 + .../node_modules/lodash/fp/without.js | 5 + .../cli-study/node_modules/lodash/fp/words.js | 5 + day1/cli-study/node_modules/lodash/fp/wrap.js | 5 + .../node_modules/lodash/fp/wrapperAt.js | 5 + .../node_modules/lodash/fp/wrapperChain.js | 5 + .../node_modules/lodash/fp/wrapperLodash.js | 5 + .../node_modules/lodash/fp/wrapperReverse.js | 5 + .../node_modules/lodash/fp/wrapperValue.js | 5 + day1/cli-study/node_modules/lodash/fp/xor.js | 5 + .../cli-study/node_modules/lodash/fp/xorBy.js | 5 + .../node_modules/lodash/fp/xorWith.js | 5 + day1/cli-study/node_modules/lodash/fp/zip.js | 5 + .../node_modules/lodash/fp/zipAll.js | 5 + .../node_modules/lodash/fp/zipObj.js | 1 + .../node_modules/lodash/fp/zipObject.js | 5 + .../node_modules/lodash/fp/zipObjectDeep.js | 5 + .../node_modules/lodash/fp/zipWith.js | 5 + .../node_modules/lodash/fromPairs.js | 28 + .../cli-study/node_modules/lodash/function.js | 25 + .../node_modules/lodash/functions.js | 31 + .../node_modules/lodash/functionsIn.js | 31 + day1/cli-study/node_modules/lodash/get.js | 33 + day1/cli-study/node_modules/lodash/groupBy.js | 41 + day1/cli-study/node_modules/lodash/gt.js | 29 + day1/cli-study/node_modules/lodash/gte.js | 30 + day1/cli-study/node_modules/lodash/has.js | 35 + day1/cli-study/node_modules/lodash/hasIn.js | 34 + day1/cli-study/node_modules/lodash/head.js | 23 + .../cli-study/node_modules/lodash/identity.js | 21 + day1/cli-study/node_modules/lodash/inRange.js | 55 + .../cli-study/node_modules/lodash/includes.js | 53 + day1/cli-study/node_modules/lodash/index.js | 1 + day1/cli-study/node_modules/lodash/indexOf.js | 42 + day1/cli-study/node_modules/lodash/initial.js | 22 + .../node_modules/lodash/intersection.js | 30 + .../node_modules/lodash/intersectionBy.js | 45 + .../node_modules/lodash/intersectionWith.js | 41 + day1/cli-study/node_modules/lodash/invert.js | 42 + .../cli-study/node_modules/lodash/invertBy.js | 56 + day1/cli-study/node_modules/lodash/invoke.js | 24 + .../node_modules/lodash/invokeMap.js | 41 + .../node_modules/lodash/isArguments.js | 36 + day1/cli-study/node_modules/lodash/isArray.js | 26 + .../node_modules/lodash/isArrayBuffer.js | 27 + .../node_modules/lodash/isArrayLike.js | 33 + .../node_modules/lodash/isArrayLikeObject.js | 33 + .../node_modules/lodash/isBoolean.js | 29 + .../cli-study/node_modules/lodash/isBuffer.js | 38 + day1/cli-study/node_modules/lodash/isDate.js | 27 + .../node_modules/lodash/isElement.js | 25 + day1/cli-study/node_modules/lodash/isEmpty.js | 77 + day1/cli-study/node_modules/lodash/isEqual.js | 35 + .../node_modules/lodash/isEqualWith.js | 41 + day1/cli-study/node_modules/lodash/isError.js | 36 + .../cli-study/node_modules/lodash/isFinite.js | 36 + .../node_modules/lodash/isFunction.js | 37 + .../node_modules/lodash/isInteger.js | 33 + .../cli-study/node_modules/lodash/isLength.js | 35 + day1/cli-study/node_modules/lodash/isMap.js | 27 + day1/cli-study/node_modules/lodash/isMatch.js | 36 + .../node_modules/lodash/isMatchWith.js | 41 + day1/cli-study/node_modules/lodash/isNaN.js | 38 + .../cli-study/node_modules/lodash/isNative.js | 40 + day1/cli-study/node_modules/lodash/isNil.js | 25 + day1/cli-study/node_modules/lodash/isNull.js | 22 + .../cli-study/node_modules/lodash/isNumber.js | 38 + .../cli-study/node_modules/lodash/isObject.js | 31 + .../node_modules/lodash/isObjectLike.js | 29 + .../node_modules/lodash/isPlainObject.js | 62 + .../cli-study/node_modules/lodash/isRegExp.js | 27 + .../node_modules/lodash/isSafeInteger.js | 37 + day1/cli-study/node_modules/lodash/isSet.js | 27 + .../cli-study/node_modules/lodash/isString.js | 30 + .../cli-study/node_modules/lodash/isSymbol.js | 29 + .../node_modules/lodash/isTypedArray.js | 27 + .../node_modules/lodash/isUndefined.js | 22 + .../node_modules/lodash/isWeakMap.js | 28 + .../node_modules/lodash/isWeakSet.js | 28 + .../cli-study/node_modules/lodash/iteratee.js | 53 + day1/cli-study/node_modules/lodash/join.js | 26 + .../node_modules/lodash/kebabCase.js | 28 + day1/cli-study/node_modules/lodash/keyBy.js | 36 + day1/cli-study/node_modules/lodash/keys.js | 37 + day1/cli-study/node_modules/lodash/keysIn.js | 32 + day1/cli-study/node_modules/lodash/lang.js | 58 + day1/cli-study/node_modules/lodash/last.js | 20 + .../node_modules/lodash/lastIndexOf.js | 46 + day1/cli-study/node_modules/lodash/lodash.js | 17112 ++++++++++++++++ .../node_modules/lodash/lodash.min.js | 137 + .../node_modules/lodash/lowerCase.js | 27 + .../node_modules/lodash/lowerFirst.js | 22 + day1/cli-study/node_modules/lodash/lt.js | 29 + day1/cli-study/node_modules/lodash/lte.js | 30 + day1/cli-study/node_modules/lodash/map.js | 53 + day1/cli-study/node_modules/lodash/mapKeys.js | 36 + .../node_modules/lodash/mapValues.js | 43 + day1/cli-study/node_modules/lodash/matches.js | 39 + .../node_modules/lodash/matchesProperty.js | 37 + day1/cli-study/node_modules/lodash/math.js | 17 + day1/cli-study/node_modules/lodash/max.js | 29 + day1/cli-study/node_modules/lodash/maxBy.js | 34 + day1/cli-study/node_modules/lodash/mean.js | 22 + day1/cli-study/node_modules/lodash/meanBy.js | 31 + day1/cli-study/node_modules/lodash/memoize.js | 73 + day1/cli-study/node_modules/lodash/merge.js | 39 + .../node_modules/lodash/mergeWith.js | 39 + day1/cli-study/node_modules/lodash/method.js | 34 + .../cli-study/node_modules/lodash/methodOf.js | 33 + day1/cli-study/node_modules/lodash/min.js | 29 + day1/cli-study/node_modules/lodash/minBy.js | 34 + day1/cli-study/node_modules/lodash/mixin.js | 74 + .../cli-study/node_modules/lodash/multiply.js | 22 + day1/cli-study/node_modules/lodash/negate.js | 40 + day1/cli-study/node_modules/lodash/next.js | 35 + day1/cli-study/node_modules/lodash/noop.js | 17 + day1/cli-study/node_modules/lodash/now.js | 23 + day1/cli-study/node_modules/lodash/nth.js | 29 + day1/cli-study/node_modules/lodash/nthArg.js | 32 + day1/cli-study/node_modules/lodash/number.js | 5 + day1/cli-study/node_modules/lodash/object.js | 49 + day1/cli-study/node_modules/lodash/omit.js | 57 + day1/cli-study/node_modules/lodash/omitBy.js | 29 + day1/cli-study/node_modules/lodash/once.js | 25 + day1/cli-study/node_modules/lodash/orderBy.js | 47 + day1/cli-study/node_modules/lodash/over.js | 24 + .../cli-study/node_modules/lodash/overArgs.js | 61 + .../node_modules/lodash/overEvery.js | 30 + .../cli-study/node_modules/lodash/overSome.js | 30 + .../node_modules/lodash/package.json | 64 + day1/cli-study/node_modules/lodash/pad.js | 49 + day1/cli-study/node_modules/lodash/padEnd.js | 39 + .../cli-study/node_modules/lodash/padStart.js | 39 + .../cli-study/node_modules/lodash/parseInt.js | 43 + day1/cli-study/node_modules/lodash/partial.js | 50 + .../node_modules/lodash/partialRight.js | 49 + .../node_modules/lodash/partition.js | 43 + day1/cli-study/node_modules/lodash/pick.js | 25 + day1/cli-study/node_modules/lodash/pickBy.js | 37 + day1/cli-study/node_modules/lodash/plant.js | 48 + .../cli-study/node_modules/lodash/property.js | 32 + .../node_modules/lodash/propertyOf.js | 30 + day1/cli-study/node_modules/lodash/pull.js | 29 + day1/cli-study/node_modules/lodash/pullAll.js | 29 + .../node_modules/lodash/pullAllBy.js | 33 + .../node_modules/lodash/pullAllWith.js | 32 + day1/cli-study/node_modules/lodash/pullAt.js | 43 + day1/cli-study/node_modules/lodash/random.js | 82 + day1/cli-study/node_modules/lodash/range.js | 46 + .../node_modules/lodash/rangeRight.js | 41 + day1/cli-study/node_modules/lodash/rearg.js | 33 + day1/cli-study/node_modules/lodash/reduce.js | 51 + .../node_modules/lodash/reduceRight.js | 36 + day1/cli-study/node_modules/lodash/reject.js | 46 + day1/cli-study/node_modules/lodash/remove.js | 53 + day1/cli-study/node_modules/lodash/repeat.js | 37 + day1/cli-study/node_modules/lodash/replace.js | 29 + day1/cli-study/node_modules/lodash/rest.js | 40 + day1/cli-study/node_modules/lodash/result.js | 56 + day1/cli-study/node_modules/lodash/reverse.js | 34 + day1/cli-study/node_modules/lodash/round.js | 26 + day1/cli-study/node_modules/lodash/sample.js | 24 + .../node_modules/lodash/sampleSize.js | 37 + day1/cli-study/node_modules/lodash/seq.js | 16 + day1/cli-study/node_modules/lodash/set.js | 35 + day1/cli-study/node_modules/lodash/setWith.js | 32 + day1/cli-study/node_modules/lodash/shuffle.js | 25 + day1/cli-study/node_modules/lodash/size.js | 46 + day1/cli-study/node_modules/lodash/slice.js | 37 + .../node_modules/lodash/snakeCase.js | 28 + day1/cli-study/node_modules/lodash/some.js | 51 + day1/cli-study/node_modules/lodash/sortBy.js | 48 + .../node_modules/lodash/sortedIndex.js | 24 + .../node_modules/lodash/sortedIndexBy.js | 33 + .../node_modules/lodash/sortedIndexOf.js | 31 + .../node_modules/lodash/sortedLastIndex.js | 25 + .../node_modules/lodash/sortedLastIndexBy.js | 33 + .../node_modules/lodash/sortedLastIndexOf.js | 31 + .../node_modules/lodash/sortedUniq.js | 24 + .../node_modules/lodash/sortedUniqBy.js | 26 + day1/cli-study/node_modules/lodash/split.js | 52 + day1/cli-study/node_modules/lodash/spread.js | 63 + .../node_modules/lodash/startCase.js | 29 + .../node_modules/lodash/startsWith.js | 39 + day1/cli-study/node_modules/lodash/string.js | 33 + .../node_modules/lodash/stubArray.js | 23 + .../node_modules/lodash/stubFalse.js | 18 + .../node_modules/lodash/stubObject.js | 23 + .../node_modules/lodash/stubString.js | 18 + .../cli-study/node_modules/lodash/stubTrue.js | 18 + .../cli-study/node_modules/lodash/subtract.js | 22 + day1/cli-study/node_modules/lodash/sum.js | 24 + day1/cli-study/node_modules/lodash/sumBy.js | 33 + day1/cli-study/node_modules/lodash/tail.js | 22 + day1/cli-study/node_modules/lodash/take.js | 37 + .../node_modules/lodash/takeRight.js | 39 + .../node_modules/lodash/takeRightWhile.js | 45 + .../node_modules/lodash/takeWhile.js | 45 + day1/cli-study/node_modules/lodash/tap.js | 29 + .../cli-study/node_modules/lodash/template.js | 253 + .../node_modules/lodash/templateSettings.js | 67 + .../cli-study/node_modules/lodash/throttle.js | 69 + day1/cli-study/node_modules/lodash/thru.js | 28 + day1/cli-study/node_modules/lodash/times.js | 51 + day1/cli-study/node_modules/lodash/toArray.js | 58 + .../cli-study/node_modules/lodash/toFinite.js | 42 + .../node_modules/lodash/toInteger.js | 36 + .../node_modules/lodash/toIterator.js | 23 + day1/cli-study/node_modules/lodash/toJSON.js | 1 + .../cli-study/node_modules/lodash/toLength.js | 38 + day1/cli-study/node_modules/lodash/toLower.js | 28 + .../cli-study/node_modules/lodash/toNumber.js | 66 + day1/cli-study/node_modules/lodash/toPairs.js | 30 + .../node_modules/lodash/toPairsIn.js | 30 + day1/cli-study/node_modules/lodash/toPath.js | 33 + .../node_modules/lodash/toPlainObject.js | 32 + .../node_modules/lodash/toSafeInteger.js | 37 + .../cli-study/node_modules/lodash/toString.js | 28 + day1/cli-study/node_modules/lodash/toUpper.js | 28 + .../node_modules/lodash/transform.js | 65 + day1/cli-study/node_modules/lodash/trim.js | 49 + day1/cli-study/node_modules/lodash/trimEnd.js | 43 + .../node_modules/lodash/trimStart.js | 43 + .../cli-study/node_modules/lodash/truncate.js | 111 + day1/cli-study/node_modules/lodash/unary.js | 22 + .../cli-study/node_modules/lodash/unescape.js | 34 + day1/cli-study/node_modules/lodash/union.js | 26 + day1/cli-study/node_modules/lodash/unionBy.js | 39 + .../node_modules/lodash/unionWith.js | 34 + day1/cli-study/node_modules/lodash/uniq.js | 25 + day1/cli-study/node_modules/lodash/uniqBy.js | 31 + .../cli-study/node_modules/lodash/uniqWith.js | 28 + .../cli-study/node_modules/lodash/uniqueId.js | 28 + day1/cli-study/node_modules/lodash/unset.js | 34 + day1/cli-study/node_modules/lodash/unzip.js | 45 + .../node_modules/lodash/unzipWith.js | 39 + day1/cli-study/node_modules/lodash/update.js | 35 + .../node_modules/lodash/updateWith.js | 33 + .../node_modules/lodash/upperCase.js | 27 + .../node_modules/lodash/upperFirst.js | 22 + day1/cli-study/node_modules/lodash/util.js | 34 + day1/cli-study/node_modules/lodash/value.js | 1 + day1/cli-study/node_modules/lodash/valueOf.js | 1 + day1/cli-study/node_modules/lodash/values.js | 34 + .../cli-study/node_modules/lodash/valuesIn.js | 32 + day1/cli-study/node_modules/lodash/without.js | 31 + day1/cli-study/node_modules/lodash/words.js | 35 + day1/cli-study/node_modules/lodash/wrap.js | 30 + .../node_modules/lodash/wrapperAt.js | 48 + .../node_modules/lodash/wrapperChain.js | 34 + .../node_modules/lodash/wrapperLodash.js | 147 + .../node_modules/lodash/wrapperReverse.js | 44 + .../node_modules/lodash/wrapperValue.js | 21 + day1/cli-study/node_modules/lodash/xor.js | 28 + day1/cli-study/node_modules/lodash/xorBy.js | 39 + day1/cli-study/node_modules/lodash/xorWith.js | 34 + day1/cli-study/node_modules/lodash/zip.js | 22 + .../node_modules/lodash/zipObject.js | 24 + .../node_modules/lodash/zipObjectDeep.js | 23 + day1/cli-study/node_modules/lodash/zipWith.js | 32 + .../node_modules/log-symbols/browser.js | 8 + .../node_modules/log-symbols/index.d.ts | 25 + .../node_modules/log-symbols/index.js | 20 + .../node_modules/log-symbols/license | 9 + .../log-symbols/node_modules/chalk/index.js | 228 + .../node_modules/chalk/index.js.flow | 93 + .../log-symbols/node_modules/chalk/license | 9 + .../node_modules/chalk/package.json | 103 + .../log-symbols/node_modules/chalk/readme.md | 314 + .../node_modules/chalk/templates.js | 128 + .../node_modules/chalk/types/index.d.ts | 97 + .../node_modules/log-symbols/package.json | 86 + .../node_modules/log-symbols/readme.md | 46 + .../node_modules/lowercase-keys/index.js | 11 + .../node_modules/lowercase-keys/license | 21 + .../node_modules/lowercase-keys/package.json | 68 + .../node_modules/lowercase-keys/readme.md | 33 + day1/cli-study/node_modules/make-dir/index.js | 85 + day1/cli-study/node_modules/make-dir/license | 9 + .../node_modules/make-dir/package.json | 87 + .../cli-study/node_modules/make-dir/readme.md | 116 + .../node_modules/metalsmith/.npmignore | 2 + .../node_modules/metalsmith/.travis.yml | 17 + .../node_modules/metalsmith/CHANGELOG.md | 299 + .../node_modules/metalsmith/Makefile | 31 + .../node_modules/metalsmith/Readme.md | 307 + .../node_modules/metalsmith/bin/_metalsmith | 159 + .../node_modules/metalsmith/bin/metalsmith | 40 + .../node_modules/metalsmith/index.js | 6 + .../node_modules/metalsmith/lib/index.js | 355 + .../node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/license | 21 + .../node_modules/ansi-regex/package.json | 108 + .../node_modules/ansi-regex/readme.md | 39 + .../node_modules/ansi-styles/index.js | 65 + .../node_modules/ansi-styles/license | 21 + .../node_modules/ansi-styles/package.json | 90 + .../node_modules/ansi-styles/readme.md | 86 + .../metalsmith/node_modules/chalk/index.js | 116 + .../metalsmith/node_modules/chalk/license | 21 + .../node_modules/chalk/package.json | 114 + .../metalsmith/node_modules/chalk/readme.md | 213 + .../node_modules/commander/CHANGELOG.md | 419 + .../metalsmith/node_modules/commander/LICENSE | 22 + .../node_modules/commander/Readme.md | 428 + .../node_modules/commander/index.js | 1224 ++ .../node_modules/commander/package.json | 70 + .../node_modules/commander/typings/index.d.ts | 310 + .../node_modules/strip-ansi/index.js | 6 + .../node_modules/strip-ansi/license | 21 + .../node_modules/strip-ansi/package.json | 101 + .../node_modules/strip-ansi/readme.md | 33 + .../node_modules/supports-color/index.js | 50 + .../node_modules/supports-color/license | 21 + .../node_modules/supports-color/package.json | 89 + .../node_modules/supports-color/readme.md | 36 + .../node_modules/metalsmith/package.json | 89 + .../node_modules/metalsmith/snapcraft.yaml | 21 + .../cli-study/node_modules/mime-db/HISTORY.md | 446 + day1/cli-study/node_modules/mime-db/LICENSE | 22 + day1/cli-study/node_modules/mime-db/README.md | 102 + day1/cli-study/node_modules/mime-db/db.json | 8176 ++++++++ day1/cli-study/node_modules/mime-db/index.js | 11 + .../node_modules/mime-db/package.json | 102 + .../node_modules/mimic-fn/index.d.ts | 54 + day1/cli-study/node_modules/mimic-fn/index.js | 13 + day1/cli-study/node_modules/mimic-fn/license | 9 + .../node_modules/mimic-fn/package.json | 74 + .../cli-study/node_modules/mimic-fn/readme.md | 69 + .../node_modules/mimic-response/index.js | 32 + .../node_modules/mimic-response/license | 9 + .../node_modules/mimic-response/package.json | 71 + .../node_modules/mimic-response/readme.md | 54 + day1/cli-study/node_modules/minimatch/LICENSE | 15 + .../node_modules/minimatch/README.md | 209 + .../node_modules/minimatch/minimatch.js | 923 + .../node_modules/minimatch/package.json | 64 + .../node_modules/minimist/.travis.yml | 8 + day1/cli-study/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + day1/cli-study/node_modules/minimist/index.js | 245 + .../node_modules/minimist/package.json | 73 + .../node_modules/minimist/readme.markdown | 95 + .../node_modules/minimist/test/all_bool.js | 32 + .../node_modules/minimist/test/bool.js | 178 + .../node_modules/minimist/test/dash.js | 31 + .../minimist/test/default_bool.js | 35 + .../node_modules/minimist/test/dotted.js | 22 + .../node_modules/minimist/test/kv_short.js | 16 + .../node_modules/minimist/test/long.js | 31 + .../node_modules/minimist/test/num.js | 36 + .../node_modules/minimist/test/parse.js | 197 + .../minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/proto.js | 44 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/stop_early.js | 15 + .../node_modules/minimist/test/unknown.js | 102 + .../node_modules/minimist/test/whitespace.js | 8 + day1/cli-study/node_modules/mkdirp/LICENSE | 21 + day1/cli-study/node_modules/mkdirp/bin/cmd.js | 33 + .../node_modules/mkdirp/bin/usage.txt | 12 + day1/cli-study/node_modules/mkdirp/index.js | 99 + .../node_modules/mkdirp/package.json | 69 + .../node_modules/mkdirp/readme.markdown | 100 + day1/cli-study/node_modules/ms/index.js | 162 + day1/cli-study/node_modules/ms/license.md | 21 + day1/cli-study/node_modules/ms/package.json | 69 + day1/cli-study/node_modules/ms/readme.md | 60 + .../node_modules/mute-stream/LICENSE | 15 + .../node_modules/mute-stream/README.md | 68 + .../node_modules/mute-stream/mute.js | 145 + .../node_modules/mute-stream/package.json | 62 + .../node_modules/natural-compare/README.md | 125 + .../node_modules/natural-compare/index.js | 57 + .../node_modules/natural-compare/package.json | 73 + day1/cli-study/node_modules/ncp/.npmignore | 4 + day1/cli-study/node_modules/ncp/.travis.yml | 6 + day1/cli-study/node_modules/ncp/LICENSE.md | 21 + day1/cli-study/node_modules/ncp/README.md | 63 + day1/cli-study/node_modules/ncp/bin/ncp | 48 + day1/cli-study/node_modules/ncp/lib/ncp.js | 261 + day1/cli-study/node_modules/ncp/package.json | 63 + .../ncp/test/modified-files/out/a | 1 + .../ncp/test/modified-files/src/a | 1 + day1/cli-study/node_modules/ncp/test/ncp.js | 197 + .../ncp/test/regular-fixtures/src/a | 1 + .../ncp/test/regular-fixtures/src/b | 1 + .../ncp/test/regular-fixtures/src/c | 0 .../ncp/test/regular-fixtures/src/d | 0 .../ncp/test/regular-fixtures/src/e | 0 .../ncp/test/regular-fixtures/src/f | 0 .../ncp/test/regular-fixtures/src/sub/a | 1 + .../ncp/test/regular-fixtures/src/sub/b | 0 .../ncp/test/symlink-fixtures/src/dir/bar | 1 + .../ncp/test/symlink-fixtures/src/foo | 1 + .../normalize-package-data/AUTHORS | 4 + .../normalize-package-data/LICENSE | 30 + .../normalize-package-data/README.md | 106 + .../lib/extract_description.js | 14 + .../normalize-package-data/lib/fixer.js | 418 + .../lib/make_warning.js | 23 + .../normalize-package-data/lib/normalize.js | 39 + .../normalize-package-data/lib/safe_format.js | 9 + .../normalize-package-data/lib/typos.json | 25 + .../lib/warning_messages.json | 30 + .../node_modules/.bin/semver | 15 + .../node_modules/.bin/semver.cmd | 17 + .../node_modules/.bin/semver.ps1 | 18 + .../node_modules/semver/CHANGELOG.md | 39 + .../node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 412 + .../node_modules/semver/bin/semver | 160 + .../node_modules/semver/package.json | 60 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/semver.js | 1483 ++ .../normalize-package-data/package.json | 77 + .../node_modules/normalize-url/index.js | 163 + .../node_modules/normalize-url/license | 9 + .../node_modules/sort-keys/index.js | 55 + .../node_modules/sort-keys/license | 9 + .../node_modules/sort-keys/package.json | 72 + .../node_modules/sort-keys/readme.md | 60 + .../node_modules/normalize-url/package.json | 80 + .../node_modules/normalize-url/readme.md | 172 + day1/cli-study/node_modules/npm-conf/index.js | 43 + .../node_modules/npm-conf/lib/conf.js | 174 + .../node_modules/npm-conf/lib/defaults.js | 169 + .../node_modules/npm-conf/lib/make.js | 91 + .../node_modules/npm-conf/lib/types.js | 127 + .../node_modules/npm-conf/lib/util.js | 147 + day1/cli-study/node_modules/npm-conf/license | 9 + .../node_modules/npm-conf/package.json | 82 + .../cli-study/node_modules/npm-conf/readme.md | 47 + .../node_modules/object-assign/index.js | 90 + .../node_modules/object-assign/license | 21 + .../node_modules/object-assign/package.json | 75 + .../node_modules/object-assign/readme.md | 61 + .../node_modules/object-inspect/.eslintignore | 1 + .../node_modules/object-inspect/.eslintrc | 64 + .../.github/workflows/rebase.yml | 15 + .../node_modules/object-inspect/.nycrc | 17 + .../node_modules/object-inspect/.travis.yml | 53 + .../node_modules/object-inspect/LICENSE | 21 + .../object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + .../node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + .../node_modules/object-inspect/index.js | 383 + .../node_modules/object-inspect/package.json | 101 + .../object-inspect/readme.markdown | 62 + .../object-inspect/test-core-js.js | 26 + .../object-inspect/test/bigint.js | 31 + .../object-inspect/test/browser/dom.js | 15 + .../object-inspect/test/circular.js | 9 + .../node_modules/object-inspect/test/deep.js | 9 + .../object-inspect/test/element.js | 53 + .../node_modules/object-inspect/test/err.js | 31 + .../node_modules/object-inspect/test/fn.js | 28 + .../node_modules/object-inspect/test/has.js | 34 + .../node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + .../object-inspect/test/inspect.js | 35 + .../object-inspect/test/lowbyte.js | 12 + .../object-inspect/test/number.js | 12 + .../object-inspect/test/quoteStyle.js | 17 + .../node_modules/object-inspect/test/undef.js | 12 + .../object-inspect/test/values.js | 171 + .../object-inspect/util.inspect.js | 1 + .../node_modules/object-keys/.editorconfig | 13 + .../node_modules/object-keys/.eslintrc | 17 + .../node_modules/object-keys/.travis.yml | 277 + .../node_modules/object-keys/CHANGELOG.md | 232 + .../node_modules/object-keys/LICENSE | 21 + .../node_modules/object-keys/README.md | 76 + .../object-keys/implementation.js | 122 + .../node_modules/object-keys/index.js | 32 + .../node_modules/object-keys/isArguments.js | 17 + .../node_modules/object-keys/package.json | 119 + .../node_modules/object-keys/test/index.js | 5 + .../node_modules/object.assign/.editorconfig | 20 + .../node_modules/object.assign/.eslintrc | 17 + .../node_modules/object.assign/CHANGELOG.md | 179 + .../node_modules/object.assign/LICENSE | 21 + .../node_modules/object.assign/README.md | 135 + .../node_modules/object.assign/auto.js | 3 + .../object.assign/dist/browser.js | 492 + .../node_modules/object.assign/hasSymbols.js | 41 + .../object.assign/implementation.js | 41 + .../node_modules/object.assign/index.js | 17 + .../node_modules/object.assign/package.json | 113 + .../node_modules/object.assign/polyfill.js | 51 + .../node_modules/object.assign/shim.js | 14 + .../node_modules/object.assign/test.sh | 53 + .../node_modules/object.assign/test/.eslintrc | 7 + .../node_modules/object.assign/test/index.js | 17 + .../node_modules/object.assign/test/native.js | 47 + .../object.assign/test/shimmed.js | 50 + .../node_modules/object.assign/test/tests.js | 224 + .../node_modules/object.entries/.editorconfig | 20 + .../node_modules/object.entries/.eslintrc | 12 + .../.github/workflows/rebase.yml | 15 + .../node_modules/object.entries/.travis.yml | 8 + .../node_modules/object.entries/CHANGELOG.md | 124 + .../node_modules/object.entries/LICENSE | 22 + .../node_modules/object.entries/README.md | 59 + .../node_modules/object.entries/auto.js | 3 + .../object.entries/implementation.js | 17 + .../node_modules/object.entries/index.js | 18 + .../node_modules/object.entries/package.json | 117 + .../node_modules/object.entries/polyfill.js | 7 + .../node_modules/object.entries/shim.js | 14 + .../object.entries/test/.eslintrc | 11 + .../node_modules/object.entries/test/index.js | 17 + .../object.entries/test/shimmed.js | 36 + .../node_modules/object.entries/test/tests.js | 82 + .../node_modules/object.values/.eslintrc | 12 + .../.github/workflows/rebase.yml | 15 + .../node_modules/object.values/.travis.yml | 12 + .../node_modules/object.values/CHANGELOG.md | 44 + .../node_modules/object.values/LICENSE | 22 + .../node_modules/object.values/README.md | 59 + .../node_modules/object.values/auto.js | 3 + .../object.values/implementation.js | 18 + .../node_modules/object.values/index.js | 17 + .../node_modules/object.values/package.json | 109 + .../node_modules/object.values/polyfill.js | 7 + .../node_modules/object.values/shim.js | 14 + .../node_modules/object.values/test/.eslintrc | 11 + .../node_modules/object.values/test/index.js | 17 + .../object.values/test/shimmed.js | 36 + .../node_modules/object.values/test/tests.js | 82 + day1/cli-study/node_modules/once/LICENSE | 15 + day1/cli-study/node_modules/once/README.md | 79 + day1/cli-study/node_modules/once/once.js | 42 + day1/cli-study/node_modules/once/package.json | 67 + .../cli-study/node_modules/onetime/index.d.ts | 49 + day1/cli-study/node_modules/onetime/index.js | 50 + day1/cli-study/node_modules/onetime/license | 9 + .../node_modules/onetime/package.json | 74 + day1/cli-study/node_modules/onetime/readme.md | 94 + .../node_modules/optionator/CHANGELOG.md | 59 + .../cli-study/node_modules/optionator/LICENSE | 22 + .../node_modules/optionator/README.md | 238 + .../node_modules/optionator/lib/help.js | 260 + .../node_modules/optionator/lib/index.js | 465 + .../node_modules/optionator/lib/util.js | 54 + .../node_modules/optionator/package.json | 73 + day1/cli-study/node_modules/ora/index.d.ts | 269 + day1/cli-study/node_modules/ora/index.js | 355 + day1/cli-study/node_modules/ora/license | 9 + .../ora/node_modules/ansi-styles/index.d.ts | 197 + .../ora/node_modules/ansi-styles/index.js | 163 + .../ora/node_modules/ansi-styles/license | 9 + .../ora/node_modules/ansi-styles/package.json | 89 + .../ora/node_modules/ansi-styles/readme.md | 158 + .../ora/node_modules/chalk/index.d.ts | 411 + .../ora/node_modules/chalk/license | 9 + .../ora/node_modules/chalk/package.json | 95 + .../ora/node_modules/chalk/readme.md | 304 + .../ora/node_modules/chalk/source/index.js | 233 + .../node_modules/chalk/source/templates.js | 134 + .../ora/node_modules/chalk/source/util.js | 39 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../ora/node_modules/color-convert/LICENSE | 21 + .../ora/node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 + .../ora/node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 83 + .../ora/node_modules/color-convert/route.js | 97 + .../ora/node_modules/color-name/LICENSE | 8 + .../ora/node_modules/color-name/README.md | 11 + .../ora/node_modules/color-name/index.js | 152 + .../ora/node_modules/color-name/package.json | 56 + .../ora/node_modules/has-flag/index.d.ts | 39 + .../ora/node_modules/has-flag/index.js | 8 + .../ora/node_modules/has-flag/license | 9 + .../ora/node_modules/has-flag/package.json | 78 + .../ora/node_modules/has-flag/readme.md | 89 + .../node_modules/supports-color/browser.js | 5 + .../ora/node_modules/supports-color/index.js | 139 + .../ora/node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../ora/node_modules/supports-color/readme.md | 76 + day1/cli-study/node_modules/ora/package.json | 91 + day1/cli-study/node_modules/ora/readme.md | 256 + .../cli-study/node_modules/os-tmpdir/index.js | 25 + day1/cli-study/node_modules/os-tmpdir/license | 21 + .../node_modules/os-tmpdir/package.json | 73 + .../node_modules/os-tmpdir/readme.md | 32 + .../node_modules/p-cancelable/index.js | 88 + .../node_modules/p-cancelable/license | 9 + .../node_modules/p-cancelable/package.json | 79 + .../node_modules/p-cancelable/readme.md | 135 + day1/cli-study/node_modules/p-event/index.js | 272 + day1/cli-study/node_modules/p-event/license | 9 + .../node_modules/p-event/package.json | 84 + day1/cli-study/node_modules/p-event/readme.md | 315 + .../cli-study/node_modules/p-finally/index.js | 15 + day1/cli-study/node_modules/p-finally/license | 21 + .../node_modules/p-finally/package.json | 74 + .../node_modules/p-finally/readme.md | 47 + .../node_modules/p-is-promise/index.js | 10 + .../node_modules/p-is-promise/license | 21 + .../node_modules/p-is-promise/package.json | 75 + .../node_modules/p-is-promise/readme.md | 43 + day1/cli-study/node_modules/p-limit/index.js | 42 + day1/cli-study/node_modules/p-limit/license | 9 + .../node_modules/p-limit/package.json | 81 + day1/cli-study/node_modules/p-limit/readme.md | 69 + day1/cli-study/node_modules/p-locate/index.js | 31 + day1/cli-study/node_modules/p-locate/license | 21 + .../node_modules/p-locate/package.json | 86 + .../cli-study/node_modules/p-locate/readme.md | 86 + .../cli-study/node_modules/p-timeout/index.js | 44 + day1/cli-study/node_modules/p-timeout/license | 9 + .../node_modules/p-timeout/package.json | 76 + .../node_modules/p-timeout/readme.md | 89 + day1/cli-study/node_modules/p-try/index.js | 4 + day1/cli-study/node_modules/p-try/license | 21 + .../cli-study/node_modules/p-try/package.json | 75 + day1/cli-study/node_modules/p-try/readme.md | 38 + .../node_modules/parent-module/index.js | 37 + .../node_modules/parent-module/license | 9 + .../node_modules/parent-module/package.json | 78 + .../node_modules/parent-module/readme.md | 67 + .../node_modules/parse-json/index.js | 35 + .../cli-study/node_modules/parse-json/license | 21 + .../node_modules/parse-json/package.json | 78 + .../node_modules/parse-json/readme.md | 83 + .../node_modules/parse-json/vendor/parse.js | 752 + .../node_modules/parse-json/vendor/unicode.js | 71 + .../node_modules/path-exists/index.js | 17 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 72 + .../node_modules/path-exists/readme.md | 50 + .../node_modules/path-is-absolute/index.js | 20 + .../node_modules/path-is-absolute/license | 21 + .../path-is-absolute/package.json | 75 + .../node_modules/path-is-absolute/readme.md | 59 + .../node_modules/path-key/index.d.ts | 40 + day1/cli-study/node_modules/path-key/index.js | 16 + day1/cli-study/node_modules/path-key/license | 9 + .../node_modules/path-key/package.json | 71 + .../cli-study/node_modules/path-key/readme.md | 61 + .../node_modules/path-parse/.travis.yml | 9 + .../cli-study/node_modules/path-parse/LICENSE | 21 + .../node_modules/path-parse/README.md | 42 + .../node_modules/path-parse/index.js | 93 + .../node_modules/path-parse/package.json | 61 + .../cli-study/node_modules/path-parse/test.js | 77 + .../cli-study/node_modules/path-type/index.js | 26 + day1/cli-study/node_modules/path-type/license | 21 + .../path-type/node_modules/pify/index.js | 68 + .../path-type/node_modules/pify/license | 21 + .../path-type/node_modules/pify/package.json | 80 + .../path-type/node_modules/pify/readme.md | 119 + .../node_modules/path-type/package.json | 80 + .../node_modules/path-type/readme.md | 42 + day1/cli-study/node_modules/pend/LICENSE | 23 + day1/cli-study/node_modules/pend/README.md | 41 + day1/cli-study/node_modules/pend/index.js | 55 + day1/cli-study/node_modules/pend/package.json | 47 + day1/cli-study/node_modules/pend/test.js | 137 + day1/cli-study/node_modules/pify/index.js | 84 + day1/cli-study/node_modules/pify/license | 9 + day1/cli-study/node_modules/pify/package.json | 86 + day1/cli-study/node_modules/pify/readme.md | 131 + .../node_modules/pinkie-promise/index.js | 3 + .../node_modules/pinkie-promise/license | 21 + .../node_modules/pinkie-promise/package.json | 67 + .../node_modules/pinkie-promise/readme.md | 28 + day1/cli-study/node_modules/pinkie/index.js | 292 + day1/cli-study/node_modules/pinkie/license | 21 + .../node_modules/pinkie/package.json | 68 + day1/cli-study/node_modules/pinkie/readme.md | 83 + day1/cli-study/node_modules/pkg-dir/index.js | 10 + day1/cli-study/node_modules/pkg-dir/license | 21 + .../node_modules/pkg-dir/package.json | 85 + day1/cli-study/node_modules/pkg-dir/readme.md | 64 + .../node_modules/prelude-ls/CHANGELOG.md | 108 + .../cli-study/node_modules/prelude-ls/LICENSE | 22 + .../node_modules/prelude-ls/README.md | 15 + .../node_modules/prelude-ls/lib/Func.js | 69 + .../node_modules/prelude-ls/lib/List.js | 716 + .../node_modules/prelude-ls/lib/Num.js | 130 + .../node_modules/prelude-ls/lib/Obj.js | 154 + .../node_modules/prelude-ls/lib/Str.js | 92 + .../node_modules/prelude-ls/lib/index.js | 178 + .../node_modules/prelude-ls/package.json | 78 + .../node_modules/prepend-http/index.js | 15 + .../node_modules/prepend-http/license | 9 + .../node_modules/prepend-http/package.json | 68 + .../node_modules/prepend-http/readme.md | 56 + .../process-nextick-args/index.js | 45 + .../process-nextick-args/license.md | 19 + .../process-nextick-args/package.json | 50 + .../process-nextick-args/readme.md | 18 + .../node_modules/progress/CHANGELOG.md | 115 + day1/cli-study/node_modules/progress/LICENSE | 22 + day1/cli-study/node_modules/progress/Makefile | 8 + .../cli-study/node_modules/progress/Readme.md | 146 + day1/cli-study/node_modules/progress/index.js | 1 + .../progress/lib/node-progress.js | 236 + .../node_modules/progress/package.json | 70 + .../cli-study/node_modules/proto-list/LICENSE | 15 + .../node_modules/proto-list/README.md | 3 + .../node_modules/proto-list/package.json | 51 + .../node_modules/proto-list/proto-list.js | 88 + .../node_modules/proto-list/test/basic.js | 61 + .../node_modules/punycode/LICENSE-MIT.txt | 20 + .../cli-study/node_modules/punycode/README.md | 122 + .../node_modules/punycode/package.json | 85 + .../node_modules/punycode/punycode.es6.js | 441 + .../node_modules/punycode/punycode.js | 440 + .../node_modules/query-string/index.js | 224 + .../node_modules/query-string/license | 9 + .../node_modules/query-string/package.json | 77 + .../node_modules/query-string/readme.md | 224 + .../node_modules/read-pkg-up/index.js | 26 + .../node_modules/read-pkg-up/license | 21 + .../node_modules/read-pkg-up/package.json | 94 + .../node_modules/read-pkg-up/readme.md | 80 + day1/cli-study/node_modules/read-pkg/index.js | 47 + day1/cli-study/node_modules/read-pkg/license | 21 + .../node_modules/read-pkg/package.json | 77 + .../cli-study/node_modules/read-pkg/readme.md | 79 + .../node_modules/readable-stream/.travis.yml | 34 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 60 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 + .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 + .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 62 + .../node_modules/readable-stream/package.json | 83 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../recursive-readdir/.travis.yml | 15 + .../recursive-readdir/CHANGELOG.md | 24 + .../node_modules/recursive-readdir/LICENSE | 21 + .../node_modules/recursive-readdir/README.md | 69 + .../node_modules/recursive-readdir/index.js | 96 + .../recursive-readdir/package.json | 61 + .../test/recursive-readdir-test.js | 401 + .../recursive-readdir/test/testdir/a/a | 0 .../recursive-readdir/test/testdir/a/beans | 0 .../recursive-readdir/test/testdir/b/123 | 0 .../test/testdir/b/b/hurp-durp | 0 .../recursive-readdir/test/testdir/c.txt | 0 .../recursive-readdir/test/testdir/d.txt | 0 .../test/testdirBeta/foo.bar | 0 .../test/testdirBeta/ignore.txt | 0 .../test/testsymlinks/linkeddir/hi.docx | 0 .../test/testsymlinks/linkedfile.wmf | 0 day1/cli-study/node_modules/regexpp/LICENSE | 21 + day1/cli-study/node_modules/regexpp/README.md | 178 + .../cli-study/node_modules/regexpp/index.d.ts | 247 + day1/cli-study/node_modules/regexpp/index.js | 2085 ++ .../node_modules/regexpp/index.js.map | 1 + day1/cli-study/node_modules/regexpp/index.mjs | 2076 ++ .../node_modules/regexpp/index.mjs.map | 1 + .../node_modules/regexpp/package.json | 112 + .../node_modules/resolve-from/index.js | 47 + .../node_modules/resolve-from/license | 9 + .../node_modules/resolve-from/package.json | 66 + .../node_modules/resolve-from/readme.md | 72 + .../node_modules/resolve/.editorconfig | 20 + .../node_modules/resolve/.eslintignore | 1 + day1/cli-study/node_modules/resolve/.eslintrc | 39 + .../node_modules/resolve/.travis.yml | 8 + day1/cli-study/node_modules/resolve/LICENSE | 21 + .../node_modules/resolve/appveyor.yml | 54 + .../node_modules/resolve/example/async.js | 5 + .../node_modules/resolve/example/sync.js | 3 + day1/cli-study/node_modules/resolve/index.js | 6 + .../node_modules/resolve/lib/async.js | 298 + .../node_modules/resolve/lib/caller.js | 8 + .../node_modules/resolve/lib/core.js | 53 + .../node_modules/resolve/lib/core.json | 75 + .../node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + .../resolve/lib/normalize-options.js | 10 + .../node_modules/resolve/lib/sync.js | 191 + .../node_modules/resolve/package.json | 78 + .../node_modules/resolve/readme.markdown | 242 + .../node_modules/resolve/test/.eslintrc | 5 + .../node_modules/resolve/test/core.js | 85 + .../node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + .../node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 29 + .../node_modules/resolve/test/filter.js | 34 + .../node_modules/resolve/test/filter_sync.js | 33 + .../node_modules/resolve/test/mock.js | 239 + .../node_modules/resolve/test/mock_sync.js | 141 + .../node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + .../node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + .../node_modules/resolve/test/nonstring.js | 9 + .../node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 .../node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + .../node_modules/resolve/test/resolver.js | 450 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + .../resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + .../resolve/test/resolver_sync.js | 358 + .../resolve/test/shadowed_core.js | 38 + .../shadowed_core/node_modules/util/index.js | 0 .../node_modules/resolve/test/subdirs.js | 13 + .../node_modules/resolve/test/symlinks.js | 173 + .../node_modules/responselike/LICENSE | 19 + .../node_modules/responselike/README.md | 77 + .../node_modules/responselike/package.json | 69 + .../node_modules/responselike/src/index.js | 34 + .../node_modules/restore-cursor/index.d.ts | 13 + .../node_modules/restore-cursor/index.js | 9 + .../node_modules/restore-cursor/license | 9 + .../node_modules/restore-cursor/package.json | 84 + .../node_modules/restore-cursor/readme.md | 26 + day1/cli-study/node_modules/rimraf/LICENSE | 15 + day1/cli-study/node_modules/rimraf/README.md | 101 + day1/cli-study/node_modules/rimraf/bin.js | 50 + .../node_modules/rimraf/package.json | 67 + day1/cli-study/node_modules/rimraf/rimraf.js | 364 + day1/cli-study/node_modules/run-async/LICENSE | 21 + .../node_modules/run-async/README.md | 79 + .../cli-study/node_modules/run-async/index.js | 98 + .../node_modules/run-async/package.json | 62 + .../node_modules/rxjs/AsyncSubject.d.ts | 1 + .../node_modules/rxjs/AsyncSubject.js | 7 + .../node_modules/rxjs/AsyncSubject.js.map | 1 + .../node_modules/rxjs/BehaviorSubject.d.ts | 1 + .../node_modules/rxjs/BehaviorSubject.js | 7 + .../node_modules/rxjs/BehaviorSubject.js.map | 1 + .../node_modules/rxjs/InnerSubscriber.d.ts | 1 + .../node_modules/rxjs/InnerSubscriber.js | 7 + .../node_modules/rxjs/InnerSubscriber.js.map | 1 + day1/cli-study/node_modules/rxjs/LICENSE.txt | 202 + .../node_modules/rxjs/Notification.d.ts | 1 + .../node_modules/rxjs/Notification.js | 7 + .../node_modules/rxjs/Notification.js.map | 1 + .../node_modules/rxjs/Observable.d.ts | 1 + .../cli-study/node_modules/rxjs/Observable.js | 7 + .../node_modules/rxjs/Observable.js.map | 1 + .../cli-study/node_modules/rxjs/Observer.d.ts | 1 + day1/cli-study/node_modules/rxjs/Observer.js | 3 + .../node_modules/rxjs/Observer.js.map | 1 + .../cli-study/node_modules/rxjs/Operator.d.ts | 1 + day1/cli-study/node_modules/rxjs/Operator.js | 3 + .../node_modules/rxjs/Operator.js.map | 1 + .../node_modules/rxjs/OuterSubscriber.d.ts | 1 + .../node_modules/rxjs/OuterSubscriber.js | 7 + .../node_modules/rxjs/OuterSubscriber.js.map | 1 + day1/cli-study/node_modules/rxjs/README.md | 147 + .../node_modules/rxjs/ReplaySubject.d.ts | 1 + .../node_modules/rxjs/ReplaySubject.js | 7 + .../node_modules/rxjs/ReplaySubject.js.map | 1 + day1/cli-study/node_modules/rxjs/Rx.d.ts | 1 + day1/cli-study/node_modules/rxjs/Rx.js | 7 + day1/cli-study/node_modules/rxjs/Rx.js.map | 1 + .../node_modules/rxjs/Scheduler.d.ts | 1 + day1/cli-study/node_modules/rxjs/Scheduler.js | 7 + .../node_modules/rxjs/Scheduler.js.map | 1 + day1/cli-study/node_modules/rxjs/Subject.d.ts | 1 + day1/cli-study/node_modules/rxjs/Subject.js | 7 + .../node_modules/rxjs/Subject.js.map | 1 + .../rxjs/SubjectSubscription.d.ts | 1 + .../node_modules/rxjs/SubjectSubscription.js | 7 + .../rxjs/SubjectSubscription.js.map | 1 + .../node_modules/rxjs/Subscriber.d.ts | 1 + .../cli-study/node_modules/rxjs/Subscriber.js | 7 + .../node_modules/rxjs/Subscriber.js.map | 1 + .../node_modules/rxjs/Subscription.d.ts | 1 + .../node_modules/rxjs/Subscription.js | 7 + .../node_modules/rxjs/Subscription.js.map | 1 + .../node_modules/rxjs/_esm2015/LICENSE.txt | 202 + .../node_modules/rxjs/_esm2015/README.md | 147 + .../node_modules/rxjs/_esm2015/ajax/index.js | 3 + .../rxjs/_esm2015/ajax/index.js.map | 1 + .../node_modules/rxjs/_esm2015/fetch/index.js | 2 + .../rxjs/_esm2015/fetch/index.js.map | 1 + .../node_modules/rxjs/_esm2015/index.js | 56 + .../node_modules/rxjs/_esm2015/index.js.map | 1 + .../_esm2015/internal-compatibility/index.js | 56 + .../internal-compatibility/index.js.map | 1 + .../rxjs/_esm2015/internal/AsyncSubject.js | 41 + .../_esm2015/internal/AsyncSubject.js.map | 1 + .../rxjs/_esm2015/internal/BehaviorSubject.js | 33 + .../_esm2015/internal/BehaviorSubject.js.map | 1 + .../rxjs/_esm2015/internal/InnerSubscriber.js | 22 + .../_esm2015/internal/InnerSubscriber.js.map | 1 + .../rxjs/_esm2015/internal/Notification.js | 73 + .../_esm2015/internal/Notification.js.map | 1 + .../rxjs/_esm2015/internal/Observable.js | 107 + .../rxjs/_esm2015/internal/Observable.js.map | 1 + .../rxjs/_esm2015/internal/Observer.js | 16 + .../rxjs/_esm2015/internal/Observer.js.map | 1 + .../rxjs/_esm2015/internal/Operator.js | 1 + .../rxjs/_esm2015/internal/Operator.js.map | 1 + .../rxjs/_esm2015/internal/OuterSubscriber.js | 13 + .../_esm2015/internal/OuterSubscriber.js.map | 1 + .../rxjs/_esm2015/internal/ReplaySubject.js | 104 + .../_esm2015/internal/ReplaySubject.js.map | 1 + .../node_modules/rxjs/_esm2015/internal/Rx.js | 172 + .../rxjs/_esm2015/internal/Rx.js.map | 1 + .../rxjs/_esm2015/internal/Scheduler.js | 11 + .../rxjs/_esm2015/internal/Scheduler.js.map | 1 + .../rxjs/_esm2015/internal/Subject.js | 144 + .../rxjs/_esm2015/internal/Subject.js.map | 1 + .../_esm2015/internal/SubjectSubscription.js | 26 + .../internal/SubjectSubscription.js.map | 1 + .../rxjs/_esm2015/internal/Subscriber.js | 222 + .../rxjs/_esm2015/internal/Subscriber.js.map | 1 + .../rxjs/_esm2015/internal/Subscription.js | 133 + .../_esm2015/internal/Subscription.js.map | 1 + .../rxjs/_esm2015/internal/config.js | 18 + .../rxjs/_esm2015/internal/config.js.map | 1 + .../observable/ConnectableObservable.js | 129 + .../observable/ConnectableObservable.js.map | 1 + .../observable/SubscribeOnObservable.js | 33 + .../observable/SubscribeOnObservable.js.map | 1 + .../internal/observable/bindCallback.js | 85 + .../internal/observable/bindCallback.js.map | 1 + .../internal/observable/bindNodeCallback.js | 93 + .../observable/bindNodeCallback.js.map | 1 + .../internal/observable/combineLatest.js | 89 + .../internal/observable/combineLatest.js.map | 1 + .../_esm2015/internal/observable/concat.js | 6 + .../internal/observable/concat.js.map | 1 + .../_esm2015/internal/observable/defer.js | 18 + .../_esm2015/internal/observable/defer.js.map | 1 + .../internal/observable/dom/AjaxObservable.js | 359 + .../observable/dom/AjaxObservable.js.map | 1 + .../observable/dom/WebSocketSubject.js | 209 + .../observable/dom/WebSocketSubject.js.map | 1 + .../_esm2015/internal/observable/dom/ajax.js | 3 + .../internal/observable/dom/ajax.js.map | 1 + .../_esm2015/internal/observable/dom/fetch.js | 51 + .../internal/observable/dom/fetch.js.map | 1 + .../internal/observable/dom/webSocket.js | 5 + .../internal/observable/dom/webSocket.js.map | 1 + .../_esm2015/internal/observable/empty.js | 9 + .../_esm2015/internal/observable/empty.js.map | 1 + .../_esm2015/internal/observable/forkJoin.js | 61 + .../internal/observable/forkJoin.js.map | 1 + .../rxjs/_esm2015/internal/observable/from.js | 15 + .../_esm2015/internal/observable/from.js.map | 1 + .../_esm2015/internal/observable/fromArray.js | 12 + .../internal/observable/fromArray.js.map | 1 + .../_esm2015/internal/observable/fromEvent.js | 62 + .../internal/observable/fromEvent.js.map | 1 + .../internal/observable/fromEventPattern.js | 25 + .../observable/fromEventPattern.js.map | 1 + .../internal/observable/fromIterable.js | 15 + .../internal/observable/fromIterable.js.map | 1 + .../internal/observable/fromPromise.js | 12 + .../internal/observable/fromPromise.js.map | 1 + .../_esm2015/internal/observable/generate.js | 124 + .../internal/observable/generate.js.map | 1 + .../rxjs/_esm2015/internal/observable/iif.js | 6 + .../_esm2015/internal/observable/iif.js.map | 1 + .../_esm2015/internal/observable/interval.js | 21 + .../internal/observable/interval.js.map | 1 + .../_esm2015/internal/observable/merge.js | 23 + .../_esm2015/internal/observable/merge.js.map | 1 + .../_esm2015/internal/observable/never.js | 7 + .../_esm2015/internal/observable/never.js.map | 1 + .../rxjs/_esm2015/internal/observable/of.js | 14 + .../_esm2015/internal/observable/of.js.map | 1 + .../internal/observable/onErrorResumeNext.js | 22 + .../observable/onErrorResumeNext.js.map | 1 + .../_esm2015/internal/observable/pairs.js | 38 + .../_esm2015/internal/observable/pairs.js.map | 1 + .../_esm2015/internal/observable/partition.js | 11 + .../internal/observable/partition.js.map | 1 + .../rxjs/_esm2015/internal/observable/race.js | 64 + .../_esm2015/internal/observable/race.js.map | 1 + .../_esm2015/internal/observable/range.js | 44 + .../_esm2015/internal/observable/range.js.map | 1 + .../internal/observable/throwError.js | 13 + .../internal/observable/throwError.js.map | 1 + .../_esm2015/internal/observable/timer.js | 37 + .../_esm2015/internal/observable/timer.js.map | 1 + .../_esm2015/internal/observable/using.js | 32 + .../_esm2015/internal/observable/using.js.map | 1 + .../rxjs/_esm2015/internal/observable/zip.js | 198 + .../_esm2015/internal/observable/zip.js.map | 1 + .../rxjs/_esm2015/internal/operators/audit.js | 63 + .../_esm2015/internal/operators/audit.js.map | 1 + .../_esm2015/internal/operators/auditTime.js | 7 + .../internal/operators/auditTime.js.map | 1 + .../_esm2015/internal/operators/buffer.js | 31 + .../_esm2015/internal/operators/buffer.js.map | 1 + .../internal/operators/bufferCount.js | 78 + .../internal/operators/bufferCount.js.map | 1 + .../_esm2015/internal/operators/bufferTime.js | 141 + .../internal/operators/bufferTime.js.map | 1 + .../internal/operators/bufferToggle.js | 101 + .../internal/operators/bufferToggle.js.map | 1 + .../_esm2015/internal/operators/bufferWhen.js | 76 + .../internal/operators/bufferWhen.js.map | 1 + .../_esm2015/internal/operators/catchError.js | 45 + .../internal/operators/catchError.js.map | 1 + .../_esm2015/internal/operators/combineAll.js | 5 + .../internal/operators/combineAll.js.map | 1 + .../internal/operators/combineLatest.js | 15 + .../internal/operators/combineLatest.js.map | 1 + .../_esm2015/internal/operators/concat.js | 5 + .../_esm2015/internal/operators/concat.js.map | 1 + .../_esm2015/internal/operators/concatAll.js | 5 + .../internal/operators/concatAll.js.map | 1 + .../_esm2015/internal/operators/concatMap.js | 5 + .../internal/operators/concatMap.js.map | 1 + .../internal/operators/concatMapTo.js | 5 + .../internal/operators/concatMapTo.js.map | 1 + .../rxjs/_esm2015/internal/operators/count.js | 48 + .../_esm2015/internal/operators/count.js.map | 1 + .../_esm2015/internal/operators/debounce.js | 70 + .../internal/operators/debounce.js.map | 1 + .../internal/operators/debounceTime.js | 55 + .../internal/operators/debounceTime.js.map | 1 + .../internal/operators/defaultIfEmpty.js | 30 + .../internal/operators/defaultIfEmpty.js.map | 1 + .../rxjs/_esm2015/internal/operators/delay.js | 83 + .../_esm2015/internal/operators/delay.js.map | 1 + .../_esm2015/internal/operators/delayWhen.js | 118 + .../internal/operators/delayWhen.js.map | 1 + .../internal/operators/dematerialize.js | 20 + .../internal/operators/dematerialize.js.map | 1 + .../_esm2015/internal/operators/distinct.js | 58 + .../internal/operators/distinct.js.map | 1 + .../operators/distinctUntilChanged.js | 54 + .../operators/distinctUntilChanged.js.map | 1 + .../operators/distinctUntilKeyChanged.js | 5 + .../operators/distinctUntilKeyChanged.js.map | 1 + .../_esm2015/internal/operators/elementAt.js | 15 + .../internal/operators/elementAt.js.map | 1 + .../_esm2015/internal/operators/endWith.js | 6 + .../internal/operators/endWith.js.map | 1 + .../rxjs/_esm2015/internal/operators/every.js | 45 + .../_esm2015/internal/operators/every.js.map | 1 + .../_esm2015/internal/operators/exhaust.js | 37 + .../internal/operators/exhaust.js.map | 1 + .../_esm2015/internal/operators/exhaustMap.js | 77 + .../internal/operators/exhaustMap.js.map | 1 + .../_esm2015/internal/operators/expand.js | 91 + .../_esm2015/internal/operators/expand.js.map | 1 + .../_esm2015/internal/operators/filter.js | 37 + .../_esm2015/internal/operators/filter.js.map | 1 + .../_esm2015/internal/operators/finalize.js | 20 + .../internal/operators/finalize.js.map | 1 + .../rxjs/_esm2015/internal/operators/find.js | 51 + .../_esm2015/internal/operators/find.js.map | 1 + .../_esm2015/internal/operators/findIndex.js | 5 + .../internal/operators/findIndex.js.map | 1 + .../rxjs/_esm2015/internal/operators/first.js | 11 + .../_esm2015/internal/operators/first.js.map | 1 + .../_esm2015/internal/operators/groupBy.js | 164 + .../internal/operators/groupBy.js.map | 1 + .../internal/operators/ignoreElements.js | 16 + .../internal/operators/ignoreElements.js.map | 1 + .../rxjs/_esm2015/internal/operators/index.js | 103 + .../_esm2015/internal/operators/index.js.map | 1 + .../_esm2015/internal/operators/isEmpty.js | 26 + .../internal/operators/isEmpty.js.map | 1 + .../rxjs/_esm2015/internal/operators/last.js | 11 + .../_esm2015/internal/operators/last.js.map | 1 + .../rxjs/_esm2015/internal/operators/map.js | 38 + .../_esm2015/internal/operators/map.js.map | 1 + .../rxjs/_esm2015/internal/operators/mapTo.js | 22 + .../_esm2015/internal/operators/mapTo.js.map | 1 + .../internal/operators/materialize.js | 31 + .../internal/operators/materialize.js.map | 1 + .../rxjs/_esm2015/internal/operators/max.js | 8 + .../_esm2015/internal/operators/max.js.map | 1 + .../rxjs/_esm2015/internal/operators/merge.js | 5 + .../_esm2015/internal/operators/merge.js.map | 1 + .../_esm2015/internal/operators/mergeAll.js | 6 + .../internal/operators/mergeAll.js.map | 1 + .../_esm2015/internal/operators/mergeMap.js | 86 + .../internal/operators/mergeMap.js.map | 1 + .../_esm2015/internal/operators/mergeMapTo.js | 11 + .../internal/operators/mergeMapTo.js.map | 1 + .../_esm2015/internal/operators/mergeScan.js | 89 + .../internal/operators/mergeScan.js.map | 1 + .../rxjs/_esm2015/internal/operators/min.js | 8 + .../_esm2015/internal/operators/min.js.map | 1 + .../_esm2015/internal/operators/multicast.js | 35 + .../internal/operators/multicast.js.map | 1 + .../_esm2015/internal/operators/observeOn.js | 50 + .../internal/operators/observeOn.js.map | 1 + .../internal/operators/onErrorResumeNext.js | 64 + .../operators/onErrorResumeNext.js.map | 1 + .../_esm2015/internal/operators/pairwise.js | 29 + .../internal/operators/pairwise.js.map | 1 + .../_esm2015/internal/operators/partition.js | 9 + .../internal/operators/partition.js.map | 1 + .../rxjs/_esm2015/internal/operators/pluck.js | 25 + .../_esm2015/internal/operators/pluck.js.map | 1 + .../_esm2015/internal/operators/publish.js | 8 + .../internal/operators/publish.js.map | 1 + .../internal/operators/publishBehavior.js | 6 + .../internal/operators/publishBehavior.js.map | 1 + .../internal/operators/publishLast.js | 6 + .../internal/operators/publishLast.js.map | 1 + .../internal/operators/publishReplay.js | 11 + .../internal/operators/publishReplay.js.map | 1 + .../rxjs/_esm2015/internal/operators/race.js | 11 + .../_esm2015/internal/operators/race.js.map | 1 + .../_esm2015/internal/operators/reduce.js | 15 + .../_esm2015/internal/operators/reduce.js.map | 1 + .../_esm2015/internal/operators/refCount.js | 52 + .../internal/operators/refCount.js.map | 1 + .../_esm2015/internal/operators/repeat.js | 44 + .../_esm2015/internal/operators/repeat.js.map | 1 + .../_esm2015/internal/operators/repeatWhen.js | 77 + .../internal/operators/repeatWhen.js.map | 1 + .../rxjs/_esm2015/internal/operators/retry.js | 33 + .../_esm2015/internal/operators/retry.js.map | 1 + .../_esm2015/internal/operators/retryWhen.js | 69 + .../internal/operators/retryWhen.js.map | 1 + .../_esm2015/internal/operators/sample.js | 39 + .../_esm2015/internal/operators/sample.js.map | 1 + .../_esm2015/internal/operators/sampleTime.js | 39 + .../internal/operators/sampleTime.js.map | 1 + .../rxjs/_esm2015/internal/operators/scan.js | 58 + .../_esm2015/internal/operators/scan.js.map | 1 + .../internal/operators/sequenceEqual.js | 99 + .../internal/operators/sequenceEqual.js.map | 1 + .../rxjs/_esm2015/internal/operators/share.js | 10 + .../_esm2015/internal/operators/share.js.map | 1 + .../internal/operators/shareReplay.js | 53 + .../internal/operators/shareReplay.js.map | 1 + .../_esm2015/internal/operators/single.js | 62 + .../_esm2015/internal/operators/single.js.map | 1 + .../rxjs/_esm2015/internal/operators/skip.js | 25 + .../_esm2015/internal/operators/skip.js.map | 1 + .../_esm2015/internal/operators/skipLast.js | 44 + .../internal/operators/skipLast.js.map | 1 + .../_esm2015/internal/operators/skipUntil.js | 42 + .../internal/operators/skipUntil.js.map | 1 + .../_esm2015/internal/operators/skipWhile.js | 39 + .../internal/operators/skipWhile.js.map | 1 + .../_esm2015/internal/operators/startWith.js | 13 + .../internal/operators/startWith.js.map | 1 + .../internal/operators/subscribeOn.js | 16 + .../internal/operators/subscribeOn.js.map | 1 + .../_esm2015/internal/operators/switchAll.js | 6 + .../internal/operators/switchAll.js.map | 1 + .../_esm2015/internal/operators/switchMap.js | 73 + .../internal/operators/switchMap.js.map | 1 + .../internal/operators/switchMapTo.js | 5 + .../internal/operators/switchMapTo.js.map | 1 + .../rxjs/_esm2015/internal/operators/take.js | 43 + .../_esm2015/internal/operators/take.js.map | 1 + .../_esm2015/internal/operators/takeLast.js | 58 + .../internal/operators/takeLast.js.map | 1 + .../_esm2015/internal/operators/takeUntil.js | 32 + .../internal/operators/takeUntil.js.map | 1 + .../_esm2015/internal/operators/takeWhile.js | 46 + .../internal/operators/takeWhile.js.map | 1 + .../rxjs/_esm2015/internal/operators/tap.js | 69 + .../_esm2015/internal/operators/tap.js.map | 1 + .../_esm2015/internal/operators/throttle.js | 82 + .../internal/operators/throttle.js.map | 1 + .../internal/operators/throttleTime.js | 73 + .../internal/operators/throttleTime.js.map | 1 + .../internal/operators/throwIfEmpty.js | 45 + .../internal/operators/throwIfEmpty.js.map | 1 + .../internal/operators/timeInterval.js | 16 + .../internal/operators/timeInterval.js.map | 1 + .../_esm2015/internal/operators/timeout.js | 8 + .../internal/operators/timeout.js.map | 1 + .../internal/operators/timeoutWith.js | 59 + .../internal/operators/timeoutWith.js.map | 1 + .../_esm2015/internal/operators/timestamp.js | 12 + .../internal/operators/timestamp.js.map | 1 + .../_esm2015/internal/operators/toArray.js | 12 + .../internal/operators/toArray.js.map | 1 + .../_esm2015/internal/operators/window.js | 61 + .../_esm2015/internal/operators/window.js.map | 1 + .../internal/operators/windowCount.js | 69 + .../internal/operators/windowCount.js.map | 1 + .../_esm2015/internal/operators/windowTime.js | 142 + .../internal/operators/windowTime.js.map | 1 + .../internal/operators/windowToggle.js | 123 + .../internal/operators/windowToggle.js.map | 1 + .../_esm2015/internal/operators/windowWhen.js | 75 + .../internal/operators/windowWhen.js.map | 1 + .../internal/operators/withLatestFrom.js | 73 + .../internal/operators/withLatestFrom.js.map | 1 + .../rxjs/_esm2015/internal/operators/zip.js | 7 + .../_esm2015/internal/operators/zip.js.map | 1 + .../_esm2015/internal/operators/zipAll.js | 5 + .../_esm2015/internal/operators/zipAll.js.map | 1 + .../internal/scheduled/scheduleArray.js | 20 + .../internal/scheduled/scheduleArray.js.map | 1 + .../internal/scheduled/scheduleIterable.js | 45 + .../scheduled/scheduleIterable.js.map | 1 + .../internal/scheduled/scheduleObservable.js | 18 + .../scheduled/scheduleObservable.js.map | 1 + .../internal/scheduled/schedulePromise.js | 17 + .../internal/scheduled/schedulePromise.js.map | 1 + .../_esm2015/internal/scheduled/scheduled.js | 26 + .../internal/scheduled/scheduled.js.map | 1 + .../_esm2015/internal/scheduler/Action.js | 10 + .../_esm2015/internal/scheduler/Action.js.map | 1 + .../scheduler/AnimationFrameAction.js | 26 + .../scheduler/AnimationFrameAction.js.map | 1 + .../scheduler/AnimationFrameScheduler.js | 25 + .../scheduler/AnimationFrameScheduler.js.map | 1 + .../_esm2015/internal/scheduler/AsapAction.js | 27 + .../internal/scheduler/AsapAction.js.map | 1 + .../internal/scheduler/AsapScheduler.js | 25 + .../internal/scheduler/AsapScheduler.js.map | 1 + .../internal/scheduler/AsyncAction.js | 80 + .../internal/scheduler/AsyncAction.js.map | 1 + .../internal/scheduler/AsyncScheduler.js | 46 + .../internal/scheduler/AsyncScheduler.js.map | 1 + .../internal/scheduler/QueueAction.js | 29 + .../internal/scheduler/QueueAction.js.map | 1 + .../internal/scheduler/QueueScheduler.js | 4 + .../internal/scheduler/QueueScheduler.js.map | 1 + .../scheduler/VirtualTimeScheduler.js | 82 + .../scheduler/VirtualTimeScheduler.js.map | 1 + .../internal/scheduler/animationFrame.js | 4 + .../internal/scheduler/animationFrame.js.map | 1 + .../rxjs/_esm2015/internal/scheduler/asap.js | 4 + .../_esm2015/internal/scheduler/asap.js.map | 1 + .../rxjs/_esm2015/internal/scheduler/async.js | 4 + .../_esm2015/internal/scheduler/async.js.map | 1 + .../rxjs/_esm2015/internal/scheduler/queue.js | 4 + .../_esm2015/internal/scheduler/queue.js.map | 1 + .../rxjs/_esm2015/internal/symbol/iterator.js | 9 + .../_esm2015/internal/symbol/iterator.js.map | 1 + .../_esm2015/internal/symbol/observable.js | 2 + .../internal/symbol/observable.js.map | 1 + .../_esm2015/internal/symbol/rxSubscriber.js | 5 + .../internal/symbol/rxSubscriber.js.map | 1 + .../internal/testing/ColdObservable.js | 30 + .../internal/testing/ColdObservable.js.map | 1 + .../internal/testing/HotObservable.js | 34 + .../internal/testing/HotObservable.js.map | 1 + .../internal/testing/SubscriptionLog.js | 7 + .../internal/testing/SubscriptionLog.js.map | 1 + .../internal/testing/SubscriptionLoggable.js | 16 + .../testing/SubscriptionLoggable.js.map | 1 + .../_esm2015/internal/testing/TestMessage.js | 1 + .../internal/testing/TestMessage.js.map | 1 + .../internal/testing/TestScheduler.js | 322 + .../internal/testing/TestScheduler.js.map | 1 + .../rxjs/_esm2015/internal/types.js | 1 + .../rxjs/_esm2015/internal/types.js.map | 1 + .../internal/util/ArgumentOutOfRangeError.js | 12 + .../util/ArgumentOutOfRangeError.js.map | 1 + .../rxjs/_esm2015/internal/util/EmptyError.js | 12 + .../_esm2015/internal/util/EmptyError.js.map | 1 + .../rxjs/_esm2015/internal/util/Immediate.js | 27 + .../_esm2015/internal/util/Immediate.js.map | 1 + .../internal/util/ObjectUnsubscribedError.js | 12 + .../util/ObjectUnsubscribedError.js.map | 1 + .../_esm2015/internal/util/TimeoutError.js | 12 + .../internal/util/TimeoutError.js.map | 1 + .../internal/util/UnsubscriptionError.js | 15 + .../internal/util/UnsubscriptionError.js.map | 1 + .../_esm2015/internal/util/applyMixins.js | 11 + .../_esm2015/internal/util/applyMixins.js.map | 1 + .../_esm2015/internal/util/canReportError.js | 17 + .../internal/util/canReportError.js.map | 1 + .../_esm2015/internal/util/errorObject.js | 2 + .../_esm2015/internal/util/errorObject.js.map | 1 + .../_esm2015/internal/util/hostReportError.js | 4 + .../internal/util/hostReportError.js.map | 1 + .../rxjs/_esm2015/internal/util/identity.js | 4 + .../_esm2015/internal/util/identity.js.map | 1 + .../rxjs/_esm2015/internal/util/isArray.js | 2 + .../_esm2015/internal/util/isArray.js.map | 1 + .../_esm2015/internal/util/isArrayLike.js | 2 + .../_esm2015/internal/util/isArrayLike.js.map | 1 + .../rxjs/_esm2015/internal/util/isDate.js | 4 + .../rxjs/_esm2015/internal/util/isDate.js.map | 1 + .../rxjs/_esm2015/internal/util/isFunction.js | 4 + .../_esm2015/internal/util/isFunction.js.map | 1 + .../internal/util/isInteropObservable.js | 5 + .../internal/util/isInteropObservable.js.map | 1 + .../rxjs/_esm2015/internal/util/isIterable.js | 5 + .../_esm2015/internal/util/isIterable.js.map | 1 + .../rxjs/_esm2015/internal/util/isNumeric.js | 5 + .../_esm2015/internal/util/isNumeric.js.map | 1 + .../rxjs/_esm2015/internal/util/isObject.js | 4 + .../_esm2015/internal/util/isObject.js.map | 1 + .../_esm2015/internal/util/isObservable.js | 5 + .../internal/util/isObservable.js.map | 1 + .../rxjs/_esm2015/internal/util/isPromise.js | 4 + .../_esm2015/internal/util/isPromise.js.map | 1 + .../_esm2015/internal/util/isScheduler.js | 4 + .../_esm2015/internal/util/isScheduler.js.map | 1 + .../rxjs/_esm2015/internal/util/noop.js | 2 + .../rxjs/_esm2015/internal/util/noop.js.map | 1 + .../rxjs/_esm2015/internal/util/not.js | 9 + .../rxjs/_esm2015/internal/util/not.js.map | 1 + .../rxjs/_esm2015/internal/util/pipe.js | 16 + .../rxjs/_esm2015/internal/util/pipe.js.map | 1 + .../rxjs/_esm2015/internal/util/root.js | 12 + .../rxjs/_esm2015/internal/util/root.js.map | 1 + .../_esm2015/internal/util/subscribeTo.js | 30 + .../_esm2015/internal/util/subscribeTo.js.map | 1 + .../internal/util/subscribeToArray.js | 7 + .../internal/util/subscribeToArray.js.map | 1 + .../internal/util/subscribeToIterable.js | 24 + .../internal/util/subscribeToIterable.js.map | 1 + .../internal/util/subscribeToObservable.js | 11 + .../util/subscribeToObservable.js.map | 1 + .../internal/util/subscribeToPromise.js | 12 + .../internal/util/subscribeToPromise.js.map | 1 + .../internal/util/subscribeToResult.js | 13 + .../internal/util/subscribeToResult.js.map | 1 + .../_esm2015/internal/util/toSubscriber.js | 18 + .../internal/util/toSubscriber.js.map | 1 + .../rxjs/_esm2015/internal/util/tryCatch.js | 20 + .../_esm2015/internal/util/tryCatch.js.map | 1 + .../rxjs/_esm2015/operators/index.js | 105 + .../rxjs/_esm2015/operators/index.js.map | 1 + .../rxjs/_esm2015/path-mapping.js | 453 + .../rxjs/_esm2015/testing/index.js | 2 + .../rxjs/_esm2015/testing/index.js.map | 1 + .../rxjs/_esm2015/webSocket/index.js | 3 + .../rxjs/_esm2015/webSocket/index.js.map | 1 + .../node_modules/rxjs/_esm5/LICENSE.txt | 202 + .../node_modules/rxjs/_esm5/README.md | 147 + .../node_modules/rxjs/_esm5/ajax/index.js | 4 + .../node_modules/rxjs/_esm5/ajax/index.js.map | 1 + .../node_modules/rxjs/_esm5/fetch/index.js | 3 + .../rxjs/_esm5/fetch/index.js.map | 1 + .../node_modules/rxjs/_esm5/index.js | 57 + .../node_modules/rxjs/_esm5/index.js.map | 1 + .../_esm5/internal-compatibility/index.js | 57 + .../_esm5/internal-compatibility/index.js.map | 1 + .../rxjs/_esm5/internal/AsyncSubject.js | 47 + .../rxjs/_esm5/internal/AsyncSubject.js.map | 1 + .../rxjs/_esm5/internal/BehaviorSubject.js | 43 + .../_esm5/internal/BehaviorSubject.js.map | 1 + .../rxjs/_esm5/internal/InnerSubscriber.js | 28 + .../_esm5/internal/InnerSubscriber.js.map | 1 + .../rxjs/_esm5/internal/Notification.js | 76 + .../rxjs/_esm5/internal/Notification.js.map | 1 + .../rxjs/_esm5/internal/Observable.js | 116 + .../rxjs/_esm5/internal/Observable.js.map | 1 + .../rxjs/_esm5/internal/Observer.js | 17 + .../rxjs/_esm5/internal/Observer.js.map | 1 + .../rxjs/_esm5/internal/Operator.js | 1 + .../rxjs/_esm5/internal/Operator.js.map | 1 + .../rxjs/_esm5/internal/OuterSubscriber.js | 21 + .../_esm5/internal/OuterSubscriber.js.map | 1 + .../rxjs/_esm5/internal/ReplaySubject.js | 117 + .../rxjs/_esm5/internal/ReplaySubject.js.map | 1 + .../node_modules/rxjs/_esm5/internal/Rx.js | 173 + .../rxjs/_esm5/internal/Rx.js.map | 1 + .../rxjs/_esm5/internal/Scheduler.js | 19 + .../rxjs/_esm5/internal/Scheduler.js.map | 1 + .../rxjs/_esm5/internal/Subject.js | 158 + .../rxjs/_esm5/internal/Subject.js.map | 1 + .../_esm5/internal/SubjectSubscription.js | 32 + .../_esm5/internal/SubjectSubscription.js.map | 1 + .../rxjs/_esm5/internal/Subscriber.js | 233 + .../rxjs/_esm5/internal/Subscriber.js.map | 1 + .../rxjs/_esm5/internal/Subscription.js | 136 + .../rxjs/_esm5/internal/Subscription.js.map | 1 + .../rxjs/_esm5/internal/config.js | 19 + .../rxjs/_esm5/internal/config.js.map | 1 + .../observable/ConnectableObservable.js | 142 + .../observable/ConnectableObservable.js.map | 1 + .../observable/SubscribeOnObservable.js | 51 + .../observable/SubscribeOnObservable.js.map | 1 + .../_esm5/internal/observable/bindCallback.js | 105 + .../internal/observable/bindCallback.js.map | 1 + .../internal/observable/bindNodeCallback.js | 113 + .../observable/bindNodeCallback.js.map | 1 + .../internal/observable/combineLatest.js | 101 + .../internal/observable/combineLatest.js.map | 1 + .../rxjs/_esm5/internal/observable/concat.js | 11 + .../_esm5/internal/observable/concat.js.map | 1 + .../rxjs/_esm5/internal/observable/defer.js | 19 + .../_esm5/internal/observable/defer.js.map | 1 + .../internal/observable/dom/AjaxObservable.js | 374 + .../observable/dom/AjaxObservable.js.map | 1 + .../observable/dom/WebSocketSubject.js | 217 + .../observable/dom/WebSocketSubject.js.map | 1 + .../_esm5/internal/observable/dom/ajax.js | 4 + .../_esm5/internal/observable/dom/ajax.js.map | 1 + .../_esm5/internal/observable/dom/fetch.js | 53 + .../internal/observable/dom/fetch.js.map | 1 + .../internal/observable/dom/webSocket.js | 6 + .../internal/observable/dom/webSocket.js.map | 1 + .../rxjs/_esm5/internal/observable/empty.js | 10 + .../_esm5/internal/observable/empty.js.map | 1 + .../_esm5/internal/observable/forkJoin.js | 69 + .../_esm5/internal/observable/forkJoin.js.map | 1 + .../rxjs/_esm5/internal/observable/from.js | 16 + .../_esm5/internal/observable/from.js.map | 1 + .../_esm5/internal/observable/fromArray.js | 13 + .../internal/observable/fromArray.js.map | 1 + .../_esm5/internal/observable/fromEvent.js | 63 + .../internal/observable/fromEvent.js.map | 1 + .../internal/observable/fromEventPattern.js | 32 + .../observable/fromEventPattern.js.map | 1 + .../_esm5/internal/observable/fromIterable.js | 16 + .../internal/observable/fromIterable.js.map | 1 + .../_esm5/internal/observable/fromPromise.js | 13 + .../internal/observable/fromPromise.js.map | 1 + .../_esm5/internal/observable/generate.js | 125 + .../_esm5/internal/observable/generate.js.map | 1 + .../rxjs/_esm5/internal/observable/iif.js | 13 + .../rxjs/_esm5/internal/observable/iif.js.map | 1 + .../_esm5/internal/observable/interval.js | 28 + .../_esm5/internal/observable/interval.js.map | 1 + .../rxjs/_esm5/internal/observable/merge.js | 28 + .../_esm5/internal/observable/merge.js.map | 1 + .../rxjs/_esm5/internal/observable/never.js | 8 + .../_esm5/internal/observable/never.js.map | 1 + .../rxjs/_esm5/internal/observable/of.js | 19 + .../rxjs/_esm5/internal/observable/of.js.map | 1 + .../internal/observable/onErrorResumeNext.js | 27 + .../observable/onErrorResumeNext.js.map | 1 + .../rxjs/_esm5/internal/observable/pairs.js | 39 + .../_esm5/internal/observable/pairs.js.map | 1 + .../_esm5/internal/observable/partition.js | 12 + .../internal/observable/partition.js.map | 1 + .../rxjs/_esm5/internal/observable/race.js | 78 + .../_esm5/internal/observable/race.js.map | 1 + .../rxjs/_esm5/internal/observable/range.js | 48 + .../_esm5/internal/observable/range.js.map | 1 + .../_esm5/internal/observable/throwError.js | 15 + .../internal/observable/throwError.js.map | 1 + .../rxjs/_esm5/internal/observable/timer.js | 41 + .../_esm5/internal/observable/timer.js.map | 1 + .../rxjs/_esm5/internal/observable/using.js | 33 + .../_esm5/internal/observable/using.js.map | 1 + .../rxjs/_esm5/internal/observable/zip.js | 218 + .../rxjs/_esm5/internal/observable/zip.js.map | 1 + .../rxjs/_esm5/internal/operators/audit.js | 69 + .../_esm5/internal/operators/audit.js.map | 1 + .../_esm5/internal/operators/auditTime.js | 11 + .../_esm5/internal/operators/auditTime.js.map | 1 + .../rxjs/_esm5/internal/operators/buffer.js | 37 + .../_esm5/internal/operators/buffer.js.map | 1 + .../_esm5/internal/operators/bufferCount.js | 90 + .../internal/operators/bufferCount.js.map | 1 + .../_esm5/internal/operators/bufferTime.js | 148 + .../internal/operators/bufferTime.js.map | 1 + .../_esm5/internal/operators/bufferToggle.js | 107 + .../internal/operators/bufferToggle.js.map | 1 + .../_esm5/internal/operators/bufferWhen.js | 82 + .../internal/operators/bufferWhen.js.map | 1 + .../_esm5/internal/operators/catchError.js | 51 + .../internal/operators/catchError.js.map | 1 + .../_esm5/internal/operators/combineAll.js | 6 + .../internal/operators/combineAll.js.map | 1 + .../_esm5/internal/operators/combineLatest.js | 20 + .../internal/operators/combineLatest.js.map | 1 + .../rxjs/_esm5/internal/operators/concat.js | 10 + .../_esm5/internal/operators/concat.js.map | 1 + .../_esm5/internal/operators/concatAll.js | 6 + .../_esm5/internal/operators/concatAll.js.map | 1 + .../_esm5/internal/operators/concatMap.js | 6 + .../_esm5/internal/operators/concatMap.js.map | 1 + .../_esm5/internal/operators/concatMapTo.js | 6 + .../internal/operators/concatMapTo.js.map | 1 + .../rxjs/_esm5/internal/operators/count.js | 54 + .../_esm5/internal/operators/count.js.map | 1 + .../rxjs/_esm5/internal/operators/debounce.js | 76 + .../_esm5/internal/operators/debounce.js.map | 1 + .../_esm5/internal/operators/debounceTime.js | 64 + .../internal/operators/debounceTime.js.map | 1 + .../internal/operators/defaultIfEmpty.js | 39 + .../internal/operators/defaultIfEmpty.js.map | 1 + .../rxjs/_esm5/internal/operators/delay.js | 93 + .../_esm5/internal/operators/delay.js.map | 1 + .../_esm5/internal/operators/delayWhen.js | 132 + .../_esm5/internal/operators/delayWhen.js.map | 1 + .../_esm5/internal/operators/dematerialize.js | 27 + .../internal/operators/dematerialize.js.map | 1 + .../rxjs/_esm5/internal/operators/distinct.js | 65 + .../_esm5/internal/operators/distinct.js.map | 1 + .../operators/distinctUntilChanged.js | 60 + .../operators/distinctUntilChanged.js.map | 1 + .../operators/distinctUntilKeyChanged.js | 6 + .../operators/distinctUntilKeyChanged.js.map | 1 + .../_esm5/internal/operators/elementAt.js | 18 + .../_esm5/internal/operators/elementAt.js.map | 1 + .../rxjs/_esm5/internal/operators/endWith.js | 11 + .../_esm5/internal/operators/endWith.js.map | 1 + .../rxjs/_esm5/internal/operators/every.js | 51 + .../_esm5/internal/operators/every.js.map | 1 + .../rxjs/_esm5/internal/operators/exhaust.js | 45 + .../_esm5/internal/operators/exhaust.js.map | 1 + .../_esm5/internal/operators/exhaustMap.js | 85 + .../internal/operators/exhaustMap.js.map | 1 + .../rxjs/_esm5/internal/operators/expand.js | 105 + .../_esm5/internal/operators/expand.js.map | 1 + .../rxjs/_esm5/internal/operators/filter.js | 43 + .../_esm5/internal/operators/filter.js.map | 1 + .../rxjs/_esm5/internal/operators/finalize.js | 26 + .../_esm5/internal/operators/finalize.js.map | 1 + .../rxjs/_esm5/internal/operators/find.js | 59 + .../rxjs/_esm5/internal/operators/find.js.map | 1 + .../_esm5/internal/operators/findIndex.js | 6 + .../_esm5/internal/operators/findIndex.js.map | 1 + .../rxjs/_esm5/internal/operators/first.js | 12 + .../_esm5/internal/operators/first.js.map | 1 + .../rxjs/_esm5/internal/operators/groupBy.js | 182 + .../_esm5/internal/operators/groupBy.js.map | 1 + .../internal/operators/ignoreElements.js | 26 + .../internal/operators/ignoreElements.js.map | 1 + .../rxjs/_esm5/internal/operators/index.js | 104 + .../_esm5/internal/operators/index.js.map | 1 + .../rxjs/_esm5/internal/operators/isEmpty.js | 33 + .../_esm5/internal/operators/isEmpty.js.map | 1 + .../rxjs/_esm5/internal/operators/last.js | 12 + .../rxjs/_esm5/internal/operators/last.js.map | 1 + .../rxjs/_esm5/internal/operators/map.js | 45 + .../rxjs/_esm5/internal/operators/map.js.map | 1 + .../rxjs/_esm5/internal/operators/mapTo.js | 28 + .../_esm5/internal/operators/mapTo.js.map | 1 + .../_esm5/internal/operators/materialize.js | 38 + .../internal/operators/materialize.js.map | 1 + .../rxjs/_esm5/internal/operators/max.js | 9 + .../rxjs/_esm5/internal/operators/max.js.map | 1 + .../rxjs/_esm5/internal/operators/merge.js | 10 + .../_esm5/internal/operators/merge.js.map | 1 + .../rxjs/_esm5/internal/operators/mergeAll.js | 10 + .../_esm5/internal/operators/mergeAll.js.map | 1 + .../rxjs/_esm5/internal/operators/mergeMap.js | 103 + .../_esm5/internal/operators/mergeMap.js.map | 1 + .../_esm5/internal/operators/mergeMapTo.js | 15 + .../internal/operators/mergeMapTo.js.map | 1 + .../_esm5/internal/operators/mergeScan.js | 100 + .../_esm5/internal/operators/mergeScan.js.map | 1 + .../rxjs/_esm5/internal/operators/min.js | 9 + .../rxjs/_esm5/internal/operators/min.js.map | 1 + .../_esm5/internal/operators/multicast.js | 38 + .../_esm5/internal/operators/multicast.js.map | 1 + .../_esm5/internal/operators/observeOn.js | 69 + .../_esm5/internal/operators/observeOn.js.map | 1 + .../internal/operators/onErrorResumeNext.js | 78 + .../operators/onErrorResumeNext.js.map | 1 + .../rxjs/_esm5/internal/operators/pairwise.js | 37 + .../_esm5/internal/operators/pairwise.js.map | 1 + .../_esm5/internal/operators/partition.js | 12 + .../_esm5/internal/operators/partition.js.map | 1 + .../rxjs/_esm5/internal/operators/pluck.js | 30 + .../_esm5/internal/operators/pluck.js.map | 1 + .../rxjs/_esm5/internal/operators/publish.js | 9 + .../_esm5/internal/operators/publish.js.map | 1 + .../internal/operators/publishBehavior.js | 7 + .../internal/operators/publishBehavior.js.map | 1 + .../_esm5/internal/operators/publishLast.js | 7 + .../internal/operators/publishLast.js.map | 1 + .../_esm5/internal/operators/publishReplay.js | 12 + .../internal/operators/publishReplay.js.map | 1 + .../rxjs/_esm5/internal/operators/race.js | 16 + .../rxjs/_esm5/internal/operators/race.js.map | 1 + .../rxjs/_esm5/internal/operators/reduce.js | 16 + .../_esm5/internal/operators/reduce.js.map | 1 + .../rxjs/_esm5/internal/operators/refCount.js | 58 + .../_esm5/internal/operators/refCount.js.map | 1 + .../rxjs/_esm5/internal/operators/repeat.js | 53 + .../_esm5/internal/operators/repeat.js.map | 1 + .../_esm5/internal/operators/repeatWhen.js | 83 + .../internal/operators/repeatWhen.js.map | 1 + .../rxjs/_esm5/internal/operators/retry.js | 42 + .../_esm5/internal/operators/retry.js.map | 1 + .../_esm5/internal/operators/retryWhen.js | 75 + .../_esm5/internal/operators/retryWhen.js.map | 1 + .../rxjs/_esm5/internal/operators/sample.js | 45 + .../_esm5/internal/operators/sample.js.map | 1 + .../_esm5/internal/operators/sampleTime.js | 48 + .../internal/operators/sampleTime.js.map | 1 + .../rxjs/_esm5/internal/operators/scan.js | 71 + .../rxjs/_esm5/internal/operators/scan.js.map | 1 + .../_esm5/internal/operators/sequenceEqual.js | 110 + .../internal/operators/sequenceEqual.js.map | 1 + .../rxjs/_esm5/internal/operators/share.js | 11 + .../_esm5/internal/operators/share.js.map | 1 + .../_esm5/internal/operators/shareReplay.js | 55 + .../internal/operators/shareReplay.js.map | 1 + .../rxjs/_esm5/internal/operators/single.js | 68 + .../_esm5/internal/operators/single.js.map | 1 + .../rxjs/_esm5/internal/operators/skip.js | 31 + .../rxjs/_esm5/internal/operators/skip.js.map | 1 + .../rxjs/_esm5/internal/operators/skipLast.js | 50 + .../_esm5/internal/operators/skipLast.js.map | 1 + .../_esm5/internal/operators/skipUntil.js | 48 + .../_esm5/internal/operators/skipUntil.js.map | 1 + .../_esm5/internal/operators/skipWhile.js | 45 + .../_esm5/internal/operators/skipWhile.js.map | 1 + .../_esm5/internal/operators/startWith.js | 18 + .../_esm5/internal/operators/startWith.js.map | 1 + .../_esm5/internal/operators/subscribeOn.js | 21 + .../internal/operators/subscribeOn.js.map | 1 + .../_esm5/internal/operators/switchAll.js | 7 + .../_esm5/internal/operators/switchAll.js.map | 1 + .../_esm5/internal/operators/switchMap.js | 79 + .../_esm5/internal/operators/switchMap.js.map | 1 + .../_esm5/internal/operators/switchMapTo.js | 6 + .../internal/operators/switchMapTo.js.map | 1 + .../rxjs/_esm5/internal/operators/take.js | 49 + .../rxjs/_esm5/internal/operators/take.js.map | 1 + .../rxjs/_esm5/internal/operators/takeLast.js | 64 + .../_esm5/internal/operators/takeLast.js.map | 1 + .../_esm5/internal/operators/takeUntil.js | 38 + .../_esm5/internal/operators/takeUntil.js.map | 1 + .../_esm5/internal/operators/takeWhile.js | 57 + .../_esm5/internal/operators/takeWhile.js.map | 1 + .../rxjs/_esm5/internal/operators/tap.js | 75 + .../rxjs/_esm5/internal/operators/tap.js.map | 1 + .../rxjs/_esm5/internal/operators/throttle.js | 91 + .../_esm5/internal/operators/throttle.js.map | 1 + .../_esm5/internal/operators/throttleTime.js | 85 + .../internal/operators/throttleTime.js.map | 1 + .../_esm5/internal/operators/throwIfEmpty.js | 54 + .../internal/operators/throwIfEmpty.js.map | 1 + .../_esm5/internal/operators/timeInterval.js | 30 + .../internal/operators/timeInterval.js.map | 1 + .../rxjs/_esm5/internal/operators/timeout.js | 12 + .../_esm5/internal/operators/timeout.js.map | 1 + .../_esm5/internal/operators/timeoutWith.js | 68 + .../internal/operators/timeoutWith.js.map | 1 + .../_esm5/internal/operators/timestamp.js | 18 + .../_esm5/internal/operators/timestamp.js.map | 1 + .../rxjs/_esm5/internal/operators/toArray.js | 13 + .../_esm5/internal/operators/toArray.js.map | 1 + .../rxjs/_esm5/internal/operators/window.js | 67 + .../_esm5/internal/operators/window.js.map | 1 + .../_esm5/internal/operators/windowCount.js | 78 + .../internal/operators/windowCount.js.map | 1 + .../_esm5/internal/operators/windowTime.js | 155 + .../internal/operators/windowTime.js.map | 1 + .../_esm5/internal/operators/windowToggle.js | 129 + .../internal/operators/windowToggle.js.map | 1 + .../_esm5/internal/operators/windowWhen.js | 84 + .../internal/operators/windowWhen.js.map | 1 + .../internal/operators/withLatestFrom.js | 83 + .../internal/operators/withLatestFrom.js.map | 1 + .../rxjs/_esm5/internal/operators/zip.js | 12 + .../rxjs/_esm5/internal/operators/zip.js.map | 1 + .../rxjs/_esm5/internal/operators/zipAll.js | 6 + .../_esm5/internal/operators/zipAll.js.map | 1 + .../_esm5/internal/scheduled/scheduleArray.js | 21 + .../internal/scheduled/scheduleArray.js.map | 1 + .../internal/scheduled/scheduleIterable.js | 46 + .../scheduled/scheduleIterable.js.map | 1 + .../internal/scheduled/scheduleObservable.js | 19 + .../scheduled/scheduleObservable.js.map | 1 + .../internal/scheduled/schedulePromise.js | 20 + .../internal/scheduled/schedulePromise.js.map | 1 + .../_esm5/internal/scheduled/scheduled.js | 27 + .../_esm5/internal/scheduled/scheduled.js.map | 1 + .../rxjs/_esm5/internal/scheduler/Action.js | 18 + .../_esm5/internal/scheduler/Action.js.map | 1 + .../scheduler/AnimationFrameAction.js | 38 + .../scheduler/AnimationFrameAction.js.map | 1 + .../scheduler/AnimationFrameScheduler.js | 33 + .../scheduler/AnimationFrameScheduler.js.map | 1 + .../_esm5/internal/scheduler/AsapAction.js | 39 + .../internal/scheduler/AsapAction.js.map | 1 + .../_esm5/internal/scheduler/AsapScheduler.js | 33 + .../internal/scheduler/AsapScheduler.js.map | 1 + .../_esm5/internal/scheduler/AsyncAction.js | 95 + .../internal/scheduler/AsyncAction.js.map | 1 + .../internal/scheduler/AsyncScheduler.js | 58 + .../internal/scheduler/AsyncScheduler.js.map | 1 + .../_esm5/internal/scheduler/QueueAction.js | 41 + .../internal/scheduler/QueueAction.js.map | 1 + .../internal/scheduler/QueueScheduler.js | 12 + .../internal/scheduler/QueueScheduler.js.map | 1 + .../scheduler/VirtualTimeScheduler.js | 110 + .../scheduler/VirtualTimeScheduler.js.map | 1 + .../internal/scheduler/animationFrame.js | 5 + .../internal/scheduler/animationFrame.js.map | 1 + .../rxjs/_esm5/internal/scheduler/asap.js | 5 + .../rxjs/_esm5/internal/scheduler/asap.js.map | 1 + .../rxjs/_esm5/internal/scheduler/async.js | 5 + .../_esm5/internal/scheduler/async.js.map | 1 + .../rxjs/_esm5/internal/scheduler/queue.js | 5 + .../_esm5/internal/scheduler/queue.js.map | 1 + .../rxjs/_esm5/internal/symbol/iterator.js | 10 + .../_esm5/internal/symbol/iterator.js.map | 1 + .../rxjs/_esm5/internal/symbol/observable.js | 3 + .../_esm5/internal/symbol/observable.js.map | 1 + .../_esm5/internal/symbol/rxSubscriber.js | 8 + .../_esm5/internal/symbol/rxSubscriber.js.map | 1 + .../_esm5/internal/testing/ColdObservable.js | 39 + .../internal/testing/ColdObservable.js.map | 1 + .../_esm5/internal/testing/HotObservable.js | 40 + .../internal/testing/HotObservable.js.map | 1 + .../_esm5/internal/testing/SubscriptionLog.js | 12 + .../internal/testing/SubscriptionLog.js.map | 1 + .../internal/testing/SubscriptionLoggable.js | 19 + .../testing/SubscriptionLoggable.js.map | 1 + .../_esm5/internal/testing/TestMessage.js | 1 + .../_esm5/internal/testing/TestMessage.js.map | 1 + .../_esm5/internal/testing/TestScheduler.js | 359 + .../internal/testing/TestScheduler.js.map | 1 + .../node_modules/rxjs/_esm5/internal/types.js | 1 + .../rxjs/_esm5/internal/types.js.map | 1 + .../internal/util/ArgumentOutOfRangeError.js | 13 + .../util/ArgumentOutOfRangeError.js.map | 1 + .../rxjs/_esm5/internal/util/EmptyError.js | 13 + .../_esm5/internal/util/EmptyError.js.map | 1 + .../rxjs/_esm5/internal/util/Immediate.js | 28 + .../rxjs/_esm5/internal/util/Immediate.js.map | 1 + .../internal/util/ObjectUnsubscribedError.js | 13 + .../util/ObjectUnsubscribedError.js.map | 1 + .../rxjs/_esm5/internal/util/TimeoutError.js | 13 + .../_esm5/internal/util/TimeoutError.js.map | 1 + .../internal/util/UnsubscriptionError.js | 15 + .../internal/util/UnsubscriptionError.js.map | 1 + .../rxjs/_esm5/internal/util/applyMixins.js | 12 + .../_esm5/internal/util/applyMixins.js.map | 1 + .../_esm5/internal/util/canReportError.js | 18 + .../_esm5/internal/util/canReportError.js.map | 1 + .../rxjs/_esm5/internal/util/errorObject.js | 3 + .../_esm5/internal/util/errorObject.js.map | 1 + .../_esm5/internal/util/hostReportError.js | 5 + .../internal/util/hostReportError.js.map | 1 + .../rxjs/_esm5/internal/util/identity.js | 5 + .../rxjs/_esm5/internal/util/identity.js.map | 1 + .../rxjs/_esm5/internal/util/isArray.js | 3 + .../rxjs/_esm5/internal/util/isArray.js.map | 1 + .../rxjs/_esm5/internal/util/isArrayLike.js | 3 + .../_esm5/internal/util/isArrayLike.js.map | 1 + .../rxjs/_esm5/internal/util/isDate.js | 5 + .../rxjs/_esm5/internal/util/isDate.js.map | 1 + .../rxjs/_esm5/internal/util/isFunction.js | 5 + .../_esm5/internal/util/isFunction.js.map | 1 + .../internal/util/isInteropObservable.js | 6 + .../internal/util/isInteropObservable.js.map | 1 + .../rxjs/_esm5/internal/util/isIterable.js | 6 + .../_esm5/internal/util/isIterable.js.map | 1 + .../rxjs/_esm5/internal/util/isNumeric.js | 6 + .../rxjs/_esm5/internal/util/isNumeric.js.map | 1 + .../rxjs/_esm5/internal/util/isObject.js | 5 + .../rxjs/_esm5/internal/util/isObject.js.map | 1 + .../rxjs/_esm5/internal/util/isObservable.js | 6 + .../_esm5/internal/util/isObservable.js.map | 1 + .../rxjs/_esm5/internal/util/isPromise.js | 5 + .../rxjs/_esm5/internal/util/isPromise.js.map | 1 + .../rxjs/_esm5/internal/util/isScheduler.js | 5 + .../_esm5/internal/util/isScheduler.js.map | 1 + .../rxjs/_esm5/internal/util/noop.js | 3 + .../rxjs/_esm5/internal/util/noop.js.map | 1 + .../rxjs/_esm5/internal/util/not.js | 10 + .../rxjs/_esm5/internal/util/not.js.map | 1 + .../rxjs/_esm5/internal/util/pipe.js | 21 + .../rxjs/_esm5/internal/util/pipe.js.map | 1 + .../rxjs/_esm5/internal/util/root.js | 13 + .../rxjs/_esm5/internal/util/root.js.map | 1 + .../rxjs/_esm5/internal/util/subscribeTo.js | 31 + .../_esm5/internal/util/subscribeTo.js.map | 1 + .../_esm5/internal/util/subscribeToArray.js | 10 + .../internal/util/subscribeToArray.js.map | 1 + .../internal/util/subscribeToIterable.js | 27 + .../internal/util/subscribeToIterable.js.map | 1 + .../internal/util/subscribeToObservable.js | 14 + .../util/subscribeToObservable.js.map | 1 + .../_esm5/internal/util/subscribeToPromise.js | 15 + .../internal/util/subscribeToPromise.js.map | 1 + .../_esm5/internal/util/subscribeToResult.js | 17 + .../internal/util/subscribeToResult.js.map | 1 + .../rxjs/_esm5/internal/util/toSubscriber.js | 19 + .../_esm5/internal/util/toSubscriber.js.map | 1 + .../rxjs/_esm5/internal/util/tryCatch.js | 21 + .../rxjs/_esm5/internal/util/tryCatch.js.map | 1 + .../rxjs/_esm5/operators/index.js | 106 + .../rxjs/_esm5/operators/index.js.map | 1 + .../node_modules/rxjs/_esm5/path-mapping.js | 453 + .../node_modules/rxjs/_esm5/testing/index.js | 3 + .../rxjs/_esm5/testing/index.js.map | 1 + .../rxjs/_esm5/webSocket/index.js | 4 + .../rxjs/_esm5/webSocket/index.js.map | 1 + .../rxjs/add/observable/bindCallback.d.ts | 1 + .../rxjs/add/observable/bindCallback.js | 4 + .../rxjs/add/observable/bindCallback.js.map | 1 + .../rxjs/add/observable/bindNodeCallback.d.ts | 1 + .../rxjs/add/observable/bindNodeCallback.js | 4 + .../add/observable/bindNodeCallback.js.map | 1 + .../rxjs/add/observable/combineLatest.d.ts | 1 + .../rxjs/add/observable/combineLatest.js | 4 + .../rxjs/add/observable/combineLatest.js.map | 1 + .../rxjs/add/observable/concat.d.ts | 1 + .../rxjs/add/observable/concat.js | 4 + .../rxjs/add/observable/concat.js.map | 1 + .../rxjs/add/observable/defer.d.ts | 1 + .../node_modules/rxjs/add/observable/defer.js | 4 + .../rxjs/add/observable/defer.js.map | 1 + .../rxjs/add/observable/dom/ajax.d.ts | 1 + .../rxjs/add/observable/dom/ajax.js | 4 + .../rxjs/add/observable/dom/ajax.js.map | 1 + .../rxjs/add/observable/dom/webSocket.d.ts | 1 + .../rxjs/add/observable/dom/webSocket.js | 4 + .../rxjs/add/observable/dom/webSocket.js.map | 1 + .../rxjs/add/observable/empty.d.ts | 1 + .../node_modules/rxjs/add/observable/empty.js | 4 + .../rxjs/add/observable/empty.js.map | 1 + .../rxjs/add/observable/forkJoin.d.ts | 1 + .../rxjs/add/observable/forkJoin.js | 4 + .../rxjs/add/observable/forkJoin.js.map | 1 + .../rxjs/add/observable/from.d.ts | 1 + .../node_modules/rxjs/add/observable/from.js | 4 + .../rxjs/add/observable/from.js.map | 1 + .../rxjs/add/observable/fromEvent.d.ts | 1 + .../rxjs/add/observable/fromEvent.js | 4 + .../rxjs/add/observable/fromEvent.js.map | 1 + .../rxjs/add/observable/fromEventPattern.d.ts | 1 + .../rxjs/add/observable/fromEventPattern.js | 4 + .../add/observable/fromEventPattern.js.map | 1 + .../rxjs/add/observable/fromPromise.d.ts | 1 + .../rxjs/add/observable/fromPromise.js | 4 + .../rxjs/add/observable/fromPromise.js.map | 1 + .../rxjs/add/observable/generate.d.ts | 1 + .../rxjs/add/observable/generate.js | 4 + .../rxjs/add/observable/generate.js.map | 1 + .../node_modules/rxjs/add/observable/if.d.ts | 1 + .../node_modules/rxjs/add/observable/if.js | 4 + .../rxjs/add/observable/if.js.map | 1 + .../rxjs/add/observable/interval.d.ts | 1 + .../rxjs/add/observable/interval.js | 4 + .../rxjs/add/observable/interval.js.map | 1 + .../rxjs/add/observable/merge.d.ts | 1 + .../node_modules/rxjs/add/observable/merge.js | 4 + .../rxjs/add/observable/merge.js.map | 1 + .../rxjs/add/observable/never.d.ts | 1 + .../node_modules/rxjs/add/observable/never.js | 4 + .../rxjs/add/observable/never.js.map | 1 + .../node_modules/rxjs/add/observable/of.d.ts | 1 + .../node_modules/rxjs/add/observable/of.js | 4 + .../rxjs/add/observable/of.js.map | 1 + .../add/observable/onErrorResumeNext.d.ts | 1 + .../rxjs/add/observable/onErrorResumeNext.js | 4 + .../add/observable/onErrorResumeNext.js.map | 1 + .../rxjs/add/observable/pairs.d.ts | 1 + .../node_modules/rxjs/add/observable/pairs.js | 4 + .../rxjs/add/observable/pairs.js.map | 1 + .../rxjs/add/observable/race.d.ts | 1 + .../node_modules/rxjs/add/observable/race.js | 4 + .../rxjs/add/observable/race.js.map | 1 + .../rxjs/add/observable/range.d.ts | 1 + .../node_modules/rxjs/add/observable/range.js | 4 + .../rxjs/add/observable/range.js.map | 1 + .../rxjs/add/observable/throw.d.ts | 1 + .../node_modules/rxjs/add/observable/throw.js | 4 + .../rxjs/add/observable/throw.js.map | 1 + .../rxjs/add/observable/timer.d.ts | 1 + .../node_modules/rxjs/add/observable/timer.js | 4 + .../rxjs/add/observable/timer.js.map | 1 + .../rxjs/add/observable/using.d.ts | 1 + .../node_modules/rxjs/add/observable/using.js | 4 + .../rxjs/add/observable/using.js.map | 1 + .../node_modules/rxjs/add/observable/zip.d.ts | 1 + .../node_modules/rxjs/add/observable/zip.js | 4 + .../rxjs/add/observable/zip.js.map | 1 + .../node_modules/rxjs/add/operator/audit.d.ts | 1 + .../node_modules/rxjs/add/operator/audit.js | 4 + .../rxjs/add/operator/audit.js.map | 1 + .../rxjs/add/operator/auditTime.d.ts | 1 + .../rxjs/add/operator/auditTime.js | 4 + .../rxjs/add/operator/auditTime.js.map | 1 + .../rxjs/add/operator/buffer.d.ts | 1 + .../node_modules/rxjs/add/operator/buffer.js | 4 + .../rxjs/add/operator/buffer.js.map | 1 + .../rxjs/add/operator/bufferCount.d.ts | 1 + .../rxjs/add/operator/bufferCount.js | 4 + .../rxjs/add/operator/bufferCount.js.map | 1 + .../rxjs/add/operator/bufferTime.d.ts | 1 + .../rxjs/add/operator/bufferTime.js | 4 + .../rxjs/add/operator/bufferTime.js.map | 1 + .../rxjs/add/operator/bufferToggle.d.ts | 1 + .../rxjs/add/operator/bufferToggle.js | 4 + .../rxjs/add/operator/bufferToggle.js.map | 1 + .../rxjs/add/operator/bufferWhen.d.ts | 1 + .../rxjs/add/operator/bufferWhen.js | 4 + .../rxjs/add/operator/bufferWhen.js.map | 1 + .../node_modules/rxjs/add/operator/catch.d.ts | 1 + .../node_modules/rxjs/add/operator/catch.js | 4 + .../rxjs/add/operator/catch.js.map | 1 + .../rxjs/add/operator/combineAll.d.ts | 1 + .../rxjs/add/operator/combineAll.js | 4 + .../rxjs/add/operator/combineAll.js.map | 1 + .../rxjs/add/operator/combineLatest.d.ts | 1 + .../rxjs/add/operator/combineLatest.js | 4 + .../rxjs/add/operator/combineLatest.js.map | 1 + .../rxjs/add/operator/concat.d.ts | 1 + .../node_modules/rxjs/add/operator/concat.js | 4 + .../rxjs/add/operator/concat.js.map | 1 + .../rxjs/add/operator/concatAll.d.ts | 1 + .../rxjs/add/operator/concatAll.js | 4 + .../rxjs/add/operator/concatAll.js.map | 1 + .../rxjs/add/operator/concatMap.d.ts | 1 + .../rxjs/add/operator/concatMap.js | 4 + .../rxjs/add/operator/concatMap.js.map | 1 + .../rxjs/add/operator/concatMapTo.d.ts | 1 + .../rxjs/add/operator/concatMapTo.js | 4 + .../rxjs/add/operator/concatMapTo.js.map | 1 + .../node_modules/rxjs/add/operator/count.d.ts | 1 + .../node_modules/rxjs/add/operator/count.js | 4 + .../rxjs/add/operator/count.js.map | 1 + .../rxjs/add/operator/debounce.d.ts | 1 + .../rxjs/add/operator/debounce.js | 4 + .../rxjs/add/operator/debounce.js.map | 1 + .../rxjs/add/operator/debounceTime.d.ts | 1 + .../rxjs/add/operator/debounceTime.js | 4 + .../rxjs/add/operator/debounceTime.js.map | 1 + .../rxjs/add/operator/defaultIfEmpty.d.ts | 1 + .../rxjs/add/operator/defaultIfEmpty.js | 4 + .../rxjs/add/operator/defaultIfEmpty.js.map | 1 + .../node_modules/rxjs/add/operator/delay.d.ts | 1 + .../node_modules/rxjs/add/operator/delay.js | 4 + .../rxjs/add/operator/delay.js.map | 1 + .../rxjs/add/operator/delayWhen.d.ts | 1 + .../rxjs/add/operator/delayWhen.js | 4 + .../rxjs/add/operator/delayWhen.js.map | 1 + .../rxjs/add/operator/dematerialize.d.ts | 1 + .../rxjs/add/operator/dematerialize.js | 4 + .../rxjs/add/operator/dematerialize.js.map | 1 + .../rxjs/add/operator/distinct.d.ts | 1 + .../rxjs/add/operator/distinct.js | 4 + .../rxjs/add/operator/distinct.js.map | 1 + .../add/operator/distinctUntilChanged.d.ts | 1 + .../rxjs/add/operator/distinctUntilChanged.js | 4 + .../add/operator/distinctUntilChanged.js.map | 1 + .../add/operator/distinctUntilKeyChanged.d.ts | 1 + .../add/operator/distinctUntilKeyChanged.js | 4 + .../operator/distinctUntilKeyChanged.js.map | 1 + .../node_modules/rxjs/add/operator/do.d.ts | 1 + .../node_modules/rxjs/add/operator/do.js | 4 + .../node_modules/rxjs/add/operator/do.js.map | 1 + .../rxjs/add/operator/elementAt.d.ts | 1 + .../rxjs/add/operator/elementAt.js | 4 + .../rxjs/add/operator/elementAt.js.map | 1 + .../node_modules/rxjs/add/operator/every.d.ts | 1 + .../node_modules/rxjs/add/operator/every.js | 4 + .../rxjs/add/operator/every.js.map | 1 + .../rxjs/add/operator/exhaust.d.ts | 1 + .../node_modules/rxjs/add/operator/exhaust.js | 4 + .../rxjs/add/operator/exhaust.js.map | 1 + .../rxjs/add/operator/exhaustMap.d.ts | 1 + .../rxjs/add/operator/exhaustMap.js | 4 + .../rxjs/add/operator/exhaustMap.js.map | 1 + .../rxjs/add/operator/expand.d.ts | 1 + .../node_modules/rxjs/add/operator/expand.js | 4 + .../rxjs/add/operator/expand.js.map | 1 + .../rxjs/add/operator/filter.d.ts | 1 + .../node_modules/rxjs/add/operator/filter.js | 4 + .../rxjs/add/operator/filter.js.map | 1 + .../rxjs/add/operator/finally.d.ts | 1 + .../node_modules/rxjs/add/operator/finally.js | 4 + .../rxjs/add/operator/finally.js.map | 1 + .../node_modules/rxjs/add/operator/find.d.ts | 1 + .../node_modules/rxjs/add/operator/find.js | 4 + .../rxjs/add/operator/find.js.map | 1 + .../rxjs/add/operator/findIndex.d.ts | 1 + .../rxjs/add/operator/findIndex.js | 4 + .../rxjs/add/operator/findIndex.js.map | 1 + .../node_modules/rxjs/add/operator/first.d.ts | 1 + .../node_modules/rxjs/add/operator/first.js | 4 + .../rxjs/add/operator/first.js.map | 1 + .../rxjs/add/operator/groupBy.d.ts | 1 + .../node_modules/rxjs/add/operator/groupBy.js | 4 + .../rxjs/add/operator/groupBy.js.map | 1 + .../rxjs/add/operator/ignoreElements.d.ts | 1 + .../rxjs/add/operator/ignoreElements.js | 4 + .../rxjs/add/operator/ignoreElements.js.map | 1 + .../rxjs/add/operator/isEmpty.d.ts | 1 + .../node_modules/rxjs/add/operator/isEmpty.js | 4 + .../rxjs/add/operator/isEmpty.js.map | 1 + .../node_modules/rxjs/add/operator/last.d.ts | 1 + .../node_modules/rxjs/add/operator/last.js | 4 + .../rxjs/add/operator/last.js.map | 1 + .../node_modules/rxjs/add/operator/let.d.ts | 1 + .../node_modules/rxjs/add/operator/let.js | 4 + .../node_modules/rxjs/add/operator/let.js.map | 1 + .../node_modules/rxjs/add/operator/map.d.ts | 1 + .../node_modules/rxjs/add/operator/map.js | 4 + .../node_modules/rxjs/add/operator/map.js.map | 1 + .../node_modules/rxjs/add/operator/mapTo.d.ts | 1 + .../node_modules/rxjs/add/operator/mapTo.js | 4 + .../rxjs/add/operator/mapTo.js.map | 1 + .../rxjs/add/operator/materialize.d.ts | 1 + .../rxjs/add/operator/materialize.js | 4 + .../rxjs/add/operator/materialize.js.map | 1 + .../node_modules/rxjs/add/operator/max.d.ts | 1 + .../node_modules/rxjs/add/operator/max.js | 4 + .../node_modules/rxjs/add/operator/max.js.map | 1 + .../node_modules/rxjs/add/operator/merge.d.ts | 1 + .../node_modules/rxjs/add/operator/merge.js | 4 + .../rxjs/add/operator/merge.js.map | 1 + .../rxjs/add/operator/mergeAll.d.ts | 1 + .../rxjs/add/operator/mergeAll.js | 4 + .../rxjs/add/operator/mergeAll.js.map | 1 + .../rxjs/add/operator/mergeMap.d.ts | 1 + .../rxjs/add/operator/mergeMap.js | 4 + .../rxjs/add/operator/mergeMap.js.map | 1 + .../rxjs/add/operator/mergeMapTo.d.ts | 1 + .../rxjs/add/operator/mergeMapTo.js | 4 + .../rxjs/add/operator/mergeMapTo.js.map | 1 + .../rxjs/add/operator/mergeScan.d.ts | 1 + .../rxjs/add/operator/mergeScan.js | 4 + .../rxjs/add/operator/mergeScan.js.map | 1 + .../node_modules/rxjs/add/operator/min.d.ts | 1 + .../node_modules/rxjs/add/operator/min.js | 4 + .../node_modules/rxjs/add/operator/min.js.map | 1 + .../rxjs/add/operator/multicast.d.ts | 1 + .../rxjs/add/operator/multicast.js | 4 + .../rxjs/add/operator/multicast.js.map | 1 + .../rxjs/add/operator/observeOn.d.ts | 1 + .../rxjs/add/operator/observeOn.js | 4 + .../rxjs/add/operator/observeOn.js.map | 1 + .../rxjs/add/operator/onErrorResumeNext.d.ts | 1 + .../rxjs/add/operator/onErrorResumeNext.js | 4 + .../add/operator/onErrorResumeNext.js.map | 1 + .../rxjs/add/operator/pairwise.d.ts | 1 + .../rxjs/add/operator/pairwise.js | 4 + .../rxjs/add/operator/pairwise.js.map | 1 + .../rxjs/add/operator/partition.d.ts | 1 + .../rxjs/add/operator/partition.js | 4 + .../rxjs/add/operator/partition.js.map | 1 + .../node_modules/rxjs/add/operator/pluck.d.ts | 1 + .../node_modules/rxjs/add/operator/pluck.js | 4 + .../rxjs/add/operator/pluck.js.map | 1 + .../rxjs/add/operator/publish.d.ts | 1 + .../node_modules/rxjs/add/operator/publish.js | 4 + .../rxjs/add/operator/publish.js.map | 1 + .../rxjs/add/operator/publishBehavior.d.ts | 1 + .../rxjs/add/operator/publishBehavior.js | 4 + .../rxjs/add/operator/publishBehavior.js.map | 1 + .../rxjs/add/operator/publishLast.d.ts | 1 + .../rxjs/add/operator/publishLast.js | 4 + .../rxjs/add/operator/publishLast.js.map | 1 + .../rxjs/add/operator/publishReplay.d.ts | 1 + .../rxjs/add/operator/publishReplay.js | 4 + .../rxjs/add/operator/publishReplay.js.map | 1 + .../node_modules/rxjs/add/operator/race.d.ts | 1 + .../node_modules/rxjs/add/operator/race.js | 4 + .../rxjs/add/operator/race.js.map | 1 + .../rxjs/add/operator/reduce.d.ts | 1 + .../node_modules/rxjs/add/operator/reduce.js | 4 + .../rxjs/add/operator/reduce.js.map | 1 + .../rxjs/add/operator/repeat.d.ts | 1 + .../node_modules/rxjs/add/operator/repeat.js | 4 + .../rxjs/add/operator/repeat.js.map | 1 + .../rxjs/add/operator/repeatWhen.d.ts | 1 + .../rxjs/add/operator/repeatWhen.js | 4 + .../rxjs/add/operator/repeatWhen.js.map | 1 + .../node_modules/rxjs/add/operator/retry.d.ts | 1 + .../node_modules/rxjs/add/operator/retry.js | 4 + .../rxjs/add/operator/retry.js.map | 1 + .../rxjs/add/operator/retryWhen.d.ts | 1 + .../rxjs/add/operator/retryWhen.js | 4 + .../rxjs/add/operator/retryWhen.js.map | 1 + .../rxjs/add/operator/sample.d.ts | 1 + .../node_modules/rxjs/add/operator/sample.js | 4 + .../rxjs/add/operator/sample.js.map | 1 + .../rxjs/add/operator/sampleTime.d.ts | 1 + .../rxjs/add/operator/sampleTime.js | 4 + .../rxjs/add/operator/sampleTime.js.map | 1 + .../node_modules/rxjs/add/operator/scan.d.ts | 1 + .../node_modules/rxjs/add/operator/scan.js | 4 + .../rxjs/add/operator/scan.js.map | 1 + .../rxjs/add/operator/sequenceEqual.d.ts | 1 + .../rxjs/add/operator/sequenceEqual.js | 4 + .../rxjs/add/operator/sequenceEqual.js.map | 1 + .../node_modules/rxjs/add/operator/share.d.ts | 1 + .../node_modules/rxjs/add/operator/share.js | 4 + .../rxjs/add/operator/share.js.map | 1 + .../rxjs/add/operator/shareReplay.d.ts | 1 + .../rxjs/add/operator/shareReplay.js | 4 + .../rxjs/add/operator/shareReplay.js.map | 1 + .../rxjs/add/operator/single.d.ts | 1 + .../node_modules/rxjs/add/operator/single.js | 4 + .../rxjs/add/operator/single.js.map | 1 + .../node_modules/rxjs/add/operator/skip.d.ts | 1 + .../node_modules/rxjs/add/operator/skip.js | 4 + .../rxjs/add/operator/skip.js.map | 1 + .../rxjs/add/operator/skipLast.d.ts | 1 + .../rxjs/add/operator/skipLast.js | 4 + .../rxjs/add/operator/skipLast.js.map | 1 + .../rxjs/add/operator/skipUntil.d.ts | 1 + .../rxjs/add/operator/skipUntil.js | 4 + .../rxjs/add/operator/skipUntil.js.map | 1 + .../rxjs/add/operator/skipWhile.d.ts | 1 + .../rxjs/add/operator/skipWhile.js | 4 + .../rxjs/add/operator/skipWhile.js.map | 1 + .../rxjs/add/operator/startWith.d.ts | 1 + .../rxjs/add/operator/startWith.js | 4 + .../rxjs/add/operator/startWith.js.map | 1 + .../rxjs/add/operator/subscribeOn.d.ts | 1 + .../rxjs/add/operator/subscribeOn.js | 4 + .../rxjs/add/operator/subscribeOn.js.map | 1 + .../rxjs/add/operator/switch.d.ts | 1 + .../node_modules/rxjs/add/operator/switch.js | 4 + .../rxjs/add/operator/switch.js.map | 1 + .../rxjs/add/operator/switchMap.d.ts | 1 + .../rxjs/add/operator/switchMap.js | 4 + .../rxjs/add/operator/switchMap.js.map | 1 + .../rxjs/add/operator/switchMapTo.d.ts | 1 + .../rxjs/add/operator/switchMapTo.js | 4 + .../rxjs/add/operator/switchMapTo.js.map | 1 + .../node_modules/rxjs/add/operator/take.d.ts | 1 + .../node_modules/rxjs/add/operator/take.js | 4 + .../rxjs/add/operator/take.js.map | 1 + .../rxjs/add/operator/takeLast.d.ts | 1 + .../rxjs/add/operator/takeLast.js | 4 + .../rxjs/add/operator/takeLast.js.map | 1 + .../rxjs/add/operator/takeUntil.d.ts | 1 + .../rxjs/add/operator/takeUntil.js | 4 + .../rxjs/add/operator/takeUntil.js.map | 1 + .../rxjs/add/operator/takeWhile.d.ts | 1 + .../rxjs/add/operator/takeWhile.js | 4 + .../rxjs/add/operator/takeWhile.js.map | 1 + .../rxjs/add/operator/throttle.d.ts | 1 + .../rxjs/add/operator/throttle.js | 4 + .../rxjs/add/operator/throttle.js.map | 1 + .../rxjs/add/operator/throttleTime.d.ts | 1 + .../rxjs/add/operator/throttleTime.js | 4 + .../rxjs/add/operator/throttleTime.js.map | 1 + .../rxjs/add/operator/timeInterval.d.ts | 1 + .../rxjs/add/operator/timeInterval.js | 4 + .../rxjs/add/operator/timeInterval.js.map | 1 + .../rxjs/add/operator/timeout.d.ts | 1 + .../node_modules/rxjs/add/operator/timeout.js | 4 + .../rxjs/add/operator/timeout.js.map | 1 + .../rxjs/add/operator/timeoutWith.d.ts | 1 + .../rxjs/add/operator/timeoutWith.js | 4 + .../rxjs/add/operator/timeoutWith.js.map | 1 + .../rxjs/add/operator/timestamp.d.ts | 1 + .../rxjs/add/operator/timestamp.js | 4 + .../rxjs/add/operator/timestamp.js.map | 1 + .../rxjs/add/operator/toArray.d.ts | 1 + .../node_modules/rxjs/add/operator/toArray.js | 4 + .../rxjs/add/operator/toArray.js.map | 1 + .../rxjs/add/operator/toPromise.d.ts | 1 + .../rxjs/add/operator/toPromise.js | 4 + .../rxjs/add/operator/toPromise.js.map | 1 + .../rxjs/add/operator/window.d.ts | 1 + .../node_modules/rxjs/add/operator/window.js | 4 + .../rxjs/add/operator/window.js.map | 1 + .../rxjs/add/operator/windowCount.d.ts | 1 + .../rxjs/add/operator/windowCount.js | 4 + .../rxjs/add/operator/windowCount.js.map | 1 + .../rxjs/add/operator/windowTime.d.ts | 1 + .../rxjs/add/operator/windowTime.js | 4 + .../rxjs/add/operator/windowTime.js.map | 1 + .../rxjs/add/operator/windowToggle.d.ts | 1 + .../rxjs/add/operator/windowToggle.js | 4 + .../rxjs/add/operator/windowToggle.js.map | 1 + .../rxjs/add/operator/windowWhen.d.ts | 1 + .../rxjs/add/operator/windowWhen.js | 4 + .../rxjs/add/operator/windowWhen.js.map | 1 + .../rxjs/add/operator/withLatestFrom.d.ts | 1 + .../rxjs/add/operator/withLatestFrom.js | 4 + .../rxjs/add/operator/withLatestFrom.js.map | 1 + .../node_modules/rxjs/add/operator/zip.d.ts | 1 + .../node_modules/rxjs/add/operator/zip.js | 4 + .../node_modules/rxjs/add/operator/zip.js.map | 1 + .../rxjs/add/operator/zipAll.d.ts | 1 + .../node_modules/rxjs/add/operator/zipAll.js | 4 + .../rxjs/add/operator/zipAll.js.map | 1 + .../node_modules/rxjs/ajax/index.d.ts | 2 + .../cli-study/node_modules/rxjs/ajax/index.js | 9 + .../node_modules/rxjs/ajax/index.js.map | 1 + .../node_modules/rxjs/ajax/package.json | 8 + .../node_modules/rxjs/bundles/rxjs.umd.js | 9297 +++++++++ .../node_modules/rxjs/bundles/rxjs.umd.js.map | 1 + .../node_modules/rxjs/bundles/rxjs.umd.min.js | 268 + .../rxjs/bundles/rxjs.umd.min.js.map | 1 + .../node_modules/rxjs/fetch/index.d.ts | 1 + .../node_modules/rxjs/fetch/index.js | 5 + .../node_modules/rxjs/fetch/index.js.map | 1 + .../node_modules/rxjs/fetch/package.json | 8 + day1/cli-study/node_modules/rxjs/index.d.ts | 57 + day1/cli-study/node_modules/rxjs/index.js | 115 + day1/cli-study/node_modules/rxjs/index.js.map | 1 + .../node_modules/rxjs/interfaces.d.ts | 1 + .../cli-study/node_modules/rxjs/interfaces.js | 3 + .../node_modules/rxjs/interfaces.js.map | 1 + .../rxjs/internal-compatibility/index.d.ts | 58 + .../rxjs/internal-compatibility/index.js | 123 + .../rxjs/internal-compatibility/index.js.map | 1 + .../rxjs/internal-compatibility/package.json | 8 + .../rxjs/internal/AsyncSubject.d.ts | 19 + .../rxjs/internal/AsyncSubject.js | 60 + .../rxjs/internal/AsyncSubject.js.map | 1 + .../rxjs/internal/BehaviorSubject.d.ts | 18 + .../rxjs/internal/BehaviorSubject.js | 56 + .../rxjs/internal/BehaviorSubject.js.map | 1 + .../rxjs/internal/InnerSubscriber.d.ts | 17 + .../rxjs/internal/InnerSubscriber.js | 41 + .../rxjs/internal/InnerSubscriber.js.map | 1 + .../rxjs/internal/Notification.d.ts | 88 + .../rxjs/internal/Notification.js | 77 + .../rxjs/internal/Notification.js.map | 1 + .../rxjs/internal/Observable.d.ts | 91 + .../node_modules/rxjs/internal/Observable.js | 117 + .../rxjs/internal/Observable.js.map | 1 + .../node_modules/rxjs/internal/Observer.d.ts | 2 + .../node_modules/rxjs/internal/Observer.js | 18 + .../rxjs/internal/Observer.js.map | 1 + .../node_modules/rxjs/internal/Operator.d.ts | 5 + .../node_modules/rxjs/internal/Operator.js | 3 + .../rxjs/internal/Operator.js.map | 1 + .../rxjs/internal/OuterSubscriber.d.ts | 12 + .../rxjs/internal/OuterSubscriber.js | 34 + .../rxjs/internal/OuterSubscriber.js.map | 1 + .../rxjs/internal/ReplaySubject.d.ts | 25 + .../rxjs/internal/ReplaySubject.js | 126 + .../rxjs/internal/ReplaySubject.js.map | 1 + .../node_modules/rxjs/internal/Rx.d.ts | 195 + .../node_modules/rxjs/internal/Rx.js | 200 + .../node_modules/rxjs/internal/Rx.js.map | 1 + .../node_modules/rxjs/internal/Scheduler.d.ts | 59 + .../node_modules/rxjs/internal/Scheduler.js | 17 + .../rxjs/internal/Scheduler.js.map | 1 + .../node_modules/rxjs/internal/Subject.d.ts | 61 + .../node_modules/rxjs/internal/Subject.js | 171 + .../node_modules/rxjs/internal/Subject.js.map | 1 + .../rxjs/internal/SubjectSubscription.d.ts | 15 + .../rxjs/internal/SubjectSubscription.js | 45 + .../rxjs/internal/SubjectSubscription.js.map | 1 + .../rxjs/internal/Subscriber.d.ts | 87 + .../node_modules/rxjs/internal/Subscriber.js | 246 + .../rxjs/internal/Subscriber.js.map | 1 + .../rxjs/internal/Subscription.d.ts | 66 + .../rxjs/internal/Subscription.js | 137 + .../rxjs/internal/Subscription.js.map | 1 + .../node_modules/rxjs/internal/config.d.ts | 20 + .../node_modules/rxjs/internal/config.js | 20 + .../node_modules/rxjs/internal/config.js.map | 1 + .../observable/ConnectableObservable.d.ts | 23 + .../observable/ConnectableObservable.js | 155 + .../observable/ConnectableObservable.js.map | 1 + .../observable/SubscribeOnObservable.d.ts | 25 + .../observable/SubscribeOnObservable.js | 56 + .../observable/SubscribeOnObservable.js.map | 1 + .../internal/observable/bindCallback.d.ts | 37 + .../rxjs/internal/observable/bindCallback.js | 107 + .../internal/observable/bindCallback.js.map | 1 + .../internal/observable/bindNodeCallback.d.ts | 35 + .../internal/observable/bindNodeCallback.js | 115 + .../observable/bindNodeCallback.js.map | 1 + .../internal/observable/combineLatest.d.ts | 100 + .../rxjs/internal/observable/combineLatest.js | 115 + .../internal/observable/combineLatest.js.map | 1 + .../rxjs/internal/observable/concat.d.ts | 26 + .../rxjs/internal/observable/concat.js | 13 + .../rxjs/internal/observable/concat.js.map | 1 + .../rxjs/internal/observable/defer.d.ts | 52 + .../rxjs/internal/observable/defer.js | 21 + .../rxjs/internal/observable/defer.js.map | 1 + .../observable/dom/AjaxObservable.d.ts | 151 + .../internal/observable/dom/AjaxObservable.js | 391 + .../observable/dom/AjaxObservable.js.map | 1 + .../observable/dom/WebSocketSubject.d.ts | 170 + .../observable/dom/WebSocketSubject.js | 241 + .../observable/dom/WebSocketSubject.js.map | 1 + .../rxjs/internal/observable/dom/ajax.d.ts | 82 + .../rxjs/internal/observable/dom/ajax.js | 5 + .../rxjs/internal/observable/dom/ajax.js.map | 1 + .../rxjs/internal/observable/dom/fetch.d.ts | 52 + .../rxjs/internal/observable/dom/fetch.js | 65 + .../rxjs/internal/observable/dom/fetch.js.map | 1 + .../internal/observable/dom/webSocket.d.ts | 153 + .../rxjs/internal/observable/dom/webSocket.js | 8 + .../internal/observable/dom/webSocket.js.map | 1 + .../rxjs/internal/observable/empty.d.ts | 60 + .../rxjs/internal/observable/empty.js | 12 + .../rxjs/internal/observable/empty.js.map | 1 + .../rxjs/internal/observable/forkJoin.d.ts | 29 + .../rxjs/internal/observable/forkJoin.js | 71 + .../rxjs/internal/observable/forkJoin.js.map | 1 + .../rxjs/internal/observable/from.d.ts | 5 + .../rxjs/internal/observable/from.js | 18 + .../rxjs/internal/observable/from.js.map | 1 + .../rxjs/internal/observable/fromArray.d.ts | 3 + .../rxjs/internal/observable/fromArray.js | 15 + .../rxjs/internal/observable/fromArray.js.map | 1 + .../rxjs/internal/observable/fromEvent.d.ts | 35 + .../rxjs/internal/observable/fromEvent.js | 65 + .../rxjs/internal/observable/fromEvent.js.map | 1 + .../internal/observable/fromEventPattern.d.ts | 5 + .../internal/observable/fromEventPattern.js | 34 + .../observable/fromEventPattern.js.map | 1 + .../internal/observable/fromIterable.d.ts | 3 + .../rxjs/internal/observable/fromIterable.js | 18 + .../internal/observable/fromIterable.js.map | 1 + .../rxjs/internal/observable/fromPromise.d.ts | 3 + .../rxjs/internal/observable/fromPromise.js | 15 + .../internal/observable/fromPromise.js.map | 1 + .../rxjs/internal/observable/generate.d.ts | 231 + .../rxjs/internal/observable/generate.js | 127 + .../rxjs/internal/observable/generate.js.map | 1 + .../rxjs/internal/observable/iif.d.ts | 91 + .../rxjs/internal/observable/iif.js | 11 + .../rxjs/internal/observable/iif.js.map | 1 + .../rxjs/internal/observable/interval.d.ts | 51 + .../rxjs/internal/observable/interval.js | 26 + .../rxjs/internal/observable/interval.js.map | 1 + .../rxjs/internal/observable/merge.d.ts | 44 + .../rxjs/internal/observable/merge.js | 30 + .../rxjs/internal/observable/merge.js.map | 1 + .../rxjs/internal/observable/never.d.ts | 36 + .../rxjs/internal/observable/never.js | 10 + .../rxjs/internal/observable/never.js.map | 1 + .../rxjs/internal/observable/of.d.ts | 31 + .../rxjs/internal/observable/of.js | 21 + .../rxjs/internal/observable/of.js.map | 1 + .../observable/onErrorResumeNext.d.ts | 9 + .../internal/observable/onErrorResumeNext.js | 29 + .../observable/onErrorResumeNext.js.map | 1 + .../rxjs/internal/observable/pairs.d.ts | 61 + .../rxjs/internal/observable/pairs.js | 42 + .../rxjs/internal/observable/pairs.js.map | 1 + .../rxjs/internal/observable/partition.d.ts | 54 + .../rxjs/internal/observable/partition.js | 14 + .../rxjs/internal/observable/partition.js.map | 1 + .../rxjs/internal/observable/race.d.ts | 39 + .../rxjs/internal/observable/race.js | 92 + .../rxjs/internal/observable/race.js.map | 1 + .../rxjs/internal/observable/range.d.ts | 39 + .../rxjs/internal/observable/range.js | 49 + .../rxjs/internal/observable/range.js.map | 1 + .../rxjs/internal/observable/throwError.d.ts | 67 + .../rxjs/internal/observable/throwError.js | 17 + .../internal/observable/throwError.js.map | 1 + .../rxjs/internal/observable/timer.d.ts | 53 + .../rxjs/internal/observable/timer.js | 41 + .../rxjs/internal/observable/timer.js.map | 1 + .../rxjs/internal/observable/using.d.ts | 31 + .../rxjs/internal/observable/using.js | 35 + .../rxjs/internal/observable/using.js.map | 1 + .../rxjs/internal/observable/zip.d.ts | 52 + .../rxjs/internal/observable/zip.js | 230 + .../rxjs/internal/observable/zip.js.map | 1 + .../rxjs/internal/operators/audit.d.ts | 48 + .../rxjs/internal/operators/audit.js | 83 + .../rxjs/internal/operators/audit.js.map | 1 + .../rxjs/internal/operators/auditTime.d.ts | 51 + .../rxjs/internal/operators/auditTime.js | 11 + .../rxjs/internal/operators/auditTime.js.map | 1 + .../rxjs/internal/operators/buffer.d.ts | 43 + .../rxjs/internal/operators/buffer.js | 51 + .../rxjs/internal/operators/buffer.js.map | 1 + .../rxjs/internal/operators/bufferCount.d.ts | 57 + .../rxjs/internal/operators/bufferCount.js | 102 + .../internal/operators/bufferCount.js.map | 1 + .../rxjs/internal/operators/bufferTime.d.ts | 4 + .../rxjs/internal/operators/bufferTime.js | 162 + .../rxjs/internal/operators/bufferTime.js.map | 1 + .../rxjs/internal/operators/bufferToggle.d.ts | 48 + .../rxjs/internal/operators/bufferToggle.js | 121 + .../internal/operators/bufferToggle.js.map | 1 + .../rxjs/internal/operators/bufferWhen.d.ts | 45 + .../rxjs/internal/operators/bufferWhen.js | 96 + .../rxjs/internal/operators/bufferWhen.js.map | 1 + .../rxjs/internal/operators/catchError.d.ts | 3 + .../rxjs/internal/operators/catchError.js | 65 + .../rxjs/internal/operators/catchError.js.map | 1 + .../rxjs/internal/operators/combineAll.d.ts | 5 + .../rxjs/internal/operators/combineAll.js | 8 + .../rxjs/internal/operators/combineAll.js.map | 1 + .../internal/operators/combineLatest.d.ts | 29 + .../rxjs/internal/operators/combineLatest.js | 22 + .../internal/operators/combineLatest.js.map | 1 + .../rxjs/internal/operators/concat.d.ts | 17 + .../rxjs/internal/operators/concat.js | 12 + .../rxjs/internal/operators/concat.js.map | 1 + .../rxjs/internal/operators/concatAll.d.ts | 3 + .../rxjs/internal/operators/concatAll.js | 8 + .../rxjs/internal/operators/concatAll.js.map | 1 + .../rxjs/internal/operators/concatMap.d.ts | 6 + .../rxjs/internal/operators/concatMap.js | 8 + .../rxjs/internal/operators/concatMap.js.map | 1 + .../rxjs/internal/operators/concatMapTo.d.ts | 6 + .../rxjs/internal/operators/concatMapTo.js | 8 + .../internal/operators/concatMapTo.js.map | 1 + .../rxjs/internal/operators/count.d.ts | 62 + .../rxjs/internal/operators/count.js | 68 + .../rxjs/internal/operators/count.js.map | 1 + .../rxjs/internal/operators/debounce.d.ts | 50 + .../rxjs/internal/operators/debounce.js | 90 + .../rxjs/internal/operators/debounce.js.map | 1 + .../rxjs/internal/operators/debounceTime.d.ts | 54 + .../rxjs/internal/operators/debounceTime.js | 76 + .../internal/operators/debounceTime.js.map | 1 + .../internal/operators/defaultIfEmpty.d.ts | 3 + .../rxjs/internal/operators/defaultIfEmpty.js | 51 + .../internal/operators/defaultIfEmpty.js.map | 1 + .../rxjs/internal/operators/delay.d.ts | 52 + .../rxjs/internal/operators/delay.js | 105 + .../rxjs/internal/operators/delay.js.map | 1 + .../rxjs/internal/operators/delayWhen.d.ts | 5 + .../rxjs/internal/operators/delayWhen.js | 146 + .../rxjs/internal/operators/delayWhen.js.map | 1 + .../internal/operators/dematerialize.d.ts | 49 + .../rxjs/internal/operators/dematerialize.js | 41 + .../internal/operators/dematerialize.js.map | 1 + .../rxjs/internal/operators/distinct.d.ts | 79 + .../rxjs/internal/operators/distinct.js | 79 + .../rxjs/internal/operators/distinct.js.map | 1 + .../operators/distinctUntilChanged.d.ts | 3 + .../operators/distinctUntilChanged.js | 74 + .../operators/distinctUntilChanged.js.map | 1 + .../operators/distinctUntilKeyChanged.d.ts | 3 + .../operators/distinctUntilKeyChanged.js | 8 + .../operators/distinctUntilKeyChanged.js.map | 1 + .../rxjs/internal/operators/elementAt.d.ts | 50 + .../rxjs/internal/operators/elementAt.js | 18 + .../rxjs/internal/operators/elementAt.js.map | 1 + .../rxjs/internal/operators/endWith.d.ts | 24 + .../rxjs/internal/operators/endWith.js | 13 + .../rxjs/internal/operators/endWith.js.map | 1 + .../rxjs/internal/operators/every.d.ts | 24 + .../rxjs/internal/operators/every.js | 65 + .../rxjs/internal/operators/every.js.map | 1 + .../rxjs/internal/operators/exhaust.d.ts | 3 + .../rxjs/internal/operators/exhaust.js | 59 + .../rxjs/internal/operators/exhaust.js.map | 1 + .../rxjs/internal/operators/exhaustMap.d.ts | 6 + .../rxjs/internal/operators/exhaustMap.js | 99 + .../rxjs/internal/operators/exhaustMap.js.map | 1 + .../rxjs/internal/operators/expand.d.ts | 36 + .../rxjs/internal/operators/expand.js | 115 + .../rxjs/internal/operators/expand.js.map | 1 + .../rxjs/internal/operators/filter.d.ts | 3 + .../rxjs/internal/operators/filter.js | 57 + .../rxjs/internal/operators/filter.js.map | 1 + .../rxjs/internal/operators/finalize.d.ts | 10 + .../rxjs/internal/operators/finalize.js | 40 + .../rxjs/internal/operators/finalize.js.map | 1 + .../rxjs/internal/operators/find.d.ts | 30 + .../rxjs/internal/operators/find.js | 73 + .../rxjs/internal/operators/find.js.map | 1 + .../rxjs/internal/operators/findIndex.d.ts | 43 + .../rxjs/internal/operators/findIndex.js | 8 + .../rxjs/internal/operators/findIndex.js.map | 1 + .../rxjs/internal/operators/first.d.ts | 5 + .../rxjs/internal/operators/first.js | 14 + .../rxjs/internal/operators/first.js.map | 1 + .../rxjs/internal/operators/groupBy.d.ts | 32 + .../rxjs/internal/operators/groupBy.js | 196 + .../rxjs/internal/operators/groupBy.js.map | 1 + .../internal/operators/ignoreElements.d.ts | 29 + .../rxjs/internal/operators/ignoreElements.js | 40 + .../internal/operators/ignoreElements.js.map | 1 + .../rxjs/internal/operators/index.d.ts | 102 + .../rxjs/internal/operators/index.js | 207 + .../rxjs/internal/operators/index.js.map | 1 + .../rxjs/internal/operators/isEmpty.d.ts | 61 + .../rxjs/internal/operators/isEmpty.js | 47 + .../rxjs/internal/operators/isEmpty.js.map | 1 + .../rxjs/internal/operators/last.d.ts | 5 + .../rxjs/internal/operators/last.js | 14 + .../rxjs/internal/operators/last.js.map | 1 + .../rxjs/internal/operators/map.d.ts | 49 + .../rxjs/internal/operators/map.js | 59 + .../rxjs/internal/operators/map.js.map | 1 + .../rxjs/internal/operators/mapTo.d.ts | 34 + .../rxjs/internal/operators/mapTo.js | 42 + .../rxjs/internal/operators/mapTo.js.map | 1 + .../rxjs/internal/operators/materialize.d.ts | 53 + .../rxjs/internal/operators/materialize.js | 52 + .../internal/operators/materialize.js.map | 1 + .../rxjs/internal/operators/max.d.ts | 47 + .../rxjs/internal/operators/max.js | 11 + .../rxjs/internal/operators/max.js.map | 1 + .../rxjs/internal/operators/merge.d.ts | 29 + .../rxjs/internal/operators/merge.js | 12 + .../rxjs/internal/operators/merge.js.map | 1 + .../rxjs/internal/operators/mergeAll.d.ts | 60 + .../rxjs/internal/operators/mergeAll.js | 10 + .../rxjs/internal/operators/mergeAll.js.map | 1 + .../rxjs/internal/operators/mergeMap.d.ts | 37 + .../rxjs/internal/operators/mergeMap.js | 111 + .../rxjs/internal/operators/mergeMap.js.map | 1 + .../rxjs/internal/operators/mergeMapTo.d.ts | 5 + .../rxjs/internal/operators/mergeMapTo.js | 15 + .../rxjs/internal/operators/mergeMapTo.js.map | 1 + .../rxjs/internal/operators/mergeScan.d.ts | 74 + .../rxjs/internal/operators/mergeScan.js | 112 + .../rxjs/internal/operators/mergeScan.js.map | 1 + .../rxjs/internal/operators/min.d.ts | 46 + .../rxjs/internal/operators/min.js | 11 + .../rxjs/internal/operators/min.js.map | 1 + .../rxjs/internal/operators/multicast.d.ts | 16 + .../rxjs/internal/operators/multicast.js | 40 + .../rxjs/internal/operators/multicast.js.map | 1 + .../rxjs/internal/operators/observeOn.d.ts | 84 + .../rxjs/internal/operators/observeOn.js | 77 + .../rxjs/internal/operators/observeOn.js.map | 1 + .../internal/operators/onErrorResumeNext.d.ts | 18 + .../internal/operators/onErrorResumeNext.js | 93 + .../operators/onErrorResumeNext.js.map | 1 + .../rxjs/internal/operators/pairwise.d.ts | 45 + .../rxjs/internal/operators/pairwise.js | 51 + .../rxjs/internal/operators/pairwise.js.map | 1 + .../rxjs/internal/operators/partition.d.ts | 51 + .../rxjs/internal/operators/partition.js | 12 + .../rxjs/internal/operators/partition.js.map | 1 + .../rxjs/internal/operators/pluck.d.ts | 8 + .../rxjs/internal/operators/pluck.js | 32 + .../rxjs/internal/operators/pluck.js.map | 1 + .../rxjs/internal/operators/publish.d.ts | 6 + .../rxjs/internal/operators/publish.js | 11 + .../rxjs/internal/operators/publish.js.map | 1 + .../internal/operators/publishBehavior.d.ts | 10 + .../internal/operators/publishBehavior.js | 9 + .../internal/operators/publishBehavior.js.map | 1 + .../rxjs/internal/operators/publishLast.d.ts | 61 + .../rxjs/internal/operators/publishLast.js | 9 + .../internal/operators/publishLast.js.map | 1 + .../internal/operators/publishReplay.d.ts | 4 + .../rxjs/internal/operators/publishReplay.js | 14 + .../internal/operators/publishReplay.js.map | 1 + .../rxjs/internal/operators/race.d.ts | 10 + .../rxjs/internal/operators/race.js | 18 + .../rxjs/internal/operators/race.js.map | 1 + .../rxjs/internal/operators/reduce.d.ts | 4 + .../rxjs/internal/operators/reduce.js | 18 + .../rxjs/internal/operators/reduce.js.map | 1 + .../rxjs/internal/operators/refCount.d.ts | 55 + .../rxjs/internal/operators/refCount.js | 72 + .../rxjs/internal/operators/refCount.js.map | 1 + .../rxjs/internal/operators/repeat.d.ts | 58 + .../rxjs/internal/operators/repeat.js | 65 + .../rxjs/internal/operators/repeat.js.map | 1 + .../rxjs/internal/operators/repeatWhen.d.ts | 33 + .../rxjs/internal/operators/repeatWhen.js | 97 + .../rxjs/internal/operators/repeatWhen.js.map | 1 + .../rxjs/internal/operators/retry.d.ts | 48 + .../rxjs/internal/operators/retry.js | 54 + .../rxjs/internal/operators/retry.js.map | 1 + .../rxjs/internal/operators/retryWhen.d.ts | 17 + .../rxjs/internal/operators/retryWhen.js | 89 + .../rxjs/internal/operators/retryWhen.js.map | 1 + .../rxjs/internal/operators/sample.d.ts | 43 + .../rxjs/internal/operators/sample.js | 59 + .../rxjs/internal/operators/sample.js.map | 1 + .../rxjs/internal/operators/sampleTime.d.ts | 44 + .../rxjs/internal/operators/sampleTime.js | 60 + .../rxjs/internal/operators/sampleTime.js.map | 1 + .../rxjs/internal/operators/scan.d.ts | 4 + .../rxjs/internal/operators/scan.js | 83 + .../rxjs/internal/operators/scan.js.map | 1 + .../internal/operators/sequenceEqual.d.ts | 87 + .../rxjs/internal/operators/sequenceEqual.js | 124 + .../internal/operators/sequenceEqual.js.map | 1 + .../rxjs/internal/operators/share.d.ts | 14 + .../rxjs/internal/operators/share.js | 13 + .../rxjs/internal/operators/share.js.map | 1 + .../rxjs/internal/operators/shareReplay.d.ts | 54 + .../rxjs/internal/operators/shareReplay.js | 57 + .../internal/operators/shareReplay.js.map | 1 + .../rxjs/internal/operators/single.d.ts | 49 + .../rxjs/internal/operators/single.js | 82 + .../rxjs/internal/operators/single.js.map | 1 + .../rxjs/internal/operators/skip.d.ts | 13 + .../rxjs/internal/operators/skip.js | 45 + .../rxjs/internal/operators/skip.js.map | 1 + .../rxjs/internal/operators/skipLast.d.ts | 40 + .../rxjs/internal/operators/skipLast.js | 64 + .../rxjs/internal/operators/skipLast.js.map | 1 + .../rxjs/internal/operators/skipUntil.d.ts | 42 + .../rxjs/internal/operators/skipUntil.js | 62 + .../rxjs/internal/operators/skipUntil.js.map | 1 + .../rxjs/internal/operators/skipWhile.d.ts | 14 + .../rxjs/internal/operators/skipWhile.js | 59 + .../rxjs/internal/operators/skipWhile.js.map | 1 + .../rxjs/internal/operators/startWith.d.ts | 24 + .../rxjs/internal/operators/startWith.js | 20 + .../rxjs/internal/operators/startWith.js.map | 1 + .../rxjs/internal/operators/subscribeOn.d.ts | 44 + .../rxjs/internal/operators/subscribeOn.js | 21 + .../internal/operators/subscribeOn.js.map | 1 + .../rxjs/internal/operators/switchAll.d.ts | 3 + .../rxjs/internal/operators/switchAll.js | 9 + .../rxjs/internal/operators/switchAll.js.map | 1 + .../rxjs/internal/operators/switchMap.d.ts | 6 + .../rxjs/internal/operators/switchMap.js | 93 + .../rxjs/internal/operators/switchMap.js.map | 1 + .../rxjs/internal/operators/switchMapTo.d.ts | 6 + .../rxjs/internal/operators/switchMapTo.js | 8 + .../internal/operators/switchMapTo.js.map | 1 + .../rxjs/internal/operators/take.d.ts | 48 + .../rxjs/internal/operators/take.js | 63 + .../rxjs/internal/operators/take.js.map | 1 + .../rxjs/internal/operators/takeLast.d.ts | 44 + .../rxjs/internal/operators/takeLast.js | 78 + .../rxjs/internal/operators/takeLast.js.map | 1 + .../rxjs/internal/operators/takeUntil.d.ts | 43 + .../rxjs/internal/operators/takeUntil.js | 52 + .../rxjs/internal/operators/takeUntil.js.map | 1 + .../rxjs/internal/operators/takeWhile.d.ts | 4 + .../rxjs/internal/operators/takeWhile.js | 69 + .../rxjs/internal/operators/takeWhile.js.map | 1 + .../rxjs/internal/operators/tap.d.ts | 9 + .../rxjs/internal/operators/tap.js | 89 + .../rxjs/internal/operators/tap.js.map | 1 + .../rxjs/internal/operators/throttle.d.ts | 53 + .../rxjs/internal/operators/throttle.js | 103 + .../rxjs/internal/operators/throttle.js.map | 1 + .../rxjs/internal/operators/throttleTime.d.ts | 82 + .../rxjs/internal/operators/throttleTime.js | 95 + .../internal/operators/throttleTime.js.map | 1 + .../rxjs/internal/operators/throwIfEmpty.d.ts | 32 + .../rxjs/internal/operators/throwIfEmpty.js | 66 + .../internal/operators/throwIfEmpty.js.map | 1 + .../rxjs/internal/operators/timeInterval.d.ts | 55 + .../rxjs/internal/operators/timeInterval.js | 28 + .../internal/operators/timeInterval.js.map | 1 + .../rxjs/internal/operators/timeout.d.ts | 80 + .../rxjs/internal/operators/timeout.js | 12 + .../rxjs/internal/operators/timeout.js.map | 1 + .../rxjs/internal/operators/timeoutWith.d.ts | 2 + .../rxjs/internal/operators/timeoutWith.js | 80 + .../internal/operators/timeoutWith.js.map | 1 + .../rxjs/internal/operators/timestamp.d.ts | 41 + .../rxjs/internal/operators/timestamp.js | 18 + .../rxjs/internal/operators/timestamp.js.map | 1 + .../rxjs/internal/operators/toArray.d.ts | 33 + .../rxjs/internal/operators/toArray.js | 15 + .../rxjs/internal/operators/toArray.js.map | 1 + .../rxjs/internal/operators/window.d.ts | 46 + .../rxjs/internal/operators/window.js | 81 + .../rxjs/internal/operators/window.js.map | 1 + .../rxjs/internal/operators/windowCount.d.ts | 66 + .../rxjs/internal/operators/windowCount.js | 90 + .../internal/operators/windowCount.js.map | 1 + .../rxjs/internal/operators/windowTime.d.ts | 87 + .../rxjs/internal/operators/windowTime.js | 169 + .../rxjs/internal/operators/windowTime.js.map | 1 + .../rxjs/internal/operators/windowToggle.d.ts | 51 + .../rxjs/internal/operators/windowToggle.js | 143 + .../internal/operators/windowToggle.js.map | 1 + .../rxjs/internal/operators/windowWhen.d.ts | 48 + .../rxjs/internal/operators/windowWhen.js | 96 + .../rxjs/internal/operators/windowWhen.js.map | 1 + .../internal/operators/withLatestFrom.d.ts | 15 + .../rxjs/internal/operators/withLatestFrom.js | 97 + .../internal/operators/withLatestFrom.js.map | 1 + .../rxjs/internal/operators/zip.d.ts | 29 + .../rxjs/internal/operators/zip.js | 14 + .../rxjs/internal/operators/zip.js.map | 1 + .../rxjs/internal/operators/zipAll.d.ts | 5 + .../rxjs/internal/operators/zipAll.js | 8 + .../rxjs/internal/operators/zipAll.js.map | 1 + .../internal/scheduled/scheduleArray.d.ts | 3 + .../rxjs/internal/scheduled/scheduleArray.js | 23 + .../internal/scheduled/scheduleArray.js.map | 1 + .../internal/scheduled/scheduleIterable.d.ts | 3 + .../internal/scheduled/scheduleIterable.js | 48 + .../scheduled/scheduleIterable.js.map | 1 + .../scheduled/scheduleObservable.d.ts | 3 + .../internal/scheduled/scheduleObservable.js | 21 + .../scheduled/scheduleObservable.js.map | 1 + .../internal/scheduled/schedulePromise.d.ts | 3 + .../internal/scheduled/schedulePromise.js | 20 + .../internal/scheduled/schedulePromise.js.map | 1 + .../rxjs/internal/scheduled/scheduled.d.ts | 13 + .../rxjs/internal/scheduled/scheduled.js | 29 + .../rxjs/internal/scheduled/scheduled.js.map | 1 + .../rxjs/internal/scheduler/Action.d.ts | 31 + .../rxjs/internal/scheduler/Action.js | 29 + .../rxjs/internal/scheduler/Action.js.map | 1 + .../scheduler/AnimationFrameAction.d.ts | 15 + .../scheduler/AnimationFrameAction.js | 47 + .../scheduler/AnimationFrameAction.js.map | 1 + .../scheduler/AnimationFrameScheduler.d.ts | 5 + .../scheduler/AnimationFrameScheduler.js | 46 + .../scheduler/AnimationFrameScheduler.js.map | 1 + .../rxjs/internal/scheduler/AsapAction.d.ts | 15 + .../rxjs/internal/scheduler/AsapAction.js | 48 + .../rxjs/internal/scheduler/AsapAction.js.map | 1 + .../internal/scheduler/AsapScheduler.d.ts | 5 + .../rxjs/internal/scheduler/AsapScheduler.js | 46 + .../internal/scheduler/AsapScheduler.js.map | 1 + .../rxjs/internal/scheduler/AsyncAction.d.ts | 29 + .../rxjs/internal/scheduler/AsyncAction.js | 102 + .../internal/scheduler/AsyncAction.js.map | 1 + .../internal/scheduler/AsyncScheduler.d.ts | 27 + .../rxjs/internal/scheduler/AsyncScheduler.js | 67 + .../internal/scheduler/AsyncScheduler.js.map | 1 + .../rxjs/internal/scheduler/QueueAction.d.ts | 17 + .../rxjs/internal/scheduler/QueueAction.js | 50 + .../internal/scheduler/QueueAction.js.map | 1 + .../internal/scheduler/QueueScheduler.d.ts | 3 + .../rxjs/internal/scheduler/QueueScheduler.js | 25 + .../internal/scheduler/QueueScheduler.js.map | 1 + .../scheduler/VirtualTimeScheduler.d.ts | 33 + .../scheduler/VirtualTimeScheduler.js | 111 + .../scheduler/VirtualTimeScheduler.js.map | 1 + .../internal/scheduler/animationFrame.d.ts | 37 + .../rxjs/internal/scheduler/animationFrame.js | 6 + .../internal/scheduler/animationFrame.js.map | 1 + .../rxjs/internal/scheduler/asap.d.ts | 39 + .../rxjs/internal/scheduler/asap.js | 6 + .../rxjs/internal/scheduler/asap.js.map | 1 + .../rxjs/internal/scheduler/async.d.ts | 52 + .../rxjs/internal/scheduler/async.js | 6 + .../rxjs/internal/scheduler/async.js.map | 1 + .../rxjs/internal/scheduler/queue.d.ts | 68 + .../rxjs/internal/scheduler/queue.js | 6 + .../rxjs/internal/scheduler/queue.js.map | 1 + .../rxjs/internal/symbol/iterator.d.ts | 6 + .../rxjs/internal/symbol/iterator.js | 12 + .../rxjs/internal/symbol/iterator.js.map | 1 + .../rxjs/internal/symbol/observable.d.ts | 8 + .../rxjs/internal/symbol/observable.js | 4 + .../rxjs/internal/symbol/observable.js.map | 1 + .../rxjs/internal/symbol/rxSubscriber.d.ts | 6 + .../rxjs/internal/symbol/rxSubscriber.js | 9 + .../rxjs/internal/symbol/rxSubscriber.js.map | 1 + .../rxjs/internal/testing/ColdObservable.d.ts | 20 + .../rxjs/internal/testing/ColdObservable.js | 52 + .../internal/testing/ColdObservable.js.map | 1 + .../rxjs/internal/testing/HotObservable.d.ts | 23 + .../rxjs/internal/testing/HotObservable.js | 53 + .../internal/testing/HotObservable.js.map | 1 + .../internal/testing/SubscriptionLog.d.ts | 5 + .../rxjs/internal/testing/SubscriptionLog.js | 12 + .../internal/testing/SubscriptionLog.js.map | 1 + .../testing/SubscriptionLoggable.d.ts | 8 + .../internal/testing/SubscriptionLoggable.js | 20 + .../testing/SubscriptionLoggable.js.map | 1 + .../rxjs/internal/testing/TestMessage.d.ts | 6 + .../rxjs/internal/testing/TestMessage.js | 3 + .../rxjs/internal/testing/TestMessage.js.map | 1 + .../rxjs/internal/testing/TestScheduler.d.ts | 53 + .../rxjs/internal/testing/TestScheduler.js | 364 + .../internal/testing/TestScheduler.js.map | 1 + .../node_modules/rxjs/internal/types.d.ts | 82 + .../node_modules/rxjs/internal/types.js | 3 + .../node_modules/rxjs/internal/types.js.map | 1 + .../util/ArgumentOutOfRangeError.d.ts | 16 + .../internal/util/ArgumentOutOfRangeError.js | 14 + .../util/ArgumentOutOfRangeError.js.map | 1 + .../rxjs/internal/util/EmptyError.d.ts | 16 + .../rxjs/internal/util/EmptyError.js | 14 + .../rxjs/internal/util/EmptyError.js.map | 1 + .../rxjs/internal/util/Immediate.d.ts | 13 + .../rxjs/internal/util/Immediate.js | 29 + .../rxjs/internal/util/Immediate.js.map | 1 + .../util/ObjectUnsubscribedError.d.ts | 15 + .../internal/util/ObjectUnsubscribedError.js | 14 + .../util/ObjectUnsubscribedError.js.map | 1 + .../rxjs/internal/util/TimeoutError.d.ts | 13 + .../rxjs/internal/util/TimeoutError.js | 14 + .../rxjs/internal/util/TimeoutError.js.map | 1 + .../internal/util/UnsubscriptionError.d.ts | 11 + .../rxjs/internal/util/UnsubscriptionError.js | 16 + .../internal/util/UnsubscriptionError.js.map | 1 + .../rxjs/internal/util/applyMixins.d.ts | 1 + .../rxjs/internal/util/applyMixins.js | 14 + .../rxjs/internal/util/applyMixins.js.map | 1 + .../rxjs/internal/util/canReportError.d.ts | 9 + .../rxjs/internal/util/canReportError.js | 20 + .../rxjs/internal/util/canReportError.js.map | 1 + .../rxjs/internal/util/errorObject.d.ts | 1 + .../rxjs/internal/util/errorObject.js | 4 + .../rxjs/internal/util/errorObject.js.map | 1 + .../rxjs/internal/util/hostReportError.d.ts | 6 + .../rxjs/internal/util/hostReportError.js | 7 + .../rxjs/internal/util/hostReportError.js.map | 1 + .../rxjs/internal/util/identity.d.ts | 1 + .../rxjs/internal/util/identity.js | 7 + .../rxjs/internal/util/identity.js.map | 1 + .../rxjs/internal/util/isArray.d.ts | 1 + .../rxjs/internal/util/isArray.js | 4 + .../rxjs/internal/util/isArray.js.map | 1 + .../rxjs/internal/util/isArrayLike.d.ts | 1 + .../rxjs/internal/util/isArrayLike.js | 4 + .../rxjs/internal/util/isArrayLike.js.map | 1 + .../rxjs/internal/util/isDate.d.ts | 1 + .../node_modules/rxjs/internal/util/isDate.js | 7 + .../rxjs/internal/util/isDate.js.map | 1 + .../rxjs/internal/util/isFunction.d.ts | 1 + .../rxjs/internal/util/isFunction.js | 7 + .../rxjs/internal/util/isFunction.js.map | 1 + .../internal/util/isInteropObservable.d.ts | 3 + .../rxjs/internal/util/isInteropObservable.js | 8 + .../internal/util/isInteropObservable.js.map | 1 + .../rxjs/internal/util/isIterable.d.ts | 2 + .../rxjs/internal/util/isIterable.js | 8 + .../rxjs/internal/util/isIterable.js.map | 1 + .../rxjs/internal/util/isNumeric.d.ts | 1 + .../rxjs/internal/util/isNumeric.js | 8 + .../rxjs/internal/util/isNumeric.js.map | 1 + .../rxjs/internal/util/isObject.d.ts | 1 + .../rxjs/internal/util/isObject.js | 7 + .../rxjs/internal/util/isObject.js.map | 1 + .../rxjs/internal/util/isObservable.d.ts | 6 + .../rxjs/internal/util/isObservable.js | 8 + .../rxjs/internal/util/isObservable.js.map | 1 + .../rxjs/internal/util/isPromise.d.ts | 6 + .../rxjs/internal/util/isPromise.js | 7 + .../rxjs/internal/util/isPromise.js.map | 1 + .../rxjs/internal/util/isScheduler.d.ts | 2 + .../rxjs/internal/util/isScheduler.js | 7 + .../rxjs/internal/util/isScheduler.js.map | 1 + .../node_modules/rxjs/internal/util/noop.d.ts | 1 + .../node_modules/rxjs/internal/util/noop.js | 5 + .../rxjs/internal/util/noop.js.map | 1 + .../node_modules/rxjs/internal/util/not.d.ts | 1 + .../node_modules/rxjs/internal/util/not.js | 12 + .../rxjs/internal/util/not.js.map | 1 + .../node_modules/rxjs/internal/util/pipe.d.ts | 14 + .../node_modules/rxjs/internal/util/pipe.js | 24 + .../rxjs/internal/util/pipe.js.map | 1 + .../node_modules/rxjs/internal/util/root.d.ts | 2 + .../node_modules/rxjs/internal/util/root.js | 14 + .../rxjs/internal/util/root.js.map | 1 + .../rxjs/internal/util/subscribeTo.d.ts | 4 + .../rxjs/internal/util/subscribeTo.js | 32 + .../rxjs/internal/util/subscribeTo.js.map | 1 + .../rxjs/internal/util/subscribeToArray.d.ts | 6 + .../rxjs/internal/util/subscribeToArray.js | 9 + .../internal/util/subscribeToArray.js.map | 1 + .../internal/util/subscribeToIterable.d.ts | 2 + .../rxjs/internal/util/subscribeToIterable.js | 26 + .../internal/util/subscribeToIterable.js.map | 1 + .../internal/util/subscribeToObservable.d.ts | 7 + .../internal/util/subscribeToObservable.js | 13 + .../util/subscribeToObservable.js.map | 1 + .../internal/util/subscribeToPromise.d.ts | 2 + .../rxjs/internal/util/subscribeToPromise.js | 14 + .../internal/util/subscribeToPromise.js.map | 1 + .../rxjs/internal/util/subscribeToResult.d.ts | 5 + .../rxjs/internal/util/subscribeToResult.js | 17 + .../internal/util/subscribeToResult.js.map | 1 + .../rxjs/internal/util/toSubscriber.d.ts | 3 + .../rxjs/internal/util/toSubscriber.js | 21 + .../rxjs/internal/util/toSubscriber.js.map | 1 + .../rxjs/internal/util/tryCatch.d.ts | 1 + .../rxjs/internal/util/tryCatch.js | 23 + .../rxjs/internal/util/tryCatch.js.map | 1 + .../rxjs/migrations/collection.json | 9 + .../rxjs/migrations/update-6_0_0/index.js | 28 + .../rxjs/migrations/update-6_0_0/index.js.map | 1 + .../rxjs/observable/ArrayLikeObservable.d.ts | 1 + .../rxjs/observable/ArrayLikeObservable.js | 7 + .../observable/ArrayLikeObservable.js.map | 1 + .../rxjs/observable/ArrayObservable.d.ts | 1 + .../rxjs/observable/ArrayObservable.js | 7 + .../rxjs/observable/ArrayObservable.js.map | 1 + .../observable/BoundCallbackObservable.d.ts | 1 + .../observable/BoundCallbackObservable.js | 7 + .../observable/BoundCallbackObservable.js.map | 1 + .../BoundNodeCallbackObservable.d.ts | 1 + .../observable/BoundNodeCallbackObservable.js | 7 + .../BoundNodeCallbackObservable.js.map | 1 + .../observable/ConnectableObservable.d.ts | 1 + .../rxjs/observable/ConnectableObservable.js | 7 + .../observable/ConnectableObservable.js.map | 1 + .../rxjs/observable/DeferObservable.d.ts | 1 + .../rxjs/observable/DeferObservable.js | 7 + .../rxjs/observable/DeferObservable.js.map | 1 + .../rxjs/observable/EmptyObservable.d.ts | 1 + .../rxjs/observable/EmptyObservable.js | 7 + .../rxjs/observable/EmptyObservable.js.map | 1 + .../rxjs/observable/ErrorObservable.d.ts | 1 + .../rxjs/observable/ErrorObservable.js | 7 + .../rxjs/observable/ErrorObservable.js.map | 1 + .../rxjs/observable/ForkJoinObservable.d.ts | 1 + .../rxjs/observable/ForkJoinObservable.js | 7 + .../rxjs/observable/ForkJoinObservable.js.map | 1 + .../rxjs/observable/FromEventObservable.d.ts | 1 + .../rxjs/observable/FromEventObservable.js | 7 + .../observable/FromEventObservable.js.map | 1 + .../FromEventPatternObservable.d.ts | 1 + .../observable/FromEventPatternObservable.js | 7 + .../FromEventPatternObservable.js.map | 1 + .../rxjs/observable/FromObservable.d.ts | 1 + .../rxjs/observable/FromObservable.js | 7 + .../rxjs/observable/FromObservable.js.map | 1 + .../rxjs/observable/GenerateObservable.d.ts | 1 + .../rxjs/observable/GenerateObservable.js | 7 + .../rxjs/observable/GenerateObservable.js.map | 1 + .../rxjs/observable/IfObservable.d.ts | 1 + .../rxjs/observable/IfObservable.js | 7 + .../rxjs/observable/IfObservable.js.map | 1 + .../rxjs/observable/IntervalObservable.d.ts | 1 + .../rxjs/observable/IntervalObservable.js | 7 + .../rxjs/observable/IntervalObservable.js.map | 1 + .../rxjs/observable/IteratorObservable.d.ts | 1 + .../rxjs/observable/IteratorObservable.js | 7 + .../rxjs/observable/IteratorObservable.js.map | 1 + .../rxjs/observable/NeverObservable.d.ts | 1 + .../rxjs/observable/NeverObservable.js | 7 + .../rxjs/observable/NeverObservable.js.map | 1 + .../rxjs/observable/PairsObservable.d.ts | 1 + .../rxjs/observable/PairsObservable.js | 7 + .../rxjs/observable/PairsObservable.js.map | 1 + .../rxjs/observable/PromiseObservable.d.ts | 1 + .../rxjs/observable/PromiseObservable.js | 7 + .../rxjs/observable/PromiseObservable.js.map | 1 + .../rxjs/observable/RangeObservable.d.ts | 1 + .../rxjs/observable/RangeObservable.js | 7 + .../rxjs/observable/RangeObservable.js.map | 1 + .../rxjs/observable/ScalarObservable.d.ts | 1 + .../rxjs/observable/ScalarObservable.js | 7 + .../rxjs/observable/ScalarObservable.js.map | 1 + .../observable/SubscribeOnObservable.d.ts | 1 + .../rxjs/observable/SubscribeOnObservable.js | 7 + .../observable/SubscribeOnObservable.js.map | 1 + .../rxjs/observable/TimerObservable.d.ts | 1 + .../rxjs/observable/TimerObservable.js | 7 + .../rxjs/observable/TimerObservable.js.map | 1 + .../rxjs/observable/UsingObservable.d.ts | 1 + .../rxjs/observable/UsingObservable.js | 7 + .../rxjs/observable/UsingObservable.js.map | 1 + .../rxjs/observable/bindCallback.d.ts | 1 + .../rxjs/observable/bindCallback.js | 7 + .../rxjs/observable/bindCallback.js.map | 1 + .../rxjs/observable/bindNodeCallback.d.ts | 1 + .../rxjs/observable/bindNodeCallback.js | 7 + .../rxjs/observable/bindNodeCallback.js.map | 1 + .../rxjs/observable/combineLatest.d.ts | 1 + .../rxjs/observable/combineLatest.js | 7 + .../rxjs/observable/combineLatest.js.map | 1 + .../node_modules/rxjs/observable/concat.d.ts | 1 + .../node_modules/rxjs/observable/concat.js | 7 + .../rxjs/observable/concat.js.map | 1 + .../node_modules/rxjs/observable/defer.d.ts | 1 + .../node_modules/rxjs/observable/defer.js | 7 + .../node_modules/rxjs/observable/defer.js.map | 1 + .../rxjs/observable/dom/AjaxObservable.d.ts | 1 + .../rxjs/observable/dom/AjaxObservable.js | 7 + .../rxjs/observable/dom/AjaxObservable.js.map | 1 + .../rxjs/observable/dom/WebSocketSubject.d.ts | 1 + .../rxjs/observable/dom/WebSocketSubject.js | 7 + .../observable/dom/WebSocketSubject.js.map | 1 + .../rxjs/observable/dom/ajax.d.ts | 1 + .../node_modules/rxjs/observable/dom/ajax.js | 7 + .../rxjs/observable/dom/ajax.js.map | 1 + .../rxjs/observable/dom/webSocket.d.ts | 1 + .../rxjs/observable/dom/webSocket.js | 7 + .../rxjs/observable/dom/webSocket.js.map | 1 + .../node_modules/rxjs/observable/empty.d.ts | 1 + .../node_modules/rxjs/observable/empty.js | 7 + .../node_modules/rxjs/observable/empty.js.map | 1 + .../rxjs/observable/forkJoin.d.ts | 1 + .../node_modules/rxjs/observable/forkJoin.js | 7 + .../rxjs/observable/forkJoin.js.map | 1 + .../node_modules/rxjs/observable/from.d.ts | 1 + .../node_modules/rxjs/observable/from.js | 7 + .../node_modules/rxjs/observable/from.js.map | 1 + .../rxjs/observable/fromArray.d.ts | 1 + .../node_modules/rxjs/observable/fromArray.js | 7 + .../rxjs/observable/fromArray.js.map | 1 + .../rxjs/observable/fromEvent.d.ts | 1 + .../node_modules/rxjs/observable/fromEvent.js | 7 + .../rxjs/observable/fromEvent.js.map | 1 + .../rxjs/observable/fromEventPattern.d.ts | 1 + .../rxjs/observable/fromEventPattern.js | 7 + .../rxjs/observable/fromEventPattern.js.map | 1 + .../rxjs/observable/fromIterable.d.ts | 1 + .../rxjs/observable/fromIterable.js | 7 + .../rxjs/observable/fromIterable.js.map | 1 + .../rxjs/observable/fromPromise.d.ts | 1 + .../rxjs/observable/fromPromise.js | 7 + .../rxjs/observable/fromPromise.js.map | 1 + .../rxjs/observable/generate.d.ts | 1 + .../node_modules/rxjs/observable/generate.js | 7 + .../rxjs/observable/generate.js.map | 1 + .../node_modules/rxjs/observable/if.d.ts | 1 + .../node_modules/rxjs/observable/if.js | 7 + .../node_modules/rxjs/observable/if.js.map | 1 + .../rxjs/observable/interval.d.ts | 1 + .../node_modules/rxjs/observable/interval.js | 7 + .../rxjs/observable/interval.js.map | 1 + .../node_modules/rxjs/observable/merge.d.ts | 1 + .../node_modules/rxjs/observable/merge.js | 7 + .../node_modules/rxjs/observable/merge.js.map | 1 + .../node_modules/rxjs/observable/never.d.ts | 1 + .../node_modules/rxjs/observable/never.js | 7 + .../node_modules/rxjs/observable/never.js.map | 1 + .../node_modules/rxjs/observable/of.d.ts | 1 + .../node_modules/rxjs/observable/of.js | 7 + .../node_modules/rxjs/observable/of.js.map | 1 + .../rxjs/observable/onErrorResumeNext.d.ts | 1 + .../rxjs/observable/onErrorResumeNext.js | 7 + .../rxjs/observable/onErrorResumeNext.js.map | 1 + .../node_modules/rxjs/observable/pairs.d.ts | 1 + .../node_modules/rxjs/observable/pairs.js | 7 + .../node_modules/rxjs/observable/pairs.js.map | 1 + .../node_modules/rxjs/observable/race.d.ts | 1 + .../node_modules/rxjs/observable/race.js | 7 + .../node_modules/rxjs/observable/race.js.map | 1 + .../node_modules/rxjs/observable/range.d.ts | 1 + .../node_modules/rxjs/observable/range.js | 7 + .../node_modules/rxjs/observable/range.js.map | 1 + .../node_modules/rxjs/observable/throw.d.ts | 1 + .../node_modules/rxjs/observable/throw.js | 7 + .../node_modules/rxjs/observable/throw.js.map | 1 + .../node_modules/rxjs/observable/timer.d.ts | 1 + .../node_modules/rxjs/observable/timer.js | 7 + .../node_modules/rxjs/observable/timer.js.map | 1 + .../node_modules/rxjs/observable/using.d.ts | 1 + .../node_modules/rxjs/observable/using.js | 7 + .../node_modules/rxjs/observable/using.js.map | 1 + .../node_modules/rxjs/observable/zip.d.ts | 1 + .../node_modules/rxjs/observable/zip.js | 7 + .../node_modules/rxjs/observable/zip.js.map | 1 + .../node_modules/rxjs/operator/audit.d.ts | 1 + .../node_modules/rxjs/operator/audit.js | 7 + .../node_modules/rxjs/operator/audit.js.map | 1 + .../node_modules/rxjs/operator/auditTime.d.ts | 1 + .../node_modules/rxjs/operator/auditTime.js | 7 + .../rxjs/operator/auditTime.js.map | 1 + .../node_modules/rxjs/operator/buffer.d.ts | 1 + .../node_modules/rxjs/operator/buffer.js | 7 + .../node_modules/rxjs/operator/buffer.js.map | 1 + .../rxjs/operator/bufferCount.d.ts | 1 + .../node_modules/rxjs/operator/bufferCount.js | 7 + .../rxjs/operator/bufferCount.js.map | 1 + .../rxjs/operator/bufferTime.d.ts | 1 + .../node_modules/rxjs/operator/bufferTime.js | 7 + .../rxjs/operator/bufferTime.js.map | 1 + .../rxjs/operator/bufferToggle.d.ts | 1 + .../rxjs/operator/bufferToggle.js | 7 + .../rxjs/operator/bufferToggle.js.map | 1 + .../rxjs/operator/bufferWhen.d.ts | 1 + .../node_modules/rxjs/operator/bufferWhen.js | 7 + .../rxjs/operator/bufferWhen.js.map | 1 + .../node_modules/rxjs/operator/catch.d.ts | 1 + .../node_modules/rxjs/operator/catch.js | 7 + .../node_modules/rxjs/operator/catch.js.map | 1 + .../rxjs/operator/combineAll.d.ts | 1 + .../node_modules/rxjs/operator/combineAll.js | 7 + .../rxjs/operator/combineAll.js.map | 1 + .../rxjs/operator/combineLatest.d.ts | 1 + .../rxjs/operator/combineLatest.js | 7 + .../rxjs/operator/combineLatest.js.map | 1 + .../node_modules/rxjs/operator/concat.d.ts | 1 + .../node_modules/rxjs/operator/concat.js | 7 + .../node_modules/rxjs/operator/concat.js.map | 1 + .../node_modules/rxjs/operator/concatAll.d.ts | 1 + .../node_modules/rxjs/operator/concatAll.js | 7 + .../rxjs/operator/concatAll.js.map | 1 + .../node_modules/rxjs/operator/concatMap.d.ts | 1 + .../node_modules/rxjs/operator/concatMap.js | 7 + .../rxjs/operator/concatMap.js.map | 1 + .../rxjs/operator/concatMapTo.d.ts | 1 + .../node_modules/rxjs/operator/concatMapTo.js | 7 + .../rxjs/operator/concatMapTo.js.map | 1 + .../node_modules/rxjs/operator/count.d.ts | 1 + .../node_modules/rxjs/operator/count.js | 7 + .../node_modules/rxjs/operator/count.js.map | 1 + .../node_modules/rxjs/operator/debounce.d.ts | 1 + .../node_modules/rxjs/operator/debounce.js | 7 + .../rxjs/operator/debounce.js.map | 1 + .../rxjs/operator/debounceTime.d.ts | 1 + .../rxjs/operator/debounceTime.js | 7 + .../rxjs/operator/debounceTime.js.map | 1 + .../rxjs/operator/defaultIfEmpty.d.ts | 1 + .../rxjs/operator/defaultIfEmpty.js | 7 + .../rxjs/operator/defaultIfEmpty.js.map | 1 + .../node_modules/rxjs/operator/delay.d.ts | 1 + .../node_modules/rxjs/operator/delay.js | 7 + .../node_modules/rxjs/operator/delay.js.map | 1 + .../node_modules/rxjs/operator/delayWhen.d.ts | 1 + .../node_modules/rxjs/operator/delayWhen.js | 7 + .../rxjs/operator/delayWhen.js.map | 1 + .../rxjs/operator/dematerialize.d.ts | 1 + .../rxjs/operator/dematerialize.js | 7 + .../rxjs/operator/dematerialize.js.map | 1 + .../node_modules/rxjs/operator/distinct.d.ts | 1 + .../node_modules/rxjs/operator/distinct.js | 7 + .../rxjs/operator/distinct.js.map | 1 + .../rxjs/operator/distinctUntilChanged.d.ts | 1 + .../rxjs/operator/distinctUntilChanged.js | 7 + .../rxjs/operator/distinctUntilChanged.js.map | 1 + .../operator/distinctUntilKeyChanged.d.ts | 1 + .../rxjs/operator/distinctUntilKeyChanged.js | 7 + .../operator/distinctUntilKeyChanged.js.map | 1 + .../node_modules/rxjs/operator/do.d.ts | 1 + .../node_modules/rxjs/operator/do.js | 7 + .../node_modules/rxjs/operator/do.js.map | 1 + .../node_modules/rxjs/operator/elementAt.d.ts | 1 + .../node_modules/rxjs/operator/elementAt.js | 7 + .../rxjs/operator/elementAt.js.map | 1 + .../node_modules/rxjs/operator/every.d.ts | 1 + .../node_modules/rxjs/operator/every.js | 7 + .../node_modules/rxjs/operator/every.js.map | 1 + .../node_modules/rxjs/operator/exhaust.d.ts | 1 + .../node_modules/rxjs/operator/exhaust.js | 7 + .../node_modules/rxjs/operator/exhaust.js.map | 1 + .../rxjs/operator/exhaustMap.d.ts | 1 + .../node_modules/rxjs/operator/exhaustMap.js | 7 + .../rxjs/operator/exhaustMap.js.map | 1 + .../node_modules/rxjs/operator/expand.d.ts | 1 + .../node_modules/rxjs/operator/expand.js | 7 + .../node_modules/rxjs/operator/expand.js.map | 1 + .../node_modules/rxjs/operator/filter.d.ts | 1 + .../node_modules/rxjs/operator/filter.js | 7 + .../node_modules/rxjs/operator/filter.js.map | 1 + .../node_modules/rxjs/operator/finally.d.ts | 1 + .../node_modules/rxjs/operator/finally.js | 7 + .../node_modules/rxjs/operator/finally.js.map | 1 + .../node_modules/rxjs/operator/find.d.ts | 1 + .../node_modules/rxjs/operator/find.js | 7 + .../node_modules/rxjs/operator/find.js.map | 1 + .../node_modules/rxjs/operator/findIndex.d.ts | 1 + .../node_modules/rxjs/operator/findIndex.js | 7 + .../rxjs/operator/findIndex.js.map | 1 + .../node_modules/rxjs/operator/first.d.ts | 1 + .../node_modules/rxjs/operator/first.js | 7 + .../node_modules/rxjs/operator/first.js.map | 1 + .../node_modules/rxjs/operator/groupBy.d.ts | 1 + .../node_modules/rxjs/operator/groupBy.js | 7 + .../node_modules/rxjs/operator/groupBy.js.map | 1 + .../rxjs/operator/ignoreElements.d.ts | 1 + .../rxjs/operator/ignoreElements.js | 7 + .../rxjs/operator/ignoreElements.js.map | 1 + .../node_modules/rxjs/operator/isEmpty.d.ts | 1 + .../node_modules/rxjs/operator/isEmpty.js | 7 + .../node_modules/rxjs/operator/isEmpty.js.map | 1 + .../node_modules/rxjs/operator/last.d.ts | 1 + .../node_modules/rxjs/operator/last.js | 7 + .../node_modules/rxjs/operator/last.js.map | 1 + .../node_modules/rxjs/operator/let.d.ts | 1 + .../node_modules/rxjs/operator/let.js | 7 + .../node_modules/rxjs/operator/let.js.map | 1 + .../node_modules/rxjs/operator/map.d.ts | 1 + .../node_modules/rxjs/operator/map.js | 7 + .../node_modules/rxjs/operator/map.js.map | 1 + .../node_modules/rxjs/operator/mapTo.d.ts | 1 + .../node_modules/rxjs/operator/mapTo.js | 7 + .../node_modules/rxjs/operator/mapTo.js.map | 1 + .../rxjs/operator/materialize.d.ts | 1 + .../node_modules/rxjs/operator/materialize.js | 7 + .../rxjs/operator/materialize.js.map | 1 + .../node_modules/rxjs/operator/max.d.ts | 1 + .../node_modules/rxjs/operator/max.js | 7 + .../node_modules/rxjs/operator/max.js.map | 1 + .../node_modules/rxjs/operator/merge.d.ts | 1 + .../node_modules/rxjs/operator/merge.js | 7 + .../node_modules/rxjs/operator/merge.js.map | 1 + .../node_modules/rxjs/operator/mergeAll.d.ts | 1 + .../node_modules/rxjs/operator/mergeAll.js | 7 + .../rxjs/operator/mergeAll.js.map | 1 + .../node_modules/rxjs/operator/mergeMap.d.ts | 1 + .../node_modules/rxjs/operator/mergeMap.js | 7 + .../rxjs/operator/mergeMap.js.map | 1 + .../rxjs/operator/mergeMapTo.d.ts | 1 + .../node_modules/rxjs/operator/mergeMapTo.js | 7 + .../rxjs/operator/mergeMapTo.js.map | 1 + .../node_modules/rxjs/operator/mergeScan.d.ts | 1 + .../node_modules/rxjs/operator/mergeScan.js | 7 + .../rxjs/operator/mergeScan.js.map | 1 + .../node_modules/rxjs/operator/min.d.ts | 1 + .../node_modules/rxjs/operator/min.js | 7 + .../node_modules/rxjs/operator/min.js.map | 1 + .../node_modules/rxjs/operator/multicast.d.ts | 1 + .../node_modules/rxjs/operator/multicast.js | 7 + .../rxjs/operator/multicast.js.map | 1 + .../node_modules/rxjs/operator/observeOn.d.ts | 1 + .../node_modules/rxjs/operator/observeOn.js | 7 + .../rxjs/operator/observeOn.js.map | 1 + .../rxjs/operator/onErrorResumeNext.d.ts | 1 + .../rxjs/operator/onErrorResumeNext.js | 7 + .../rxjs/operator/onErrorResumeNext.js.map | 1 + .../node_modules/rxjs/operator/pairwise.d.ts | 1 + .../node_modules/rxjs/operator/pairwise.js | 7 + .../rxjs/operator/pairwise.js.map | 1 + .../node_modules/rxjs/operator/partition.d.ts | 1 + .../node_modules/rxjs/operator/partition.js | 7 + .../rxjs/operator/partition.js.map | 1 + .../node_modules/rxjs/operator/pluck.d.ts | 1 + .../node_modules/rxjs/operator/pluck.js | 7 + .../node_modules/rxjs/operator/pluck.js.map | 1 + .../node_modules/rxjs/operator/publish.d.ts | 1 + .../node_modules/rxjs/operator/publish.js | 7 + .../node_modules/rxjs/operator/publish.js.map | 1 + .../rxjs/operator/publishBehavior.d.ts | 1 + .../rxjs/operator/publishBehavior.js | 7 + .../rxjs/operator/publishBehavior.js.map | 1 + .../rxjs/operator/publishLast.d.ts | 1 + .../node_modules/rxjs/operator/publishLast.js | 7 + .../rxjs/operator/publishLast.js.map | 1 + .../rxjs/operator/publishReplay.d.ts | 1 + .../rxjs/operator/publishReplay.js | 7 + .../rxjs/operator/publishReplay.js.map | 1 + .../node_modules/rxjs/operator/race.d.ts | 1 + .../node_modules/rxjs/operator/race.js | 7 + .../node_modules/rxjs/operator/race.js.map | 1 + .../node_modules/rxjs/operator/reduce.d.ts | 1 + .../node_modules/rxjs/operator/reduce.js | 7 + .../node_modules/rxjs/operator/reduce.js.map | 1 + .../node_modules/rxjs/operator/repeat.d.ts | 1 + .../node_modules/rxjs/operator/repeat.js | 7 + .../node_modules/rxjs/operator/repeat.js.map | 1 + .../rxjs/operator/repeatWhen.d.ts | 1 + .../node_modules/rxjs/operator/repeatWhen.js | 7 + .../rxjs/operator/repeatWhen.js.map | 1 + .../node_modules/rxjs/operator/retry.d.ts | 1 + .../node_modules/rxjs/operator/retry.js | 7 + .../node_modules/rxjs/operator/retry.js.map | 1 + .../node_modules/rxjs/operator/retryWhen.d.ts | 1 + .../node_modules/rxjs/operator/retryWhen.js | 7 + .../rxjs/operator/retryWhen.js.map | 1 + .../node_modules/rxjs/operator/sample.d.ts | 1 + .../node_modules/rxjs/operator/sample.js | 7 + .../node_modules/rxjs/operator/sample.js.map | 1 + .../rxjs/operator/sampleTime.d.ts | 1 + .../node_modules/rxjs/operator/sampleTime.js | 7 + .../rxjs/operator/sampleTime.js.map | 1 + .../node_modules/rxjs/operator/scan.d.ts | 1 + .../node_modules/rxjs/operator/scan.js | 7 + .../node_modules/rxjs/operator/scan.js.map | 1 + .../rxjs/operator/sequenceEqual.d.ts | 1 + .../rxjs/operator/sequenceEqual.js | 7 + .../rxjs/operator/sequenceEqual.js.map | 1 + .../node_modules/rxjs/operator/share.d.ts | 1 + .../node_modules/rxjs/operator/share.js | 7 + .../node_modules/rxjs/operator/share.js.map | 1 + .../rxjs/operator/shareReplay.d.ts | 1 + .../node_modules/rxjs/operator/shareReplay.js | 7 + .../rxjs/operator/shareReplay.js.map | 1 + .../node_modules/rxjs/operator/single.d.ts | 1 + .../node_modules/rxjs/operator/single.js | 7 + .../node_modules/rxjs/operator/single.js.map | 1 + .../node_modules/rxjs/operator/skip.d.ts | 1 + .../node_modules/rxjs/operator/skip.js | 7 + .../node_modules/rxjs/operator/skip.js.map | 1 + .../node_modules/rxjs/operator/skipLast.d.ts | 1 + .../node_modules/rxjs/operator/skipLast.js | 7 + .../rxjs/operator/skipLast.js.map | 1 + .../node_modules/rxjs/operator/skipUntil.d.ts | 1 + .../node_modules/rxjs/operator/skipUntil.js | 7 + .../rxjs/operator/skipUntil.js.map | 1 + .../node_modules/rxjs/operator/skipWhile.d.ts | 1 + .../node_modules/rxjs/operator/skipWhile.js | 7 + .../rxjs/operator/skipWhile.js.map | 1 + .../node_modules/rxjs/operator/startWith.d.ts | 1 + .../node_modules/rxjs/operator/startWith.js | 7 + .../rxjs/operator/startWith.js.map | 1 + .../rxjs/operator/subscribeOn.d.ts | 1 + .../node_modules/rxjs/operator/subscribeOn.js | 7 + .../rxjs/operator/subscribeOn.js.map | 1 + .../node_modules/rxjs/operator/switch.d.ts | 1 + .../node_modules/rxjs/operator/switch.js | 7 + .../node_modules/rxjs/operator/switch.js.map | 1 + .../node_modules/rxjs/operator/switchMap.d.ts | 1 + .../node_modules/rxjs/operator/switchMap.js | 7 + .../rxjs/operator/switchMap.js.map | 1 + .../rxjs/operator/switchMapTo.d.ts | 1 + .../node_modules/rxjs/operator/switchMapTo.js | 7 + .../rxjs/operator/switchMapTo.js.map | 1 + .../node_modules/rxjs/operator/take.d.ts | 1 + .../node_modules/rxjs/operator/take.js | 7 + .../node_modules/rxjs/operator/take.js.map | 1 + .../node_modules/rxjs/operator/takeLast.d.ts | 1 + .../node_modules/rxjs/operator/takeLast.js | 7 + .../rxjs/operator/takeLast.js.map | 1 + .../node_modules/rxjs/operator/takeUntil.d.ts | 1 + .../node_modules/rxjs/operator/takeUntil.js | 7 + .../rxjs/operator/takeUntil.js.map | 1 + .../node_modules/rxjs/operator/takeWhile.d.ts | 1 + .../node_modules/rxjs/operator/takeWhile.js | 7 + .../rxjs/operator/takeWhile.js.map | 1 + .../node_modules/rxjs/operator/throttle.d.ts | 1 + .../node_modules/rxjs/operator/throttle.js | 7 + .../rxjs/operator/throttle.js.map | 1 + .../rxjs/operator/throttleTime.d.ts | 1 + .../rxjs/operator/throttleTime.js | 7 + .../rxjs/operator/throttleTime.js.map | 1 + .../rxjs/operator/timeInterval.d.ts | 1 + .../rxjs/operator/timeInterval.js | 7 + .../rxjs/operator/timeInterval.js.map | 1 + .../node_modules/rxjs/operator/timeout.d.ts | 1 + .../node_modules/rxjs/operator/timeout.js | 7 + .../node_modules/rxjs/operator/timeout.js.map | 1 + .../rxjs/operator/timeoutWith.d.ts | 1 + .../node_modules/rxjs/operator/timeoutWith.js | 7 + .../rxjs/operator/timeoutWith.js.map | 1 + .../node_modules/rxjs/operator/timestamp.d.ts | 1 + .../node_modules/rxjs/operator/timestamp.js | 7 + .../rxjs/operator/timestamp.js.map | 1 + .../node_modules/rxjs/operator/toArray.d.ts | 1 + .../node_modules/rxjs/operator/toArray.js | 7 + .../node_modules/rxjs/operator/toArray.js.map | 1 + .../node_modules/rxjs/operator/toPromise.d.ts | 1 + .../node_modules/rxjs/operator/toPromise.js | 7 + .../rxjs/operator/toPromise.js.map | 1 + .../node_modules/rxjs/operator/window.d.ts | 1 + .../node_modules/rxjs/operator/window.js | 7 + .../node_modules/rxjs/operator/window.js.map | 1 + .../rxjs/operator/windowCount.d.ts | 1 + .../node_modules/rxjs/operator/windowCount.js | 7 + .../rxjs/operator/windowCount.js.map | 1 + .../rxjs/operator/windowTime.d.ts | 1 + .../node_modules/rxjs/operator/windowTime.js | 7 + .../rxjs/operator/windowTime.js.map | 1 + .../rxjs/operator/windowToggle.d.ts | 1 + .../rxjs/operator/windowToggle.js | 7 + .../rxjs/operator/windowToggle.js.map | 1 + .../rxjs/operator/windowWhen.d.ts | 1 + .../node_modules/rxjs/operator/windowWhen.js | 7 + .../rxjs/operator/windowWhen.js.map | 1 + .../rxjs/operator/withLatestFrom.d.ts | 1 + .../rxjs/operator/withLatestFrom.js | 7 + .../rxjs/operator/withLatestFrom.js.map | 1 + .../node_modules/rxjs/operator/zip.d.ts | 1 + .../node_modules/rxjs/operator/zip.js | 7 + .../node_modules/rxjs/operator/zip.js.map | 1 + .../node_modules/rxjs/operator/zipAll.d.ts | 1 + .../node_modules/rxjs/operator/zipAll.js | 7 + .../node_modules/rxjs/operator/zipAll.js.map | 1 + .../node_modules/rxjs/operators/audit.d.ts | 1 + .../node_modules/rxjs/operators/audit.js | 7 + .../node_modules/rxjs/operators/audit.js.map | 1 + .../rxjs/operators/auditTime.d.ts | 1 + .../node_modules/rxjs/operators/auditTime.js | 7 + .../rxjs/operators/auditTime.js.map | 1 + .../node_modules/rxjs/operators/buffer.d.ts | 1 + .../node_modules/rxjs/operators/buffer.js | 7 + .../node_modules/rxjs/operators/buffer.js.map | 1 + .../rxjs/operators/bufferCount.d.ts | 1 + .../rxjs/operators/bufferCount.js | 7 + .../rxjs/operators/bufferCount.js.map | 1 + .../rxjs/operators/bufferTime.d.ts | 1 + .../node_modules/rxjs/operators/bufferTime.js | 7 + .../rxjs/operators/bufferTime.js.map | 1 + .../rxjs/operators/bufferToggle.d.ts | 1 + .../rxjs/operators/bufferToggle.js | 7 + .../rxjs/operators/bufferToggle.js.map | 1 + .../rxjs/operators/bufferWhen.d.ts | 1 + .../node_modules/rxjs/operators/bufferWhen.js | 7 + .../rxjs/operators/bufferWhen.js.map | 1 + .../rxjs/operators/catchError.d.ts | 1 + .../node_modules/rxjs/operators/catchError.js | 7 + .../rxjs/operators/catchError.js.map | 1 + .../rxjs/operators/combineAll.d.ts | 1 + .../node_modules/rxjs/operators/combineAll.js | 7 + .../rxjs/operators/combineAll.js.map | 1 + .../rxjs/operators/combineLatest.d.ts | 1 + .../rxjs/operators/combineLatest.js | 7 + .../rxjs/operators/combineLatest.js.map | 1 + .../node_modules/rxjs/operators/concat.d.ts | 1 + .../node_modules/rxjs/operators/concat.js | 7 + .../node_modules/rxjs/operators/concat.js.map | 1 + .../rxjs/operators/concatAll.d.ts | 1 + .../node_modules/rxjs/operators/concatAll.js | 7 + .../rxjs/operators/concatAll.js.map | 1 + .../rxjs/operators/concatMap.d.ts | 1 + .../node_modules/rxjs/operators/concatMap.js | 7 + .../rxjs/operators/concatMap.js.map | 1 + .../rxjs/operators/concatMapTo.d.ts | 1 + .../rxjs/operators/concatMapTo.js | 7 + .../rxjs/operators/concatMapTo.js.map | 1 + .../node_modules/rxjs/operators/count.d.ts | 1 + .../node_modules/rxjs/operators/count.js | 7 + .../node_modules/rxjs/operators/count.js.map | 1 + .../node_modules/rxjs/operators/debounce.d.ts | 1 + .../node_modules/rxjs/operators/debounce.js | 7 + .../rxjs/operators/debounce.js.map | 1 + .../rxjs/operators/debounceTime.d.ts | 1 + .../rxjs/operators/debounceTime.js | 7 + .../rxjs/operators/debounceTime.js.map | 1 + .../rxjs/operators/defaultIfEmpty.d.ts | 1 + .../rxjs/operators/defaultIfEmpty.js | 7 + .../rxjs/operators/defaultIfEmpty.js.map | 1 + .../node_modules/rxjs/operators/delay.d.ts | 1 + .../node_modules/rxjs/operators/delay.js | 7 + .../node_modules/rxjs/operators/delay.js.map | 1 + .../rxjs/operators/delayWhen.d.ts | 1 + .../node_modules/rxjs/operators/delayWhen.js | 7 + .../rxjs/operators/delayWhen.js.map | 1 + .../rxjs/operators/dematerialize.d.ts | 1 + .../rxjs/operators/dematerialize.js | 7 + .../rxjs/operators/dematerialize.js.map | 1 + .../node_modules/rxjs/operators/distinct.d.ts | 1 + .../node_modules/rxjs/operators/distinct.js | 7 + .../rxjs/operators/distinct.js.map | 1 + .../rxjs/operators/distinctUntilChanged.d.ts | 1 + .../rxjs/operators/distinctUntilChanged.js | 7 + .../operators/distinctUntilChanged.js.map | 1 + .../operators/distinctUntilKeyChanged.d.ts | 1 + .../rxjs/operators/distinctUntilKeyChanged.js | 7 + .../operators/distinctUntilKeyChanged.js.map | 1 + .../rxjs/operators/elementAt.d.ts | 1 + .../node_modules/rxjs/operators/elementAt.js | 7 + .../rxjs/operators/elementAt.js.map | 1 + .../node_modules/rxjs/operators/every.d.ts | 1 + .../node_modules/rxjs/operators/every.js | 7 + .../node_modules/rxjs/operators/every.js.map | 1 + .../node_modules/rxjs/operators/exhaust.d.ts | 1 + .../node_modules/rxjs/operators/exhaust.js | 7 + .../rxjs/operators/exhaust.js.map | 1 + .../rxjs/operators/exhaustMap.d.ts | 1 + .../node_modules/rxjs/operators/exhaustMap.js | 7 + .../rxjs/operators/exhaustMap.js.map | 1 + .../node_modules/rxjs/operators/expand.d.ts | 1 + .../node_modules/rxjs/operators/expand.js | 7 + .../node_modules/rxjs/operators/expand.js.map | 1 + .../node_modules/rxjs/operators/filter.d.ts | 1 + .../node_modules/rxjs/operators/filter.js | 7 + .../node_modules/rxjs/operators/filter.js.map | 1 + .../node_modules/rxjs/operators/finalize.d.ts | 1 + .../node_modules/rxjs/operators/finalize.js | 7 + .../rxjs/operators/finalize.js.map | 1 + .../node_modules/rxjs/operators/find.d.ts | 1 + .../node_modules/rxjs/operators/find.js | 7 + .../node_modules/rxjs/operators/find.js.map | 1 + .../rxjs/operators/findIndex.d.ts | 1 + .../node_modules/rxjs/operators/findIndex.js | 7 + .../rxjs/operators/findIndex.js.map | 1 + .../node_modules/rxjs/operators/first.d.ts | 1 + .../node_modules/rxjs/operators/first.js | 7 + .../node_modules/rxjs/operators/first.js.map | 1 + .../node_modules/rxjs/operators/groupBy.d.ts | 1 + .../node_modules/rxjs/operators/groupBy.js | 7 + .../rxjs/operators/groupBy.js.map | 1 + .../rxjs/operators/ignoreElements.d.ts | 1 + .../rxjs/operators/ignoreElements.js | 7 + .../rxjs/operators/ignoreElements.js.map | 1 + .../node_modules/rxjs/operators/index.d.ts | 104 + .../node_modules/rxjs/operators/index.js | 211 + .../node_modules/rxjs/operators/index.js.map | 1 + .../node_modules/rxjs/operators/isEmpty.d.ts | 1 + .../node_modules/rxjs/operators/isEmpty.js | 7 + .../rxjs/operators/isEmpty.js.map | 1 + .../node_modules/rxjs/operators/last.d.ts | 1 + .../node_modules/rxjs/operators/last.js | 7 + .../node_modules/rxjs/operators/last.js.map | 1 + .../node_modules/rxjs/operators/map.d.ts | 1 + .../node_modules/rxjs/operators/map.js | 7 + .../node_modules/rxjs/operators/map.js.map | 1 + .../node_modules/rxjs/operators/mapTo.d.ts | 1 + .../node_modules/rxjs/operators/mapTo.js | 7 + .../node_modules/rxjs/operators/mapTo.js.map | 1 + .../rxjs/operators/materialize.d.ts | 1 + .../rxjs/operators/materialize.js | 7 + .../rxjs/operators/materialize.js.map | 1 + .../node_modules/rxjs/operators/max.d.ts | 1 + .../node_modules/rxjs/operators/max.js | 7 + .../node_modules/rxjs/operators/max.js.map | 1 + .../node_modules/rxjs/operators/merge.d.ts | 1 + .../node_modules/rxjs/operators/merge.js | 7 + .../node_modules/rxjs/operators/merge.js.map | 1 + .../node_modules/rxjs/operators/mergeAll.d.ts | 1 + .../node_modules/rxjs/operators/mergeAll.js | 7 + .../rxjs/operators/mergeAll.js.map | 1 + .../node_modules/rxjs/operators/mergeMap.d.ts | 1 + .../node_modules/rxjs/operators/mergeMap.js | 7 + .../rxjs/operators/mergeMap.js.map | 1 + .../rxjs/operators/mergeMapTo.d.ts | 1 + .../node_modules/rxjs/operators/mergeMapTo.js | 7 + .../rxjs/operators/mergeMapTo.js.map | 1 + .../rxjs/operators/mergeScan.d.ts | 1 + .../node_modules/rxjs/operators/mergeScan.js | 7 + .../rxjs/operators/mergeScan.js.map | 1 + .../node_modules/rxjs/operators/min.d.ts | 1 + .../node_modules/rxjs/operators/min.js | 7 + .../node_modules/rxjs/operators/min.js.map | 1 + .../rxjs/operators/multicast.d.ts | 1 + .../node_modules/rxjs/operators/multicast.js | 7 + .../rxjs/operators/multicast.js.map | 1 + .../rxjs/operators/observeOn.d.ts | 1 + .../node_modules/rxjs/operators/observeOn.js | 7 + .../rxjs/operators/observeOn.js.map | 1 + .../rxjs/operators/onErrorResumeNext.d.ts | 1 + .../rxjs/operators/onErrorResumeNext.js | 7 + .../rxjs/operators/onErrorResumeNext.js.map | 1 + .../node_modules/rxjs/operators/package.json | 8 + .../node_modules/rxjs/operators/pairwise.d.ts | 1 + .../node_modules/rxjs/operators/pairwise.js | 7 + .../rxjs/operators/pairwise.js.map | 1 + .../rxjs/operators/partition.d.ts | 1 + .../node_modules/rxjs/operators/partition.js | 7 + .../rxjs/operators/partition.js.map | 1 + .../node_modules/rxjs/operators/pluck.d.ts | 1 + .../node_modules/rxjs/operators/pluck.js | 7 + .../node_modules/rxjs/operators/pluck.js.map | 1 + .../node_modules/rxjs/operators/publish.d.ts | 1 + .../node_modules/rxjs/operators/publish.js | 7 + .../rxjs/operators/publish.js.map | 1 + .../rxjs/operators/publishBehavior.d.ts | 1 + .../rxjs/operators/publishBehavior.js | 7 + .../rxjs/operators/publishBehavior.js.map | 1 + .../rxjs/operators/publishLast.d.ts | 1 + .../rxjs/operators/publishLast.js | 7 + .../rxjs/operators/publishLast.js.map | 1 + .../rxjs/operators/publishReplay.d.ts | 1 + .../rxjs/operators/publishReplay.js | 7 + .../rxjs/operators/publishReplay.js.map | 1 + .../node_modules/rxjs/operators/race.d.ts | 1 + .../node_modules/rxjs/operators/race.js | 7 + .../node_modules/rxjs/operators/race.js.map | 1 + .../node_modules/rxjs/operators/reduce.d.ts | 1 + .../node_modules/rxjs/operators/reduce.js | 7 + .../node_modules/rxjs/operators/reduce.js.map | 1 + .../node_modules/rxjs/operators/refCount.d.ts | 1 + .../node_modules/rxjs/operators/refCount.js | 7 + .../rxjs/operators/refCount.js.map | 1 + .../node_modules/rxjs/operators/repeat.d.ts | 1 + .../node_modules/rxjs/operators/repeat.js | 7 + .../node_modules/rxjs/operators/repeat.js.map | 1 + .../rxjs/operators/repeatWhen.d.ts | 1 + .../node_modules/rxjs/operators/repeatWhen.js | 7 + .../rxjs/operators/repeatWhen.js.map | 1 + .../node_modules/rxjs/operators/retry.d.ts | 1 + .../node_modules/rxjs/operators/retry.js | 7 + .../node_modules/rxjs/operators/retry.js.map | 1 + .../rxjs/operators/retryWhen.d.ts | 1 + .../node_modules/rxjs/operators/retryWhen.js | 7 + .../rxjs/operators/retryWhen.js.map | 1 + .../node_modules/rxjs/operators/sample.d.ts | 1 + .../node_modules/rxjs/operators/sample.js | 7 + .../node_modules/rxjs/operators/sample.js.map | 1 + .../rxjs/operators/sampleTime.d.ts | 1 + .../node_modules/rxjs/operators/sampleTime.js | 7 + .../rxjs/operators/sampleTime.js.map | 1 + .../node_modules/rxjs/operators/scan.d.ts | 1 + .../node_modules/rxjs/operators/scan.js | 7 + .../node_modules/rxjs/operators/scan.js.map | 1 + .../rxjs/operators/sequenceEqual.d.ts | 1 + .../rxjs/operators/sequenceEqual.js | 7 + .../rxjs/operators/sequenceEqual.js.map | 1 + .../node_modules/rxjs/operators/share.d.ts | 1 + .../node_modules/rxjs/operators/share.js | 7 + .../node_modules/rxjs/operators/share.js.map | 1 + .../rxjs/operators/shareReplay.d.ts | 1 + .../rxjs/operators/shareReplay.js | 7 + .../rxjs/operators/shareReplay.js.map | 1 + .../node_modules/rxjs/operators/single.d.ts | 1 + .../node_modules/rxjs/operators/single.js | 7 + .../node_modules/rxjs/operators/single.js.map | 1 + .../node_modules/rxjs/operators/skip.d.ts | 1 + .../node_modules/rxjs/operators/skip.js | 7 + .../node_modules/rxjs/operators/skip.js.map | 1 + .../node_modules/rxjs/operators/skipLast.d.ts | 1 + .../node_modules/rxjs/operators/skipLast.js | 7 + .../rxjs/operators/skipLast.js.map | 1 + .../rxjs/operators/skipUntil.d.ts | 1 + .../node_modules/rxjs/operators/skipUntil.js | 7 + .../rxjs/operators/skipUntil.js.map | 1 + .../rxjs/operators/skipWhile.d.ts | 1 + .../node_modules/rxjs/operators/skipWhile.js | 7 + .../rxjs/operators/skipWhile.js.map | 1 + .../rxjs/operators/startWith.d.ts | 1 + .../node_modules/rxjs/operators/startWith.js | 7 + .../rxjs/operators/startWith.js.map | 1 + .../rxjs/operators/subscribeOn.d.ts | 1 + .../rxjs/operators/subscribeOn.js | 7 + .../rxjs/operators/subscribeOn.js.map | 1 + .../rxjs/operators/switchAll.d.ts | 1 + .../node_modules/rxjs/operators/switchAll.js | 7 + .../rxjs/operators/switchAll.js.map | 1 + .../rxjs/operators/switchMap.d.ts | 1 + .../node_modules/rxjs/operators/switchMap.js | 7 + .../rxjs/operators/switchMap.js.map | 1 + .../rxjs/operators/switchMapTo.d.ts | 1 + .../rxjs/operators/switchMapTo.js | 7 + .../rxjs/operators/switchMapTo.js.map | 1 + .../node_modules/rxjs/operators/take.d.ts | 1 + .../node_modules/rxjs/operators/take.js | 7 + .../node_modules/rxjs/operators/take.js.map | 1 + .../node_modules/rxjs/operators/takeLast.d.ts | 1 + .../node_modules/rxjs/operators/takeLast.js | 7 + .../rxjs/operators/takeLast.js.map | 1 + .../rxjs/operators/takeUntil.d.ts | 1 + .../node_modules/rxjs/operators/takeUntil.js | 7 + .../rxjs/operators/takeUntil.js.map | 1 + .../rxjs/operators/takeWhile.d.ts | 1 + .../node_modules/rxjs/operators/takeWhile.js | 7 + .../rxjs/operators/takeWhile.js.map | 1 + .../node_modules/rxjs/operators/tap.d.ts | 1 + .../node_modules/rxjs/operators/tap.js | 7 + .../node_modules/rxjs/operators/tap.js.map | 1 + .../node_modules/rxjs/operators/throttle.d.ts | 1 + .../node_modules/rxjs/operators/throttle.js | 7 + .../rxjs/operators/throttle.js.map | 1 + .../rxjs/operators/throttleTime.d.ts | 1 + .../rxjs/operators/throttleTime.js | 7 + .../rxjs/operators/throttleTime.js.map | 1 + .../rxjs/operators/throwIfEmpty.d.ts | 1 + .../rxjs/operators/throwIfEmpty.js | 7 + .../rxjs/operators/throwIfEmpty.js.map | 1 + .../rxjs/operators/timeInterval.d.ts | 1 + .../rxjs/operators/timeInterval.js | 7 + .../rxjs/operators/timeInterval.js.map | 1 + .../node_modules/rxjs/operators/timeout.d.ts | 1 + .../node_modules/rxjs/operators/timeout.js | 7 + .../rxjs/operators/timeout.js.map | 1 + .../rxjs/operators/timeoutWith.d.ts | 1 + .../rxjs/operators/timeoutWith.js | 7 + .../rxjs/operators/timeoutWith.js.map | 1 + .../rxjs/operators/timestamp.d.ts | 1 + .../node_modules/rxjs/operators/timestamp.js | 7 + .../rxjs/operators/timestamp.js.map | 1 + .../node_modules/rxjs/operators/toArray.d.ts | 1 + .../node_modules/rxjs/operators/toArray.js | 7 + .../rxjs/operators/toArray.js.map | 1 + .../node_modules/rxjs/operators/window.d.ts | 1 + .../node_modules/rxjs/operators/window.js | 7 + .../node_modules/rxjs/operators/window.js.map | 1 + .../rxjs/operators/windowCount.d.ts | 1 + .../rxjs/operators/windowCount.js | 7 + .../rxjs/operators/windowCount.js.map | 1 + .../rxjs/operators/windowTime.d.ts | 1 + .../node_modules/rxjs/operators/windowTime.js | 7 + .../rxjs/operators/windowTime.js.map | 1 + .../rxjs/operators/windowToggle.d.ts | 1 + .../rxjs/operators/windowToggle.js | 7 + .../rxjs/operators/windowToggle.js.map | 1 + .../rxjs/operators/windowWhen.d.ts | 1 + .../node_modules/rxjs/operators/windowWhen.js | 7 + .../rxjs/operators/windowWhen.js.map | 1 + .../rxjs/operators/withLatestFrom.d.ts | 1 + .../rxjs/operators/withLatestFrom.js | 7 + .../rxjs/operators/withLatestFrom.js.map | 1 + .../node_modules/rxjs/operators/zip.d.ts | 1 + .../node_modules/rxjs/operators/zip.js | 7 + .../node_modules/rxjs/operators/zip.js.map | 1 + .../node_modules/rxjs/operators/zipAll.d.ts | 1 + .../node_modules/rxjs/operators/zipAll.js | 7 + .../node_modules/rxjs/operators/zipAll.js.map | 1 + day1/cli-study/node_modules/rxjs/package.json | 208 + .../rxjs/scheduler/animationFrame.d.ts | 1 + .../rxjs/scheduler/animationFrame.js | 7 + .../rxjs/scheduler/animationFrame.js.map | 1 + .../node_modules/rxjs/scheduler/asap.d.ts | 1 + .../node_modules/rxjs/scheduler/asap.js | 7 + .../node_modules/rxjs/scheduler/asap.js.map | 1 + .../node_modules/rxjs/scheduler/async.d.ts | 1 + .../node_modules/rxjs/scheduler/async.js | 7 + .../node_modules/rxjs/scheduler/async.js.map | 1 + .../node_modules/rxjs/scheduler/queue.d.ts | 1 + .../node_modules/rxjs/scheduler/queue.js | 7 + .../node_modules/rxjs/scheduler/queue.js.map | 1 + .../node_modules/rxjs/src/AsyncSubject.ts | 1 + .../node_modules/rxjs/src/BehaviorSubject.ts | 1 + .../node_modules/rxjs/src/InnerSubscriber.ts | 1 + .../node_modules/rxjs/src/LICENSE.txt | 202 + .../node_modules/rxjs/src/MiscJSDoc.ts | 451 + .../node_modules/rxjs/src/Notification.ts | 1 + .../node_modules/rxjs/src/Observable.ts | 1 + .../node_modules/rxjs/src/Observer.ts | 1 + .../node_modules/rxjs/src/Operator.ts | 1 + .../node_modules/rxjs/src/OuterSubscriber.ts | 1 + .../cli-study/node_modules/rxjs/src/README.md | 147 + .../node_modules/rxjs/src/ReplaySubject.ts | 1 + .../node_modules/rxjs/src/Rx.global.js | 5 + day1/cli-study/node_modules/rxjs/src/Rx.ts | 2 + .../node_modules/rxjs/src/Scheduler.ts | 1 + .../node_modules/rxjs/src/Subject.ts | 1 + .../rxjs/src/SubjectSubscription.ts | 1 + .../node_modules/rxjs/src/Subscriber.ts | 1 + .../node_modules/rxjs/src/Subscription.ts | 1 + .../rxjs/src/add/observable/bindCallback.ts | 1 + .../src/add/observable/bindNodeCallback.ts | 1 + .../rxjs/src/add/observable/combineLatest.ts | 1 + .../rxjs/src/add/observable/concat.ts | 1 + .../rxjs/src/add/observable/defer.ts | 1 + .../rxjs/src/add/observable/dom/ajax.ts | 1 + .../rxjs/src/add/observable/dom/webSocket.ts | 1 + .../rxjs/src/add/observable/empty.ts | 1 + .../rxjs/src/add/observable/forkJoin.ts | 1 + .../rxjs/src/add/observable/from.ts | 1 + .../rxjs/src/add/observable/fromEvent.ts | 1 + .../src/add/observable/fromEventPattern.ts | 1 + .../rxjs/src/add/observable/fromPromise.ts | 1 + .../rxjs/src/add/observable/generate.ts | 1 + .../rxjs/src/add/observable/if.ts | 1 + .../rxjs/src/add/observable/interval.ts | 1 + .../rxjs/src/add/observable/merge.ts | 1 + .../rxjs/src/add/observable/never.ts | 1 + .../rxjs/src/add/observable/of.ts | 1 + .../src/add/observable/onErrorResumeNext.ts | 1 + .../rxjs/src/add/observable/pairs.ts | 1 + .../rxjs/src/add/observable/race.ts | 1 + .../rxjs/src/add/observable/range.ts | 1 + .../rxjs/src/add/observable/throw.ts | 1 + .../rxjs/src/add/observable/timer.ts | 1 + .../rxjs/src/add/observable/using.ts | 1 + .../rxjs/src/add/observable/zip.ts | 1 + .../rxjs/src/add/operator/audit.ts | 1 + .../rxjs/src/add/operator/auditTime.ts | 1 + .../rxjs/src/add/operator/buffer.ts | 1 + .../rxjs/src/add/operator/bufferCount.ts | 1 + .../rxjs/src/add/operator/bufferTime.ts | 1 + .../rxjs/src/add/operator/bufferToggle.ts | 1 + .../rxjs/src/add/operator/bufferWhen.ts | 1 + .../rxjs/src/add/operator/catch.ts | 1 + .../rxjs/src/add/operator/combineAll.ts | 1 + .../rxjs/src/add/operator/combineLatest.ts | 1 + .../rxjs/src/add/operator/concat.ts | 1 + .../rxjs/src/add/operator/concatAll.ts | 1 + .../rxjs/src/add/operator/concatMap.ts | 1 + .../rxjs/src/add/operator/concatMapTo.ts | 1 + .../rxjs/src/add/operator/count.ts | 1 + .../rxjs/src/add/operator/debounce.ts | 1 + .../rxjs/src/add/operator/debounceTime.ts | 1 + .../rxjs/src/add/operator/defaultIfEmpty.ts | 1 + .../rxjs/src/add/operator/delay.ts | 1 + .../rxjs/src/add/operator/delayWhen.ts | 1 + .../rxjs/src/add/operator/dematerialize.ts | 1 + .../rxjs/src/add/operator/distinct.ts | 1 + .../src/add/operator/distinctUntilChanged.ts | 1 + .../add/operator/distinctUntilKeyChanged.ts | 1 + .../node_modules/rxjs/src/add/operator/do.ts | 1 + .../rxjs/src/add/operator/elementAt.ts | 1 + .../rxjs/src/add/operator/every.ts | 1 + .../rxjs/src/add/operator/exhaust.ts | 1 + .../rxjs/src/add/operator/exhaustMap.ts | 1 + .../rxjs/src/add/operator/expand.ts | 1 + .../rxjs/src/add/operator/filter.ts | 1 + .../rxjs/src/add/operator/finally.ts | 1 + .../rxjs/src/add/operator/find.ts | 1 + .../rxjs/src/add/operator/findIndex.ts | 1 + .../rxjs/src/add/operator/first.ts | 1 + .../rxjs/src/add/operator/groupBy.ts | 1 + .../rxjs/src/add/operator/ignoreElements.ts | 1 + .../rxjs/src/add/operator/isEmpty.ts | 1 + .../rxjs/src/add/operator/last.ts | 1 + .../node_modules/rxjs/src/add/operator/let.ts | 1 + .../node_modules/rxjs/src/add/operator/map.ts | 1 + .../rxjs/src/add/operator/mapTo.ts | 1 + .../rxjs/src/add/operator/materialize.ts | 1 + .../node_modules/rxjs/src/add/operator/max.ts | 1 + .../rxjs/src/add/operator/merge.ts | 1 + .../rxjs/src/add/operator/mergeAll.ts | 1 + .../rxjs/src/add/operator/mergeMap.ts | 1 + .../rxjs/src/add/operator/mergeMapTo.ts | 1 + .../rxjs/src/add/operator/mergeScan.ts | 1 + .../node_modules/rxjs/src/add/operator/min.ts | 1 + .../rxjs/src/add/operator/multicast.ts | 1 + .../rxjs/src/add/operator/observeOn.ts | 1 + .../src/add/operator/onErrorResumeNext.ts | 1 + .../rxjs/src/add/operator/pairwise.ts | 1 + .../rxjs/src/add/operator/partition.ts | 1 + .../rxjs/src/add/operator/pluck.ts | 1 + .../rxjs/src/add/operator/publish.ts | 1 + .../rxjs/src/add/operator/publishBehavior.ts | 1 + .../rxjs/src/add/operator/publishLast.ts | 1 + .../rxjs/src/add/operator/publishReplay.ts | 1 + .../rxjs/src/add/operator/race.ts | 1 + .../rxjs/src/add/operator/reduce.ts | 1 + .../rxjs/src/add/operator/repeat.ts | 1 + .../rxjs/src/add/operator/repeatWhen.ts | 1 + .../rxjs/src/add/operator/retry.ts | 1 + .../rxjs/src/add/operator/retryWhen.ts | 1 + .../rxjs/src/add/operator/sample.ts | 1 + .../rxjs/src/add/operator/sampleTime.ts | 1 + .../rxjs/src/add/operator/scan.ts | 1 + .../rxjs/src/add/operator/sequenceEqual.ts | 1 + .../rxjs/src/add/operator/share.ts | 1 + .../rxjs/src/add/operator/shareReplay.ts | 1 + .../rxjs/src/add/operator/single.ts | 1 + .../rxjs/src/add/operator/skip.ts | 1 + .../rxjs/src/add/operator/skipLast.ts | 1 + .../rxjs/src/add/operator/skipUntil.ts | 1 + .../rxjs/src/add/operator/skipWhile.ts | 1 + .../rxjs/src/add/operator/startWith.ts | 1 + .../rxjs/src/add/operator/subscribeOn.ts | 1 + .../rxjs/src/add/operator/switch.ts | 1 + .../rxjs/src/add/operator/switchMap.ts | 1 + .../rxjs/src/add/operator/switchMapTo.ts | 1 + .../rxjs/src/add/operator/take.ts | 1 + .../rxjs/src/add/operator/takeLast.ts | 1 + .../rxjs/src/add/operator/takeUntil.ts | 1 + .../rxjs/src/add/operator/takeWhile.ts | 1 + .../rxjs/src/add/operator/throttle.ts | 1 + .../rxjs/src/add/operator/throttleTime.ts | 1 + .../rxjs/src/add/operator/timeInterval.ts | 1 + .../rxjs/src/add/operator/timeout.ts | 1 + .../rxjs/src/add/operator/timeoutWith.ts | 1 + .../rxjs/src/add/operator/timestamp.ts | 1 + .../rxjs/src/add/operator/toArray.ts | 1 + .../rxjs/src/add/operator/toPromise.ts | 1 + .../rxjs/src/add/operator/window.ts | 1 + .../rxjs/src/add/operator/windowCount.ts | 1 + .../rxjs/src/add/operator/windowTime.ts | 1 + .../rxjs/src/add/operator/windowToggle.ts | 1 + .../rxjs/src/add/operator/windowWhen.ts | 1 + .../rxjs/src/add/operator/withLatestFrom.ts | 1 + .../node_modules/rxjs/src/add/operator/zip.ts | 1 + .../rxjs/src/add/operator/zipAll.ts | 1 + .../node_modules/rxjs/src/ajax/index.ts | 2 + .../node_modules/rxjs/src/ajax/package.json | 8 + .../node_modules/rxjs/src/fetch/index.ts | 1 + .../node_modules/rxjs/src/fetch/package.json | 8 + day1/cli-study/node_modules/rxjs/src/index.ts | 78 + .../node_modules/rxjs/src/interfaces.ts | 1 + .../rxjs/src/internal-compatibility/index.ts | 64 + .../src/internal-compatibility/package.json | 8 + .../rxjs/src/internal/AsyncSubject.ts | 49 + .../rxjs/src/internal/BehaviorSubject.ts | 45 + .../rxjs/src/internal/InnerSubscriber.ts | 29 + .../rxjs/src/internal/Notification.ts | 148 + .../rxjs/src/internal/Observable.ts | 382 + .../rxjs/src/internal/Observer.ts | 16 + .../rxjs/src/internal/Operator.ts | 6 + .../rxjs/src/internal/OuterSubscriber.ts | 23 + .../rxjs/src/internal/ReplaySubject.ts | 136 + .../node_modules/rxjs/src/internal/Rx.ts | 228 + .../rxjs/src/internal/Scheduler.ts | 68 + .../node_modules/rxjs/src/internal/Subject.ts | 188 + .../rxjs/src/internal/SubjectSubscription.ts | 39 + .../rxjs/src/internal/Subscriber.ts | 302 + .../rxjs/src/internal/Subscription.ts | 211 + .../node_modules/rxjs/src/internal/config.ts | 35 + .../observable/ConnectableObservable.ts | 182 + .../observable/SubscribeOnObservable.ts | 52 + .../src/internal/observable/bindCallback.ts | 290 + .../internal/observable/bindNodeCallback.ts | 278 + .../src/internal/observable/combineLatest.ts | 328 + .../rxjs/src/internal/observable/concat.ts | 147 + .../rxjs/src/internal/observable/defer.ts | 67 + .../internal/observable/dom/AjaxObservable.ts | 550 + .../src/internal/observable/dom/MiscJSDoc.ts | 77 + .../observable/dom/WebSocketSubject.ts | 387 + .../rxjs/src/internal/observable/dom/ajax.ts | 82 + .../rxjs/src/internal/observable/dom/fetch.ts | 107 + .../src/internal/observable/dom/webSocket.ts | 156 + .../rxjs/src/internal/observable/empty.ts | 68 + .../rxjs/src/internal/observable/forkJoin.ts | 204 + .../rxjs/src/internal/observable/from.ts | 118 + .../rxjs/src/internal/observable/fromArray.ts | 12 + .../rxjs/src/internal/observable/fromEvent.ts | 245 + .../internal/observable/fromEventPattern.ts | 169 + .../src/internal/observable/fromIterable.ts | 15 + .../src/internal/observable/fromObservable.ts | 12 + .../src/internal/observable/fromPromise.ts | 12 + .../rxjs/src/internal/observable/generate.ts | 379 + .../rxjs/src/internal/observable/iif.ts | 100 + .../rxjs/src/internal/observable/interval.ts | 83 + .../rxjs/src/internal/observable/merge.ts | 140 + .../rxjs/src/internal/observable/never.ts | 41 + .../rxjs/src/internal/observable/of.ts | 110 + .../internal/observable/onErrorResumeNext.ts | 102 + .../rxjs/src/internal/observable/pairs.ts | 91 + .../rxjs/src/internal/observable/partition.ts | 67 + .../rxjs/src/internal/observable/race.ts | 140 + .../rxjs/src/internal/observable/range.ts | 90 + .../src/internal/observable/throwError.ts | 84 + .../rxjs/src/internal/observable/timer.ts | 101 + .../rxjs/src/internal/observable/using.ts | 63 + .../rxjs/src/internal/observable/zip.ts | 330 + .../rxjs/src/internal/operators/audit.ts | 128 + .../rxjs/src/internal/operators/auditTime.ts | 57 + .../rxjs/src/internal/operators/buffer.ts | 89 + .../src/internal/operators/bufferCount.ts | 158 + .../rxjs/src/internal/operators/bufferTime.ts | 250 + .../src/internal/operators/bufferToggle.ts | 182 + .../rxjs/src/internal/operators/bufferWhen.ts | 144 + .../rxjs/src/internal/operators/catchError.ts | 149 + .../rxjs/src/internal/operators/combineAll.ts | 57 + .../src/internal/operators/combineLatest.ts | 59 + .../rxjs/src/internal/operators/concat.ts | 29 + .../rxjs/src/internal/operators/concatAll.ts | 68 + .../rxjs/src/internal/operators/concatMap.ts | 77 + .../src/internal/operators/concatMapTo.ts | 73 + .../rxjs/src/internal/operators/count.ts | 121 + .../rxjs/src/internal/operators/debounce.ts | 148 + .../src/internal/operators/debounceTime.ts | 130 + .../src/internal/operators/defaultIfEmpty.ts | 84 + .../rxjs/src/internal/operators/delay.ts | 161 + .../rxjs/src/internal/operators/delayWhen.ts | 225 + .../src/internal/operators/dematerialize.ts | 78 + .../rxjs/src/internal/operators/distinct.ts | 135 + .../operators/distinctUntilChanged.ts | 124 + .../operators/distinctUntilKeyChanged.ts | 81 + .../rxjs/src/internal/operators/elementAt.ts | 69 + .../rxjs/src/internal/operators/endWith.ts | 67 + .../rxjs/src/internal/operators/every.ts | 81 + .../rxjs/src/internal/operators/exhaust.ts | 100 + .../rxjs/src/internal/operators/exhaustMap.ts | 164 + .../rxjs/src/internal/operators/expand.ts | 180 + .../rxjs/src/internal/operators/filter.ts | 104 + .../rxjs/src/internal/operators/finalize.ts | 38 + .../rxjs/src/internal/operators/find.ts | 109 + .../rxjs/src/internal/operators/findIndex.ts | 47 + .../rxjs/src/internal/operators/first.ts | 91 + .../rxjs/src/internal/operators/groupBy.ts | 319 + .../src/internal/operators/ignoreElements.ts | 54 + .../rxjs/src/internal/operators/index.ts | 102 + .../rxjs/src/internal/operators/isEmpty.ts | 100 + .../rxjs/src/internal/operators/last.ts | 54 + .../rxjs/src/internal/operators/map.ts | 91 + .../rxjs/src/internal/operators/mapTo.ts | 72 + .../src/internal/operators/materialize.ts | 94 + .../rxjs/src/internal/operators/max.ts | 55 + .../rxjs/src/internal/operators/merge.ts | 41 + .../rxjs/src/internal/operators/mergeAll.ts | 66 + .../rxjs/src/internal/operators/mergeMap.ts | 181 + .../rxjs/src/internal/operators/mergeMapTo.ts | 64 + .../rxjs/src/internal/operators/mergeScan.ts | 152 + .../rxjs/src/internal/operators/min.ts | 53 + .../rxjs/src/internal/operators/multicast.ts | 69 + .../rxjs/src/internal/operators/observeOn.ts | 122 + .../internal/operators/onErrorResumeNext.ts | 176 + .../rxjs/src/internal/operators/pairwise.ts | 87 + .../rxjs/src/internal/operators/partition.ts | 60 + .../rxjs/src/internal/operators/pluck.ts | 70 + .../rxjs/src/internal/operators/publish.ts | 67 + .../src/internal/operators/publishBehavior.ts | 15 + .../src/internal/operators/publishLast.ts | 67 + .../src/internal/operators/publishReplay.ts | 25 + .../rxjs/src/internal/operators/race.ts | 36 + .../rxjs/src/internal/operators/reduce.ts | 82 + .../rxjs/src/internal/operators/refCount.ts | 148 + .../rxjs/src/internal/operators/repeat.ts | 106 + .../rxjs/src/internal/operators/repeatWhen.ts | 140 + .../rxjs/src/internal/operators/retry.ts | 89 + .../rxjs/src/internal/operators/retryWhen.ts | 114 + .../rxjs/src/internal/operators/sample.ts | 96 + .../rxjs/src/internal/operators/sampleTime.ts | 96 + .../rxjs/src/internal/operators/scan.ts | 121 + .../src/internal/operators/sequenceEqual.ts | 174 + .../rxjs/src/internal/operators/share.ts | 26 + .../src/internal/operators/shareReplay.ts | 122 + .../rxjs/src/internal/operators/single.ts | 123 + .../rxjs/src/internal/operators/skip.ts | 47 + .../rxjs/src/internal/operators/skipLast.ts | 96 + .../rxjs/src/internal/operators/skipUntil.ts | 105 + .../rxjs/src/internal/operators/skipWhile.ts | 64 + .../rxjs/src/internal/operators/startWith.ts | 77 + .../src/internal/operators/subscribeOn.ts | 64 + .../rxjs/src/internal/operators/switchAll.ts | 65 + .../rxjs/src/internal/operators/switchMap.ts | 174 + .../src/internal/operators/switchMapTo.ts | 64 + .../rxjs/src/internal/operators/take.ts | 99 + .../rxjs/src/internal/operators/takeLast.ts | 114 + .../rxjs/src/internal/operators/takeUntil.ts | 92 + .../rxjs/src/internal/operators/takeWhile.ts | 110 + .../rxjs/src/internal/operators/tap.ts | 147 + .../rxjs/src/internal/operators/throttle.ts | 163 + .../src/internal/operators/throttleTime.ts | 174 + .../src/internal/operators/throwIfEmpty.ts | 81 + .../src/internal/operators/timeInterval.ts | 75 + .../rxjs/src/internal/operators/timeout.ts | 92 + .../src/internal/operators/timeoutWith.ts | 144 + .../rxjs/src/internal/operators/timestamp.ts | 48 + .../rxjs/src/internal/operators/toArray.ts | 45 + .../rxjs/src/internal/operators/window.ts | 130 + .../src/internal/operators/windowCount.ts | 149 + .../rxjs/src/internal/operators/windowTime.ts | 282 + .../src/internal/operators/windowToggle.ts | 211 + .../rxjs/src/internal/operators/windowWhen.ts | 147 + .../src/internal/operators/withLatestFrom.ts | 156 + .../rxjs/src/internal/operators/zip.ts | 43 + .../rxjs/src/internal/operators/zipAll.ts | 12 + .../src/internal/scheduled/scheduleArray.ts | 21 + .../internal/scheduled/scheduleIterable.ts | 45 + .../internal/scheduled/scheduleObservable.ts | 19 + .../src/internal/scheduled/schedulePromise.ts | 21 + .../rxjs/src/internal/scheduled/scheduled.ts | 36 + .../rxjs/src/internal/scheduler/Action.ts | 36 + .../scheduler/AnimationFrameAction.ts | 47 + .../scheduler/AnimationFrameScheduler.ts | 31 + .../rxjs/src/internal/scheduler/AsapAction.ts | 48 + .../src/internal/scheduler/AsapScheduler.ts | 31 + .../src/internal/scheduler/AsyncAction.ts | 156 + .../src/internal/scheduler/AsyncScheduler.ts | 72 + .../src/internal/scheduler/QueueAction.ts | 44 + .../src/internal/scheduler/QueueScheduler.ts | 4 + .../scheduler/VirtualTimeScheduler.ts | 108 + .../src/internal/scheduler/animationFrame.ts | 40 + .../rxjs/src/internal/scheduler/asap.ts | 42 + .../rxjs/src/internal/scheduler/async.ts | 55 + .../rxjs/src/internal/scheduler/queue.ts | 71 + .../rxjs/src/internal/symbol/iterator.ts | 14 + .../rxjs/src/internal/symbol/observable.ts | 11 + .../rxjs/src/internal/symbol/rxSubscriber.ts | 10 + .../src/internal/testing/ColdObservable.ts | 48 + .../src/internal/testing/HotObservable.ts | 55 + .../src/internal/testing/SubscriptionLog.ts | 5 + .../internal/testing/SubscriptionLoggable.ts | 21 + .../rxjs/src/internal/testing/TestMessage.ts | 7 + .../src/internal/testing/TestScheduler.ts | 401 + .../node_modules/rxjs/src/internal/types.ts | 103 + .../node_modules/rxjs/src/internal/umd.ts | 26 + .../internal/util/ArgumentOutOfRangeError.ts | 31 + .../rxjs/src/internal/util/EmptyError.ts | 31 + .../rxjs/src/internal/util/Immediate.ts | 41 + .../internal/util/ObjectUnsubscribedError.ts | 30 + .../rxjs/src/internal/util/TimeoutError.ts | 28 + .../src/internal/util/UnsubscriptionError.ts | 29 + .../rxjs/src/internal/util/applyMixins.ts | 10 + .../rxjs/src/internal/util/canReportError.ts | 22 + .../rxjs/src/internal/util/errorObject.ts | 2 + .../rxjs/src/internal/util/hostReportError.ts | 8 + .../rxjs/src/internal/util/identity.ts | 3 + .../rxjs/src/internal/util/isArray.ts | 1 + .../rxjs/src/internal/util/isArrayLike.ts | 1 + .../rxjs/src/internal/util/isDate.ts | 3 + .../rxjs/src/internal/util/isFunction.ts | 3 + .../src/internal/util/isInteropObservable.ts | 7 + .../rxjs/src/internal/util/isIterable.ts | 6 + .../rxjs/src/internal/util/isNumeric.ts | 9 + .../rxjs/src/internal/util/isObject.ts | 3 + .../rxjs/src/internal/util/isObservable.ts | 10 + .../rxjs/src/internal/util/isPromise.ts | 8 + .../rxjs/src/internal/util/isScheduler.ts | 5 + .../rxjs/src/internal/util/noop.ts | 2 + .../rxjs/src/internal/util/not.ts | 8 + .../rxjs/src/internal/util/pipe.ts | 36 + .../rxjs/src/internal/util/root.ts | 31 + .../rxjs/src/internal/util/subscribeTo.ts | 29 + .../src/internal/util/subscribeToArray.ts | 12 + .../src/internal/util/subscribeToIterable.ts | 28 + .../internal/util/subscribeToObservable.ts | 17 + .../src/internal/util/subscribeToPromise.ts | 16 + .../src/internal/util/subscribeToResult.ts | 37 + .../rxjs/src/internal/util/toSubscriber.ts | 26 + .../rxjs/src/internal/util/tryCatch.ts | 20 + .../src/observable/ArrayLikeObservable.ts | 1 + .../rxjs/src/observable/ArrayObservable.ts | 1 + .../src/observable/BoundCallbackObservable.ts | 1 + .../observable/BoundNodeCallbackObservable.ts | 1 + .../src/observable/ConnectableObservable.ts | 1 + .../rxjs/src/observable/DeferObservable.ts | 1 + .../rxjs/src/observable/EmptyObservable.ts | 1 + .../rxjs/src/observable/ErrorObservable.ts | 1 + .../rxjs/src/observable/ForkJoinObservable.ts | 1 + .../src/observable/FromEventObservable.ts | 1 + .../observable/FromEventPatternObservable.ts | 1 + .../rxjs/src/observable/FromObservable.ts | 1 + .../rxjs/src/observable/GenerateObservable.ts | 1 + .../rxjs/src/observable/IfObservable.ts | 1 + .../rxjs/src/observable/IntervalObservable.ts | 1 + .../rxjs/src/observable/IteratorObservable.ts | 1 + .../rxjs/src/observable/NeverObservable.ts | 1 + .../rxjs/src/observable/PairsObservable.ts | 1 + .../rxjs/src/observable/PromiseObservable.ts | 1 + .../rxjs/src/observable/RangeObservable.ts | 1 + .../rxjs/src/observable/ScalarObservable.ts | 1 + .../src/observable/SubscribeOnObservable.ts | 1 + .../rxjs/src/observable/TimerObservable.ts | 1 + .../rxjs/src/observable/UsingObservable.ts | 1 + .../rxjs/src/observable/bindCallback.ts | 1 + .../rxjs/src/observable/bindNodeCallback.ts | 1 + .../rxjs/src/observable/combineLatest.ts | 1 + .../rxjs/src/observable/concat.ts | 1 + .../node_modules/rxjs/src/observable/defer.ts | 1 + .../rxjs/src/observable/dom/AjaxObservable.ts | 1 + .../src/observable/dom/WebSocketSubject.ts | 1 + .../rxjs/src/observable/dom/ajax.ts | 1 + .../rxjs/src/observable/dom/webSocket.ts | 1 + .../node_modules/rxjs/src/observable/empty.ts | 1 + .../rxjs/src/observable/forkJoin.ts | 1 + .../node_modules/rxjs/src/observable/from.ts | 1 + .../rxjs/src/observable/fromArray.ts | 1 + .../rxjs/src/observable/fromEvent.ts | 1 + .../rxjs/src/observable/fromEventPattern.ts | 1 + .../rxjs/src/observable/fromIterable.ts | 1 + .../rxjs/src/observable/fromPromise.ts | 1 + .../rxjs/src/observable/generate.ts | 1 + .../node_modules/rxjs/src/observable/if.ts | 1 + .../rxjs/src/observable/interval.ts | 1 + .../node_modules/rxjs/src/observable/merge.ts | 1 + .../node_modules/rxjs/src/observable/never.ts | 1 + .../node_modules/rxjs/src/observable/of.ts | 1 + .../rxjs/src/observable/onErrorResumeNext.ts | 1 + .../node_modules/rxjs/src/observable/pairs.ts | 1 + .../node_modules/rxjs/src/observable/race.ts | 1 + .../node_modules/rxjs/src/observable/range.ts | 1 + .../node_modules/rxjs/src/observable/throw.ts | 1 + .../node_modules/rxjs/src/observable/timer.ts | 1 + .../node_modules/rxjs/src/observable/using.ts | 1 + .../node_modules/rxjs/src/observable/zip.ts | 1 + .../node_modules/rxjs/src/operator/audit.ts | 1 + .../rxjs/src/operator/auditTime.ts | 1 + .../node_modules/rxjs/src/operator/buffer.ts | 1 + .../rxjs/src/operator/bufferCount.ts | 1 + .../rxjs/src/operator/bufferTime.ts | 1 + .../rxjs/src/operator/bufferToggle.ts | 1 + .../rxjs/src/operator/bufferWhen.ts | 1 + .../node_modules/rxjs/src/operator/catch.ts | 1 + .../rxjs/src/operator/combineAll.ts | 1 + .../rxjs/src/operator/combineLatest.ts | 1 + .../node_modules/rxjs/src/operator/concat.ts | 1 + .../rxjs/src/operator/concatAll.ts | 1 + .../rxjs/src/operator/concatMap.ts | 1 + .../rxjs/src/operator/concatMapTo.ts | 1 + .../node_modules/rxjs/src/operator/count.ts | 1 + .../rxjs/src/operator/debounce.ts | 1 + .../rxjs/src/operator/debounceTime.ts | 1 + .../rxjs/src/operator/defaultIfEmpty.ts | 1 + .../node_modules/rxjs/src/operator/delay.ts | 1 + .../rxjs/src/operator/delayWhen.ts | 1 + .../rxjs/src/operator/dematerialize.ts | 1 + .../rxjs/src/operator/distinct.ts | 1 + .../rxjs/src/operator/distinctUntilChanged.ts | 1 + .../src/operator/distinctUntilKeyChanged.ts | 1 + .../node_modules/rxjs/src/operator/do.ts | 1 + .../rxjs/src/operator/elementAt.ts | 1 + .../node_modules/rxjs/src/operator/every.ts | 1 + .../node_modules/rxjs/src/operator/exhaust.ts | 1 + .../rxjs/src/operator/exhaustMap.ts | 1 + .../node_modules/rxjs/src/operator/expand.ts | 1 + .../node_modules/rxjs/src/operator/filter.ts | 1 + .../node_modules/rxjs/src/operator/finally.ts | 1 + .../node_modules/rxjs/src/operator/find.ts | 1 + .../rxjs/src/operator/findIndex.ts | 1 + .../node_modules/rxjs/src/operator/first.ts | 1 + .../node_modules/rxjs/src/operator/groupBy.ts | 1 + .../rxjs/src/operator/ignoreElements.ts | 1 + .../node_modules/rxjs/src/operator/isEmpty.ts | 1 + .../node_modules/rxjs/src/operator/last.ts | 1 + .../node_modules/rxjs/src/operator/let.ts | 1 + .../node_modules/rxjs/src/operator/map.ts | 1 + .../node_modules/rxjs/src/operator/mapTo.ts | 1 + .../rxjs/src/operator/materialize.ts | 1 + .../node_modules/rxjs/src/operator/max.ts | 1 + .../node_modules/rxjs/src/operator/merge.ts | 1 + .../rxjs/src/operator/mergeAll.ts | 1 + .../rxjs/src/operator/mergeMap.ts | 1 + .../rxjs/src/operator/mergeMapTo.ts | 1 + .../rxjs/src/operator/mergeScan.ts | 1 + .../node_modules/rxjs/src/operator/min.ts | 1 + .../rxjs/src/operator/multicast.ts | 1 + .../rxjs/src/operator/observeOn.ts | 1 + .../rxjs/src/operator/onErrorResumeNext.ts | 1 + .../rxjs/src/operator/pairwise.ts | 1 + .../rxjs/src/operator/partition.ts | 1 + .../node_modules/rxjs/src/operator/pluck.ts | 1 + .../node_modules/rxjs/src/operator/publish.ts | 1 + .../rxjs/src/operator/publishBehavior.ts | 1 + .../rxjs/src/operator/publishLast.ts | 1 + .../rxjs/src/operator/publishReplay.ts | 1 + .../node_modules/rxjs/src/operator/race.ts | 1 + .../node_modules/rxjs/src/operator/reduce.ts | 1 + .../node_modules/rxjs/src/operator/repeat.ts | 1 + .../rxjs/src/operator/repeatWhen.ts | 1 + .../node_modules/rxjs/src/operator/retry.ts | 1 + .../rxjs/src/operator/retryWhen.ts | 1 + .../node_modules/rxjs/src/operator/sample.ts | 1 + .../rxjs/src/operator/sampleTime.ts | 1 + .../node_modules/rxjs/src/operator/scan.ts | 1 + .../rxjs/src/operator/sequenceEqual.ts | 1 + .../node_modules/rxjs/src/operator/share.ts | 1 + .../rxjs/src/operator/shareReplay.ts | 1 + .../node_modules/rxjs/src/operator/single.ts | 1 + .../node_modules/rxjs/src/operator/skip.ts | 1 + .../rxjs/src/operator/skipLast.ts | 1 + .../rxjs/src/operator/skipUntil.ts | 1 + .../rxjs/src/operator/skipWhile.ts | 1 + .../rxjs/src/operator/startWith.ts | 1 + .../rxjs/src/operator/subscribeOn.ts | 1 + .../node_modules/rxjs/src/operator/switch.ts | 1 + .../rxjs/src/operator/switchMap.ts | 1 + .../rxjs/src/operator/switchMapTo.ts | 1 + .../node_modules/rxjs/src/operator/take.ts | 1 + .../rxjs/src/operator/takeLast.ts | 1 + .../rxjs/src/operator/takeUntil.ts | 1 + .../rxjs/src/operator/takeWhile.ts | 1 + .../rxjs/src/operator/throttle.ts | 1 + .../rxjs/src/operator/throttleTime.ts | 1 + .../rxjs/src/operator/timeInterval.ts | 1 + .../node_modules/rxjs/src/operator/timeout.ts | 1 + .../rxjs/src/operator/timeoutWith.ts | 1 + .../rxjs/src/operator/timestamp.ts | 1 + .../node_modules/rxjs/src/operator/toArray.ts | 1 + .../rxjs/src/operator/toPromise.ts | 1 + .../node_modules/rxjs/src/operator/window.ts | 1 + .../rxjs/src/operator/windowCount.ts | 1 + .../rxjs/src/operator/windowTime.ts | 1 + .../rxjs/src/operator/windowToggle.ts | 1 + .../rxjs/src/operator/windowWhen.ts | 1 + .../rxjs/src/operator/withLatestFrom.ts | 1 + .../node_modules/rxjs/src/operator/zip.ts | 1 + .../node_modules/rxjs/src/operator/zipAll.ts | 1 + .../node_modules/rxjs/src/operators/audit.ts | 1 + .../rxjs/src/operators/auditTime.ts | 1 + .../node_modules/rxjs/src/operators/buffer.ts | 1 + .../rxjs/src/operators/bufferCount.ts | 1 + .../rxjs/src/operators/bufferTime.ts | 1 + .../rxjs/src/operators/bufferToggle.ts | 1 + .../rxjs/src/operators/bufferWhen.ts | 1 + .../rxjs/src/operators/catchError.ts | 1 + .../rxjs/src/operators/combineAll.ts | 1 + .../rxjs/src/operators/combineLatest.ts | 1 + .../node_modules/rxjs/src/operators/concat.ts | 1 + .../rxjs/src/operators/concatAll.ts | 1 + .../rxjs/src/operators/concatMap.ts | 1 + .../rxjs/src/operators/concatMapTo.ts | 1 + .../node_modules/rxjs/src/operators/count.ts | 1 + .../rxjs/src/operators/debounce.ts | 1 + .../rxjs/src/operators/debounceTime.ts | 1 + .../rxjs/src/operators/defaultIfEmpty.ts | 1 + .../node_modules/rxjs/src/operators/delay.ts | 1 + .../rxjs/src/operators/delayWhen.ts | 1 + .../rxjs/src/operators/dematerialize.ts | 1 + .../rxjs/src/operators/distinct.ts | 1 + .../src/operators/distinctUntilChanged.ts | 1 + .../src/operators/distinctUntilKeyChanged.ts | 1 + .../rxjs/src/operators/elementAt.ts | 1 + .../node_modules/rxjs/src/operators/every.ts | 1 + .../rxjs/src/operators/exhaust.ts | 1 + .../rxjs/src/operators/exhaustMap.ts | 1 + .../node_modules/rxjs/src/operators/expand.ts | 1 + .../node_modules/rxjs/src/operators/filter.ts | 1 + .../rxjs/src/operators/finalize.ts | 1 + .../node_modules/rxjs/src/operators/find.ts | 1 + .../rxjs/src/operators/findIndex.ts | 1 + .../node_modules/rxjs/src/operators/first.ts | 1 + .../rxjs/src/operators/groupBy.ts | 1 + .../rxjs/src/operators/ignoreElements.ts | 1 + .../node_modules/rxjs/src/operators/index.ts | 106 + .../rxjs/src/operators/isEmpty.ts | 1 + .../node_modules/rxjs/src/operators/last.ts | 1 + .../node_modules/rxjs/src/operators/map.ts | 1 + .../node_modules/rxjs/src/operators/mapTo.ts | 1 + .../rxjs/src/operators/materialize.ts | 1 + .../node_modules/rxjs/src/operators/max.ts | 1 + .../node_modules/rxjs/src/operators/merge.ts | 1 + .../rxjs/src/operators/mergeAll.ts | 1 + .../rxjs/src/operators/mergeMap.ts | 1 + .../rxjs/src/operators/mergeMapTo.ts | 1 + .../rxjs/src/operators/mergeScan.ts | 1 + .../node_modules/rxjs/src/operators/min.ts | 1 + .../rxjs/src/operators/multicast.ts | 1 + .../rxjs/src/operators/observeOn.ts | 1 + .../rxjs/src/operators/onErrorResumeNext.ts | 1 + .../rxjs/src/operators/package.json | 8 + .../rxjs/src/operators/pairwise.ts | 1 + .../rxjs/src/operators/partition.ts | 1 + .../node_modules/rxjs/src/operators/pluck.ts | 1 + .../rxjs/src/operators/publish.ts | 1 + .../rxjs/src/operators/publishBehavior.ts | 1 + .../rxjs/src/operators/publishLast.ts | 1 + .../rxjs/src/operators/publishReplay.ts | 1 + .../node_modules/rxjs/src/operators/race.ts | 1 + .../node_modules/rxjs/src/operators/reduce.ts | 1 + .../rxjs/src/operators/refCount.ts | 1 + .../node_modules/rxjs/src/operators/repeat.ts | 1 + .../rxjs/src/operators/repeatWhen.ts | 1 + .../node_modules/rxjs/src/operators/retry.ts | 1 + .../rxjs/src/operators/retryWhen.ts | 1 + .../node_modules/rxjs/src/operators/sample.ts | 1 + .../rxjs/src/operators/sampleTime.ts | 1 + .../node_modules/rxjs/src/operators/scan.ts | 1 + .../rxjs/src/operators/sequenceEqual.ts | 1 + .../node_modules/rxjs/src/operators/share.ts | 1 + .../rxjs/src/operators/shareReplay.ts | 1 + .../node_modules/rxjs/src/operators/single.ts | 1 + .../node_modules/rxjs/src/operators/skip.ts | 1 + .../rxjs/src/operators/skipLast.ts | 1 + .../rxjs/src/operators/skipUntil.ts | 1 + .../rxjs/src/operators/skipWhile.ts | 1 + .../rxjs/src/operators/startWith.ts | 1 + .../rxjs/src/operators/subscribeOn.ts | 1 + .../rxjs/src/operators/switchAll.ts | 1 + .../rxjs/src/operators/switchMap.ts | 1 + .../rxjs/src/operators/switchMapTo.ts | 1 + .../node_modules/rxjs/src/operators/take.ts | 1 + .../rxjs/src/operators/takeLast.ts | 1 + .../rxjs/src/operators/takeUntil.ts | 1 + .../rxjs/src/operators/takeWhile.ts | 1 + .../node_modules/rxjs/src/operators/tap.ts | 1 + .../rxjs/src/operators/throttle.ts | 1 + .../rxjs/src/operators/throttleTime.ts | 1 + .../rxjs/src/operators/throwIfEmpty.ts | 1 + .../rxjs/src/operators/timeInterval.ts | 1 + .../rxjs/src/operators/timeout.ts | 1 + .../rxjs/src/operators/timeoutWith.ts | 1 + .../rxjs/src/operators/timestamp.ts | 1 + .../rxjs/src/operators/toArray.ts | 1 + .../node_modules/rxjs/src/operators/window.ts | 1 + .../rxjs/src/operators/windowCount.ts | 1 + .../rxjs/src/operators/windowTime.ts | 1 + .../rxjs/src/operators/windowToggle.ts | 1 + .../rxjs/src/operators/windowWhen.ts | 1 + .../rxjs/src/operators/withLatestFrom.ts | 1 + .../node_modules/rxjs/src/operators/zip.ts | 1 + .../node_modules/rxjs/src/operators/zipAll.ts | 1 + .../rxjs/src/scheduler/animationFrame.ts | 1 + .../node_modules/rxjs/src/scheduler/asap.ts | 1 + .../node_modules/rxjs/src/scheduler/async.ts | 1 + .../node_modules/rxjs/src/scheduler/queue.ts | 1 + .../node_modules/rxjs/src/symbol/iterator.ts | 1 + .../rxjs/src/symbol/observable.ts | 1 + .../rxjs/src/symbol/rxSubscriber.ts | 1 + .../node_modules/rxjs/src/testing/index.ts | 1 + .../rxjs/src/testing/package.json | 8 + .../node_modules/rxjs/src/tsconfig.json | 32 + .../rxjs/src/util/ArgumentOutOfRangeError.ts | 1 + .../node_modules/rxjs/src/util/EmptyError.ts | 1 + .../node_modules/rxjs/src/util/Immediate.ts | 1 + .../rxjs/src/util/ObjectUnsubscribedError.ts | 1 + .../rxjs/src/util/TimeoutError.ts | 1 + .../rxjs/src/util/UnsubscriptionError.ts | 1 + .../node_modules/rxjs/src/util/applyMixins.ts | 1 + .../node_modules/rxjs/src/util/errorObject.ts | 1 + .../rxjs/src/util/hostReportError.ts | 1 + .../node_modules/rxjs/src/util/identity.ts | 1 + .../node_modules/rxjs/src/util/isArray.ts | 1 + .../node_modules/rxjs/src/util/isArrayLike.ts | 1 + .../node_modules/rxjs/src/util/isDate.ts | 1 + .../node_modules/rxjs/src/util/isFunction.ts | 1 + .../node_modules/rxjs/src/util/isIterable.ts | 1 + .../node_modules/rxjs/src/util/isNumeric.ts | 1 + .../node_modules/rxjs/src/util/isObject.ts | 1 + .../rxjs/src/util/isObservable.ts | 1 + .../node_modules/rxjs/src/util/isPromise.ts | 1 + .../node_modules/rxjs/src/util/isScheduler.ts | 1 + .../node_modules/rxjs/src/util/noop.ts | 1 + .../node_modules/rxjs/src/util/not.ts | 1 + .../node_modules/rxjs/src/util/pipe.ts | 1 + .../node_modules/rxjs/src/util/root.ts | 1 + .../node_modules/rxjs/src/util/subscribeTo.ts | 1 + .../rxjs/src/util/subscribeToArray.ts | 1 + .../rxjs/src/util/subscribeToIterable.ts | 1 + .../rxjs/src/util/subscribeToObservable.ts | 1 + .../rxjs/src/util/subscribeToPromise.ts | 1 + .../rxjs/src/util/subscribeToResult.ts | 1 + .../rxjs/src/util/toSubscriber.ts | 1 + .../node_modules/rxjs/src/util/tryCatch.ts | 1 + .../node_modules/rxjs/src/webSocket/index.ts | 2 + .../rxjs/src/webSocket/package.json | 8 + .../node_modules/rxjs/symbol/iterator.d.ts | 1 + .../node_modules/rxjs/symbol/iterator.js | 7 + .../node_modules/rxjs/symbol/iterator.js.map | 1 + .../node_modules/rxjs/symbol/observable.d.ts | 1 + .../node_modules/rxjs/symbol/observable.js | 7 + .../rxjs/symbol/observable.js.map | 1 + .../rxjs/symbol/rxSubscriber.d.ts | 1 + .../node_modules/rxjs/symbol/rxSubscriber.js | 7 + .../rxjs/symbol/rxSubscriber.js.map | 1 + .../node_modules/rxjs/testing/index.d.ts | 1 + .../node_modules/rxjs/testing/index.js | 5 + .../node_modules/rxjs/testing/index.js.map | 1 + .../node_modules/rxjs/testing/package.json | 8 + .../rxjs/util/ArgumentOutOfRangeError.d.ts | 1 + .../rxjs/util/ArgumentOutOfRangeError.js | 7 + .../rxjs/util/ArgumentOutOfRangeError.js.map | 1 + .../node_modules/rxjs/util/EmptyError.d.ts | 1 + .../node_modules/rxjs/util/EmptyError.js | 7 + .../node_modules/rxjs/util/EmptyError.js.map | 1 + .../node_modules/rxjs/util/Immediate.d.ts | 1 + .../node_modules/rxjs/util/Immediate.js | 7 + .../node_modules/rxjs/util/Immediate.js.map | 1 + .../rxjs/util/ObjectUnsubscribedError.d.ts | 1 + .../rxjs/util/ObjectUnsubscribedError.js | 7 + .../rxjs/util/ObjectUnsubscribedError.js.map | 1 + .../node_modules/rxjs/util/TimeoutError.d.ts | 1 + .../node_modules/rxjs/util/TimeoutError.js | 7 + .../rxjs/util/TimeoutError.js.map | 1 + .../rxjs/util/UnsubscriptionError.d.ts | 1 + .../rxjs/util/UnsubscriptionError.js | 7 + .../rxjs/util/UnsubscriptionError.js.map | 1 + .../node_modules/rxjs/util/applyMixins.d.ts | 1 + .../node_modules/rxjs/util/applyMixins.js | 7 + .../node_modules/rxjs/util/applyMixins.js.map | 1 + .../node_modules/rxjs/util/errorObject.d.ts | 1 + .../node_modules/rxjs/util/errorObject.js | 7 + .../node_modules/rxjs/util/errorObject.js.map | 1 + .../rxjs/util/hostReportError.d.ts | 1 + .../node_modules/rxjs/util/hostReportError.js | 7 + .../rxjs/util/hostReportError.js.map | 1 + .../node_modules/rxjs/util/identity.d.ts | 1 + .../node_modules/rxjs/util/identity.js | 7 + .../node_modules/rxjs/util/identity.js.map | 1 + .../node_modules/rxjs/util/isArray.d.ts | 1 + .../node_modules/rxjs/util/isArray.js | 7 + .../node_modules/rxjs/util/isArray.js.map | 1 + .../node_modules/rxjs/util/isArrayLike.d.ts | 1 + .../node_modules/rxjs/util/isArrayLike.js | 7 + .../node_modules/rxjs/util/isArrayLike.js.map | 1 + .../node_modules/rxjs/util/isDate.d.ts | 1 + .../node_modules/rxjs/util/isDate.js | 7 + .../node_modules/rxjs/util/isDate.js.map | 1 + .../node_modules/rxjs/util/isFunction.d.ts | 1 + .../node_modules/rxjs/util/isFunction.js | 7 + .../node_modules/rxjs/util/isFunction.js.map | 1 + .../node_modules/rxjs/util/isIterable.d.ts | 1 + .../node_modules/rxjs/util/isIterable.js | 7 + .../node_modules/rxjs/util/isIterable.js.map | 1 + .../node_modules/rxjs/util/isNumeric.d.ts | 1 + .../node_modules/rxjs/util/isNumeric.js | 7 + .../node_modules/rxjs/util/isNumeric.js.map | 1 + .../node_modules/rxjs/util/isObject.d.ts | 1 + .../node_modules/rxjs/util/isObject.js | 7 + .../node_modules/rxjs/util/isObject.js.map | 1 + .../node_modules/rxjs/util/isObservable.d.ts | 1 + .../node_modules/rxjs/util/isObservable.js | 7 + .../rxjs/util/isObservable.js.map | 1 + .../node_modules/rxjs/util/isPromise.d.ts | 1 + .../node_modules/rxjs/util/isPromise.js | 7 + .../node_modules/rxjs/util/isPromise.js.map | 1 + .../node_modules/rxjs/util/isScheduler.d.ts | 1 + .../node_modules/rxjs/util/isScheduler.js | 7 + .../node_modules/rxjs/util/isScheduler.js.map | 1 + .../node_modules/rxjs/util/noop.d.ts | 1 + day1/cli-study/node_modules/rxjs/util/noop.js | 7 + .../node_modules/rxjs/util/noop.js.map | 1 + .../cli-study/node_modules/rxjs/util/not.d.ts | 1 + day1/cli-study/node_modules/rxjs/util/not.js | 7 + .../node_modules/rxjs/util/not.js.map | 1 + .../node_modules/rxjs/util/pipe.d.ts | 1 + day1/cli-study/node_modules/rxjs/util/pipe.js | 7 + .../node_modules/rxjs/util/pipe.js.map | 1 + .../node_modules/rxjs/util/root.d.ts | 1 + day1/cli-study/node_modules/rxjs/util/root.js | 7 + .../node_modules/rxjs/util/root.js.map | 1 + .../node_modules/rxjs/util/subscribeTo.d.ts | 1 + .../node_modules/rxjs/util/subscribeTo.js | 7 + .../node_modules/rxjs/util/subscribeTo.js.map | 1 + .../rxjs/util/subscribeToArray.d.ts | 1 + .../rxjs/util/subscribeToArray.js | 7 + .../rxjs/util/subscribeToArray.js.map | 1 + .../rxjs/util/subscribeToIterable.d.ts | 1 + .../rxjs/util/subscribeToIterable.js | 7 + .../rxjs/util/subscribeToIterable.js.map | 1 + .../rxjs/util/subscribeToObservable.d.ts | 1 + .../rxjs/util/subscribeToObservable.js | 7 + .../rxjs/util/subscribeToObservable.js.map | 1 + .../rxjs/util/subscribeToPromise.d.ts | 1 + .../rxjs/util/subscribeToPromise.js | 7 + .../rxjs/util/subscribeToPromise.js.map | 1 + .../rxjs/util/subscribeToResult.d.ts | 1 + .../rxjs/util/subscribeToResult.js | 7 + .../rxjs/util/subscribeToResult.js.map | 1 + .../node_modules/rxjs/util/toSubscriber.d.ts | 1 + .../node_modules/rxjs/util/toSubscriber.js | 7 + .../rxjs/util/toSubscriber.js.map | 1 + .../node_modules/rxjs/util/tryCatch.d.ts | 1 + .../node_modules/rxjs/util/tryCatch.js | 7 + .../node_modules/rxjs/util/tryCatch.js.map | 1 + .../node_modules/rxjs/webSocket/index.d.ts | 2 + .../node_modules/rxjs/webSocket/index.js | 7 + .../node_modules/rxjs/webSocket/index.js.map | 1 + .../node_modules/rxjs/webSocket/package.json | 8 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 65 + .../node_modules/safe-buffer/package.json | 78 + .../node_modules/safer-buffer/LICENSE | 21 + .../safer-buffer/Porting-Buffer.md | 268 + .../node_modules/safer-buffer/Readme.md | 156 + .../node_modules/safer-buffer/dangerous.js | 58 + .../node_modules/safer-buffer/package.json | 60 + .../node_modules/safer-buffer/safer.js | 77 + .../node_modules/safer-buffer/tests.js | 406 + .../node_modules/seek-bzip/.npmignore | 6 + .../node_modules/seek-bzip/README.md | 185 + .../node_modules/seek-bzip/bin/seek-bunzip | 129 + .../seek-bzip/bin/seek-bzip-table | 71 + .../node_modules/seek-bzip/lib/bitreader.js | 89 + .../node_modules/seek-bzip/lib/crc32.js | 104 + .../node_modules/seek-bzip/lib/index.js | 600 + .../node_modules/seek-bzip/lib/stream.js | 42 + .../node_modules/commander/History.md | 256 + .../seek-bzip/node_modules/commander/LICENSE | 22 + .../node_modules/commander/Readme.md | 342 + .../seek-bzip/node_modules/commander/index.js | 1103 + .../node_modules/commander/package.json | 65 + .../node_modules/seek-bzip/package.json | 75 + .../node_modules/semver/CHANGELOG.md | 111 + day1/cli-study/node_modules/semver/LICENSE | 15 + day1/cli-study/node_modules/semver/README.md | 566 + .../node_modules/semver/bin/semver.js | 173 + .../node_modules/semver/classes/comparator.js | 139 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 463 + .../node_modules/semver/classes/semver.js | 290 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 48 + .../node_modules/semver/functions/coerce.js | 51 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 23 + .../node_modules/semver/functions/eq.js | 3 + .../node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 15 + .../node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 37 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + day1/cli-study/node_modules/semver/index.js | 48 + .../node_modules/semver/internal/constants.js | 17 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../node_modules/semver/internal/re.js | 182 + .../node_modules/semver/package.json | 70 + day1/cli-study/node_modules/semver/preload.js | 2 + day1/cli-study/node_modules/semver/range.bnf | 16 + .../node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + .../node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 57 + .../node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 44 + .../node_modules/semver/ranges/subset.js | 155 + .../semver/ranges/to-comparators.js | 8 + .../node_modules/semver/ranges/valid.js | 11 + .../node_modules/shebang-command/index.js | 19 + .../node_modules/shebang-command/license | 9 + .../node_modules/shebang-command/package.json | 66 + .../node_modules/shebang-command/readme.md | 34 + .../node_modules/shebang-regex/index.d.ts | 22 + .../node_modules/shebang-regex/index.js | 2 + .../node_modules/shebang-regex/license | 9 + .../node_modules/shebang-regex/package.json | 67 + .../node_modules/shebang-regex/readme.md | 33 + .../node_modules/signal-exit/CHANGELOG.md | 35 + .../node_modules/signal-exit/LICENSE.txt | 16 + .../node_modules/signal-exit/README.md | 39 + .../node_modules/signal-exit/index.js | 163 + .../node_modules/signal-exit/package.json | 66 + .../node_modules/signal-exit/signals.js | 53 + .../node_modules/slice-ansi/index.js | 59 + .../cli-study/node_modules/slice-ansi/license | 9 + .../node_modules/slice-ansi/package.json | 83 + .../node_modules/slice-ansi/readme.md | 64 + .../node_modules/sort-keys-length/LICENSE.md | 19 + .../node_modules/sort-keys-length/README.md | 35 + .../node_modules/sort-keys-length/index.js | 22 + .../sort-keys-length/package.json | 64 + .../cli-study/node_modules/sort-keys/index.js | 44 + day1/cli-study/node_modules/sort-keys/license | 21 + .../node_modules/sort-keys/package.json | 72 + .../node_modules/sort-keys/readme.md | 60 + .../node_modules/spdx-correct/LICENSE | 202 + .../node_modules/spdx-correct/README.md | 14 + .../node_modules/spdx-correct/index.js | 364 + .../node_modules/spdx-correct/package.json | 88 + .../node_modules/spdx-exceptions/README.md | 36 + .../node_modules/spdx-exceptions/index.json | 40 + .../node_modules/spdx-exceptions/package.json | 55 + .../spdx-expression-parse/AUTHORS | 4 + .../spdx-expression-parse/LICENSE | 22 + .../spdx-expression-parse/README.md | 91 + .../spdx-expression-parse/index.js | 8 + .../spdx-expression-parse/package.json | 96 + .../spdx-expression-parse/parse.js | 138 + .../spdx-expression-parse/scan.js | 131 + .../node_modules/spdx-license-ids/README.md | 52 + .../spdx-license-ids/deprecated.json | 24 + .../node_modules/spdx-license-ids/index.json | 370 + .../spdx-license-ids/package.json | 75 + .../node_modules/sprintf-js/.npmignore | 1 + .../cli-study/node_modules/sprintf-js/LICENSE | 24 + .../node_modules/sprintf-js/README.md | 88 + .../node_modules/sprintf-js/bower.json | 14 + .../node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../dist/angular-sprintf.min.js.map | 1 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + .../sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.js.map | 1 + .../sprintf-js/dist/sprintf.min.map | 1 + .../node_modules/sprintf-js/gruntfile.js | 36 + .../node_modules/sprintf-js/package.json | 54 + .../sprintf-js/src/angular-sprintf.js | 18 + .../node_modules/sprintf-js/src/sprintf.js | 208 + .../node_modules/sprintf-js/test/test.js | 82 + .../node_modules/stat-mode/.npmignore | 1 + .../node_modules/stat-mode/.travis.yml | 27 + .../node_modules/stat-mode/History.md | 40 + .../node_modules/stat-mode/README.md | 182 + .../cli-study/node_modules/stat-mode/index.js | 337 + .../node_modules/stat-mode/package.json | 62 + .../node_modules/stat-mode/test/test.js | 115 + .../node_modules/strict-uri-encode/index.js | 6 + .../node_modules/strict-uri-encode/license | 21 + .../strict-uri-encode/package.json | 62 + .../node_modules/strict-uri-encode/readme.md | 40 + .../node_modules/string-width/index.js | 39 + .../node_modules/string-width/license | 9 + .../node_modules/ansi-regex/index.js | 14 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 85 + .../node_modules/ansi-regex/readme.md | 87 + .../node_modules/strip-ansi/index.d.ts | 15 + .../node_modules/strip-ansi/index.js | 7 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 86 + .../node_modules/strip-ansi/readme.md | 61 + .../node_modules/string-width/package.json | 88 + .../node_modules/string-width/readme.md | 45 + .../string.prototype.trimend/.editorconfig | 20 + .../string.prototype.trimend/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimend/.travis.yml | 8 + .../string.prototype.trimend/CHANGELOG.md | 44 + .../string.prototype.trimend/LICENSE | 21 + .../string.prototype.trimend/README.md | 47 + .../string.prototype.trimend/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimend/index.js | 18 + .../string.prototype.trimend/package.json | 103 + .../string.prototype.trimend/polyfill.js | 15 + .../string.prototype.trimend/shim.js | 14 + .../string.prototype.trimend/test/index.js | 17 + .../string.prototype.trimend/test/shimmed.js | 37 + .../string.prototype.trimend/test/tests.js | 26 + .../string.prototype.trimstart/.editorconfig | 20 + .../string.prototype.trimstart/.eslintrc | 15 + .../.github/workflows/rebase.yml | 15 + .../string.prototype.trimstart/.travis.yml | 12 + .../string.prototype.trimstart/CHANGELOG.md | 44 + .../string.prototype.trimstart/LICENSE | 21 + .../string.prototype.trimstart/README.md | 47 + .../string.prototype.trimstart/auto.js | 3 + .../implementation.js | 12 + .../string.prototype.trimstart/index.js | 18 + .../string.prototype.trimstart/package.json | 103 + .../string.prototype.trimstart/polyfill.js | 15 + .../string.prototype.trimstart/shim.js | 14 + .../string.prototype.trimstart/test/index.js | 18 + .../test/shimmed.js | 37 + .../string.prototype.trimstart/test/tests.js | 26 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 48 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 62 + .../node_modules/string_decoder/package.json | 59 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../cli-study/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 86 + .../node_modules/strip-ansi/readme.md | 46 + .../cli-study/node_modules/strip-bom/index.js | 14 + day1/cli-study/node_modules/strip-bom/license | 21 + .../node_modules/strip-bom/package.json | 73 + .../node_modules/strip-bom/readme.md | 36 + .../cli-study/node_modules/strip-dirs/LICENSE | 20 + .../node_modules/strip-dirs/README.md | 75 + .../node_modules/strip-dirs/index.js | 72 + .../node_modules/strip-dirs/package.json | 74 + .../strip-json-comments/index.d.ts | 36 + .../node_modules/strip-json-comments/index.js | 77 + .../node_modules/strip-json-comments/license | 9 + .../strip-json-comments/package.json | 77 + .../strip-json-comments/readme.md | 84 + .../node_modules/strip-outer/index.js | 11 + .../node_modules/strip-outer/license | 21 + .../node_modules/strip-outer/package.json | 76 + .../node_modules/strip-outer/readme.md | 28 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 131 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 85 + .../node_modules/supports-color/readme.md | 66 + day1/cli-study/node_modules/table/LICENSE | 24 + day1/cli-study/node_modules/table/README.md | 735 + .../node_modules/table/dist/alignString.js | 108 + .../table/dist/alignString.js.flow | 96 + .../table/dist/alignString.js.map | 1 + .../node_modules/table/dist/alignTableData.js | 35 + .../table/dist/alignTableData.js.flow | 21 + .../table/dist/alignTableData.js.map | 1 + .../table/dist/calculateCellHeight.js | 38 + .../table/dist/calculateCellHeight.js.flow | 24 + .../table/dist/calculateCellHeight.js.map | 1 + .../table/dist/calculateCellWidthIndex.js | 28 + .../dist/calculateCellWidthIndex.js.flow | 17 + .../table/dist/calculateCellWidthIndex.js.map | 1 + .../dist/calculateMaximumColumnWidthIndex.js | 37 + .../calculateMaximumColumnWidthIndex.js.flow | 27 + .../calculateMaximumColumnWidthIndex.js.map | 1 + .../table/dist/calculateRowHeightIndex.js | 48 + .../dist/calculateRowHeightIndex.js.flow | 35 + .../table/dist/calculateRowHeightIndex.js.map | 1 + .../node_modules/table/dist/createStream.js | 132 + .../table/dist/createStream.js.flow | 127 + .../table/dist/createStream.js.map | 1 + .../node_modules/table/dist/drawBorder.js | 110 + .../table/dist/drawBorder.js.flow | 101 + .../node_modules/table/dist/drawBorder.js.map | 1 + .../node_modules/table/dist/drawRow.js | 26 + .../node_modules/table/dist/drawRow.js.flow | 15 + .../node_modules/table/dist/drawRow.js.map | 1 + .../node_modules/table/dist/drawTable.js | 59 + .../node_modules/table/dist/drawTable.js.flow | 53 + .../node_modules/table/dist/drawTable.js.map | 1 + .../table/dist/getBorderCharacters.js | 119 + .../table/dist/getBorderCharacters.js.flow | 120 + .../table/dist/getBorderCharacters.js.map | 1 + .../node_modules/table/dist/index.js | 32 + .../node_modules/table/dist/index.js.flow | 9 + .../node_modules/table/dist/index.js.map | 1 + .../node_modules/table/dist/makeConfig.js | 94 + .../table/dist/makeConfig.js.flow | 76 + .../node_modules/table/dist/makeConfig.js.map | 1 + .../table/dist/makeStreamConfig.js | 101 + .../table/dist/makeStreamConfig.js.flow | 83 + .../table/dist/makeStreamConfig.js.map | 1 + .../table/dist/mapDataUsingRowHeightIndex.js | 44 + .../dist/mapDataUsingRowHeightIndex.js.flow | 34 + .../dist/mapDataUsingRowHeightIndex.js.map | 1 + .../node_modules/table/dist/padTableData.js | 24 + .../table/dist/padTableData.js.flow | 14 + .../table/dist/padTableData.js.map | 1 + .../table/dist/schemas/config.json | 114 + .../table/dist/schemas/streamConfig.json | 114 + .../table/dist/stringifyTableData.js | 22 + .../table/dist/stringifyTableData.js.flow | 11 + .../table/dist/stringifyTableData.js.map | 1 + .../node_modules/table/dist/table.js | 110 + .../node_modules/table/dist/table.js.flow | 96 + .../node_modules/table/dist/table.js.map | 1 + .../table/dist/truncateTableData.js | 30 + .../table/dist/truncateTableData.js.flow | 17 + .../table/dist/truncateTableData.js.map | 1 + .../node_modules/table/dist/validateConfig.js | 752 + .../table/dist/validateConfig.js.flow | 34 + .../table/dist/validateConfig.js.map | 1 + .../table/dist/validateStreamConfig.js | 739 + .../table/dist/validateTableData.js | 96 + .../table/dist/validateTableData.js.flow | 44 + .../table/dist/validateTableData.js.map | 1 + .../node_modules/table/dist/wrapCell.js | 48 + .../node_modules/table/dist/wrapCell.js.flow | 35 + .../node_modules/table/dist/wrapCell.js.map | 1 + .../node_modules/table/dist/wrapString.js | 40 + .../table/dist/wrapString.js.flow | 29 + .../node_modules/table/dist/wrapString.js.map | 1 + .../node_modules/table/dist/wrapWord.js | 47 + .../node_modules/table/dist/wrapWord.js.flow | 39 + .../node_modules/table/dist/wrapWord.js.map | 1 + .../cli-study/node_modules/table/package.json | 113 + .../cli-study/node_modules/tar-stream/LICENSE | 21 + .../node_modules/tar-stream/README.md | 168 + .../node_modules/tar-stream/extract.js | 258 + .../node_modules/tar-stream/headers.js | 283 + .../node_modules/tar-stream/index.js | 2 + .../cli-study/node_modules/tar-stream/pack.js | 255 + .../node_modules/tar-stream/package.json | 88 + .../node_modules/text-table/.travis.yml | 4 + .../cli-study/node_modules/text-table/LICENSE | 18 + .../node_modules/text-table/example/align.js | 8 + .../node_modules/text-table/example/center.js | 8 + .../text-table/example/dotalign.js | 9 + .../text-table/example/doubledot.js | 11 + .../node_modules/text-table/example/table.js | 6 + .../node_modules/text-table/index.js | 86 + .../node_modules/text-table/package.json | 73 + .../node_modules/text-table/readme.markdown | 134 + .../node_modules/text-table/test/align.js | 18 + .../text-table/test/ansi-colors.js | 32 + .../node_modules/text-table/test/center.js | 18 + .../node_modules/text-table/test/dotalign.js | 20 + .../node_modules/text-table/test/doubledot.js | 24 + .../node_modules/text-table/test/table.js | 14 + .../node_modules/through/.travis.yml | 5 + .../node_modules/through/LICENSE.APACHE2 | 15 + .../node_modules/through/LICENSE.MIT | 24 + day1/cli-study/node_modules/through/index.js | 108 + .../node_modules/through/package.json | 69 + .../node_modules/through/readme.markdown | 64 + .../node_modules/through/test/async.js | 28 + .../node_modules/through/test/auto-destroy.js | 30 + .../node_modules/through/test/buffering.js | 71 + .../node_modules/through/test/end.js | 45 + .../node_modules/through/test/index.js | 133 + .../node_modules/thunkify-wrap/.npmignore | 5 + .../node_modules/thunkify-wrap/History.md | 73 + .../node_modules/thunkify-wrap/Readme.md | 120 + .../thunkify-wrap/benchmark/base.js | 65 + .../node_modules/thunkify-wrap/example.js | 52 + .../node_modules/thunkify-wrap/genify.js | 29 + .../node_modules/thunkify-wrap/index.js | 173 + .../node_modules/thunkify-wrap/package.json | 55 + .../node_modules/thunkify/.npmignore | 1 + .../node_modules/thunkify/History.md | 26 + day1/cli-study/node_modules/thunkify/Makefile | 8 + .../cli-study/node_modules/thunkify/Readme.md | 27 + day1/cli-study/node_modules/thunkify/index.js | 49 + .../node_modules/thunkify/package.json | 51 + .../node_modules/thunkify/test/index.js | 111 + .../cli-study/node_modules/timed-out/index.js | 55 + day1/cli-study/node_modules/timed-out/license | 21 + .../node_modules/timed-out/package.json | 68 + .../node_modules/timed-out/readme.md | 42 + day1/cli-study/node_modules/tmp/LICENSE | 21 + day1/cli-study/node_modules/tmp/README.md | 314 + day1/cli-study/node_modules/tmp/lib/tmp.js | 611 + day1/cli-study/node_modules/tmp/package.json | 70 + .../node_modules/to-buffer/.travis.yml | 9 + day1/cli-study/node_modules/to-buffer/LICENSE | 21 + .../node_modules/to-buffer/README.md | 23 + .../cli-study/node_modules/to-buffer/index.js | 14 + .../node_modules/to-buffer/package.json | 52 + day1/cli-study/node_modules/to-buffer/test.js | 26 + day1/cli-study/node_modules/toml/.jshintrc | 18 + day1/cli-study/node_modules/toml/.travis.yml | 7 + day1/cli-study/node_modules/toml/CHANGELOG.md | 116 + day1/cli-study/node_modules/toml/LICENSE | 22 + day1/cli-study/node_modules/toml/README.md | 93 + day1/cli-study/node_modules/toml/benchmark.js | 12 + day1/cli-study/node_modules/toml/index.d.ts | 3 + day1/cli-study/node_modules/toml/index.js | 9 + .../node_modules/toml/lib/compiler.js | 195 + .../cli-study/node_modules/toml/lib/parser.js | 3841 ++++ day1/cli-study/node_modules/toml/package.json | 59 + .../node_modules/toml/src/toml.pegjs | 231 + .../cli-study/node_modules/toml/test/bad.toml | 5 + .../node_modules/toml/test/example.toml | 32 + .../node_modules/toml/test/hard_example.toml | 33 + .../node_modules/toml/test/inline_tables.toml | 10 + .../toml/test/literal_strings.toml | 5 + .../toml/test/multiline_eat_whitespace.toml | 15 + .../toml/test/multiline_literal_strings.toml | 7 + .../toml/test/multiline_strings.toml | 6 + .../cli-study/node_modules/toml/test/smoke.js | 22 + .../toml/test/table_arrays_easy.toml | 10 + .../toml/test/table_arrays_hard.toml | 31 + .../node_modules/toml/test/test_toml.js | 586 + .../node_modules/trim-repeated/index.js | 10 + .../node_modules/trim-repeated/license | 21 + .../node_modules/trim-repeated/package.json | 73 + .../node_modules/trim-repeated/readme.md | 47 + .../node_modules/tsconfig-paths/.nycrc.json | 8 + .../node_modules/tsconfig-paths/CHANGELOG.md | 307 + .../node_modules/tsconfig-paths/LICENSE | 21 + .../node_modules/tsconfig-paths/README.md | 231 + .../tsconfig-paths/lib/config-loader.d.ts | 33 + .../tsconfig-paths/lib/config-loader.js | 55 + .../tsconfig-paths/lib/filesystem.d.ts | 33 + .../tsconfig-paths/lib/filesystem.js | 53 + .../tsconfig-paths/lib/index.d.ts | 5 + .../node_modules/tsconfig-paths/lib/index.js | 13 + .../tsconfig-paths/lib/mapping-entry.d.ts | 17 + .../tsconfig-paths/lib/mapping-entry.js | 51 + .../tsconfig-paths/lib/match-path-async.d.ts | 21 + .../tsconfig-paths/lib/match-path-async.js | 113 + .../tsconfig-paths/lib/match-path-sync.d.ts | 30 + .../tsconfig-paths/lib/match-path-sync.js | 87 + .../tsconfig-paths/lib/options.d.ts | 4 + .../tsconfig-paths/lib/options.js | 13 + .../tsconfig-paths/lib/register.d.ts | 6 + .../tsconfig-paths/lib/register.js | 82 + .../tsconfig-paths/lib/try-path.d.ts | 15 + .../tsconfig-paths/lib/try-path.js | 91 + .../tsconfig-paths/lib/tsconfig-loader.d.ts | 28 + .../tsconfig-paths/lib/tsconfig-loader.js | 97 + .../node_modules/tsconfig-paths/package.json | 97 + .../node_modules/tsconfig-paths/register.js | 1 + .../test/config-loader-tests.ts | 90 + .../test/data/match-path-data.ts | 212 + .../tsconfig-paths/test/filesystem-tests.ts | 46 + .../tsconfig-paths/test/mapping-entry-test.ts | 47 + .../test/match-path-async-tests.ts | 27 + .../test/match-path-sync-tests.ts | 23 + .../tsconfig-paths/test/mocha.opts | 3 + .../tsconfig-paths/test/try-path-tests.ts | 99 + .../test/tsconfig-loader-tests.ts | 203 + .../tsconfig-paths/test/tsconfig-named.json | 10 + .../tsconfig-paths/test/tsconfig.json | 9 + .../node_modules/tsconfig-paths/tslint.json | 88 + .../node_modules/tslib/CopyrightNotice.txt | 15 + day1/cli-study/node_modules/tslib/LICENSE.txt | 12 + day1/cli-study/node_modules/tslib/README.md | 142 + .../cli-study/node_modules/tslib/package.json | 56 + day1/cli-study/node_modules/tslib/tslib.d.ts | 37 + .../node_modules/tslib/tslib.es6.html | 1 + .../cli-study/node_modules/tslib/tslib.es6.js | 218 + day1/cli-study/node_modules/tslib/tslib.html | 1 + day1/cli-study/node_modules/tslib/tslib.js | 284 + .../node_modules/tunnel-agent/LICENSE | 55 + .../node_modules/tunnel-agent/README.md | 4 + .../node_modules/tunnel-agent/index.js | 244 + .../node_modules/tunnel-agent/package.json | 55 + .../cli-study/node_modules/type-check/LICENSE | 22 + .../node_modules/type-check/README.md | 210 + .../node_modules/type-check/lib/check.js | 128 + .../node_modules/type-check/lib/index.js | 16 + .../node_modules/type-check/lib/parse-type.js | 198 + .../node_modules/type-check/package.json | 70 + .../node_modules/type-fest/index.d.ts | 20 + day1/cli-study/node_modules/type-fest/license | 9 + .../node_modules/type-fest/package.json | 83 + .../node_modules/type-fest/readme.md | 635 + .../node_modules/type-fest/source/basic.d.ts | 67 + .../node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + .../node_modules/type-fest/source/merge.d.ts | 22 + .../type-fest/source/mutable.d.ts | 22 + .../node_modules/type-fest/source/opaque.d.ts | 40 + .../type-fest/source/package-json.d.ts | 501 + .../type-fest/source/partial-deep.d.ts | 72 + .../type-fest/source/promisable.d.ts | 23 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 32 + .../type-fest/source/require-exactly-one.d.ts | 36 + .../type-fest/source/set-optional.d.ts | 32 + .../type-fest/source/set-required.d.ts | 32 + .../node_modules/unbzip2-stream/LICENSE | 24 + .../node_modules/unbzip2-stream/README.md | 59 + .../unbzip2-stream/dist/unbzip2-stream.min.js | 1 + .../node_modules/unbzip2-stream/index.js | 93 + .../unbzip2-stream/lib/bit_iterator.js | 39 + .../node_modules/unbzip2-stream/lib/bzip2.js | 365 + .../node_modules/unbzip2-stream/package.json | 80 + .../cli-study/node_modules/unyield/.npmignore | 4 + .../cli-study/node_modules/unyield/History.md | 5 + day1/cli-study/node_modules/unyield/Makefile | 8 + day1/cli-study/node_modules/unyield/Readme.md | 56 + day1/cli-study/node_modules/unyield/index.js | 32 + .../node_modules/unyield/package.json | 51 + day1/cli-study/node_modules/uri-js/README.md | 199 + day1/cli-study/node_modules/uri-js/bower.json | 47 + .../node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + .../node_modules/uri-js/dist/es5/uri.all.js | 1389 ++ .../uri-js/dist/es5/uri.all.js.map | 1 + .../uri-js/dist/es5/uri.all.min.d.ts | 59 + .../uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + .../uri-js/dist/esnext/index.d.ts | 1 + .../node_modules/uri-js/dist/esnext/index.js | 13 + .../uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 27 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + .../node_modules/uri-js/dist/esnext/uri.d.ts | 59 + .../node_modules/uri-js/dist/esnext/uri.js | 480 + .../uri-js/dist/esnext/uri.js.map | 1 + .../node_modules/uri-js/dist/esnext/util.d.ts | 6 + .../node_modules/uri-js/dist/esnext/util.js | 36 + .../uri-js/dist/esnext/util.js.map | 1 + .../node_modules/uri-js/package.json | 93 + .../node_modules/uri-js/rollup.config.js | 32 + .../node_modules/uri-js/src/index.ts | 18 + .../node_modules/uri-js/src/punycode.d.ts | 24 + .../node_modules/uri-js/src/regexps-iri.ts | 4 + .../node_modules/uri-js/src/regexps-uri.ts | 89 + .../node_modules/uri-js/src/schemes/http.ts | 36 + .../node_modules/uri-js/src/schemes/https.ts | 11 + .../node_modules/uri-js/src/schemes/mailto.ts | 182 + .../uri-js/src/schemes/urn-uuid.ts | 36 + .../node_modules/uri-js/src/schemes/urn.ts | 69 + day1/cli-study/node_modules/uri-js/src/uri.ts | 556 + .../cli-study/node_modules/uri-js/src/util.ts | 40 + .../node_modules/uri-js/tests/qunit.css | 118 + .../node_modules/uri-js/tests/qunit.js | 1042 + .../uri-js/tests/test-es5-min.html | 17 + .../node_modules/uri-js/tests/test-es5.html | 17 + .../node_modules/uri-js/tests/tests.js | 774 + .../node_modules/uri-js/tsconfig.json | 20 + day1/cli-study/node_modules/uri-js/yarn.lock | 1902 ++ .../node_modules/url-parse-lax/index.js | 12 + .../node_modules/url-parse-lax/license | 9 + .../node_modules/url-parse-lax/package.json | 74 + .../node_modules/url-parse-lax/readme.md | 127 + .../node_modules/url-to-options/LICENSE | 21 + .../node_modules/url-to-options/README.md | 29 + .../node_modules/url-to-options/index.js | 28 + .../node_modules/url-to-options/package.json | 63 + .../node_modules/util-deprecate/History.md | 16 + .../node_modules/util-deprecate/LICENSE | 24 + .../node_modules/util-deprecate/README.md | 53 + .../node_modules/util-deprecate/browser.js | 67 + .../node_modules/util-deprecate/node.js | 6 + .../node_modules/util-deprecate/package.json | 56 + .../v8-compile-cache/CHANGELOG.md | 45 + .../node_modules/v8-compile-cache/LICENSE | 21 + .../node_modules/v8-compile-cache/README.md | 53 + .../v8-compile-cache/package.json | 65 + .../v8-compile-cache/v8-compile-cache.js | 367 + .../validate-npm-package-license/LICENSE | 202 + .../validate-npm-package-license/README.md | 113 + .../validate-npm-package-license/index.js | 86 + .../validate-npm-package-license/package.json | 67 + day1/cli-study/node_modules/ware/History.md | 56 + day1/cli-study/node_modules/ware/Readme.md | 104 + day1/cli-study/node_modules/ware/lib/index.js | 91 + day1/cli-study/node_modules/ware/package.json | 62 + .../cli-study/node_modules/wcwidth/.npmignore | 1 + day1/cli-study/node_modules/wcwidth/LICENSE | 30 + day1/cli-study/node_modules/wcwidth/Readme.md | 33 + .../node_modules/wcwidth/combining.js | 50 + .../node_modules/wcwidth/docs/index.md | 65 + day1/cli-study/node_modules/wcwidth/index.js | 99 + .../node_modules/wcwidth/package.json | 73 + .../node_modules/wcwidth/test/index.js | 64 + .../cli-study/node_modules/which/CHANGELOG.md | 166 + day1/cli-study/node_modules/which/LICENSE | 15 + day1/cli-study/node_modules/which/README.md | 54 + .../node_modules/which/bin/node-which | 52 + .../cli-study/node_modules/which/package.json | 76 + day1/cli-study/node_modules/which/which.js | 125 + .../node_modules/win-fork/.npmignore | 15 + .../cli-study/node_modules/win-fork/README.md | 39 + .../win-fork/bin/win-line-endings | 5 + .../node_modules/win-fork/bin/win-spawn | 12 + day1/cli-study/node_modules/win-fork/index.js | 89 + .../node_modules/win-fork/package.json | 54 + day1/cli-study/node_modules/word-wrap/LICENSE | 21 + .../node_modules/word-wrap/README.md | 182 + .../node_modules/word-wrap/index.d.ts | 50 + .../cli-study/node_modules/word-wrap/index.js | 46 + .../node_modules/word-wrap/package.json | 137 + .../cli-study/node_modules/wrap-fn/History.md | 43 + day1/cli-study/node_modules/wrap-fn/Readme.md | 79 + day1/cli-study/node_modules/wrap-fn/index.js | 125 + .../node_modules/wrap-fn/package.json | 65 + day1/cli-study/node_modules/wrappy/LICENSE | 15 + day1/cli-study/node_modules/wrappy/README.md | 36 + .../node_modules/wrappy/package.json | 59 + day1/cli-study/node_modules/wrappy/wrappy.js | 33 + day1/cli-study/node_modules/write/LICENSE | 21 + day1/cli-study/node_modules/write/README.md | 178 + day1/cli-study/node_modules/write/index.js | 160 + .../cli-study/node_modules/write/package.json | 111 + day1/cli-study/node_modules/xtend/.jshintrc | 30 + day1/cli-study/node_modules/xtend/LICENSE | 20 + day1/cli-study/node_modules/xtend/README.md | 32 + .../cli-study/node_modules/xtend/immutable.js | 19 + day1/cli-study/node_modules/xtend/mutable.js | 17 + .../cli-study/node_modules/xtend/package.json | 86 + day1/cli-study/node_modules/xtend/test.js | 103 + day1/cli-study/node_modules/yauzl/LICENSE | 21 + day1/cli-study/node_modules/yauzl/README.md | 658 + day1/cli-study/node_modules/yauzl/index.js | 796 + .../cli-study/node_modules/yauzl/package.json | 68 + day1/cli-study/package-lock.json | 2938 +++ day1/cli-study/package.json | 31 + day1/cli-study/src/constants.js | 10 + day1/cli-study/src/create.js | 144 + day1/cli-study/src/main.js | 56 + day1/repos.json | 299 + day1/work.md | 1 + ...46\344\271\240\346\227\245\350\256\260.md" | 20 +- 9076 files changed, 624982 insertions(+), 1 deletion(-) create mode 100644 day1/cli-study/.eslintrc.js create mode 100644 day1/cli-study/bin/www create mode 100644 day1/cli-study/node_modules/.bin/_metalsmith create mode 100644 day1/cli-study/node_modules/.bin/_metalsmith.cmd create mode 100644 day1/cli-study/node_modules/.bin/_metalsmith.ps1 create mode 100644 day1/cli-study/node_modules/.bin/acorn create mode 100644 day1/cli-study/node_modules/.bin/acorn.cmd create mode 100644 day1/cli-study/node_modules/.bin/acorn.ps1 create mode 100644 day1/cli-study/node_modules/.bin/cake create mode 100644 day1/cli-study/node_modules/.bin/cake.cmd create mode 100644 day1/cli-study/node_modules/.bin/cake.ps1 create mode 100644 day1/cli-study/node_modules/.bin/coffee create mode 100644 day1/cli-study/node_modules/.bin/coffee.cmd create mode 100644 day1/cli-study/node_modules/.bin/coffee.ps1 create mode 100644 day1/cli-study/node_modules/.bin/ejs create mode 100644 day1/cli-study/node_modules/.bin/ejs.cmd create mode 100644 day1/cli-study/node_modules/.bin/ejs.ps1 create mode 100644 day1/cli-study/node_modules/.bin/eslint create mode 100644 day1/cli-study/node_modules/.bin/eslint.cmd create mode 100644 day1/cli-study/node_modules/.bin/eslint.ps1 create mode 100644 day1/cli-study/node_modules/.bin/esparse create mode 100644 day1/cli-study/node_modules/.bin/esparse.cmd create mode 100644 day1/cli-study/node_modules/.bin/esparse.ps1 create mode 100644 day1/cli-study/node_modules/.bin/esvalidate create mode 100644 day1/cli-study/node_modules/.bin/esvalidate.cmd create mode 100644 day1/cli-study/node_modules/.bin/esvalidate.ps1 create mode 100644 day1/cli-study/node_modules/.bin/jake create mode 100644 day1/cli-study/node_modules/.bin/jake.cmd create mode 100644 day1/cli-study/node_modules/.bin/jake.ps1 create mode 100644 day1/cli-study/node_modules/.bin/js-yaml create mode 100644 day1/cli-study/node_modules/.bin/js-yaml.cmd create mode 100644 day1/cli-study/node_modules/.bin/js-yaml.ps1 create mode 100644 day1/cli-study/node_modules/.bin/json5 create mode 100644 day1/cli-study/node_modules/.bin/json5.cmd create mode 100644 day1/cli-study/node_modules/.bin/json5.ps1 create mode 100644 day1/cli-study/node_modules/.bin/metalsmith create mode 100644 day1/cli-study/node_modules/.bin/metalsmith.cmd create mode 100644 day1/cli-study/node_modules/.bin/metalsmith.ps1 create mode 100644 day1/cli-study/node_modules/.bin/mkdirp create mode 100644 day1/cli-study/node_modules/.bin/mkdirp.cmd create mode 100644 day1/cli-study/node_modules/.bin/mkdirp.ps1 create mode 100644 day1/cli-study/node_modules/.bin/ncp create mode 100644 day1/cli-study/node_modules/.bin/ncp.cmd create mode 100644 day1/cli-study/node_modules/.bin/ncp.ps1 create mode 100644 day1/cli-study/node_modules/.bin/node-which create mode 100644 day1/cli-study/node_modules/.bin/node-which.cmd create mode 100644 day1/cli-study/node_modules/.bin/node-which.ps1 create mode 100644 day1/cli-study/node_modules/.bin/rimraf create mode 100644 day1/cli-study/node_modules/.bin/rimraf.cmd create mode 100644 day1/cli-study/node_modules/.bin/rimraf.ps1 create mode 100644 day1/cli-study/node_modules/.bin/seek-bunzip create mode 100644 day1/cli-study/node_modules/.bin/seek-bunzip.cmd create mode 100644 day1/cli-study/node_modules/.bin/seek-bunzip.ps1 create mode 100644 day1/cli-study/node_modules/.bin/seek-table create mode 100644 day1/cli-study/node_modules/.bin/seek-table.cmd create mode 100644 day1/cli-study/node_modules/.bin/seek-table.ps1 create mode 100644 day1/cli-study/node_modules/.bin/semver create mode 100644 day1/cli-study/node_modules/.bin/semver.cmd create mode 100644 day1/cli-study/node_modules/.bin/semver.ps1 create mode 100644 day1/cli-study/node_modules/.bin/win-fork create mode 100644 day1/cli-study/node_modules/.bin/win-fork.cmd create mode 100644 day1/cli-study/node_modules/.bin/win-fork.ps1 create mode 100644 day1/cli-study/node_modules/.bin/win-line-endings create mode 100644 day1/cli-study/node_modules/.bin/win-line-endings.cmd create mode 100644 day1/cli-study/node_modules/.bin/win-line-endings.ps1 create mode 100644 day1/cli-study/node_modules/.bin/win-spawn create mode 100644 day1/cli-study/node_modules/.bin/win-spawn.cmd create mode 100644 day1/cli-study/node_modules/.bin/win-spawn.ps1 create mode 100644 day1/cli-study/node_modules/@babel/code-frame/LICENSE create mode 100644 day1/cli-study/node_modules/@babel/code-frame/README.md create mode 100644 day1/cli-study/node_modules/@babel/code-frame/lib/index.js create mode 100644 day1/cli-study/node_modules/@babel/code-frame/package.json create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/README.md create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/package.json create mode 100644 day1/cli-study/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 day1/cli-study/node_modules/@babel/highlight/LICENSE create mode 100644 day1/cli-study/node_modules/@babel/highlight/README.md create mode 100644 day1/cli-study/node_modules/@babel/highlight/lib/index.js create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js.flow create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/templates.js create mode 100644 day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts create mode 100644 day1/cli-study/node_modules/@babel/highlight/package.json create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/example.d.ts create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/example.js create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/example.js.map create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/index.d.ts create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/index.js create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/index.js.map create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/index.d.ts create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/index.js create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/index.js.map create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/tests/test.d.ts create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/tests/test.js create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/dist/source/tests/test.js.map create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/license create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/package.json create mode 100644 day1/cli-study/node_modules/@sindresorhus/is/readme.md create mode 100644 day1/cli-study/node_modules/@types/color-name/LICENSE create mode 100644 day1/cli-study/node_modules/@types/color-name/README.md create mode 100644 day1/cli-study/node_modules/@types/color-name/index.d.ts create mode 100644 day1/cli-study/node_modules/@types/color-name/package.json create mode 100644 day1/cli-study/node_modules/@types/json5/README.md create mode 100644 day1/cli-study/node_modules/@types/json5/index.d.ts create mode 100644 day1/cli-study/node_modules/@types/json5/package.json create mode 100644 day1/cli-study/node_modules/@types/json5/types-metadata.json create mode 100644 day1/cli-study/node_modules/absolute/.npmignore create mode 100644 day1/cli-study/node_modules/absolute/README.md create mode 100644 day1/cli-study/node_modules/absolute/absolute.js create mode 100644 day1/cli-study/node_modules/absolute/package.json create mode 100644 day1/cli-study/node_modules/absolute/test/test.js create mode 100644 day1/cli-study/node_modules/acorn-jsx/LICENSE create mode 100644 day1/cli-study/node_modules/acorn-jsx/README.md create mode 100644 day1/cli-study/node_modules/acorn-jsx/index.js create mode 100644 day1/cli-study/node_modules/acorn-jsx/package.json create mode 100644 day1/cli-study/node_modules/acorn-jsx/xhtml.js create mode 100644 day1/cli-study/node_modules/acorn/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/acorn/LICENSE create mode 100644 day1/cli-study/node_modules/acorn/README.md create mode 100644 day1/cli-study/node_modules/acorn/bin/acorn create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.d.ts create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.js create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.js.map create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.mjs create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.mjs.d.ts create mode 100644 day1/cli-study/node_modules/acorn/dist/acorn.mjs.map create mode 100644 day1/cli-study/node_modules/acorn/dist/bin.js create mode 100644 day1/cli-study/node_modules/acorn/package.json create mode 100644 day1/cli-study/node_modules/ajv/.tonic_example.js create mode 100644 day1/cli-study/node_modules/ajv/LICENSE create mode 100644 day1/cli-study/node_modules/ajv/README.md create mode 100644 day1/cli-study/node_modules/ajv/dist/ajv.bundle.js create mode 100644 day1/cli-study/node_modules/ajv/dist/ajv.min.js create mode 100644 day1/cli-study/node_modules/ajv/dist/ajv.min.js.map create mode 100644 day1/cli-study/node_modules/ajv/lib/ajv.d.ts create mode 100644 day1/cli-study/node_modules/ajv/lib/ajv.js create mode 100644 day1/cli-study/node_modules/ajv/lib/cache.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/async.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/equal.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/error_classes.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/formats.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/index.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/resolve.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/rules.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/schema_obj.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/ucs2length.js create mode 100644 day1/cli-study/node_modules/ajv/lib/compile/util.js create mode 100644 day1/cli-study/node_modules/ajv/lib/data.js create mode 100644 day1/cli-study/node_modules/ajv/lib/definition_schema.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/_limit.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/allOf.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/anyOf.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/coerce.def create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/comment.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/const.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/contains.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/custom.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/defaults.def create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/definitions.def create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/dependencies.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/enum.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/errors.def create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/format.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/if.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/items.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/missing.def create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/not.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/oneOf.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/pattern.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/properties.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/propertyNames.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/ref.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/required.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dot/validate.jst create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/README.md create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/_limit.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/allOf.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/comment.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/const.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/contains.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/custom.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/enum.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/format.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/if.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/index.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/items.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/not.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/pattern.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/properties.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/propertyNames.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/ref.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/required.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 day1/cli-study/node_modules/ajv/lib/dotjs/validate.js create mode 100644 day1/cli-study/node_modules/ajv/lib/keyword.js create mode 100644 day1/cli-study/node_modules/ajv/lib/refs/data.json create mode 100644 day1/cli-study/node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 day1/cli-study/node_modules/ajv/lib/refs/json-schema-draft-06.json create mode 100644 day1/cli-study/node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 day1/cli-study/node_modules/ajv/lib/refs/json-schema-secure.json create mode 100644 day1/cli-study/node_modules/ajv/package.json create mode 100644 day1/cli-study/node_modules/ajv/scripts/.eslintrc.yml create mode 100644 day1/cli-study/node_modules/ajv/scripts/bundle.js create mode 100644 day1/cli-study/node_modules/ajv/scripts/compile-dots.js create mode 100644 day1/cli-study/node_modules/ajv/scripts/info create mode 100644 day1/cli-study/node_modules/ajv/scripts/prepare-tests create mode 100644 day1/cli-study/node_modules/ajv/scripts/publish-built-version create mode 100644 day1/cli-study/node_modules/ajv/scripts/travis-gh-pages create mode 100644 day1/cli-study/node_modules/ansi-colors/LICENSE create mode 100644 day1/cli-study/node_modules/ansi-colors/README.md create mode 100644 day1/cli-study/node_modules/ansi-colors/index.js create mode 100644 day1/cli-study/node_modules/ansi-colors/package.json create mode 100644 day1/cli-study/node_modules/ansi-colors/symbols.js create mode 100644 day1/cli-study/node_modules/ansi-colors/types/index.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/index.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/index.js create mode 100644 day1/cli-study/node_modules/ansi-escapes/license create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/index.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/license create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/package.json create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/readme.md create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/async-return-type.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/conditional-except.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/conditional-keys.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/conditional-pick.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/except.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/literal-union.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/merge.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/mutable.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/opaque.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/package-json.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/partial-deep.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/promisable.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/promise-value.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/set-optional.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/set-required.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/node_modules/type-fest/source/tsconfig-json.d.ts create mode 100644 day1/cli-study/node_modules/ansi-escapes/package.json create mode 100644 day1/cli-study/node_modules/ansi-escapes/readme.md create mode 100644 day1/cli-study/node_modules/ansi-red/LICENSE create mode 100644 day1/cli-study/node_modules/ansi-red/index.js create mode 100644 day1/cli-study/node_modules/ansi-red/package.json create mode 100644 day1/cli-study/node_modules/ansi-red/readme.md create mode 100644 day1/cli-study/node_modules/ansi-regex/index.d.ts create mode 100644 day1/cli-study/node_modules/ansi-regex/index.js create mode 100644 day1/cli-study/node_modules/ansi-regex/license create mode 100644 day1/cli-study/node_modules/ansi-regex/package.json create mode 100644 day1/cli-study/node_modules/ansi-regex/readme.md create mode 100644 day1/cli-study/node_modules/ansi-styles/index.js create mode 100644 day1/cli-study/node_modules/ansi-styles/license create mode 100644 day1/cli-study/node_modules/ansi-styles/package.json create mode 100644 day1/cli-study/node_modules/ansi-styles/readme.md create mode 100644 day1/cli-study/node_modules/ansi-wrap/LICENSE create mode 100644 day1/cli-study/node_modules/ansi-wrap/README.md create mode 100644 day1/cli-study/node_modules/ansi-wrap/index.js create mode 100644 day1/cli-study/node_modules/ansi-wrap/package.json create mode 100644 day1/cli-study/node_modules/archive-type/index.js create mode 100644 day1/cli-study/node_modules/archive-type/license create mode 100644 day1/cli-study/node_modules/archive-type/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/archive-type/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/archive-type/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/archive-type/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/archive-type/package.json create mode 100644 day1/cli-study/node_modules/archive-type/readme.md create mode 100644 day1/cli-study/node_modules/argparse/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/argparse/LICENSE create mode 100644 day1/cli-study/node_modules/argparse/README.md create mode 100644 day1/cli-study/node_modules/argparse/index.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/append.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/append/constant.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/count.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/help.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/store.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/store/constant.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/store/false.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/store/true.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/subparsers.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action/version.js create mode 100644 day1/cli-study/node_modules/argparse/lib/action_container.js create mode 100644 day1/cli-study/node_modules/argparse/lib/argparse.js create mode 100644 day1/cli-study/node_modules/argparse/lib/argument/error.js create mode 100644 day1/cli-study/node_modules/argparse/lib/argument/exclusive.js create mode 100644 day1/cli-study/node_modules/argparse/lib/argument/group.js create mode 100644 day1/cli-study/node_modules/argparse/lib/argument_parser.js create mode 100644 day1/cli-study/node_modules/argparse/lib/const.js create mode 100644 day1/cli-study/node_modules/argparse/lib/help/added_formatters.js create mode 100644 day1/cli-study/node_modules/argparse/lib/help/formatter.js create mode 100644 day1/cli-study/node_modules/argparse/lib/namespace.js create mode 100644 day1/cli-study/node_modules/argparse/lib/utils.js create mode 100644 day1/cli-study/node_modules/argparse/package.json create mode 100644 day1/cli-study/node_modules/array-includes/.editorconfig create mode 100644 day1/cli-study/node_modules/array-includes/.eslintrc create mode 100644 day1/cli-study/node_modules/array-includes/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/array-includes/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/array-includes/.travis.yml create mode 100644 day1/cli-study/node_modules/array-includes/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/array-includes/LICENSE create mode 100644 day1/cli-study/node_modules/array-includes/README.md create mode 100644 day1/cli-study/node_modules/array-includes/auto.js create mode 100644 day1/cli-study/node_modules/array-includes/implementation.js create mode 100644 day1/cli-study/node_modules/array-includes/index.js create mode 100644 day1/cli-study/node_modules/array-includes/package.json create mode 100644 day1/cli-study/node_modules/array-includes/polyfill.js create mode 100644 day1/cli-study/node_modules/array-includes/shim.js create mode 100644 day1/cli-study/node_modules/array-includes/test.html create mode 100644 day1/cli-study/node_modules/array-includes/test/index.js create mode 100644 day1/cli-study/node_modules/array-includes/test/shimmed.js create mode 100644 day1/cli-study/node_modules/array-includes/test/tests.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.editorconfig create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.eslintrc create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.nycrc create mode 100644 day1/cli-study/node_modules/array.prototype.flat/.travis.yml create mode 100644 day1/cli-study/node_modules/array.prototype.flat/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/array.prototype.flat/LICENSE create mode 100644 day1/cli-study/node_modules/array.prototype.flat/README.md create mode 100644 day1/cli-study/node_modules/array.prototype.flat/auto.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/implementation.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/index.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/package.json create mode 100644 day1/cli-study/node_modules/array.prototype.flat/polyfill.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/shim.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/test/index.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/test/shimmed.js create mode 100644 day1/cli-study/node_modules/array.prototype.flat/test/tests.js create mode 100644 day1/cli-study/node_modules/astral-regex/index.js create mode 100644 day1/cli-study/node_modules/astral-regex/license create mode 100644 day1/cli-study/node_modules/astral-regex/package.json create mode 100644 day1/cli-study/node_modules/astral-regex/readme.md create mode 100644 day1/cli-study/node_modules/async/.travis.yml create mode 100644 day1/cli-study/node_modules/async/LICENSE create mode 100644 day1/cli-study/node_modules/async/README.md create mode 100644 day1/cli-study/node_modules/async/bower.json create mode 100644 day1/cli-study/node_modules/async/component.json create mode 100644 day1/cli-study/node_modules/async/lib/async.js create mode 100644 day1/cli-study/node_modules/async/package.json create mode 100644 day1/cli-study/node_modules/async/support/sync-package-managers.js create mode 100644 day1/cli-study/node_modules/axios/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/axios/LICENSE create mode 100644 day1/cli-study/node_modules/axios/README.md create mode 100644 day1/cli-study/node_modules/axios/UPGRADE_GUIDE.md create mode 100644 day1/cli-study/node_modules/axios/dist/axios.js create mode 100644 day1/cli-study/node_modules/axios/dist/axios.map create mode 100644 day1/cli-study/node_modules/axios/dist/axios.min.js create mode 100644 day1/cli-study/node_modules/axios/dist/axios.min.map create mode 100644 day1/cli-study/node_modules/axios/index.d.ts create mode 100644 day1/cli-study/node_modules/axios/index.js create mode 100644 day1/cli-study/node_modules/axios/lib/adapters/README.md create mode 100644 day1/cli-study/node_modules/axios/lib/adapters/http.js create mode 100644 day1/cli-study/node_modules/axios/lib/adapters/xhr.js create mode 100644 day1/cli-study/node_modules/axios/lib/axios.js create mode 100644 day1/cli-study/node_modules/axios/lib/cancel/Cancel.js create mode 100644 day1/cli-study/node_modules/axios/lib/cancel/CancelToken.js create mode 100644 day1/cli-study/node_modules/axios/lib/cancel/isCancel.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/Axios.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/InterceptorManager.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/README.md create mode 100644 day1/cli-study/node_modules/axios/lib/core/buildFullPath.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/createError.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/dispatchRequest.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/enhanceError.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/mergeConfig.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/settle.js create mode 100644 day1/cli-study/node_modules/axios/lib/core/transformData.js create mode 100644 day1/cli-study/node_modules/axios/lib/defaults.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/README.md create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/bind.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/buildURL.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/combineURLs.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/cookies.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/deprecatedMethod.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/isAbsoluteURL.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/isURLSameOrigin.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/normalizeHeaderName.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/parseHeaders.js create mode 100644 day1/cli-study/node_modules/axios/lib/helpers/spread.js create mode 100644 day1/cli-study/node_modules/axios/lib/utils.js create mode 100644 day1/cli-study/node_modules/axios/package.json create mode 100644 day1/cli-study/node_modules/balanced-match/.npmignore create mode 100644 day1/cli-study/node_modules/balanced-match/LICENSE.md create mode 100644 day1/cli-study/node_modules/balanced-match/README.md create mode 100644 day1/cli-study/node_modules/balanced-match/index.js create mode 100644 day1/cli-study/node_modules/balanced-match/package.json create mode 100644 day1/cli-study/node_modules/base64-js/LICENSE create mode 100644 day1/cli-study/node_modules/base64-js/README.md create mode 100644 day1/cli-study/node_modules/base64-js/base64js.min.js create mode 100644 day1/cli-study/node_modules/base64-js/index.js create mode 100644 day1/cli-study/node_modules/base64-js/package.json create mode 100644 day1/cli-study/node_modules/bl/.jshintrc create mode 100644 day1/cli-study/node_modules/bl/.travis.yml create mode 100644 day1/cli-study/node_modules/bl/LICENSE.md create mode 100644 day1/cli-study/node_modules/bl/README.md create mode 100644 day1/cli-study/node_modules/bl/bl.js create mode 100644 day1/cli-study/node_modules/bl/package.json create mode 100644 day1/cli-study/node_modules/bl/test/test.js create mode 100644 day1/cli-study/node_modules/bluebird/LICENSE create mode 100644 day1/cli-study/node_modules/bluebird/README.md create mode 100644 day1/cli-study/node_modules/bluebird/changelog.md create mode 100644 day1/cli-study/node_modules/bluebird/js/browser/bluebird.core.js create mode 100644 day1/cli-study/node_modules/bluebird/js/browser/bluebird.core.min.js create mode 100644 day1/cli-study/node_modules/bluebird/js/browser/bluebird.js create mode 100644 day1/cli-study/node_modules/bluebird/js/browser/bluebird.min.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/any.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/assert.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/async.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/bind.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/bluebird.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/call_get.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/cancel.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/catch_filter.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/context.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/debuggability.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/direct_resolve.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/each.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/errors.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/es5.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/filter.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/finally.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/generators.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/join.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/map.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/method.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/nodeback.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/nodeify.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/promise.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/promise_array.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/promisify.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/props.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/queue.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/race.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/reduce.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/schedule.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/settle.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/some.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/synchronous_inspection.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/thenables.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/timers.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/using.js create mode 100644 day1/cli-study/node_modules/bluebird/js/release/util.js create mode 100644 day1/cli-study/node_modules/bluebird/package.json create mode 100644 day1/cli-study/node_modules/brace-expansion/LICENSE create mode 100644 day1/cli-study/node_modules/brace-expansion/README.md create mode 100644 day1/cli-study/node_modules/brace-expansion/index.js create mode 100644 day1/cli-study/node_modules/brace-expansion/package.json create mode 100644 day1/cli-study/node_modules/buffer-alloc-unsafe/index.js create mode 100644 day1/cli-study/node_modules/buffer-alloc-unsafe/package.json create mode 100644 day1/cli-study/node_modules/buffer-alloc-unsafe/readme.md create mode 100644 day1/cli-study/node_modules/buffer-alloc/index.js create mode 100644 day1/cli-study/node_modules/buffer-alloc/package.json create mode 100644 day1/cli-study/node_modules/buffer-alloc/readme.md create mode 100644 day1/cli-study/node_modules/buffer-crc32/LICENSE create mode 100644 day1/cli-study/node_modules/buffer-crc32/README.md create mode 100644 day1/cli-study/node_modules/buffer-crc32/index.js create mode 100644 day1/cli-study/node_modules/buffer-crc32/package.json create mode 100644 day1/cli-study/node_modules/buffer-fill/index.js create mode 100644 day1/cli-study/node_modules/buffer-fill/package.json create mode 100644 day1/cli-study/node_modules/buffer-fill/readme.md create mode 100644 day1/cli-study/node_modules/buffer/AUTHORS.md create mode 100644 day1/cli-study/node_modules/buffer/LICENSE create mode 100644 day1/cli-study/node_modules/buffer/README.md create mode 100644 day1/cli-study/node_modules/buffer/index.d.ts create mode 100644 day1/cli-study/node_modules/buffer/index.js create mode 100644 day1/cli-study/node_modules/buffer/package.json create mode 100644 day1/cli-study/node_modules/cacheable-request/LICENSE create mode 100644 day1/cli-study/node_modules/cacheable-request/README.md create mode 100644 day1/cli-study/node_modules/cacheable-request/node_modules/lowercase-keys/index.js create mode 100644 day1/cli-study/node_modules/cacheable-request/node_modules/lowercase-keys/package.json create mode 100644 day1/cli-study/node_modules/cacheable-request/node_modules/lowercase-keys/readme.md create mode 100644 day1/cli-study/node_modules/cacheable-request/package.json create mode 100644 day1/cli-study/node_modules/cacheable-request/src/index.js create mode 100644 day1/cli-study/node_modules/callsites/index.d.ts create mode 100644 day1/cli-study/node_modules/callsites/index.js create mode 100644 day1/cli-study/node_modules/callsites/license create mode 100644 day1/cli-study/node_modules/callsites/package.json create mode 100644 day1/cli-study/node_modules/callsites/readme.md create mode 100644 day1/cli-study/node_modules/caw/index.js create mode 100644 day1/cli-study/node_modules/caw/license create mode 100644 day1/cli-study/node_modules/caw/package.json create mode 100644 day1/cli-study/node_modules/caw/readme.md create mode 100644 day1/cli-study/node_modules/chalk/index.d.ts create mode 100644 day1/cli-study/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/chalk/node_modules/ansi-styles/index.d.ts create mode 100644 day1/cli-study/node_modules/chalk/node_modules/ansi-styles/index.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/ansi-styles/license create mode 100644 day1/cli-study/node_modules/chalk/node_modules/ansi-styles/package.json create mode 100644 day1/cli-study/node_modules/chalk/node_modules/ansi-styles/readme.md create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/LICENSE create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/README.md create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/conversions.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/index.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/package.json create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-convert/route.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-name/LICENSE create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-name/README.md create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-name/index.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/color-name/package.json create mode 100644 day1/cli-study/node_modules/chalk/node_modules/has-flag/index.d.ts create mode 100644 day1/cli-study/node_modules/chalk/node_modules/has-flag/index.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/has-flag/license create mode 100644 day1/cli-study/node_modules/chalk/node_modules/has-flag/package.json create mode 100644 day1/cli-study/node_modules/chalk/node_modules/has-flag/readme.md create mode 100644 day1/cli-study/node_modules/chalk/node_modules/supports-color/browser.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/supports-color/index.js create mode 100644 day1/cli-study/node_modules/chalk/node_modules/supports-color/license create mode 100644 day1/cli-study/node_modules/chalk/node_modules/supports-color/package.json create mode 100644 day1/cli-study/node_modules/chalk/node_modules/supports-color/readme.md create mode 100644 day1/cli-study/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/chalk/source/index.js create mode 100644 day1/cli-study/node_modules/chalk/source/templates.js create mode 100644 day1/cli-study/node_modules/chalk/source/util.js create mode 100644 day1/cli-study/node_modules/chardet/.travis.yml create mode 100644 day1/cli-study/node_modules/chardet/LICENSE create mode 100644 day1/cli-study/node_modules/chardet/README.md create mode 100644 day1/cli-study/node_modules/chardet/encoding/iso2022.js create mode 100644 day1/cli-study/node_modules/chardet/encoding/mbcs.js create mode 100644 day1/cli-study/node_modules/chardet/encoding/sbcs.js create mode 100644 day1/cli-study/node_modules/chardet/encoding/unicode.js create mode 100644 day1/cli-study/node_modules/chardet/encoding/utf8.js create mode 100644 day1/cli-study/node_modules/chardet/index.js create mode 100644 day1/cli-study/node_modules/chardet/match.js create mode 100644 day1/cli-study/node_modules/chardet/package.json create mode 100644 day1/cli-study/node_modules/cli-cursor/index.d.ts create mode 100644 day1/cli-study/node_modules/cli-cursor/index.js create mode 100644 day1/cli-study/node_modules/cli-cursor/license create mode 100644 day1/cli-study/node_modules/cli-cursor/package.json create mode 100644 day1/cli-study/node_modules/cli-cursor/readme.md create mode 100644 day1/cli-study/node_modules/cli-spinners/index.d.ts create mode 100644 day1/cli-study/node_modules/cli-spinners/index.js create mode 100644 day1/cli-study/node_modules/cli-spinners/license create mode 100644 day1/cli-study/node_modules/cli-spinners/package.json create mode 100644 day1/cli-study/node_modules/cli-spinners/readme.md create mode 100644 day1/cli-study/node_modules/cli-spinners/spinners.json create mode 100644 day1/cli-study/node_modules/cli-width/.nyc_output/00ef1b3d-3687-482b-8d03-de2f76b58f54.json create mode 100644 day1/cli-study/node_modules/cli-width/.nyc_output/processinfo/00ef1b3d-3687-482b-8d03-de2f76b58f54.json create mode 100644 day1/cli-study/node_modules/cli-width/.nyc_output/processinfo/index.json create mode 100644 day1/cli-study/node_modules/cli-width/.travis.yml create mode 100644 day1/cli-study/node_modules/cli-width/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/cli-width/LICENSE create mode 100644 day1/cli-study/node_modules/cli-width/README.md create mode 100644 day1/cli-study/node_modules/cli-width/index.js create mode 100644 day1/cli-study/node_modules/cli-width/package.json create mode 100644 day1/cli-study/node_modules/clone-response/LICENSE create mode 100644 day1/cli-study/node_modules/clone-response/README.md create mode 100644 day1/cli-study/node_modules/clone-response/package.json create mode 100644 day1/cli-study/node_modules/clone-response/src/index.js create mode 100644 day1/cli-study/node_modules/clone/.npmignore create mode 100644 day1/cli-study/node_modules/clone/LICENSE create mode 100644 day1/cli-study/node_modules/clone/README.md create mode 100644 day1/cli-study/node_modules/clone/clone.iml create mode 100644 day1/cli-study/node_modules/clone/clone.js create mode 100644 day1/cli-study/node_modules/clone/package.json create mode 100644 day1/cli-study/node_modules/co-from-stream/.npmignore create mode 100644 day1/cli-study/node_modules/co-from-stream/History.md create mode 100644 day1/cli-study/node_modules/co-from-stream/Makefile create mode 100644 day1/cli-study/node_modules/co-from-stream/Readme.md create mode 100644 day1/cli-study/node_modules/co-from-stream/example.js create mode 100644 day1/cli-study/node_modules/co-from-stream/index.js create mode 100644 day1/cli-study/node_modules/co-from-stream/package.json create mode 100644 day1/cli-study/node_modules/co-from-stream/test.js create mode 100644 day1/cli-study/node_modules/co-fs-extra/.npmignore create mode 100644 day1/cli-study/node_modules/co-fs-extra/History.md create mode 100644 day1/cli-study/node_modules/co-fs-extra/Makefile create mode 100644 day1/cli-study/node_modules/co-fs-extra/README.md create mode 100644 day1/cli-study/node_modules/co-fs-extra/generator.js create mode 100644 day1/cli-study/node_modules/co-fs-extra/index.js create mode 100644 day1/cli-study/node_modules/co-fs-extra/methods.js create mode 100644 day1/cli-study/node_modules/co-fs-extra/package.json create mode 100644 day1/cli-study/node_modules/co-fs-extra/test/fixtures/msg.json create mode 100644 day1/cli-study/node_modules/co-fs-extra/test/index.js create mode 100644 day1/cli-study/node_modules/co-read/.npmignore create mode 100644 day1/cli-study/node_modules/co-read/.travis.yml create mode 100644 day1/cli-study/node_modules/co-read/README.md create mode 100644 day1/cli-study/node_modules/co-read/example.js create mode 100644 day1/cli-study/node_modules/co-read/index.js create mode 100644 day1/cli-study/node_modules/co-read/package.json create mode 100644 day1/cli-study/node_modules/co-read/test/stream1-backpressure.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream1-error.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream1-read.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream2-end.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream2-error.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream2-read.js create mode 100644 day1/cli-study/node_modules/co-read/test/stream2-read2.js create mode 100644 day1/cli-study/node_modules/co/Readme.md create mode 100644 day1/cli-study/node_modules/co/index.js create mode 100644 day1/cli-study/node_modules/co/package.json create mode 100644 day1/cli-study/node_modules/coffee-script/LICENSE create mode 100644 day1/cli-study/node_modules/coffee-script/README.md create mode 100644 day1/cli-study/node_modules/coffee-script/bin/cake create mode 100644 day1/cli-study/node_modules/coffee-script/bin/coffee create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/browser.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/cake.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/coffee-script.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/command.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/grammar.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/helpers.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/index.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/lexer.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/nodes.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/optparse.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/parser.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/register.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/repl.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/rewriter.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/scope.js create mode 100644 day1/cli-study/node_modules/coffee-script/lib/coffee-script/sourcemap.js create mode 100644 day1/cli-study/node_modules/coffee-script/package.json create mode 100644 day1/cli-study/node_modules/coffee-script/register.js create mode 100644 day1/cli-study/node_modules/coffee-script/repl.js create mode 100644 day1/cli-study/node_modules/color-convert/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/color-convert/LICENSE create mode 100644 day1/cli-study/node_modules/color-convert/README.md create mode 100644 day1/cli-study/node_modules/color-convert/conversions.js create mode 100644 day1/cli-study/node_modules/color-convert/index.js create mode 100644 day1/cli-study/node_modules/color-convert/package.json create mode 100644 day1/cli-study/node_modules/color-convert/route.js create mode 100644 day1/cli-study/node_modules/color-name/.eslintrc.json create mode 100644 day1/cli-study/node_modules/color-name/.npmignore create mode 100644 day1/cli-study/node_modules/color-name/LICENSE create mode 100644 day1/cli-study/node_modules/color-name/README.md create mode 100644 day1/cli-study/node_modules/color-name/index.js create mode 100644 day1/cli-study/node_modules/color-name/package.json create mode 100644 day1/cli-study/node_modules/color-name/test.js create mode 100644 day1/cli-study/node_modules/commander/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/commander/LICENSE create mode 100644 day1/cli-study/node_modules/commander/Readme.md create mode 100644 day1/cli-study/node_modules/commander/index.js create mode 100644 day1/cli-study/node_modules/commander/package.json create mode 100644 day1/cli-study/node_modules/commander/typings/index.d.ts create mode 100644 day1/cli-study/node_modules/concat-map/.travis.yml create mode 100644 day1/cli-study/node_modules/concat-map/LICENSE create mode 100644 day1/cli-study/node_modules/concat-map/README.markdown create mode 100644 day1/cli-study/node_modules/concat-map/example/map.js create mode 100644 day1/cli-study/node_modules/concat-map/index.js create mode 100644 day1/cli-study/node_modules/concat-map/package.json create mode 100644 day1/cli-study/node_modules/concat-map/test/map.js create mode 100644 day1/cli-study/node_modules/config-chain/LICENCE create mode 100644 day1/cli-study/node_modules/config-chain/index.js create mode 100644 day1/cli-study/node_modules/config-chain/package.json create mode 100644 day1/cli-study/node_modules/config-chain/readme.markdown create mode 100644 day1/cli-study/node_modules/confusing-browser-globals/LICENSE create mode 100644 day1/cli-study/node_modules/confusing-browser-globals/README.md create mode 100644 day1/cli-study/node_modules/confusing-browser-globals/index.js create mode 100644 day1/cli-study/node_modules/confusing-browser-globals/package.json create mode 100644 day1/cli-study/node_modules/consolidate/History.md create mode 100644 day1/cli-study/node_modules/consolidate/Readme.md create mode 100644 day1/cli-study/node_modules/consolidate/index.js create mode 100644 day1/cli-study/node_modules/consolidate/lib/consolidate.js create mode 100644 day1/cli-study/node_modules/consolidate/package.json create mode 100644 day1/cli-study/node_modules/contains-path/LICENSE create mode 100644 day1/cli-study/node_modules/contains-path/README.md create mode 100644 day1/cli-study/node_modules/contains-path/index.js create mode 100644 day1/cli-study/node_modules/contains-path/package.json create mode 100644 day1/cli-study/node_modules/content-disposition/HISTORY.md create mode 100644 day1/cli-study/node_modules/content-disposition/LICENSE create mode 100644 day1/cli-study/node_modules/content-disposition/README.md create mode 100644 day1/cli-study/node_modules/content-disposition/index.js create mode 100644 day1/cli-study/node_modules/content-disposition/node_modules/safe-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/content-disposition/node_modules/safe-buffer/README.md create mode 100644 day1/cli-study/node_modules/content-disposition/node_modules/safe-buffer/index.d.ts create mode 100644 day1/cli-study/node_modules/content-disposition/node_modules/safe-buffer/index.js create mode 100644 day1/cli-study/node_modules/content-disposition/node_modules/safe-buffer/package.json create mode 100644 day1/cli-study/node_modules/content-disposition/package.json create mode 100644 day1/cli-study/node_modules/core-util-is/LICENSE create mode 100644 day1/cli-study/node_modules/core-util-is/README.md create mode 100644 day1/cli-study/node_modules/core-util-is/float.patch create mode 100644 day1/cli-study/node_modules/core-util-is/lib/util.js create mode 100644 day1/cli-study/node_modules/core-util-is/package.json create mode 100644 day1/cli-study/node_modules/core-util-is/test.js create mode 100644 day1/cli-study/node_modules/cross-spawn/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/cross-spawn/LICENSE create mode 100644 day1/cli-study/node_modules/cross-spawn/README.md create mode 100644 day1/cli-study/node_modules/cross-spawn/index.js create mode 100644 day1/cli-study/node_modules/cross-spawn/lib/enoent.js create mode 100644 day1/cli-study/node_modules/cross-spawn/lib/parse.js create mode 100644 day1/cli-study/node_modules/cross-spawn/lib/util/escape.js create mode 100644 day1/cli-study/node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 day1/cli-study/node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 day1/cli-study/node_modules/cross-spawn/package.json create mode 100644 day1/cli-study/node_modules/debug/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/debug/LICENSE create mode 100644 day1/cli-study/node_modules/debug/README.md create mode 100644 day1/cli-study/node_modules/debug/dist/debug.js create mode 100644 day1/cli-study/node_modules/debug/package.json create mode 100644 day1/cli-study/node_modules/debug/src/browser.js create mode 100644 day1/cli-study/node_modules/debug/src/common.js create mode 100644 day1/cli-study/node_modules/debug/src/index.js create mode 100644 day1/cli-study/node_modules/debug/src/node.js create mode 100644 day1/cli-study/node_modules/decode-uri-component/index.js create mode 100644 day1/cli-study/node_modules/decode-uri-component/license create mode 100644 day1/cli-study/node_modules/decode-uri-component/package.json create mode 100644 day1/cli-study/node_modules/decode-uri-component/readme.md create mode 100644 day1/cli-study/node_modules/decompress-response/index.js create mode 100644 day1/cli-study/node_modules/decompress-response/license create mode 100644 day1/cli-study/node_modules/decompress-response/package.json create mode 100644 day1/cli-study/node_modules/decompress-response/readme.md create mode 100644 day1/cli-study/node_modules/decompress-tar/index.js create mode 100644 day1/cli-study/node_modules/decompress-tar/license create mode 100644 day1/cli-study/node_modules/decompress-tar/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/decompress-tar/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/decompress-tar/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/decompress-tar/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/decompress-tar/package.json create mode 100644 day1/cli-study/node_modules/decompress-tar/readme.md create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/index.js create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/license create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/package.json create mode 100644 day1/cli-study/node_modules/decompress-tarbz2/readme.md create mode 100644 day1/cli-study/node_modules/decompress-targz/index.js create mode 100644 day1/cli-study/node_modules/decompress-targz/license create mode 100644 day1/cli-study/node_modules/decompress-targz/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/decompress-targz/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/decompress-targz/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/decompress-targz/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/decompress-targz/package.json create mode 100644 day1/cli-study/node_modules/decompress-targz/readme.md create mode 100644 day1/cli-study/node_modules/decompress-unzip/index.js create mode 100644 day1/cli-study/node_modules/decompress-unzip/license create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/get-stream/buffer-stream.js create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/get-stream/index.js create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/get-stream/license create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/get-stream/package.json create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/get-stream/readme.md create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/pify/index.js create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/pify/license create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/pify/package.json create mode 100644 day1/cli-study/node_modules/decompress-unzip/node_modules/pify/readme.md create mode 100644 day1/cli-study/node_modules/decompress-unzip/package.json create mode 100644 day1/cli-study/node_modules/decompress-unzip/readme.md create mode 100644 day1/cli-study/node_modules/decompress/index.js create mode 100644 day1/cli-study/node_modules/decompress/license create mode 100644 day1/cli-study/node_modules/decompress/node_modules/pify/index.js create mode 100644 day1/cli-study/node_modules/decompress/node_modules/pify/license create mode 100644 day1/cli-study/node_modules/decompress/node_modules/pify/package.json create mode 100644 day1/cli-study/node_modules/decompress/node_modules/pify/readme.md create mode 100644 day1/cli-study/node_modules/decompress/package.json create mode 100644 day1/cli-study/node_modules/decompress/readme.md create mode 100644 day1/cli-study/node_modules/deep-is/.npmignore create mode 100644 day1/cli-study/node_modules/deep-is/.travis.yml create mode 100644 day1/cli-study/node_modules/deep-is/LICENSE create mode 100644 day1/cli-study/node_modules/deep-is/README.markdown create mode 100644 day1/cli-study/node_modules/deep-is/example/cmp.js create mode 100644 day1/cli-study/node_modules/deep-is/index.js create mode 100644 day1/cli-study/node_modules/deep-is/package.json create mode 100644 day1/cli-study/node_modules/deep-is/test/NaN.js create mode 100644 day1/cli-study/node_modules/deep-is/test/cmp.js create mode 100644 day1/cli-study/node_modules/deep-is/test/neg-vs-pos-0.js create mode 100644 day1/cli-study/node_modules/defaults/.npmignore create mode 100644 day1/cli-study/node_modules/defaults/LICENSE create mode 100644 day1/cli-study/node_modules/defaults/README.md create mode 100644 day1/cli-study/node_modules/defaults/index.js create mode 100644 day1/cli-study/node_modules/defaults/package.json create mode 100644 day1/cli-study/node_modules/defaults/test.js create mode 100644 day1/cli-study/node_modules/define-properties/.editorconfig create mode 100644 day1/cli-study/node_modules/define-properties/.eslintrc create mode 100644 day1/cli-study/node_modules/define-properties/.jscs.json create mode 100644 day1/cli-study/node_modules/define-properties/.travis.yml create mode 100644 day1/cli-study/node_modules/define-properties/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/define-properties/LICENSE create mode 100644 day1/cli-study/node_modules/define-properties/README.md create mode 100644 day1/cli-study/node_modules/define-properties/index.js create mode 100644 day1/cli-study/node_modules/define-properties/package.json create mode 100644 day1/cli-study/node_modules/define-properties/test/index.js create mode 100644 day1/cli-study/node_modules/doctrine/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/doctrine/LICENSE create mode 100644 day1/cli-study/node_modules/doctrine/LICENSE.closure-compiler create mode 100644 day1/cli-study/node_modules/doctrine/LICENSE.esprima create mode 100644 day1/cli-study/node_modules/doctrine/README.md create mode 100644 day1/cli-study/node_modules/doctrine/lib/doctrine.js create mode 100644 day1/cli-study/node_modules/doctrine/lib/typed.js create mode 100644 day1/cli-study/node_modules/doctrine/lib/utility.js create mode 100644 day1/cli-study/node_modules/doctrine/package.json create mode 100644 day1/cli-study/node_modules/download-git-repo/.gitlab-ci.yml create mode 100644 day1/cli-study/node_modules/download-git-repo/Makefile create mode 100644 day1/cli-study/node_modules/download-git-repo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/index.js create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/.bin/rimraf create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/.bin/rimraf.cmd create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/.bin/rimraf.ps1 create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/LICENSE create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/bin.js create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/package.json create mode 100644 day1/cli-study/node_modules/download-git-repo/node_modules/rimraf/rimraf.js create mode 100644 day1/cli-study/node_modules/download-git-repo/package.json create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/master/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/master/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/master/bitbucket-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/master/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch-with-slashes/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch-with-slashes/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch-with-slashes/bitbucket-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch-with-slashes/branch-with-slashes-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch-with-slashes/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch/bitbucket-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch/branch-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/bitbucket/my-branch/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/master/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/master/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/master/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/master/github-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch-with-slashes/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch-with-slashes/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch-with-slashes/branch-with-slashes-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch-with-slashes/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch-with-slashes/github-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch/branch-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/github/my-branch/github-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master-only-md/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master-only-md/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master-only-md/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master-only-md/gitlab-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master/UNLICENSE create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/master/gitlab-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch-with-slashes/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch-with-slashes/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch-with-slashes/branch-with-slashes-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch-with-slashes/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch-with-slashes/gitlab-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch/bar/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch/branch-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch/foo/README.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/fixtures/gitlab/my-branch/gitlab-only-file.md create mode 100644 day1/cli-study/node_modules/download-git-repo/test/index.js create mode 100644 day1/cli-study/node_modules/download/index.js create mode 100644 day1/cli-study/node_modules/download/license create mode 100644 day1/cli-study/node_modules/download/package.json create mode 100644 day1/cli-study/node_modules/download/readme.md create mode 100644 day1/cli-study/node_modules/duplexer3/LICENSE.md create mode 100644 day1/cli-study/node_modules/duplexer3/README.md create mode 100644 day1/cli-study/node_modules/duplexer3/index.js create mode 100644 day1/cli-study/node_modules/duplexer3/package.json create mode 100644 day1/cli-study/node_modules/ejs/LICENSE create mode 100644 day1/cli-study/node_modules/ejs/README.md create mode 100644 day1/cli-study/node_modules/ejs/bin/cli.js create mode 100644 day1/cli-study/node_modules/ejs/ejs.js create mode 100644 day1/cli-study/node_modules/ejs/ejs.min.js create mode 100644 day1/cli-study/node_modules/ejs/jakefile.js create mode 100644 day1/cli-study/node_modules/ejs/lib/ejs.js create mode 100644 day1/cli-study/node_modules/ejs/lib/utils.js create mode 100644 day1/cli-study/node_modules/ejs/package.json create mode 100644 day1/cli-study/node_modules/ejs/postinstall.js create mode 100644 day1/cli-study/node_modules/ejs/usage.txt create mode 100644 day1/cli-study/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 day1/cli-study/node_modules/emoji-regex/README.md create mode 100644 day1/cli-study/node_modules/emoji-regex/es2015/index.js create mode 100644 day1/cli-study/node_modules/emoji-regex/es2015/text.js create mode 100644 day1/cli-study/node_modules/emoji-regex/index.d.ts create mode 100644 day1/cli-study/node_modules/emoji-regex/index.js create mode 100644 day1/cli-study/node_modules/emoji-regex/package.json create mode 100644 day1/cli-study/node_modules/emoji-regex/text.js create mode 100644 day1/cli-study/node_modules/enable/.editorconfig create mode 100644 day1/cli-study/node_modules/enable/.npmignore create mode 100644 day1/cli-study/node_modules/enable/AUTHORS create mode 100644 day1/cli-study/node_modules/enable/History.md create mode 100644 day1/cli-study/node_modules/enable/LICENSE create mode 100644 day1/cli-study/node_modules/enable/README.md create mode 100644 day1/cli-study/node_modules/enable/index.js create mode 100644 day1/cli-study/node_modules/enable/package.json create mode 100644 day1/cli-study/node_modules/end-of-stream/LICENSE create mode 100644 day1/cli-study/node_modules/end-of-stream/README.md create mode 100644 day1/cli-study/node_modules/end-of-stream/index.js create mode 100644 day1/cli-study/node_modules/end-of-stream/package.json create mode 100644 day1/cli-study/node_modules/enquirer/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/enquirer/LICENSE create mode 100644 day1/cli-study/node_modules/enquirer/README.md create mode 100644 day1/cli-study/node_modules/enquirer/index.d.ts create mode 100644 day1/cli-study/node_modules/enquirer/index.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/ansi.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/combos.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/completer.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/interpolate.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/keypress.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/placeholder.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompt.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/autocomplete.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/basicauth.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/confirm.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/editable.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/form.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/index.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/input.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/invisible.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/list.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/multiselect.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/numeral.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/password.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/quiz.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/scale.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/select.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/snippet.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/sort.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/survey.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/text.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/prompts/toggle.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/render.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/roles.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/state.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/styles.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/symbols.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/theme.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/timer.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/array.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/auth.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/boolean.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/index.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/number.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/types/string.js create mode 100644 day1/cli-study/node_modules/enquirer/lib/utils.js create mode 100644 day1/cli-study/node_modules/enquirer/package.json create mode 100644 day1/cli-study/node_modules/error-ex/LICENSE create mode 100644 day1/cli-study/node_modules/error-ex/README.md create mode 100644 day1/cli-study/node_modules/error-ex/index.js create mode 100644 day1/cli-study/node_modules/error-ex/package.json create mode 100644 day1/cli-study/node_modules/es-abstract/.editorconfig create mode 100644 day1/cli-study/node_modules/es-abstract/.eslintignore create mode 100644 day1/cli-study/node_modules/es-abstract/.eslintrc create mode 100644 day1/cli-study/node_modules/es-abstract/.gitattributes create mode 100644 day1/cli-study/node_modules/es-abstract/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/es-abstract/.github/workflows/codeql-analysis.yml create mode 100644 day1/cli-study/node_modules/es-abstract/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/es-abstract/.nycrc create mode 100644 day1/cli-study/node_modules/es-abstract/.travis.yml create mode 100644 day1/cli-study/node_modules/es-abstract/2015/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/AdvanceStringIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ArrayCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ArraySetLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ArraySpeciesCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Call.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CanonicalNumericIndexString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CompletePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateDataProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateDataPropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateHTML.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateIterResultObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateListFromArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/CreateMethodProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DefinePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/DeletePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/EnumerableOwnNames.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Get.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetIterator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetOwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetPrototypeFromConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetSubstitution.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/GetV.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/HasOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/HasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/InstanceofOperator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Invoke.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsConcatSpreadable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsExtensible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsPromise.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IsRegExp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IteratorClose.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IteratorComplete.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IteratorNext.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IteratorStep.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/IteratorValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ObjectCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/OrdinaryDefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/OrdinaryGetOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/OrdinaryHasInstance.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/OrdinaryHasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/RegExpExec.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/RequireObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SameValueZero.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Set.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SetFunctionName.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SetIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SpeciesConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/SymbolDescriptiveString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/TestIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToDateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToInt16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToInt8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToUint8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ToUint8Clamp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/ValidateAndApplyPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/thisBooleanValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/thisNumberValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/thisStringValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2015/thisTimeValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/AdvanceStringIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ArrayCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ArraySetLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ArraySpeciesCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Call.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CanonicalNumericIndexString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CompletePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateDataProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateHTML.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateIterResultObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateListFromArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/CreateMethodProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DefinePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/DeletePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/EnumerableOwnNames.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Get.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetIterator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetOwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetPrototypeFromConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetSubstitution.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/GetV.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/HasOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/HasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/InstanceofOperator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Invoke.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsConcatSpreadable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsExtensible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsPromise.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IsRegExp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IterableToArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IteratorClose.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IteratorComplete.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IteratorNext.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IteratorStep.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/IteratorValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ObjectCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinaryDefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinaryGetOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinaryGetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinaryHasInstance.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinaryHasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/OrdinarySetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/RegExpExec.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/RequireObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SameValueNonNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SameValueZero.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Set.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SetFunctionName.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SetIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SpeciesConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/SymbolDescriptiveString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/TestIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToDateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToInt16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToInt8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToUint8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ToUint8Clamp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/ValidateAndApplyPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/thisBooleanValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/thisNumberValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/thisStringValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2016/thisTimeValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/AdvanceStringIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ArrayCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ArraySetLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ArraySpeciesCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Call.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CanonicalNumericIndexString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CompletePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateDataProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateDataPropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateHTML.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateIterResultObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateListFromArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/CreateMethodProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DefinePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/DeletePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/EnumerableOwnProperties.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Get.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetIterator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetOwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetPrototypeFromConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetSubstitution.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/GetV.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/HasOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/HasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/InstanceofOperator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Invoke.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsConcatSpreadable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsExtensible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsPromise.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IsRegExp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IterableToList.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IteratorClose.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IteratorComplete.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IteratorNext.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IteratorStep.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/IteratorValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ObjectCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinaryDefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinaryGetOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinaryGetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinaryHasInstance.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinaryHasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/OrdinarySetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/RegExpExec.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/RequireObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SameValueNonNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SameValueZero.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Set.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SetFunctionName.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SetIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SpeciesConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/SymbolDescriptiveString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/TestIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToDateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToInt16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToInt8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToUint8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ToUint8Clamp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/ValidateAndApplyPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/thisBooleanValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/thisNumberValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/thisStringValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2017/thisTimeValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/AdvanceStringIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ArrayCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ArraySetLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ArraySpeciesCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Call.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CanonicalNumericIndexString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CompletePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CopyDataProperties.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateDataProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateDataPropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateHTML.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateIterResultObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateListFromArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/CreateMethodProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DefinePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/DeletePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/EnumerableOwnPropertyNames.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Get.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetIterator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetOwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetPrototypeFromConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetSubstitution.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/GetV.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/HasOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/HasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/InstanceofOperator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Invoke.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsConcatSpreadable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsExtensible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsPromise.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsRegExp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IsStringPrefix.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IterableToList.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IteratorClose.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IteratorComplete.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IteratorNext.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IteratorStep.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/IteratorValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/NumberToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ObjectCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinaryDefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinaryGetOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinaryGetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinaryHasInstance.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinaryHasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/OrdinarySetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/PromiseResolve.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/RegExpExec.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/RequireObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SameValueNonNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SameValueZero.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Set.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SetFunctionName.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SetIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SpeciesConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/SymbolDescriptiveString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/TestIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/TimeString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToDateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToInt16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToInt8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToUint8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ToUint8Clamp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/ValidateAndApplyPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/thisBooleanValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/thisNumberValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/thisStringValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/thisSymbolValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2018/thisTimeValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/AddEntriesFromIterable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/AdvanceStringIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ArrayCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ArraySetLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ArraySpeciesCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Call.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CanonicalNumericIndexString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CompletePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CopyDataProperties.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateDataProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateDataPropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateHTML.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateIterResultObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateListFromArrayLike.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/CreateMethodProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DefinePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/DeletePropertyOrThrow.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/EnumerableOwnPropertyNames.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/FlattenIntoArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Get.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetIterator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetOwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetPrototypeFromConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetSubstitution.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/GetV.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/HasOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/HasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/InstanceofOperator.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Invoke.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsArray.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsConcatSpreadable.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsExtensible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsPromise.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsRegExp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IsStringPrefix.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IterableToList.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IteratorClose.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IteratorComplete.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IteratorNext.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IteratorStep.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/IteratorValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/NumberToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ObjectCreate.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinaryDefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinaryGetOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinaryGetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinaryHasInstance.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinaryHasProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/OrdinarySetPrototypeOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/PromiseResolve.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/RegExpExec.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/RequireObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SameValueNonNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SameValueZero.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Set.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SetFunctionName.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SetIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SpeciesConstructor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/SymbolDescriptiveString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TestIntegrityLevel.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TimeString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToDateString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToIndex.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToInt16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToInt8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToLength.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToPropertyKey.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToUint8.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ToUint8Clamp.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/TrimString.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/ValidateAndApplyPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/thisBooleanValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/thisNumberValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/thisStringValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/thisSymbolValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/2019/thisTimeValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/AbstractEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/AbstractRelationalComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/CheckObjectCoercible.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/DateFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/Day.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/DayFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/DayWithinYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/DaysInYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/FromPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/HourFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/InLeapYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/IsAccessorDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/IsCallable.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/IsDataDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/IsGenericDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/IsPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/MakeDate.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/MakeDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/MakeTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/MinFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/MonthFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/SameValue.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/SecFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/StrictEqualityComparison.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/TimeClip.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/TimeFromYear.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/TimeWithinDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToBoolean.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToInt32.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToNumber.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToObject.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToString.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToUint16.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/ToUint32.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/Type.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/WeekDay.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/YearFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/modulo.js create mode 100644 day1/cli-study/node_modules/es-abstract/5/msFromTime.js create mode 100644 day1/cli-study/node_modules/es-abstract/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/es-abstract/GetIntrinsic.js create mode 100644 day1/cli-study/node_modules/es-abstract/LICENSE create mode 100644 day1/cli-study/node_modules/es-abstract/README.md create mode 100644 day1/cli-study/node_modules/es-abstract/es2015.js create mode 100644 day1/cli-study/node_modules/es-abstract/es2016.js create mode 100644 day1/cli-study/node_modules/es-abstract/es2017.js create mode 100644 day1/cli-study/node_modules/es-abstract/es2018.js create mode 100644 day1/cli-study/node_modules/es-abstract/es2019.js create mode 100644 day1/cli-study/node_modules/es-abstract/es5.js create mode 100644 day1/cli-study/node_modules/es-abstract/es6.js create mode 100644 day1/cli-study/node_modules/es-abstract/es7.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/DefineOwnProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/OwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/assertRecord.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/assign.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/callBind.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/callBound.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/every.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/forEach.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/getInferredName.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/getIteratorMethod.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/getProto.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/getSymbolDescription.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isFinite.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isNaN.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isPrefixOf.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isPrimitive.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isPropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/maxSafeInteger.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/mod.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/padTimeComponent.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/regexTester.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/setProto.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/sign.js create mode 100644 day1/cli-study/node_modules/es-abstract/helpers/timeConstants.js create mode 100644 day1/cli-study/node_modules/es-abstract/index.js create mode 100644 day1/cli-study/node_modules/es-abstract/operations/.eslintrc create mode 100644 day1/cli-study/node_modules/es-abstract/operations/2015.js create mode 100644 day1/cli-study/node_modules/es-abstract/operations/2016.js create mode 100644 day1/cli-study/node_modules/es-abstract/operations/2017.js create mode 100644 day1/cli-study/node_modules/es-abstract/operations/2018.js create mode 100644 day1/cli-study/node_modules/es-abstract/operations/2019.js create mode 100644 day1/cli-study/node_modules/es-abstract/package.json create mode 100644 day1/cli-study/node_modules/es-abstract/test/GetIntrinsic.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/diffOps.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es2015.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es2016.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es2017.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es2018.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es2019.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es5.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es6.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/es7.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/OwnPropertyKeys.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/assertRecord.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/createBoundESNamespace.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/defineProperty.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/getSymbolDescription.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/runManifestTest.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/helpers/values.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/index.js create mode 100644 day1/cli-study/node_modules/es-abstract/test/tests.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/.eslintrc create mode 100644 day1/cli-study/node_modules/es-to-primitive/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/es-to-primitive/.travis.yml create mode 100644 day1/cli-study/node_modules/es-to-primitive/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/es-to-primitive/LICENSE create mode 100644 day1/cli-study/node_modules/es-to-primitive/Makefile create mode 100644 day1/cli-study/node_modules/es-to-primitive/README.md create mode 100644 day1/cli-study/node_modules/es-to-primitive/es2015.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/es5.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/es6.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/helpers/isPrimitive.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/index.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/package.json create mode 100644 day1/cli-study/node_modules/es-to-primitive/test/es2015.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/test/es5.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/test/es6.js create mode 100644 day1/cli-study/node_modules/es-to-primitive/test/index.js create mode 100644 day1/cli-study/node_modules/escape-string-regexp/index.js create mode 100644 day1/cli-study/node_modules/escape-string-regexp/license create mode 100644 day1/cli-study/node_modules/escape-string-regexp/package.json create mode 100644 day1/cli-study/node_modules/escape-string-regexp/readme.md create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/.babelrc create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/.eslintrc create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/LICENSE.md create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/README.md create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/index.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/legacy.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/package.json create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/best-practices.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/errors.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/es6.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/imports.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/node.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/strict.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/style.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/rules/variables.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/test/.eslintrc create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/test/requires.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/test/test-base.js create mode 100644 day1/cli-study/node_modules/eslint-config-airbnb-base/whitespace.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/README.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/index.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/.coveralls.yml create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/.eslintrc create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/.npmignore create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/.travis.yml create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/Makefile create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/README.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/component.json create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/karma.conf.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/node.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/package.json create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/src/browser.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/src/debug.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/src/index.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/src/inspector-log.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/debug/src/node.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/ms/index.js create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/ms/license.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/ms/package.json create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/node_modules/ms/readme.md create mode 100644 day1/cli-study/node_modules/eslint-import-resolver-node/package.json create mode 100644 day1/cli-study/node_modules/eslint-module-utils/.eslintrc.yml create mode 100644 day1/cli-study/node_modules/eslint-module-utils/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-module-utils/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-module-utils/ModuleCache.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/declaredScope.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/hash.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/ignore.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/module-require.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/moduleVisitor.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/.coveralls.yml create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/.eslintrc create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/.npmignore create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/.travis.yml create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/Makefile create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/README.md create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/component.json create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/karma.conf.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/node.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/package.json create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/src/browser.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/src/debug.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/src/index.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/src/inspector-log.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/debug/src/node.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/ms/index.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/ms/license.md create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/ms/package.json create mode 100644 day1/cli-study/node_modules/eslint-module-utils/node_modules/ms/readme.md create mode 100644 day1/cli-study/node_modules/eslint-module-utils/package.json create mode 100644 day1/cli-study/node_modules/eslint-module-utils/parse.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/resolve.js create mode 100644 day1/cli-study/node_modules/eslint-module-utils/unambiguous.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/CONTRIBUTING.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/README.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/RELEASE.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/SECURITY.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/electron.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/errors.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/react-native.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/react.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/recommended.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/stage-0.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/typescript.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/config/warnings.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/default.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/export.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/exports-last.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/extensions.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/first.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/group-exports.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/imports-first.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/named.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/namespace.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-amd.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-cycle.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-default-export.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-named-default.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-named-export.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-namespace.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-self-import.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/order.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/docs/rules/unambiguous.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/ExportMap.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/core/importType.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/core/staticRequire.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/docsUrl.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/importDeclaration.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/index.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/default.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/export.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/exports-last.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/extensions.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/first.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/group-exports.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/imports-first.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/named.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/namespace.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-amd.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-cycle.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-default-export.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-named-default.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-named-export.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-namespace.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-self-import.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/order.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/lib/rules/unambiguous.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/memo-parser/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/memo-parser/README.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/memo-parser/index.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/memo-parser/package.json create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/.coveralls.yml create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/.eslintrc create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/.npmignore create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/.travis.yml create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/Makefile create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/README.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/component.json create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/karma.conf.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/node.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/package.json create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/src/debug.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/src/index.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/src/inspector-log.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/debug/src/node.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.BSD create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/README.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/doctrine/package.json create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/ms/index.js create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/ms/license.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/ms/package.json create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/node_modules/ms/readme.md create mode 100644 day1/cli-study/node_modules/eslint-plugin-import/package.json create mode 100644 day1/cli-study/node_modules/eslint-scope/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-scope/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-scope/README.md create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/definition.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/index.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/pattern-visitor.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/reference.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/referencer.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/scope-manager.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/scope.js create mode 100644 day1/cli-study/node_modules/eslint-scope/lib/variable.js create mode 100644 day1/cli-study/node_modules/eslint-scope/package.json create mode 100644 day1/cli-study/node_modules/eslint-utils/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-utils/README.md create mode 100644 day1/cli-study/node_modules/eslint-utils/index.js create mode 100644 day1/cli-study/node_modules/eslint-utils/index.js.map create mode 100644 day1/cli-study/node_modules/eslint-utils/index.mjs create mode 100644 day1/cli-study/node_modules/eslint-utils/index.mjs.map create mode 100644 day1/cli-study/node_modules/eslint-utils/package.json create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/LICENSE create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/README.md create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/lib/index.js create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/lib/visitor-keys.json create mode 100644 day1/cli-study/node_modules/eslint-visitor-keys/package.json create mode 100644 day1/cli-study/node_modules/eslint/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/eslint/LICENSE create mode 100644 day1/cli-study/node_modules/eslint/README.md create mode 100644 day1/cli-study/node_modules/eslint/bin/eslint.js create mode 100644 day1/cli-study/node_modules/eslint/conf/category-list.json create mode 100644 day1/cli-study/node_modules/eslint/conf/config-schema.js create mode 100644 day1/cli-study/node_modules/eslint/conf/default-cli-options.js create mode 100644 day1/cli-study/node_modules/eslint/conf/environments.js create mode 100644 day1/cli-study/node_modules/eslint/conf/eslint-all.js create mode 100644 day1/cli-study/node_modules/eslint/conf/eslint-recommended.js create mode 100644 day1/cli-study/node_modules/eslint/conf/replacements.json create mode 100644 day1/cli-study/node_modules/eslint/lib/api.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/cli-engine.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array-factory.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/config-array.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/config-dependency.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/extracted-config.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/ignore-pattern.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/config-array/override-tester.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/file-enumerator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/checkstyle.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/codeframe.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/compact.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-message.html create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-page.html create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/junit.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/stylish.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/table.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/tap.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/unix.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/hash.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/lint-result-cache.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/load-rules.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli-engine/xml-escape.js create mode 100644 day1/cli-study/node_modules/eslint/lib/cli.js create mode 100644 day1/cli-study/node_modules/eslint/lib/eslint/eslint.js create mode 100644 day1/cli-study/node_modules/eslint/lib/eslint/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/autoconfig.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/config-file.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/config-initializer.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/config-rule.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/npm-utils.js create mode 100644 day1/cli-study/node_modules/eslint/lib/init/source-code-utils.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/apply-disable-directives.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/config-comment-parser.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/interpolate.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/linter.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/node-event-generator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/report-translator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/rule-fixer.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/rules.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/safe-emitter.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/source-code-fixer.js create mode 100644 day1/cli-study/node_modules/eslint/lib/linter/timing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/options.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rule-tester/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rule-tester/rule-tester.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/accessor-pairs.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/array-bracket-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/array-bracket-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/array-callback-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/array-element-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/arrow-body-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/arrow-parens.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/arrow-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/block-scoped-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/block-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/brace-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/callback-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/camelcase.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/capitalized-comments.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/class-methods-use-this.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/comma-dangle.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/comma-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/comma-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/complexity.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/computed-property-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/consistent-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/consistent-this.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/constructor-super.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/curly.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/default-case-last.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/default-case.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/default-param-last.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/dot-location.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/dot-notation.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/eol-last.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/eqeqeq.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/for-direction.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/func-call-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/func-name-matching.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/func-names.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/func-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/function-call-argument-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/function-paren-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/generator-star-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/getter-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/global-require.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/grouped-accessor-pairs.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/guard-for-in.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/handle-callback-err.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/id-blacklist.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/id-length.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/id-match.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/indent-legacy.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/indent.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/init-declarations.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/jsx-quotes.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/key-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/keyword-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/line-comment-position.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/linebreak-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/lines-around-comment.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/lines-around-directive.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/lines-between-class-members.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-classes-per-file.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-depth.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-len.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-lines-per-function.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-lines.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-nested-callbacks.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-params.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-statements-per-line.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/max-statements.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/multiline-comment-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/multiline-ternary.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/new-cap.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/new-parens.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/newline-after-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/newline-before-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/newline-per-chained-call.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-alert.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-array-constructor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-async-promise-executor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-await-in-loop.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-bitwise.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-buffer-constructor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-caller.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-case-declarations.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-catch-shadow.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-class-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-compare-neg-zero.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-cond-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-confusing-arrow.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-console.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-const-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-constant-condition.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-constructor-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-continue.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-control-regex.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-debugger.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-delete-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-div-regex.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-dupe-args.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-dupe-class-members.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-dupe-else-if.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-dupe-keys.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-case.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-imports.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-else-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-empty-character-class.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-empty-function.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-empty-pattern.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-empty.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-eq-null.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-eval.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-ex-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extend-native.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extra-bind.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extra-boolean-cast.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extra-label.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extra-parens.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-extra-semi.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-fallthrough.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-floating-decimal.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-func-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-global-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-implicit-coercion.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-implicit-globals.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-implied-eval.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-import-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-inline-comments.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-inner-declarations.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-invalid-regexp.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-invalid-this.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-irregular-whitespace.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-iterator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-label-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-labels.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-lone-blocks.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-lonely-if.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-loop-func.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-loss-of-precision.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-magic-numbers.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-misleading-character-class.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-mixed-operators.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-mixed-requires.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-multi-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-multi-spaces.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-multi-str.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-multiple-empty-lines.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-native-reassign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-negated-condition.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-negated-in-lhs.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-nested-ternary.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new-func.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new-object.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new-require.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new-symbol.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new-wrappers.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-new.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-obj-calls.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-octal-escape.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-octal.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-param-reassign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-path-concat.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-plusplus.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-process-env.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-process-exit.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-promise-executor-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-proto.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-prototype-builtins.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-redeclare.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-regex-spaces.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-exports.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-globals.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-imports.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-modules.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-properties.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-restricted-syntax.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-return-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-return-await.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-script-url.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-self-assign.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-self-compare.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-sequences.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-setter-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-shadow-restricted-names.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-shadow.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-spaced-func.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-sparse-arrays.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-sync.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-tabs.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-template-curly-in-string.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-ternary.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-this-before-super.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-throw-literal.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-trailing-spaces.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-undef-init.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-undef.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-undefined.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-underscore-dangle.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unexpected-multiline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unneeded-ternary.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unreachable-loop.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unreachable.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-finally.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-negation.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unused-expressions.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unused-labels.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-unused-vars.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-use-before-define.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-backreference.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-call.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-catch.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-computed-key.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-concat.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-constructor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-escape.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-rename.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-useless-return.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-void.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-warning-comments.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-whitespace-before-property.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/no-with.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/nonblock-statement-body-position.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/object-curly-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/object-curly-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/object-property-newline.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/object-shorthand.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/one-var-declaration-per-line.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/one-var.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/operator-assignment.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/operator-linebreak.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/padded-blocks.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/padding-line-between-statements.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-arrow-callback.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-const.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-destructuring.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-named-capture-group.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-numeric-literals.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-object-spread.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-reflect.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-regex-literals.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-rest-params.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-spread.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/prefer-template.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/quote-props.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/quotes.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/radix.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/require-atomic-updates.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/require-await.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/require-jsdoc.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/require-unicode-regexp.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/require-yield.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/rest-spread-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/semi-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/semi-style.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/semi.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/sort-imports.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/sort-keys.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/sort-vars.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/space-before-blocks.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/space-before-function-paren.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/space-in-parens.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/space-infix-ops.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/space-unary-ops.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/spaced-comment.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/strict.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/switch-colon-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/symbol-description.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/template-curly-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/template-tag-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/unicode-bom.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/use-isnan.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/ast-utils.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/fix-tracker.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/keywords.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/patterns/letters.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/valid-jsdoc.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/valid-typeof.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/vars-on-top.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/wrap-iife.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/wrap-regex.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/yield-star-spacing.js create mode 100644 day1/cli-study/node_modules/eslint/lib/rules/yoda.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/ajv.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/ast-utils.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/config-ops.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/config-validator.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/deprecation-warnings.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/logging.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/naming.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/relative-module-resolver.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/runtime-info.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/traverser.js create mode 100644 day1/cli-study/node_modules/eslint/lib/shared/types.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/source-code.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursors.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/filter-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/index.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/limit-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/skip-cursor.js create mode 100644 day1/cli-study/node_modules/eslint/lib/source-code/token-store/utils.js create mode 100644 day1/cli-study/node_modules/eslint/messages/all-files-ignored.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/extend-config-missing.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/failed-to-read-json.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/file-not-found.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/no-config-found.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/plugin-conflict.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/plugin-missing.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/print-config-with-directory-path.txt create mode 100644 day1/cli-study/node_modules/eslint/messages/whitespace-found.txt create mode 100644 day1/cli-study/node_modules/eslint/package.json create mode 100644 day1/cli-study/node_modules/espree/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/espree/LICENSE create mode 100644 day1/cli-study/node_modules/espree/README.md create mode 100644 day1/cli-study/node_modules/espree/espree.js create mode 100644 day1/cli-study/node_modules/espree/lib/ast-node-types.js create mode 100644 day1/cli-study/node_modules/espree/lib/espree.js create mode 100644 day1/cli-study/node_modules/espree/lib/features.js create mode 100644 day1/cli-study/node_modules/espree/lib/options.js create mode 100644 day1/cli-study/node_modules/espree/lib/token-translator.js create mode 100644 day1/cli-study/node_modules/espree/lib/visitor-keys.js create mode 100644 day1/cli-study/node_modules/espree/package.json create mode 100644 day1/cli-study/node_modules/esprima/ChangeLog create mode 100644 day1/cli-study/node_modules/esprima/LICENSE.BSD create mode 100644 day1/cli-study/node_modules/esprima/README.md create mode 100644 day1/cli-study/node_modules/esprima/bin/esparse.js create mode 100644 day1/cli-study/node_modules/esprima/bin/esvalidate.js create mode 100644 day1/cli-study/node_modules/esprima/dist/esprima.js create mode 100644 day1/cli-study/node_modules/esprima/package.json create mode 100644 day1/cli-study/node_modules/esquery/README.md create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.esm.js create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.esm.min.js create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.esm.min.js.map create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.js create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.min.js create mode 100644 day1/cli-study/node_modules/esquery/dist/esquery.min.js.map create mode 100644 day1/cli-study/node_modules/esquery/license.txt create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/.jshintrc create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/LICENSE.BSD create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/README.md create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/estraverse.js create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/gulpfile.js create mode 100644 day1/cli-study/node_modules/esquery/node_modules/estraverse/package.json create mode 100644 day1/cli-study/node_modules/esquery/package.json create mode 100644 day1/cli-study/node_modules/esquery/parser.js create mode 100644 day1/cli-study/node_modules/esrecurse/.babelrc create mode 100644 day1/cli-study/node_modules/esrecurse/README.md create mode 100644 day1/cli-study/node_modules/esrecurse/esrecurse.js create mode 100644 day1/cli-study/node_modules/esrecurse/gulpfile.babel.js create mode 100644 day1/cli-study/node_modules/esrecurse/package.json create mode 100644 day1/cli-study/node_modules/estraverse/.jshintrc create mode 100644 day1/cli-study/node_modules/estraverse/LICENSE.BSD create mode 100644 day1/cli-study/node_modules/estraverse/README.md create mode 100644 day1/cli-study/node_modules/estraverse/estraverse.js create mode 100644 day1/cli-study/node_modules/estraverse/gulpfile.js create mode 100644 day1/cli-study/node_modules/estraverse/package.json create mode 100644 day1/cli-study/node_modules/esutils/LICENSE.BSD create mode 100644 day1/cli-study/node_modules/esutils/README.md create mode 100644 day1/cli-study/node_modules/esutils/lib/ast.js create mode 100644 day1/cli-study/node_modules/esutils/lib/code.js create mode 100644 day1/cli-study/node_modules/esutils/lib/keyword.js create mode 100644 day1/cli-study/node_modules/esutils/lib/utils.js create mode 100644 day1/cli-study/node_modules/esutils/package.json create mode 100644 day1/cli-study/node_modules/ext-list/index.js create mode 100644 day1/cli-study/node_modules/ext-list/license create mode 100644 day1/cli-study/node_modules/ext-list/package.json create mode 100644 day1/cli-study/node_modules/ext-list/readme.md create mode 100644 day1/cli-study/node_modules/ext-name/index.js create mode 100644 day1/cli-study/node_modules/ext-name/license create mode 100644 day1/cli-study/node_modules/ext-name/package.json create mode 100644 day1/cli-study/node_modules/ext-name/readme.md create mode 100644 day1/cli-study/node_modules/extend-shallow/LICENSE create mode 100644 day1/cli-study/node_modules/extend-shallow/README.md create mode 100644 day1/cli-study/node_modules/extend-shallow/index.js create mode 100644 day1/cli-study/node_modules/extend-shallow/package.json create mode 100644 day1/cli-study/node_modules/external-editor/LICENSE create mode 100644 day1/cli-study/node_modules/external-editor/README.md create mode 100644 day1/cli-study/node_modules/external-editor/example_async.js create mode 100644 day1/cli-study/node_modules/external-editor/example_sync.js create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/CreateFileError.d.ts create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/CreateFileError.js create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/LaunchEditorError.d.ts create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/LaunchEditorError.js create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/ReadFileError.d.ts create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/ReadFileError.js create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/RemoveFileError.d.ts create mode 100644 day1/cli-study/node_modules/external-editor/main/errors/RemoveFileError.js create mode 100644 day1/cli-study/node_modules/external-editor/main/index.d.ts create mode 100644 day1/cli-study/node_modules/external-editor/main/index.js create mode 100644 day1/cli-study/node_modules/external-editor/package.json create mode 100644 day1/cli-study/node_modules/fast-deep-equal/LICENSE create mode 100644 day1/cli-study/node_modules/fast-deep-equal/README.md create mode 100644 day1/cli-study/node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 day1/cli-study/node_modules/fast-deep-equal/es6/index.js create mode 100644 day1/cli-study/node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 day1/cli-study/node_modules/fast-deep-equal/es6/react.js create mode 100644 day1/cli-study/node_modules/fast-deep-equal/index.d.ts create mode 100644 day1/cli-study/node_modules/fast-deep-equal/index.js create mode 100644 day1/cli-study/node_modules/fast-deep-equal/package.json create mode 100644 day1/cli-study/node_modules/fast-deep-equal/react.d.ts create mode 100644 day1/cli-study/node_modules/fast-deep-equal/react.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/LICENSE create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/README.md create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/example/str.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/index.d.ts create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/index.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/package.json create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/test/str.js create mode 100644 day1/cli-study/node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 day1/cli-study/node_modules/fast-levenshtein/LICENSE.md create mode 100644 day1/cli-study/node_modules/fast-levenshtein/README.md create mode 100644 day1/cli-study/node_modules/fast-levenshtein/levenshtein.js create mode 100644 day1/cli-study/node_modules/fast-levenshtein/package.json create mode 100644 day1/cli-study/node_modules/fd-slicer/.npmignore create mode 100644 day1/cli-study/node_modules/fd-slicer/.travis.yml create mode 100644 day1/cli-study/node_modules/fd-slicer/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/fd-slicer/LICENSE create mode 100644 day1/cli-study/node_modules/fd-slicer/README.md create mode 100644 day1/cli-study/node_modules/fd-slicer/index.js create mode 100644 day1/cli-study/node_modules/fd-slicer/package.json create mode 100644 day1/cli-study/node_modules/fd-slicer/test/test.js create mode 100644 day1/cli-study/node_modules/figures/index.d.ts create mode 100644 day1/cli-study/node_modules/figures/index.js create mode 100644 day1/cli-study/node_modules/figures/license create mode 100644 day1/cli-study/node_modules/figures/package.json create mode 100644 day1/cli-study/node_modules/figures/readme.md create mode 100644 day1/cli-study/node_modules/file-entry-cache/LICENSE create mode 100644 day1/cli-study/node_modules/file-entry-cache/README.md create mode 100644 day1/cli-study/node_modules/file-entry-cache/cache.js create mode 100644 day1/cli-study/node_modules/file-entry-cache/changelog.md create mode 100644 day1/cli-study/node_modules/file-entry-cache/package.json create mode 100644 day1/cli-study/node_modules/file-type/index.js create mode 100644 day1/cli-study/node_modules/file-type/license create mode 100644 day1/cli-study/node_modules/file-type/package.json create mode 100644 day1/cli-study/node_modules/file-type/readme.md create mode 100644 day1/cli-study/node_modules/filelist/Jakefile create mode 100644 day1/cli-study/node_modules/filelist/README.md create mode 100644 day1/cli-study/node_modules/filelist/index.js create mode 100644 day1/cli-study/node_modules/filelist/package.json create mode 100644 day1/cli-study/node_modules/filename-reserved-regex/index.js create mode 100644 day1/cli-study/node_modules/filename-reserved-regex/license create mode 100644 day1/cli-study/node_modules/filename-reserved-regex/package.json create mode 100644 day1/cli-study/node_modules/filename-reserved-regex/readme.md create mode 100644 day1/cli-study/node_modules/filenamify/index.js create mode 100644 day1/cli-study/node_modules/filenamify/license create mode 100644 day1/cli-study/node_modules/filenamify/package.json create mode 100644 day1/cli-study/node_modules/filenamify/readme.md create mode 100644 day1/cli-study/node_modules/find-up/index.js create mode 100644 day1/cli-study/node_modules/find-up/license create mode 100644 day1/cli-study/node_modules/find-up/package.json create mode 100644 day1/cli-study/node_modules/find-up/readme.md create mode 100644 day1/cli-study/node_modules/flat-cache/LICENSE create mode 100644 day1/cli-study/node_modules/flat-cache/README.md create mode 100644 day1/cli-study/node_modules/flat-cache/cache.js create mode 100644 day1/cli-study/node_modules/flat-cache/changelog.md create mode 100644 day1/cli-study/node_modules/flat-cache/del.js create mode 100644 day1/cli-study/node_modules/flat-cache/package.json create mode 100644 day1/cli-study/node_modules/flat-cache/utils.js create mode 100644 day1/cli-study/node_modules/flatted/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/flatted/LICENSE create mode 100644 day1/cli-study/node_modules/flatted/README.md create mode 100644 day1/cli-study/node_modules/flatted/SPECS.md create mode 100644 day1/cli-study/node_modules/flatted/cjs/index.js create mode 100644 day1/cli-study/node_modules/flatted/esm/index.js create mode 100644 day1/cli-study/node_modules/flatted/index.js create mode 100644 day1/cli-study/node_modules/flatted/min.js create mode 100644 day1/cli-study/node_modules/flatted/package.json create mode 100644 day1/cli-study/node_modules/flatted/types.d.ts create mode 100644 day1/cli-study/node_modules/follow-redirects/LICENSE create mode 100644 day1/cli-study/node_modules/follow-redirects/README.md create mode 100644 day1/cli-study/node_modules/follow-redirects/http.js create mode 100644 day1/cli-study/node_modules/follow-redirects/https.js create mode 100644 day1/cli-study/node_modules/follow-redirects/index.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/.coveralls.yml create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/.eslintrc create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/.npmignore create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/.travis.yml create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/LICENSE create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/Makefile create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/README.md create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/karma.conf.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/node.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/package.json create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/src/browser.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/src/debug.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/src/index.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/debug/src/node.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/ms/index.js create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/ms/license.md create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/ms/package.json create mode 100644 day1/cli-study/node_modules/follow-redirects/node_modules/ms/readme.md create mode 100644 day1/cli-study/node_modules/follow-redirects/package.json create mode 100644 day1/cli-study/node_modules/from2/.travis.yml create mode 100644 day1/cli-study/node_modules/from2/LICENSE.md create mode 100644 day1/cli-study/node_modules/from2/README.md create mode 100644 day1/cli-study/node_modules/from2/index.js create mode 100644 day1/cli-study/node_modules/from2/package.json create mode 100644 day1/cli-study/node_modules/from2/test.js create mode 100644 day1/cli-study/node_modules/fs-constants/LICENSE create mode 100644 day1/cli-study/node_modules/fs-constants/README.md create mode 100644 day1/cli-study/node_modules/fs-constants/browser.js create mode 100644 day1/cli-study/node_modules/fs-constants/index.js create mode 100644 day1/cli-study/node_modules/fs-constants/package.json create mode 100644 day1/cli-study/node_modules/fs-extra/.npmignore create mode 100644 day1/cli-study/node_modules/fs-extra/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/fs-extra/LICENSE create mode 100644 day1/cli-study/node_modules/fs-extra/README.md create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy/copy.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/copy/ncp.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/empty/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/file.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/link.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/json/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/json/output-json.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/move/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/output/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/remove/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/streams/create-output-stream.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/streams/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/util/assign.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/util/utimes.js create mode 100644 day1/cli-study/node_modules/fs-extra/lib/walk/index.js create mode 100644 day1/cli-study/node_modules/fs-extra/package.json create mode 100644 day1/cli-study/node_modules/fs.realpath/LICENSE create mode 100644 day1/cli-study/node_modules/fs.realpath/README.md create mode 100644 day1/cli-study/node_modules/fs.realpath/index.js create mode 100644 day1/cli-study/node_modules/fs.realpath/old.js create mode 100644 day1/cli-study/node_modules/fs.realpath/package.json create mode 100644 day1/cli-study/node_modules/function-bind/.editorconfig create mode 100644 day1/cli-study/node_modules/function-bind/.eslintrc create mode 100644 day1/cli-study/node_modules/function-bind/.jscs.json create mode 100644 day1/cli-study/node_modules/function-bind/.npmignore create mode 100644 day1/cli-study/node_modules/function-bind/.travis.yml create mode 100644 day1/cli-study/node_modules/function-bind/LICENSE create mode 100644 day1/cli-study/node_modules/function-bind/README.md create mode 100644 day1/cli-study/node_modules/function-bind/implementation.js create mode 100644 day1/cli-study/node_modules/function-bind/index.js create mode 100644 day1/cli-study/node_modules/function-bind/package.json create mode 100644 day1/cli-study/node_modules/function-bind/test/.eslintrc create mode 100644 day1/cli-study/node_modules/function-bind/test/index.js create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/.npmignore create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/LICENSE create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/README.md create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/bench/test.js create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/package.json create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/rbtree.js create mode 100644 day1/cli-study/node_modules/functional-red-black-tree/test/test.js create mode 100644 day1/cli-study/node_modules/get-proxy/index.js create mode 100644 day1/cli-study/node_modules/get-proxy/license create mode 100644 day1/cli-study/node_modules/get-proxy/package.json create mode 100644 day1/cli-study/node_modules/get-proxy/readme.md create mode 100644 day1/cli-study/node_modules/get-stream/buffer-stream.js create mode 100644 day1/cli-study/node_modules/get-stream/index.js create mode 100644 day1/cli-study/node_modules/get-stream/license create mode 100644 day1/cli-study/node_modules/get-stream/package.json create mode 100644 day1/cli-study/node_modules/get-stream/readme.md create mode 100644 day1/cli-study/node_modules/git-clone/README.md create mode 100644 day1/cli-study/node_modules/git-clone/index.js create mode 100644 day1/cli-study/node_modules/git-clone/package.json create mode 100644 day1/cli-study/node_modules/git-clone/test/.npmignore create mode 100644 day1/cli-study/node_modules/git-clone/test/test.js create mode 100644 day1/cli-study/node_modules/glob-parent/LICENSE create mode 100644 day1/cli-study/node_modules/glob-parent/README.md create mode 100644 day1/cli-study/node_modules/glob-parent/index.js create mode 100644 day1/cli-study/node_modules/glob-parent/package.json create mode 100644 day1/cli-study/node_modules/glob/LICENSE create mode 100644 day1/cli-study/node_modules/glob/README.md create mode 100644 day1/cli-study/node_modules/glob/changelog.md create mode 100644 day1/cli-study/node_modules/glob/common.js create mode 100644 day1/cli-study/node_modules/glob/glob.js create mode 100644 day1/cli-study/node_modules/glob/package.json create mode 100644 day1/cli-study/node_modules/glob/sync.js create mode 100644 day1/cli-study/node_modules/globals/globals.json create mode 100644 day1/cli-study/node_modules/globals/index.d.ts create mode 100644 day1/cli-study/node_modules/globals/index.js create mode 100644 day1/cli-study/node_modules/globals/license create mode 100644 day1/cli-study/node_modules/globals/package.json create mode 100644 day1/cli-study/node_modules/globals/readme.md create mode 100644 day1/cli-study/node_modules/got/errors.js create mode 100644 day1/cli-study/node_modules/got/index.js create mode 100644 day1/cli-study/node_modules/got/license create mode 100644 day1/cli-study/node_modules/got/package.json create mode 100644 day1/cli-study/node_modules/got/readme.md create mode 100644 day1/cli-study/node_modules/graceful-fs/LICENSE create mode 100644 day1/cli-study/node_modules/graceful-fs/README.md create mode 100644 day1/cli-study/node_modules/graceful-fs/clone.js create mode 100644 day1/cli-study/node_modules/graceful-fs/graceful-fs.js create mode 100644 day1/cli-study/node_modules/graceful-fs/legacy-streams.js create mode 100644 day1/cli-study/node_modules/graceful-fs/package.json create mode 100644 day1/cli-study/node_modules/graceful-fs/polyfills.js create mode 100644 day1/cli-study/node_modules/graceful-readlink/.npmignore create mode 100644 day1/cli-study/node_modules/graceful-readlink/.travis.yml create mode 100644 day1/cli-study/node_modules/graceful-readlink/LICENSE create mode 100644 day1/cli-study/node_modules/graceful-readlink/README.md create mode 100644 day1/cli-study/node_modules/graceful-readlink/index.js create mode 100644 day1/cli-study/node_modules/graceful-readlink/package.json create mode 100644 day1/cli-study/node_modules/gray-matter/LICENSE create mode 100644 day1/cli-study/node_modules/gray-matter/README.md create mode 100644 day1/cli-study/node_modules/gray-matter/gray-matter.d.ts create mode 100644 day1/cli-study/node_modules/gray-matter/index.js create mode 100644 day1/cli-study/node_modules/gray-matter/lib/parsers.js create mode 100644 day1/cli-study/node_modules/gray-matter/package.json create mode 100644 day1/cli-study/node_modules/has-ansi/index.js create mode 100644 day1/cli-study/node_modules/has-ansi/license create mode 100644 day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/index.js create mode 100644 day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/license create mode 100644 day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/package.json create mode 100644 day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/readme.md create mode 100644 day1/cli-study/node_modules/has-ansi/package.json create mode 100644 day1/cli-study/node_modules/has-ansi/readme.md create mode 100644 day1/cli-study/node_modules/has-flag/index.js create mode 100644 day1/cli-study/node_modules/has-flag/license create mode 100644 day1/cli-study/node_modules/has-flag/package.json create mode 100644 day1/cli-study/node_modules/has-flag/readme.md create mode 100644 day1/cli-study/node_modules/has-generators/.README.md.un~ create mode 100644 day1/cli-study/node_modules/has-generators/.package.json.un~ create mode 100644 day1/cli-study/node_modules/has-generators/README.md create mode 100644 day1/cli-study/node_modules/has-generators/index.js create mode 100644 day1/cli-study/node_modules/has-generators/package.json create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.editorconfig create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.eslintignore create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.eslintrc.json create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.nvmrc create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.travis.yml create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/.uglifyjsrc.json create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/LICENSE create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/README.md create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/badges.html create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/index.js create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.js create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js.map create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/package.json create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/tests/index.html create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/tests/run.js create mode 100644 day1/cli-study/node_modules/has-symbol-support-x/tests/spec/test.js create mode 100644 day1/cli-study/node_modules/has-symbols/.eslintrc create mode 100644 day1/cli-study/node_modules/has-symbols/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/has-symbols/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/has-symbols/.travis.yml create mode 100644 day1/cli-study/node_modules/has-symbols/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/has-symbols/LICENSE create mode 100644 day1/cli-study/node_modules/has-symbols/README.md create mode 100644 day1/cli-study/node_modules/has-symbols/index.js create mode 100644 day1/cli-study/node_modules/has-symbols/package.json create mode 100644 day1/cli-study/node_modules/has-symbols/shams.js create mode 100644 day1/cli-study/node_modules/has-symbols/test/index.js create mode 100644 day1/cli-study/node_modules/has-symbols/test/shams/core-js.js create mode 100644 day1/cli-study/node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 day1/cli-study/node_modules/has-symbols/test/tests.js create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.editorconfig create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.eslintignore create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.eslintrc.json create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.nvmrc create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.travis.yml create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/.uglifyjsrc.json create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/LICENSE create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/README.md create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/badges.html create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/index.js create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.js create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js.map create mode 100644 day1/cli-study/node_modules/has-to-string-tag-x/package.json create mode 100644 day1/cli-study/node_modules/has/LICENSE-MIT create mode 100644 day1/cli-study/node_modules/has/README.md create mode 100644 day1/cli-study/node_modules/has/package.json create mode 100644 day1/cli-study/node_modules/has/src/index.js create mode 100644 day1/cli-study/node_modules/has/test/index.js create mode 100644 day1/cli-study/node_modules/hosted-git-info/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/hosted-git-info/LICENSE create mode 100644 day1/cli-study/node_modules/hosted-git-info/README.md create mode 100644 day1/cli-study/node_modules/hosted-git-info/git-host-info.js create mode 100644 day1/cli-study/node_modules/hosted-git-info/git-host.js create mode 100644 day1/cli-study/node_modules/hosted-git-info/index.js create mode 100644 day1/cli-study/node_modules/hosted-git-info/package.json create mode 100644 day1/cli-study/node_modules/http-cache-semantics/README.md create mode 100644 day1/cli-study/node_modules/http-cache-semantics/node4/index.js create mode 100644 day1/cli-study/node_modules/http-cache-semantics/package.json create mode 100644 day1/cli-study/node_modules/iconv-lite/Changelog.md create mode 100644 day1/cli-study/node_modules/iconv-lite/LICENSE create mode 100644 day1/cli-study/node_modules/iconv-lite/README.md create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/dbcs-codec.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/dbcs-data.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/index.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/internal.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/sbcs-codec.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data-generated.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/big5-added.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/cp936.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/cp949.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/cp950.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/eucjp.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/gbk-added.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/tables/shiftjis.json create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/utf16.js create mode 100644 day1/cli-study/node_modules/iconv-lite/encodings/utf7.js create mode 100644 day1/cli-study/node_modules/iconv-lite/lib/bom-handling.js create mode 100644 day1/cli-study/node_modules/iconv-lite/lib/extend-node.js create mode 100644 day1/cli-study/node_modules/iconv-lite/lib/index.d.ts create mode 100644 day1/cli-study/node_modules/iconv-lite/lib/index.js create mode 100644 day1/cli-study/node_modules/iconv-lite/lib/streams.js create mode 100644 day1/cli-study/node_modules/iconv-lite/package.json create mode 100644 day1/cli-study/node_modules/ieee754/LICENSE create mode 100644 day1/cli-study/node_modules/ieee754/README.md create mode 100644 day1/cli-study/node_modules/ieee754/index.js create mode 100644 day1/cli-study/node_modules/ieee754/package.json create mode 100644 day1/cli-study/node_modules/ignore/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/ignore/LICENSE-MIT create mode 100644 day1/cli-study/node_modules/ignore/README.md create mode 100644 day1/cli-study/node_modules/ignore/index.d.ts create mode 100644 day1/cli-study/node_modules/ignore/index.js create mode 100644 day1/cli-study/node_modules/ignore/legacy.js create mode 100644 day1/cli-study/node_modules/ignore/package.json create mode 100644 day1/cli-study/node_modules/import-fresh/index.d.ts create mode 100644 day1/cli-study/node_modules/import-fresh/index.js create mode 100644 day1/cli-study/node_modules/import-fresh/license create mode 100644 day1/cli-study/node_modules/import-fresh/package.json create mode 100644 day1/cli-study/node_modules/import-fresh/readme.md create mode 100644 day1/cli-study/node_modules/imurmurhash/README.md create mode 100644 day1/cli-study/node_modules/imurmurhash/imurmurhash.js create mode 100644 day1/cli-study/node_modules/imurmurhash/imurmurhash.min.js create mode 100644 day1/cli-study/node_modules/imurmurhash/package.json create mode 100644 day1/cli-study/node_modules/inflight/LICENSE create mode 100644 day1/cli-study/node_modules/inflight/README.md create mode 100644 day1/cli-study/node_modules/inflight/inflight.js create mode 100644 day1/cli-study/node_modules/inflight/package.json create mode 100644 day1/cli-study/node_modules/inherits/LICENSE create mode 100644 day1/cli-study/node_modules/inherits/README.md create mode 100644 day1/cli-study/node_modules/inherits/inherits.js create mode 100644 day1/cli-study/node_modules/inherits/inherits_browser.js create mode 100644 day1/cli-study/node_modules/inherits/package.json create mode 100644 day1/cli-study/node_modules/ini/LICENSE create mode 100644 day1/cli-study/node_modules/ini/README.md create mode 100644 day1/cli-study/node_modules/ini/ini.js create mode 100644 day1/cli-study/node_modules/ini/package.json create mode 100644 day1/cli-study/node_modules/inquirer/LICENSE create mode 100644 day1/cli-study/node_modules/inquirer/README.md create mode 100644 day1/cli-study/node_modules/inquirer/lib/inquirer.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/objects/choice.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/objects/choices.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/objects/separator.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/base.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/checkbox.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/confirm.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/editor.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/expand.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/input.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/list.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/number.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/password.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/prompts/rawlist.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/ui/baseUI.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/ui/bottom-bar.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/ui/prompt.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/utils/events.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/utils/paginator.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/utils/readline.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/utils/screen-manager.js create mode 100644 day1/cli-study/node_modules/inquirer/lib/utils/utils.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/source/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/source/templates.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/chalk/source/util.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/LICENSE create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/README.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/conversions.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-convert/route.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-name/LICENSE create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-name/README.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-name/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/color-name/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/README.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/es2015/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/es2015/text.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/emoji-regex/text.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/has-flag/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/has-flag/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/has-flag/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/has-flag/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/has-flag/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/is-fullwidth-code-point/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/is-fullwidth-code-point/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/is-fullwidth-code-point/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/is-fullwidth-code-point/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/string-width/index.d.ts create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/string-width/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/string-width/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/string-width/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/string-width/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/supports-color/browser.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/supports-color/index.js create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/supports-color/license create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/supports-color/package.json create mode 100644 day1/cli-study/node_modules/inquirer/node_modules/supports-color/readme.md create mode 100644 day1/cli-study/node_modules/inquirer/package.json create mode 100644 day1/cli-study/node_modules/into-stream/index.js create mode 100644 day1/cli-study/node_modules/into-stream/license create mode 100644 day1/cli-study/node_modules/into-stream/package.json create mode 100644 day1/cli-study/node_modules/into-stream/readme.md create mode 100644 day1/cli-study/node_modules/is-arrayish/.editorconfig create mode 100644 day1/cli-study/node_modules/is-arrayish/.istanbul.yml create mode 100644 day1/cli-study/node_modules/is-arrayish/.npmignore create mode 100644 day1/cli-study/node_modules/is-arrayish/.travis.yml create mode 100644 day1/cli-study/node_modules/is-arrayish/LICENSE create mode 100644 day1/cli-study/node_modules/is-arrayish/README.md create mode 100644 day1/cli-study/node_modules/is-arrayish/index.js create mode 100644 day1/cli-study/node_modules/is-arrayish/package.json create mode 100644 day1/cli-study/node_modules/is-callable/.editorconfig create mode 100644 day1/cli-study/node_modules/is-callable/.eslintrc create mode 100644 day1/cli-study/node_modules/is-callable/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/is-callable/.github/main.workflow create mode 100644 day1/cli-study/node_modules/is-callable/.github/workflows/lint.yml create mode 100644 day1/cli-study/node_modules/is-callable/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/is-callable/.istanbul.yml create mode 100644 day1/cli-study/node_modules/is-callable/.travis.yml create mode 100644 day1/cli-study/node_modules/is-callable/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is-callable/LICENSE create mode 100644 day1/cli-study/node_modules/is-callable/README.md create mode 100644 day1/cli-study/node_modules/is-callable/index.js create mode 100644 day1/cli-study/node_modules/is-callable/package.json create mode 100644 day1/cli-study/node_modules/is-callable/test/index.js create mode 100644 day1/cli-study/node_modules/is-date-object/.eslintrc create mode 100644 day1/cli-study/node_modules/is-date-object/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/is-date-object/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/is-date-object/.jscs.json create mode 100644 day1/cli-study/node_modules/is-date-object/.travis.yml create mode 100644 day1/cli-study/node_modules/is-date-object/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is-date-object/LICENSE create mode 100644 day1/cli-study/node_modules/is-date-object/README.md create mode 100644 day1/cli-study/node_modules/is-date-object/index.js create mode 100644 day1/cli-study/node_modules/is-date-object/package.json create mode 100644 day1/cli-study/node_modules/is-date-object/test/index.js create mode 100644 day1/cli-study/node_modules/is-extendable/LICENSE create mode 100644 day1/cli-study/node_modules/is-extendable/README.md create mode 100644 day1/cli-study/node_modules/is-extendable/index.js create mode 100644 day1/cli-study/node_modules/is-extendable/package.json create mode 100644 day1/cli-study/node_modules/is-extglob/LICENSE create mode 100644 day1/cli-study/node_modules/is-extglob/README.md create mode 100644 day1/cli-study/node_modules/is-extglob/index.js create mode 100644 day1/cli-study/node_modules/is-extglob/package.json create mode 100644 day1/cli-study/node_modules/is-fullwidth-code-point/index.js create mode 100644 day1/cli-study/node_modules/is-fullwidth-code-point/license create mode 100644 day1/cli-study/node_modules/is-fullwidth-code-point/package.json create mode 100644 day1/cli-study/node_modules/is-fullwidth-code-point/readme.md create mode 100644 day1/cli-study/node_modules/is-glob/LICENSE create mode 100644 day1/cli-study/node_modules/is-glob/README.md create mode 100644 day1/cli-study/node_modules/is-glob/index.js create mode 100644 day1/cli-study/node_modules/is-glob/package.json create mode 100644 day1/cli-study/node_modules/is-interactive/index.d.ts create mode 100644 day1/cli-study/node_modules/is-interactive/index.js create mode 100644 day1/cli-study/node_modules/is-interactive/license create mode 100644 day1/cli-study/node_modules/is-interactive/package.json create mode 100644 day1/cli-study/node_modules/is-interactive/readme.md create mode 100644 day1/cli-study/node_modules/is-natural-number/LICENSE create mode 100644 day1/cli-study/node_modules/is-natural-number/README.md create mode 100644 day1/cli-study/node_modules/is-natural-number/index.js create mode 100644 day1/cli-study/node_modules/is-natural-number/index.jsnext.js create mode 100644 day1/cli-study/node_modules/is-natural-number/package.json create mode 100644 day1/cli-study/node_modules/is-object/.jscs.json create mode 100644 day1/cli-study/node_modules/is-object/.npmignore create mode 100644 day1/cli-study/node_modules/is-object/.testem.json create mode 100644 day1/cli-study/node_modules/is-object/.travis.yml create mode 100644 day1/cli-study/node_modules/is-object/LICENSE create mode 100644 day1/cli-study/node_modules/is-object/README.md create mode 100644 day1/cli-study/node_modules/is-object/index.js create mode 100644 day1/cli-study/node_modules/is-object/package.json create mode 100644 day1/cli-study/node_modules/is-object/test/index.js create mode 100644 day1/cli-study/node_modules/is-plain-obj/index.js create mode 100644 day1/cli-study/node_modules/is-plain-obj/license create mode 100644 day1/cli-study/node_modules/is-plain-obj/package.json create mode 100644 day1/cli-study/node_modules/is-plain-obj/readme.md create mode 100644 day1/cli-study/node_modules/is-regex/.editorconfig create mode 100644 day1/cli-study/node_modules/is-regex/.eslintrc create mode 100644 day1/cli-study/node_modules/is-regex/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/is-regex/.travis.yml create mode 100644 day1/cli-study/node_modules/is-regex/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is-regex/LICENSE create mode 100644 day1/cli-study/node_modules/is-regex/README.md create mode 100644 day1/cli-study/node_modules/is-regex/index.js create mode 100644 day1/cli-study/node_modules/is-regex/package.json create mode 100644 day1/cli-study/node_modules/is-regex/test/index.js create mode 100644 day1/cli-study/node_modules/is-retry-allowed/index.js create mode 100644 day1/cli-study/node_modules/is-retry-allowed/license create mode 100644 day1/cli-study/node_modules/is-retry-allowed/package.json create mode 100644 day1/cli-study/node_modules/is-retry-allowed/readme.md create mode 100644 day1/cli-study/node_modules/is-stream/index.js create mode 100644 day1/cli-study/node_modules/is-stream/license create mode 100644 day1/cli-study/node_modules/is-stream/package.json create mode 100644 day1/cli-study/node_modules/is-stream/readme.md create mode 100644 day1/cli-study/node_modules/is-string/.eslintrc create mode 100644 day1/cli-study/node_modules/is-string/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/is-string/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/is-string/.travis.yml create mode 100644 day1/cli-study/node_modules/is-string/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is-string/LICENSE create mode 100644 day1/cli-study/node_modules/is-string/README.md create mode 100644 day1/cli-study/node_modules/is-string/index.js create mode 100644 day1/cli-study/node_modules/is-string/package.json create mode 100644 day1/cli-study/node_modules/is-string/test/index.js create mode 100644 day1/cli-study/node_modules/is-symbol/.editorconfig create mode 100644 day1/cli-study/node_modules/is-symbol/.eslintrc create mode 100644 day1/cli-study/node_modules/is-symbol/.github/FUNDING.yml create mode 100644 day1/cli-study/node_modules/is-symbol/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/is-symbol/.nvmrc create mode 100644 day1/cli-study/node_modules/is-symbol/.travis.yml create mode 100644 day1/cli-study/node_modules/is-symbol/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is-symbol/LICENSE create mode 100644 day1/cli-study/node_modules/is-symbol/Makefile create mode 100644 day1/cli-study/node_modules/is-symbol/README.md create mode 100644 day1/cli-study/node_modules/is-symbol/index.js create mode 100644 day1/cli-study/node_modules/is-symbol/package.json create mode 100644 day1/cli-study/node_modules/is-symbol/test/index.js create mode 100644 day1/cli-study/node_modules/is-utf8/LICENSE create mode 100644 day1/cli-study/node_modules/is-utf8/README.md create mode 100644 day1/cli-study/node_modules/is-utf8/is-utf8.js create mode 100644 day1/cli-study/node_modules/is-utf8/package.json create mode 100644 day1/cli-study/node_modules/is/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/is/LICENSE.md create mode 100644 day1/cli-study/node_modules/is/Makefile create mode 100644 day1/cli-study/node_modules/is/README.md create mode 100644 day1/cli-study/node_modules/is/component.json create mode 100644 day1/cli-study/node_modules/is/index.js create mode 100644 day1/cli-study/node_modules/is/package.json create mode 100644 day1/cli-study/node_modules/is/test/index.js create mode 100644 day1/cli-study/node_modules/isarray/.npmignore create mode 100644 day1/cli-study/node_modules/isarray/.travis.yml create mode 100644 day1/cli-study/node_modules/isarray/Makefile create mode 100644 day1/cli-study/node_modules/isarray/README.md create mode 100644 day1/cli-study/node_modules/isarray/component.json create mode 100644 day1/cli-study/node_modules/isarray/index.js create mode 100644 day1/cli-study/node_modules/isarray/package.json create mode 100644 day1/cli-study/node_modules/isarray/test.js create mode 100644 day1/cli-study/node_modules/isexe/.npmignore create mode 100644 day1/cli-study/node_modules/isexe/LICENSE create mode 100644 day1/cli-study/node_modules/isexe/README.md create mode 100644 day1/cli-study/node_modules/isexe/index.js create mode 100644 day1/cli-study/node_modules/isexe/mode.js create mode 100644 day1/cli-study/node_modules/isexe/package.json create mode 100644 day1/cli-study/node_modules/isexe/test/basic.js create mode 100644 day1/cli-study/node_modules/isexe/windows.js create mode 100644 day1/cli-study/node_modules/isurl/LICENSE create mode 100644 day1/cli-study/node_modules/isurl/README.md create mode 100644 day1/cli-study/node_modules/isurl/index.js create mode 100644 day1/cli-study/node_modules/isurl/package.json create mode 100644 day1/cli-study/node_modules/jake/Makefile create mode 100644 day1/cli-study/node_modules/jake/README.md create mode 100644 day1/cli-study/node_modules/jake/bin/bash_completion.sh create mode 100644 day1/cli-study/node_modules/jake/bin/cli.js create mode 100644 day1/cli-study/node_modules/jake/jakefile.js create mode 100644 day1/cli-study/node_modules/jake/lib/api.js create mode 100644 day1/cli-study/node_modules/jake/lib/jake.js create mode 100644 day1/cli-study/node_modules/jake/lib/loader.js create mode 100644 day1/cli-study/node_modules/jake/lib/namespace.js create mode 100644 day1/cli-study/node_modules/jake/lib/package_task.js create mode 100644 day1/cli-study/node_modules/jake/lib/parseargs.js create mode 100644 day1/cli-study/node_modules/jake/lib/program.js create mode 100644 day1/cli-study/node_modules/jake/lib/publish_task.js create mode 100644 day1/cli-study/node_modules/jake/lib/rule.js create mode 100644 day1/cli-study/node_modules/jake/lib/task/directory_task.js create mode 100644 day1/cli-study/node_modules/jake/lib/task/file_task.js create mode 100644 day1/cli-study/node_modules/jake/lib/task/index.js create mode 100644 day1/cli-study/node_modules/jake/lib/task/task.js create mode 100644 day1/cli-study/node_modules/jake/lib/test_task.js create mode 100644 day1/cli-study/node_modules/jake/lib/utils/file.js create mode 100644 day1/cli-study/node_modules/jake/lib/utils/index.js create mode 100644 day1/cli-study/node_modules/jake/lib/utils/logger.js create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/index.js create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/index.js.flow create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/templates.js create mode 100644 day1/cli-study/node_modules/jake/node_modules/chalk/types/index.d.ts create mode 100644 day1/cli-study/node_modules/jake/package.json create mode 100644 day1/cli-study/node_modules/jake/test/integration/concurrent.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/file.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/file_task.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/helpers.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/jakefile.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/jakelib/concurrent.jake.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/jakelib/publish.jake.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/jakelib/required_module.jake.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/jakelib/rule.jake.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/publish_task.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/rule.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/selfdep.js create mode 100644 day1/cli-study/node_modules/jake/test/integration/task_base.js create mode 100644 day1/cli-study/node_modules/jake/test/unit/jakefile.js create mode 100644 day1/cli-study/node_modules/jake/test/unit/namespace.js create mode 100644 day1/cli-study/node_modules/jake/test/unit/parseargs.js create mode 100644 day1/cli-study/node_modules/jake/usage.txt create mode 100644 day1/cli-study/node_modules/js-tokens/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/js-tokens/LICENSE create mode 100644 day1/cli-study/node_modules/js-tokens/README.md create mode 100644 day1/cli-study/node_modules/js-tokens/index.js create mode 100644 day1/cli-study/node_modules/js-tokens/package.json create mode 100644 day1/cli-study/node_modules/js-yaml/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/js-yaml/LICENSE create mode 100644 day1/cli-study/node_modules/js-yaml/README.md create mode 100644 day1/cli-study/node_modules/js-yaml/bin/js-yaml.js create mode 100644 day1/cli-study/node_modules/js-yaml/dist/js-yaml.js create mode 100644 day1/cli-study/node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 day1/cli-study/node_modules/js-yaml/index.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/common.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/dumper.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/exception.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/loader.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/mark.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema/core.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema/default_full.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/schema/json.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/binary.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/bool.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/float.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/int.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/js/function.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/map.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/merge.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/null.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/omap.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/pairs.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/seq.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/set.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/str.js create mode 100644 day1/cli-study/node_modules/js-yaml/lib/js-yaml/type/timestamp.js create mode 100644 day1/cli-study/node_modules/js-yaml/package.json create mode 100644 day1/cli-study/node_modules/json-buffer/.npmignore create mode 100644 day1/cli-study/node_modules/json-buffer/.travis.yml create mode 100644 day1/cli-study/node_modules/json-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/json-buffer/README.md create mode 100644 day1/cli-study/node_modules/json-buffer/index.js create mode 100644 day1/cli-study/node_modules/json-buffer/package.json create mode 100644 day1/cli-study/node_modules/json-buffer/test/index.js create mode 100644 day1/cli-study/node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 day1/cli-study/node_modules/json-schema-traverse/.travis.yml create mode 100644 day1/cli-study/node_modules/json-schema-traverse/LICENSE create mode 100644 day1/cli-study/node_modules/json-schema-traverse/README.md create mode 100644 day1/cli-study/node_modules/json-schema-traverse/index.js create mode 100644 day1/cli-study/node_modules/json-schema-traverse/package.json create mode 100644 day1/cli-study/node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 day1/cli-study/node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 day1/cli-study/node_modules/json-schema-traverse/spec/index.spec.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/.npmignore create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/.travis.yml create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/LICENSE create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/example/nested.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/example/str.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/index.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/package.json create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/readme.markdown create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/cmp.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/nested.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/replacer.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/space.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/str.js create mode 100644 day1/cli-study/node_modules/json-stable-stringify-without-jsonify/test/to-json.js create mode 100644 day1/cli-study/node_modules/json5/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/json5/LICENSE.md create mode 100644 day1/cli-study/node_modules/json5/README.md create mode 100644 day1/cli-study/node_modules/json5/dist/index.js create mode 100644 day1/cli-study/node_modules/json5/lib/cli.js create mode 100644 day1/cli-study/node_modules/json5/lib/index.js create mode 100644 day1/cli-study/node_modules/json5/lib/parse.js create mode 100644 day1/cli-study/node_modules/json5/lib/register.js create mode 100644 day1/cli-study/node_modules/json5/lib/require.js create mode 100644 day1/cli-study/node_modules/json5/lib/stringify.js create mode 100644 day1/cli-study/node_modules/json5/lib/unicode.js create mode 100644 day1/cli-study/node_modules/json5/lib/util.js create mode 100644 day1/cli-study/node_modules/json5/package.json create mode 100644 day1/cli-study/node_modules/jsonfile/.npmignore create mode 100644 day1/cli-study/node_modules/jsonfile/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/jsonfile/LICENSE create mode 100644 day1/cli-study/node_modules/jsonfile/README.md create mode 100644 day1/cli-study/node_modules/jsonfile/appveyor.yml create mode 100644 day1/cli-study/node_modules/jsonfile/index.js create mode 100644 day1/cli-study/node_modules/jsonfile/package.json create mode 100644 day1/cli-study/node_modules/keyv/LICENSE create mode 100644 day1/cli-study/node_modules/keyv/README.md create mode 100644 day1/cli-study/node_modules/keyv/package.json create mode 100644 day1/cli-study/node_modules/keyv/src/index.js create mode 100644 day1/cli-study/node_modules/klaw/.npmignore create mode 100644 day1/cli-study/node_modules/klaw/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/klaw/LICENSE create mode 100644 day1/cli-study/node_modules/klaw/README.md create mode 100644 day1/cli-study/node_modules/klaw/package.json create mode 100644 day1/cli-study/node_modules/klaw/src/assign.js create mode 100644 day1/cli-study/node_modules/klaw/src/index.js create mode 100644 day1/cli-study/node_modules/levn/LICENSE create mode 100644 day1/cli-study/node_modules/levn/README.md create mode 100644 day1/cli-study/node_modules/levn/lib/cast.js create mode 100644 day1/cli-study/node_modules/levn/lib/index.js create mode 100644 day1/cli-study/node_modules/levn/lib/parse-string.js create mode 100644 day1/cli-study/node_modules/levn/package.json create mode 100644 day1/cli-study/node_modules/load-json-file/index.js create mode 100644 day1/cli-study/node_modules/load-json-file/license create mode 100644 day1/cli-study/node_modules/load-json-file/node_modules/pify/index.js create mode 100644 day1/cli-study/node_modules/load-json-file/node_modules/pify/license create mode 100644 day1/cli-study/node_modules/load-json-file/node_modules/pify/package.json create mode 100644 day1/cli-study/node_modules/load-json-file/node_modules/pify/readme.md create mode 100644 day1/cli-study/node_modules/load-json-file/package.json create mode 100644 day1/cli-study/node_modules/load-json-file/readme.md create mode 100644 day1/cli-study/node_modules/locate-path/index.js create mode 100644 day1/cli-study/node_modules/locate-path/license create mode 100644 day1/cli-study/node_modules/locate-path/package.json create mode 100644 day1/cli-study/node_modules/locate-path/readme.md create mode 100644 day1/cli-study/node_modules/lodash/LICENSE create mode 100644 day1/cli-study/node_modules/lodash/README.md create mode 100644 day1/cli-study/node_modules/lodash/_DataView.js create mode 100644 day1/cli-study/node_modules/lodash/_Hash.js create mode 100644 day1/cli-study/node_modules/lodash/_LazyWrapper.js create mode 100644 day1/cli-study/node_modules/lodash/_ListCache.js create mode 100644 day1/cli-study/node_modules/lodash/_LodashWrapper.js create mode 100644 day1/cli-study/node_modules/lodash/_Map.js create mode 100644 day1/cli-study/node_modules/lodash/_MapCache.js create mode 100644 day1/cli-study/node_modules/lodash/_Promise.js create mode 100644 day1/cli-study/node_modules/lodash/_Set.js create mode 100644 day1/cli-study/node_modules/lodash/_SetCache.js create mode 100644 day1/cli-study/node_modules/lodash/_Stack.js create mode 100644 day1/cli-study/node_modules/lodash/_Symbol.js create mode 100644 day1/cli-study/node_modules/lodash/_Uint8Array.js create mode 100644 day1/cli-study/node_modules/lodash/_WeakMap.js create mode 100644 day1/cli-study/node_modules/lodash/_apply.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayAggregator.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayEach.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayEachRight.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayEvery.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayFilter.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayIncludes.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayIncludesWith.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayLikeKeys.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayMap.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayPush.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayReduce.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayReduceRight.js create mode 100644 day1/cli-study/node_modules/lodash/_arraySample.js create mode 100644 day1/cli-study/node_modules/lodash/_arraySampleSize.js create mode 100644 day1/cli-study/node_modules/lodash/_arrayShuffle.js create mode 100644 day1/cli-study/node_modules/lodash/_arraySome.js create mode 100644 day1/cli-study/node_modules/lodash/_asciiSize.js create mode 100644 day1/cli-study/node_modules/lodash/_asciiToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_asciiWords.js create mode 100644 day1/cli-study/node_modules/lodash/_assignMergeValue.js create mode 100644 day1/cli-study/node_modules/lodash/_assignValue.js create mode 100644 day1/cli-study/node_modules/lodash/_assocIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/_baseAggregator.js create mode 100644 day1/cli-study/node_modules/lodash/_baseAssign.js create mode 100644 day1/cli-study/node_modules/lodash/_baseAssignIn.js create mode 100644 day1/cli-study/node_modules/lodash/_baseAssignValue.js create mode 100644 day1/cli-study/node_modules/lodash/_baseAt.js create mode 100644 day1/cli-study/node_modules/lodash/_baseClamp.js create mode 100644 day1/cli-study/node_modules/lodash/_baseClone.js create mode 100644 day1/cli-study/node_modules/lodash/_baseConforms.js create mode 100644 day1/cli-study/node_modules/lodash/_baseConformsTo.js create mode 100644 day1/cli-study/node_modules/lodash/_baseCreate.js create mode 100644 day1/cli-study/node_modules/lodash/_baseDelay.js create mode 100644 day1/cli-study/node_modules/lodash/_baseDifference.js create mode 100644 day1/cli-study/node_modules/lodash/_baseEach.js create mode 100644 day1/cli-study/node_modules/lodash/_baseEachRight.js create mode 100644 day1/cli-study/node_modules/lodash/_baseEvery.js create mode 100644 day1/cli-study/node_modules/lodash/_baseExtremum.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFill.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFilter.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFindIndex.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFindKey.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFlatten.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFor.js create mode 100644 day1/cli-study/node_modules/lodash/_baseForOwn.js create mode 100644 day1/cli-study/node_modules/lodash/_baseForOwnRight.js create mode 100644 day1/cli-study/node_modules/lodash/_baseForRight.js create mode 100644 day1/cli-study/node_modules/lodash/_baseFunctions.js create mode 100644 day1/cli-study/node_modules/lodash/_baseGet.js create mode 100644 day1/cli-study/node_modules/lodash/_baseGetAllKeys.js create mode 100644 day1/cli-study/node_modules/lodash/_baseGetTag.js create mode 100644 day1/cli-study/node_modules/lodash/_baseGt.js create mode 100644 day1/cli-study/node_modules/lodash/_baseHas.js create mode 100644 day1/cli-study/node_modules/lodash/_baseHasIn.js create mode 100644 day1/cli-study/node_modules/lodash/_baseInRange.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIndexOfWith.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIntersection.js create mode 100644 day1/cli-study/node_modules/lodash/_baseInverter.js create mode 100644 day1/cli-study/node_modules/lodash/_baseInvoke.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsArguments.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsArrayBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsDate.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsEqual.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsEqualDeep.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsMap.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsMatch.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsNaN.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsNative.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsSet.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIsTypedArray.js create mode 100644 day1/cli-study/node_modules/lodash/_baseIteratee.js create mode 100644 day1/cli-study/node_modules/lodash/_baseKeys.js create mode 100644 day1/cli-study/node_modules/lodash/_baseKeysIn.js create mode 100644 day1/cli-study/node_modules/lodash/_baseLodash.js create mode 100644 day1/cli-study/node_modules/lodash/_baseLt.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMap.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMatches.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMatchesProperty.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMean.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMerge.js create mode 100644 day1/cli-study/node_modules/lodash/_baseMergeDeep.js create mode 100644 day1/cli-study/node_modules/lodash/_baseNth.js create mode 100644 day1/cli-study/node_modules/lodash/_baseOrderBy.js create mode 100644 day1/cli-study/node_modules/lodash/_basePick.js create mode 100644 day1/cli-study/node_modules/lodash/_basePickBy.js create mode 100644 day1/cli-study/node_modules/lodash/_baseProperty.js create mode 100644 day1/cli-study/node_modules/lodash/_basePropertyDeep.js create mode 100644 day1/cli-study/node_modules/lodash/_basePropertyOf.js create mode 100644 day1/cli-study/node_modules/lodash/_basePullAll.js create mode 100644 day1/cli-study/node_modules/lodash/_basePullAt.js create mode 100644 day1/cli-study/node_modules/lodash/_baseRandom.js create mode 100644 day1/cli-study/node_modules/lodash/_baseRange.js create mode 100644 day1/cli-study/node_modules/lodash/_baseReduce.js create mode 100644 day1/cli-study/node_modules/lodash/_baseRepeat.js create mode 100644 day1/cli-study/node_modules/lodash/_baseRest.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSample.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSampleSize.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSet.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSetData.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSetToString.js create mode 100644 day1/cli-study/node_modules/lodash/_baseShuffle.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSlice.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSome.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSortBy.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSortedIndex.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSortedIndexBy.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSortedUniq.js create mode 100644 day1/cli-study/node_modules/lodash/_baseSum.js create mode 100644 day1/cli-study/node_modules/lodash/_baseTimes.js create mode 100644 day1/cli-study/node_modules/lodash/_baseToNumber.js create mode 100644 day1/cli-study/node_modules/lodash/_baseToPairs.js create mode 100644 day1/cli-study/node_modules/lodash/_baseToString.js create mode 100644 day1/cli-study/node_modules/lodash/_baseUnary.js create mode 100644 day1/cli-study/node_modules/lodash/_baseUniq.js create mode 100644 day1/cli-study/node_modules/lodash/_baseUnset.js create mode 100644 day1/cli-study/node_modules/lodash/_baseUpdate.js create mode 100644 day1/cli-study/node_modules/lodash/_baseValues.js create mode 100644 day1/cli-study/node_modules/lodash/_baseWhile.js create mode 100644 day1/cli-study/node_modules/lodash/_baseWrapperValue.js create mode 100644 day1/cli-study/node_modules/lodash/_baseXor.js create mode 100644 day1/cli-study/node_modules/lodash/_baseZipObject.js create mode 100644 day1/cli-study/node_modules/lodash/_cacheHas.js create mode 100644 day1/cli-study/node_modules/lodash/_castArrayLikeObject.js create mode 100644 day1/cli-study/node_modules/lodash/_castFunction.js create mode 100644 day1/cli-study/node_modules/lodash/_castPath.js create mode 100644 day1/cli-study/node_modules/lodash/_castRest.js create mode 100644 day1/cli-study/node_modules/lodash/_castSlice.js create mode 100644 day1/cli-study/node_modules/lodash/_charsEndIndex.js create mode 100644 day1/cli-study/node_modules/lodash/_charsStartIndex.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneArrayBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneDataView.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneSymbol.js create mode 100644 day1/cli-study/node_modules/lodash/_cloneTypedArray.js create mode 100644 day1/cli-study/node_modules/lodash/_compareAscending.js create mode 100644 day1/cli-study/node_modules/lodash/_compareMultiple.js create mode 100644 day1/cli-study/node_modules/lodash/_composeArgs.js create mode 100644 day1/cli-study/node_modules/lodash/_composeArgsRight.js create mode 100644 day1/cli-study/node_modules/lodash/_copyArray.js create mode 100644 day1/cli-study/node_modules/lodash/_copyObject.js create mode 100644 day1/cli-study/node_modules/lodash/_copySymbols.js create mode 100644 day1/cli-study/node_modules/lodash/_copySymbolsIn.js create mode 100644 day1/cli-study/node_modules/lodash/_coreJsData.js create mode 100644 day1/cli-study/node_modules/lodash/_countHolders.js create mode 100644 day1/cli-study/node_modules/lodash/_createAggregator.js create mode 100644 day1/cli-study/node_modules/lodash/_createAssigner.js create mode 100644 day1/cli-study/node_modules/lodash/_createBaseEach.js create mode 100644 day1/cli-study/node_modules/lodash/_createBaseFor.js create mode 100644 day1/cli-study/node_modules/lodash/_createBind.js create mode 100644 day1/cli-study/node_modules/lodash/_createCaseFirst.js create mode 100644 day1/cli-study/node_modules/lodash/_createCompounder.js create mode 100644 day1/cli-study/node_modules/lodash/_createCtor.js create mode 100644 day1/cli-study/node_modules/lodash/_createCurry.js create mode 100644 day1/cli-study/node_modules/lodash/_createFind.js create mode 100644 day1/cli-study/node_modules/lodash/_createFlow.js create mode 100644 day1/cli-study/node_modules/lodash/_createHybrid.js create mode 100644 day1/cli-study/node_modules/lodash/_createInverter.js create mode 100644 day1/cli-study/node_modules/lodash/_createMathOperation.js create mode 100644 day1/cli-study/node_modules/lodash/_createOver.js create mode 100644 day1/cli-study/node_modules/lodash/_createPadding.js create mode 100644 day1/cli-study/node_modules/lodash/_createPartial.js create mode 100644 day1/cli-study/node_modules/lodash/_createRange.js create mode 100644 day1/cli-study/node_modules/lodash/_createRecurry.js create mode 100644 day1/cli-study/node_modules/lodash/_createRelationalOperation.js create mode 100644 day1/cli-study/node_modules/lodash/_createRound.js create mode 100644 day1/cli-study/node_modules/lodash/_createSet.js create mode 100644 day1/cli-study/node_modules/lodash/_createToPairs.js create mode 100644 day1/cli-study/node_modules/lodash/_createWrap.js create mode 100644 day1/cli-study/node_modules/lodash/_customDefaultsAssignIn.js create mode 100644 day1/cli-study/node_modules/lodash/_customDefaultsMerge.js create mode 100644 day1/cli-study/node_modules/lodash/_customOmitClone.js create mode 100644 day1/cli-study/node_modules/lodash/_deburrLetter.js create mode 100644 day1/cli-study/node_modules/lodash/_defineProperty.js create mode 100644 day1/cli-study/node_modules/lodash/_equalArrays.js create mode 100644 day1/cli-study/node_modules/lodash/_equalByTag.js create mode 100644 day1/cli-study/node_modules/lodash/_equalObjects.js create mode 100644 day1/cli-study/node_modules/lodash/_escapeHtmlChar.js create mode 100644 day1/cli-study/node_modules/lodash/_escapeStringChar.js create mode 100644 day1/cli-study/node_modules/lodash/_flatRest.js create mode 100644 day1/cli-study/node_modules/lodash/_freeGlobal.js create mode 100644 day1/cli-study/node_modules/lodash/_getAllKeys.js create mode 100644 day1/cli-study/node_modules/lodash/_getAllKeysIn.js create mode 100644 day1/cli-study/node_modules/lodash/_getData.js create mode 100644 day1/cli-study/node_modules/lodash/_getFuncName.js create mode 100644 day1/cli-study/node_modules/lodash/_getHolder.js create mode 100644 day1/cli-study/node_modules/lodash/_getMapData.js create mode 100644 day1/cli-study/node_modules/lodash/_getMatchData.js create mode 100644 day1/cli-study/node_modules/lodash/_getNative.js create mode 100644 day1/cli-study/node_modules/lodash/_getPrototype.js create mode 100644 day1/cli-study/node_modules/lodash/_getRawTag.js create mode 100644 day1/cli-study/node_modules/lodash/_getSymbols.js create mode 100644 day1/cli-study/node_modules/lodash/_getSymbolsIn.js create mode 100644 day1/cli-study/node_modules/lodash/_getTag.js create mode 100644 day1/cli-study/node_modules/lodash/_getValue.js create mode 100644 day1/cli-study/node_modules/lodash/_getView.js create mode 100644 day1/cli-study/node_modules/lodash/_getWrapDetails.js create mode 100644 day1/cli-study/node_modules/lodash/_hasPath.js create mode 100644 day1/cli-study/node_modules/lodash/_hasUnicode.js create mode 100644 day1/cli-study/node_modules/lodash/_hasUnicodeWord.js create mode 100644 day1/cli-study/node_modules/lodash/_hashClear.js create mode 100644 day1/cli-study/node_modules/lodash/_hashDelete.js create mode 100644 day1/cli-study/node_modules/lodash/_hashGet.js create mode 100644 day1/cli-study/node_modules/lodash/_hashHas.js create mode 100644 day1/cli-study/node_modules/lodash/_hashSet.js create mode 100644 day1/cli-study/node_modules/lodash/_initCloneArray.js create mode 100644 day1/cli-study/node_modules/lodash/_initCloneByTag.js create mode 100644 day1/cli-study/node_modules/lodash/_initCloneObject.js create mode 100644 day1/cli-study/node_modules/lodash/_insertWrapDetails.js create mode 100644 day1/cli-study/node_modules/lodash/_isFlattenable.js create mode 100644 day1/cli-study/node_modules/lodash/_isIndex.js create mode 100644 day1/cli-study/node_modules/lodash/_isIterateeCall.js create mode 100644 day1/cli-study/node_modules/lodash/_isKey.js create mode 100644 day1/cli-study/node_modules/lodash/_isKeyable.js create mode 100644 day1/cli-study/node_modules/lodash/_isLaziable.js create mode 100644 day1/cli-study/node_modules/lodash/_isMaskable.js create mode 100644 day1/cli-study/node_modules/lodash/_isMasked.js create mode 100644 day1/cli-study/node_modules/lodash/_isPrototype.js create mode 100644 day1/cli-study/node_modules/lodash/_isStrictComparable.js create mode 100644 day1/cli-study/node_modules/lodash/_iteratorToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_lazyClone.js create mode 100644 day1/cli-study/node_modules/lodash/_lazyReverse.js create mode 100644 day1/cli-study/node_modules/lodash/_lazyValue.js create mode 100644 day1/cli-study/node_modules/lodash/_listCacheClear.js create mode 100644 day1/cli-study/node_modules/lodash/_listCacheDelete.js create mode 100644 day1/cli-study/node_modules/lodash/_listCacheGet.js create mode 100644 day1/cli-study/node_modules/lodash/_listCacheHas.js create mode 100644 day1/cli-study/node_modules/lodash/_listCacheSet.js create mode 100644 day1/cli-study/node_modules/lodash/_mapCacheClear.js create mode 100644 day1/cli-study/node_modules/lodash/_mapCacheDelete.js create mode 100644 day1/cli-study/node_modules/lodash/_mapCacheGet.js create mode 100644 day1/cli-study/node_modules/lodash/_mapCacheHas.js create mode 100644 day1/cli-study/node_modules/lodash/_mapCacheSet.js create mode 100644 day1/cli-study/node_modules/lodash/_mapToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_matchesStrictComparable.js create mode 100644 day1/cli-study/node_modules/lodash/_memoizeCapped.js create mode 100644 day1/cli-study/node_modules/lodash/_mergeData.js create mode 100644 day1/cli-study/node_modules/lodash/_metaMap.js create mode 100644 day1/cli-study/node_modules/lodash/_nativeCreate.js create mode 100644 day1/cli-study/node_modules/lodash/_nativeKeys.js create mode 100644 day1/cli-study/node_modules/lodash/_nativeKeysIn.js create mode 100644 day1/cli-study/node_modules/lodash/_nodeUtil.js create mode 100644 day1/cli-study/node_modules/lodash/_objectToString.js create mode 100644 day1/cli-study/node_modules/lodash/_overArg.js create mode 100644 day1/cli-study/node_modules/lodash/_overRest.js create mode 100644 day1/cli-study/node_modules/lodash/_parent.js create mode 100644 day1/cli-study/node_modules/lodash/_reEscape.js create mode 100644 day1/cli-study/node_modules/lodash/_reEvaluate.js create mode 100644 day1/cli-study/node_modules/lodash/_reInterpolate.js create mode 100644 day1/cli-study/node_modules/lodash/_realNames.js create mode 100644 day1/cli-study/node_modules/lodash/_reorder.js create mode 100644 day1/cli-study/node_modules/lodash/_replaceHolders.js create mode 100644 day1/cli-study/node_modules/lodash/_root.js create mode 100644 day1/cli-study/node_modules/lodash/_safeGet.js create mode 100644 day1/cli-study/node_modules/lodash/_setCacheAdd.js create mode 100644 day1/cli-study/node_modules/lodash/_setCacheHas.js create mode 100644 day1/cli-study/node_modules/lodash/_setData.js create mode 100644 day1/cli-study/node_modules/lodash/_setToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_setToPairs.js create mode 100644 day1/cli-study/node_modules/lodash/_setToString.js create mode 100644 day1/cli-study/node_modules/lodash/_setWrapToString.js create mode 100644 day1/cli-study/node_modules/lodash/_shortOut.js create mode 100644 day1/cli-study/node_modules/lodash/_shuffleSelf.js create mode 100644 day1/cli-study/node_modules/lodash/_stackClear.js create mode 100644 day1/cli-study/node_modules/lodash/_stackDelete.js create mode 100644 day1/cli-study/node_modules/lodash/_stackGet.js create mode 100644 day1/cli-study/node_modules/lodash/_stackHas.js create mode 100644 day1/cli-study/node_modules/lodash/_stackSet.js create mode 100644 day1/cli-study/node_modules/lodash/_strictIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/_strictLastIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/_stringSize.js create mode 100644 day1/cli-study/node_modules/lodash/_stringToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_stringToPath.js create mode 100644 day1/cli-study/node_modules/lodash/_toKey.js create mode 100644 day1/cli-study/node_modules/lodash/_toSource.js create mode 100644 day1/cli-study/node_modules/lodash/_unescapeHtmlChar.js create mode 100644 day1/cli-study/node_modules/lodash/_unicodeSize.js create mode 100644 day1/cli-study/node_modules/lodash/_unicodeToArray.js create mode 100644 day1/cli-study/node_modules/lodash/_unicodeWords.js create mode 100644 day1/cli-study/node_modules/lodash/_updateWrapDetails.js create mode 100644 day1/cli-study/node_modules/lodash/_wrapperClone.js create mode 100644 day1/cli-study/node_modules/lodash/add.js create mode 100644 day1/cli-study/node_modules/lodash/after.js create mode 100644 day1/cli-study/node_modules/lodash/array.js create mode 100644 day1/cli-study/node_modules/lodash/ary.js create mode 100644 day1/cli-study/node_modules/lodash/assign.js create mode 100644 day1/cli-study/node_modules/lodash/assignIn.js create mode 100644 day1/cli-study/node_modules/lodash/assignInWith.js create mode 100644 day1/cli-study/node_modules/lodash/assignWith.js create mode 100644 day1/cli-study/node_modules/lodash/at.js create mode 100644 day1/cli-study/node_modules/lodash/attempt.js create mode 100644 day1/cli-study/node_modules/lodash/before.js create mode 100644 day1/cli-study/node_modules/lodash/bind.js create mode 100644 day1/cli-study/node_modules/lodash/bindAll.js create mode 100644 day1/cli-study/node_modules/lodash/bindKey.js create mode 100644 day1/cli-study/node_modules/lodash/camelCase.js create mode 100644 day1/cli-study/node_modules/lodash/capitalize.js create mode 100644 day1/cli-study/node_modules/lodash/castArray.js create mode 100644 day1/cli-study/node_modules/lodash/ceil.js create mode 100644 day1/cli-study/node_modules/lodash/chain.js create mode 100644 day1/cli-study/node_modules/lodash/chunk.js create mode 100644 day1/cli-study/node_modules/lodash/clamp.js create mode 100644 day1/cli-study/node_modules/lodash/clone.js create mode 100644 day1/cli-study/node_modules/lodash/cloneDeep.js create mode 100644 day1/cli-study/node_modules/lodash/cloneDeepWith.js create mode 100644 day1/cli-study/node_modules/lodash/cloneWith.js create mode 100644 day1/cli-study/node_modules/lodash/collection.js create mode 100644 day1/cli-study/node_modules/lodash/commit.js create mode 100644 day1/cli-study/node_modules/lodash/compact.js create mode 100644 day1/cli-study/node_modules/lodash/concat.js create mode 100644 day1/cli-study/node_modules/lodash/cond.js create mode 100644 day1/cli-study/node_modules/lodash/conforms.js create mode 100644 day1/cli-study/node_modules/lodash/conformsTo.js create mode 100644 day1/cli-study/node_modules/lodash/constant.js create mode 100644 day1/cli-study/node_modules/lodash/core.js create mode 100644 day1/cli-study/node_modules/lodash/core.min.js create mode 100644 day1/cli-study/node_modules/lodash/countBy.js create mode 100644 day1/cli-study/node_modules/lodash/create.js create mode 100644 day1/cli-study/node_modules/lodash/curry.js create mode 100644 day1/cli-study/node_modules/lodash/curryRight.js create mode 100644 day1/cli-study/node_modules/lodash/date.js create mode 100644 day1/cli-study/node_modules/lodash/debounce.js create mode 100644 day1/cli-study/node_modules/lodash/deburr.js create mode 100644 day1/cli-study/node_modules/lodash/defaultTo.js create mode 100644 day1/cli-study/node_modules/lodash/defaults.js create mode 100644 day1/cli-study/node_modules/lodash/defaultsDeep.js create mode 100644 day1/cli-study/node_modules/lodash/defer.js create mode 100644 day1/cli-study/node_modules/lodash/delay.js create mode 100644 day1/cli-study/node_modules/lodash/difference.js create mode 100644 day1/cli-study/node_modules/lodash/differenceBy.js create mode 100644 day1/cli-study/node_modules/lodash/differenceWith.js create mode 100644 day1/cli-study/node_modules/lodash/divide.js create mode 100644 day1/cli-study/node_modules/lodash/drop.js create mode 100644 day1/cli-study/node_modules/lodash/dropRight.js create mode 100644 day1/cli-study/node_modules/lodash/dropRightWhile.js create mode 100644 day1/cli-study/node_modules/lodash/dropWhile.js create mode 100644 day1/cli-study/node_modules/lodash/each.js create mode 100644 day1/cli-study/node_modules/lodash/eachRight.js create mode 100644 day1/cli-study/node_modules/lodash/endsWith.js create mode 100644 day1/cli-study/node_modules/lodash/entries.js create mode 100644 day1/cli-study/node_modules/lodash/entriesIn.js create mode 100644 day1/cli-study/node_modules/lodash/eq.js create mode 100644 day1/cli-study/node_modules/lodash/escape.js create mode 100644 day1/cli-study/node_modules/lodash/escapeRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/every.js create mode 100644 day1/cli-study/node_modules/lodash/extend.js create mode 100644 day1/cli-study/node_modules/lodash/extendWith.js create mode 100644 day1/cli-study/node_modules/lodash/fill.js create mode 100644 day1/cli-study/node_modules/lodash/filter.js create mode 100644 day1/cli-study/node_modules/lodash/find.js create mode 100644 day1/cli-study/node_modules/lodash/findIndex.js create mode 100644 day1/cli-study/node_modules/lodash/findKey.js create mode 100644 day1/cli-study/node_modules/lodash/findLast.js create mode 100644 day1/cli-study/node_modules/lodash/findLastIndex.js create mode 100644 day1/cli-study/node_modules/lodash/findLastKey.js create mode 100644 day1/cli-study/node_modules/lodash/first.js create mode 100644 day1/cli-study/node_modules/lodash/flatMap.js create mode 100644 day1/cli-study/node_modules/lodash/flatMapDeep.js create mode 100644 day1/cli-study/node_modules/lodash/flatMapDepth.js create mode 100644 day1/cli-study/node_modules/lodash/flatten.js create mode 100644 day1/cli-study/node_modules/lodash/flattenDeep.js create mode 100644 day1/cli-study/node_modules/lodash/flattenDepth.js create mode 100644 day1/cli-study/node_modules/lodash/flip.js create mode 100644 day1/cli-study/node_modules/lodash/floor.js create mode 100644 day1/cli-study/node_modules/lodash/flow.js create mode 100644 day1/cli-study/node_modules/lodash/flowRight.js create mode 100644 day1/cli-study/node_modules/lodash/forEach.js create mode 100644 day1/cli-study/node_modules/lodash/forEachRight.js create mode 100644 day1/cli-study/node_modules/lodash/forIn.js create mode 100644 day1/cli-study/node_modules/lodash/forInRight.js create mode 100644 day1/cli-study/node_modules/lodash/forOwn.js create mode 100644 day1/cli-study/node_modules/lodash/forOwnRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp.js create mode 100644 day1/cli-study/node_modules/lodash/fp/F.js create mode 100644 day1/cli-study/node_modules/lodash/fp/T.js create mode 100644 day1/cli-study/node_modules/lodash/fp/__.js create mode 100644 day1/cli-study/node_modules/lodash/fp/_baseConvert.js create mode 100644 day1/cli-study/node_modules/lodash/fp/_convertBrowser.js create mode 100644 day1/cli-study/node_modules/lodash/fp/_falseOptions.js create mode 100644 day1/cli-study/node_modules/lodash/fp/_mapping.js create mode 100644 day1/cli-study/node_modules/lodash/fp/_util.js create mode 100644 day1/cli-study/node_modules/lodash/fp/add.js create mode 100644 day1/cli-study/node_modules/lodash/fp/after.js create mode 100644 day1/cli-study/node_modules/lodash/fp/all.js create mode 100644 day1/cli-study/node_modules/lodash/fp/allPass.js create mode 100644 day1/cli-study/node_modules/lodash/fp/always.js create mode 100644 day1/cli-study/node_modules/lodash/fp/any.js create mode 100644 day1/cli-study/node_modules/lodash/fp/anyPass.js create mode 100644 day1/cli-study/node_modules/lodash/fp/apply.js create mode 100644 day1/cli-study/node_modules/lodash/fp/array.js create mode 100644 day1/cli-study/node_modules/lodash/fp/ary.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assign.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignInAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignInAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignInWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assignWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assoc.js create mode 100644 day1/cli-study/node_modules/lodash/fp/assocPath.js create mode 100644 day1/cli-study/node_modules/lodash/fp/at.js create mode 100644 day1/cli-study/node_modules/lodash/fp/attempt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/before.js create mode 100644 day1/cli-study/node_modules/lodash/fp/bind.js create mode 100644 day1/cli-study/node_modules/lodash/fp/bindAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/bindKey.js create mode 100644 day1/cli-study/node_modules/lodash/fp/camelCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/capitalize.js create mode 100644 day1/cli-study/node_modules/lodash/fp/castArray.js create mode 100644 day1/cli-study/node_modules/lodash/fp/ceil.js create mode 100644 day1/cli-study/node_modules/lodash/fp/chain.js create mode 100644 day1/cli-study/node_modules/lodash/fp/chunk.js create mode 100644 day1/cli-study/node_modules/lodash/fp/clamp.js create mode 100644 day1/cli-study/node_modules/lodash/fp/clone.js create mode 100644 day1/cli-study/node_modules/lodash/fp/cloneDeep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/cloneDeepWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/cloneWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/collection.js create mode 100644 day1/cli-study/node_modules/lodash/fp/commit.js create mode 100644 day1/cli-study/node_modules/lodash/fp/compact.js create mode 100644 day1/cli-study/node_modules/lodash/fp/complement.js create mode 100644 day1/cli-study/node_modules/lodash/fp/compose.js create mode 100644 day1/cli-study/node_modules/lodash/fp/concat.js create mode 100644 day1/cli-study/node_modules/lodash/fp/cond.js create mode 100644 day1/cli-study/node_modules/lodash/fp/conforms.js create mode 100644 day1/cli-study/node_modules/lodash/fp/conformsTo.js create mode 100644 day1/cli-study/node_modules/lodash/fp/constant.js create mode 100644 day1/cli-study/node_modules/lodash/fp/contains.js create mode 100644 day1/cli-study/node_modules/lodash/fp/convert.js create mode 100644 day1/cli-study/node_modules/lodash/fp/countBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/create.js create mode 100644 day1/cli-study/node_modules/lodash/fp/curry.js create mode 100644 day1/cli-study/node_modules/lodash/fp/curryN.js create mode 100644 day1/cli-study/node_modules/lodash/fp/curryRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/curryRightN.js create mode 100644 day1/cli-study/node_modules/lodash/fp/date.js create mode 100644 day1/cli-study/node_modules/lodash/fp/debounce.js create mode 100644 day1/cli-study/node_modules/lodash/fp/deburr.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defaultTo.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defaults.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defaultsAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defaultsDeep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defaultsDeepAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/defer.js create mode 100644 day1/cli-study/node_modules/lodash/fp/delay.js create mode 100644 day1/cli-study/node_modules/lodash/fp/difference.js create mode 100644 day1/cli-study/node_modules/lodash/fp/differenceBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/differenceWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dissoc.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dissocPath.js create mode 100644 day1/cli-study/node_modules/lodash/fp/divide.js create mode 100644 day1/cli-study/node_modules/lodash/fp/drop.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dropLast.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dropLastWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dropRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dropRightWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/dropWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/each.js create mode 100644 day1/cli-study/node_modules/lodash/fp/eachRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/endsWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/entries.js create mode 100644 day1/cli-study/node_modules/lodash/fp/entriesIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/eq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/equals.js create mode 100644 day1/cli-study/node_modules/lodash/fp/escape.js create mode 100644 day1/cli-study/node_modules/lodash/fp/escapeRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/fp/every.js create mode 100644 day1/cli-study/node_modules/lodash/fp/extend.js create mode 100644 day1/cli-study/node_modules/lodash/fp/extendAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/extendAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/extendWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/fill.js create mode 100644 day1/cli-study/node_modules/lodash/fp/filter.js create mode 100644 day1/cli-study/node_modules/lodash/fp/find.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findIndex.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findIndexFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findKey.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findLast.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findLastFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findLastIndex.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findLastIndexFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/findLastKey.js create mode 100644 day1/cli-study/node_modules/lodash/fp/first.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flatMap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flatMapDeep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flatMapDepth.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flatten.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flattenDeep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flattenDepth.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flip.js create mode 100644 day1/cli-study/node_modules/lodash/fp/floor.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flow.js create mode 100644 day1/cli-study/node_modules/lodash/fp/flowRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forEach.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forEachRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forInRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forOwn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/forOwnRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/fromPairs.js create mode 100644 day1/cli-study/node_modules/lodash/fp/function.js create mode 100644 day1/cli-study/node_modules/lodash/fp/functions.js create mode 100644 day1/cli-study/node_modules/lodash/fp/functionsIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/get.js create mode 100644 day1/cli-study/node_modules/lodash/fp/getOr.js create mode 100644 day1/cli-study/node_modules/lodash/fp/groupBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/gt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/gte.js create mode 100644 day1/cli-study/node_modules/lodash/fp/has.js create mode 100644 day1/cli-study/node_modules/lodash/fp/hasIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/head.js create mode 100644 day1/cli-study/node_modules/lodash/fp/identical.js create mode 100644 day1/cli-study/node_modules/lodash/fp/identity.js create mode 100644 day1/cli-study/node_modules/lodash/fp/inRange.js create mode 100644 day1/cli-study/node_modules/lodash/fp/includes.js create mode 100644 day1/cli-study/node_modules/lodash/fp/includesFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/indexBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/indexOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/indexOfFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/init.js create mode 100644 day1/cli-study/node_modules/lodash/fp/initial.js create mode 100644 day1/cli-study/node_modules/lodash/fp/intersection.js create mode 100644 day1/cli-study/node_modules/lodash/fp/intersectionBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/intersectionWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invert.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invertBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invertObj.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invoke.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invokeArgs.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invokeArgsMap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/invokeMap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isArguments.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isArray.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isArrayBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isArrayLike.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isArrayLikeObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isBoolean.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isDate.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isElement.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isEmpty.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isEqual.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isEqualWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isError.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isFinite.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isFunction.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isInteger.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isLength.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isMap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isMatch.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isMatchWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isNaN.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isNative.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isNil.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isNull.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isNumber.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isObjectLike.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isPlainObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isSafeInteger.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isSet.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isString.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isSymbol.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isTypedArray.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isUndefined.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isWeakMap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/isWeakSet.js create mode 100644 day1/cli-study/node_modules/lodash/fp/iteratee.js create mode 100644 day1/cli-study/node_modules/lodash/fp/join.js create mode 100644 day1/cli-study/node_modules/lodash/fp/juxt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/kebabCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/keyBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/keys.js create mode 100644 day1/cli-study/node_modules/lodash/fp/keysIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lang.js create mode 100644 day1/cli-study/node_modules/lodash/fp/last.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lastIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lastIndexOfFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lowerCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lowerFirst.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/lte.js create mode 100644 day1/cli-study/node_modules/lodash/fp/map.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mapKeys.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mapValues.js create mode 100644 day1/cli-study/node_modules/lodash/fp/matches.js create mode 100644 day1/cli-study/node_modules/lodash/fp/matchesProperty.js create mode 100644 day1/cli-study/node_modules/lodash/fp/math.js create mode 100644 day1/cli-study/node_modules/lodash/fp/max.js create mode 100644 day1/cli-study/node_modules/lodash/fp/maxBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mean.js create mode 100644 day1/cli-study/node_modules/lodash/fp/meanBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/memoize.js create mode 100644 day1/cli-study/node_modules/lodash/fp/merge.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mergeAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mergeAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mergeWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/method.js create mode 100644 day1/cli-study/node_modules/lodash/fp/methodOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/min.js create mode 100644 day1/cli-study/node_modules/lodash/fp/minBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/mixin.js create mode 100644 day1/cli-study/node_modules/lodash/fp/multiply.js create mode 100644 day1/cli-study/node_modules/lodash/fp/nAry.js create mode 100644 day1/cli-study/node_modules/lodash/fp/negate.js create mode 100644 day1/cli-study/node_modules/lodash/fp/next.js create mode 100644 day1/cli-study/node_modules/lodash/fp/noop.js create mode 100644 day1/cli-study/node_modules/lodash/fp/now.js create mode 100644 day1/cli-study/node_modules/lodash/fp/nth.js create mode 100644 day1/cli-study/node_modules/lodash/fp/nthArg.js create mode 100644 day1/cli-study/node_modules/lodash/fp/number.js create mode 100644 day1/cli-study/node_modules/lodash/fp/object.js create mode 100644 day1/cli-study/node_modules/lodash/fp/omit.js create mode 100644 day1/cli-study/node_modules/lodash/fp/omitAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/omitBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/once.js create mode 100644 day1/cli-study/node_modules/lodash/fp/orderBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/over.js create mode 100644 day1/cli-study/node_modules/lodash/fp/overArgs.js create mode 100644 day1/cli-study/node_modules/lodash/fp/overEvery.js create mode 100644 day1/cli-study/node_modules/lodash/fp/overSome.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pad.js create mode 100644 day1/cli-study/node_modules/lodash/fp/padChars.js create mode 100644 day1/cli-study/node_modules/lodash/fp/padCharsEnd.js create mode 100644 day1/cli-study/node_modules/lodash/fp/padCharsStart.js create mode 100644 day1/cli-study/node_modules/lodash/fp/padEnd.js create mode 100644 day1/cli-study/node_modules/lodash/fp/padStart.js create mode 100644 day1/cli-study/node_modules/lodash/fp/parseInt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/partial.js create mode 100644 day1/cli-study/node_modules/lodash/fp/partialRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/partition.js create mode 100644 day1/cli-study/node_modules/lodash/fp/path.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pathEq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pathOr.js create mode 100644 day1/cli-study/node_modules/lodash/fp/paths.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pick.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pickAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pickBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pipe.js create mode 100644 day1/cli-study/node_modules/lodash/fp/placeholder.js create mode 100644 day1/cli-study/node_modules/lodash/fp/plant.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pluck.js create mode 100644 day1/cli-study/node_modules/lodash/fp/prop.js create mode 100644 day1/cli-study/node_modules/lodash/fp/propEq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/propOr.js create mode 100644 day1/cli-study/node_modules/lodash/fp/property.js create mode 100644 day1/cli-study/node_modules/lodash/fp/propertyOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/props.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pull.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pullAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pullAllBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pullAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/pullAt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/random.js create mode 100644 day1/cli-study/node_modules/lodash/fp/range.js create mode 100644 day1/cli-study/node_modules/lodash/fp/rangeRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/rangeStep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/rangeStepRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/rearg.js create mode 100644 day1/cli-study/node_modules/lodash/fp/reduce.js create mode 100644 day1/cli-study/node_modules/lodash/fp/reduceRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/reject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/remove.js create mode 100644 day1/cli-study/node_modules/lodash/fp/repeat.js create mode 100644 day1/cli-study/node_modules/lodash/fp/replace.js create mode 100644 day1/cli-study/node_modules/lodash/fp/rest.js create mode 100644 day1/cli-study/node_modules/lodash/fp/restFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/result.js create mode 100644 day1/cli-study/node_modules/lodash/fp/reverse.js create mode 100644 day1/cli-study/node_modules/lodash/fp/round.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sample.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sampleSize.js create mode 100644 day1/cli-study/node_modules/lodash/fp/seq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/set.js create mode 100644 day1/cli-study/node_modules/lodash/fp/setWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/shuffle.js create mode 100644 day1/cli-study/node_modules/lodash/fp/size.js create mode 100644 day1/cli-study/node_modules/lodash/fp/slice.js create mode 100644 day1/cli-study/node_modules/lodash/fp/snakeCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/some.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedIndex.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedIndexBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedLastIndex.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedLastIndexBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedLastIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedUniq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sortedUniqBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/split.js create mode 100644 day1/cli-study/node_modules/lodash/fp/spread.js create mode 100644 day1/cli-study/node_modules/lodash/fp/spreadFrom.js create mode 100644 day1/cli-study/node_modules/lodash/fp/startCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/startsWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/string.js create mode 100644 day1/cli-study/node_modules/lodash/fp/stubArray.js create mode 100644 day1/cli-study/node_modules/lodash/fp/stubFalse.js create mode 100644 day1/cli-study/node_modules/lodash/fp/stubObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/stubString.js create mode 100644 day1/cli-study/node_modules/lodash/fp/stubTrue.js create mode 100644 day1/cli-study/node_modules/lodash/fp/subtract.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sum.js create mode 100644 day1/cli-study/node_modules/lodash/fp/sumBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/symmetricDifference.js create mode 100644 day1/cli-study/node_modules/lodash/fp/symmetricDifferenceBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/symmetricDifferenceWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/tail.js create mode 100644 day1/cli-study/node_modules/lodash/fp/take.js create mode 100644 day1/cli-study/node_modules/lodash/fp/takeLast.js create mode 100644 day1/cli-study/node_modules/lodash/fp/takeLastWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/takeRight.js create mode 100644 day1/cli-study/node_modules/lodash/fp/takeRightWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/takeWhile.js create mode 100644 day1/cli-study/node_modules/lodash/fp/tap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/template.js create mode 100644 day1/cli-study/node_modules/lodash/fp/templateSettings.js create mode 100644 day1/cli-study/node_modules/lodash/fp/throttle.js create mode 100644 day1/cli-study/node_modules/lodash/fp/thru.js create mode 100644 day1/cli-study/node_modules/lodash/fp/times.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toArray.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toFinite.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toInteger.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toIterator.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toJSON.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toLength.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toLower.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toNumber.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toPairs.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toPairsIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toPath.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toPlainObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toSafeInteger.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toString.js create mode 100644 day1/cli-study/node_modules/lodash/fp/toUpper.js create mode 100644 day1/cli-study/node_modules/lodash/fp/transform.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trim.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trimChars.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trimCharsEnd.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trimCharsStart.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trimEnd.js create mode 100644 day1/cli-study/node_modules/lodash/fp/trimStart.js create mode 100644 day1/cli-study/node_modules/lodash/fp/truncate.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unapply.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unary.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unescape.js create mode 100644 day1/cli-study/node_modules/lodash/fp/union.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unionBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unionWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/uniq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/uniqBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/uniqWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/uniqueId.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unnest.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unset.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unzip.js create mode 100644 day1/cli-study/node_modules/lodash/fp/unzipWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/update.js create mode 100644 day1/cli-study/node_modules/lodash/fp/updateWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/upperCase.js create mode 100644 day1/cli-study/node_modules/lodash/fp/upperFirst.js create mode 100644 day1/cli-study/node_modules/lodash/fp/useWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/util.js create mode 100644 day1/cli-study/node_modules/lodash/fp/value.js create mode 100644 day1/cli-study/node_modules/lodash/fp/valueOf.js create mode 100644 day1/cli-study/node_modules/lodash/fp/values.js create mode 100644 day1/cli-study/node_modules/lodash/fp/valuesIn.js create mode 100644 day1/cli-study/node_modules/lodash/fp/where.js create mode 100644 day1/cli-study/node_modules/lodash/fp/whereEq.js create mode 100644 day1/cli-study/node_modules/lodash/fp/without.js create mode 100644 day1/cli-study/node_modules/lodash/fp/words.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrap.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrapperAt.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrapperChain.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrapperLodash.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrapperReverse.js create mode 100644 day1/cli-study/node_modules/lodash/fp/wrapperValue.js create mode 100644 day1/cli-study/node_modules/lodash/fp/xor.js create mode 100644 day1/cli-study/node_modules/lodash/fp/xorBy.js create mode 100644 day1/cli-study/node_modules/lodash/fp/xorWith.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zip.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zipAll.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zipObj.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zipObject.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zipObjectDeep.js create mode 100644 day1/cli-study/node_modules/lodash/fp/zipWith.js create mode 100644 day1/cli-study/node_modules/lodash/fromPairs.js create mode 100644 day1/cli-study/node_modules/lodash/function.js create mode 100644 day1/cli-study/node_modules/lodash/functions.js create mode 100644 day1/cli-study/node_modules/lodash/functionsIn.js create mode 100644 day1/cli-study/node_modules/lodash/get.js create mode 100644 day1/cli-study/node_modules/lodash/groupBy.js create mode 100644 day1/cli-study/node_modules/lodash/gt.js create mode 100644 day1/cli-study/node_modules/lodash/gte.js create mode 100644 day1/cli-study/node_modules/lodash/has.js create mode 100644 day1/cli-study/node_modules/lodash/hasIn.js create mode 100644 day1/cli-study/node_modules/lodash/head.js create mode 100644 day1/cli-study/node_modules/lodash/identity.js create mode 100644 day1/cli-study/node_modules/lodash/inRange.js create mode 100644 day1/cli-study/node_modules/lodash/includes.js create mode 100644 day1/cli-study/node_modules/lodash/index.js create mode 100644 day1/cli-study/node_modules/lodash/indexOf.js create mode 100644 day1/cli-study/node_modules/lodash/initial.js create mode 100644 day1/cli-study/node_modules/lodash/intersection.js create mode 100644 day1/cli-study/node_modules/lodash/intersectionBy.js create mode 100644 day1/cli-study/node_modules/lodash/intersectionWith.js create mode 100644 day1/cli-study/node_modules/lodash/invert.js create mode 100644 day1/cli-study/node_modules/lodash/invertBy.js create mode 100644 day1/cli-study/node_modules/lodash/invoke.js create mode 100644 day1/cli-study/node_modules/lodash/invokeMap.js create mode 100644 day1/cli-study/node_modules/lodash/isArguments.js create mode 100644 day1/cli-study/node_modules/lodash/isArray.js create mode 100644 day1/cli-study/node_modules/lodash/isArrayBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/isArrayLike.js create mode 100644 day1/cli-study/node_modules/lodash/isArrayLikeObject.js create mode 100644 day1/cli-study/node_modules/lodash/isBoolean.js create mode 100644 day1/cli-study/node_modules/lodash/isBuffer.js create mode 100644 day1/cli-study/node_modules/lodash/isDate.js create mode 100644 day1/cli-study/node_modules/lodash/isElement.js create mode 100644 day1/cli-study/node_modules/lodash/isEmpty.js create mode 100644 day1/cli-study/node_modules/lodash/isEqual.js create mode 100644 day1/cli-study/node_modules/lodash/isEqualWith.js create mode 100644 day1/cli-study/node_modules/lodash/isError.js create mode 100644 day1/cli-study/node_modules/lodash/isFinite.js create mode 100644 day1/cli-study/node_modules/lodash/isFunction.js create mode 100644 day1/cli-study/node_modules/lodash/isInteger.js create mode 100644 day1/cli-study/node_modules/lodash/isLength.js create mode 100644 day1/cli-study/node_modules/lodash/isMap.js create mode 100644 day1/cli-study/node_modules/lodash/isMatch.js create mode 100644 day1/cli-study/node_modules/lodash/isMatchWith.js create mode 100644 day1/cli-study/node_modules/lodash/isNaN.js create mode 100644 day1/cli-study/node_modules/lodash/isNative.js create mode 100644 day1/cli-study/node_modules/lodash/isNil.js create mode 100644 day1/cli-study/node_modules/lodash/isNull.js create mode 100644 day1/cli-study/node_modules/lodash/isNumber.js create mode 100644 day1/cli-study/node_modules/lodash/isObject.js create mode 100644 day1/cli-study/node_modules/lodash/isObjectLike.js create mode 100644 day1/cli-study/node_modules/lodash/isPlainObject.js create mode 100644 day1/cli-study/node_modules/lodash/isRegExp.js create mode 100644 day1/cli-study/node_modules/lodash/isSafeInteger.js create mode 100644 day1/cli-study/node_modules/lodash/isSet.js create mode 100644 day1/cli-study/node_modules/lodash/isString.js create mode 100644 day1/cli-study/node_modules/lodash/isSymbol.js create mode 100644 day1/cli-study/node_modules/lodash/isTypedArray.js create mode 100644 day1/cli-study/node_modules/lodash/isUndefined.js create mode 100644 day1/cli-study/node_modules/lodash/isWeakMap.js create mode 100644 day1/cli-study/node_modules/lodash/isWeakSet.js create mode 100644 day1/cli-study/node_modules/lodash/iteratee.js create mode 100644 day1/cli-study/node_modules/lodash/join.js create mode 100644 day1/cli-study/node_modules/lodash/kebabCase.js create mode 100644 day1/cli-study/node_modules/lodash/keyBy.js create mode 100644 day1/cli-study/node_modules/lodash/keys.js create mode 100644 day1/cli-study/node_modules/lodash/keysIn.js create mode 100644 day1/cli-study/node_modules/lodash/lang.js create mode 100644 day1/cli-study/node_modules/lodash/last.js create mode 100644 day1/cli-study/node_modules/lodash/lastIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/lodash.js create mode 100644 day1/cli-study/node_modules/lodash/lodash.min.js create mode 100644 day1/cli-study/node_modules/lodash/lowerCase.js create mode 100644 day1/cli-study/node_modules/lodash/lowerFirst.js create mode 100644 day1/cli-study/node_modules/lodash/lt.js create mode 100644 day1/cli-study/node_modules/lodash/lte.js create mode 100644 day1/cli-study/node_modules/lodash/map.js create mode 100644 day1/cli-study/node_modules/lodash/mapKeys.js create mode 100644 day1/cli-study/node_modules/lodash/mapValues.js create mode 100644 day1/cli-study/node_modules/lodash/matches.js create mode 100644 day1/cli-study/node_modules/lodash/matchesProperty.js create mode 100644 day1/cli-study/node_modules/lodash/math.js create mode 100644 day1/cli-study/node_modules/lodash/max.js create mode 100644 day1/cli-study/node_modules/lodash/maxBy.js create mode 100644 day1/cli-study/node_modules/lodash/mean.js create mode 100644 day1/cli-study/node_modules/lodash/meanBy.js create mode 100644 day1/cli-study/node_modules/lodash/memoize.js create mode 100644 day1/cli-study/node_modules/lodash/merge.js create mode 100644 day1/cli-study/node_modules/lodash/mergeWith.js create mode 100644 day1/cli-study/node_modules/lodash/method.js create mode 100644 day1/cli-study/node_modules/lodash/methodOf.js create mode 100644 day1/cli-study/node_modules/lodash/min.js create mode 100644 day1/cli-study/node_modules/lodash/minBy.js create mode 100644 day1/cli-study/node_modules/lodash/mixin.js create mode 100644 day1/cli-study/node_modules/lodash/multiply.js create mode 100644 day1/cli-study/node_modules/lodash/negate.js create mode 100644 day1/cli-study/node_modules/lodash/next.js create mode 100644 day1/cli-study/node_modules/lodash/noop.js create mode 100644 day1/cli-study/node_modules/lodash/now.js create mode 100644 day1/cli-study/node_modules/lodash/nth.js create mode 100644 day1/cli-study/node_modules/lodash/nthArg.js create mode 100644 day1/cli-study/node_modules/lodash/number.js create mode 100644 day1/cli-study/node_modules/lodash/object.js create mode 100644 day1/cli-study/node_modules/lodash/omit.js create mode 100644 day1/cli-study/node_modules/lodash/omitBy.js create mode 100644 day1/cli-study/node_modules/lodash/once.js create mode 100644 day1/cli-study/node_modules/lodash/orderBy.js create mode 100644 day1/cli-study/node_modules/lodash/over.js create mode 100644 day1/cli-study/node_modules/lodash/overArgs.js create mode 100644 day1/cli-study/node_modules/lodash/overEvery.js create mode 100644 day1/cli-study/node_modules/lodash/overSome.js create mode 100644 day1/cli-study/node_modules/lodash/package.json create mode 100644 day1/cli-study/node_modules/lodash/pad.js create mode 100644 day1/cli-study/node_modules/lodash/padEnd.js create mode 100644 day1/cli-study/node_modules/lodash/padStart.js create mode 100644 day1/cli-study/node_modules/lodash/parseInt.js create mode 100644 day1/cli-study/node_modules/lodash/partial.js create mode 100644 day1/cli-study/node_modules/lodash/partialRight.js create mode 100644 day1/cli-study/node_modules/lodash/partition.js create mode 100644 day1/cli-study/node_modules/lodash/pick.js create mode 100644 day1/cli-study/node_modules/lodash/pickBy.js create mode 100644 day1/cli-study/node_modules/lodash/plant.js create mode 100644 day1/cli-study/node_modules/lodash/property.js create mode 100644 day1/cli-study/node_modules/lodash/propertyOf.js create mode 100644 day1/cli-study/node_modules/lodash/pull.js create mode 100644 day1/cli-study/node_modules/lodash/pullAll.js create mode 100644 day1/cli-study/node_modules/lodash/pullAllBy.js create mode 100644 day1/cli-study/node_modules/lodash/pullAllWith.js create mode 100644 day1/cli-study/node_modules/lodash/pullAt.js create mode 100644 day1/cli-study/node_modules/lodash/random.js create mode 100644 day1/cli-study/node_modules/lodash/range.js create mode 100644 day1/cli-study/node_modules/lodash/rangeRight.js create mode 100644 day1/cli-study/node_modules/lodash/rearg.js create mode 100644 day1/cli-study/node_modules/lodash/reduce.js create mode 100644 day1/cli-study/node_modules/lodash/reduceRight.js create mode 100644 day1/cli-study/node_modules/lodash/reject.js create mode 100644 day1/cli-study/node_modules/lodash/remove.js create mode 100644 day1/cli-study/node_modules/lodash/repeat.js create mode 100644 day1/cli-study/node_modules/lodash/replace.js create mode 100644 day1/cli-study/node_modules/lodash/rest.js create mode 100644 day1/cli-study/node_modules/lodash/result.js create mode 100644 day1/cli-study/node_modules/lodash/reverse.js create mode 100644 day1/cli-study/node_modules/lodash/round.js create mode 100644 day1/cli-study/node_modules/lodash/sample.js create mode 100644 day1/cli-study/node_modules/lodash/sampleSize.js create mode 100644 day1/cli-study/node_modules/lodash/seq.js create mode 100644 day1/cli-study/node_modules/lodash/set.js create mode 100644 day1/cli-study/node_modules/lodash/setWith.js create mode 100644 day1/cli-study/node_modules/lodash/shuffle.js create mode 100644 day1/cli-study/node_modules/lodash/size.js create mode 100644 day1/cli-study/node_modules/lodash/slice.js create mode 100644 day1/cli-study/node_modules/lodash/snakeCase.js create mode 100644 day1/cli-study/node_modules/lodash/some.js create mode 100644 day1/cli-study/node_modules/lodash/sortBy.js create mode 100644 day1/cli-study/node_modules/lodash/sortedIndex.js create mode 100644 day1/cli-study/node_modules/lodash/sortedIndexBy.js create mode 100644 day1/cli-study/node_modules/lodash/sortedIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/sortedLastIndex.js create mode 100644 day1/cli-study/node_modules/lodash/sortedLastIndexBy.js create mode 100644 day1/cli-study/node_modules/lodash/sortedLastIndexOf.js create mode 100644 day1/cli-study/node_modules/lodash/sortedUniq.js create mode 100644 day1/cli-study/node_modules/lodash/sortedUniqBy.js create mode 100644 day1/cli-study/node_modules/lodash/split.js create mode 100644 day1/cli-study/node_modules/lodash/spread.js create mode 100644 day1/cli-study/node_modules/lodash/startCase.js create mode 100644 day1/cli-study/node_modules/lodash/startsWith.js create mode 100644 day1/cli-study/node_modules/lodash/string.js create mode 100644 day1/cli-study/node_modules/lodash/stubArray.js create mode 100644 day1/cli-study/node_modules/lodash/stubFalse.js create mode 100644 day1/cli-study/node_modules/lodash/stubObject.js create mode 100644 day1/cli-study/node_modules/lodash/stubString.js create mode 100644 day1/cli-study/node_modules/lodash/stubTrue.js create mode 100644 day1/cli-study/node_modules/lodash/subtract.js create mode 100644 day1/cli-study/node_modules/lodash/sum.js create mode 100644 day1/cli-study/node_modules/lodash/sumBy.js create mode 100644 day1/cli-study/node_modules/lodash/tail.js create mode 100644 day1/cli-study/node_modules/lodash/take.js create mode 100644 day1/cli-study/node_modules/lodash/takeRight.js create mode 100644 day1/cli-study/node_modules/lodash/takeRightWhile.js create mode 100644 day1/cli-study/node_modules/lodash/takeWhile.js create mode 100644 day1/cli-study/node_modules/lodash/tap.js create mode 100644 day1/cli-study/node_modules/lodash/template.js create mode 100644 day1/cli-study/node_modules/lodash/templateSettings.js create mode 100644 day1/cli-study/node_modules/lodash/throttle.js create mode 100644 day1/cli-study/node_modules/lodash/thru.js create mode 100644 day1/cli-study/node_modules/lodash/times.js create mode 100644 day1/cli-study/node_modules/lodash/toArray.js create mode 100644 day1/cli-study/node_modules/lodash/toFinite.js create mode 100644 day1/cli-study/node_modules/lodash/toInteger.js create mode 100644 day1/cli-study/node_modules/lodash/toIterator.js create mode 100644 day1/cli-study/node_modules/lodash/toJSON.js create mode 100644 day1/cli-study/node_modules/lodash/toLength.js create mode 100644 day1/cli-study/node_modules/lodash/toLower.js create mode 100644 day1/cli-study/node_modules/lodash/toNumber.js create mode 100644 day1/cli-study/node_modules/lodash/toPairs.js create mode 100644 day1/cli-study/node_modules/lodash/toPairsIn.js create mode 100644 day1/cli-study/node_modules/lodash/toPath.js create mode 100644 day1/cli-study/node_modules/lodash/toPlainObject.js create mode 100644 day1/cli-study/node_modules/lodash/toSafeInteger.js create mode 100644 day1/cli-study/node_modules/lodash/toString.js create mode 100644 day1/cli-study/node_modules/lodash/toUpper.js create mode 100644 day1/cli-study/node_modules/lodash/transform.js create mode 100644 day1/cli-study/node_modules/lodash/trim.js create mode 100644 day1/cli-study/node_modules/lodash/trimEnd.js create mode 100644 day1/cli-study/node_modules/lodash/trimStart.js create mode 100644 day1/cli-study/node_modules/lodash/truncate.js create mode 100644 day1/cli-study/node_modules/lodash/unary.js create mode 100644 day1/cli-study/node_modules/lodash/unescape.js create mode 100644 day1/cli-study/node_modules/lodash/union.js create mode 100644 day1/cli-study/node_modules/lodash/unionBy.js create mode 100644 day1/cli-study/node_modules/lodash/unionWith.js create mode 100644 day1/cli-study/node_modules/lodash/uniq.js create mode 100644 day1/cli-study/node_modules/lodash/uniqBy.js create mode 100644 day1/cli-study/node_modules/lodash/uniqWith.js create mode 100644 day1/cli-study/node_modules/lodash/uniqueId.js create mode 100644 day1/cli-study/node_modules/lodash/unset.js create mode 100644 day1/cli-study/node_modules/lodash/unzip.js create mode 100644 day1/cli-study/node_modules/lodash/unzipWith.js create mode 100644 day1/cli-study/node_modules/lodash/update.js create mode 100644 day1/cli-study/node_modules/lodash/updateWith.js create mode 100644 day1/cli-study/node_modules/lodash/upperCase.js create mode 100644 day1/cli-study/node_modules/lodash/upperFirst.js create mode 100644 day1/cli-study/node_modules/lodash/util.js create mode 100644 day1/cli-study/node_modules/lodash/value.js create mode 100644 day1/cli-study/node_modules/lodash/valueOf.js create mode 100644 day1/cli-study/node_modules/lodash/values.js create mode 100644 day1/cli-study/node_modules/lodash/valuesIn.js create mode 100644 day1/cli-study/node_modules/lodash/without.js create mode 100644 day1/cli-study/node_modules/lodash/words.js create mode 100644 day1/cli-study/node_modules/lodash/wrap.js create mode 100644 day1/cli-study/node_modules/lodash/wrapperAt.js create mode 100644 day1/cli-study/node_modules/lodash/wrapperChain.js create mode 100644 day1/cli-study/node_modules/lodash/wrapperLodash.js create mode 100644 day1/cli-study/node_modules/lodash/wrapperReverse.js create mode 100644 day1/cli-study/node_modules/lodash/wrapperValue.js create mode 100644 day1/cli-study/node_modules/lodash/xor.js create mode 100644 day1/cli-study/node_modules/lodash/xorBy.js create mode 100644 day1/cli-study/node_modules/lodash/xorWith.js create mode 100644 day1/cli-study/node_modules/lodash/zip.js create mode 100644 day1/cli-study/node_modules/lodash/zipObject.js create mode 100644 day1/cli-study/node_modules/lodash/zipObjectDeep.js create mode 100644 day1/cli-study/node_modules/lodash/zipWith.js create mode 100644 day1/cli-study/node_modules/log-symbols/browser.js create mode 100644 day1/cli-study/node_modules/log-symbols/index.d.ts create mode 100644 day1/cli-study/node_modules/log-symbols/index.js create mode 100644 day1/cli-study/node_modules/log-symbols/license create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/index.js create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/index.js.flow create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/templates.js create mode 100644 day1/cli-study/node_modules/log-symbols/node_modules/chalk/types/index.d.ts create mode 100644 day1/cli-study/node_modules/log-symbols/package.json create mode 100644 day1/cli-study/node_modules/log-symbols/readme.md create mode 100644 day1/cli-study/node_modules/lowercase-keys/index.js create mode 100644 day1/cli-study/node_modules/lowercase-keys/license create mode 100644 day1/cli-study/node_modules/lowercase-keys/package.json create mode 100644 day1/cli-study/node_modules/lowercase-keys/readme.md create mode 100644 day1/cli-study/node_modules/make-dir/index.js create mode 100644 day1/cli-study/node_modules/make-dir/license create mode 100644 day1/cli-study/node_modules/make-dir/package.json create mode 100644 day1/cli-study/node_modules/make-dir/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/.npmignore create mode 100644 day1/cli-study/node_modules/metalsmith/.travis.yml create mode 100644 day1/cli-study/node_modules/metalsmith/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/metalsmith/Makefile create mode 100644 day1/cli-study/node_modules/metalsmith/Readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/bin/_metalsmith create mode 100644 day1/cli-study/node_modules/metalsmith/bin/metalsmith create mode 100644 day1/cli-study/node_modules/metalsmith/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/lib/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-regex/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-regex/license create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-regex/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-regex/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-styles/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-styles/license create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-styles/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/ansi-styles/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/chalk/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/LICENSE create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/Readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/commander/typings/index.d.ts create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/strip-ansi/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/strip-ansi/license create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/strip-ansi/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/strip-ansi/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/supports-color/index.js create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/supports-color/license create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/supports-color/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/node_modules/supports-color/readme.md create mode 100644 day1/cli-study/node_modules/metalsmith/package.json create mode 100644 day1/cli-study/node_modules/metalsmith/snapcraft.yaml create mode 100644 day1/cli-study/node_modules/mime-db/HISTORY.md create mode 100644 day1/cli-study/node_modules/mime-db/LICENSE create mode 100644 day1/cli-study/node_modules/mime-db/README.md create mode 100644 day1/cli-study/node_modules/mime-db/db.json create mode 100644 day1/cli-study/node_modules/mime-db/index.js create mode 100644 day1/cli-study/node_modules/mime-db/package.json create mode 100644 day1/cli-study/node_modules/mimic-fn/index.d.ts create mode 100644 day1/cli-study/node_modules/mimic-fn/index.js create mode 100644 day1/cli-study/node_modules/mimic-fn/license create mode 100644 day1/cli-study/node_modules/mimic-fn/package.json create mode 100644 day1/cli-study/node_modules/mimic-fn/readme.md create mode 100644 day1/cli-study/node_modules/mimic-response/index.js create mode 100644 day1/cli-study/node_modules/mimic-response/license create mode 100644 day1/cli-study/node_modules/mimic-response/package.json create mode 100644 day1/cli-study/node_modules/mimic-response/readme.md create mode 100644 day1/cli-study/node_modules/minimatch/LICENSE create mode 100644 day1/cli-study/node_modules/minimatch/README.md create mode 100644 day1/cli-study/node_modules/minimatch/minimatch.js create mode 100644 day1/cli-study/node_modules/minimatch/package.json create mode 100644 day1/cli-study/node_modules/minimist/.travis.yml create mode 100644 day1/cli-study/node_modules/minimist/LICENSE create mode 100644 day1/cli-study/node_modules/minimist/example/parse.js create mode 100644 day1/cli-study/node_modules/minimist/index.js create mode 100644 day1/cli-study/node_modules/minimist/package.json create mode 100644 day1/cli-study/node_modules/minimist/readme.markdown create mode 100644 day1/cli-study/node_modules/minimist/test/all_bool.js create mode 100644 day1/cli-study/node_modules/minimist/test/bool.js create mode 100644 day1/cli-study/node_modules/minimist/test/dash.js create mode 100644 day1/cli-study/node_modules/minimist/test/default_bool.js create mode 100644 day1/cli-study/node_modules/minimist/test/dotted.js create mode 100644 day1/cli-study/node_modules/minimist/test/kv_short.js create mode 100644 day1/cli-study/node_modules/minimist/test/long.js create mode 100644 day1/cli-study/node_modules/minimist/test/num.js create mode 100644 day1/cli-study/node_modules/minimist/test/parse.js create mode 100644 day1/cli-study/node_modules/minimist/test/parse_modified.js create mode 100644 day1/cli-study/node_modules/minimist/test/proto.js create mode 100644 day1/cli-study/node_modules/minimist/test/short.js create mode 100644 day1/cli-study/node_modules/minimist/test/stop_early.js create mode 100644 day1/cli-study/node_modules/minimist/test/unknown.js create mode 100644 day1/cli-study/node_modules/minimist/test/whitespace.js create mode 100644 day1/cli-study/node_modules/mkdirp/LICENSE create mode 100644 day1/cli-study/node_modules/mkdirp/bin/cmd.js create mode 100644 day1/cli-study/node_modules/mkdirp/bin/usage.txt create mode 100644 day1/cli-study/node_modules/mkdirp/index.js create mode 100644 day1/cli-study/node_modules/mkdirp/package.json create mode 100644 day1/cli-study/node_modules/mkdirp/readme.markdown create mode 100644 day1/cli-study/node_modules/ms/index.js create mode 100644 day1/cli-study/node_modules/ms/license.md create mode 100644 day1/cli-study/node_modules/ms/package.json create mode 100644 day1/cli-study/node_modules/ms/readme.md create mode 100644 day1/cli-study/node_modules/mute-stream/LICENSE create mode 100644 day1/cli-study/node_modules/mute-stream/README.md create mode 100644 day1/cli-study/node_modules/mute-stream/mute.js create mode 100644 day1/cli-study/node_modules/mute-stream/package.json create mode 100644 day1/cli-study/node_modules/natural-compare/README.md create mode 100644 day1/cli-study/node_modules/natural-compare/index.js create mode 100644 day1/cli-study/node_modules/natural-compare/package.json create mode 100644 day1/cli-study/node_modules/ncp/.npmignore create mode 100644 day1/cli-study/node_modules/ncp/.travis.yml create mode 100644 day1/cli-study/node_modules/ncp/LICENSE.md create mode 100644 day1/cli-study/node_modules/ncp/README.md create mode 100644 day1/cli-study/node_modules/ncp/bin/ncp create mode 100644 day1/cli-study/node_modules/ncp/lib/ncp.js create mode 100644 day1/cli-study/node_modules/ncp/package.json create mode 100644 day1/cli-study/node_modules/ncp/test/modified-files/out/a create mode 100644 day1/cli-study/node_modules/ncp/test/modified-files/src/a create mode 100644 day1/cli-study/node_modules/ncp/test/ncp.js create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/a create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/b create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/c create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/d create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/e create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/f create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/sub/a create mode 100644 day1/cli-study/node_modules/ncp/test/regular-fixtures/src/sub/b create mode 100644 day1/cli-study/node_modules/ncp/test/symlink-fixtures/src/dir/bar create mode 100644 day1/cli-study/node_modules/ncp/test/symlink-fixtures/src/foo create mode 100644 day1/cli-study/node_modules/normalize-package-data/AUTHORS create mode 100644 day1/cli-study/node_modules/normalize-package-data/LICENSE create mode 100644 day1/cli-study/node_modules/normalize-package-data/README.md create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/extract_description.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/fixer.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/make_warning.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/normalize.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/safe_format.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/typos.json create mode 100644 day1/cli-study/node_modules/normalize-package-data/lib/warning_messages.json create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/.bin/semver create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/.bin/semver.cmd create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/.bin/semver.ps1 create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/LICENSE create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/README.md create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/bin/semver create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/package.json create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/range.bnf create mode 100644 day1/cli-study/node_modules/normalize-package-data/node_modules/semver/semver.js create mode 100644 day1/cli-study/node_modules/normalize-package-data/package.json create mode 100644 day1/cli-study/node_modules/normalize-url/index.js create mode 100644 day1/cli-study/node_modules/normalize-url/license create mode 100644 day1/cli-study/node_modules/normalize-url/node_modules/sort-keys/index.js create mode 100644 day1/cli-study/node_modules/normalize-url/node_modules/sort-keys/license create mode 100644 day1/cli-study/node_modules/normalize-url/node_modules/sort-keys/package.json create mode 100644 day1/cli-study/node_modules/normalize-url/node_modules/sort-keys/readme.md create mode 100644 day1/cli-study/node_modules/normalize-url/package.json create mode 100644 day1/cli-study/node_modules/normalize-url/readme.md create mode 100644 day1/cli-study/node_modules/npm-conf/index.js create mode 100644 day1/cli-study/node_modules/npm-conf/lib/conf.js create mode 100644 day1/cli-study/node_modules/npm-conf/lib/defaults.js create mode 100644 day1/cli-study/node_modules/npm-conf/lib/make.js create mode 100644 day1/cli-study/node_modules/npm-conf/lib/types.js create mode 100644 day1/cli-study/node_modules/npm-conf/lib/util.js create mode 100644 day1/cli-study/node_modules/npm-conf/license create mode 100644 day1/cli-study/node_modules/npm-conf/package.json create mode 100644 day1/cli-study/node_modules/npm-conf/readme.md create mode 100644 day1/cli-study/node_modules/object-assign/index.js create mode 100644 day1/cli-study/node_modules/object-assign/license create mode 100644 day1/cli-study/node_modules/object-assign/package.json create mode 100644 day1/cli-study/node_modules/object-assign/readme.md create mode 100644 day1/cli-study/node_modules/object-inspect/.eslintignore create mode 100644 day1/cli-study/node_modules/object-inspect/.eslintrc create mode 100644 day1/cli-study/node_modules/object-inspect/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/object-inspect/.nycrc create mode 100644 day1/cli-study/node_modules/object-inspect/.travis.yml create mode 100644 day1/cli-study/node_modules/object-inspect/LICENSE create mode 100644 day1/cli-study/node_modules/object-inspect/example/all.js create mode 100644 day1/cli-study/node_modules/object-inspect/example/circular.js create mode 100644 day1/cli-study/node_modules/object-inspect/example/fn.js create mode 100644 day1/cli-study/node_modules/object-inspect/example/inspect.js create mode 100644 day1/cli-study/node_modules/object-inspect/index.js create mode 100644 day1/cli-study/node_modules/object-inspect/package.json create mode 100644 day1/cli-study/node_modules/object-inspect/readme.markdown create mode 100644 day1/cli-study/node_modules/object-inspect/test-core-js.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/bigint.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/browser/dom.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/circular.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/deep.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/element.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/err.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/fn.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/has.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/holes.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/indent-option.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/inspect.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/lowbyte.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/number.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/quoteStyle.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/undef.js create mode 100644 day1/cli-study/node_modules/object-inspect/test/values.js create mode 100644 day1/cli-study/node_modules/object-inspect/util.inspect.js create mode 100644 day1/cli-study/node_modules/object-keys/.editorconfig create mode 100644 day1/cli-study/node_modules/object-keys/.eslintrc create mode 100644 day1/cli-study/node_modules/object-keys/.travis.yml create mode 100644 day1/cli-study/node_modules/object-keys/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/object-keys/LICENSE create mode 100644 day1/cli-study/node_modules/object-keys/README.md create mode 100644 day1/cli-study/node_modules/object-keys/implementation.js create mode 100644 day1/cli-study/node_modules/object-keys/index.js create mode 100644 day1/cli-study/node_modules/object-keys/isArguments.js create mode 100644 day1/cli-study/node_modules/object-keys/package.json create mode 100644 day1/cli-study/node_modules/object-keys/test/index.js create mode 100644 day1/cli-study/node_modules/object.assign/.editorconfig create mode 100644 day1/cli-study/node_modules/object.assign/.eslintrc create mode 100644 day1/cli-study/node_modules/object.assign/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/object.assign/LICENSE create mode 100644 day1/cli-study/node_modules/object.assign/README.md create mode 100644 day1/cli-study/node_modules/object.assign/auto.js create mode 100644 day1/cli-study/node_modules/object.assign/dist/browser.js create mode 100644 day1/cli-study/node_modules/object.assign/hasSymbols.js create mode 100644 day1/cli-study/node_modules/object.assign/implementation.js create mode 100644 day1/cli-study/node_modules/object.assign/index.js create mode 100644 day1/cli-study/node_modules/object.assign/package.json create mode 100644 day1/cli-study/node_modules/object.assign/polyfill.js create mode 100644 day1/cli-study/node_modules/object.assign/shim.js create mode 100644 day1/cli-study/node_modules/object.assign/test.sh create mode 100644 day1/cli-study/node_modules/object.assign/test/.eslintrc create mode 100644 day1/cli-study/node_modules/object.assign/test/index.js create mode 100644 day1/cli-study/node_modules/object.assign/test/native.js create mode 100644 day1/cli-study/node_modules/object.assign/test/shimmed.js create mode 100644 day1/cli-study/node_modules/object.assign/test/tests.js create mode 100644 day1/cli-study/node_modules/object.entries/.editorconfig create mode 100644 day1/cli-study/node_modules/object.entries/.eslintrc create mode 100644 day1/cli-study/node_modules/object.entries/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/object.entries/.travis.yml create mode 100644 day1/cli-study/node_modules/object.entries/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/object.entries/LICENSE create mode 100644 day1/cli-study/node_modules/object.entries/README.md create mode 100644 day1/cli-study/node_modules/object.entries/auto.js create mode 100644 day1/cli-study/node_modules/object.entries/implementation.js create mode 100644 day1/cli-study/node_modules/object.entries/index.js create mode 100644 day1/cli-study/node_modules/object.entries/package.json create mode 100644 day1/cli-study/node_modules/object.entries/polyfill.js create mode 100644 day1/cli-study/node_modules/object.entries/shim.js create mode 100644 day1/cli-study/node_modules/object.entries/test/.eslintrc create mode 100644 day1/cli-study/node_modules/object.entries/test/index.js create mode 100644 day1/cli-study/node_modules/object.entries/test/shimmed.js create mode 100644 day1/cli-study/node_modules/object.entries/test/tests.js create mode 100644 day1/cli-study/node_modules/object.values/.eslintrc create mode 100644 day1/cli-study/node_modules/object.values/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/object.values/.travis.yml create mode 100644 day1/cli-study/node_modules/object.values/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/object.values/LICENSE create mode 100644 day1/cli-study/node_modules/object.values/README.md create mode 100644 day1/cli-study/node_modules/object.values/auto.js create mode 100644 day1/cli-study/node_modules/object.values/implementation.js create mode 100644 day1/cli-study/node_modules/object.values/index.js create mode 100644 day1/cli-study/node_modules/object.values/package.json create mode 100644 day1/cli-study/node_modules/object.values/polyfill.js create mode 100644 day1/cli-study/node_modules/object.values/shim.js create mode 100644 day1/cli-study/node_modules/object.values/test/.eslintrc create mode 100644 day1/cli-study/node_modules/object.values/test/index.js create mode 100644 day1/cli-study/node_modules/object.values/test/shimmed.js create mode 100644 day1/cli-study/node_modules/object.values/test/tests.js create mode 100644 day1/cli-study/node_modules/once/LICENSE create mode 100644 day1/cli-study/node_modules/once/README.md create mode 100644 day1/cli-study/node_modules/once/once.js create mode 100644 day1/cli-study/node_modules/once/package.json create mode 100644 day1/cli-study/node_modules/onetime/index.d.ts create mode 100644 day1/cli-study/node_modules/onetime/index.js create mode 100644 day1/cli-study/node_modules/onetime/license create mode 100644 day1/cli-study/node_modules/onetime/package.json create mode 100644 day1/cli-study/node_modules/onetime/readme.md create mode 100644 day1/cli-study/node_modules/optionator/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/optionator/LICENSE create mode 100644 day1/cli-study/node_modules/optionator/README.md create mode 100644 day1/cli-study/node_modules/optionator/lib/help.js create mode 100644 day1/cli-study/node_modules/optionator/lib/index.js create mode 100644 day1/cli-study/node_modules/optionator/lib/util.js create mode 100644 day1/cli-study/node_modules/optionator/package.json create mode 100644 day1/cli-study/node_modules/ora/index.d.ts create mode 100644 day1/cli-study/node_modules/ora/index.js create mode 100644 day1/cli-study/node_modules/ora/license create mode 100644 day1/cli-study/node_modules/ora/node_modules/ansi-styles/index.d.ts create mode 100644 day1/cli-study/node_modules/ora/node_modules/ansi-styles/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/ansi-styles/license create mode 100644 day1/cli-study/node_modules/ora/node_modules/ansi-styles/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/ansi-styles/readme.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/index.d.ts create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/license create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/readme.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/source/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/source/templates.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/chalk/source/util.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/LICENSE create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/README.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/conversions.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-convert/route.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-name/LICENSE create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-name/README.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-name/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/color-name/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/has-flag/index.d.ts create mode 100644 day1/cli-study/node_modules/ora/node_modules/has-flag/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/has-flag/license create mode 100644 day1/cli-study/node_modules/ora/node_modules/has-flag/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/has-flag/readme.md create mode 100644 day1/cli-study/node_modules/ora/node_modules/supports-color/browser.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/supports-color/index.js create mode 100644 day1/cli-study/node_modules/ora/node_modules/supports-color/license create mode 100644 day1/cli-study/node_modules/ora/node_modules/supports-color/package.json create mode 100644 day1/cli-study/node_modules/ora/node_modules/supports-color/readme.md create mode 100644 day1/cli-study/node_modules/ora/package.json create mode 100644 day1/cli-study/node_modules/ora/readme.md create mode 100644 day1/cli-study/node_modules/os-tmpdir/index.js create mode 100644 day1/cli-study/node_modules/os-tmpdir/license create mode 100644 day1/cli-study/node_modules/os-tmpdir/package.json create mode 100644 day1/cli-study/node_modules/os-tmpdir/readme.md create mode 100644 day1/cli-study/node_modules/p-cancelable/index.js create mode 100644 day1/cli-study/node_modules/p-cancelable/license create mode 100644 day1/cli-study/node_modules/p-cancelable/package.json create mode 100644 day1/cli-study/node_modules/p-cancelable/readme.md create mode 100644 day1/cli-study/node_modules/p-event/index.js create mode 100644 day1/cli-study/node_modules/p-event/license create mode 100644 day1/cli-study/node_modules/p-event/package.json create mode 100644 day1/cli-study/node_modules/p-event/readme.md create mode 100644 day1/cli-study/node_modules/p-finally/index.js create mode 100644 day1/cli-study/node_modules/p-finally/license create mode 100644 day1/cli-study/node_modules/p-finally/package.json create mode 100644 day1/cli-study/node_modules/p-finally/readme.md create mode 100644 day1/cli-study/node_modules/p-is-promise/index.js create mode 100644 day1/cli-study/node_modules/p-is-promise/license create mode 100644 day1/cli-study/node_modules/p-is-promise/package.json create mode 100644 day1/cli-study/node_modules/p-is-promise/readme.md create mode 100644 day1/cli-study/node_modules/p-limit/index.js create mode 100644 day1/cli-study/node_modules/p-limit/license create mode 100644 day1/cli-study/node_modules/p-limit/package.json create mode 100644 day1/cli-study/node_modules/p-limit/readme.md create mode 100644 day1/cli-study/node_modules/p-locate/index.js create mode 100644 day1/cli-study/node_modules/p-locate/license create mode 100644 day1/cli-study/node_modules/p-locate/package.json create mode 100644 day1/cli-study/node_modules/p-locate/readme.md create mode 100644 day1/cli-study/node_modules/p-timeout/index.js create mode 100644 day1/cli-study/node_modules/p-timeout/license create mode 100644 day1/cli-study/node_modules/p-timeout/package.json create mode 100644 day1/cli-study/node_modules/p-timeout/readme.md create mode 100644 day1/cli-study/node_modules/p-try/index.js create mode 100644 day1/cli-study/node_modules/p-try/license create mode 100644 day1/cli-study/node_modules/p-try/package.json create mode 100644 day1/cli-study/node_modules/p-try/readme.md create mode 100644 day1/cli-study/node_modules/parent-module/index.js create mode 100644 day1/cli-study/node_modules/parent-module/license create mode 100644 day1/cli-study/node_modules/parent-module/package.json create mode 100644 day1/cli-study/node_modules/parent-module/readme.md create mode 100644 day1/cli-study/node_modules/parse-json/index.js create mode 100644 day1/cli-study/node_modules/parse-json/license create mode 100644 day1/cli-study/node_modules/parse-json/package.json create mode 100644 day1/cli-study/node_modules/parse-json/readme.md create mode 100644 day1/cli-study/node_modules/parse-json/vendor/parse.js create mode 100644 day1/cli-study/node_modules/parse-json/vendor/unicode.js create mode 100644 day1/cli-study/node_modules/path-exists/index.js create mode 100644 day1/cli-study/node_modules/path-exists/license create mode 100644 day1/cli-study/node_modules/path-exists/package.json create mode 100644 day1/cli-study/node_modules/path-exists/readme.md create mode 100644 day1/cli-study/node_modules/path-is-absolute/index.js create mode 100644 day1/cli-study/node_modules/path-is-absolute/license create mode 100644 day1/cli-study/node_modules/path-is-absolute/package.json create mode 100644 day1/cli-study/node_modules/path-is-absolute/readme.md create mode 100644 day1/cli-study/node_modules/path-key/index.d.ts create mode 100644 day1/cli-study/node_modules/path-key/index.js create mode 100644 day1/cli-study/node_modules/path-key/license create mode 100644 day1/cli-study/node_modules/path-key/package.json create mode 100644 day1/cli-study/node_modules/path-key/readme.md create mode 100644 day1/cli-study/node_modules/path-parse/.travis.yml create mode 100644 day1/cli-study/node_modules/path-parse/LICENSE create mode 100644 day1/cli-study/node_modules/path-parse/README.md create mode 100644 day1/cli-study/node_modules/path-parse/index.js create mode 100644 day1/cli-study/node_modules/path-parse/package.json create mode 100644 day1/cli-study/node_modules/path-parse/test.js create mode 100644 day1/cli-study/node_modules/path-type/index.js create mode 100644 day1/cli-study/node_modules/path-type/license create mode 100644 day1/cli-study/node_modules/path-type/node_modules/pify/index.js create mode 100644 day1/cli-study/node_modules/path-type/node_modules/pify/license create mode 100644 day1/cli-study/node_modules/path-type/node_modules/pify/package.json create mode 100644 day1/cli-study/node_modules/path-type/node_modules/pify/readme.md create mode 100644 day1/cli-study/node_modules/path-type/package.json create mode 100644 day1/cli-study/node_modules/path-type/readme.md create mode 100644 day1/cli-study/node_modules/pend/LICENSE create mode 100644 day1/cli-study/node_modules/pend/README.md create mode 100644 day1/cli-study/node_modules/pend/index.js create mode 100644 day1/cli-study/node_modules/pend/package.json create mode 100644 day1/cli-study/node_modules/pend/test.js create mode 100644 day1/cli-study/node_modules/pify/index.js create mode 100644 day1/cli-study/node_modules/pify/license create mode 100644 day1/cli-study/node_modules/pify/package.json create mode 100644 day1/cli-study/node_modules/pify/readme.md create mode 100644 day1/cli-study/node_modules/pinkie-promise/index.js create mode 100644 day1/cli-study/node_modules/pinkie-promise/license create mode 100644 day1/cli-study/node_modules/pinkie-promise/package.json create mode 100644 day1/cli-study/node_modules/pinkie-promise/readme.md create mode 100644 day1/cli-study/node_modules/pinkie/index.js create mode 100644 day1/cli-study/node_modules/pinkie/license create mode 100644 day1/cli-study/node_modules/pinkie/package.json create mode 100644 day1/cli-study/node_modules/pinkie/readme.md create mode 100644 day1/cli-study/node_modules/pkg-dir/index.js create mode 100644 day1/cli-study/node_modules/pkg-dir/license create mode 100644 day1/cli-study/node_modules/pkg-dir/package.json create mode 100644 day1/cli-study/node_modules/pkg-dir/readme.md create mode 100644 day1/cli-study/node_modules/prelude-ls/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/prelude-ls/LICENSE create mode 100644 day1/cli-study/node_modules/prelude-ls/README.md create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/Func.js create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/List.js create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/Num.js create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/Obj.js create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/Str.js create mode 100644 day1/cli-study/node_modules/prelude-ls/lib/index.js create mode 100644 day1/cli-study/node_modules/prelude-ls/package.json create mode 100644 day1/cli-study/node_modules/prepend-http/index.js create mode 100644 day1/cli-study/node_modules/prepend-http/license create mode 100644 day1/cli-study/node_modules/prepend-http/package.json create mode 100644 day1/cli-study/node_modules/prepend-http/readme.md create mode 100644 day1/cli-study/node_modules/process-nextick-args/index.js create mode 100644 day1/cli-study/node_modules/process-nextick-args/license.md create mode 100644 day1/cli-study/node_modules/process-nextick-args/package.json create mode 100644 day1/cli-study/node_modules/process-nextick-args/readme.md create mode 100644 day1/cli-study/node_modules/progress/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/progress/LICENSE create mode 100644 day1/cli-study/node_modules/progress/Makefile create mode 100644 day1/cli-study/node_modules/progress/Readme.md create mode 100644 day1/cli-study/node_modules/progress/index.js create mode 100644 day1/cli-study/node_modules/progress/lib/node-progress.js create mode 100644 day1/cli-study/node_modules/progress/package.json create mode 100644 day1/cli-study/node_modules/proto-list/LICENSE create mode 100644 day1/cli-study/node_modules/proto-list/README.md create mode 100644 day1/cli-study/node_modules/proto-list/package.json create mode 100644 day1/cli-study/node_modules/proto-list/proto-list.js create mode 100644 day1/cli-study/node_modules/proto-list/test/basic.js create mode 100644 day1/cli-study/node_modules/punycode/LICENSE-MIT.txt create mode 100644 day1/cli-study/node_modules/punycode/README.md create mode 100644 day1/cli-study/node_modules/punycode/package.json create mode 100644 day1/cli-study/node_modules/punycode/punycode.es6.js create mode 100644 day1/cli-study/node_modules/punycode/punycode.js create mode 100644 day1/cli-study/node_modules/query-string/index.js create mode 100644 day1/cli-study/node_modules/query-string/license create mode 100644 day1/cli-study/node_modules/query-string/package.json create mode 100644 day1/cli-study/node_modules/query-string/readme.md create mode 100644 day1/cli-study/node_modules/read-pkg-up/index.js create mode 100644 day1/cli-study/node_modules/read-pkg-up/license create mode 100644 day1/cli-study/node_modules/read-pkg-up/package.json create mode 100644 day1/cli-study/node_modules/read-pkg-up/readme.md create mode 100644 day1/cli-study/node_modules/read-pkg/index.js create mode 100644 day1/cli-study/node_modules/read-pkg/license create mode 100644 day1/cli-study/node_modules/read-pkg/package.json create mode 100644 day1/cli-study/node_modules/read-pkg/readme.md create mode 100644 day1/cli-study/node_modules/readable-stream/.travis.yml create mode 100644 day1/cli-study/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 day1/cli-study/node_modules/readable-stream/GOVERNANCE.md create mode 100644 day1/cli-study/node_modules/readable-stream/LICENSE create mode 100644 day1/cli-study/node_modules/readable-stream/README.md create mode 100644 day1/cli-study/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 day1/cli-study/node_modules/readable-stream/duplex-browser.js create mode 100644 day1/cli-study/node_modules/readable-stream/duplex.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 day1/cli-study/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 day1/cli-study/node_modules/readable-stream/node_modules/safe-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/readable-stream/node_modules/safe-buffer/README.md create mode 100644 day1/cli-study/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts create mode 100644 day1/cli-study/node_modules/readable-stream/node_modules/safe-buffer/index.js create mode 100644 day1/cli-study/node_modules/readable-stream/node_modules/safe-buffer/package.json create mode 100644 day1/cli-study/node_modules/readable-stream/package.json create mode 100644 day1/cli-study/node_modules/readable-stream/passthrough.js create mode 100644 day1/cli-study/node_modules/readable-stream/readable-browser.js create mode 100644 day1/cli-study/node_modules/readable-stream/readable.js create mode 100644 day1/cli-study/node_modules/readable-stream/transform.js create mode 100644 day1/cli-study/node_modules/readable-stream/writable-browser.js create mode 100644 day1/cli-study/node_modules/readable-stream/writable.js create mode 100644 day1/cli-study/node_modules/recursive-readdir/.travis.yml create mode 100644 day1/cli-study/node_modules/recursive-readdir/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/recursive-readdir/LICENSE create mode 100644 day1/cli-study/node_modules/recursive-readdir/README.md create mode 100644 day1/cli-study/node_modules/recursive-readdir/index.js create mode 100644 day1/cli-study/node_modules/recursive-readdir/package.json create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/recursive-readdir-test.js create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/a/a create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/a/beans create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/b/123 create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/b/b/hurp-durp create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/c.txt create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdir/d.txt create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdirBeta/foo.bar create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testdirBeta/ignore.txt create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testsymlinks/linkeddir/hi.docx create mode 100644 day1/cli-study/node_modules/recursive-readdir/test/testsymlinks/linkedfile.wmf create mode 100644 day1/cli-study/node_modules/regexpp/LICENSE create mode 100644 day1/cli-study/node_modules/regexpp/README.md create mode 100644 day1/cli-study/node_modules/regexpp/index.d.ts create mode 100644 day1/cli-study/node_modules/regexpp/index.js create mode 100644 day1/cli-study/node_modules/regexpp/index.js.map create mode 100644 day1/cli-study/node_modules/regexpp/index.mjs create mode 100644 day1/cli-study/node_modules/regexpp/index.mjs.map create mode 100644 day1/cli-study/node_modules/regexpp/package.json create mode 100644 day1/cli-study/node_modules/resolve-from/index.js create mode 100644 day1/cli-study/node_modules/resolve-from/license create mode 100644 day1/cli-study/node_modules/resolve-from/package.json create mode 100644 day1/cli-study/node_modules/resolve-from/readme.md create mode 100644 day1/cli-study/node_modules/resolve/.editorconfig create mode 100644 day1/cli-study/node_modules/resolve/.eslintignore create mode 100644 day1/cli-study/node_modules/resolve/.eslintrc create mode 100644 day1/cli-study/node_modules/resolve/.travis.yml create mode 100644 day1/cli-study/node_modules/resolve/LICENSE create mode 100644 day1/cli-study/node_modules/resolve/appveyor.yml create mode 100644 day1/cli-study/node_modules/resolve/example/async.js create mode 100644 day1/cli-study/node_modules/resolve/example/sync.js create mode 100644 day1/cli-study/node_modules/resolve/index.js create mode 100644 day1/cli-study/node_modules/resolve/lib/async.js create mode 100644 day1/cli-study/node_modules/resolve/lib/caller.js create mode 100644 day1/cli-study/node_modules/resolve/lib/core.js create mode 100644 day1/cli-study/node_modules/resolve/lib/core.json create mode 100644 day1/cli-study/node_modules/resolve/lib/is-core.js create mode 100644 day1/cli-study/node_modules/resolve/lib/node-modules-paths.js create mode 100644 day1/cli-study/node_modules/resolve/lib/normalize-options.js create mode 100644 day1/cli-study/node_modules/resolve/lib/sync.js create mode 100644 day1/cli-study/node_modules/resolve/package.json create mode 100644 day1/cli-study/node_modules/resolve/readme.markdown create mode 100644 day1/cli-study/node_modules/resolve/test/.eslintrc create mode 100644 day1/cli-study/node_modules/resolve/test/core.js create mode 100644 day1/cli-study/node_modules/resolve/test/dotdot.js create mode 100644 day1/cli-study/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/dotdot/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/faulty_basedir.js create mode 100644 day1/cli-study/node_modules/resolve/test/filter.js create mode 100644 day1/cli-study/node_modules/resolve/test/filter_sync.js create mode 100644 day1/cli-study/node_modules/resolve/test/mock.js create mode 100644 day1/cli-study/node_modules/resolve/test/mock_sync.js create mode 100644 day1/cli-study/node_modules/resolve/test/module_dir.js create mode 100644 day1/cli-study/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 day1/cli-study/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/node-modules-paths.js create mode 100644 day1/cli-study/node_modules/resolve/test/node_path.js create mode 100644 day1/cli-study/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/nonstring.js create mode 100644 day1/cli-study/node_modules/resolve/test/pathfilter.js create mode 100644 day1/cli-study/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence/aaa.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence/bbb.js create mode 100644 day1/cli-study/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/baz/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/cup.coffee create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/foo.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/mug.coffee create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/mug.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 day1/cli-study/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 day1/cli-study/node_modules/resolve/test/resolver_sync.js create mode 100644 day1/cli-study/node_modules/resolve/test/shadowed_core.js create mode 100644 day1/cli-study/node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 day1/cli-study/node_modules/resolve/test/subdirs.js create mode 100644 day1/cli-study/node_modules/resolve/test/symlinks.js create mode 100644 day1/cli-study/node_modules/responselike/LICENSE create mode 100644 day1/cli-study/node_modules/responselike/README.md create mode 100644 day1/cli-study/node_modules/responselike/package.json create mode 100644 day1/cli-study/node_modules/responselike/src/index.js create mode 100644 day1/cli-study/node_modules/restore-cursor/index.d.ts create mode 100644 day1/cli-study/node_modules/restore-cursor/index.js create mode 100644 day1/cli-study/node_modules/restore-cursor/license create mode 100644 day1/cli-study/node_modules/restore-cursor/package.json create mode 100644 day1/cli-study/node_modules/restore-cursor/readme.md create mode 100644 day1/cli-study/node_modules/rimraf/LICENSE create mode 100644 day1/cli-study/node_modules/rimraf/README.md create mode 100644 day1/cli-study/node_modules/rimraf/bin.js create mode 100644 day1/cli-study/node_modules/rimraf/package.json create mode 100644 day1/cli-study/node_modules/rimraf/rimraf.js create mode 100644 day1/cli-study/node_modules/run-async/LICENSE create mode 100644 day1/cli-study/node_modules/run-async/README.md create mode 100644 day1/cli-study/node_modules/run-async/index.js create mode 100644 day1/cli-study/node_modules/run-async/package.json create mode 100644 day1/cli-study/node_modules/rxjs/AsyncSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/AsyncSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/AsyncSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/BehaviorSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/BehaviorSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/BehaviorSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/InnerSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/InnerSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/InnerSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/LICENSE.txt create mode 100644 day1/cli-study/node_modules/rxjs/Notification.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Notification.js create mode 100644 day1/cli-study/node_modules/rxjs/Notification.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Observable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Observable.js create mode 100644 day1/cli-study/node_modules/rxjs/Observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Observer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Observer.js create mode 100644 day1/cli-study/node_modules/rxjs/Observer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Operator.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Operator.js create mode 100644 day1/cli-study/node_modules/rxjs/Operator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/OuterSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/OuterSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/OuterSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/README.md create mode 100644 day1/cli-study/node_modules/rxjs/ReplaySubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/ReplaySubject.js create mode 100644 day1/cli-study/node_modules/rxjs/ReplaySubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Rx.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Rx.js create mode 100644 day1/cli-study/node_modules/rxjs/Rx.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Scheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Scheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/Scheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Subject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Subject.js create mode 100644 day1/cli-study/node_modules/rxjs/Subject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/SubjectSubscription.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/SubjectSubscription.js create mode 100644 day1/cli-study/node_modules/rxjs/SubjectSubscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Subscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Subscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/Subscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/Subscription.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/Subscription.js create mode 100644 day1/cli-study/node_modules/rxjs/Subscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/LICENSE.txt create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/README.md create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/ajax/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/ajax/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/fetch/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/fetch/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal-compatibility/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal-compatibility/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/AsyncSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/AsyncSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/BehaviorSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/BehaviorSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/InnerSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/InnerSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Notification.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Notification.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Observable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Observer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Observer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Operator.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Operator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/OuterSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/OuterSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/ReplaySubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/ReplaySubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Rx.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Rx.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Scheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Scheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/SubjectSubscription.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/SubjectSubscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subscription.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/Subscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/config.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/config.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/ConnectableObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/SubscribeOnObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/bindCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/bindCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/bindNodeCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/defer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/defer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/AjaxObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/AjaxObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/WebSocketSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/WebSocketSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/ajax.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/ajax.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/fetch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/webSocket.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/dom/webSocket.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/empty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/empty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/forkJoin.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/forkJoin.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/from.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/from.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromEvent.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromEvent.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromEventPattern.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/fromPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/generate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/generate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/iif.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/iif.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/interval.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/interval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/never.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/never.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/of.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/of.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/pairs.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/pairs.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/race.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/range.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/range.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/throwError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/throwError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/timer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/timer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/using.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/using.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/observable/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/catchError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/catchError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/count.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/endWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/endWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/every.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/finalize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/finalize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/find.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/first.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/last.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/map.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/max.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/min.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/race.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/refCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/refCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/share.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/single.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/take.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/tap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/tap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/throwIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/window.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/operators/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduleObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/schedulePromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduled/scheduled.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/Action.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/Action.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AnimationFrameScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsapAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsapScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsyncAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/AsyncScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/QueueAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/QueueScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/VirtualTimeScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/animationFrame.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/asap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/asap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/async.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/async.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/queue.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/scheduler/queue.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/iterator.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/iterator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/observable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/symbol/rxSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/ColdObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/ColdObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/HotObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/HotObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/SubscriptionLog.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/SubscriptionLog.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/SubscriptionLoggable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/SubscriptionLoggable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/TestMessage.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/TestMessage.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/TestScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/testing/TestScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/types.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/types.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/ArgumentOutOfRangeError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/EmptyError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/EmptyError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/Immediate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/Immediate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/ObjectUnsubscribedError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/TimeoutError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/TimeoutError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/UnsubscriptionError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/applyMixins.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/applyMixins.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/canReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/canReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/errorObject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/errorObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/hostReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/hostReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/identity.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/identity.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isArrayLike.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isArrayLike.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isDate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isDate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isFunction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isFunction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isInteropObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isNumeric.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isNumeric.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isObject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/isScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/noop.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/noop.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/not.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/not.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/pipe.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/pipe.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/root.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/root.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/subscribeToResult.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/toSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/toSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/tryCatch.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/internal/util/tryCatch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/path-mapping.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/testing/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/testing/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/webSocket/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm2015/webSocket/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/LICENSE.txt create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/README.md create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/ajax/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/ajax/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/fetch/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/fetch/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal-compatibility/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal-compatibility/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/AsyncSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/AsyncSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/BehaviorSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/BehaviorSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/InnerSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/InnerSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Notification.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Notification.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Observable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Observer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Observer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Operator.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Operator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/OuterSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/OuterSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/ReplaySubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/ReplaySubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Rx.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Rx.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Scheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Scheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/SubjectSubscription.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/SubjectSubscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subscription.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/Subscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/config.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/config.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/ConnectableObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/bindCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/bindCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/bindNodeCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/defer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/defer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/AjaxObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/AjaxObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/WebSocketSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/WebSocketSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/ajax.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/ajax.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/fetch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/webSocket.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/dom/webSocket.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/empty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/empty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/forkJoin.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/forkJoin.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/from.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/from.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromEvent.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromEvent.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromEventPattern.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/fromPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/generate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/generate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/iif.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/iif.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/interval.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/interval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/never.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/never.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/of.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/of.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/pairs.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/pairs.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/race.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/range.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/range.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/throwError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/throwError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/timer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/timer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/using.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/using.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/observable/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/catchError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/catchError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/count.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/endWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/endWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/every.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/finalize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/finalize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/find.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/first.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/last.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/map.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/max.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/min.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/race.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/refCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/refCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/share.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/single.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/take.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/tap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/tap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/throwIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/window.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/operators/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduleObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/schedulePromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduled.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduled/scheduled.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/Action.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/Action.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AnimationFrameScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsapAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsapScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsyncAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/AsyncScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/QueueAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/QueueScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/VirtualTimeScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/animationFrame.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/asap.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/asap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/async.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/async.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/queue.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/scheduler/queue.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/iterator.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/iterator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/observable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/symbol/rxSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/ColdObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/ColdObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/HotObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/HotObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/SubscriptionLog.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/SubscriptionLog.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/SubscriptionLoggable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/SubscriptionLoggable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/TestMessage.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/TestMessage.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/TestScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/testing/TestScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/types.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/types.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/ArgumentOutOfRangeError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/EmptyError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/EmptyError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/Immediate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/Immediate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/ObjectUnsubscribedError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/TimeoutError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/TimeoutError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/UnsubscriptionError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/applyMixins.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/applyMixins.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/canReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/canReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/errorObject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/errorObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/hostReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/hostReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/identity.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/identity.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isArrayLike.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isArrayLike.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isDate.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isDate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isFunction.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isFunction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isInteropObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isInteropObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isNumeric.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isNumeric.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isObject.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/isScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/noop.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/noop.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/not.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/not.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/pipe.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/pipe.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/root.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/root.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeTo.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToArray.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToResult.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/subscribeToResult.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/toSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/toSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/tryCatch.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/internal/util/tryCatch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/path-mapping.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/testing/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/testing/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/webSocket/index.js create mode 100644 day1/cli-study/node_modules/rxjs/_esm5/webSocket/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindNodeCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindNodeCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/bindNodeCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/defer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/defer.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/defer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/ajax.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/ajax.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/ajax.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/webSocket.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/webSocket.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/dom/webSocket.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/empty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/empty.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/empty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/forkJoin.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/forkJoin.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/forkJoin.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/from.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/from.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/from.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEvent.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEvent.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEvent.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEventPattern.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEventPattern.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromEventPattern.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/fromPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/generate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/generate.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/generate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/if.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/if.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/if.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/interval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/interval.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/interval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/never.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/never.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/never.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/of.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/of.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/of.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/pairs.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/pairs.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/pairs.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/race.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/range.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/range.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/range.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/throw.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/throw.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/throw.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/timer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/timer.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/timer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/using.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/using.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/using.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/add/observable/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/audit.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/auditTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/buffer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/catch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/catch.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/catch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/count.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/count.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounceTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/defaultIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delayWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/dematerialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinct.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilKeyChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/do.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/do.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/do.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/elementAt.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/every.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/every.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaust.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaustMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/expand.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/filter.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/finally.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/finally.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/finally.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/find.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/find.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/findIndex.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/first.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/first.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/groupBy.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/ignoreElements.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/isEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/last.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/last.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/let.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/let.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/let.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/map.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/map.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/materialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/max.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/max.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeScan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/min.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/min.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/multicast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/observeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pairwise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/partition.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pluck.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publish.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishBehavior.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/race.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/reduce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeatWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retry.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retryWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sample.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sampleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/scan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sequenceEqual.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/share.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/share.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/shareReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/single.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/single.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/startWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/subscribeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switch.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/take.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/take.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeInterval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeout.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeoutWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timestamp.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/toPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/window.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/window.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/withLatestFrom.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zipAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/add/operator/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/ajax/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/ajax/index.js create mode 100644 day1/cli-study/node_modules/rxjs/ajax/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/ajax/package.json create mode 100644 day1/cli-study/node_modules/rxjs/bundles/rxjs.umd.js create mode 100644 day1/cli-study/node_modules/rxjs/bundles/rxjs.umd.js.map create mode 100644 day1/cli-study/node_modules/rxjs/bundles/rxjs.umd.min.js create mode 100644 day1/cli-study/node_modules/rxjs/bundles/rxjs.umd.min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/fetch/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/fetch/index.js create mode 100644 day1/cli-study/node_modules/rxjs/fetch/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/fetch/package.json create mode 100644 day1/cli-study/node_modules/rxjs/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/index.js create mode 100644 day1/cli-study/node_modules/rxjs/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/interfaces.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/interfaces.js create mode 100644 day1/cli-study/node_modules/rxjs/interfaces.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal-compatibility/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal-compatibility/index.js create mode 100644 day1/cli-study/node_modules/rxjs/internal-compatibility/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal-compatibility/package.json create mode 100644 day1/cli-study/node_modules/rxjs/internal/AsyncSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/AsyncSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/AsyncSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/BehaviorSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/BehaviorSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/BehaviorSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/InnerSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/InnerSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/InnerSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Notification.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Notification.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Notification.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observer.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Observer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Operator.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Operator.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Operator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/OuterSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/OuterSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/OuterSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/ReplaySubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/ReplaySubject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/ReplaySubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Rx.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Rx.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Rx.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Scheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Scheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Scheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/SubjectSubscription.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/SubjectSubscription.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/SubjectSubscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscription.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscription.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/Subscription.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/config.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/config.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/config.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/ConnectableObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/ConnectableObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/ConnectableObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/SubscribeOnObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/SubscribeOnObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/SubscribeOnObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindNodeCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindNodeCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/bindNodeCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/defer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/defer.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/defer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/AjaxObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/AjaxObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/AjaxObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/WebSocketSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/WebSocketSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/WebSocketSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/ajax.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/ajax.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/ajax.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/fetch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/fetch.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/fetch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/webSocket.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/webSocket.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/dom/webSocket.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/empty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/empty.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/empty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/forkJoin.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/forkJoin.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/forkJoin.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/from.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/from.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/from.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromArray.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEvent.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEvent.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEvent.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEventPattern.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEventPattern.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromEventPattern.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/fromPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/generate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/generate.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/generate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/iif.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/iif.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/iif.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/interval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/interval.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/interval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/never.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/never.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/never.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/of.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/of.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/of.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/pairs.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/pairs.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/pairs.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/partition.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/race.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/range.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/range.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/range.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/throwError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/throwError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/throwError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/timer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/timer.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/timer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/using.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/using.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/using.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/observable/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/audit.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/auditTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/buffer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/catchError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/catchError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/catchError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/count.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/count.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounceTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/defaultIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delayWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/dematerialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinct.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilKeyChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/elementAt.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/endWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/endWith.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/endWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/every.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/every.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaust.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaustMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/expand.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/filter.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/finalize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/finalize.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/finalize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/find.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/find.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/findIndex.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/first.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/first.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/groupBy.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/ignoreElements.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/isEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/last.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/last.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/map.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/map.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/materialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/max.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/max.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeScan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/min.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/min.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/multicast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/observeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pairwise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/partition.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pluck.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publish.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishBehavior.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/race.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/reduce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/refCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/refCount.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/refCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeatWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retry.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retryWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sample.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sampleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/scan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sequenceEqual.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/share.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/share.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/shareReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/single.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/single.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/startWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/subscribeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchAll.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/take.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/take.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/tap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/tap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/tap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throwIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throwIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/throwIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeInterval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeout.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeoutWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timestamp.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/toArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/window.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/window.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/withLatestFrom.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zipAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/operators/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleArray.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduleObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/schedulePromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/schedulePromise.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/schedulePromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduled.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduled.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduled/scheduled.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/Action.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/Action.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/Action.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameAction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameAction.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapAction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapAction.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsapScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncAction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncAction.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/AsyncScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueAction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueAction.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueAction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/QueueScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/animationFrame.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/animationFrame.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/animationFrame.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/asap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/asap.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/asap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/async.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/async.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/async.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/queue.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/queue.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/scheduler/queue.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/iterator.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/iterator.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/iterator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/observable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/observable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/rxSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/rxSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/symbol/rxSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/ColdObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/ColdObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/ColdObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/HotObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/HotObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/HotObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLog.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLog.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLog.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLoggable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLoggable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/SubscriptionLoggable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestMessage.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestMessage.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestMessage.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/testing/TestScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/types.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/types.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/types.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ArgumentOutOfRangeError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/EmptyError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/EmptyError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/EmptyError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/Immediate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/Immediate.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/Immediate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ObjectUnsubscribedError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ObjectUnsubscribedError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/ObjectUnsubscribedError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/TimeoutError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/TimeoutError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/TimeoutError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/UnsubscriptionError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/UnsubscriptionError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/UnsubscriptionError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/applyMixins.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/applyMixins.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/applyMixins.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/canReportError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/canReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/canReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/errorObject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/errorObject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/errorObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/hostReportError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/hostReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/hostReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/identity.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/identity.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/identity.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArray.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArrayLike.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArrayLike.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isArrayLike.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isDate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isDate.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isDate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isFunction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isFunction.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isFunction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isInteropObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isInteropObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isInteropObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isNumeric.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isNumeric.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isNumeric.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObject.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/isScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/noop.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/noop.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/noop.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/not.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/not.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/not.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/pipe.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/pipe.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/pipe.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/root.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/root.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/root.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeTo.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToArray.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToResult.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToResult.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/subscribeToResult.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/toSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/toSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/toSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/tryCatch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/tryCatch.js create mode 100644 day1/cli-study/node_modules/rxjs/internal/util/tryCatch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/migrations/collection.json create mode 100644 day1/cli-study/node_modules/rxjs/migrations/update-6_0_0/index.js create mode 100644 day1/cli-study/node_modules/rxjs/migrations/update-6_0_0/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayLikeObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayLikeObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayLikeObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ArrayObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundCallbackObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundCallbackObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundCallbackObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundNodeCallbackObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundNodeCallbackObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/BoundNodeCallbackObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ConnectableObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ConnectableObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ConnectableObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/DeferObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/DeferObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/DeferObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/EmptyObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/EmptyObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/EmptyObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ErrorObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ErrorObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ErrorObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ForkJoinObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ForkJoinObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ForkJoinObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventPatternObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventPatternObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromEventPatternObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/FromObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/GenerateObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/GenerateObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/GenerateObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/IfObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/IfObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/IfObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/IntervalObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/IntervalObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/IntervalObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/IteratorObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/IteratorObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/IteratorObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/NeverObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/NeverObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/NeverObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/PairsObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/PairsObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/PairsObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/PromiseObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/PromiseObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/PromiseObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/RangeObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/RangeObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/RangeObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/ScalarObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/ScalarObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/ScalarObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/SubscribeOnObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/SubscribeOnObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/SubscribeOnObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/TimerObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/TimerObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/TimerObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/UsingObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/UsingObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/UsingObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindNodeCallback.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindNodeCallback.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/bindNodeCallback.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/defer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/defer.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/defer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/AjaxObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/AjaxObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/AjaxObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/WebSocketSubject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/WebSocketSubject.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/WebSocketSubject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/ajax.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/ajax.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/ajax.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/webSocket.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/webSocket.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/dom/webSocket.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/empty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/empty.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/empty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/forkJoin.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/forkJoin.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/forkJoin.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/from.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/from.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/from.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromArray.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEvent.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEvent.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEvent.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEventPattern.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEventPattern.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromEventPattern.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/fromPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/generate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/generate.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/generate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/if.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/if.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/if.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/interval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/interval.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/interval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/never.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/never.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/never.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/of.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/of.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/of.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/pairs.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/pairs.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/pairs.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/race.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/range.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/range.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/range.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/throw.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/throw.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/throw.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/timer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/timer.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/timer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/using.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/using.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/using.js.map create mode 100644 day1/cli-study/node_modules/rxjs/observable/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/observable/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/observable/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/audit.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/auditTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/buffer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/catch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/catch.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/catch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/count.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/count.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounceTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/defaultIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/delay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/delayWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/dematerialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinct.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilKeyChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/do.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/do.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/do.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/elementAt.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/every.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/every.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaust.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaustMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/expand.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/filter.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/finally.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/finally.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/finally.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/find.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/find.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/findIndex.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/first.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/first.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/groupBy.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/ignoreElements.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/isEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/last.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/last.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/let.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/let.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/let.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/map.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/map.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/mapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/materialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/max.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/max.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeScan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/min.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/min.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/multicast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/observeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/pairwise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/partition.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/pluck.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/publish.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishBehavior.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/race.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/reduce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeatWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/retry.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/retryWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/sample.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/sampleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/scan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/sequenceEqual.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/share.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/share.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/shareReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/single.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/single.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/skip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/startWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/subscribeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/switch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/switch.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/switch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/take.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/take.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeInterval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeout.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeoutWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/timestamp.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/toArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/toPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/toPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/toPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/window.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/window.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/withLatestFrom.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operator/zipAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operator/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operator/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/audit.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/audit.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/audit.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/auditTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/auditTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/auditTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/buffer.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/buffer.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/buffer.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferCount.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/bufferWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/catchError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/catchError.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/catchError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineLatest.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineLatest.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/combineLatest.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/concat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/concat.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/concat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/concatMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/count.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/count.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/count.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounce.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounceTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounceTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/debounceTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/defaultIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/defaultIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/defaultIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/delay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/delay.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/delay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/delayWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/delayWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/delayWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/dematerialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/dematerialize.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/dematerialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinct.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinct.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinct.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilKeyChanged.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilKeyChanged.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/distinctUntilKeyChanged.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/elementAt.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/elementAt.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/elementAt.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/every.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/every.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/every.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaust.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaust.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaust.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaustMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaustMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/exhaustMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/expand.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/expand.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/expand.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/filter.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/filter.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/filter.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/finalize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/finalize.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/finalize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/find.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/find.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/find.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/findIndex.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/findIndex.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/findIndex.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/first.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/first.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/first.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/groupBy.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/groupBy.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/groupBy.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/ignoreElements.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/ignoreElements.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/ignoreElements.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/index.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/isEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/isEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/isEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/last.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/last.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/last.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/map.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/map.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/map.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/mapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/mapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/mapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/materialize.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/materialize.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/materialize.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/max.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/max.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/max.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/merge.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/merge.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/merge.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeScan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeScan.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/mergeScan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/min.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/min.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/min.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/multicast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/multicast.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/multicast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/observeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/observeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/observeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/onErrorResumeNext.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/onErrorResumeNext.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/onErrorResumeNext.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/package.json create mode 100644 day1/cli-study/node_modules/rxjs/operators/pairwise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/pairwise.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/pairwise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/partition.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/partition.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/partition.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/pluck.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/pluck.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/pluck.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/publish.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/publish.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/publish.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishBehavior.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishBehavior.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishBehavior.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/publishReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/race.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/race.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/race.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/reduce.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/reduce.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/reduce.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/refCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/refCount.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/refCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeat.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeat.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeat.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeatWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeatWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/repeatWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/retry.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/retry.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/retry.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/retryWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/retryWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/retryWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/sample.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/sample.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/sample.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/sampleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/sampleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/sampleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/scan.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/scan.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/scan.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/sequenceEqual.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/sequenceEqual.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/sequenceEqual.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/share.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/share.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/share.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/shareReplay.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/shareReplay.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/shareReplay.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/single.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/single.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/single.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/skip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/skip.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/skip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/skipWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/startWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/startWith.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/startWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/subscribeOn.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/subscribeOn.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/subscribeOn.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMap.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMapTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMapTo.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/switchMapTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/take.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/take.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/take.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeLast.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeLast.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeLast.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeUntil.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeUntil.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeUntil.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeWhile.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeWhile.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/takeWhile.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/tap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/tap.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/tap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttle.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttleTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttleTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/throttleTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/throwIfEmpty.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/throwIfEmpty.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/throwIfEmpty.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeInterval.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeInterval.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeInterval.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeout.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeout.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeout.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeoutWith.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeoutWith.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/timeoutWith.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/timestamp.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/timestamp.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/timestamp.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/toArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/toArray.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/toArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/window.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/window.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/window.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowCount.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowCount.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowCount.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowTime.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowTime.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowTime.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowToggle.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowToggle.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowToggle.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowWhen.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowWhen.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/windowWhen.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/withLatestFrom.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/withLatestFrom.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/withLatestFrom.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/zip.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/zip.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/zip.js.map create mode 100644 day1/cli-study/node_modules/rxjs/operators/zipAll.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/operators/zipAll.js create mode 100644 day1/cli-study/node_modules/rxjs/operators/zipAll.js.map create mode 100644 day1/cli-study/node_modules/rxjs/package.json create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/animationFrame.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/animationFrame.js create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/animationFrame.js.map create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/asap.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/asap.js create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/asap.js.map create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/async.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/async.js create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/async.js.map create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/queue.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/queue.js create mode 100644 day1/cli-study/node_modules/rxjs/scheduler/queue.js.map create mode 100644 day1/cli-study/node_modules/rxjs/src/AsyncSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/BehaviorSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/InnerSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/LICENSE.txt create mode 100644 day1/cli-study/node_modules/rxjs/src/MiscJSDoc.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Notification.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Observable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Observer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Operator.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/OuterSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/README.md create mode 100644 day1/cli-study/node_modules/rxjs/src/ReplaySubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Rx.global.js create mode 100644 day1/cli-study/node_modules/rxjs/src/Rx.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Scheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Subject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/SubjectSubscription.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Subscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/Subscription.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/bindCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/bindNodeCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/defer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/dom/ajax.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/dom/webSocket.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/empty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/forkJoin.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/from.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/fromEvent.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/fromEventPattern.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/fromPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/generate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/if.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/interval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/never.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/of.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/pairs.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/range.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/throw.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/timer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/using.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/observable/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/audit.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/auditTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/buffer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/bufferCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/bufferTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/bufferToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/bufferWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/catch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/combineAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/concatAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/concatMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/concatMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/count.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/debounce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/debounceTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/defaultIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/delay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/delayWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/dematerialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/distinct.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/distinctUntilChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/distinctUntilKeyChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/do.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/elementAt.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/every.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/exhaust.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/exhaustMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/expand.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/filter.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/finally.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/find.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/findIndex.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/first.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/groupBy.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/ignoreElements.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/isEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/last.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/let.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/map.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/mapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/materialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/max.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/mergeAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/mergeMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/mergeMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/mergeScan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/min.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/multicast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/observeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/pairwise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/partition.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/pluck.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/publish.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/publishBehavior.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/publishLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/publishReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/reduce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/repeat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/repeatWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/retry.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/retryWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/sample.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/sampleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/scan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/sequenceEqual.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/share.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/shareReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/single.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/skip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/skipLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/skipUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/skipWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/startWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/subscribeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/switch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/switchMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/switchMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/take.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/takeLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/takeUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/takeWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/throttle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/throttleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/timeInterval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/timeout.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/timeoutWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/timestamp.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/toArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/toPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/window.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/windowCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/windowTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/windowToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/windowWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/withLatestFrom.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/add/operator/zipAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/ajax/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/ajax/package.json create mode 100644 day1/cli-study/node_modules/rxjs/src/fetch/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/fetch/package.json create mode 100644 day1/cli-study/node_modules/rxjs/src/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/interfaces.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal-compatibility/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal-compatibility/package.json create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/AsyncSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/BehaviorSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/InnerSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Notification.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Observable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Observer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Operator.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/OuterSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/ReplaySubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Rx.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Scheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Subject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/SubjectSubscription.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Subscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/Subscription.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/config.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/ConnectableObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/SubscribeOnObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/bindCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/bindNodeCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/defer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/AjaxObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/MiscJSDoc.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/WebSocketSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/ajax.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/fetch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/dom/webSocket.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/empty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/forkJoin.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/from.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromEvent.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromEventPattern.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/fromPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/generate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/iif.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/interval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/never.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/of.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/pairs.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/partition.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/range.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/throwError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/timer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/using.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/observable/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/audit.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/auditTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/buffer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/bufferCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/bufferTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/bufferToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/bufferWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/catchError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/combineAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/concatAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/concatMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/concatMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/count.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/debounce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/debounceTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/delay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/delayWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/dematerialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/distinct.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/elementAt.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/endWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/every.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/exhaust.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/exhaustMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/expand.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/filter.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/finalize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/find.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/findIndex.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/first.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/groupBy.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/ignoreElements.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/isEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/last.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/map.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/mapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/materialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/max.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/mergeAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/mergeMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/mergeMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/mergeScan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/min.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/multicast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/observeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/pairwise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/partition.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/pluck.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/publish.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/publishBehavior.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/publishLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/publishReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/reduce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/refCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/repeat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/repeatWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/retry.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/retryWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/sample.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/sampleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/scan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/sequenceEqual.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/share.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/shareReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/single.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/skip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/skipLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/skipUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/skipWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/startWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/subscribeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/switchAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/switchMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/switchMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/take.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/takeLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/takeUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/takeWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/tap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/throttle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/throttleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/throwIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/timeInterval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/timeout.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/timeoutWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/timestamp.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/toArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/window.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/windowCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/windowTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/windowToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/windowWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/withLatestFrom.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/operators/zipAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduled/scheduleArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduled/schedulePromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduled/scheduled.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/Action.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AsapAction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AsapScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AsyncAction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/QueueAction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/animationFrame.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/asap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/async.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/scheduler/queue.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/symbol/iterator.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/symbol/observable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/symbol/rxSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/ColdObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/HotObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/SubscriptionLog.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/TestMessage.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/testing/TestScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/types.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/umd.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/EmptyError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/Immediate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/TimeoutError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/applyMixins.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/canReportError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/errorObject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/hostReportError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/identity.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isArrayLike.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isDate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isFunction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isInteropObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isNumeric.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isObject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/isScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/noop.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/not.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/pipe.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/root.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeToArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeToIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeToObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeToPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/subscribeToResult.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/toSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/internal/util/tryCatch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ArrayLikeObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ArrayObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/BoundCallbackObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/BoundNodeCallbackObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ConnectableObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/DeferObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/EmptyObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ErrorObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ForkJoinObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/FromEventObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/FromEventPatternObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/FromObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/GenerateObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/IfObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/IntervalObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/IteratorObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/NeverObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/PairsObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/PromiseObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/RangeObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/ScalarObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/SubscribeOnObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/TimerObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/UsingObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/bindCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/bindNodeCallback.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/defer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/dom/AjaxObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/dom/WebSocketSubject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/dom/ajax.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/dom/webSocket.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/empty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/forkJoin.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/from.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/fromArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/fromEvent.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/fromEventPattern.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/fromIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/fromPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/generate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/if.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/interval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/never.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/of.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/pairs.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/range.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/throw.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/timer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/using.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/observable/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/audit.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/auditTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/buffer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/bufferCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/bufferTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/bufferToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/bufferWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/catch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/combineAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/concatAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/concatMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/concatMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/count.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/debounce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/debounceTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/defaultIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/delay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/delayWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/dematerialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/distinct.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/distinctUntilChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/distinctUntilKeyChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/do.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/elementAt.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/every.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/exhaust.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/exhaustMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/expand.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/filter.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/finally.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/find.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/findIndex.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/first.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/groupBy.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/ignoreElements.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/isEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/last.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/let.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/map.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/mapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/materialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/max.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/mergeAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/mergeMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/mergeMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/mergeScan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/min.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/multicast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/observeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/pairwise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/partition.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/pluck.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/publish.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/publishBehavior.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/publishLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/publishReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/reduce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/repeat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/repeatWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/retry.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/retryWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/sample.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/sampleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/scan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/sequenceEqual.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/share.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/shareReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/single.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/skip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/skipLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/skipUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/skipWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/startWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/subscribeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/switch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/switchMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/switchMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/take.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/takeLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/takeUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/takeWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/throttle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/throttleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/timeInterval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/timeout.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/timeoutWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/timestamp.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/toArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/toPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/window.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/windowCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/windowTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/windowToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/windowWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/withLatestFrom.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operator/zipAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/audit.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/auditTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/buffer.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/bufferCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/bufferTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/bufferToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/bufferWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/catchError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/combineAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/combineLatest.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/concat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/concatAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/concatMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/concatMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/count.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/debounce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/debounceTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/defaultIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/delay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/delayWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/dematerialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/distinct.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/distinctUntilChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/distinctUntilKeyChanged.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/elementAt.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/every.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/exhaust.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/exhaustMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/expand.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/filter.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/finalize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/find.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/findIndex.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/first.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/groupBy.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/ignoreElements.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/isEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/last.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/map.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/mapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/materialize.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/max.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/merge.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/mergeAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/mergeMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/mergeMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/mergeScan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/min.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/multicast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/observeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/onErrorResumeNext.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/package.json create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/pairwise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/partition.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/pluck.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/publish.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/publishBehavior.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/publishLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/publishReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/race.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/reduce.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/refCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/repeat.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/repeatWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/retry.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/retryWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/sample.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/sampleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/scan.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/sequenceEqual.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/share.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/shareReplay.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/single.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/skip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/skipLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/skipUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/skipWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/startWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/subscribeOn.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/switchAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/switchMap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/switchMapTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/take.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/takeLast.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/takeUntil.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/takeWhile.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/tap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/throttle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/throttleTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/throwIfEmpty.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/timeInterval.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/timeout.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/timeoutWith.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/timestamp.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/toArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/window.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/windowCount.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/windowTime.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/windowToggle.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/windowWhen.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/withLatestFrom.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/zip.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/operators/zipAll.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/scheduler/animationFrame.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/scheduler/asap.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/scheduler/async.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/scheduler/queue.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/symbol/iterator.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/symbol/observable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/symbol/rxSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/testing/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/testing/package.json create mode 100644 day1/cli-study/node_modules/rxjs/src/tsconfig.json create mode 100644 day1/cli-study/node_modules/rxjs/src/util/ArgumentOutOfRangeError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/EmptyError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/Immediate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/ObjectUnsubscribedError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/TimeoutError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/UnsubscriptionError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/applyMixins.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/errorObject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/hostReportError.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/identity.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isArrayLike.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isDate.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isFunction.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isNumeric.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isObject.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/isScheduler.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/noop.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/not.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/pipe.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/root.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeTo.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeToArray.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeToIterable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeToObservable.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeToPromise.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/subscribeToResult.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/toSubscriber.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/util/tryCatch.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/webSocket/index.ts create mode 100644 day1/cli-study/node_modules/rxjs/src/webSocket/package.json create mode 100644 day1/cli-study/node_modules/rxjs/symbol/iterator.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/symbol/iterator.js create mode 100644 day1/cli-study/node_modules/rxjs/symbol/iterator.js.map create mode 100644 day1/cli-study/node_modules/rxjs/symbol/observable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/symbol/observable.js create mode 100644 day1/cli-study/node_modules/rxjs/symbol/observable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/symbol/rxSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/symbol/rxSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/symbol/rxSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/testing/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/testing/index.js create mode 100644 day1/cli-study/node_modules/rxjs/testing/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/testing/package.json create mode 100644 day1/cli-study/node_modules/rxjs/util/ArgumentOutOfRangeError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/ArgumentOutOfRangeError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/ArgumentOutOfRangeError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/EmptyError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/EmptyError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/EmptyError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/Immediate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/Immediate.js create mode 100644 day1/cli-study/node_modules/rxjs/util/Immediate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/ObjectUnsubscribedError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/ObjectUnsubscribedError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/ObjectUnsubscribedError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/TimeoutError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/TimeoutError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/TimeoutError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/UnsubscriptionError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/UnsubscriptionError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/UnsubscriptionError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/applyMixins.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/applyMixins.js create mode 100644 day1/cli-study/node_modules/rxjs/util/applyMixins.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/errorObject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/errorObject.js create mode 100644 day1/cli-study/node_modules/rxjs/util/errorObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/hostReportError.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/hostReportError.js create mode 100644 day1/cli-study/node_modules/rxjs/util/hostReportError.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/identity.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/identity.js create mode 100644 day1/cli-study/node_modules/rxjs/util/identity.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isArray.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isArrayLike.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isArrayLike.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isArrayLike.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isDate.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isDate.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isDate.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isFunction.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isFunction.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isFunction.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isNumeric.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isNumeric.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isNumeric.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isObject.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isObject.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isObject.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/isScheduler.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/isScheduler.js create mode 100644 day1/cli-study/node_modules/rxjs/util/isScheduler.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/noop.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/noop.js create mode 100644 day1/cli-study/node_modules/rxjs/util/noop.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/not.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/not.js create mode 100644 day1/cli-study/node_modules/rxjs/util/not.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/pipe.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/pipe.js create mode 100644 day1/cli-study/node_modules/rxjs/util/pipe.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/root.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/root.js create mode 100644 day1/cli-study/node_modules/rxjs/util/root.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeTo.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeTo.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeTo.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToArray.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToArray.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToArray.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToIterable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToIterable.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToIterable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToObservable.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToObservable.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToObservable.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToPromise.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToPromise.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToPromise.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToResult.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToResult.js create mode 100644 day1/cli-study/node_modules/rxjs/util/subscribeToResult.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/toSubscriber.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/toSubscriber.js create mode 100644 day1/cli-study/node_modules/rxjs/util/toSubscriber.js.map create mode 100644 day1/cli-study/node_modules/rxjs/util/tryCatch.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/util/tryCatch.js create mode 100644 day1/cli-study/node_modules/rxjs/util/tryCatch.js.map create mode 100644 day1/cli-study/node_modules/rxjs/webSocket/index.d.ts create mode 100644 day1/cli-study/node_modules/rxjs/webSocket/index.js create mode 100644 day1/cli-study/node_modules/rxjs/webSocket/index.js.map create mode 100644 day1/cli-study/node_modules/rxjs/webSocket/package.json create mode 100644 day1/cli-study/node_modules/safe-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/safe-buffer/README.md create mode 100644 day1/cli-study/node_modules/safe-buffer/index.d.ts create mode 100644 day1/cli-study/node_modules/safe-buffer/index.js create mode 100644 day1/cli-study/node_modules/safe-buffer/package.json create mode 100644 day1/cli-study/node_modules/safer-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/safer-buffer/Porting-Buffer.md create mode 100644 day1/cli-study/node_modules/safer-buffer/Readme.md create mode 100644 day1/cli-study/node_modules/safer-buffer/dangerous.js create mode 100644 day1/cli-study/node_modules/safer-buffer/package.json create mode 100644 day1/cli-study/node_modules/safer-buffer/safer.js create mode 100644 day1/cli-study/node_modules/safer-buffer/tests.js create mode 100644 day1/cli-study/node_modules/seek-bzip/.npmignore create mode 100644 day1/cli-study/node_modules/seek-bzip/README.md create mode 100644 day1/cli-study/node_modules/seek-bzip/bin/seek-bunzip create mode 100644 day1/cli-study/node_modules/seek-bzip/bin/seek-bzip-table create mode 100644 day1/cli-study/node_modules/seek-bzip/lib/bitreader.js create mode 100644 day1/cli-study/node_modules/seek-bzip/lib/crc32.js create mode 100644 day1/cli-study/node_modules/seek-bzip/lib/index.js create mode 100644 day1/cli-study/node_modules/seek-bzip/lib/stream.js create mode 100644 day1/cli-study/node_modules/seek-bzip/node_modules/commander/History.md create mode 100644 day1/cli-study/node_modules/seek-bzip/node_modules/commander/LICENSE create mode 100644 day1/cli-study/node_modules/seek-bzip/node_modules/commander/Readme.md create mode 100644 day1/cli-study/node_modules/seek-bzip/node_modules/commander/index.js create mode 100644 day1/cli-study/node_modules/seek-bzip/node_modules/commander/package.json create mode 100644 day1/cli-study/node_modules/seek-bzip/package.json create mode 100644 day1/cli-study/node_modules/semver/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/semver/LICENSE create mode 100644 day1/cli-study/node_modules/semver/README.md create mode 100644 day1/cli-study/node_modules/semver/bin/semver.js create mode 100644 day1/cli-study/node_modules/semver/classes/comparator.js create mode 100644 day1/cli-study/node_modules/semver/classes/index.js create mode 100644 day1/cli-study/node_modules/semver/classes/range.js create mode 100644 day1/cli-study/node_modules/semver/classes/semver.js create mode 100644 day1/cli-study/node_modules/semver/functions/clean.js create mode 100644 day1/cli-study/node_modules/semver/functions/cmp.js create mode 100644 day1/cli-study/node_modules/semver/functions/coerce.js create mode 100644 day1/cli-study/node_modules/semver/functions/compare-build.js create mode 100644 day1/cli-study/node_modules/semver/functions/compare-loose.js create mode 100644 day1/cli-study/node_modules/semver/functions/compare.js create mode 100644 day1/cli-study/node_modules/semver/functions/diff.js create mode 100644 day1/cli-study/node_modules/semver/functions/eq.js create mode 100644 day1/cli-study/node_modules/semver/functions/gt.js create mode 100644 day1/cli-study/node_modules/semver/functions/gte.js create mode 100644 day1/cli-study/node_modules/semver/functions/inc.js create mode 100644 day1/cli-study/node_modules/semver/functions/lt.js create mode 100644 day1/cli-study/node_modules/semver/functions/lte.js create mode 100644 day1/cli-study/node_modules/semver/functions/major.js create mode 100644 day1/cli-study/node_modules/semver/functions/minor.js create mode 100644 day1/cli-study/node_modules/semver/functions/neq.js create mode 100644 day1/cli-study/node_modules/semver/functions/parse.js create mode 100644 day1/cli-study/node_modules/semver/functions/patch.js create mode 100644 day1/cli-study/node_modules/semver/functions/prerelease.js create mode 100644 day1/cli-study/node_modules/semver/functions/rcompare.js create mode 100644 day1/cli-study/node_modules/semver/functions/rsort.js create mode 100644 day1/cli-study/node_modules/semver/functions/satisfies.js create mode 100644 day1/cli-study/node_modules/semver/functions/sort.js create mode 100644 day1/cli-study/node_modules/semver/functions/valid.js create mode 100644 day1/cli-study/node_modules/semver/index.js create mode 100644 day1/cli-study/node_modules/semver/internal/constants.js create mode 100644 day1/cli-study/node_modules/semver/internal/debug.js create mode 100644 day1/cli-study/node_modules/semver/internal/identifiers.js create mode 100644 day1/cli-study/node_modules/semver/internal/re.js create mode 100644 day1/cli-study/node_modules/semver/package.json create mode 100644 day1/cli-study/node_modules/semver/preload.js create mode 100644 day1/cli-study/node_modules/semver/range.bnf create mode 100644 day1/cli-study/node_modules/semver/ranges/gtr.js create mode 100644 day1/cli-study/node_modules/semver/ranges/intersects.js create mode 100644 day1/cli-study/node_modules/semver/ranges/ltr.js create mode 100644 day1/cli-study/node_modules/semver/ranges/max-satisfying.js create mode 100644 day1/cli-study/node_modules/semver/ranges/min-satisfying.js create mode 100644 day1/cli-study/node_modules/semver/ranges/min-version.js create mode 100644 day1/cli-study/node_modules/semver/ranges/outside.js create mode 100644 day1/cli-study/node_modules/semver/ranges/simplify.js create mode 100644 day1/cli-study/node_modules/semver/ranges/subset.js create mode 100644 day1/cli-study/node_modules/semver/ranges/to-comparators.js create mode 100644 day1/cli-study/node_modules/semver/ranges/valid.js create mode 100644 day1/cli-study/node_modules/shebang-command/index.js create mode 100644 day1/cli-study/node_modules/shebang-command/license create mode 100644 day1/cli-study/node_modules/shebang-command/package.json create mode 100644 day1/cli-study/node_modules/shebang-command/readme.md create mode 100644 day1/cli-study/node_modules/shebang-regex/index.d.ts create mode 100644 day1/cli-study/node_modules/shebang-regex/index.js create mode 100644 day1/cli-study/node_modules/shebang-regex/license create mode 100644 day1/cli-study/node_modules/shebang-regex/package.json create mode 100644 day1/cli-study/node_modules/shebang-regex/readme.md create mode 100644 day1/cli-study/node_modules/signal-exit/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/signal-exit/LICENSE.txt create mode 100644 day1/cli-study/node_modules/signal-exit/README.md create mode 100644 day1/cli-study/node_modules/signal-exit/index.js create mode 100644 day1/cli-study/node_modules/signal-exit/package.json create mode 100644 day1/cli-study/node_modules/signal-exit/signals.js create mode 100644 day1/cli-study/node_modules/slice-ansi/index.js create mode 100644 day1/cli-study/node_modules/slice-ansi/license create mode 100644 day1/cli-study/node_modules/slice-ansi/package.json create mode 100644 day1/cli-study/node_modules/slice-ansi/readme.md create mode 100644 day1/cli-study/node_modules/sort-keys-length/LICENSE.md create mode 100644 day1/cli-study/node_modules/sort-keys-length/README.md create mode 100644 day1/cli-study/node_modules/sort-keys-length/index.js create mode 100644 day1/cli-study/node_modules/sort-keys-length/package.json create mode 100644 day1/cli-study/node_modules/sort-keys/index.js create mode 100644 day1/cli-study/node_modules/sort-keys/license create mode 100644 day1/cli-study/node_modules/sort-keys/package.json create mode 100644 day1/cli-study/node_modules/sort-keys/readme.md create mode 100644 day1/cli-study/node_modules/spdx-correct/LICENSE create mode 100644 day1/cli-study/node_modules/spdx-correct/README.md create mode 100644 day1/cli-study/node_modules/spdx-correct/index.js create mode 100644 day1/cli-study/node_modules/spdx-correct/package.json create mode 100644 day1/cli-study/node_modules/spdx-exceptions/README.md create mode 100644 day1/cli-study/node_modules/spdx-exceptions/index.json create mode 100644 day1/cli-study/node_modules/spdx-exceptions/package.json create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/AUTHORS create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/LICENSE create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/README.md create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/index.js create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/package.json create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/parse.js create mode 100644 day1/cli-study/node_modules/spdx-expression-parse/scan.js create mode 100644 day1/cli-study/node_modules/spdx-license-ids/README.md create mode 100644 day1/cli-study/node_modules/spdx-license-ids/deprecated.json create mode 100644 day1/cli-study/node_modules/spdx-license-ids/index.json create mode 100644 day1/cli-study/node_modules/spdx-license-ids/package.json create mode 100644 day1/cli-study/node_modules/sprintf-js/.npmignore create mode 100644 day1/cli-study/node_modules/sprintf-js/LICENSE create mode 100644 day1/cli-study/node_modules/sprintf-js/README.md create mode 100644 day1/cli-study/node_modules/sprintf-js/bower.json create mode 100644 day1/cli-study/node_modules/sprintf-js/demo/angular.html create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/angular-sprintf.min.js.map create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/sprintf.min.js.map create mode 100644 day1/cli-study/node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 day1/cli-study/node_modules/sprintf-js/gruntfile.js create mode 100644 day1/cli-study/node_modules/sprintf-js/package.json create mode 100644 day1/cli-study/node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 day1/cli-study/node_modules/sprintf-js/src/sprintf.js create mode 100644 day1/cli-study/node_modules/sprintf-js/test/test.js create mode 100644 day1/cli-study/node_modules/stat-mode/.npmignore create mode 100644 day1/cli-study/node_modules/stat-mode/.travis.yml create mode 100644 day1/cli-study/node_modules/stat-mode/History.md create mode 100644 day1/cli-study/node_modules/stat-mode/README.md create mode 100644 day1/cli-study/node_modules/stat-mode/index.js create mode 100644 day1/cli-study/node_modules/stat-mode/package.json create mode 100644 day1/cli-study/node_modules/stat-mode/test/test.js create mode 100644 day1/cli-study/node_modules/strict-uri-encode/index.js create mode 100644 day1/cli-study/node_modules/strict-uri-encode/license create mode 100644 day1/cli-study/node_modules/strict-uri-encode/package.json create mode 100644 day1/cli-study/node_modules/strict-uri-encode/readme.md create mode 100644 day1/cli-study/node_modules/string-width/index.js create mode 100644 day1/cli-study/node_modules/string-width/license create mode 100644 day1/cli-study/node_modules/string-width/node_modules/ansi-regex/index.js create mode 100644 day1/cli-study/node_modules/string-width/node_modules/ansi-regex/license create mode 100644 day1/cli-study/node_modules/string-width/node_modules/ansi-regex/package.json create mode 100644 day1/cli-study/node_modules/string-width/node_modules/ansi-regex/readme.md create mode 100644 day1/cli-study/node_modules/string-width/node_modules/strip-ansi/index.d.ts create mode 100644 day1/cli-study/node_modules/string-width/node_modules/strip-ansi/index.js create mode 100644 day1/cli-study/node_modules/string-width/node_modules/strip-ansi/license create mode 100644 day1/cli-study/node_modules/string-width/node_modules/strip-ansi/package.json create mode 100644 day1/cli-study/node_modules/string-width/node_modules/strip-ansi/readme.md create mode 100644 day1/cli-study/node_modules/string-width/package.json create mode 100644 day1/cli-study/node_modules/string-width/readme.md create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/.editorconfig create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/.eslintrc create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/.travis.yml create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/LICENSE create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/README.md create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/auto.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/implementation.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/index.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/package.json create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/polyfill.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/shim.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/test/index.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/test/shimmed.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimend/test/tests.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/.editorconfig create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/.eslintrc create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/.github/workflows/rebase.yml create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/.travis.yml create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/LICENSE create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/README.md create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/auto.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/implementation.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/index.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/package.json create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/polyfill.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/shim.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/test/index.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/test/shimmed.js create mode 100644 day1/cli-study/node_modules/string.prototype.trimstart/test/tests.js create mode 100644 day1/cli-study/node_modules/string_decoder/.travis.yml create mode 100644 day1/cli-study/node_modules/string_decoder/LICENSE create mode 100644 day1/cli-study/node_modules/string_decoder/README.md create mode 100644 day1/cli-study/node_modules/string_decoder/lib/string_decoder.js create mode 100644 day1/cli-study/node_modules/string_decoder/node_modules/safe-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/string_decoder/node_modules/safe-buffer/README.md create mode 100644 day1/cli-study/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts create mode 100644 day1/cli-study/node_modules/string_decoder/node_modules/safe-buffer/index.js create mode 100644 day1/cli-study/node_modules/string_decoder/node_modules/safe-buffer/package.json create mode 100644 day1/cli-study/node_modules/string_decoder/package.json create mode 100644 day1/cli-study/node_modules/strip-ansi/index.d.ts create mode 100644 day1/cli-study/node_modules/strip-ansi/index.js create mode 100644 day1/cli-study/node_modules/strip-ansi/license create mode 100644 day1/cli-study/node_modules/strip-ansi/package.json create mode 100644 day1/cli-study/node_modules/strip-ansi/readme.md create mode 100644 day1/cli-study/node_modules/strip-bom/index.js create mode 100644 day1/cli-study/node_modules/strip-bom/license create mode 100644 day1/cli-study/node_modules/strip-bom/package.json create mode 100644 day1/cli-study/node_modules/strip-bom/readme.md create mode 100644 day1/cli-study/node_modules/strip-dirs/LICENSE create mode 100644 day1/cli-study/node_modules/strip-dirs/README.md create mode 100644 day1/cli-study/node_modules/strip-dirs/index.js create mode 100644 day1/cli-study/node_modules/strip-dirs/package.json create mode 100644 day1/cli-study/node_modules/strip-json-comments/index.d.ts create mode 100644 day1/cli-study/node_modules/strip-json-comments/index.js create mode 100644 day1/cli-study/node_modules/strip-json-comments/license create mode 100644 day1/cli-study/node_modules/strip-json-comments/package.json create mode 100644 day1/cli-study/node_modules/strip-json-comments/readme.md create mode 100644 day1/cli-study/node_modules/strip-outer/index.js create mode 100644 day1/cli-study/node_modules/strip-outer/license create mode 100644 day1/cli-study/node_modules/strip-outer/package.json create mode 100644 day1/cli-study/node_modules/strip-outer/readme.md create mode 100644 day1/cli-study/node_modules/supports-color/browser.js create mode 100644 day1/cli-study/node_modules/supports-color/index.js create mode 100644 day1/cli-study/node_modules/supports-color/license create mode 100644 day1/cli-study/node_modules/supports-color/package.json create mode 100644 day1/cli-study/node_modules/supports-color/readme.md create mode 100644 day1/cli-study/node_modules/table/LICENSE create mode 100644 day1/cli-study/node_modules/table/README.md create mode 100644 day1/cli-study/node_modules/table/dist/alignString.js create mode 100644 day1/cli-study/node_modules/table/dist/alignString.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/alignString.js.map create mode 100644 day1/cli-study/node_modules/table/dist/alignTableData.js create mode 100644 day1/cli-study/node_modules/table/dist/alignTableData.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/alignTableData.js.map create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellHeight.js create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellHeight.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellHeight.js.map create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellWidthIndex.js create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellWidthIndex.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/calculateCellWidthIndex.js.map create mode 100644 day1/cli-study/node_modules/table/dist/calculateMaximumColumnWidthIndex.js create mode 100644 day1/cli-study/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map create mode 100644 day1/cli-study/node_modules/table/dist/calculateRowHeightIndex.js create mode 100644 day1/cli-study/node_modules/table/dist/calculateRowHeightIndex.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/calculateRowHeightIndex.js.map create mode 100644 day1/cli-study/node_modules/table/dist/createStream.js create mode 100644 day1/cli-study/node_modules/table/dist/createStream.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/createStream.js.map create mode 100644 day1/cli-study/node_modules/table/dist/drawBorder.js create mode 100644 day1/cli-study/node_modules/table/dist/drawBorder.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/drawBorder.js.map create mode 100644 day1/cli-study/node_modules/table/dist/drawRow.js create mode 100644 day1/cli-study/node_modules/table/dist/drawRow.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/drawRow.js.map create mode 100644 day1/cli-study/node_modules/table/dist/drawTable.js create mode 100644 day1/cli-study/node_modules/table/dist/drawTable.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/drawTable.js.map create mode 100644 day1/cli-study/node_modules/table/dist/getBorderCharacters.js create mode 100644 day1/cli-study/node_modules/table/dist/getBorderCharacters.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/getBorderCharacters.js.map create mode 100644 day1/cli-study/node_modules/table/dist/index.js create mode 100644 day1/cli-study/node_modules/table/dist/index.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/index.js.map create mode 100644 day1/cli-study/node_modules/table/dist/makeConfig.js create mode 100644 day1/cli-study/node_modules/table/dist/makeConfig.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/makeConfig.js.map create mode 100644 day1/cli-study/node_modules/table/dist/makeStreamConfig.js create mode 100644 day1/cli-study/node_modules/table/dist/makeStreamConfig.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/makeStreamConfig.js.map create mode 100644 day1/cli-study/node_modules/table/dist/mapDataUsingRowHeightIndex.js create mode 100644 day1/cli-study/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map create mode 100644 day1/cli-study/node_modules/table/dist/padTableData.js create mode 100644 day1/cli-study/node_modules/table/dist/padTableData.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/padTableData.js.map create mode 100644 day1/cli-study/node_modules/table/dist/schemas/config.json create mode 100644 day1/cli-study/node_modules/table/dist/schemas/streamConfig.json create mode 100644 day1/cli-study/node_modules/table/dist/stringifyTableData.js create mode 100644 day1/cli-study/node_modules/table/dist/stringifyTableData.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/stringifyTableData.js.map create mode 100644 day1/cli-study/node_modules/table/dist/table.js create mode 100644 day1/cli-study/node_modules/table/dist/table.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/table.js.map create mode 100644 day1/cli-study/node_modules/table/dist/truncateTableData.js create mode 100644 day1/cli-study/node_modules/table/dist/truncateTableData.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/truncateTableData.js.map create mode 100644 day1/cli-study/node_modules/table/dist/validateConfig.js create mode 100644 day1/cli-study/node_modules/table/dist/validateConfig.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/validateConfig.js.map create mode 100644 day1/cli-study/node_modules/table/dist/validateStreamConfig.js create mode 100644 day1/cli-study/node_modules/table/dist/validateTableData.js create mode 100644 day1/cli-study/node_modules/table/dist/validateTableData.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/validateTableData.js.map create mode 100644 day1/cli-study/node_modules/table/dist/wrapCell.js create mode 100644 day1/cli-study/node_modules/table/dist/wrapCell.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/wrapCell.js.map create mode 100644 day1/cli-study/node_modules/table/dist/wrapString.js create mode 100644 day1/cli-study/node_modules/table/dist/wrapString.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/wrapString.js.map create mode 100644 day1/cli-study/node_modules/table/dist/wrapWord.js create mode 100644 day1/cli-study/node_modules/table/dist/wrapWord.js.flow create mode 100644 day1/cli-study/node_modules/table/dist/wrapWord.js.map create mode 100644 day1/cli-study/node_modules/table/package.json create mode 100644 day1/cli-study/node_modules/tar-stream/LICENSE create mode 100644 day1/cli-study/node_modules/tar-stream/README.md create mode 100644 day1/cli-study/node_modules/tar-stream/extract.js create mode 100644 day1/cli-study/node_modules/tar-stream/headers.js create mode 100644 day1/cli-study/node_modules/tar-stream/index.js create mode 100644 day1/cli-study/node_modules/tar-stream/pack.js create mode 100644 day1/cli-study/node_modules/tar-stream/package.json create mode 100644 day1/cli-study/node_modules/text-table/.travis.yml create mode 100644 day1/cli-study/node_modules/text-table/LICENSE create mode 100644 day1/cli-study/node_modules/text-table/example/align.js create mode 100644 day1/cli-study/node_modules/text-table/example/center.js create mode 100644 day1/cli-study/node_modules/text-table/example/dotalign.js create mode 100644 day1/cli-study/node_modules/text-table/example/doubledot.js create mode 100644 day1/cli-study/node_modules/text-table/example/table.js create mode 100644 day1/cli-study/node_modules/text-table/index.js create mode 100644 day1/cli-study/node_modules/text-table/package.json create mode 100644 day1/cli-study/node_modules/text-table/readme.markdown create mode 100644 day1/cli-study/node_modules/text-table/test/align.js create mode 100644 day1/cli-study/node_modules/text-table/test/ansi-colors.js create mode 100644 day1/cli-study/node_modules/text-table/test/center.js create mode 100644 day1/cli-study/node_modules/text-table/test/dotalign.js create mode 100644 day1/cli-study/node_modules/text-table/test/doubledot.js create mode 100644 day1/cli-study/node_modules/text-table/test/table.js create mode 100644 day1/cli-study/node_modules/through/.travis.yml create mode 100644 day1/cli-study/node_modules/through/LICENSE.APACHE2 create mode 100644 day1/cli-study/node_modules/through/LICENSE.MIT create mode 100644 day1/cli-study/node_modules/through/index.js create mode 100644 day1/cli-study/node_modules/through/package.json create mode 100644 day1/cli-study/node_modules/through/readme.markdown create mode 100644 day1/cli-study/node_modules/through/test/async.js create mode 100644 day1/cli-study/node_modules/through/test/auto-destroy.js create mode 100644 day1/cli-study/node_modules/through/test/buffering.js create mode 100644 day1/cli-study/node_modules/through/test/end.js create mode 100644 day1/cli-study/node_modules/through/test/index.js create mode 100644 day1/cli-study/node_modules/thunkify-wrap/.npmignore create mode 100644 day1/cli-study/node_modules/thunkify-wrap/History.md create mode 100644 day1/cli-study/node_modules/thunkify-wrap/Readme.md create mode 100644 day1/cli-study/node_modules/thunkify-wrap/benchmark/base.js create mode 100644 day1/cli-study/node_modules/thunkify-wrap/example.js create mode 100644 day1/cli-study/node_modules/thunkify-wrap/genify.js create mode 100644 day1/cli-study/node_modules/thunkify-wrap/index.js create mode 100644 day1/cli-study/node_modules/thunkify-wrap/package.json create mode 100644 day1/cli-study/node_modules/thunkify/.npmignore create mode 100644 day1/cli-study/node_modules/thunkify/History.md create mode 100644 day1/cli-study/node_modules/thunkify/Makefile create mode 100644 day1/cli-study/node_modules/thunkify/Readme.md create mode 100644 day1/cli-study/node_modules/thunkify/index.js create mode 100644 day1/cli-study/node_modules/thunkify/package.json create mode 100644 day1/cli-study/node_modules/thunkify/test/index.js create mode 100644 day1/cli-study/node_modules/timed-out/index.js create mode 100644 day1/cli-study/node_modules/timed-out/license create mode 100644 day1/cli-study/node_modules/timed-out/package.json create mode 100644 day1/cli-study/node_modules/timed-out/readme.md create mode 100644 day1/cli-study/node_modules/tmp/LICENSE create mode 100644 day1/cli-study/node_modules/tmp/README.md create mode 100644 day1/cli-study/node_modules/tmp/lib/tmp.js create mode 100644 day1/cli-study/node_modules/tmp/package.json create mode 100644 day1/cli-study/node_modules/to-buffer/.travis.yml create mode 100644 day1/cli-study/node_modules/to-buffer/LICENSE create mode 100644 day1/cli-study/node_modules/to-buffer/README.md create mode 100644 day1/cli-study/node_modules/to-buffer/index.js create mode 100644 day1/cli-study/node_modules/to-buffer/package.json create mode 100644 day1/cli-study/node_modules/to-buffer/test.js create mode 100644 day1/cli-study/node_modules/toml/.jshintrc create mode 100644 day1/cli-study/node_modules/toml/.travis.yml create mode 100644 day1/cli-study/node_modules/toml/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/toml/LICENSE create mode 100644 day1/cli-study/node_modules/toml/README.md create mode 100644 day1/cli-study/node_modules/toml/benchmark.js create mode 100644 day1/cli-study/node_modules/toml/index.d.ts create mode 100644 day1/cli-study/node_modules/toml/index.js create mode 100644 day1/cli-study/node_modules/toml/lib/compiler.js create mode 100644 day1/cli-study/node_modules/toml/lib/parser.js create mode 100644 day1/cli-study/node_modules/toml/package.json create mode 100644 day1/cli-study/node_modules/toml/src/toml.pegjs create mode 100644 day1/cli-study/node_modules/toml/test/bad.toml create mode 100644 day1/cli-study/node_modules/toml/test/example.toml create mode 100644 day1/cli-study/node_modules/toml/test/hard_example.toml create mode 100644 day1/cli-study/node_modules/toml/test/inline_tables.toml create mode 100644 day1/cli-study/node_modules/toml/test/literal_strings.toml create mode 100644 day1/cli-study/node_modules/toml/test/multiline_eat_whitespace.toml create mode 100644 day1/cli-study/node_modules/toml/test/multiline_literal_strings.toml create mode 100644 day1/cli-study/node_modules/toml/test/multiline_strings.toml create mode 100644 day1/cli-study/node_modules/toml/test/smoke.js create mode 100644 day1/cli-study/node_modules/toml/test/table_arrays_easy.toml create mode 100644 day1/cli-study/node_modules/toml/test/table_arrays_hard.toml create mode 100644 day1/cli-study/node_modules/toml/test/test_toml.js create mode 100644 day1/cli-study/node_modules/trim-repeated/index.js create mode 100644 day1/cli-study/node_modules/trim-repeated/license create mode 100644 day1/cli-study/node_modules/trim-repeated/package.json create mode 100644 day1/cli-study/node_modules/trim-repeated/readme.md create mode 100644 day1/cli-study/node_modules/tsconfig-paths/.nycrc.json create mode 100644 day1/cli-study/node_modules/tsconfig-paths/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/tsconfig-paths/LICENSE create mode 100644 day1/cli-study/node_modules/tsconfig-paths/README.md create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/config-loader.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/config-loader.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/filesystem.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/filesystem.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/index.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/index.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/mapping-entry.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/mapping-entry.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/match-path-async.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/match-path-async.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/match-path-sync.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/match-path-sync.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/options.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/options.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/register.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/register.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/try-path.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/try-path.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/tsconfig-loader.d.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/lib/tsconfig-loader.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/package.json create mode 100644 day1/cli-study/node_modules/tsconfig-paths/register.js create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/config-loader-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/data/match-path-data.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/filesystem-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/mapping-entry-test.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/match-path-async-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/match-path-sync-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/mocha.opts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/try-path-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/tsconfig-loader-tests.ts create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/tsconfig-named.json create mode 100644 day1/cli-study/node_modules/tsconfig-paths/test/tsconfig.json create mode 100644 day1/cli-study/node_modules/tsconfig-paths/tslint.json create mode 100644 day1/cli-study/node_modules/tslib/CopyrightNotice.txt create mode 100644 day1/cli-study/node_modules/tslib/LICENSE.txt create mode 100644 day1/cli-study/node_modules/tslib/README.md create mode 100644 day1/cli-study/node_modules/tslib/package.json create mode 100644 day1/cli-study/node_modules/tslib/tslib.d.ts create mode 100644 day1/cli-study/node_modules/tslib/tslib.es6.html create mode 100644 day1/cli-study/node_modules/tslib/tslib.es6.js create mode 100644 day1/cli-study/node_modules/tslib/tslib.html create mode 100644 day1/cli-study/node_modules/tslib/tslib.js create mode 100644 day1/cli-study/node_modules/tunnel-agent/LICENSE create mode 100644 day1/cli-study/node_modules/tunnel-agent/README.md create mode 100644 day1/cli-study/node_modules/tunnel-agent/index.js create mode 100644 day1/cli-study/node_modules/tunnel-agent/package.json create mode 100644 day1/cli-study/node_modules/type-check/LICENSE create mode 100644 day1/cli-study/node_modules/type-check/README.md create mode 100644 day1/cli-study/node_modules/type-check/lib/check.js create mode 100644 day1/cli-study/node_modules/type-check/lib/index.js create mode 100644 day1/cli-study/node_modules/type-check/lib/parse-type.js create mode 100644 day1/cli-study/node_modules/type-check/package.json create mode 100644 day1/cli-study/node_modules/type-fest/index.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/license create mode 100644 day1/cli-study/node_modules/type-fest/package.json create mode 100644 day1/cli-study/node_modules/type-fest/readme.md create mode 100644 day1/cli-study/node_modules/type-fest/source/basic.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/except.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/literal-union.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/merge.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/mutable.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/opaque.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/package-json.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/partial-deep.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/promisable.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/set-optional.d.ts create mode 100644 day1/cli-study/node_modules/type-fest/source/set-required.d.ts create mode 100644 day1/cli-study/node_modules/unbzip2-stream/LICENSE create mode 100644 day1/cli-study/node_modules/unbzip2-stream/README.md create mode 100644 day1/cli-study/node_modules/unbzip2-stream/dist/unbzip2-stream.min.js create mode 100644 day1/cli-study/node_modules/unbzip2-stream/index.js create mode 100644 day1/cli-study/node_modules/unbzip2-stream/lib/bit_iterator.js create mode 100644 day1/cli-study/node_modules/unbzip2-stream/lib/bzip2.js create mode 100644 day1/cli-study/node_modules/unbzip2-stream/package.json create mode 100644 day1/cli-study/node_modules/unyield/.npmignore create mode 100644 day1/cli-study/node_modules/unyield/History.md create mode 100644 day1/cli-study/node_modules/unyield/Makefile create mode 100644 day1/cli-study/node_modules/unyield/Readme.md create mode 100644 day1/cli-study/node_modules/unyield/index.js create mode 100644 day1/cli-study/node_modules/unyield/package.json create mode 100644 day1/cli-study/node_modules/uri-js/README.md create mode 100644 day1/cli-study/node_modules/uri-js/bower.json create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.min.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/index.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/index.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/index.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/http.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/https.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/uri.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/uri.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/uri.js.map create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/util.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/util.js create mode 100644 day1/cli-study/node_modules/uri-js/dist/esnext/util.js.map create mode 100644 day1/cli-study/node_modules/uri-js/package.json create mode 100644 day1/cli-study/node_modules/uri-js/rollup.config.js create mode 100644 day1/cli-study/node_modules/uri-js/src/index.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/punycode.d.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/regexps-iri.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/regexps-uri.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/schemes/http.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/schemes/https.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/schemes/mailto.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/schemes/urn-uuid.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/schemes/urn.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/uri.ts create mode 100644 day1/cli-study/node_modules/uri-js/src/util.ts create mode 100644 day1/cli-study/node_modules/uri-js/tests/qunit.css create mode 100644 day1/cli-study/node_modules/uri-js/tests/qunit.js create mode 100644 day1/cli-study/node_modules/uri-js/tests/test-es5-min.html create mode 100644 day1/cli-study/node_modules/uri-js/tests/test-es5.html create mode 100644 day1/cli-study/node_modules/uri-js/tests/tests.js create mode 100644 day1/cli-study/node_modules/uri-js/tsconfig.json create mode 100644 day1/cli-study/node_modules/uri-js/yarn.lock create mode 100644 day1/cli-study/node_modules/url-parse-lax/index.js create mode 100644 day1/cli-study/node_modules/url-parse-lax/license create mode 100644 day1/cli-study/node_modules/url-parse-lax/package.json create mode 100644 day1/cli-study/node_modules/url-parse-lax/readme.md create mode 100644 day1/cli-study/node_modules/url-to-options/LICENSE create mode 100644 day1/cli-study/node_modules/url-to-options/README.md create mode 100644 day1/cli-study/node_modules/url-to-options/index.js create mode 100644 day1/cli-study/node_modules/url-to-options/package.json create mode 100644 day1/cli-study/node_modules/util-deprecate/History.md create mode 100644 day1/cli-study/node_modules/util-deprecate/LICENSE create mode 100644 day1/cli-study/node_modules/util-deprecate/README.md create mode 100644 day1/cli-study/node_modules/util-deprecate/browser.js create mode 100644 day1/cli-study/node_modules/util-deprecate/node.js create mode 100644 day1/cli-study/node_modules/util-deprecate/package.json create mode 100644 day1/cli-study/node_modules/v8-compile-cache/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/v8-compile-cache/LICENSE create mode 100644 day1/cli-study/node_modules/v8-compile-cache/README.md create mode 100644 day1/cli-study/node_modules/v8-compile-cache/package.json create mode 100644 day1/cli-study/node_modules/v8-compile-cache/v8-compile-cache.js create mode 100644 day1/cli-study/node_modules/validate-npm-package-license/LICENSE create mode 100644 day1/cli-study/node_modules/validate-npm-package-license/README.md create mode 100644 day1/cli-study/node_modules/validate-npm-package-license/index.js create mode 100644 day1/cli-study/node_modules/validate-npm-package-license/package.json create mode 100644 day1/cli-study/node_modules/ware/History.md create mode 100644 day1/cli-study/node_modules/ware/Readme.md create mode 100644 day1/cli-study/node_modules/ware/lib/index.js create mode 100644 day1/cli-study/node_modules/ware/package.json create mode 100644 day1/cli-study/node_modules/wcwidth/.npmignore create mode 100644 day1/cli-study/node_modules/wcwidth/LICENSE create mode 100644 day1/cli-study/node_modules/wcwidth/Readme.md create mode 100644 day1/cli-study/node_modules/wcwidth/combining.js create mode 100644 day1/cli-study/node_modules/wcwidth/docs/index.md create mode 100644 day1/cli-study/node_modules/wcwidth/index.js create mode 100644 day1/cli-study/node_modules/wcwidth/package.json create mode 100644 day1/cli-study/node_modules/wcwidth/test/index.js create mode 100644 day1/cli-study/node_modules/which/CHANGELOG.md create mode 100644 day1/cli-study/node_modules/which/LICENSE create mode 100644 day1/cli-study/node_modules/which/README.md create mode 100644 day1/cli-study/node_modules/which/bin/node-which create mode 100644 day1/cli-study/node_modules/which/package.json create mode 100644 day1/cli-study/node_modules/which/which.js create mode 100644 day1/cli-study/node_modules/win-fork/.npmignore create mode 100644 day1/cli-study/node_modules/win-fork/README.md create mode 100644 day1/cli-study/node_modules/win-fork/bin/win-line-endings create mode 100644 day1/cli-study/node_modules/win-fork/bin/win-spawn create mode 100644 day1/cli-study/node_modules/win-fork/index.js create mode 100644 day1/cli-study/node_modules/win-fork/package.json create mode 100644 day1/cli-study/node_modules/word-wrap/LICENSE create mode 100644 day1/cli-study/node_modules/word-wrap/README.md create mode 100644 day1/cli-study/node_modules/word-wrap/index.d.ts create mode 100644 day1/cli-study/node_modules/word-wrap/index.js create mode 100644 day1/cli-study/node_modules/word-wrap/package.json create mode 100644 day1/cli-study/node_modules/wrap-fn/History.md create mode 100644 day1/cli-study/node_modules/wrap-fn/Readme.md create mode 100644 day1/cli-study/node_modules/wrap-fn/index.js create mode 100644 day1/cli-study/node_modules/wrap-fn/package.json create mode 100644 day1/cli-study/node_modules/wrappy/LICENSE create mode 100644 day1/cli-study/node_modules/wrappy/README.md create mode 100644 day1/cli-study/node_modules/wrappy/package.json create mode 100644 day1/cli-study/node_modules/wrappy/wrappy.js create mode 100644 day1/cli-study/node_modules/write/LICENSE create mode 100644 day1/cli-study/node_modules/write/README.md create mode 100644 day1/cli-study/node_modules/write/index.js create mode 100644 day1/cli-study/node_modules/write/package.json create mode 100644 day1/cli-study/node_modules/xtend/.jshintrc create mode 100644 day1/cli-study/node_modules/xtend/LICENSE create mode 100644 day1/cli-study/node_modules/xtend/README.md create mode 100644 day1/cli-study/node_modules/xtend/immutable.js create mode 100644 day1/cli-study/node_modules/xtend/mutable.js create mode 100644 day1/cli-study/node_modules/xtend/package.json create mode 100644 day1/cli-study/node_modules/xtend/test.js create mode 100644 day1/cli-study/node_modules/yauzl/LICENSE create mode 100644 day1/cli-study/node_modules/yauzl/README.md create mode 100644 day1/cli-study/node_modules/yauzl/index.js create mode 100644 day1/cli-study/node_modules/yauzl/package.json create mode 100644 day1/cli-study/package-lock.json create mode 100644 day1/cli-study/package.json create mode 100644 day1/cli-study/src/constants.js create mode 100644 day1/cli-study/src/create.js create mode 100644 day1/cli-study/src/main.js create mode 100644 day1/repos.json diff --git a/day1/cli-study/.eslintrc.js b/day1/cli-study/.eslintrc.js new file mode 100644 index 0000000..0c325bb --- /dev/null +++ b/day1/cli-study/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2020: true, + }, + extends: [ + 'airbnb-base', + ], + parserOptions: { + ecmaVersion: 11, + }, + rules: { + "no-console": "off" + }, +}; diff --git a/day1/cli-study/bin/www b/day1/cli-study/bin/www new file mode 100644 index 0000000..7aa58df --- /dev/null +++ b/day1/cli-study/bin/www @@ -0,0 +1,3 @@ +#! /usr/bin/env node + +require('../src/main.js'); \ No newline at end of file diff --git a/day1/cli-study/node_modules/.bin/_metalsmith b/day1/cli-study/node_modules/.bin/_metalsmith new file mode 100644 index 0000000..e1fd8c0 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/_metalsmith @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../metalsmith/bin/_metalsmith" "$@" + ret=$? +else + node "$basedir/../metalsmith/bin/_metalsmith" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/_metalsmith.cmd b/day1/cli-study/node_modules/.bin/_metalsmith.cmd new file mode 100644 index 0000000..4cf59d6 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/_metalsmith.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\metalsmith\bin\_metalsmith" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/_metalsmith.ps1 b/day1/cli-study/node_modules/.bin/_metalsmith.ps1 new file mode 100644 index 0000000..ab1248b --- /dev/null +++ b/day1/cli-study/node_modules/.bin/_metalsmith.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../metalsmith/bin/_metalsmith" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../metalsmith/bin/_metalsmith" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/acorn b/day1/cli-study/node_modules/.bin/acorn new file mode 100644 index 0000000..c31c430 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/acorn @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" + ret=$? +else + node "$basedir/../acorn/bin/acorn" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/acorn.cmd b/day1/cli-study/node_modules/.bin/acorn.cmd new file mode 100644 index 0000000..3c863f5 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/acorn.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\acorn\bin\acorn" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/acorn.ps1 b/day1/cli-study/node_modules/.bin/acorn.ps1 new file mode 100644 index 0000000..759f820 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/acorn.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../acorn/bin/acorn" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/cake b/day1/cli-study/node_modules/.bin/cake new file mode 100644 index 0000000..b0faeb1 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/cake @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../coffee-script/bin/cake" "$@" + ret=$? +else + node "$basedir/../coffee-script/bin/cake" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/cake.cmd b/day1/cli-study/node_modules/.bin/cake.cmd new file mode 100644 index 0000000..93e1e62 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/cake.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\coffee-script\bin\cake" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/cake.ps1 b/day1/cli-study/node_modules/.bin/cake.ps1 new file mode 100644 index 0000000..05196f8 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/cake.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../coffee-script/bin/cake" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../coffee-script/bin/cake" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/coffee b/day1/cli-study/node_modules/.bin/coffee new file mode 100644 index 0000000..c334111 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/coffee @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../coffee-script/bin/coffee" "$@" + ret=$? +else + node "$basedir/../coffee-script/bin/coffee" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/coffee.cmd b/day1/cli-study/node_modules/.bin/coffee.cmd new file mode 100644 index 0000000..af41705 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/coffee.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\coffee-script\bin\coffee" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/coffee.ps1 b/day1/cli-study/node_modules/.bin/coffee.ps1 new file mode 100644 index 0000000..bf099ed --- /dev/null +++ b/day1/cli-study/node_modules/.bin/coffee.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../coffee-script/bin/coffee" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../coffee-script/bin/coffee" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/ejs b/day1/cli-study/node_modules/.bin/ejs new file mode 100644 index 0000000..0b9c6b7 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ejs @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../ejs/bin/cli.js" "$@" + ret=$? +else + node "$basedir/../ejs/bin/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/ejs.cmd b/day1/cli-study/node_modules/.bin/ejs.cmd new file mode 100644 index 0000000..3bb42ad --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ejs.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\ejs\bin\cli.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/ejs.ps1 b/day1/cli-study/node_modules/.bin/ejs.ps1 new file mode 100644 index 0000000..78e73c8 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ejs.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../ejs/bin/cli.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../ejs/bin/cli.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/eslint b/day1/cli-study/node_modules/.bin/eslint new file mode 100644 index 0000000..3bb2761 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/eslint @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@" + ret=$? +else + node "$basedir/../eslint/bin/eslint.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/eslint.cmd b/day1/cli-study/node_modules/.bin/eslint.cmd new file mode 100644 index 0000000..1c5e51c --- /dev/null +++ b/day1/cli-study/node_modules/.bin/eslint.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\eslint\bin\eslint.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/eslint.ps1 b/day1/cli-study/node_modules/.bin/eslint.ps1 new file mode 100644 index 0000000..ee32767 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/eslint.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../eslint/bin/eslint.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../eslint/bin/eslint.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/esparse b/day1/cli-study/node_modules/.bin/esparse new file mode 100644 index 0000000..735d854 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esparse @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" + ret=$? +else + node "$basedir/../esprima/bin/esparse.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/esparse.cmd b/day1/cli-study/node_modules/.bin/esparse.cmd new file mode 100644 index 0000000..b8c6a63 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esparse.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/esparse.ps1 b/day1/cli-study/node_modules/.bin/esparse.ps1 new file mode 100644 index 0000000..567aea3 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esparse.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/esvalidate b/day1/cli-study/node_modules/.bin/esvalidate new file mode 100644 index 0000000..d278bc7 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esvalidate @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" + ret=$? +else + node "$basedir/../esprima/bin/esvalidate.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/esvalidate.cmd b/day1/cli-study/node_modules/.bin/esvalidate.cmd new file mode 100644 index 0000000..74859bd --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esvalidate.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/esvalidate.ps1 b/day1/cli-study/node_modules/.bin/esvalidate.ps1 new file mode 100644 index 0000000..b1ed174 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/esvalidate.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/jake b/day1/cli-study/node_modules/.bin/jake new file mode 100644 index 0000000..df203c1 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/jake @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../jake/bin/cli.js" "$@" + ret=$? +else + node "$basedir/../jake/bin/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/jake.cmd b/day1/cli-study/node_modules/.bin/jake.cmd new file mode 100644 index 0000000..5b09dcb --- /dev/null +++ b/day1/cli-study/node_modules/.bin/jake.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\jake\bin\cli.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/jake.ps1 b/day1/cli-study/node_modules/.bin/jake.ps1 new file mode 100644 index 0000000..bbe80ea --- /dev/null +++ b/day1/cli-study/node_modules/.bin/jake.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../jake/bin/cli.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../jake/bin/cli.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/js-yaml b/day1/cli-study/node_modules/.bin/js-yaml new file mode 100644 index 0000000..4537030 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/js-yaml @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@" + ret=$? +else + node "$basedir/../js-yaml/bin/js-yaml.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/js-yaml.cmd b/day1/cli-study/node_modules/.bin/js-yaml.cmd new file mode 100644 index 0000000..9597bdf --- /dev/null +++ b/day1/cli-study/node_modules/.bin/js-yaml.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\js-yaml\bin\js-yaml.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/js-yaml.ps1 b/day1/cli-study/node_modules/.bin/js-yaml.ps1 new file mode 100644 index 0000000..728b322 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/js-yaml.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/json5 b/day1/cli-study/node_modules/.bin/json5 new file mode 100644 index 0000000..882cecd --- /dev/null +++ b/day1/cli-study/node_modules/.bin/json5 @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" + ret=$? +else + node "$basedir/../json5/lib/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/json5.cmd b/day1/cli-study/node_modules/.bin/json5.cmd new file mode 100644 index 0000000..b030d83 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/json5.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\json5\lib\cli.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/json5.ps1 b/day1/cli-study/node_modules/.bin/json5.ps1 new file mode 100644 index 0000000..585f9ad --- /dev/null +++ b/day1/cli-study/node_modules/.bin/json5.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/metalsmith b/day1/cli-study/node_modules/.bin/metalsmith new file mode 100644 index 0000000..5fa2aa2 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/metalsmith @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../metalsmith/bin/metalsmith" "$@" + ret=$? +else + node "$basedir/../metalsmith/bin/metalsmith" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/metalsmith.cmd b/day1/cli-study/node_modules/.bin/metalsmith.cmd new file mode 100644 index 0000000..f23ddb3 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/metalsmith.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\metalsmith\bin\metalsmith" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/metalsmith.ps1 b/day1/cli-study/node_modules/.bin/metalsmith.ps1 new file mode 100644 index 0000000..4e2fb96 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/metalsmith.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../metalsmith/bin/metalsmith" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../metalsmith/bin/metalsmith" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/mkdirp b/day1/cli-study/node_modules/.bin/mkdirp new file mode 100644 index 0000000..bcd333f --- /dev/null +++ b/day1/cli-study/node_modules/.bin/mkdirp @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +else + node "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/mkdirp.cmd b/day1/cli-study/node_modules/.bin/mkdirp.cmd new file mode 100644 index 0000000..c2c9350 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/mkdirp.ps1 b/day1/cli-study/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 0000000..35ce690 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/ncp b/day1/cli-study/node_modules/.bin/ncp new file mode 100644 index 0000000..e8d6f11 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ncp @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../ncp/bin/ncp" "$@" + ret=$? +else + node "$basedir/../ncp/bin/ncp" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/ncp.cmd b/day1/cli-study/node_modules/.bin/ncp.cmd new file mode 100644 index 0000000..a186535 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ncp.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\ncp\bin\ncp" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/ncp.ps1 b/day1/cli-study/node_modules/.bin/ncp.ps1 new file mode 100644 index 0000000..bbb962a --- /dev/null +++ b/day1/cli-study/node_modules/.bin/ncp.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../ncp/bin/ncp" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../ncp/bin/ncp" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/node-which b/day1/cli-study/node_modules/.bin/node-which new file mode 100644 index 0000000..cd9503c --- /dev/null +++ b/day1/cli-study/node_modules/.bin/node-which @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../which/bin/node-which" "$@" + ret=$? +else + node "$basedir/../which/bin/node-which" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/node-which.cmd b/day1/cli-study/node_modules/.bin/node-which.cmd new file mode 100644 index 0000000..7060445 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/node-which.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\which\bin\node-which" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/node-which.ps1 b/day1/cli-study/node_modules/.bin/node-which.ps1 new file mode 100644 index 0000000..60d6560 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/node-which.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../which/bin/node-which" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/rimraf b/day1/cli-study/node_modules/.bin/rimraf new file mode 100644 index 0000000..a3e9f71 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/rimraf @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../rimraf/bin.js" "$@" + ret=$? +else + node "$basedir/../rimraf/bin.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/rimraf.cmd b/day1/cli-study/node_modules/.bin/rimraf.cmd new file mode 100644 index 0000000..698f4ba --- /dev/null +++ b/day1/cli-study/node_modules/.bin/rimraf.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\rimraf\bin.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/rimraf.ps1 b/day1/cli-study/node_modules/.bin/rimraf.ps1 new file mode 100644 index 0000000..a244a80 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/rimraf.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../rimraf/bin.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/seek-bunzip b/day1/cli-study/node_modules/.bin/seek-bunzip new file mode 100644 index 0000000..7b7b955 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-bunzip @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../seek-bzip/bin/seek-bunzip" "$@" + ret=$? +else + node "$basedir/../seek-bzip/bin/seek-bunzip" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/seek-bunzip.cmd b/day1/cli-study/node_modules/.bin/seek-bunzip.cmd new file mode 100644 index 0000000..6ecd3ee --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-bunzip.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\seek-bzip\bin\seek-bunzip" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/seek-bunzip.ps1 b/day1/cli-study/node_modules/.bin/seek-bunzip.ps1 new file mode 100644 index 0000000..7a7de2f --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-bunzip.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../seek-bzip/bin/seek-bunzip" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../seek-bzip/bin/seek-bunzip" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/seek-table b/day1/cli-study/node_modules/.bin/seek-table new file mode 100644 index 0000000..5caec7a --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-table @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../seek-bzip/bin/seek-bzip-table" "$@" + ret=$? +else + node "$basedir/../seek-bzip/bin/seek-bzip-table" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/seek-table.cmd b/day1/cli-study/node_modules/.bin/seek-table.cmd new file mode 100644 index 0000000..4be4947 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-table.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\seek-bzip\bin\seek-bzip-table" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/seek-table.ps1 b/day1/cli-study/node_modules/.bin/seek-table.ps1 new file mode 100644 index 0000000..6a8f489 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/seek-table.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../seek-bzip/bin/seek-bzip-table" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../seek-bzip/bin/seek-bzip-table" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/semver b/day1/cli-study/node_modules/.bin/semver new file mode 100644 index 0000000..7e36527 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/semver @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" + ret=$? +else + node "$basedir/../semver/bin/semver.js" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/semver.cmd b/day1/cli-study/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..164cdea --- /dev/null +++ b/day1/cli-study/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\semver\bin\semver.js" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/semver.ps1 b/day1/cli-study/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..6a85e34 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/semver.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-fork b/day1/cli-study/node_modules/.bin/win-fork new file mode 100644 index 0000000..b83e588 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-fork @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../win-fork/bin/win-spawn" "$@" + ret=$? +else + node "$basedir/../win-fork/bin/win-spawn" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-fork.cmd b/day1/cli-study/node_modules/.bin/win-fork.cmd new file mode 100644 index 0000000..7e6f20f --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-fork.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\win-fork\bin\win-spawn" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/win-fork.ps1 b/day1/cli-study/node_modules/.bin/win-fork.ps1 new file mode 100644 index 0000000..144bbd9 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-fork.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../win-fork/bin/win-spawn" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../win-fork/bin/win-spawn" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-line-endings b/day1/cli-study/node_modules/.bin/win-line-endings new file mode 100644 index 0000000..b0e8ab9 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-line-endings @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../win-fork/bin/win-line-endings" "$@" + ret=$? +else + node "$basedir/../win-fork/bin/win-line-endings" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-line-endings.cmd b/day1/cli-study/node_modules/.bin/win-line-endings.cmd new file mode 100644 index 0000000..2448235 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-line-endings.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\win-fork\bin\win-line-endings" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/win-line-endings.ps1 b/day1/cli-study/node_modules/.bin/win-line-endings.ps1 new file mode 100644 index 0000000..e47c2dc --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-line-endings.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../win-fork/bin/win-line-endings" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../win-fork/bin/win-line-endings" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-spawn b/day1/cli-study/node_modules/.bin/win-spawn new file mode 100644 index 0000000..b83e588 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-spawn @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../win-fork/bin/win-spawn" "$@" + ret=$? +else + node "$basedir/../win-fork/bin/win-spawn" "$@" + ret=$? +fi +exit $ret diff --git a/day1/cli-study/node_modules/.bin/win-spawn.cmd b/day1/cli-study/node_modules/.bin/win-spawn.cmd new file mode 100644 index 0000000..7e6f20f --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-spawn.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\win-fork\bin\win-spawn" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/day1/cli-study/node_modules/.bin/win-spawn.ps1 b/day1/cli-study/node_modules/.bin/win-spawn.ps1 new file mode 100644 index 0000000..144bbd9 --- /dev/null +++ b/day1/cli-study/node_modules/.bin/win-spawn.ps1 @@ -0,0 +1,18 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + & "$basedir/node$exe" "$basedir/../win-fork/bin/win-spawn" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../win-fork/bin/win-spawn" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/day1/cli-study/node_modules/@babel/code-frame/LICENSE b/day1/cli-study/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/day1/cli-study/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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. diff --git a/day1/cli-study/node_modules/@babel/code-frame/README.md b/day1/cli-study/node_modules/@babel/code-frame/README.md new file mode 100644 index 0000000..185f93d --- /dev/null +++ b/day1/cli-study/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/day1/cli-study/node_modules/@babel/code-frame/lib/index.js b/day1/cli-study/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 0000000..28d86f7 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,167 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameColumns = codeFrameColumns; +exports.default = _default; + +var _highlight = _interopRequireWildcard(require("@babel/highlight")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +let deprecationWarningShown = false; + +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + + if (startLine === -1) { + start = 0; + } + + if (endLine === -1) { + end = source.length; + } + + const lineDiff = endLine - startLine; + const markerLines = {}; + + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + + return { + start, + end, + markerLines + }; +} + +function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk = (0, _highlight.getChalk)(opts); + const defs = getDefs(chalk); + + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; + + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} | `; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + + if (hasMarker) { + let markerLine = ""; + + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line}`; + } + }).join("\n"); + + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +} + +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/@babel/code-frame/package.json b/day1/cli-study/node_modules/@babel/code-frame/package.json new file mode 100644 index 0000000..9586401 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/code-frame/package.json @@ -0,0 +1,57 @@ +{ + "_from": "@babel/code-frame@^7.0.0", + "_id": "@babel/code-frame@7.10.4", + "_inBundle": false, + "_integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "_location": "/@babel/code-frame", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@babel/code-frame@^7.0.0", + "name": "@babel/code-frame", + "escapedName": "@babel%2fcode-frame", + "scope": "@babel", + "rawSpec": "^7.0.0", + "saveSpec": null, + "fetchSpec": "^7.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "_shasum": "168da1a36e90da68ae8d49c0f1b48c7c6249213a", + "_spec": "@babel/code-frame@^7.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/highlight": "^7.10.4" + }, + "deprecated": false, + "description": "Generate errors that contain a code frame that point to source locations.", + "devDependencies": { + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "name": "@babel/code-frame", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "version": "7.10.4" +} diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/LICENSE b/day1/cli-study/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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. diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/README.md b/day1/cli-study/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 0000000..ab2dad1 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/next/babel-helper-validator-identifier.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helper-validator-identifier +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-identifier --dev +``` diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 0000000..51ec763 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIdentifierStart = isIdentifierStart; +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + +function isInAstralSet(code, set) { + let pos = 0x10000; + + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + + return false; +} + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes); +} + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +function isIdentifierName(name) { + let isFirst = true; + + for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { + const char = _Array$from[_i]; + const cp = char.codePointAt(0); + + if (isFirst) { + if (!isIdentifierStart(cp)) { + return false; + } + + isFirst = false; + } else if (!isIdentifierChar(cp)) { + return false; + } + } + + return !isFirst; +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/index.js b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 0000000..7b623c9 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +}); +Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +}); +Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +}); +Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +}); +Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +}); +Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +}); + +var _identifier = require("./identifier"); + +var _keyword = require("./keyword"); \ No newline at end of file diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 0000000..110cee4 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isReservedWord = isReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isKeyword = isKeyword; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} + +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} + +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} + +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} + +function isKeyword(word) { + return keywords.has(word); +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/package.json b/day1/cli-study/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 0000000..01075c3 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,51 @@ +{ + "_from": "@babel/helper-validator-identifier@^7.10.4", + "_id": "@babel/helper-validator-identifier@7.10.4", + "_inBundle": false, + "_integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "_location": "/@babel/helper-validator-identifier", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@babel/helper-validator-identifier@^7.10.4", + "name": "@babel/helper-validator-identifier", + "escapedName": "@babel%2fhelper-validator-identifier", + "scope": "@babel", + "rawSpec": "^7.10.4", + "saveSpec": null, + "fetchSpec": "^7.10.4" + }, + "_requiredBy": [ + "/@babel/highlight" + ], + "_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "_shasum": "a78c7a7251e01f616512d31b10adcf52ada5e0d2", + "_spec": "@babel/helper-validator-identifier@^7.10.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\@babel\\highlight", + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Validate identifier/keywords name", + "devDependencies": { + "charcodes": "^0.2.0", + "unicode-13.0.0": "^0.8.0" + }, + "exports": "./lib/index.js", + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "homepage": "https://github.com/babel/babel#readme", + "license": "MIT", + "main": "./lib/index.js", + "name": "@babel/helper-validator-identifier", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "version": "7.10.4" +} diff --git a/day1/cli-study/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/day1/cli-study/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js new file mode 100644 index 0000000..70b3715 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js @@ -0,0 +1,75 @@ +"use strict"; + +// Always use the latest available version of Unicode! +// https://tc39.github.io/ecma262/#sec-conformance +const version = "13.0.0"; + +const start = require("unicode-" + + version + + "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { + return ch > 0x7f; +}); +let last = -1; +const cont = [0x200c, 0x200d].concat( + require("unicode-" + + version + + "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { + return ch > 0x7f && search(start, ch, last + 1) == -1; + }) +); + +function search(arr, ch, starting) { + for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { + if (arr[i] === ch) return i; + } + return -1; +} + +function pad(str, width) { + while (str.length < width) str = "0" + str; + return str; +} + +function esc(code) { + const hex = code.toString(16); + if (hex.length <= 2) return "\\x" + pad(hex, 2); + else return "\\u" + pad(hex, 4); +} + +function generate(chars) { + const astral = []; + let re = ""; + for (let i = 0, at = 0x10000; i < chars.length; i++) { + const from = chars[i]; + let to = from; + while (i < chars.length - 1 && chars[i + 1] == to + 1) { + i++; + to++; + } + if (to <= 0xffff) { + if (from == to) re += esc(from); + else if (from + 1 == to) re += esc(from) + esc(to); + else re += esc(from) + "-" + esc(to); + } else { + astral.push(from - at, to - from); + at = to; + } + } + return { nonASCII: re, astral: astral }; +} + +const startData = generate(start); +const contData = generate(cont); + +console.log("/* prettier-ignore */"); +console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); +console.log("/* prettier-ignore */"); +console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); +console.log("/* prettier-ignore */"); +console.log( + "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" +); +console.log("/* prettier-ignore */"); +console.log( + "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" +); diff --git a/day1/cli-study/node_modules/@babel/highlight/LICENSE b/day1/cli-study/node_modules/@babel/highlight/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +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. diff --git a/day1/cli-study/node_modules/@babel/highlight/README.md b/day1/cli-study/node_modules/@babel/highlight/README.md new file mode 100644 index 0000000..72dae60 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/README.md @@ -0,0 +1,19 @@ +# @babel/highlight + +> Syntax highlight JavaScript strings for output in terminals. + +See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/highlight +``` + +or using yarn: + +```sh +yarn add @babel/highlight --dev +``` diff --git a/day1/cli-study/node_modules/@babel/highlight/lib/index.js b/day1/cli-study/node_modules/@babel/highlight/lib/index.js new file mode 100644 index 0000000..b0d1be7 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/lib/index.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shouldHighlight = shouldHighlight; +exports.getChalk = getChalk; +exports.default = highlight; + +var _jsTokens = _interopRequireWildcard(require("js-tokens")); + +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); + +var _chalk = _interopRequireDefault(require("chalk")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsx_tag: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold + }; +} + +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const JSX_TAG = /^[a-z][\w-]*$/i; +const BRACKET = /^[()[\]{}]$/; + +function getTokenType(match) { + const [offset, text] = match.slice(-2); + const token = (0, _jsTokens.matchToToken)(match); + + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) { + return "keyword"; + } + + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)).join("\n"); + } else { + return args[0]; + } + }); +} + +function shouldHighlight(options) { + return _chalk.default.supportsColor || options.forceColor; +} + +function getChalk(options) { + let chalk = _chalk.default; + + if (options.forceColor) { + chalk = new _chalk.default.constructor({ + enabled: true, + level: 1 + }); + } + + return chalk; +} + +function highlight(code, options = {}) { + if (shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; + } +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js new file mode 100644 index 0000000..1cc5fa8 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js.flow b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js.flow new file mode 100644 index 0000000..622caaa --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/license b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/package.json b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/package.json new file mode 100644 index 0000000..0aed4cb --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/package.json @@ -0,0 +1,103 @@ +{ + "_from": "chalk@^2.0.0", + "_id": "chalk@2.4.2", + "_inBundle": false, + "_integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "_location": "/@babel/highlight/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chalk@^2.0.0", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/@babel/highlight" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "_shasum": "cd42541677a54333cf541a49108c1432b44c9424", + "_spec": "chalk@^2.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\@babel\\highlight", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" + }, + "types": "types/index.d.ts", + "version": "2.4.2", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/readme.md b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/readme.md new file mode 100644 index 0000000..d298e2c --- /dev/null +++ b/day1/cli-study/node_modules/@babel/highlight/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + + + + + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.` + + +
+

ESLint Report

+
+ <%= reportSummary %> - Generated on <%= date %> +
+
+ + + <%= results %> + +
+ + + diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html new file mode 100644 index 0000000..f4a5593 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html-template-result.html @@ -0,0 +1,6 @@ + + + [+] <%- filePath %> + <%- summary %> + + diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html.js new file mode 100644 index 0000000..69f7395 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -0,0 +1,140 @@ +/** + * @fileoverview HTML reporter + * @author Julian Laval + */ +"use strict"; + +const lodash = require("lodash"); +const fs = require("fs"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const pageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-page.html"), "utf-8")); +const messageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-message.html"), "utf-8")); +const resultTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-result.html"), "utf-8")); + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + const totalProblems = totalErrors + totalWarnings; + let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`; + + if (totalProblems !== 0) { + renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`; + } + return renderedText; +} + +/** + * Get the color based on whether there are errors/warnings... + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return 2; + } + if (totalWarnings !== 0) { + return 1; + } + return 0; +} + +/** + * Get HTML (table rows) describing the messages. + * @param {Array} messages Messages. + * @param {int} parentIndex Index of the parent HTML row. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML (table rows) describing the messages. + */ +function renderMessages(messages, parentIndex, rulesMeta) { + + /** + * Get HTML (table row) describing a message. + * @param {Object} message Message. + * @returns {string} HTML (table row) describing a message. + */ + return lodash.map(messages, message => { + const lineNumber = message.line || 0; + const columnNumber = message.column || 0; + let ruleUrl; + + if (rulesMeta) { + const meta = rulesMeta[message.ruleId]; + + ruleUrl = lodash.get(meta, "docs.url", null); + } + + return messageTemplate({ + parentIndex, + lineNumber, + columnNumber, + severityNumber: message.severity, + severityName: message.severity === 1 ? "Warning" : "Error", + message: message.message, + ruleId: message.ruleId, + ruleUrl + }); + }).join("\n"); +} + +// eslint-disable-next-line jsdoc/require-description +/** + * @param {Array} results Test results. + * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis. + * @returns {string} HTML string describing the results. + */ +function renderResults(results, rulesMeta) { + return lodash.map(results, (result, index) => resultTemplate({ + index, + color: renderColor(result.errorCount, result.warningCount), + filePath: result.filePath, + summary: renderSummary(result.errorCount, result.warningCount) + + }) + renderMessages(result.messages, index, rulesMeta)).join("\n"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + let totalErrors, + totalWarnings; + + const metaData = data ? data.rulesMeta : {}; + + totalErrors = 0; + totalWarnings = 0; + + // Iterate over results to get totals + results.forEach(result => { + totalErrors += result.errorCount; + totalWarnings += result.warningCount; + }); + + return pageTemplate({ + date: new Date(), + reportColor: renderColor(totalErrors, totalWarnings), + reportSummary: renderSummary(totalErrors, totalWarnings), + results: renderResults(results, metaData) + }); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js new file mode 100644 index 0000000..0ca1cba --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/jslint-xml.js @@ -0,0 +1,41 @@ +/** + * @fileoverview JSLint XML reporter + * @author Ian Christian Myers + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += ""; + output += ""; + + results.forEach(result => { + const messages = result.messages; + + output += ``; + + messages.forEach(message => { + output += [ + `` + ].join(" "); + }); + + output += ""; + + }); + + output += ""; + + return output; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js new file mode 100644 index 0000000..6899471 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js @@ -0,0 +1,16 @@ +/** + * @fileoverview JSON reporter, including rules metadata + * @author Chris Meyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results, data) { + return JSON.stringify({ + results, + metadata: data + }); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json.js new file mode 100644 index 0000000..82138af --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/json.js @@ -0,0 +1,13 @@ +/** + * @fileoverview JSON reporter + * @author Burak Yigit Kaya aka BYK + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + return JSON.stringify(results); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/junit.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/junit.js new file mode 100644 index 0000000..a994b4b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/junit.js @@ -0,0 +1,82 @@ +/** + * @fileoverview jUnit Reporter + * @author Jamund Ferguson + */ +"use strict"; + +const xmlEscape = require("../xml-escape"); +const path = require("path"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + +/** + * Returns a full file path without extension + * @param {string} filePath input file path + * @returns {string} file path without extension + * @private + */ +function pathWithoutExt(filePath) { + return path.join(path.dirname(filePath), path.basename(filePath, path.extname(filePath))); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = ""; + + output += "\n"; + output += "\n"; + + results.forEach(result => { + + const messages = result.messages; + const classname = pathWithoutExt(result.filePath); + + if (messages.length > 0) { + output += `\n`; + messages.forEach(message => { + const type = message.fatal ? "error" : "failure"; + + output += ``; + output += `<${type} message="${xmlEscape(message.message || "")}">`; + output += ""; + output += ``; + output += "\n"; + }); + output += "\n"; + } else { + output += `\n`; + output += `\n`; + output += "\n"; + } + + }); + + output += "\n"; + + return output; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/stylish.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/stylish.js new file mode 100644 index 0000000..a808448 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/stylish.js @@ -0,0 +1,101 @@ +/** + * @fileoverview Stylish reporter + * @author Sindre Sorhus + */ +"use strict"; + +const chalk = require("chalk"), + stripAnsi = require("strip-ansi"), + table = require("text-table"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "\n", + errorCount = 0, + warningCount = 0, + fixableErrorCount = 0, + fixableWarningCount = 0, + summaryColor = "yellow"; + + results.forEach(result => { + const messages = result.messages; + + if (messages.length === 0) { + return; + } + + errorCount += result.errorCount; + warningCount += result.warningCount; + fixableErrorCount += result.fixableErrorCount; + fixableWarningCount += result.fixableWarningCount; + + output += `${chalk.underline(result.filePath)}\n`; + + output += `${table( + messages.map(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + summaryColor = "red"; + } else { + messageType = chalk.yellow("warning"); + } + + return [ + "", + message.line || 0, + message.column || 0, + messageType, + message.message.replace(/([^ ])\.$/u, "$1"), + chalk.dim(message.ruleId || "") + ]; + }), + { + align: ["", "r", "l"], + stringLength(str) { + return stripAnsi(str).length; + } + } + ).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`; + }); + + const total = errorCount + warningCount; + + if (total > 0) { + output += chalk[summaryColor].bold([ + "\u2716 ", total, pluralize(" problem", total), + " (", errorCount, pluralize(" error", errorCount), ", ", + warningCount, pluralize(" warning", warningCount), ")\n" + ].join("")); + + if (fixableErrorCount > 0 || fixableWarningCount > 0) { + output += chalk[summaryColor].bold([ + " ", fixableErrorCount, pluralize(" error", fixableErrorCount), " and ", + fixableWarningCount, pluralize(" warning", fixableWarningCount), + " potentially fixable with the `--fix` option.\n" + ].join("")); + } + } + + // Resets output color, for prevent change on top level + return total > 0 ? chalk.reset(output) : ""; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/table.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/table.js new file mode 100644 index 0000000..a74cce0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/table.js @@ -0,0 +1,159 @@ +/** + * @fileoverview "table reporter. + * @author Gajus Kuizinas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const chalk = require("chalk"), + table = require("table").table; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Given a word and a count, append an "s" if count is not one. + * @param {string} word A word. + * @param {number} count Quantity. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : `${word}s`); +} + +/** + * Draws text table. + * @param {Array} messages Error messages relating to a specific file. + * @returns {string} A text table. + */ +function drawTable(messages) { + const rows = []; + + if (messages.length === 0) { + return ""; + } + + rows.push([ + chalk.bold("Line"), + chalk.bold("Column"), + chalk.bold("Type"), + chalk.bold("Message"), + chalk.bold("Rule ID") + ]); + + messages.forEach(message => { + let messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + } else { + messageType = chalk.yellow("warning"); + } + + rows.push([ + message.line || 0, + message.column || 0, + messageType, + message.message, + message.ruleId || "" + ]); + }); + + return table(rows, { + columns: { + 0: { + width: 8, + wrapWord: true + }, + 1: { + width: 8, + wrapWord: true + }, + 2: { + width: 8, + wrapWord: true + }, + 3: { + paddingRight: 5, + width: 50, + wrapWord: true + }, + 4: { + width: 20, + wrapWord: true + } + }, + drawHorizontalLine(index) { + return index === 1; + } + }); +} + +/** + * Draws a report (multiple tables). + * @param {Array} results Report results for every file. + * @returns {string} A column of text tables. + */ +function drawReport(results) { + let files; + + files = results.map(result => { + if (!result.messages.length) { + return ""; + } + + return `\n${result.filePath}\n\n${drawTable(result.messages)}`; + }); + + files = files.filter(content => content.trim()); + + return files.join(""); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(report) { + let result, + errorCount, + warningCount; + + result = ""; + errorCount = 0; + warningCount = 0; + + report.forEach(fileReport => { + errorCount += fileReport.errorCount; + warningCount += fileReport.warningCount; + }); + + if (errorCount || warningCount) { + result = drawReport(report); + } + + result += `\n${table([ + [ + chalk.red(pluralize(`${errorCount} Error`, errorCount)) + ], + [ + chalk.yellow(pluralize(`${warningCount} Warning`, warningCount)) + ] + ], { + columns: { + 0: { + width: 110, + wrapWord: true + } + }, + drawHorizontalLine() { + return true; + } + })}`; + + return result; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/tap.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/tap.js new file mode 100644 index 0000000..354872a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/tap.js @@ -0,0 +1,95 @@ +/** + * @fileoverview TAP reporter + * @author Jonathan Kingston + */ +"use strict"; + +const yaml = require("js-yaml"); + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; +} + +/** + * Takes in a JavaScript object and outputs a TAP diagnostics string + * @param {Object} diagnostic JavaScript object to be embedded as YAML into output. + * @returns {string} diagnostics string with YAML embedded - TAP version 13 compliant + */ +function outputDiagnostics(diagnostic) { + const prefix = " "; + let output = `${prefix}---\n`; + + output += prefix + yaml.safeDump(diagnostic).split("\n").join(`\n${prefix}`); + output += "...\n"; + return output; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + let output = `TAP version 13\n1..${results.length}\n`; + + results.forEach((result, id) => { + const messages = result.messages; + let testResult = "ok"; + let diagnostics = {}; + + if (messages.length > 0) { + messages.forEach(message => { + const severity = getMessageType(message); + const diagnostic = { + message: message.message, + severity, + data: { + line: message.line || 0, + column: message.column || 0, + ruleId: message.ruleId || "" + } + }; + + // This ensures a warning message is not flagged as error + if (severity === "error") { + testResult = "not ok"; + } + + /* + * If we have multiple messages place them under a messages key + * The first error will be logged as message key + * This is to adhere to TAP 13 loosely defined specification of having a message key + */ + if ("message" in diagnostics) { + if (typeof diagnostics.messages === "undefined") { + diagnostics.messages = []; + } + diagnostics.messages.push(diagnostic); + } else { + diagnostics = diagnostic; + } + }); + } + + output += `${testResult} ${id + 1} - ${result.filePath}\n`; + + // If we have an error include diagnostics + if (messages.length > 0) { + output += outputDiagnostics(diagnostics); + } + + }); + + return output; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/unix.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/unix.js new file mode 100644 index 0000000..c6c4ebb --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/unix.js @@ -0,0 +1,58 @@ +/** + * @fileoverview unix-style formatter. + * @author oshi-shinobu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {Object} message Individual error message provided by eslint + * @returns {string} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } + return "Warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += `${result.filePath}:`; + output += `${message.line || 0}:`; + output += `${message.column || 0}:`; + output += ` ${message.message} `; + output += `[${getMessageType(message)}${message.ruleId ? `/${message.ruleId}` : ""}]`; + output += "\n"; + + }); + + }); + + if (total > 0) { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js new file mode 100644 index 0000000..0d49431 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/formatters/visualstudio.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Visual Studio compatible formatter + * @author Ronald Pijnacker + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {Object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } + return "warning"; + +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + let output = "", + total = 0; + + results.forEach(result => { + + const messages = result.messages; + + total += messages.length; + + messages.forEach(message => { + + output += result.filePath; + output += `(${message.line || 0}`; + output += message.column ? `,${message.column}` : ""; + output += `): ${getMessageType(message)}`; + output += message.ruleId ? ` ${message.ruleId}` : ""; + output += ` : ${message.message}`; + output += "\n"; + + }); + + }); + + if (total === 0) { + output += "no problems"; + } else { + output += `\n${total} problem${total !== 1 ? "s" : ""}`; + } + + return output; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/hash.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/hash.js new file mode 100644 index 0000000..6d7ef8b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/hash.js @@ -0,0 +1,35 @@ +/** + * @fileoverview Defining the hashing function in one place. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const murmur = require("imurmurhash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +function hash(str) { + return murmur(str).result().toString(36); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = hash; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/index.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/index.js new file mode 100644 index 0000000..52e45a6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { CLIEngine } = require("./cli-engine"); + +module.exports = { + CLIEngine +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/lint-result-cache.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/lint-result-cache.js new file mode 100644 index 0000000..23a1420 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/lint-result-cache.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Utility for caching lint results. + * @author Kevin Partington + */ +"use strict"; + +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const assert = require("assert"); +const fs = require("fs"); +const fileEntryCache = require("file-entry-cache"); +const stringify = require("json-stable-stringify-without-jsonify"); +const pkg = require("../../package.json"); +const hash = require("./hash"); + +//----------------------------------------------------------------------------- +// Helpers +//----------------------------------------------------------------------------- + +const configHashCache = new WeakMap(); +const nodeVersion = process && process.version; + +/** + * Calculates the hash of the config + * @param {ConfigArray} config The config. + * @returns {string} The hash of the config + */ +function hashOfConfigFor(config) { + if (!configHashCache.has(config)) { + configHashCache.set(config, hash(`${pkg.version}_${nodeVersion}_${stringify(config)}`)); + } + + return configHashCache.get(config); +} + +//----------------------------------------------------------------------------- +// Public Interface +//----------------------------------------------------------------------------- + +/** + * Lint result cache. This wraps around the file-entry-cache module, + * transparently removing properties that are difficult or expensive to + * serialize and adding them back in on retrieval. + */ +class LintResultCache { + + /** + * Creates a new LintResultCache instance. + * @param {string} cacheFileLocation The cache file location. + * configuration lookup by file path). + */ + constructor(cacheFileLocation) { + assert(cacheFileLocation, "Cache file location is required"); + + this.fileEntryCache = fileEntryCache.create(cacheFileLocation); + } + + /** + * Retrieve cached lint results for a given file path, if present in the + * cache. If the file is present and has not been changed, rebuild any + * missing result information. + * @param {string} filePath The file for which to retrieve lint results. + * @param {ConfigArray} config The config of the file. + * @returns {Object|null} The rebuilt lint results, or null if the file is + * changed or not in the filesystem. + */ + getCachedLintResults(filePath, config) { + + /* + * Cached lint results are valid if and only if: + * 1. The file is present in the filesystem + * 2. The file has not changed since the time it was previously linted + * 3. The ESLint configuration has not changed since the time the file + * was previously linted + * If any of these are not true, we will not reuse the lint results. + */ + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + const hashOfConfig = hashOfConfigFor(config); + const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig; + + if (fileDescriptor.notFound || changed) { + return null; + } + + // If source is present but null, need to reread the file from the filesystem. + if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) { + fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8"); + } + + return fileDescriptor.meta.results; + } + + /** + * Set the cached lint results for a given file path, after removing any + * information that will be both unnecessary and difficult to serialize. + * Avoids caching results with an "output" property (meaning fixes were + * applied), to prevent potentially incorrect results if fixes are not + * written to disk. + * @param {string} filePath The file for which to set lint results. + * @param {ConfigArray} config The config of the file. + * @param {Object} result The lint result to be set for the file. + * @returns {void} + */ + setCachedLintResults(filePath, config, result) { + if (result && Object.prototype.hasOwnProperty.call(result, "output")) { + return; + } + + const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); + + if (fileDescriptor && !fileDescriptor.notFound) { + + // Serialize the result, except that we want to remove the file source if present. + const resultToSerialize = Object.assign({}, result); + + /* + * Set result.source to null. + * In `getCachedLintResults`, if source is explicitly null, we will + * read the file from the filesystem to set the value again. + */ + if (Object.prototype.hasOwnProperty.call(resultToSerialize, "source")) { + resultToSerialize.source = null; + } + + fileDescriptor.meta.results = resultToSerialize; + fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config); + } + } + + /** + * Persists the in-memory cache to disk. + * @returns {void} + */ + reconcile() { + this.fileEntryCache.reconcile(); + } +} + +module.exports = LintResultCache; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/load-rules.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/load-rules.js new file mode 100644 index 0000000..81bab63 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/load-rules.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Module for loading rules from files and directories. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"); + +const rulesDirCache = {}; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Load all rule modules from specified directory. + * @param {string} relativeRulesDir Path to rules directory, may be relative. + * @param {string} cwd Current working directory + * @returns {Object} Loaded rule modules. + */ +module.exports = function(relativeRulesDir, cwd) { + const rulesDir = path.resolve(cwd, relativeRulesDir); + + // cache will help performance as IO operation are expensive + if (rulesDirCache[rulesDir]) { + return rulesDirCache[rulesDir]; + } + + const rules = Object.create(null); + + fs.readdirSync(rulesDir).forEach(file => { + if (path.extname(file) !== ".js") { + return; + } + rules[file.slice(0, -3)] = require(path.join(rulesDir, file)); + }); + rulesDirCache[rulesDir] = rules; + + return rules; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli-engine/xml-escape.js b/day1/cli-study/node_modules/eslint/lib/cli-engine/xml-escape.js new file mode 100644 index 0000000..175c2c0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli-engine/xml-escape.js @@ -0,0 +1,34 @@ +/** + * @fileoverview XML character escaper + * @author George Chung + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Returns the escaped value for a character + * @param {string} s string to examine + * @returns {string} severity level + * @private + */ +module.exports = function(s) { + return (`${s}`).replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/gu, c => { // eslint-disable-line no-control-regex + switch (c) { + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + case "\"": + return """; + case "'": + return "'"; + default: + return `&#${c.charCodeAt(0)};`; + } + }); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/cli.js b/day1/cli-study/node_modules/eslint/lib/cli.js new file mode 100644 index 0000000..ce11878 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/cli.js @@ -0,0 +1,326 @@ +/** + * @fileoverview Main CLI object. + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * The CLI object should *not* call process.exit() directly. It should only return + * exit codes. This allows other programs to use the CLI object and still control + * when the program exits. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + { promisify } = require("util"), + { ESLint } = require("./eslint"), + CLIOptions = require("./options"), + log = require("./shared/logging"), + RuntimeInfo = require("./shared/runtime-info"); + +const debug = require("debug")("eslint:cli"); + +//------------------------------------------------------------------------------ +// Types +//------------------------------------------------------------------------------ + +/** @typedef {import("./eslint/eslint").ESLintOptions} ESLintOptions */ +/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ +/** @typedef {import("./eslint/eslint").LintResult} LintResult */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const mkdir = promisify(fs.mkdir); +const stat = promisify(fs.stat); +const writeFile = promisify(fs.writeFile); + +/** + * Predicate function for whether or not to apply fixes in quiet mode. + * If a message is a warning, do not apply a fix. + * @param {LintMessage} message The lint result. + * @returns {boolean} True if the lint message is an error (and thus should be + * autofixed), false otherwise. + */ +function quietFixPredicate(message) { + return message.severity === 2; +} + +/** + * Translates the CLI options into the options expected by the CLIEngine. + * @param {Object} cliOptions The CLI options to translate. + * @returns {ESLintOptions} The options object for the CLIEngine. + * @private + */ +function translateOptions({ + cache, + cacheFile, + cacheLocation, + config, + env, + errorOnUnmatchedPattern, + eslintrc, + ext, + fix, + fixDryRun, + fixType, + global, + ignore, + ignorePath, + ignorePattern, + inlineConfig, + parser, + parserOptions, + plugin, + quiet, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rule, + rulesdir +}) { + return { + allowInlineConfig: inlineConfig, + cache, + cacheLocation: cacheLocation || cacheFile, + errorOnUnmatchedPattern, + extensions: ext, + fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true), + fixTypes: fixType, + ignore, + ignorePath, + overrideConfig: { + env: env && env.reduce((obj, name) => { + obj[name] = true; + return obj; + }, {}), + globals: global && global.reduce((obj, name) => { + if (name.endsWith(":true")) { + obj[name.slice(0, -5)] = "writable"; + } else { + obj[name] = "readonly"; + } + return obj; + }, {}), + ignorePatterns: ignorePattern, + parser, + parserOptions, + plugins: plugin, + rules: rule + }, + overrideConfigFile: config, + reportUnusedDisableDirectives: reportUnusedDisableDirectives ? "error" : void 0, + resolvePluginsRelativeTo, + rulePaths: rulesdir, + useEslintrc: eslintrc + }; +} + +/** + * Count error messages. + * @param {LintResult[]} results The lint results. + * @returns {{errorCount:number;warningCount:number}} The number of error messages. + */ +function countErrors(results) { + let errorCount = 0; + let warningCount = 0; + + for (const result of results) { + errorCount += result.errorCount; + warningCount += result.warningCount; + } + + return { errorCount, warningCount }; +} + +/** + * Check if a given file path is a directory or not. + * @param {string} filePath The path to a file to check. + * @returns {Promise} `true` if the given path is a directory. + */ +async function isDirectory(filePath) { + try { + return (await stat(filePath)).isDirectory(); + } catch (error) { + if (error.code === "ENOENT" || error.code === "ENOTDIR") { + return false; + } + throw error; + } +} + +/** + * Outputs the results of the linting. + * @param {ESLint} engine The ESLint instance to use. + * @param {LintResult[]} results The results to print. + * @param {string} format The name of the formatter to use or the path to the formatter. + * @param {string} outputFile The path for the output file. + * @returns {Promise} True if the printing succeeds, false if not. + * @private + */ +async function printResults(engine, results, format, outputFile) { + let formatter; + + try { + formatter = await engine.loadFormatter(format); + } catch (e) { + log.error(e.message); + return false; + } + + const output = formatter.format(results); + + if (output) { + if (outputFile) { + const filePath = path.resolve(process.cwd(), outputFile); + + if (await isDirectory(filePath)) { + log.error("Cannot write to output file path, it is a directory: %s", outputFile); + return false; + } + + try { + await mkdir(path.dirname(filePath), { recursive: true }); + await writeFile(filePath, output); + } catch (ex) { + log.error("There was a problem writing the output file:\n%s", ex); + return false; + } + } else { + log.info(output); + } + } + + return true; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as + * for other Node.js programs to effectively run the CLI. + */ +const cli = { + + /** + * Executes the CLI based on an array of arguments that is passed in. + * @param {string|Array|Object} args The arguments to process. + * @param {string} [text] The text to lint (used for TTY). + * @returns {Promise} The exit code for the operation. + */ + async execute(args, text) { + if (Array.isArray(args)) { + debug("CLI args: %o", args.slice(2)); + } + let options; + + try { + options = CLIOptions.parse(args); + } catch (error) { + log.error(error.message); + return 2; + } + + const files = options._; + const useStdin = typeof text === "string"; + + if (options.help) { + log.info(CLIOptions.generateHelp()); + return 0; + } + if (options.version) { + log.info(RuntimeInfo.version()); + return 0; + } + if (options.envInfo) { + try { + log.info(RuntimeInfo.environment()); + return 0; + } catch (err) { + log.error(err.message); + return 2; + } + } + + if (options.printConfig) { + if (files.length) { + log.error("The --print-config option must be used with exactly one file name."); + return 2; + } + if (useStdin) { + log.error("The --print-config option is not available for piped-in code."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + const fileConfig = + await engine.calculateConfigForFile(options.printConfig); + + log.info(JSON.stringify(fileConfig, null, " ")); + return 0; + } + + debug(`Running on ${useStdin ? "text" : "files"}`); + + if (options.fix && options.fixDryRun) { + log.error("The --fix option and the --fix-dry-run option cannot be used together."); + return 2; + } + if (useStdin && options.fix) { + log.error("The --fix option is not available for piped-in code; use --fix-dry-run instead."); + return 2; + } + if (options.fixType && !options.fix && !options.fixDryRun) { + log.error("The --fix-type option requires either --fix or --fix-dry-run."); + return 2; + } + + const engine = new ESLint(translateOptions(options)); + let results; + + if (useStdin) { + results = await engine.lintText(text, { + filePath: options.stdinFilename, + warnIgnored: true + }); + } else { + results = await engine.lintFiles(files); + } + + if (options.fix) { + debug("Fix mode enabled - applying fixes"); + await ESLint.outputFixes(results); + } + + if (options.quiet) { + debug("Quiet mode enabled - filtering out warnings"); + results = ESLint.getErrorResults(results); + } + + if (await printResults(engine, results, options.format, options.outputFile)) { + const { errorCount, warningCount } = countErrors(results); + const tooManyWarnings = + options.maxWarnings >= 0 && warningCount > options.maxWarnings; + + if (!errorCount && tooManyWarnings) { + log.error( + "ESLint found too many warnings (maximum: %s).", + options.maxWarnings + ); + } + + return (errorCount || tooManyWarnings) ? 1 : 0; + } + + return 2; + } +}; + +module.exports = cli; diff --git a/day1/cli-study/node_modules/eslint/lib/eslint/eslint.js b/day1/cli-study/node_modules/eslint/lib/eslint/eslint.js new file mode 100644 index 0000000..d195aab --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/eslint/eslint.js @@ -0,0 +1,656 @@ +/** + * @fileoverview Main API Class + * @author Kai Cataldo + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const fs = require("fs"); +const { promisify } = require("util"); +const { CLIEngine, getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); +const BuiltinRules = require("../rules"); +const { getRuleSeverity } = require("../shared/config-ops"); +const { version } = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../cli-engine/cli-engine").LintReport} CLIEngineLintReport */ +/** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").Plugin} Plugin */ +/** @typedef {import("../shared/types").Rule} Rule */ +/** @typedef {import("./load-formatter").Formatter} Formatter */ + +/** + * The options with which to configure the ESLint instance. + * @typedef {Object} ESLintOptions + * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments. + * @property {ConfigData} [baseConfig] Base config object, extended by all configs used with this instance + * @property {boolean} [cache] Enable result caching. + * @property {string} [cacheLocation] The cache file to use instead of .eslintcache. + * @property {string} [cwd] The value to use for the current working directory. + * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. + * @property {string[]} [extensions] An array of file extensions to check. + * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean. + * @property {string[]} [fixTypes] Array of rule types to apply fixes for. + * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file. + * @property {boolean} [ignore] False disables use of .eslintignore. + * @property {string} [ignorePath] The ignore file to use instead of .eslintignore. + * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance + * @property {string} [overrideConfigFile] The configuration file to use. + * @property {Record} [plugins] An array of plugin implementations. + * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. + * @property {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD. + * @property {string[]} [rulePaths] An array of directories to load custom rules from. + * @property {boolean} [useEslintrc] False disables looking for .eslintrc.* files. + */ + +/** + * A rules metadata object. + * @typedef {Object} RulesMeta + * @property {string} id The plugin ID. + * @property {Object} definition The plugin definition. + */ + +/** + * A linting result. + * @typedef {Object} LintResult + * @property {string} filePath The path to the file that was linted. + * @property {LintMessage[]} messages All of the messages for the result. + * @property {number} errorCount Number of errors for the result. + * @property {number} warningCount Number of warnings for the result. + * @property {number} fixableErrorCount Number of fixable errors for the result. + * @property {number} fixableWarningCount Number of fixable warnings for the result. + * @property {string} [source] The source code of the file that was linted. + * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible. + * @property {DeprecatedRuleInfo[]} usedDeprecatedRules The list of used deprecated rules. + */ + +/** + * Private members for the `ESLint` instance. + * @typedef {Object} ESLintPrivateMembers + * @property {CLIEngine} cliEngine The wrapped CLIEngine instance. + * @property {ESLintOptions} options The options used to instantiate the ESLint instance. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const writeFile = promisify(fs.writeFile); + +/** + * The map with which to store private class members. + * @type {WeakMap} + */ +const privateMembersMap = new WeakMap(); + +/** + * Check if a given value is a non-empty string or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is a non-empty string. + */ +function isNonEmptyString(x) { + return typeof x === "string" && x.trim() !== ""; +} + +/** + * Check if a given value is an array of non-empty stringss or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of non-empty stringss. + */ +function isArrayOfNonEmptyString(x) { + return Array.isArray(x) && x.every(isNonEmptyString); +} + +/** + * Check if a given value is a valid fix type or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is valid fix type. + */ +function isFixType(x) { + return x === "problem" || x === "suggestion" || x === "layout"; +} + +/** + * Check if a given value is an array of fix types or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if `x` is an array of fix types. + */ +function isFixTypeArray(x) { + return Array.isArray(x) && x.every(isFixType); +} + +/** + * The error for invalid options. + */ +class ESLintInvalidOptionsError extends Error { + constructor(messages) { + super(`Invalid Options:\n- ${messages.join("\n- ")}`); + this.code = "ESLINT_INVALID_OPTIONS"; + Error.captureStackTrace(this, ESLintInvalidOptionsError); + } +} + +/** + * Validates and normalizes options for the wrapped CLIEngine instance. + * @param {ESLintOptions} options The options to process. + * @returns {ESLintOptions} The normalized options. + */ +function processOptions({ + allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. + baseConfig = null, + cache = false, + cacheLocation = ".eslintcache", + cwd = process.cwd(), + errorOnUnmatchedPattern = true, + extensions = null, // ← should be null by default because if it's an array then it suppresses RFC20 feature. + fix = false, + fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property. + globInputPaths = true, + ignore = true, + ignorePath = null, // ← should be null by default because if it's a string then it may throw ENOENT. + overrideConfig = null, + overrideConfigFile = null, + plugins = {}, + reportUnusedDisableDirectives = null, // ← should be null by default because if it's a string then it overrides the 'reportUnusedDisableDirectives' setting in config files. And we cannot use `overrideConfig.reportUnusedDisableDirectives` instead because we cannot configure the `error` severity with that. + resolvePluginsRelativeTo = null, // ← should be null by default because if it's a string then it suppresses RFC47 feature. + rulePaths = [], + useEslintrc = true, + ...unknownOptions +}) { + const errors = []; + const unknownOptionKeys = Object.keys(unknownOptions); + + if (unknownOptionKeys.length >= 1) { + errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`); + if (unknownOptionKeys.includes("cacheFile")) { + errors.push("'cacheFile' has been removed. Please use the 'cacheLocation' option instead."); + } + if (unknownOptionKeys.includes("configFile")) { + errors.push("'configFile' has been removed. Please use the 'overrideConfigFile' option instead."); + } + if (unknownOptionKeys.includes("envs")) { + errors.push("'envs' has been removed. Please use the 'overrideConfig.env' option instead."); + } + if (unknownOptionKeys.includes("globals")) { + errors.push("'globals' has been removed. Please use the 'overrideConfig.globals' option instead."); + } + if (unknownOptionKeys.includes("ignorePattern")) { + errors.push("'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead."); + } + if (unknownOptionKeys.includes("parser")) { + errors.push("'parser' has been removed. Please use the 'overrideConfig.parser' option instead."); + } + if (unknownOptionKeys.includes("parserOptions")) { + errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.parserOptions' option instead."); + } + if (unknownOptionKeys.includes("rules")) { + errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); + } + } + if (typeof allowInlineConfig !== "boolean") { + errors.push("'allowInlineConfig' must be a boolean."); + } + if (typeof baseConfig !== "object") { + errors.push("'baseConfig' must be an object or null."); + } + if (typeof cache !== "boolean") { + errors.push("'cache' must be a boolean."); + } + if (!isNonEmptyString(cacheLocation)) { + errors.push("'cacheLocation' must be a non-empty string."); + } + if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) { + errors.push("'cwd' must be an absolute path."); + } + if (typeof errorOnUnmatchedPattern !== "boolean") { + errors.push("'errorOnUnmatchedPattern' must be a boolean."); + } + if (!isArrayOfNonEmptyString(extensions) && extensions !== null) { + errors.push("'extensions' must be an array of non-empty strings or null."); + } + if (typeof fix !== "boolean" && typeof fix !== "function") { + errors.push("'fix' must be a boolean or a function."); + } + if (fixTypes !== null && !isFixTypeArray(fixTypes)) { + errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\"."); + } + if (typeof globInputPaths !== "boolean") { + errors.push("'globInputPaths' must be a boolean."); + } + if (typeof ignore !== "boolean") { + errors.push("'ignore' must be a boolean."); + } + if (!isNonEmptyString(ignorePath) && ignorePath !== null) { + errors.push("'ignorePath' must be a non-empty string or null."); + } + if (typeof overrideConfig !== "object") { + errors.push("'overrideConfig' must be an object or null."); + } + if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null) { + errors.push("'overrideConfigFile' must be a non-empty string or null."); + } + if (typeof plugins !== "object") { + errors.push("'plugins' must be an object or null."); + } else if (plugins !== null && Object.keys(plugins).includes("")) { + errors.push("'plugins' must not include an empty string."); + } + if (Array.isArray(plugins)) { + errors.push("'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead."); + } + if ( + reportUnusedDisableDirectives !== "error" && + reportUnusedDisableDirectives !== "warn" && + reportUnusedDisableDirectives !== "off" && + reportUnusedDisableDirectives !== null + ) { + errors.push("'reportUnusedDisableDirectives' must be any of \"error\", \"warn\", \"off\", and null."); + } + if ( + !isNonEmptyString(resolvePluginsRelativeTo) && + resolvePluginsRelativeTo !== null + ) { + errors.push("'resolvePluginsRelativeTo' must be a non-empty string or null."); + } + if (!isArrayOfNonEmptyString(rulePaths)) { + errors.push("'rulePaths' must be an array of non-empty strings."); + } + if (typeof useEslintrc !== "boolean") { + errors.push("'useElintrc' must be a boolean."); + } + + if (errors.length > 0) { + throw new ESLintInvalidOptionsError(errors); + } + + return { + allowInlineConfig, + baseConfig, + cache, + cacheLocation, + configFile: overrideConfigFile, + cwd, + errorOnUnmatchedPattern, + extensions, + fix, + fixTypes, + globInputPaths, + ignore, + ignorePath, + reportUnusedDisableDirectives, + resolvePluginsRelativeTo, + rulePaths, + useEslintrc + }; +} + +/** + * Check if a value has one or more properties and that value is not undefined. + * @param {any} obj The value to check. + * @returns {boolean} `true` if `obj` has one or more properties that that value is not undefined. + */ +function hasDefinedProperty(obj) { + if (typeof obj === "object" && obj !== null) { + for (const key in obj) { + if (typeof obj[key] !== "undefined") { + return true; + } + } + } + return false; +} + +/** + * Create rulesMeta object. + * @param {Map} rules a map of rules from which to generate the object. + * @returns {Object} metadata for all enabled rules. + */ +function createRulesMeta(rules) { + return Array.from(rules).reduce((retVal, [id, rule]) => { + retVal[id] = rule.meta; + return retVal; + }, {}); +} + +/** @type {WeakMap} */ +const usedDeprecatedRulesCache = new WeakMap(); + +/** + * Create used deprecated rule list. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {string} maybeFilePath The absolute path to a lint target file or `""`. + * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. + */ +function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { + const { + configArrayFactory, + options: { cwd } + } = getCLIEngineInternalSlots(cliEngine); + const filePath = path.isAbsolute(maybeFilePath) + ? maybeFilePath + : path.join(cwd, "__placeholder__.js"); + const configArray = configArrayFactory.getConfigArrayForFile(filePath); + const config = configArray.extractConfig(filePath); + + // Most files use the same config, so cache it. + if (!usedDeprecatedRulesCache.has(config)) { + const pluginRules = configArray.pluginRules; + const retv = []; + + for (const [ruleId, ruleConf] of Object.entries(config.rules)) { + if (getRuleSeverity(ruleConf) === 0) { + continue; + } + const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId); + const meta = rule && rule.meta; + + if (meta && meta.deprecated) { + retv.push({ ruleId, replacedBy: meta.replacedBy || [] }); + } + } + + usedDeprecatedRulesCache.set(config, Object.freeze(retv)); + } + + return usedDeprecatedRulesCache.get(config); +} + +/** + * Processes the linting results generated by a CLIEngine linting report to + * match the ESLint class's API. + * @param {CLIEngine} cliEngine The CLIEngine instance. + * @param {CLIEngineLintReport} report The CLIEngine linting report to process. + * @returns {LintResult[]} The processed linting results. + */ +function processCLIEngineLintReport(cliEngine, { results }) { + const descriptor = { + configurable: true, + enumerable: true, + get() { + return getOrFindUsedDeprecatedRules(cliEngine, this.filePath); + } + }; + + for (const result of results) { + Object.defineProperty(result, "usedDeprecatedRules", descriptor); + } + + return results; +} + +/** + * An Array.prototype.sort() compatible compare function to order results by their file path. + * @param {LintResult} a The first lint result. + * @param {LintResult} b The second lint result. + * @returns {number} An integer representing the order in which the two results should occur. + */ +function compareResultsByFilePath(a, b) { + if (a.filePath < b.filePath) { + return -1; + } + + if (a.filePath > b.filePath) { + return 1; + } + + return 0; +} + +class ESLint { + + /** + * Creates a new instance of the main ESLint API. + * @param {ESLintOptions} options The options for this instance. + */ + constructor(options = {}) { + const processedOptions = processOptions(options); + const cliEngine = new CLIEngine(processedOptions); + const { + additionalPluginPool, + configArrayFactory, + lastConfigArrays + } = getCLIEngineInternalSlots(cliEngine); + let updated = false; + + /* + * Address `plugins` to add plugin implementations. + * Operate the `additionalPluginPool` internal slot directly to avoid + * using `addPlugin(id, plugin)` method that resets cache everytime. + */ + if (options.plugins) { + for (const [id, plugin] of Object.entries(options.plugins)) { + additionalPluginPool.set(id, plugin); + updated = true; + } + } + + /* + * Address `overrideConfig` to set override config. + * Operate the `configArrayFactory` internal slot directly because this + * functionality doesn't exist as the public API of CLIEngine. + */ + if (hasDefinedProperty(options.overrideConfig)) { + configArrayFactory.setOverrideConfig(options.overrideConfig); + updated = true; + } + + // Update caches. + if (updated) { + configArrayFactory.clearCache(); + lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); + } + + // Initialize private properties. + privateMembersMap.set(this, { + cliEngine, + options: processedOptions + }); + } + + /** + * The version text. + * @type {string} + */ + static get version() { + return version; + } + + /** + * Outputs fixes from the given results to files. + * @param {LintResult[]} results The lint results. + * @returns {Promise} Returns a promise that is used to track side effects. + */ + static async outputFixes(results) { + if (!Array.isArray(results)) { + throw new Error("'results' must be an array"); + } + + await Promise.all( + results + .filter(result => { + if (typeof result !== "object" || result === null) { + throw new Error("'results' must include only objects"); + } + return ( + typeof result.output === "string" && + path.isAbsolute(result.filePath) + ); + }) + .map(r => writeFile(r.filePath, r.output)) + ); + } + + /** + * Returns results that only contains errors. + * @param {LintResult[]} results The results to filter. + * @returns {LintResult[]} The filtered results. + */ + static getErrorResults(results) { + return CLIEngine.getErrorResults(results); + } + + /** + * Executes the current configuration on an array of file and directory names. + * @param {string[]} patterns An array of file and directory names. + * @returns {Promise} The results of linting the file patterns given. + */ + async lintFiles(patterns) { + if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) { + throw new Error("'patterns' must be a non-empty string or an array of non-empty strings"); + } + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnFiles(patterns) + ); + } + + /** + * Executes the current configuration on text. + * @param {string} code A string of JavaScript code to lint. + * @param {Object} [options] The options. + * @param {string} [options.filePath] The path to the file of the source code. + * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path. + * @returns {Promise} The results of linting the string of code given. + */ + async lintText(code, options = {}) { + if (typeof code !== "string") { + throw new Error("'code' must be a string"); + } + if (typeof options !== "object") { + throw new Error("'options' must be an object, null, or undefined"); + } + const { + filePath, + warnIgnored = false, + ...unknownOptions + } = options || {}; + + for (const key of Object.keys(unknownOptions)) { + throw new Error(`'options' must not include the unknown option '${key}'`); + } + if (filePath !== void 0 && !isNonEmptyString(filePath)) { + throw new Error("'options.filePath' must be a non-empty string or undefined"); + } + if (typeof warnIgnored !== "boolean") { + throw new Error("'options.warnIgnored' must be a boolean or undefined"); + } + + const { cliEngine } = privateMembersMap.get(this); + + return processCLIEngineLintReport( + cliEngine, + cliEngine.executeOnText(code, filePath, warnIgnored) + ); + } + + /** + * Returns the formatter representing the given formatter name. + * @param {string} [name] The name of the formattter to load. + * The following values are allowed: + * - `undefined` ... Load `stylish` builtin formatter. + * - A builtin formatter name ... Load the builtin formatter. + * - A thirdparty formatter name: + * - `foo` → `eslint-formatter-foo` + * - `@foo` → `@foo/eslint-formatter` + * - `@foo/bar` → `@foo/eslint-formatter-bar` + * - A file path ... Load the file. + * @returns {Promise} A promise resolving to the formatter object. + * This promise will be rejected if the given formatter was not found or not + * a function. + */ + async loadFormatter(name = "stylish") { + if (typeof name !== "string") { + throw new Error("'name' must be a string"); + } + + const { cliEngine } = privateMembersMap.get(this); + const formatter = cliEngine.getFormatter(name); + + if (typeof formatter !== "function") { + throw new Error(`Formatter must be a function, but got a ${typeof formatter}.`); + } + + return { + + /** + * The main formatter method. + * @param {LintResults[]} results The lint results to format. + * @returns {string} The formatted lint results. + */ + format(results) { + let rulesMeta = null; + + results.sort(compareResultsByFilePath); + + return formatter(results, { + get rulesMeta() { + if (!rulesMeta) { + rulesMeta = createRulesMeta(cliEngine.getRules()); + } + + return rulesMeta; + } + }); + } + }; + } + + /** + * Returns a configuration object for the given file based on the CLI options. + * This is the same logic used by the ESLint CLI executable to determine + * configuration for each file it processes. + * @param {string} filePath The path of the file to retrieve a config object for. + * @returns {Promise} A configuration object for the file. + */ + async calculateConfigForFile(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.getConfigForFile(filePath); + } + + /** + * Checks if a given path is ignored by ESLint. + * @param {string} filePath The path of the file to check. + * @returns {Promise} Whether or not the given path is ignored. + */ + async isPathIgnored(filePath) { + if (!isNonEmptyString(filePath)) { + throw new Error("'filePath' must be a non-empty string"); + } + const { cliEngine } = privateMembersMap.get(this); + + return cliEngine.isPathIgnored(filePath); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + ESLint, + + /** + * Get the private class members of a given ESLint instance for tests. + * @param {ESLint} instance The ESLint instance to get. + * @returns {ESLintPrivateMembers} The instance's private class members. + */ + getESLintPrivateMembers(instance) { + return privateMembersMap.get(instance); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/eslint/index.js b/day1/cli-study/node_modules/eslint/lib/eslint/index.js new file mode 100644 index 0000000..c9185ee --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/eslint/index.js @@ -0,0 +1,7 @@ +"use strict"; + +const { ESLint } = require("./eslint"); + +module.exports = { + ESLint +}; diff --git a/day1/cli-study/node_modules/eslint/lib/init/autoconfig.js b/day1/cli-study/node_modules/eslint/lib/init/autoconfig.js new file mode 100644 index 0000000..2b0aa12 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/autoconfig.js @@ -0,0 +1,348 @@ +/** + * @fileoverview Used for creating a suggested configuration based on project code. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("../shared/config-ops"), + { Linter } = require("../linter"), + configRule = require("./config-rule"); + +const debug = require("debug")("eslint:autoconfig"); +const linter = new Linter(); + +//------------------------------------------------------------------------------ +// Data +//------------------------------------------------------------------------------ + +const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only + RECOMMENDED_CONFIG_NAME = "eslint:recommended"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Information about a rule configuration, in the context of a Registry. + * @typedef {Object} registryItem + * @param {ruleConfig} config A valid configuration for the rule + * @param {number} specificity The number of elements in the ruleConfig array + * @param {number} errorCount The number of errors encountered when linting with the config + */ + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Create registryItems for rules + * @param {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items + * @returns {Object} registryItems for each rule in provided rulesConfig + */ +function makeRegistryItems(rulesConfig) { + return Object.keys(rulesConfig).reduce((accumulator, ruleId) => { + accumulator[ruleId] = rulesConfig[ruleId].map(config => ({ + config, + specificity: config.length || 1, + errorCount: void 0 + })); + return accumulator; + }, {}); +} + +/** + * Creates an object in which to store rule configs and error counts + * + * Unless a rulesConfig is provided at construction, the registry will not contain + * any rules, only methods. This will be useful for building up registries manually. + * + * Registry class + */ +class Registry { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations + */ + constructor(rulesConfig) { + this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {}; + } + + /** + * Populate the registry with core rule configs. + * + * It will set the registry's `rule` property to an object having rule names + * as keys and an array of registryItems as values. + * @returns {void} + */ + populateFromCoreRules() { + const rulesConfig = configRule.createCoreRuleConfigs(); + + this.rules = makeRegistryItems(rulesConfig); + } + + /** + * Creates sets of rule configurations which can be used for linting + * and initializes registry errors to zero for those configurations (side effect). + * + * This combines as many rules together as possible, such that the first sets + * in the array will have the highest number of rules configured, and later sets + * will have fewer and fewer, as not all rules have the same number of possible + * configurations. + * + * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. + * @returns {Object[]} "rules" configurations to use for linting + */ + buildRuleSets() { + let idx = 0; + const ruleIds = Object.keys(this.rules), + ruleSets = []; + + /** + * Add a rule configuration from the registry to the ruleSets + * + * This is broken out into its own function so that it doesn't need to be + * created inside of the while loop. + * @param {string} rule The ruleId to add. + * @returns {void} + */ + const addRuleToRuleSet = function(rule) { + + /* + * This check ensures that there is a rule configuration and that + * it has fewer than the max combinations allowed. + * If it has too many configs, we will only use the most basic of + * the possible configurations. + */ + const hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS); + + if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) { + + /* + * If the rule has too many possible combinations, only take + * simple ones, avoiding objects. + */ + if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") { + return; + } + + ruleSets[idx] = ruleSets[idx] || {}; + ruleSets[idx][rule] = this.rules[rule][idx].config; + + /* + * Initialize errorCount to zero, since this is a config which + * will be linted. + */ + this.rules[rule][idx].errorCount = 0; + } + }.bind(this); + + while (ruleSets.length === idx) { + ruleIds.forEach(addRuleToRuleSet); + idx += 1; + } + + return ruleSets; + } + + /** + * Remove all items from the registry with a non-zero number of errors + * + * Note: this also removes rule configurations which were not linted + * (meaning, they have an undefined errorCount). + * @returns {void} + */ + stripFailingConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + const errorFreeItems = newRegistry.rules[ruleId].filter(registryItem => (registryItem.errorCount === 0)); + + if (errorFreeItems.length > 0) { + newRegistry.rules[ruleId] = errorFreeItems; + } else { + delete newRegistry.rules[ruleId]; + } + }); + + return newRegistry; + } + + /** + * Removes rule configurations which were not included in a ruleSet + * @returns {void} + */ + stripExtraConfigs() { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(registryItem => (typeof registryItem.errorCount !== "undefined")); + }); + + return newRegistry; + } + + /** + * Creates a registry of rules which had no error-free configs. + * The new registry is intended to be analyzed to determine whether its rules + * should be disabled or set to warning. + * @returns {Registry} A registry of failing rules. + */ + getFailingRulesRegistry() { + const ruleIds = Object.keys(this.rules), + failingRegistry = new Registry(); + + ruleIds.forEach(ruleId => { + const failingConfigs = this.rules[ruleId].filter(registryItem => (registryItem.errorCount > 0)); + + if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) { + failingRegistry.rules[ruleId] = failingConfigs; + } + }); + + return failingRegistry; + } + + /** + * Create an eslint config for any rules which only have one configuration + * in the registry. + * @returns {Object} An eslint config with rules section populated + */ + createConfig() { + const ruleIds = Object.keys(this.rules), + config = { rules: {} }; + + ruleIds.forEach(ruleId => { + if (this.rules[ruleId].length === 1) { + config.rules[ruleId] = this.rules[ruleId][0].config; + } + }); + + return config; + } + + /** + * Return a cloned registry containing only configs with a desired specificity + * @param {number} specificity Only keep configs with this specificity + * @returns {Registry} A registry of rules + */ + filterBySpecificity(specificity) { + const ruleIds = Object.keys(this.rules), + newRegistry = new Registry(); + + newRegistry.rules = Object.assign({}, this.rules); + ruleIds.forEach(ruleId => { + newRegistry.rules[ruleId] = this.rules[ruleId].filter(registryItem => (registryItem.specificity === specificity)); + }); + + return newRegistry; + } + + /** + * Lint SourceCodes against all configurations in the registry, and record results + * @param {Object[]} sourceCodes SourceCode objects for each filename + * @param {Object} config ESLint config object + * @param {progressCallback} [cb] Optional callback for reporting execution status + * @returns {Registry} New registry with errorCount populated + */ + lintSourceCode(sourceCodes, config, cb) { + let lintedRegistry = new Registry(); + + lintedRegistry.rules = Object.assign({}, this.rules); + + const ruleSets = lintedRegistry.buildRuleSets(); + + lintedRegistry = lintedRegistry.stripExtraConfigs(); + + debug("Linting with all possible rule combinations"); + + const filenames = Object.keys(sourceCodes); + const totalFilesLinting = filenames.length * ruleSets.length; + + filenames.forEach(filename => { + debug(`Linting file: ${filename}`); + + let ruleSetIdx = 0; + + ruleSets.forEach(ruleSet => { + const lintConfig = Object.assign({}, config, { rules: ruleSet }); + const lintResults = linter.verify(sourceCodes[filename], lintConfig); + + lintResults.forEach(result => { + + /* + * It is possible that the error is from a configuration comment + * in a linted file, in which case there may not be a config + * set in this ruleSetIdx. + * (https://github.com/eslint/eslint/issues/5992) + * (https://github.com/eslint/eslint/issues/7860) + */ + if ( + lintedRegistry.rules[result.ruleId] && + lintedRegistry.rules[result.ruleId][ruleSetIdx] + ) { + lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1; + } + }); + + ruleSetIdx += 1; + + if (cb) { + cb(totalFilesLinting); // eslint-disable-line node/callback-return + } + }); + + // Deallocate for GC + sourceCodes[filename] = null; + }); + + return lintedRegistry; + } +} + +/** + * Extract rule configuration into eslint:recommended where possible. + * + * This will return a new config with `["extends": [ ..., "eslint:recommended"]` and + * only the rules which have configurations different from the recommended config. + * @param {Object} config config object + * @returns {Object} config object using `"extends": ["eslint:recommended"]` + */ +function extendFromRecommended(config) { + const newConfig = Object.assign({}, config); + + ConfigOps.normalizeToStrings(newConfig); + + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + recRules.forEach(ruleId => { + if (lodash.isEqual(recConfig.rules[ruleId], newConfig.rules[ruleId])) { + delete newConfig.rules[ruleId]; + } + }); + newConfig.extends.unshift(RECOMMENDED_CONFIG_NAME); + return newConfig; +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + Registry, + extendFromRecommended +}; diff --git a/day1/cli-study/node_modules/eslint/lib/init/config-file.js b/day1/cli-study/node_modules/eslint/lib/init/config-file.js new file mode 100644 index 0000000..fc62b81 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/config-file.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Helper to locate and load configuration files. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + path = require("path"), + stringify = require("json-stable-stringify-without-jsonify"); + +const debug = require("debug")("eslint:config-file"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines sort order for object keys for json-stable-stringify + * + * see: https://github.com/samn/json-stable-stringify#cmp + * @param {Object} a The first comparison object ({key: akey, value: avalue}) + * @param {Object} b The second comparison object ({key: bkey, value: bvalue}) + * @returns {number} 1 or -1, used in stringify cmp method + */ +function sortByKey(a, b) { + return a.key > b.key ? 1 : -1; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Writes a configuration file in JSON format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeJSONConfigFile(config, filePath) { + debug(`Writing JSON config file: ${filePath}`); + + const content = `${stringify(config, { cmp: sortByKey, space: 4 })}\n`; + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in YAML format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @private + */ +function writeYAMLConfigFile(config, filePath) { + debug(`Writing YAML config file: ${filePath}`); + + // lazy load YAML to improve performance when not used + const yaml = require("js-yaml"); + + const content = yaml.safeDump(config, { sortKeys: true }); + + fs.writeFileSync(filePath, content, "utf8"); +} + +/** + * Writes a configuration file in JavaScript format. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @throws {Error} If an error occurs linting the config file contents. + * @returns {void} + * @private + */ +function writeJSConfigFile(config, filePath) { + debug(`Writing JS config file: ${filePath}`); + + let contentToWrite; + const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};\n`; + + try { + const { CLIEngine } = require("../cli-engine"); + const linter = new CLIEngine({ + baseConfig: config, + fix: true, + useEslintrc: false + }); + const report = linter.executeOnText(stringifiedContent); + + contentToWrite = report.results[0].output || stringifiedContent; + } catch (e) { + debug("Error linting JavaScript config file, writing unlinted version"); + const errorMessage = e.message; + + contentToWrite = stringifiedContent; + e.message = "An error occurred while generating your JavaScript config file. "; + e.message += "A config file was still generated, but the config file itself may not follow your linting rules."; + e.message += `\nError: ${errorMessage}`; + throw e; + } finally { + fs.writeFileSync(filePath, contentToWrite, "utf8"); + } +} + +/** + * Writes a configuration file. + * @param {Object} config The configuration object to write. + * @param {string} filePath The filename to write to. + * @returns {void} + * @throws {Error} When an unknown file type is specified. + * @private + */ +function write(config, filePath) { + switch (path.extname(filePath)) { + case ".js": + writeJSConfigFile(config, filePath); + break; + + case ".json": + writeJSONConfigFile(config, filePath); + break; + + case ".yaml": + case ".yml": + writeYAMLConfigFile(config, filePath); + break; + + default: + throw new Error("Can't write to unknown file type."); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + write +}; diff --git a/day1/cli-study/node_modules/eslint/lib/init/config-initializer.js b/day1/cli-study/node_modules/eslint/lib/init/config-initializer.js new file mode 100644 index 0000000..e14f1cb --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/config-initializer.js @@ -0,0 +1,690 @@ +/** + * @fileoverview Config initialization wizard. + * @author Ilya Volodin + */ + + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const util = require("util"), + path = require("path"), + enquirer = require("enquirer"), + ProgressBar = require("progress"), + semver = require("semver"), + espree = require("espree"), + recConfig = require("../../conf/eslint-recommended"), + ConfigOps = require("../shared/config-ops"), + log = require("../shared/logging"), + naming = require("../shared/naming"), + ModuleResolver = require("../shared/relative-module-resolver"), + autoconfig = require("./autoconfig.js"), + ConfigFile = require("./config-file"), + npmUtils = require("./npm-utils"), + { getSourceCodeOfFiles } = require("./source-code-utils"); + +const debug = require("debug")("eslint:config-initializer"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/* istanbul ignore next: hard to test fs function */ +/** + * Create .eslintrc file in the current working directory + * @param {Object} config object that contains user's answers + * @param {string} format The file format to write to. + * @returns {void} + */ +function writeFile(config, format) { + + // default is .js + let extname = ".js"; + + if (format === "YAML") { + extname = ".yml"; + } else if (format === "JSON") { + extname = ".json"; + } + + const installedESLint = config.installedESLint; + + delete config.installedESLint; + + ConfigFile.write(config, `./.eslintrc${extname}`); + log.info(`Successfully created .eslintrc${extname} file in ${process.cwd()}`); + + if (installedESLint) { + log.info("ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy."); + } +} + +/** + * Get the peer dependencies of the given module. + * This adds the gotten value to cache at the first time, then reuses it. + * In a process, this function is called twice, but `npmUtils.fetchPeerDependencies` needs to access network which is relatively slow. + * @param {string} moduleName The module name to get. + * @returns {Object} The peer dependencies of the given module. + * This object is the object of `peerDependencies` field of `package.json`. + * Returns null if npm was not found. + */ +function getPeerDependencies(moduleName) { + let result = getPeerDependencies.cache.get(moduleName); + + if (!result) { + log.info(`Checking peerDependencies of ${moduleName}`); + + result = npmUtils.fetchPeerDependencies(moduleName); + getPeerDependencies.cache.set(moduleName, result); + } + + return result; +} +getPeerDependencies.cache = new Map(); + +/** + * Return necessary plugins, configs, parsers, etc. based on the config + * @param {Object} config config object + * @param {boolean} [installESLint=true] If `false` is given, it does not install eslint. + * @returns {string[]} An array of modules to be installed. + */ +function getModulesList(config, installESLint) { + const modules = {}; + + // Create a list of modules which should be installed based on config + if (config.plugins) { + for (const plugin of config.plugins) { + const moduleName = naming.normalizePackageName(plugin, "eslint-plugin"); + + modules[moduleName] = "latest"; + } + } + if (config.extends) { + const extendList = Array.isArray(config.extends) ? config.extends : [config.extends]; + + for (const extend of extendList) { + if (extend.startsWith("eslint:") || extend.startsWith("plugin:")) { + continue; + } + const moduleName = naming.normalizePackageName(extend, "eslint-config"); + + modules[moduleName] = "latest"; + Object.assign( + modules, + getPeerDependencies(`${moduleName}@latest`) + ); + } + } + + const parser = config.parser || (config.parserOptions && config.parserOptions.parser); + + if (parser) { + modules[parser] = "latest"; + } + + if (installESLint === false) { + delete modules.eslint; + } else { + const installStatus = npmUtils.checkDevDeps(["eslint"]); + + // Mark to show messages if it's new installation of eslint. + if (installStatus.eslint === false) { + log.info("Local ESLint installation not found."); + modules.eslint = modules.eslint || "latest"; + config.installedESLint = true; + } + } + + return Object.keys(modules).map(name => `${name}@${modules[name]}`); +} + +/** + * Set the `rules` of a config by examining a user's source code + * + * Note: This clones the config object and returns a new config to avoid mutating + * the original config parameter. + * @param {Object} answers answers received from enquirer + * @param {Object} config config object + * @returns {Object} config object with configured rules + */ +function configureRules(answers, config) { + const BAR_TOTAL = 20, + BAR_SOURCE_CODE_TOTAL = 4, + newConfig = Object.assign({}, config), + disabledConfigs = {}; + let sourceCodes, + registry; + + // Set up a progress bar, as this process can take a long time + const bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", { + width: 30, + total: BAR_TOTAL + }); + + bar.tick(0); // Shows the progress bar + + // Get the SourceCode of all chosen files + const patterns = answers.patterns.split(/[\s]+/u); + + try { + sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, total => { + bar.tick((BAR_SOURCE_CODE_TOTAL / total)); + }); + } catch (e) { + log.info("\n"); + throw e; + } + const fileQty = Object.keys(sourceCodes).length; + + if (fileQty === 0) { + log.info("\n"); + throw new Error("Automatic Configuration failed. No files were able to be parsed."); + } + + // Create a registry of rule configs + registry = new autoconfig.Registry(); + registry.populateFromCoreRules(); + + // Lint all files with each rule config in the registry + registry = registry.lintSourceCode(sourceCodes, newConfig, total => { + bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning + }); + debug(`\nRegistry: ${util.inspect(registry.rules, { depth: null })}`); + + // Create a list of recommended rules, because we don't want to disable them + const recRules = Object.keys(recConfig.rules).filter(ruleId => ConfigOps.isErrorSeverity(recConfig.rules[ruleId])); + + // Find and disable rules which had no error-free configuration + const failingRegistry = registry.getFailingRulesRegistry(); + + Object.keys(failingRegistry.rules).forEach(ruleId => { + + // If the rule is recommended, set it to error, otherwise disable it + disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0; + }); + + // Now that we know which rules to disable, strip out configs with errors + registry = registry.stripFailingConfigs(); + + /* + * If there is only one config that results in no errors for a rule, we should use it. + * createConfig will only add rules that have one configuration in the registry. + */ + const singleConfigs = registry.createConfig().rules; + + /* + * The "sweet spot" for number of options in a config seems to be two (severity plus one option). + * Very often, a third option (usually an object) is available to address + * edge cases, exceptions, or unique situations. We will prefer to use a config with + * specificity of two. + */ + const specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules; + + // Maybe a specific combination using all three options works + const specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules; + + // If all else fails, try to use the default (severity only) + const defaultConfigs = registry.filterBySpecificity(1).createConfig().rules; + + // Combine configs in reverse priority order (later take precedence) + newConfig.rules = Object.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs); + + // Make sure progress bar has finished (floating point rounding) + bar.update(BAR_TOTAL); + + // Log out some stats to let the user know what happened + const finalRuleIds = Object.keys(newConfig.rules); + const totalRules = finalRuleIds.length; + const enabledRules = finalRuleIds.filter(ruleId => (newConfig.rules[ruleId] !== 0)).length; + const resultMessage = [ + `\nEnabled ${enabledRules} out of ${totalRules}`, + `rules based on ${fileQty}`, + `file${(fileQty === 1) ? "." : "s."}` + ].join(" "); + + log.info(resultMessage); + + ConfigOps.normalizeToStrings(newConfig); + return newConfig; +} + +/** + * process user's answers and create config object + * @param {Object} answers answers received from enquirer + * @returns {Object} config object + */ +function processAnswers(answers) { + let config = { + rules: {}, + env: {}, + parserOptions: {}, + extends: [] + }; + + config.parserOptions.ecmaVersion = espree.latestEcmaVersion; + config.env.es2020 = true; + + // set the module type + if (answers.moduleType === "esm") { + config.parserOptions.sourceType = "module"; + } else if (answers.moduleType === "commonjs") { + config.env.commonjs = true; + } + + // add in browser and node environments if necessary + answers.env.forEach(env => { + config.env[env] = true; + }); + + // add in library information + if (answers.framework === "react") { + config.parserOptions.ecmaFeatures = { + jsx: true + }; + config.plugins = ["react"]; + config.extends.push("plugin:react/recommended"); + } else if (answers.framework === "vue") { + config.plugins = ["vue"]; + config.extends.push("plugin:vue/essential"); + } + + if (answers.typescript) { + if (answers.framework === "vue") { + config.parserOptions.parser = "@typescript-eslint/parser"; + } else { + config.parser = "@typescript-eslint/parser"; + } + + if (Array.isArray(config.plugins)) { + config.plugins.push("@typescript-eslint"); + } else { + config.plugins = ["@typescript-eslint"]; + } + } + + // setup rules based on problems/style enforcement preferences + if (answers.purpose === "problems") { + config.extends.unshift("eslint:recommended"); + } else if (answers.purpose === "style") { + if (answers.source === "prompt") { + config.extends.unshift("eslint:recommended"); + config.rules.indent = ["error", answers.indent]; + config.rules.quotes = ["error", answers.quotes]; + config.rules["linebreak-style"] = ["error", answers.linebreak]; + config.rules.semi = ["error", answers.semi ? "always" : "never"]; + } else if (answers.source === "auto") { + config = configureRules(answers, config); + config = autoconfig.extendFromRecommended(config); + } + } + if (answers.typescript && config.extends.includes("eslint:recommended")) { + config.extends.push("plugin:@typescript-eslint/recommended"); + } + + // normalize extends + if (config.extends.length === 0) { + delete config.extends; + } else if (config.extends.length === 1) { + config.extends = config.extends[0]; + } + + ConfigOps.normalizeToStrings(config); + return config; +} + +/** + * Get the version of the local ESLint. + * @returns {string|null} The version. If the local ESLint was not found, returns null. + */ +function getLocalESLintVersion() { + try { + const eslintPath = ModuleResolver.resolve("eslint", path.join(process.cwd(), "__placeholder__.js")); + const eslint = require(eslintPath); + + return eslint.linter.version || null; + } catch { + return null; + } +} + +/** + * Get the shareable config name of the chosen style guide. + * @param {Object} answers The answers object. + * @returns {string} The shareable config name. + */ +function getStyleGuideName(answers) { + if (answers.styleguide === "airbnb" && answers.framework !== "react") { + return "airbnb-base"; + } + return answers.styleguide; +} + +/** + * Check whether the local ESLint version conflicts with the required version of the chosen shareable config. + * @param {Object} answers The answers object. + * @returns {boolean} `true` if the local ESLint is found then it conflicts with the required version of the chosen shareable config. + */ +function hasESLintVersionConflict(answers) { + + // Get the local ESLint version. + const localESLintVersion = getLocalESLintVersion(); + + if (!localESLintVersion) { + return false; + } + + // Get the required range of ESLint version. + const configName = getStyleGuideName(answers); + const moduleName = `eslint-config-${configName}@latest`; + const peerDependencies = getPeerDependencies(moduleName) || {}; + const requiredESLintVersionRange = peerDependencies.eslint; + + if (!requiredESLintVersionRange) { + return false; + } + + answers.localESLintVersion = localESLintVersion; + answers.requiredESLintVersionRange = requiredESLintVersionRange; + + // Check the version. + if (semver.satisfies(localESLintVersion, requiredESLintVersionRange)) { + answers.installESLint = false; + return false; + } + + return true; +} + +/** + * Install modules. + * @param {string[]} modules Modules to be installed. + * @returns {void} + */ +function installModules(modules) { + log.info(`Installing ${modules.join(", ")}`); + npmUtils.installSyncSaveDev(modules); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask user to install modules. + * @param {string[]} modules Array of modules to be installed. + * @param {boolean} packageJsonExists Indicates if package.json is existed. + * @returns {Promise} Answer that indicates if user wants to install. + */ +function askInstallModules(modules, packageJsonExists) { + + // If no modules, do nothing. + if (modules.length === 0) { + return Promise.resolve(); + } + + log.info("The config that you've selected requires the following dependencies:\n"); + log.info(modules.join(" ")); + return enquirer.prompt([ + { + type: "toggle", + name: "executeInstallation", + message: "Would you like to install them now with npm?", + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(modules.length && packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(({ executeInstallation }) => { + if (executeInstallation) { + installModules(modules); + } + }); +} + +/* istanbul ignore next: no need to test enquirer */ +/** + * Ask use a few questions on command prompt + * @returns {Promise} The promise with the result of the prompt + */ +function promptUser() { + + return enquirer.prompt([ + { + type: "select", + name: "purpose", + message: "How would you like to use ESLint?", + + // The returned number matches the name value of nth in the choices array. + initial: 1, + choices: [ + { message: "To check syntax only", name: "syntax" }, + { message: "To check syntax and find problems", name: "problems" }, + { message: "To check syntax, find problems, and enforce code style", name: "style" } + ] + }, + { + type: "select", + name: "moduleType", + message: "What type of modules does your project use?", + initial: 0, + choices: [ + { message: "JavaScript modules (import/export)", name: "esm" }, + { message: "CommonJS (require/exports)", name: "commonjs" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "select", + name: "framework", + message: "Which framework does your project use?", + initial: 0, + choices: [ + { message: "React", name: "react" }, + { message: "Vue.js", name: "vue" }, + { message: "None of these", name: "none" } + ] + }, + { + type: "toggle", + name: "typescript", + message: "Does your project use TypeScript?", + enabled: "Yes", + disabled: "No", + initial: 0 + }, + { + type: "multiselect", + name: "env", + message: "Where does your code run?", + hint: "(Press to select, to toggle all, to invert selection)", + initial: 0, + choices: [ + { message: "Browser", name: "browser" }, + { message: "Node", name: "node" } + ] + }, + { + type: "select", + name: "source", + message: "How would you like to define a style for your project?", + choices: [ + { message: "Use a popular style guide", name: "guide" }, + { message: "Answer questions about your style", name: "prompt" }, + { message: "Inspect your JavaScript file(s)", name: "auto" } + ], + skip() { + return this.state.answers.purpose !== "style"; + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "select", + name: "styleguide", + message: "Which style guide do you want to follow?", + choices: [ + { message: "Airbnb: https://github.com/airbnb/javascript", name: "airbnb" }, + { message: "Standard: https://github.com/standard/standard", name: "standard" }, + { message: "Google: https://github.com/google/eslint-config-google", name: "google" } + ], + skip() { + this.state.answers.packageJsonExists = npmUtils.checkPackageJson(); + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists); + }, + result(input) { + return this.skipped ? null : input; + } + }, + { + type: "input", + name: "patterns", + message: "Which file(s), path(s), or glob(s) should be examined?", + skip() { + return this.state.answers.source !== "auto"; + }, + validate(input) { + if (!this.skipped && input.trim().length === 0 && input.trim() !== ",") { + return "You must tell us what code to examine. Try again."; + } + return true; + } + }, + { + type: "select", + name: "format", + message: "What format do you want your config file to be in?", + initial: 0, + choices: ["JavaScript", "YAML", "JSON"] + }, + { + type: "toggle", + name: "installESLint", + message(answers) { + const verb = semver.ltr(answers.localESLintVersion, answers.requiredESLintVersionRange) + ? "upgrade" + : "downgrade"; + + return `The style guide "${answers.styleguide}" requires eslint@${answers.requiredESLintVersionRange}. You are currently using eslint@${answers.localESLintVersion}.\n Do you want to ${verb}?`; + }, + enabled: "Yes", + disabled: "No", + initial: 1, + skip() { + return !(this.state.answers.source === "guide" && this.state.answers.packageJsonExists && hasESLintVersionConflict(this.state.answers)); + }, + result(input) { + return this.skipped ? null : input; + } + } + ]).then(earlyAnswers => { + + // early exit if no style guide is necessary + if (earlyAnswers.purpose !== "style") { + const config = processAnswers(earlyAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + } + + // early exit if you are using a style guide + if (earlyAnswers.source === "guide") { + if (!earlyAnswers.packageJsonExists) { + log.info("A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again."); + return void 0; + } + if (earlyAnswers.installESLint === false && !semver.satisfies(earlyAnswers.localESLintVersion, earlyAnswers.requiredESLintVersionRange)) { + log.info(`Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`); + } + if (earlyAnswers.styleguide === "airbnb" && earlyAnswers.framework !== "react") { + earlyAnswers.styleguide = "airbnb-base"; + } + + const config = processAnswers(earlyAnswers); + + if (Array.isArray(config.extends)) { + config.extends.push(earlyAnswers.styleguide); + } else if (config.extends) { + config.extends = [config.extends, earlyAnswers.styleguide]; + } else { + config.extends = [earlyAnswers.styleguide]; + } + + const modules = getModulesList(config); + + return askInstallModules(modules, earlyAnswers.packageJsonExists) + .then(() => writeFile(config, earlyAnswers.format)); + + } + + if (earlyAnswers.source === "auto") { + const combinedAnswers = Object.assign({}, earlyAnswers); + const config = processAnswers(combinedAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + } + + // continue with the style questions otherwise... + return enquirer.prompt([ + { + type: "select", + name: "indent", + message: "What style of indentation do you use?", + initial: 0, + choices: [{ message: "Tabs", name: "tab" }, { message: "Spaces", name: 4 }] + }, + { + type: "select", + name: "quotes", + message: "What quotes do you use for strings?", + initial: 0, + choices: [{ message: "Double", name: "double" }, { message: "Single", name: "single" }] + }, + { + type: "select", + name: "linebreak", + message: "What line endings do you use?", + initial: 0, + choices: [{ message: "Unix", name: "unix" }, { message: "Windows", name: "windows" }] + }, + { + type: "toggle", + name: "semi", + message: "Do you require semicolons?", + enabled: "Yes", + disabled: "No", + initial: 1 + } + ]).then(answers => { + const totalAnswers = Object.assign({}, earlyAnswers, answers); + + const config = processAnswers(totalAnswers); + const modules = getModulesList(config); + + return askInstallModules(modules).then(() => writeFile(config, earlyAnswers.format)); + }); + }); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +const init = { + getModulesList, + hasESLintVersionConflict, + installModules, + processAnswers, + /* istanbul ignore next */initializeConfig() { + return promptUser(); + } +}; + +module.exports = init; diff --git a/day1/cli-study/node_modules/eslint/lib/init/config-rule.js b/day1/cli-study/node_modules/eslint/lib/init/config-rule.js new file mode 100644 index 0000000..7aec89c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/config-rule.js @@ -0,0 +1,317 @@ +/** + * @fileoverview Create configurations for a rule + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Wrap all of the elements of an array into arrays. + * @param {*[]} xs Any array. + * @returns {Array[]} An array of arrays. + */ +function explodeArray(xs) { + return xs.reduce((accumulator, x) => { + accumulator.push([x]); + return accumulator; + }, []); +} + +/** + * Mix two arrays such that each element of the second array is concatenated + * onto each element of the first array. + * + * For example: + * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] + * @param {Array} arr1 The first array to combine. + * @param {Array} arr2 The second array to combine. + * @returns {Array} A mixture of the elements of the first and second arrays. + */ +function combineArrays(arr1, arr2) { + const res = []; + + if (arr1.length === 0) { + return explodeArray(arr2); + } + if (arr2.length === 0) { + return explodeArray(arr1); + } + arr1.forEach(x1 => { + arr2.forEach(x2 => { + res.push([].concat(x1, x2)); + }); + }); + return res; +} + +/** + * Group together valid rule configurations based on object properties + * + * e.g.: + * groupByProperty([ + * {before: true}, + * {before: false}, + * {after: true}, + * {after: false} + * ]); + * + * will return: + * [ + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ] + * @param {Object[]} objects Array of objects, each with one property/value pair + * @returns {Array[]} Array of arrays of objects grouped by property + */ +function groupByProperty(objects) { + const groupedObj = objects.reduce((accumulator, obj) => { + const prop = Object.keys(obj)[0]; + + accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj]; + return accumulator; + }, {}); + + return Object.keys(groupedObj).map(prop => groupedObj[prop]); +} + + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Configuration settings for a rule. + * + * A configuration can be a single number (severity), or an array where the first + * element in the array is the severity, and is the only required element. + * Configs may also have one or more additional elements to specify rule + * configuration or options. + * @typedef {Array|number} ruleConfig + * @param {number} 0 The rule's severity (0, 1, 2). + */ + +/** + * Object whose keys are rule names and values are arrays of valid ruleConfig items + * which should be linted against the target source code to determine error counts. + * (a ruleConfigSet.ruleConfigs). + * + * e.g. rulesConfig = { + * "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]], + * "no-console": [2] + * } + * @typedef rulesConfig + */ + + +/** + * Create valid rule configurations by combining two arrays, + * with each array containing multiple objects each with a + * single property/value pair and matching properties. + * + * e.g.: + * combinePropertyObjects( + * [{before: true}, {before: false}], + * [{after: true}, {after: false}] + * ); + * + * will return: + * [ + * {before: true, after: true}, + * {before: true, after: false}, + * {before: false, after: true}, + * {before: false, after: false} + * ] + * @param {Object[]} objArr1 Single key/value objects, all with the same key + * @param {Object[]} objArr2 Single key/value objects, all with another key + * @returns {Object[]} Combined objects for each combination of input properties and values + */ +function combinePropertyObjects(objArr1, objArr2) { + const res = []; + + if (objArr1.length === 0) { + return objArr2; + } + if (objArr2.length === 0) { + return objArr1; + } + objArr1.forEach(obj1 => { + objArr2.forEach(obj2 => { + const combinedObj = {}; + const obj1Props = Object.keys(obj1); + const obj2Props = Object.keys(obj2); + + obj1Props.forEach(prop1 => { + combinedObj[prop1] = obj1[prop1]; + }); + obj2Props.forEach(prop2 => { + combinedObj[prop2] = obj2[prop2]; + }); + res.push(combinedObj); + }); + }); + return res; +} + +/** + * Creates a new instance of a rule configuration set + * + * A rule configuration set is an array of configurations that are valid for a + * given rule. For example, the configuration set for the "semi" rule could be: + * + * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]] + * + * Rule configuration set class + */ +class RuleConfigSet { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ruleConfig[]} configs Valid rule configurations + */ + constructor(configs) { + + /** + * Stored valid rule configurations for this instance + * @type {Array} + */ + this.ruleConfigs = configs || []; + } + + /** + * Add a severity level to the front of all configs in the instance. + * This should only be called after all configs have been added to the instance. + * @returns {void} + */ + addErrorSeverity() { + const severity = 2; + + this.ruleConfigs = this.ruleConfigs.map(config => { + config.unshift(severity); + return config; + }); + + // Add a single config at the beginning consisting of only the severity + this.ruleConfigs.unshift(severity); + } + + /** + * Add rule configs from an array of strings (schema enums) + * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"]) + * @returns {void} + */ + addEnums(enums) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums)); + } + + /** + * Add rule configurations from a schema object + * @param {Object} obj Schema item with type === "object" + * @returns {boolean} true if at least one schema for the object could be generated, false otherwise + */ + addObject(obj) { + const objectConfigSet = { + objectConfigs: [], + add(property, values) { + for (let idx = 0; idx < values.length; idx++) { + const optionObj = {}; + + optionObj[property] = values[idx]; + this.objectConfigs.push(optionObj); + } + }, + + combine() { + this.objectConfigs = groupByProperty(this.objectConfigs).reduce((accumulator, objArr) => combinePropertyObjects(accumulator, objArr), []); + } + }; + + /* + * The object schema could have multiple independent properties. + * If any contain enums or booleans, they can be added and then combined + */ + Object.keys(obj.properties).forEach(prop => { + if (obj.properties[prop].enum) { + objectConfigSet.add(prop, obj.properties[prop].enum); + } + if (obj.properties[prop].type && obj.properties[prop].type === "boolean") { + objectConfigSet.add(prop, [true, false]); + } + }); + objectConfigSet.combine(); + + if (objectConfigSet.objectConfigs.length > 0) { + this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs)); + return true; + } + + return false; + } +} + +/** + * Generate valid rule configurations based on a schema object + * @param {Object} schema A rule's schema object + * @returns {Array[]} Valid rule configurations + */ +function generateConfigsFromSchema(schema) { + const configSet = new RuleConfigSet(); + + if (Array.isArray(schema)) { + for (const opt of schema) { + if (opt.enum) { + configSet.addEnums(opt.enum); + } else if (opt.type && opt.type === "object") { + if (!configSet.addObject(opt)) { + break; + } + + // TODO (IanVS): support oneOf + } else { + + // If we don't know how to fill in this option, don't fill in any of the following options. + break; + } + } + } + configSet.addErrorSeverity(); + return configSet.ruleConfigs; +} + +/** + * Generate possible rule configurations for all of the core rules + * @param {boolean} noDeprecated Indicates whether ignores deprecated rules or not. + * @returns {rulesConfig} Hash of rule names and arrays of possible configurations + */ +function createCoreRuleConfigs(noDeprecated = false) { + return Array.from(builtInRules).reduce((accumulator, [id, rule]) => { + const schema = (typeof rule === "function") ? rule.schema : rule.meta.schema; + const isDeprecated = (typeof rule === "function") ? rule.deprecated : rule.meta.deprecated; + + if (noDeprecated && isDeprecated) { + return accumulator; + } + + accumulator[id] = generateConfigsFromSchema(schema); + return accumulator; + }, {}); +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + generateConfigsFromSchema, + createCoreRuleConfigs +}; diff --git a/day1/cli-study/node_modules/eslint/lib/init/npm-utils.js b/day1/cli-study/node_modules/eslint/lib/init/npm-utils.js new file mode 100644 index 0000000..555ea2b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/npm-utils.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Utility for executing npm commands. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const fs = require("fs"), + spawn = require("cross-spawn"), + path = require("path"), + log = require("../shared/logging"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Find the closest package.json file, starting at process.cwd (by default), + * and working up to root. + * @param {string} [startDir=process.cwd()] Starting directory + * @returns {string} Absolute path to closest package.json file + */ +function findPackageJson(startDir) { + let dir = path.resolve(startDir || process.cwd()); + + do { + const pkgFile = path.join(dir, "package.json"); + + if (!fs.existsSync(pkgFile) || !fs.statSync(pkgFile).isFile()) { + dir = path.join(dir, ".."); + continue; + } + return pkgFile; + } while (dir !== path.resolve(dir, "..")); + return null; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Install node modules synchronously and save to devDependencies in package.json + * @param {string|string[]} packages Node module or modules to install + * @returns {void} + */ +function installSyncSaveDev(packages) { + const packageList = Array.isArray(packages) ? packages : [packages]; + const npmProcess = spawn.sync("npm", ["i", "--save-dev"].concat(packageList), + { stdio: "inherit" }); + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + const pluralS = packageList.length > 1 ? "s" : ""; + + log.error(`Could not execute npm. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`); + } +} + +/** + * Fetch `peerDependencies` of the given package by `npm show` command. + * @param {string} packageName The package name to fetch peerDependencies. + * @returns {Object} Gotten peerDependencies. Returns null if npm was not found. + */ +function fetchPeerDependencies(packageName) { + const npmProcess = spawn.sync( + "npm", + ["show", "--json", packageName, "peerDependencies"], + { encoding: "utf8" } + ); + + const error = npmProcess.error; + + if (error && error.code === "ENOENT") { + return null; + } + const fetchedText = npmProcess.stdout.trim(); + + return JSON.parse(fetchedText || "{}"); + + +} + +/** + * Check whether node modules are include in a project's package.json. + * @param {string[]} packages Array of node module names + * @param {Object} opt Options Object + * @param {boolean} opt.dependencies Set to true to check for direct dependencies + * @param {boolean} opt.devDependencies Set to true to check for development dependencies + * @param {boolean} opt.startdir Directory to begin searching from + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function check(packages, opt) { + const deps = new Set(); + const pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson(); + let fileJson; + + if (!pkgJson) { + throw new Error("Could not find a package.json file. Run 'npm init' to create one."); + } + + try { + fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8")); + } catch (e) { + const error = new Error(e); + + error.messageTemplate = "failed-to-read-json"; + error.messageData = { + path: pkgJson, + message: e.message + }; + throw error; + } + + ["dependencies", "devDependencies"].forEach(key => { + if (opt[key] && typeof fileJson[key] === "object") { + Object.keys(fileJson[key]).forEach(dep => deps.add(dep)); + } + }); + + return packages.reduce((status, pkg) => { + status[pkg] = deps.has(pkg); + return status; + }, {}); +} + +/** + * Check whether node modules are included in the dependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @param {string} rootDir The directory containing a package.json + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDeps(packages, rootDir) { + return check(packages, { dependencies: true, startDir: rootDir }); +} + +/** + * Check whether node modules are included in the devDependencies of a project's + * package.json. + * + * Convenience wrapper around check(). + * @param {string[]} packages Array of node modules to check. + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDevDeps(packages) { + return check(packages, { devDependencies: true }); +} + +/** + * Check whether package.json is found in current path. + * @param {string} [startDir] Starting directory + * @returns {boolean} Whether a package.json is found in current path. + */ +function checkPackageJson(startDir) { + return !!findPackageJson(startDir); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + installSyncSaveDev, + fetchPeerDependencies, + checkDeps, + checkDevDeps, + checkPackageJson +}; diff --git a/day1/cli-study/node_modules/eslint/lib/init/source-code-utils.js b/day1/cli-study/node_modules/eslint/lib/init/source-code-utils.js new file mode 100644 index 0000000..dca6541 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/init/source-code-utils.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Tools for obtaining SourceCode objects. + * @author Ian VanSchooten + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CLIEngine } = require("../cli-engine"); + +/* + * This is used for: + * + * 1. Enumerate target file because we have not expose such a API on `CLIEngine` + * (https://github.com/eslint/eslint/issues/11222). + * 2. Create `SourceCode` instances. Because we don't have any function which + * instantiate `SourceCode` so it needs to take the created `SourceCode` + * instance out after linting. + * + * TODO1: Expose the API that enumerates target files. + * TODO2: Extract the creation logic of `SourceCode` from `Linter` class. + */ +const { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require + +const debug = require("debug")("eslint:source-code-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the SourceCode object for a single file + * @param {string} filename The fully resolved filename to get SourceCode from. + * @param {Object} engine A CLIEngine. + * @returns {Array} Array of the SourceCode object representing the file + * and fatal error message. + */ +function getSourceCodeOfFile(filename, engine) { + debug("getting sourceCode of", filename); + const results = engine.executeOnFiles([filename]); + + if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) { + const msg = results.results[0].messages[0]; + + throw new Error(`(${filename}:${msg.line}:${msg.column}) ${msg.message}`); + } + + // TODO: extract the logic that creates source code objects to `SourceCode#parse(text, options)` or something like. + const { linter } = getCLIEngineInternalSlots(engine); + const sourceCode = linter.getSourceCode(); + + return sourceCode; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Gets the SourceCode of a single file, or set of files. + * @param {string[]|string} patterns A filename, directory name, or glob, or an array of them + * @param {Object} options A CLIEngine options object. If not provided, the default cli options will be used. + * @param {progressCallback} callback Callback for reporting execution status + * @returns {Object} The SourceCode of all processed files. + */ +function getSourceCodeOfFiles(patterns, options, callback) { + const sourceCodes = {}; + const globPatternsList = typeof patterns === "string" ? [patterns] : patterns; + const engine = new CLIEngine({ ...options, rules: {} }); + + // TODO: make file iteration as a public API and use it. + const { fileEnumerator } = getCLIEngineInternalSlots(engine); + const filenames = + Array.from(fileEnumerator.iterateFiles(globPatternsList)) + .filter(entry => !entry.ignored) + .map(entry => entry.filePath); + + if (filenames.length === 0) { + debug(`Did not find any files matching pattern(s): ${globPatternsList}`); + } + + filenames.forEach(filename => { + const sourceCode = getSourceCodeOfFile(filename, engine); + + if (sourceCode) { + debug("got sourceCode of", filename); + sourceCodes[filename] = sourceCode; + } + if (callback) { + callback(filenames.length); // eslint-disable-line node/callback-return + } + }); + + return sourceCodes; +} + +module.exports = { + getSourceCodeOfFiles +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/apply-disable-directives.js b/day1/cli-study/node_modules/eslint/lib/linter/apply-disable-directives.js new file mode 100644 index 0000000..41d6934 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -0,0 +1,167 @@ +/** + * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments + * @author Teddy Katz + */ + +"use strict"; + +const lodash = require("lodash"); + +/** + * Compares the locations of two objects in a source file + * @param {{line: number, column: number}} itemA The first object + * @param {{line: number, column: number}} itemB The second object + * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if + * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location. + */ +function compareLocations(itemA, itemB) { + return itemA.line - itemB.line || itemA.column - itemB.column; +} + +/** + * This is the same as the exported function, except that it + * doesn't handle disable-line and disable-next-line directives, and it always reports unused + * disable directives. + * @param {Object} options options for applying directives. This is the same as the options + * for the exported function, except that `reportUnusedDisableDirectives` is not supported + * (this function always reports unused disable directives). + * @returns {{problems: Problem[], unusedDisableDirectives: Problem[]}} An object with a list + * of filtered problems and unused eslint-disable directives + */ +function applyDirectives(options) { + const problems = []; + let nextDirectiveIndex = 0; + let currentGlobalDisableDirective = null; + const disabledRuleMap = new Map(); + + // enabledRules is only used when there is a current global disable directive. + const enabledRules = new Set(); + const usedDisableDirectives = new Set(); + + for (const problem of options.problems) { + while ( + nextDirectiveIndex < options.directives.length && + compareLocations(options.directives[nextDirectiveIndex], problem) <= 0 + ) { + const directive = options.directives[nextDirectiveIndex++]; + + switch (directive.type) { + case "disable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = directive; + disabledRuleMap.clear(); + enabledRules.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.delete(directive.ruleId); + disabledRuleMap.set(directive.ruleId, directive); + } else { + disabledRuleMap.set(directive.ruleId, directive); + } + break; + + case "enable": + if (directive.ruleId === null) { + currentGlobalDisableDirective = null; + disabledRuleMap.clear(); + } else if (currentGlobalDisableDirective) { + enabledRules.add(directive.ruleId); + disabledRuleMap.delete(directive.ruleId); + } else { + disabledRuleMap.delete(directive.ruleId); + } + break; + + // no default + } + } + + if (disabledRuleMap.has(problem.ruleId)) { + usedDisableDirectives.add(disabledRuleMap.get(problem.ruleId)); + } else if (currentGlobalDisableDirective && !enabledRules.has(problem.ruleId)) { + usedDisableDirectives.add(currentGlobalDisableDirective); + } else { + problems.push(problem); + } + } + + const unusedDisableDirectives = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)) + .map(directive => ({ + ruleId: null, + message: directive.ruleId + ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').` + : "Unused eslint-disable directive (no problems were reported).", + line: directive.unprocessedDirective.line, + column: directive.unprocessedDirective.column, + severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2, + nodeType: null + })); + + return { problems, unusedDisableDirectives }; +} + +/** + * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list + * of reported problems, determines which problems should be reported. + * @param {Object} options Information about directives and problems + * @param {{ + * type: ("disable"|"enable"|"disable-line"|"disable-next-line"), + * ruleId: (string|null), + * line: number, + * column: number + * }} options.directives Directive comments found in the file, with one-based columns. + * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable + * comment for two different rules is represented as two directives). + * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems + * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns. + * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives + * @returns {{ruleId: (string|null), line: number, column: number}[]} + * A list of reported problems that were not disabled by the directive comments. + */ +module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" }) => { + const blockDirectives = directives + .filter(directive => directive.type === "disable" || directive.type === "enable") + .map(directive => Object.assign({}, directive, { unprocessedDirective: directive })) + .sort(compareLocations); + + const lineDirectives = lodash.flatMap(directives, directive => { + switch (directive.type) { + case "disable": + case "enable": + return []; + + case "disable-line": + return [ + { type: "disable", line: directive.line, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 1, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + case "disable-next-line": + return [ + { type: "disable", line: directive.line + 1, column: 1, ruleId: directive.ruleId, unprocessedDirective: directive }, + { type: "enable", line: directive.line + 2, column: 0, ruleId: directive.ruleId, unprocessedDirective: directive } + ]; + + default: + throw new TypeError(`Unrecognized directive type '${directive.type}'`); + } + }).sort(compareLocations); + + const blockDirectivesResult = applyDirectives({ + problems, + directives: blockDirectives, + reportUnusedDisableDirectives + }); + const lineDirectivesResult = applyDirectives({ + problems: blockDirectivesResult.problems, + directives: lineDirectives, + reportUnusedDisableDirectives + }); + + return reportUnusedDisableDirectives !== "off" + ? lineDirectivesResult.problems + .concat(blockDirectivesResult.unusedDisableDirectives) + .concat(lineDirectivesResult.unusedDisableDirectives) + .sort(compareLocations) + : lineDirectivesResult.problems; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js new file mode 100644 index 0000000..b612cf4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js @@ -0,0 +1,684 @@ +/** + * @fileoverview A class of the code path analyzer. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + { breakableTypePattern } = require("../../shared/ast-utils"), + CodePath = require("./code-path"), + CodePathSegment = require("./code-path-segment"), + IdGenerator = require("./id-generator"), + debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a `case` node (not `default` node). + * @param {ASTNode} node A `SwitchCase` node to check. + * @returns {boolean} `true` if the node is a `case` node (not `default` node). + */ +function isCaseNode(node) { + return Boolean(node.test); +} + +/** + * Checks whether the given logical operator is taken into account for the code + * path analysis. + * @param {string} operator The operator found in the LogicalExpression node + * @returns {boolean} `true` if the operator is "&&" or "||" or "??" + */ +function isHandledLogicalOperator(operator) { + return operator === "&&" || operator === "||" || operator === "??"; +} + +/** + * Gets the label if the parent node of a given node is a LabeledStatement. + * @param {ASTNode} node A node to get. + * @returns {string|null} The label or `null`. + */ +function getLabel(node) { + if (node.parent.type === "LabeledStatement") { + return node.parent.label.name; + } + return null; +} + +/** + * Checks whether or not a given logical expression node goes different path + * between the `true` case and the `false` case. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a test of a choice statement. + */ +function isForkingByTrueOrFalse(node) { + const parent = node.parent; + + switch (parent.type) { + case "ConditionalExpression": + case "IfStatement": + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + return parent.test === node; + + case "LogicalExpression": + return isHandledLogicalOperator(parent.operator); + + default: + return false; + } +} + +/** + * Gets the boolean value of a given literal node. + * + * This is used to detect infinity loops (e.g. `while (true) {}`). + * Statements preceded by an infinity loop are unreachable if the loop didn't + * have any `break` statement. + * @param {ASTNode} node A node to get. + * @returns {boolean|undefined} a boolean value if the node is a Literal node, + * otherwise `undefined`. + */ +function getBooleanValueIfSimpleConstant(node) { + if (node.type === "Literal") { + return Boolean(node.value); + } + return void 0; +} + +/** + * Checks that a given identifier node is a reference or not. + * + * This is used to detect the first throwable node in a `try` block. + * @param {ASTNode} node An Identifier node to check. + * @returns {boolean} `true` if the node is a reference. + */ +function isIdentifierReference(node) { + const parent = node.parent; + + switch (parent.type) { + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": + case "ArrayPattern": + case "RestElement": + case "ImportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "CatchClause": + return false; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ClassDeclaration": + case "ClassExpression": + case "VariableDeclarator": + return parent.id !== node; + + case "Property": + case "MethodDefinition": + return ( + parent.key !== node || + parent.computed || + parent.shorthand + ); + + case "AssignmentPattern": + return parent.key !== node; + + default: + return true; + } +} + +/** + * Updates the current segment with the head segment. + * This is similar to local branches and tracking branches of git. + * + * To separate the current and the head is in order to not make useless segments. + * + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd" + * events are fired. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function forwardCurrentToHead(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const currentSegments = state.currentSegments; + const headSegments = state.headSegments; + const end = Math.max(currentSegments.length, headSegments.length); + let i, currentSegment, headSegment; + + // Fires leaving events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && currentSegment) { + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + } + + // Update state. + state.currentSegments = headSegments; + + // Fires entering events. + for (i = 0; i < end; ++i) { + currentSegment = currentSegments[i]; + headSegment = headSegments[i]; + + if (currentSegment !== headSegment && headSegment) { + debug.dump(`onCodePathSegmentStart ${headSegment.id}`); + + CodePathSegment.markUsed(headSegment); + if (headSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentStart", + headSegment, + node + ); + } + } + } + +} + +/** + * Updates the current segment with empty. + * This is called at the last of functions or the program. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function leaveFromCurrentSegment(analyzer, node) { + const state = CodePath.getState(analyzer.codePath); + const currentSegments = state.currentSegments; + + for (let i = 0; i < currentSegments.length; ++i) { + const currentSegment = currentSegments[i]; + + debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); + if (currentSegment.reachable) { + analyzer.emitter.emit( + "onCodePathSegmentEnd", + currentSegment, + node + ); + } + } + + state.currentSegments = []; +} + +/** + * Updates the code path due to the position of a given node in the parent node + * thereof. + * + * For example, if the node is `parent.consequent`, this creates a fork from the + * current path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function preprocess(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + const parent = node.parent; + + switch (parent.type) { + case "LogicalExpression": + if ( + parent.right === node && + isHandledLogicalOperator(parent.operator) + ) { + state.makeLogicalRight(); + } + break; + + case "ConditionalExpression": + case "IfStatement": + + /* + * Fork if this node is at `consequent`/`alternate`. + * `popForkContext()` exists at `IfStatement:exit` and + * `ConditionalExpression:exit`. + */ + if (parent.consequent === node) { + state.makeIfConsequent(); + } else if (parent.alternate === node) { + state.makeIfAlternate(); + } + break; + + case "SwitchCase": + if (parent.consequent[0] === node) { + state.makeSwitchCaseBody(false, !parent.test); + } + break; + + case "TryStatement": + if (parent.handler === node) { + state.makeCatchBlock(); + } else if (parent.finalizer === node) { + state.makeFinallyBlock(); + } + break; + + case "WhileStatement": + if (parent.test === node) { + state.makeWhileTest(getBooleanValueIfSimpleConstant(node)); + } else { + assert(parent.body === node); + state.makeWhileBody(); + } + break; + + case "DoWhileStatement": + if (parent.body === node) { + state.makeDoWhileBody(); + } else { + assert(parent.test === node); + state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node)); + } + break; + + case "ForStatement": + if (parent.test === node) { + state.makeForTest(getBooleanValueIfSimpleConstant(node)); + } else if (parent.update === node) { + state.makeForUpdate(); + } else if (parent.body === node) { + state.makeForBody(); + } + break; + + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + state.makeForInOfLeft(); + } else if (parent.right === node) { + state.makeForInOfRight(); + } else { + assert(parent.body === node); + state.makeForInOfBody(); + } + break; + + case "AssignmentPattern": + + /* + * Fork if this node is at `right`. + * `left` is executed always, so it uses the current path. + * `popForkContext()` exists at `AssignmentPattern:exit`. + */ + if (parent.right === node) { + state.pushForkContext(); + state.forkBypassPath(); + state.forkPath(); + } + break; + + default: + break; + } +} + +/** + * Updates the code path due to the type of a given node in entering. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToEnter(analyzer, node) { + let codePath = analyzer.codePath; + let state = codePath && CodePath.getState(codePath); + const parent = node.parent; + + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + if (codePath) { + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); + } + + // Create the code path of this scope. + codePath = analyzer.codePath = new CodePath( + analyzer.idGenerator.next(), + codePath, + analyzer.onLooped + ); + state = CodePath.getState(codePath); + + // Emits onCodePathStart events. + debug.dump(`onCodePathStart ${codePath.id}`); + analyzer.emitter.emit("onCodePathStart", codePath, node); + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.pushChoiceContext( + node.operator, + isForkingByTrueOrFalse(node) + ); + } + break; + + case "ConditionalExpression": + case "IfStatement": + state.pushChoiceContext("test", false); + break; + + case "SwitchStatement": + state.pushSwitchContext( + node.cases.some(isCaseNode), + getLabel(node) + ); + break; + + case "TryStatement": + state.pushTryContext(Boolean(node.finalizer)); + break; + + case "SwitchCase": + + /* + * Fork if this node is after the 2st node in `cases`. + * It's similar to `else` blocks. + * The next `test` node is processed in this path. + */ + if (parent.discriminant !== node && parent.cases[0] !== node) { + state.forkPath(); + } + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.pushLoopContext(node.type, getLabel(node)); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.pushBreakContext(false, node.label.name); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + forwardCurrentToHead(analyzer, node); + debug.dumpState(node, state, false); +} + +/** + * Updates the code path due to the type of a given node in leaving. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function processCodePathToExit(analyzer, node) { + const codePath = analyzer.codePath; + const state = CodePath.getState(codePath); + let dontForward = false; + + switch (node.type) { + case "IfStatement": + case "ConditionalExpression": + state.popChoiceContext(); + break; + + case "LogicalExpression": + if (isHandledLogicalOperator(node.operator)) { + state.popChoiceContext(); + } + break; + + case "SwitchStatement": + state.popSwitchContext(); + break; + + case "SwitchCase": + + /* + * This is the same as the process at the 1st `consequent` node in + * `preprocess` function. + * Must do if this `consequent` is empty. + */ + if (node.consequent.length === 0) { + state.makeSwitchCaseBody(true, !node.test); + } + if (state.forkContext.reachable) { + dontForward = true; + } + break; + + case "TryStatement": + state.popTryContext(); + break; + + case "BreakStatement": + forwardCurrentToHead(analyzer, node); + state.makeBreak(node.label && node.label.name); + dontForward = true; + break; + + case "ContinueStatement": + forwardCurrentToHead(analyzer, node); + state.makeContinue(node.label && node.label.name); + dontForward = true; + break; + + case "ReturnStatement": + forwardCurrentToHead(analyzer, node); + state.makeReturn(); + dontForward = true; + break; + + case "ThrowStatement": + forwardCurrentToHead(analyzer, node); + state.makeThrow(); + dontForward = true; + break; + + case "Identifier": + if (isIdentifierReference(node)) { + state.makeFirstThrowablePathInTryBlock(); + dontForward = true; + } + break; + + case "CallExpression": + case "ImportExpression": + case "MemberExpression": + case "NewExpression": + case "YieldExpression": + state.makeFirstThrowablePathInTryBlock(); + break; + + case "WhileStatement": + case "DoWhileStatement": + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + state.popLoopContext(); + break; + + case "AssignmentPattern": + state.popForkContext(); + break; + + case "LabeledStatement": + if (!breakableTypePattern.test(node.body.type)) { + state.popBreakContext(); + } + break; + + default: + break; + } + + // Emits onCodePathSegmentStart events if updated. + if (!dontForward) { + forwardCurrentToHead(analyzer, node); + } + debug.dumpState(node, state, true); +} + +/** + * Updates the code path to finalize the current code path. + * @param {CodePathAnalyzer} analyzer The instance. + * @param {ASTNode} node The current AST node. + * @returns {void} + */ +function postprocess(analyzer, node) { + switch (node.type) { + case "Program": + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": { + let codePath = analyzer.codePath; + + // Mark the current path as the final node. + CodePath.getState(codePath).makeFinal(); + + // Emits onCodePathSegmentEnd event of the current segments. + leaveFromCurrentSegment(analyzer, node); + + // Emits onCodePathEnd event of this code path. + debug.dump(`onCodePathEnd ${codePath.id}`); + analyzer.emitter.emit("onCodePathEnd", codePath, node); + debug.dumpDot(codePath); + + codePath = analyzer.codePath = analyzer.codePath.upper; + if (codePath) { + debug.dumpState(node, CodePath.getState(codePath), true); + } + break; + } + + default: + break; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The class to analyze code paths. + * This class implements the EventGenerator interface. + */ +class CodePathAnalyzer { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {EventGenerator} eventGenerator An event generator to wrap. + */ + constructor(eventGenerator) { + this.original = eventGenerator; + this.emitter = eventGenerator.emitter; + this.codePath = null; + this.idGenerator = new IdGenerator("s"); + this.currentNode = null; + this.onLooped = this.onLooped.bind(this); + } + + /** + * Does the process to enter a given AST node. + * This updates state of analysis and calls `enterNode` of the wrapped. + * @param {ASTNode} node A node which is entering. + * @returns {void} + */ + enterNode(node) { + this.currentNode = node; + + // Updates the code path due to node's position in its parent node. + if (node.parent) { + preprocess(this, node); + } + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToEnter(this, node); + + // Emits node events. + this.original.enterNode(node); + + this.currentNode = null; + } + + /** + * Does the process to leave a given AST node. + * This updates state of analysis and calls `leaveNode` of the wrapped. + * @param {ASTNode} node A node which is leaving. + * @returns {void} + */ + leaveNode(node) { + this.currentNode = node; + + /* + * Updates the code path. + * And emits onCodePathStart/onCodePathSegmentStart events. + */ + processCodePathToExit(this, node); + + // Emits node events. + this.original.leaveNode(node); + + // Emits the last onCodePathStart/onCodePathSegmentStart events. + postprocess(this, node); + + this.currentNode = null; + } + + /** + * This is called on a code path looped. + * Then this raises a looped event. + * @param {CodePathSegment} fromSegment A segment of prev. + * @param {CodePathSegment} toSegment A segment of next. + * @returns {void} + */ + onLooped(fromSegment, toSegment) { + if (fromSegment.reachable && toSegment.reachable) { + debug.dump(`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`); + this.emitter.emit( + "onCodePathSegmentLoop", + fromSegment, + toSegment, + this.currentNode + ); + } + } +} + +module.exports = CodePathAnalyzer; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js new file mode 100644 index 0000000..6b17b25 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js @@ -0,0 +1,237 @@ +/** + * @fileoverview A class of the code path segment. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("./debug-helpers"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path segment. + */ +class CodePathSegment { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * This array includes unreachable segments. + * @param {boolean} reachable A flag which shows this is reachable. + */ + constructor(id, allPrevSegments, reachable) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * An array of the next segments. + * @type {CodePathSegment[]} + */ + this.nextSegments = []; + + /** + * An array of the previous segments. + * @type {CodePathSegment[]} + */ + this.prevSegments = allPrevSegments.filter(isReachable); + + /** + * An array of the next segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allNextSegments = []; + + /** + * An array of the previous segments. + * This array includes unreachable segments. + * @type {CodePathSegment[]} + */ + this.allPrevSegments = allPrevSegments; + + /** + * A flag which shows this is reachable. + * @type {boolean} + */ + this.reachable = reachable; + + // Internal data. + Object.defineProperty(this, "internal", { + value: { + used: false, + loopedPrevSegments: [] + } + }); + + /* istanbul ignore if */ + if (debug.enabled) { + this.internal.nodes = []; + this.internal.exitNodes = []; + } + } + + /** + * Checks a given previous segment is coming from the end of a loop. + * @param {CodePathSegment} segment A previous segment to check. + * @returns {boolean} `true` if the segment is coming from the end of a loop. + */ + isLoopedPrevSegment(segment) { + return this.internal.loopedPrevSegments.indexOf(segment) !== -1; + } + + /** + * Creates the root segment. + * @param {string} id An identifier. + * @returns {CodePathSegment} The created segment. + */ + static newRoot(id) { + return new CodePathSegment(id, [], true); + } + + /** + * Creates a segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newNext(id, allPrevSegments) { + return new CodePathSegment( + id, + CodePathSegment.flattenUnusedSegments(allPrevSegments), + allPrevSegments.some(isReachable) + ); + } + + /** + * Creates an unreachable segment that follows given segments. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newUnreachable(id, allPrevSegments) { + const segment = new CodePathSegment(id, CodePathSegment.flattenUnusedSegments(allPrevSegments), false); + + /* + * In `if (a) return a; foo();` case, the unreachable segment preceded by + * the return statement is not used but must not be remove. + */ + CodePathSegment.markUsed(segment); + + return segment; + } + + /** + * Creates a segment that follows given segments. + * This factory method does not connect with `allPrevSegments`. + * But this inherits `reachable` flag. + * @param {string} id An identifier. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @returns {CodePathSegment} The created segment. + */ + static newDisconnected(id, allPrevSegments) { + return new CodePathSegment(id, [], allPrevSegments.some(isReachable)); + } + + /** + * Makes a given segment being used. + * + * And this function registers the segment into the previous segments as a next. + * @param {CodePathSegment} segment A segment to mark. + * @returns {void} + */ + static markUsed(segment) { + if (segment.internal.used) { + return; + } + segment.internal.used = true; + + let i; + + if (segment.reachable) { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + const prevSegment = segment.allPrevSegments[i]; + + prevSegment.allNextSegments.push(segment); + prevSegment.nextSegments.push(segment); + } + } else { + for (i = 0; i < segment.allPrevSegments.length; ++i) { + segment.allPrevSegments[i].allNextSegments.push(segment); + } + } + } + + /** + * Marks a previous segment as looped. + * @param {CodePathSegment} segment A segment. + * @param {CodePathSegment} prevSegment A previous segment to mark. + * @returns {void} + */ + static markPrevSegmentAsLooped(segment, prevSegment) { + segment.internal.loopedPrevSegments.push(prevSegment); + } + + /** + * Replaces unused segments with the previous segments of each unused segment. + * @param {CodePathSegment[]} segments An array of segments to replace. + * @returns {CodePathSegment[]} The replaced array. + */ + static flattenUnusedSegments(segments) { + const done = Object.create(null); + const retv = []; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + // Ignores duplicated. + if (done[segment.id]) { + continue; + } + + // Use previous segments if unused. + if (!segment.internal.used) { + for (let j = 0; j < segment.allPrevSegments.length; ++j) { + const prevSegment = segment.allPrevSegments[j]; + + if (!done[prevSegment.id]) { + done[prevSegment.id] = true; + retv.push(prevSegment); + } + } + } else { + done[segment.id] = true; + retv.push(segment); + } + } + + return retv; + } +} + +module.exports = CodePathSegment; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js new file mode 100644 index 0000000..9e76060 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js @@ -0,0 +1,1421 @@ +/** + * @fileoverview A class to manage state of generating a code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathSegment = require("./code-path-segment"), + ForkContext = require("./fork-context"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Adds given segments into the `dest` array. + * If the `others` array does not includes the given segments, adds to the `all` + * array as well. + * + * This adds only reachable and used segments. + * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`). + * @param {CodePathSegment[]} all The unified destination array (`finalSegments`). + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ +function addToReturnedOrThrown(dest, others, all, segments) { + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + dest.push(segment); + if (others.indexOf(segment) === -1) { + all.push(segment); + } + } +} + +/** + * Gets a loop-context for a `continue` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `continue` statement. + * @returns {LoopContext} A loop-context for a `continue` statement. + */ +function getContinueContext(state, label) { + if (!label) { + return state.loopContext; + } + + let context = state.loopContext; + + while (context) { + if (context.label === label) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `break` statement. + * @param {CodePathState} state A state to get. + * @param {string} label The label of a `break` statement. + * @returns {LoopContext|SwitchContext} A context for a `break` statement. + */ +function getBreakContext(state, label) { + let context = state.breakContext; + + while (context) { + if (label ? context.label === label : context.breakable) { + return context; + } + context = context.upper; + } + + /* istanbul ignore next: foolproof (syntax error) */ + return null; +} + +/** + * Gets a context for a `return` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `return` statement. + */ +function getReturnContext(state) { + let context = state.tryContext; + + while (context) { + if (context.hasFinalizer && context.position !== "finally") { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Gets a context for a `throw` statement. + * @param {CodePathState} state A state to get. + * @returns {TryContext|CodePathState} A context for a `throw` statement. + */ +function getThrowContext(state) { + let context = state.tryContext; + + while (context) { + if (context.position === "try" || + (context.hasFinalizer && context.position === "catch") + ) { + return context; + } + context = context.upper; + } + + return state; +} + +/** + * Removes a given element from a given array. + * @param {any[]} xs An array to remove the specific element. + * @param {any} x An element to be removed. + * @returns {void} + */ +function remove(xs, x) { + xs.splice(xs.indexOf(x), 1); +} + +/** + * Disconnect given segments. + * + * This is used in a process for switch statements. + * If there is the "default" chunk before other cases, the order is different + * between node's and running's. + * @param {CodePathSegment[]} prevSegments Forward segments to disconnect. + * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. + * @returns {void} + */ +function removeConnection(prevSegments, nextSegments) { + for (let i = 0; i < prevSegments.length; ++i) { + const prevSegment = prevSegments[i]; + const nextSegment = nextSegments[i]; + + remove(prevSegment.nextSegments, nextSegment); + remove(prevSegment.allNextSegments, nextSegment); + remove(nextSegment.prevSegments, prevSegment); + remove(nextSegment.allPrevSegments, prevSegment); + } +} + +/** + * Creates looping path. + * @param {CodePathState} state The instance. + * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. + * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. + * @returns {void} + */ +function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { + const fromSegments = CodePathSegment.flattenUnusedSegments(unflattenedFromSegments); + const toSegments = CodePathSegment.flattenUnusedSegments(unflattenedToSegments); + + const end = Math.min(fromSegments.length, toSegments.length); + + for (let i = 0; i < end; ++i) { + const fromSegment = fromSegments[i]; + const toSegment = toSegments[i]; + + if (toSegment.reachable) { + fromSegment.nextSegments.push(toSegment); + } + if (fromSegment.reachable) { + toSegment.prevSegments.push(fromSegment); + } + fromSegment.allNextSegments.push(toSegment); + toSegment.allPrevSegments.push(fromSegment); + + if (toSegment.allPrevSegments.length >= 2) { + CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment); + } + + state.notifyLooped(fromSegment, toSegment); + } +} + +/** + * Finalizes segments of `test` chunk of a ForStatement. + * + * - Adds `false` paths to paths which are leaving from the loop. + * - Sets `true` paths to paths which go to the body. + * @param {LoopContext} context A loop context to modify. + * @param {ChoiceContext} choiceContext A choice context of this loop. + * @param {CodePathSegment[]} head The current head paths. + * @returns {void} + */ +function finalizeTestSegmentsOfFor(context, choiceContext, head) { + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(head); + choiceContext.falseForkContext.add(head); + choiceContext.qqForkContext.add(head); + } + + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class which manages state to analyze code paths. + */ +class CodePathState { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An id generator to generate id for code + * path segments. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(idGenerator, onLooped) { + this.idGenerator = idGenerator; + this.notifyLooped = onLooped; + this.forkContext = ForkContext.newRoot(idGenerator); + this.choiceContext = null; + this.switchContext = null; + this.tryContext = null; + this.loopContext = null; + this.breakContext = null; + + this.currentSegments = []; + this.initialSegment = this.forkContext.head[0]; + + // returnedSegments and thrownSegments push elements into finalSegments also. + const final = this.finalSegments = []; + const returned = this.returnedForkContext = []; + const thrown = this.thrownForkContext = []; + + returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final); + thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final); + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get headSegments() { + return this.forkContext.head; + } + + /** + * The parent forking context. + * This is used for the root of new forks. + * @type {ForkContext} + */ + get parentForkContext() { + const current = this.forkContext; + + return current && current.upper; + } + + /** + * Creates and stacks new forking context. + * @param {boolean} forkLeavingPath A flag which shows being in a + * "finally" block. + * @returns {ForkContext} The created context. + */ + pushForkContext(forkLeavingPath) { + this.forkContext = ForkContext.newEmpty( + this.forkContext, + forkLeavingPath + ); + + return this.forkContext; + } + + /** + * Pops and merges the last forking context. + * @returns {ForkContext} The last context. + */ + popForkContext() { + const lastContext = this.forkContext; + + this.forkContext = lastContext.upper; + this.forkContext.replaceHead(lastContext.makeNext(0, -1)); + + return lastContext; + } + + /** + * Creates a new path. + * @returns {void} + */ + forkPath() { + this.forkContext.add(this.parentForkContext.makeNext(-1, -1)); + } + + /** + * Creates a bypass path. + * This is used for such as IfStatement which does not have "else" chunk. + * @returns {void} + */ + forkBypassPath() { + this.forkContext.add(this.parentForkContext.head); + } + + //-------------------------------------------------------------------------- + // ConditionalExpression, LogicalExpression, IfStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context for ConditionalExpression, LogicalExpression, + * IfStatement, WhileStatement, DoWhileStatement, or ForStatement. + * + * LogicalExpressions have cases that it goes different paths between the + * `true` case and the `false` case. + * + * For Example: + * + * if (a || b) { + * foo(); + * } else { + * bar(); + * } + * + * In this case, `b` is evaluated always in the code path of the `else` + * block, but it's not so in the code path of the `if` block. + * So there are 3 paths. + * + * a -> foo(); + * a -> b -> foo(); + * a -> b -> bar(); + * @param {string} kind A kind string. + * If the new context is LogicalExpression's, this is `"&&"` or `"||"`. + * If it's IfStatement's or ConditionalExpression's, this is `"test"`. + * Otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult A flag that shows that goes different + * paths between `true` and `false`. + * @returns {void} + */ + pushChoiceContext(kind, isForkingAsResult) { + this.choiceContext = { + upper: this.choiceContext, + kind, + isForkingAsResult, + trueForkContext: ForkContext.newEmpty(this.forkContext), + falseForkContext: ForkContext.newEmpty(this.forkContext), + qqForkContext: ForkContext.newEmpty(this.forkContext), + processed: false + }; + } + + /** + * Pops the last choice context and finalizes it. + * @returns {ChoiceContext} The popped context. + */ + popChoiceContext() { + const context = this.choiceContext; + + this.choiceContext = context.upper; + + const forkContext = this.forkContext; + const headSegments = forkContext.head; + + switch (context.kind) { + case "&&": + case "||": + case "??": + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the right-hand operand. + */ + if (!context.processed) { + context.trueForkContext.add(headSegments); + context.falseForkContext.add(headSegments); + context.qqForkContext.add(headSegments); + } + + /* + * Transfers results to upper context if this context is in + * test chunk. + */ + if (context.isForkingAsResult) { + const parentContext = this.choiceContext; + + parentContext.trueForkContext.addAll(context.trueForkContext); + parentContext.falseForkContext.addAll(context.falseForkContext); + parentContext.qqForkContext.addAll(context.qqForkContext); + parentContext.processed = true; + + return context; + } + + break; + + case "test": + if (!context.processed) { + + /* + * The head segments are the path of the `if` block here. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(headSegments); + } else { + + /* + * The head segments are the path of the `else` block here. + * Updates the `false` path with the end of the `else` + * block. + */ + context.falseForkContext.clear(); + context.falseForkContext.add(headSegments); + } + + break; + + case "loop": + + /* + * Loops are addressed in popLoopContext(). + * This is called from popLoopContext(). + */ + return context; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Merges all paths. + const prevForkContext = context.trueForkContext; + + prevForkContext.addAll(context.falseForkContext); + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + + return context; + } + + /** + * Makes a code path segment of the right-hand operand of a logical + * expression. + * @returns {void} + */ + makeLogicalRight() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + if (context.processed) { + + /* + * This got segments already from the child choice context. + * Creates the next path from own true/false fork context. + */ + let prevForkContext; + + switch (context.kind) { + case "&&": // if true then go to the right-hand side. + prevForkContext = context.trueForkContext; + break; + case "||": // if false then go to the right-hand side. + prevForkContext = context.falseForkContext; + break; + case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's qqForkContext. + prevForkContext = context.qqForkContext; + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + prevForkContext.clear(); + context.processed = false; + } else { + + /* + * This did not get segments from the child choice context. + * So addresses the head segments. + * The head segments are the path of the left-hand operand. + */ + switch (context.kind) { + case "&&": // the false path can short-circuit. + context.falseForkContext.add(forkContext.head); + break; + case "||": // the true path can short-circuit. + context.trueForkContext.add(forkContext.head); + break; + case "??": // both can short-circuit. + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + break; + default: + throw new Error("unreachable"); + } + + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + } + + /** + * Makes a code path segment of the `if` block. + * @returns {void} + */ + makeIfConsequent() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * If any result were not transferred from child contexts, + * this sets the head segments to both cases. + * The head segments are the path of the test expression. + */ + if (!context.processed) { + context.trueForkContext.add(forkContext.head); + context.falseForkContext.add(forkContext.head); + context.qqForkContext.add(forkContext.head); + } + + context.processed = false; + + // Creates new path from the `true` case. + forkContext.replaceHead( + context.trueForkContext.makeNext(0, -1) + ); + } + + /** + * Makes a code path segment of the `else` block. + * @returns {void} + */ + makeIfAlternate() { + const context = this.choiceContext; + const forkContext = this.forkContext; + + /* + * The head segments are the path of the `if` block. + * Updates the `true` path with the end of the `if` block. + */ + context.trueForkContext.clear(); + context.trueForkContext.add(forkContext.head); + context.processed = true; + + // Creates new path from the `false` case. + forkContext.replaceHead( + context.falseForkContext.makeNext(0, -1) + ); + } + + //-------------------------------------------------------------------------- + // SwitchStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of SwitchStatement and stacks it. + * @param {boolean} hasCase `true` if the switch statement has one or more + * case parts. + * @param {string|null} label The label text. + * @returns {void} + */ + pushSwitchContext(hasCase, label) { + this.switchContext = { + upper: this.switchContext, + hasCase, + defaultSegments: null, + defaultBodySegments: null, + foundDefault: false, + lastIsDefault: false, + countForks: 0 + }; + + this.pushBreakContext(true, label); + } + + /** + * Pops the last context of SwitchStatement and finalizes it. + * + * - Disposes all forking stack for `case` and `default`. + * - Creates the next code path segment from `context.brokenForkContext`. + * - If the last `SwitchCase` node is not a `default` part, creates a path + * to the `default` body. + * @returns {void} + */ + popSwitchContext() { + const context = this.switchContext; + + this.switchContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + if (context.countForks === 0) { + + /* + * When there is only one `default` chunk and there is one or more + * `break` statements, even if forks are nothing, it needs to merge + * those. + */ + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.makeNext(-1, -1)); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + return; + } + + const lastSegments = forkContext.head; + + this.forkBypassPath(); + const lastCaseSegments = forkContext.head; + + /* + * `brokenForkContext` is used to make the next segment. + * It must add the last segment into `brokenForkContext`. + */ + brokenForkContext.add(lastSegments); + + /* + * A path which is failed in all case test should be connected to path + * of `default` chunk. + */ + if (!context.lastIsDefault) { + if (context.defaultBodySegments) { + + /* + * Remove a link from `default` label to its chunk. + * It's false route. + */ + removeConnection(context.defaultSegments, context.defaultBodySegments); + makeLooped(this, lastCaseSegments, context.defaultBodySegments); + } else { + + /* + * It handles the last case body as broken if `default` chunk + * does not exist. + */ + brokenForkContext.add(lastCaseSegments); + } + } + + // Pops the segment context stack until the entry segment. + for (let i = 0; i < context.countForks; ++i) { + this.forkContext = this.forkContext.upper; + } + + /* + * Creates a path from all brokenForkContext paths. + * This is a path after switch statement. + */ + this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for a `SwitchCase` node. + * @param {boolean} isEmpty `true` if the body is empty. + * @param {boolean} isDefault `true` if the body is the default case. + * @returns {void} + */ + makeSwitchCaseBody(isEmpty, isDefault) { + const context = this.switchContext; + + if (!context.hasCase) { + return; + } + + /* + * Merge forks. + * The parent fork context has two segments. + * Those are from the current case and the body of the previous case. + */ + const parentForkContext = this.forkContext; + const forkContext = this.pushForkContext(); + + forkContext.add(parentForkContext.makeNext(0, -1)); + + /* + * Save `default` chunk info. + * If the `default` label is not at the last, we must make a path from + * the last `case` to the `default` chunk. + */ + if (isDefault) { + context.defaultSegments = parentForkContext.head; + if (isEmpty) { + context.foundDefault = true; + } else { + context.defaultBodySegments = forkContext.head; + } + } else { + if (!isEmpty && context.foundDefault) { + context.foundDefault = false; + context.defaultBodySegments = forkContext.head; + } + } + + context.lastIsDefault = isDefault; + context.countForks += 1; + } + + //-------------------------------------------------------------------------- + // TryStatement + //-------------------------------------------------------------------------- + + /** + * Creates a context object of TryStatement and stacks it. + * @param {boolean} hasFinalizer `true` if the try statement has a + * `finally` block. + * @returns {void} + */ + pushTryContext(hasFinalizer) { + this.tryContext = { + upper: this.tryContext, + position: "try", + hasFinalizer, + + returnedForkContext: hasFinalizer + ? ForkContext.newEmpty(this.forkContext) + : null, + + thrownForkContext: ForkContext.newEmpty(this.forkContext), + lastOfTryIsReachable: false, + lastOfCatchIsReachable: false + }; + } + + /** + * Pops the last context of TryStatement and finalizes it. + * @returns {void} + */ + popTryContext() { + const context = this.tryContext; + + this.tryContext = context.upper; + + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block merely. + this.popForkContext(); + return; + } + + /* + * The following process is executed only when there is the `finally` + * block. + */ + + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + + if (returned.empty && thrown.empty) { + return; + } + + // Separate head to normal paths and leaving paths. + const headSegments = this.forkContext.head; + + this.forkContext = this.forkContext.upper; + const normalSegments = headSegments.slice(0, headSegments.length / 2 | 0); + const leavingSegments = headSegments.slice(headSegments.length / 2 | 0); + + // Forwards the leaving path to upper contexts. + if (!returned.empty) { + getReturnContext(this).returnedForkContext.add(leavingSegments); + } + if (!thrown.empty) { + getThrowContext(this).thrownForkContext.add(leavingSegments); + } + + // Sets the normal path as the next. + this.forkContext.replaceHead(normalSegments); + + /* + * If both paths of the `try` block and the `catch` block are + * unreachable, the next path becomes unreachable as well. + */ + if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) { + this.forkContext.makeUnreachable(); + } + } + + /** + * Makes a code path segment for a `catch` block. + * @returns {void} + */ + makeCatchBlock() { + const context = this.tryContext; + const forkContext = this.forkContext; + const thrown = context.thrownForkContext; + + // Update state. + context.position = "catch"; + context.thrownForkContext = ForkContext.newEmpty(forkContext); + context.lastOfTryIsReachable = forkContext.reachable; + + // Merge thrown paths. + thrown.add(forkContext.head); + const thrownSegments = thrown.makeNext(0, -1); + + // Fork to a bypass and the merged thrown path. + this.pushForkContext(); + this.forkBypassPath(); + this.forkContext.add(thrownSegments); + } + + /** + * Makes a code path segment for a `finally` block. + * + * In the `finally` block, parallel paths are created. The parallel paths + * are used as leaving-paths. The leaving-paths are paths from `return` + * statements and `throw` statements in a `try` block or a `catch` block. + * @returns {void} + */ + makeFinallyBlock() { + const context = this.tryContext; + let forkContext = this.forkContext; + const returned = context.returnedForkContext; + const thrown = context.thrownForkContext; + const headOfLeavingSegments = forkContext.head; + + // Update state. + if (context.position === "catch") { + + // Merges two paths from the `try` block and `catch` block. + this.popForkContext(); + forkContext = this.forkContext; + + context.lastOfCatchIsReachable = forkContext.reachable; + } else { + context.lastOfTryIsReachable = forkContext.reachable; + } + context.position = "finally"; + + if (returned.empty && thrown.empty) { + + // This path does not leave. + return; + } + + /* + * Create a parallel segment from merging returned and thrown. + * This segment will leave at the end of this finally block. + */ + const segments = forkContext.makeNext(-1, -1); + + for (let i = 0; i < forkContext.count; ++i) { + const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]]; + + for (let j = 0; j < returned.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]); + } + for (let j = 0; j < thrown.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]); + } + + segments.push( + CodePathSegment.newNext( + this.idGenerator.next(), + prevSegsOfLeavingSegment + ) + ); + } + + this.pushForkContext(true); + this.forkContext.add(segments); + } + + /** + * Makes a code path segment from the first throwable node to the `catch` + * block or the `finally` block. + * @returns {void} + */ + makeFirstThrowablePathInTryBlock() { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getThrowContext(this); + + if (context === this || + context.position !== "try" || + !context.thrownForkContext.empty + ) { + return; + } + + context.thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeNext(-1, -1)); + } + + //-------------------------------------------------------------------------- + // Loop Statements + //-------------------------------------------------------------------------- + + /** + * Creates a context object of a loop statement and stacks it. + * @param {string} type The type of the node which was triggered. One of + * `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`, + * and `ForStatement`. + * @param {string|null} label A label of the node which was triggered. + * @returns {void} + */ + pushLoopContext(type, label) { + const forkContext = this.forkContext; + const breakContext = this.pushBreakContext(true, label); + + switch (type) { + case "WhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "DoWhileStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + entrySegments: null, + continueForkContext: ForkContext.newEmpty(forkContext), + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForStatement": + this.pushChoiceContext("loop", false); + this.loopContext = { + upper: this.loopContext, + type, + label, + test: void 0, + endOfInitSegments: null, + testSegments: null, + endOfTestSegments: null, + updateSegments: null, + endOfUpdateSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + case "ForInStatement": + case "ForOfStatement": + this.loopContext = { + upper: this.loopContext, + type, + label, + prevSegments: null, + leftSegments: null, + endOfLeftSegments: null, + continueDestSegments: null, + brokenForkContext: breakContext.brokenForkContext + }; + break; + + /* istanbul ignore next */ + default: + throw new Error(`unknown type: "${type}"`); + } + } + + /** + * Pops the last context of a loop statement and finalizes it. + * @returns {void} + */ + popLoopContext() { + const context = this.loopContext; + + this.loopContext = context.upper; + + const forkContext = this.forkContext; + const brokenForkContext = this.popBreakContext().brokenForkContext; + + // Creates a looped path. + switch (context.type) { + case "WhileStatement": + case "ForStatement": + this.popChoiceContext(); + makeLooped( + this, + forkContext.head, + context.continueDestSegments + ); + break; + + case "DoWhileStatement": { + const choiceContext = this.popChoiceContext(); + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + if (context.test !== true) { + brokenForkContext.addAll(choiceContext.falseForkContext); + } + + // `true` paths go to looping. + const segmentsList = choiceContext.trueForkContext.segmentsList; + + for (let i = 0; i < segmentsList.length; ++i) { + makeLooped( + this, + segmentsList[i], + context.entrySegments + ); + } + break; + } + + case "ForInStatement": + case "ForOfStatement": + brokenForkContext.add(forkContext.head); + makeLooped( + this, + forkContext.head, + context.leftSegments + ); + break; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + + // Go next. + if (brokenForkContext.empty) { + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } else { + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + /** + * Makes a code path segment for the test part of a WhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const testSegments = forkContext.makeNext(0, -1); + + // Update state. + context.test = test; + context.continueDestSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the body part of a WhileStatement. + * @returns {void} + */ + makeWhileBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + if (!choiceContext.processed) { + choiceContext.trueForkContext.add(forkContext.head); + choiceContext.falseForkContext.add(forkContext.head); + } + + // Update state. + if (context.test !== true) { + context.brokenForkContext.addAll(choiceContext.falseForkContext); + } + forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1)); + } + + /** + * Makes a code path segment for the body part of a DoWhileStatement. + * @returns {void} + */ + makeDoWhileBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const bodySegments = forkContext.makeNext(-1, -1); + + // Update state. + context.entrySegments = bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the test part of a DoWhileStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeDoWhileTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + + context.test = test; + + // Creates paths of `continue` statements. + if (!context.continueForkContext.empty) { + context.continueForkContext.add(forkContext.head); + const testSegments = context.continueForkContext.makeNext(0, -1); + + forkContext.replaceHead(testSegments); + } + } + + /** + * Makes a code path segment for the test part of a ForStatement. + * @param {boolean|undefined} test The test value (only when constant). + * @returns {void} + */ + makeForTest(test) { + const context = this.loopContext; + const forkContext = this.forkContext; + const endOfInitSegments = forkContext.head; + const testSegments = forkContext.makeNext(-1, -1); + + // Update state. + context.test = test; + context.endOfInitSegments = endOfInitSegments; + context.continueDestSegments = context.testSegments = testSegments; + forkContext.replaceHead(testSegments); + } + + /** + * Makes a code path segment for the update part of a ForStatement. + * @returns {void} + */ + makeForUpdate() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Make the next paths of the test. + if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + // Update state. + const updateSegments = forkContext.makeDisconnected(-1, -1); + + context.continueDestSegments = context.updateSegments = updateSegments; + forkContext.replaceHead(updateSegments); + } + + /** + * Makes a code path segment for the body part of a ForStatement. + * @returns {void} + */ + makeForBody() { + const context = this.loopContext; + const choiceContext = this.choiceContext; + const forkContext = this.forkContext; + + // Update state. + if (context.updateSegments) { + context.endOfUpdateSegments = forkContext.head; + + // `update` -> `test` + if (context.testSegments) { + makeLooped( + this, + context.endOfUpdateSegments, + context.testSegments + ); + } + } else if (context.testSegments) { + finalizeTestSegmentsOfFor( + context, + choiceContext, + forkContext.head + ); + } else { + context.endOfInitSegments = forkContext.head; + } + + let bodySegments = context.endOfTestSegments; + + if (!bodySegments) { + + /* + * If there is not the `test` part, the `body` path comes from the + * `init` part and the `update` part. + */ + const prevForkContext = ForkContext.newEmpty(forkContext); + + prevForkContext.add(context.endOfInitSegments); + if (context.endOfUpdateSegments) { + prevForkContext.add(context.endOfUpdateSegments); + } + + bodySegments = prevForkContext.makeNext(0, -1); + } + context.continueDestSegments = context.continueDestSegments || bodySegments; + forkContext.replaceHead(bodySegments); + } + + /** + * Makes a code path segment for the left part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfLeft() { + const context = this.loopContext; + const forkContext = this.forkContext; + const leftSegments = forkContext.makeDisconnected(-1, -1); + + // Update state. + context.prevSegments = forkContext.head; + context.leftSegments = context.continueDestSegments = leftSegments; + forkContext.replaceHead(leftSegments); + } + + /** + * Makes a code path segment for the right part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfRight() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.prevSegments); + const rightSegments = temp.makeNext(-1, -1); + + // Update state. + context.endOfLeftSegments = forkContext.head; + forkContext.replaceHead(rightSegments); + } + + /** + * Makes a code path segment for the body part of a ForInStatement and a + * ForOfStatement. + * @returns {void} + */ + makeForInOfBody() { + const context = this.loopContext; + const forkContext = this.forkContext; + const temp = ForkContext.newEmpty(forkContext); + + temp.add(context.endOfLeftSegments); + const bodySegments = temp.makeNext(-1, -1); + + // Make a path: `right` -> `left`. + makeLooped(this, forkContext.head, context.leftSegments); + + // Update state. + context.brokenForkContext.add(forkContext.head); + forkContext.replaceHead(bodySegments); + } + + //-------------------------------------------------------------------------- + // Control Statements + //-------------------------------------------------------------------------- + + /** + * Creates new context for BreakStatement. + * @param {boolean} breakable The flag to indicate it can break by + * an unlabeled BreakStatement. + * @param {string|null} label The label of this context. + * @returns {Object} The new context. + */ + pushBreakContext(breakable, label) { + this.breakContext = { + upper: this.breakContext, + breakable, + label, + brokenForkContext: ForkContext.newEmpty(this.forkContext) + }; + return this.breakContext; + } + + /** + * Removes the top item of the break context stack. + * @returns {Object} The removed context. + */ + popBreakContext() { + const context = this.breakContext; + const forkContext = this.forkContext; + + this.breakContext = context.upper; + + // Process this context here for other than switches and loops. + if (!context.breakable) { + const brokenForkContext = context.brokenForkContext; + + if (!brokenForkContext.empty) { + brokenForkContext.add(forkContext.head); + forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); + } + } + + return context; + } + + /** + * Makes a path for a `break` statement. + * + * It registers the head segment to a context of `break`. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the break statement. + * @returns {void} + */ + makeBreak(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getBreakContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + context.brokenForkContext.add(forkContext.head); + } + + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `continue` statement. + * + * It makes a looping path. + * It makes new unreachable segment, then it set the head with the segment. + * @param {string} label A label of the continue statement. + * @returns {void} + */ + makeContinue(label) { + const forkContext = this.forkContext; + + if (!forkContext.reachable) { + return; + } + + const context = getContinueContext(this, label); + + /* istanbul ignore else: foolproof (syntax error) */ + if (context) { + if (context.continueDestSegments) { + makeLooped(this, forkContext.head, context.continueDestSegments); + + // If the context is a for-in/of loop, this effects a break also. + if (context.type === "ForInStatement" || + context.type === "ForOfStatement" + ) { + context.brokenForkContext.add(forkContext.head); + } + } else { + context.continueForkContext.add(forkContext.head); + } + } + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + + /** + * Makes a path for a `return` statement. + * + * It registers the head segment to a context of `return`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeReturn() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getReturnContext(this).returnedForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes a path for a `throw` statement. + * + * It registers the head segment to a context of `throw`. + * It makes new unreachable segment, then it set the head with the segment. + * @returns {void} + */ + makeThrow() { + const forkContext = this.forkContext; + + if (forkContext.reachable) { + getThrowContext(this).thrownForkContext.add(forkContext.head); + forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); + } + } + + /** + * Makes the final path. + * @returns {void} + */ + makeFinal() { + const segments = this.currentSegments; + + if (segments.length > 0 && segments[0].reachable) { + this.returnedForkContext.add(segments); + } + } +} + +module.exports = CodePathState; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path.js new file mode 100644 index 0000000..49b37c6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/code-path.js @@ -0,0 +1,238 @@ +/** + * @fileoverview A class of the code path. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const CodePathState = require("./code-path-state"); +const IdGenerator = require("./id-generator"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A code path. + */ +class CodePath { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} id An identifier. + * @param {CodePath|null} upper The code path of the upper function scope. + * @param {Function} onLooped A callback function to notify looping. + */ + constructor(id, upper, onLooped) { + + /** + * The identifier of this code path. + * Rules use it to store additional information of each rule. + * @type {string} + */ + this.id = id; + + /** + * The code path of the upper function scope. + * @type {CodePath|null} + */ + this.upper = upper; + + /** + * The code paths of nested function scopes. + * @type {CodePath[]} + */ + this.childCodePaths = []; + + // Initializes internal state. + Object.defineProperty( + this, + "internal", + { value: new CodePathState(new IdGenerator(`${id}_`), onLooped) } + ); + + // Adds this into `childCodePaths` of `upper`. + if (upper) { + upper.childCodePaths.push(this); + } + } + + /** + * Gets the state of a given code path. + * @param {CodePath} codePath A code path to get. + * @returns {CodePathState} The state of the code path. + */ + static getState(codePath) { + return codePath.internal; + } + + /** + * The initial code path segment. + * @type {CodePathSegment} + */ + get initialSegment() { + return this.internal.initialSegment; + } + + /** + * Final code path segments. + * This array is a mix of `returnedSegments` and `thrownSegments`. + * @type {CodePathSegment[]} + */ + get finalSegments() { + return this.internal.finalSegments; + } + + /** + * Final code path segments which is with `return` statements. + * This array contains the last path segment if it's reachable. + * Since the reachable last path returns `undefined`. + * @type {CodePathSegment[]} + */ + get returnedSegments() { + return this.internal.returnedForkContext; + } + + /** + * Final code path segments which is with `throw` statements. + * @type {CodePathSegment[]} + */ + get thrownSegments() { + return this.internal.thrownForkContext; + } + + /** + * Current code path segments. + * @type {CodePathSegment[]} + */ + get currentSegments() { + return this.internal.currentSegments; + } + + /** + * Traverses all segments in this code path. + * + * codePath.traverseSegments(function(segment, controller) { + * // do something. + * }); + * + * This method enumerates segments in order from the head. + * + * The `controller` object has two methods. + * + * - `controller.skip()` - Skip the following segments in this branch. + * - `controller.break()` - Skip all following segments. + * @param {Object} [options] Omittable. + * @param {CodePathSegment} [options.first] The first segment to traverse. + * @param {CodePathSegment} [options.last] The last segment to traverse. + * @param {Function} callback A callback function. + * @returns {void} + */ + traverseSegments(options, callback) { + let resolvedOptions; + let resolvedCallback; + + if (typeof options === "function") { + resolvedCallback = options; + resolvedOptions = {}; + } else { + resolvedOptions = options || {}; + resolvedCallback = callback; + } + + const startSegment = resolvedOptions.first || this.internal.initialSegment; + const lastSegment = resolvedOptions.last; + + let item = null; + let index = 0; + let end = 0; + let segment = null; + const visited = Object.create(null); + const stack = [[startSegment, 0]]; + let skippedSegment = null; + let broken = false; + const controller = { + skip() { + if (stack.length <= 1) { + broken = true; + } else { + skippedSegment = stack[stack.length - 2][0]; + } + }, + break() { + broken = true; + } + }; + + /** + * Checks a given previous segment has been visited. + * @param {CodePathSegment} prevSegment A previous segment to check. + * @returns {boolean} `true` if the segment has been visited. + */ + function isVisited(prevSegment) { + return ( + visited[prevSegment.id] || + segment.isLoopedPrevSegment(prevSegment) + ); + } + + while (stack.length > 0) { + item = stack[stack.length - 1]; + segment = item[0]; + index = item[1]; + + if (index === 0) { + + // Skip if this segment has been visited already. + if (visited[segment.id]) { + stack.pop(); + continue; + } + + // Skip if all previous segments have not been visited. + if (segment !== startSegment && + segment.prevSegments.length > 0 && + !segment.prevSegments.every(isVisited) + ) { + stack.pop(); + continue; + } + + // Reset the flag of skipping if all branches have been skipped. + if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) { + skippedSegment = null; + } + visited[segment.id] = true; + + // Call the callback when the first time. + if (!skippedSegment) { + resolvedCallback.call(this, segment, controller); + if (segment === lastSegment) { + controller.skip(); + } + if (broken) { + break; + } + } + } + + // Update the stack. + end = segment.nextSegments.length - 1; + if (index < end) { + item[1] += 1; + stack.push([segment.nextSegments[index], 0]); + } else if (index === end) { + item[0] = segment.nextSegments[index]; + item[1] = 0; + } else { + stack.pop(); + } + } + } +} + +module.exports = CodePath; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js new file mode 100644 index 0000000..bde4e0a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Helpers to debug for code path analysis. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:code-path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets id of a given segment. + * @param {CodePathSegment} segment A segment to get. + * @returns {string} Id of the segment. + */ +/* istanbul ignore next */ +function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc + return segment.id + (segment.reachable ? "" : "!"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * A flag that debug dumping is enabled or not. + * @type {boolean} + */ + enabled: debug.enabled, + + /** + * Dumps given objects. + * @param {...any} args objects to dump. + * @returns {void} + */ + dump: debug, + + /** + * Dumps the current analyzing state. + * @param {ASTNode} node A node to dump. + * @param {CodePathState} state A state to dump. + * @param {boolean} leaving A flag whether or not it's leaving + * @returns {void} + */ + dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) { + for (let i = 0; i < state.currentSegments.length; ++i) { + const segInternal = state.currentSegments[i].internal; + + if (leaving) { + segInternal.exitNodes.push(node); + } else { + segInternal.nodes.push(node); + } + } + + debug([ + `${state.currentSegments.map(getId).join(",")})`, + `${node.type}${leaving ? ":exit" : ""}` + ].join(" ")); + }, + + /** + * Dumps a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to dump. + * @returns {void} + * @see http://www.graphviz.org + * @see http://www.webgraphviz.com + */ + dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) { + let text = + "\n" + + "digraph {\n" + + "node[shape=box,style=\"rounded,filled\",fillcolor=white];\n" + + "initial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + + if (codePath.returnedSegments.length > 0) { + text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; + } + if (codePath.thrownSegments.length > 0) { + text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n"; + } + + const traceMap = Object.create(null); + const arrows = this.makeDotArrows(codePath, traceMap); + + for (const id in traceMap) { // eslint-disable-line guard-for-in + const segment = traceMap[id]; + + text += `${id}[`; + + if (segment.reachable) { + text += "label=\""; + } else { + text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<>\\n"; + } + + if (segment.internal.nodes.length > 0 || segment.internal.exitNodes.length > 0) { + text += [].concat( + segment.internal.nodes.map(node => { + switch (node.type) { + case "Identifier": return `${node.type} (${node.name})`; + case "Literal": return `${node.type} (${node.value})`; + default: return node.type; + } + }), + segment.internal.exitNodes.map(node => { + switch (node.type) { + case "Identifier": return `${node.type}:exit (${node.name})`; + case "Literal": return `${node.type}:exit (${node.value})`; + default: return `${node.type}:exit`; + } + }) + ).join("\\n"); + } else { + text += "????"; + } + + text += "\"];\n"; + } + + text += `${arrows}\n`; + text += "}"; + debug("DOT", text); + }, + + /** + * Makes a DOT code of a given code path. + * The DOT code can be visualized with Graphvis. + * @param {CodePath} codePath A code path to make DOT. + * @param {Object} traceMap Optional. A map to check whether or not segments had been done. + * @returns {string} A DOT code of the code path. + */ + makeDotArrows(codePath, traceMap) { + const stack = [[codePath.initialSegment, 0]]; + const done = traceMap || Object.create(null); + let lastId = codePath.initialSegment.id; + let text = `initial->${codePath.initialSegment.id}`; + + while (stack.length > 0) { + const item = stack.pop(); + const segment = item[0]; + const index = item[1]; + + if (done[segment.id] && index === 0) { + continue; + } + done[segment.id] = segment; + + const nextSegment = segment.allNextSegments[index]; + + if (!nextSegment) { + continue; + } + + if (lastId === segment.id) { + text += `->${nextSegment.id}`; + } else { + text += `;\n${segment.id}->${nextSegment.id}`; + } + lastId = nextSegment.id; + + stack.unshift([segment, 1 + index]); + stack.push([nextSegment, 0]); + } + + codePath.returnedSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->final"; + } else { + text += `;\n${finalSegment.id}->final`; + } + lastId = null; + }); + + codePath.thrownSegments.forEach(finalSegment => { + if (lastId === finalSegment.id) { + text += "->thrown"; + } else { + text += `;\n${finalSegment.id}->thrown`; + } + lastId = null; + }); + + return `${text};`; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js new file mode 100644 index 0000000..2e872b5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js @@ -0,0 +1,249 @@ +/** + * @fileoverview A class to operate forking. + * + * This is state of forking. + * This has a fork list and manages it. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"), + CodePathSegment = require("./code-path-segment"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets whether or not a given segment is reachable. + * @param {CodePathSegment} segment A segment to get. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Creates new segments from the specific range of `context.segmentsList`. + * + * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and + * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`. + * This `h` is from `b`, `d`, and `f`. + * @param {ForkContext} context An instance. + * @param {number} begin The first index of the previous segments. + * @param {number} end The last index of the previous segments. + * @param {Function} create A factory function of new segments. + * @returns {CodePathSegment[]} New segments. + */ +function makeSegments(context, begin, end, create) { + const list = context.segmentsList; + + const normalizedBegin = begin >= 0 ? begin : list.length + begin; + const normalizedEnd = end >= 0 ? end : list.length + end; + + const segments = []; + + for (let i = 0; i < context.count; ++i) { + const allPrevSegments = []; + + for (let j = normalizedBegin; j <= normalizedEnd; ++j) { + allPrevSegments.push(list[j][i]); + } + + segments.push(create(context.idGenerator.next(), allPrevSegments)); + } + + return segments; +} + +/** + * `segments` becomes doubly in a `finally` block. Then if a code path exits by a + * control statement (such as `break`, `continue`) from the `finally` block, the + * destination's segments may be half of the source segments. In that case, this + * merges segments. + * @param {ForkContext} context An instance. + * @param {CodePathSegment[]} segments Segments to merge. + * @returns {CodePathSegment[]} The merged segments. + */ +function mergeExtraSegments(context, segments) { + let currentSegments = segments; + + while (currentSegments.length > context.count) { + const merged = []; + + for (let i = 0, length = currentSegments.length / 2 | 0; i < length; ++i) { + merged.push(CodePathSegment.newNext( + context.idGenerator.next(), + [currentSegments[i], currentSegments[i + length]] + )); + } + currentSegments = merged; + } + return currentSegments; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A class to manage forking. + */ +class ForkContext { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @param {ForkContext|null} upper An upper fork context. + * @param {number} count A number of parallel segments. + */ + constructor(idGenerator, upper, count) { + this.idGenerator = idGenerator; + this.upper = upper; + this.count = count; + this.segmentsList = []; + } + + /** + * The head segments. + * @type {CodePathSegment[]} + */ + get head() { + const list = this.segmentsList; + + return list.length === 0 ? [] : list[list.length - 1]; + } + + /** + * A flag which shows empty. + * @type {boolean} + */ + get empty() { + return this.segmentsList.length === 0; + } + + /** + * A flag which shows reachable. + * @type {boolean} + */ + get reachable() { + const segments = this.head; + + return segments.length > 0 && segments.some(isReachable); + } + + /** + * Creates new segments from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeNext(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newNext); + } + + /** + * Creates new segments from this context. + * The new segments is always unreachable. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeUnreachable(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newUnreachable); + } + + /** + * Creates new segments from this context. + * The new segments don't have connections for previous segments. + * But these inherit the reachable flag from this context. + * @param {number} begin The first index of previous segments. + * @param {number} end The last index of previous segments. + * @returns {CodePathSegment[]} New segments. + */ + makeDisconnected(begin, end) { + return makeSegments(this, begin, end, CodePathSegment.newDisconnected); + } + + /** + * Adds segments into this context. + * The added segments become the head. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + add(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.push(mergeExtraSegments(this, segments)); + } + + /** + * Replaces the head segments with given segments. + * The current head segments are removed. + * @param {CodePathSegment[]} segments Segments to add. + * @returns {void} + */ + replaceHead(segments) { + assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); + + this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments)); + } + + /** + * Adds all segments of a given fork context into this context. + * @param {ForkContext} context A fork context to add. + * @returns {void} + */ + addAll(context) { + assert(context.count === this.count); + + const source = context.segmentsList; + + for (let i = 0; i < source.length; ++i) { + this.segmentsList.push(source[i]); + } + } + + /** + * Clears all segments in this context. + * @returns {void} + */ + clear() { + this.segmentsList = []; + } + + /** + * Creates the root fork context. + * @param {IdGenerator} idGenerator An identifier generator for segments. + * @returns {ForkContext} New fork context. + */ + static newRoot(idGenerator) { + const context = new ForkContext(idGenerator, null, 1); + + context.add([CodePathSegment.newRoot(idGenerator.next())]); + + return context; + } + + /** + * Creates an empty fork context preceded by a given context. + * @param {ForkContext} parentContext The parent fork context. + * @param {boolean} forkLeavingPath A flag which shows inside of `finally` block. + * @returns {ForkContext} New fork context. + */ + static newEmpty(parentContext, forkLeavingPath) { + return new ForkContext( + parentContext.idGenerator, + parentContext, + (forkLeavingPath ? 2 : 1) * parentContext.count + ); + } +} + +module.exports = ForkContext; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js new file mode 100644 index 0000000..4cb2e0e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A class of identifiers generator for code path segments. + * + * Each rule uses the identifier of code path segments to store additional + * information of the code path. + * + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A generator for unique ids. + */ +class IdGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} prefix Optional. A prefix of generated ids. + */ + constructor(prefix) { + this.prefix = String(prefix); + this.n = 0; + } + + /** + * Generates id. + * @returns {string} A generated id. + */ + next() { + this.n = 1 + this.n | 0; + + /* istanbul ignore if */ + if (this.n < 0) { + this.n = 1; + } + + return this.prefix + this.n; + } +} + +module.exports = IdGenerator; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/config-comment-parser.js b/day1/cli-study/node_modules/eslint/lib/linter/config-comment-parser.js new file mode 100644 index 0000000..067d024 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/config-comment-parser.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + +/* eslint-disable class-methods-use-this*/ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const levn = require("levn"), + ConfigOps = require("../shared/config-ops"); + +const debug = require("debug")("eslint:config-comment-parser"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments inside JavaScript files. + * @name ConfigCommentParser + */ +module.exports = class ConfigCommentParser { + + /** + * Parses a list of "name:string_value" or/and "name" options divided by comma or + * whitespace. Used for "global" and "exported" comments. + * @param {string} string The string to parse. + * @param {Comment} comment The comment node which has the string. + * @returns {Object} Result map object of names and string values, or null values if no value was provided + */ + parseStringConfig(string, comment) { + debug("Parsing String config"); + + const items = {}; + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string.replace(/\s*([:,])\s*/gu, "$1"); + + trimmedString.split(/\s|,+/u).forEach(name => { + if (!name) { + return; + } + + // value defaults to null (if not provided), e.g: "foo" => ["foo", null] + const [key, value = null] = name.split(":"); + + items[key] = { value, comment }; + }); + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @param {Object} location Start line and column of comments for potential error message. + * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object + */ + parseJsonConfig(string, location) { + debug("Parsing JSON config"); + + let items = {}; + + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + items = levn.parse("Object", string) || {}; + + // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. + // Also, commaless notations have invalid severity: + // "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"} + // Should ignore that case as well. + if (ConfigOps.isEverySeverityValid(items)) { + return { + success: true, + config: items + }; + } + } catch { + + debug("Levn parsing failed; falling back to manual parsing."); + + // ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + items = {}; + const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,"); + + try { + items = JSON.parse(`{${normalizedString}}`); + } catch (ex) { + debug("Manual parsing failed."); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, + line: location.start.line, + column: location.start.column + 1 + } + }; + + } + + return { + success: true, + config: items + }; + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {Object} Result map of values and true values + */ + parseListConfig(string) { + debug("Parsing list config"); + + const items = {}; + + // Collapse whitespace around commas + string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { + const trimmedName = name.trim(); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + return items; + } + +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/index.js b/day1/cli-study/node_modules/eslint/lib/linter/index.js new file mode 100644 index 0000000..25fd769 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/index.js @@ -0,0 +1,13 @@ +"use strict"; + +const { Linter } = require("./linter"); +const interpolate = require("./interpolate"); +const SourceCodeFixer = require("./source-code-fixer"); + +module.exports = { + Linter, + + // For testers. + SourceCodeFixer, + interpolate +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/interpolate.js b/day1/cli-study/node_modules/eslint/lib/linter/interpolate.js new file mode 100644 index 0000000..87e06a0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/interpolate.js @@ -0,0 +1,28 @@ +/** + * @fileoverview Interpolate keys from an object into a string with {{ }} markers. + * @author Jed Fox + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (text, data) => { + if (!data) { + return text; + } + + // Substitution content for any {{ }} markers. + return text.replace(/\{\{([^{}]+?)\}\}/gu, (fullMatch, termWithWhitespace) => { + const term = termWithWhitespace.trim(); + + if (term in data) { + return data[term]; + } + + // Preserve old behavior: If parameter name not provided, don't replace it. + return fullMatch; + }); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/linter.js b/day1/cli-study/node_modules/eslint/lib/linter/linter.js new file mode 100644 index 0000000..f9f3879 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/linter.js @@ -0,0 +1,1464 @@ +/** + * @fileoverview Main Linter Class + * @author Gyandeep Singh + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + path = require("path"), + eslintScope = require("eslint-scope"), + evk = require("eslint-visitor-keys"), + espree = require("espree"), + lodash = require("lodash"), + BuiltInEnvironments = require("../../conf/environments"), + pkg = require("../../package.json"), + astUtils = require("../shared/ast-utils"), + ConfigOps = require("../shared/config-ops"), + validator = require("../shared/config-validator"), + Traverser = require("../shared/traverser"), + { SourceCode } = require("../source-code"), + CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"), + applyDisableDirectives = require("./apply-disable-directives"), + ConfigCommentParser = require("./config-comment-parser"), + NodeEventGenerator = require("./node-event-generator"), + createReportTranslator = require("./report-translator"), + Rules = require("./rules"), + createEmitter = require("./safe-emitter"), + SourceCodeFixer = require("./source-code-fixer"), + timing = require("./timing"), + ruleReplacements = require("../../conf/replacements.json"); + +const debug = require("debug")("eslint:linter"); +const MAX_AUTOFIX_PASSES = 10; +const DEFAULT_PARSER_NAME = "espree"; +const commentParser = new ConfigCommentParser(); +const DEFAULT_ERROR_LOC = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {InstanceType} ConfigArray */ +/** @typedef {InstanceType} ExtractedConfig */ +/** @typedef {import("../shared/types").ConfigData} ConfigData */ +/** @typedef {import("../shared/types").Environment} Environment */ +/** @typedef {import("../shared/types").GlobalConf} GlobalConf */ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ +/** @typedef {import("../shared/types").ParserOptions} ParserOptions */ +/** @typedef {import("../shared/types").Processor} Processor */ +/** @typedef {import("../shared/types").Rule} Rule */ + +/** + * @template T + * @typedef {{ [P in keyof T]-?: T[P] }} Required + */ + +/** + * @typedef {Object} DisableDirective + * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type + * @property {number} line + * @property {number} column + * @property {(string|null)} ruleId + */ + +/** + * The private data for `Linter` instance. + * @typedef {Object} LinterInternalSlots + * @property {ConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used. + * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used. + * @property {Map} parserMap The loaded parsers. + * @property {Rules} ruleMap The loaded rules. + */ + +/** + * @typedef {Object} VerifyOptions + * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability + * to change config once it is set. Defaults to true if not supplied. + * Useful if you want to validate JS without comments overriding rules. + * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix` + * properties into the lint result. + * @property {string} [filename] the filename of the source code. + * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for + * unused `eslint-disable` directives. + */ + +/** + * @typedef {Object} ProcessorOptions + * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the + * predicate function that selects adopt code blocks. + * @property {Processor["postprocess"]} [postprocess] postprocessor for report + * messages. If provided, this should accept an array of the message lists + * for each code block returned from the preprocessor, apply a mapping to + * the messages as appropriate, and return a one-dimensional array of + * messages. + * @property {Processor["preprocess"]} [preprocess] preprocessor for source text. + * If provided, this should accept a string of source text, and return an + * array of code blocks to lint. + */ + +/** + * @typedef {Object} FixOptions + * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines + * whether fixes should be applied. + */ + +/** + * @typedef {Object} InternalOptions + * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments. + * @property {"off" | "warn" | "error"} reportUnusedDisableDirectives (boolean values were normalized) + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object} configGlobals The globals declared in configuration + * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, enabledGlobals }) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) { + + /* + * `ConfigOps.normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : ConfigOps.normalizeConfigGlobal(configGlobals[id]); + const commentValue = enabledGlobals[id] && enabledGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = enabledGlobals[id] && enabledGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + // mark all exported variables as such + Object.keys(exportedVariables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + } + }); + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * creates a missing-rule message. + * @param {string} ruleId the ruleId to create + * @returns {string} created error message + * @private + */ +function createMissingRuleMessage(ruleId) { + return Object.prototype.hasOwnProperty.call(ruleReplacements.rules, ruleId) + ? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}` + : `Definition for rule '${ruleId}' was not found.`; +} + +/** + * creates a linting problem + * @param {Object} options to create linting error + * @param {string} [options.ruleId] the ruleId to report + * @param {Object} [options.loc] the loc to report + * @param {string} [options.message] the error message to report + * @param {string} [options.severity] the error message to report + * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. + * @private + */ +function createLintingProblem(options) { + const { + ruleId = null, + loc = DEFAULT_ERROR_LOC, + message = createMissingRuleMessage(options.ruleId), + severity = 2 + } = options; + + return { + ruleId, + message, + line: loc.start.line, + column: loc.start.column + 1, + endLine: loc.end.line, + endColumn: loc.end.column + 1, + severity, + nodeType: null + }; +} + +/** + * Creates a collection of disable directives from a comment + * @param {Object} options to create disable directives + * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment + * @param {{line: number, column: number}} options.loc The 0-based location of the comment token + * @param {string} options.value The value after the directive in the comment + * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`) + * @param {function(string): {create: Function}} options.ruleMapper A map from rule IDs to defined rules + * @returns {Object} Directives and problems from the comment + */ +function createDisableDirectives(options) { + const { type, loc, value, ruleMapper } = options; + const ruleIds = Object.keys(commentParser.parseListConfig(value)); + const directiveRules = ruleIds.length ? ruleIds : [null]; + const result = { + directives: [], // valid disable directives + directiveProblems: [] // problems in directives + }; + + for (const ruleId of directiveRules) { + + // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) + if (ruleId === null || ruleMapper(ruleId) !== null) { + result.directives.push({ type, line: loc.start.line, column: loc.start.column + 1, ruleId }); + } else { + result.directiveProblems.push(createLintingProblem({ ruleId, loc })); + } + } + return result; +} + +/** + * Remove the ignored part from a given directive comment and trim it. + * @param {string} value The comment text to strip. + * @returns {string} The stripped text. + */ +function stripDirectiveComment(value) { + return value.split(/\s-{2,}\s/u)[0].trim(); +} + +/** + * Parses comments in file to extract file-specific config of rules, globals + * and environments and merges them with global config; also code blocks + * where reporting is disabled or enabled and merges them with reporting config. + * @param {string} filename The file being checked. + * @param {ASTNode} ast The top node of the AST. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from. + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { + const configuredRules = {}; + const enabledGlobals = Object.create(null); + const exportedVariables = {}; + const problems = []; + const disableDirectives = []; + + ast.comments.filter(token => token.type !== "Shebang").forEach(comment => { + const trimmedCommentText = stripDirectiveComment(comment.value); + const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(trimmedCommentText); + + if (!match) { + return; + } + const directiveText = match[1]; + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + if (warnInlineConfig) { + const kind = comment.type === "Block" ? `/*${directiveText}*/` : `//${directiveText}`; + + problems.push(createLintingProblem({ + ruleId: null, + message: `'${kind}' has no effect because you have 'noInlineConfig' setting in ${warnInlineConfig}.`, + loc: comment.loc, + severity: 1 + })); + return; + } + + if (lineCommentSupported && comment.loc.start.line !== comment.loc.end.line) { + const message = `${directiveText} comment should not span multiple lines.`; + + problems.push(createLintingProblem({ + ruleId: null, + message, + loc: comment.loc + })); + return; + } + + const directiveValue = trimmedCommentText.slice(match.index + directiveText.length); + + switch (directiveText) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = directiveText.slice("eslint-".length); + const options = { type: directiveType, loc: comment.loc, value: directiveValue, ruleMapper }; + const { directives, directiveProblems } = createDisableDirectives(options); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; + } + + case "exported": + Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); + break; + + case "globals": + case "global": + for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { + let normalizedValue; + + try { + normalizedValue = ConfigOps.normalizeConfigGlobal(value); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: null, + loc: comment.loc, + message: err.message + })); + continue; + } + + if (enabledGlobals[id]) { + enabledGlobals[id].comments.push(comment); + enabledGlobals[id].value = normalizedValue; + } else { + enabledGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); + + if (parseResult.success) { + Object.keys(parseResult.config).forEach(name => { + const rule = ruleMapper(name); + const ruleValue = parseResult.config[name]; + + if (rule === null) { + problems.push(createLintingProblem({ ruleId: name, loc: comment.loc })); + return; + } + + try { + validator.validateRuleOptions(rule, name, ruleValue); + } catch (err) { + problems.push(createLintingProblem({ + ruleId: name, + message: err.message, + loc: comment.loc + })); + + // do not apply the config, if found invalid options. + return; + } + + configuredRules[name] = ruleValue; + }); + } else { + problems.push(parseResult.error); + } + + break; + } + + // no default + } + }); + + return { + configuredRules, + enabledGlobals, + exportedVariables, + problems, + disableDirectives + }; +} + +/** + * Normalize ECMAScript version from the initial config + * @param {number} ecmaVersion ECMAScript version from the initial config + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion) { + + /* + * Calculate ECMAScript edition number from official year version starting with + * ES2015, which corresponds with ES6 (or a difference of 2009). + */ + return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; +} + +const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gu; + +/** + * Checks whether or not there is a comment which has "eslint-env *" in a given text. + * @param {string} text A source code text to check. + * @returns {Object|null} A result of parseListConfig() with "eslint-env *" comment. + */ +function findEslintEnv(text) { + let match, retv; + + eslintEnvPattern.lastIndex = 0; + + while ((match = eslintEnvPattern.exec(text)) !== null) { + retv = Object.assign( + retv || {}, + commentParser.parseListConfig(stripDirectiveComment(match[1])) + ); + } + + return retv; +} + +/** + * Convert "/path/to/" to "". + * `CLIEngine#executeOnText()` method gives "/path/to/" if the filename + * was omitted because `configArray.extractConfig()` requires an absolute path. + * But the linter should pass `` to `RuleContext#getFilename()` in that + * case. + * Also, code blocks can have their virtual filename. If the parent filename was + * ``, the virtual filename is `/0_foo.js` or something like (i.e., + * it's not an absolute path). + * @param {string} filename The filename to normalize. + * @returns {string} The normalized filename. + */ +function normalizeFilename(filename) { + const parts = filename.split(path.sep); + const index = parts.lastIndexOf(""); + + return index === -1 ? filename : parts.slice(index).join(path.sep); +} + +/** + * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a + * consistent shape. + * @param {VerifyOptions} providedOptions Options + * @param {ConfigData} config Config. + * @returns {Required & InternalOptions} Normalized options + */ +function normalizeVerifyOptions(providedOptions, config) { + const disableInlineConfig = config.noInlineConfig === true; + const ignoreInlineConfig = providedOptions.allowInlineConfig === false; + const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig + ? ` (${config.configNameOfNoInlineConfig})` + : ""; + + let reportUnusedDisableDirectives = providedOptions.reportUnusedDisableDirectives; + + if (typeof reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; + } + if (typeof reportUnusedDisableDirectives !== "string") { + reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off"; + } + + return { + filename: normalizeFilename(providedOptions.filename || ""), + allowInlineConfig: !ignoreInlineConfig, + warnInlineConfig: disableInlineConfig && !ignoreInlineConfig + ? `your config${configNameOfNoInlineConfig}` + : null, + reportUnusedDisableDirectives, + disableFixes: Boolean(providedOptions.disableFixes) + }; +} + +/** + * Combines the provided parserOptions with the options from environments + * @param {string} parserName The parser name which uses this options. + * @param {ParserOptions} providedOptions The provided 'parserOptions' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {ParserOptions} Resulting parser options after merge + */ +function resolveParserOptions(parserName, providedOptions, enabledEnvironments) { + const parserOptionsFromEnv = enabledEnvironments + .filter(env => env.parserOptions) + .reduce((parserOptions, env) => lodash.merge(parserOptions, env.parserOptions), {}); + const mergedParserOptions = lodash.merge(parserOptionsFromEnv, providedOptions || {}); + const isModule = mergedParserOptions.sourceType === "module"; + + if (isModule) { + + /* + * can't have global return inside of modules + * TODO: espree validate parserOptions.globalReturn when sourceType is setting to module.(@aladdin-add) + */ + mergedParserOptions.ecmaFeatures = Object.assign({}, mergedParserOptions.ecmaFeatures, { globalReturn: false }); + } + + /* + * TODO: @aladdin-add + * 1. for a 3rd-party parser, do not normalize parserOptions + * 2. for espree, no need to do this (espree will do it) + */ + mergedParserOptions.ecmaVersion = normalizeEcmaVersion(mergedParserOptions.ecmaVersion); + + return mergedParserOptions; +} + +/** + * Combines the provided globals object with the globals from environments + * @param {Record} providedGlobals The 'globals' key in a config + * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments + * @returns {Record} The resolved globals object + */ +function resolveGlobals(providedGlobals, enabledEnvironments) { + return Object.assign( + {}, + ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), + providedGlobals + ); +} + +/** + * Strips Unicode BOM from a given text. + * @param {string} text A text to strip. + * @returns {string} The stripped text. + */ +function stripUnicodeBOM(text) { + + /* + * Check Unicode BOM. + * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF. + * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters + */ + if (text.charCodeAt(0) === 0xFEFF) { + return text.slice(1); + } + return text; +} + +/** + * Get the options for a rule (not including severity), if any + * @param {Array|number} ruleConfig rule configuration + * @returns {Array} of rule options, empty Array if none + */ +function getRuleOptions(ruleConfig) { + if (Array.isArray(ruleConfig)) { + return ruleConfig.slice(1); + } + return []; + +} + +/** + * Analyze scope of the given AST. + * @param {ASTNode} ast The `Program` node to analyze. + * @param {ParserOptions} parserOptions The parser options. + * @param {Record} visitorKeys The visitor keys. + * @returns {ScopeManager} The analysis result. + */ +function analyzeScope(ast, parserOptions, visitorKeys) { + const ecmaFeatures = parserOptions.ecmaFeatures || {}; + const ecmaVersion = parserOptions.ecmaVersion || 5; + + return eslintScope.analyze(ast, { + ignoreEval: true, + nodejsScope: ecmaFeatures.globalReturn, + impliedStrict: ecmaFeatures.impliedStrict, + ecmaVersion, + sourceType: parserOptions.sourceType || "script", + childVisitorKeys: visitorKeys || evk.KEYS, + fallback: Traverser.getKeys + }); +} + +/** + * Parses text into an AST. Moved out here because the try-catch prevents + * optimization of functions, so it's best to keep the try-catch as isolated + * as possible + * @param {string} text The text to parse. + * @param {Parser} parser The parser to parse. + * @param {ParserOptions} providedParserOptions Options to pass to the parser + * @param {string} filePath The path to the file being parsed. + * @returns {{success: false, error: Problem}|{success: true, sourceCode: SourceCode}} + * An object containing the AST and parser services if parsing was successful, or the error if parsing failed + * @private + */ +function parse(text, parser, providedParserOptions, filePath) { + const textToParse = stripUnicodeBOM(text).replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); + const parserOptions = Object.assign({}, providedParserOptions, { + loc: true, + range: true, + raw: true, + tokens: true, + comment: true, + eslintVisitorKeys: true, + eslintScopeManager: true, + filePath + }); + + /* + * Check for parsing errors first. If there's a parsing error, nothing + * else can happen. However, a parsing error does not throw an error + * from this method - it's just considered a fatal error message, a + * problem that ESLint identified just like any other. + */ + try { + const parseResult = (typeof parser.parseForESLint === "function") + ? parser.parseForESLint(textToParse, parserOptions) + : { ast: parser.parse(textToParse, parserOptions) }; + const ast = parseResult.ast; + const parserServices = parseResult.services || {}; + const visitorKeys = parseResult.visitorKeys || evk.KEYS; + const scopeManager = parseResult.scopeManager || analyzeScope(ast, parserOptions, visitorKeys); + + return { + success: true, + + /* + * Save all values that `parseForESLint()` returned. + * If a `SourceCode` object is given as the first parameter instead of source code text, + * linter skips the parsing process and reuses the source code object. + * In that case, linter needs all the values that `parseForESLint()` returned. + */ + sourceCode: new SourceCode({ + text, + ast, + parserServices, + scopeManager, + visitorKeys + }) + }; + } catch (ex) { + + // If the message includes a leading line number, strip it: + const message = `Parsing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`; + + debug("%s\n%s", message, ex.stack); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message, + line: ex.lineNumber, + column: ex.column + } + }; + } +} + +/** + * Gets the scope for the current node + * @param {ScopeManager} scopeManager The scope manager for this AST + * @param {ASTNode} currentNode The node to get the scope of + * @returns {eslint-scope.Scope} The scope information for this node + */ +function getScope(scopeManager, currentNode) { + + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== "Program"; + + for (let node = currentNode; node; node = node.parent) { + const scope = scopeManager.acquire(node, inner); + + if (scope) { + if (scope.type === "function-expression-name") { + return scope.childScopes[0]; + } + return scope; + } + } + + return scopeManager.scopes[0]; +} + +/** + * Marks a variable as used in the current scope + * @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function. + * @param {ASTNode} currentNode The node currently being traversed + * @param {Object} parserOptions The options used to parse this text + * @param {string} name The name of the variable that should be marked as used. + * @returns {boolean} True if the variable was found and marked as used, false if not. + */ +function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) { + const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn; + const specialScope = hasGlobalReturn || parserOptions.sourceType === "module"; + const currentScope = getScope(scopeManager, currentNode); + + // Special Node.js scope means we need to start one level deeper + const initialScope = currentScope.type === "global" && specialScope ? currentScope.childScopes[0] : currentScope; + + for (let scope = initialScope; scope; scope = scope.upper) { + const variable = scope.variables.find(scopeVar => scopeVar.name === name); + + if (variable) { + variable.eslintUsed = true; + return true; + } + } + + return false; +} + +/** + * Runs a rule, and gets its listeners + * @param {Rule} rule A normalized rule with a `create` method + * @param {Context} ruleContext The context that should be passed to the rule + * @returns {Object} A map of selector listeners provided by the rule + */ +function createRuleListeners(rule, ruleContext) { + try { + return rule.create(ruleContext); + } catch (ex) { + ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`; + throw ex; + } +} + +/** + * Gets all the ancestors of a given node + * @param {ASTNode} node The node + * @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node and going inwards to the parent node. + */ +function getAncestors(node) { + const ancestorsStartingAtParent = []; + + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); +} + +// methods that exist on SourceCode object +const DEPRECATED_SOURCECODE_PASSTHROUGHS = { + getSource: "getText", + getSourceLines: "getLines", + getAllComments: "getAllComments", + getNodeByRangeIndex: "getNodeByRangeIndex", + getComments: "getComments", + getCommentsBefore: "getCommentsBefore", + getCommentsAfter: "getCommentsAfter", + getCommentsInside: "getCommentsInside", + getJSDocComment: "getJSDocComment", + getFirstToken: "getFirstToken", + getFirstTokens: "getFirstTokens", + getLastToken: "getLastToken", + getLastTokens: "getLastTokens", + getTokenAfter: "getTokenAfter", + getTokenBefore: "getTokenBefore", + getTokenByRangeStart: "getTokenByRangeStart", + getTokens: "getTokens", + getTokensAfter: "getTokensAfter", + getTokensBefore: "getTokensBefore", + getTokensBetween: "getTokensBetween" +}; + +const BASE_TRAVERSAL_CONTEXT = Object.freeze( + Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce( + (contextInfo, methodName) => + Object.assign(contextInfo, { + [methodName](...args) { + return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args); + } + }), + {} + ) +); + +/** + * Runs the given rules on the given SourceCode object + * @param {SourceCode} sourceCode A SourceCode object for the given text + * @param {Object} configuredRules The rules configuration + * @param {function(string): Rule} ruleMapper A mapper function from rule names to rules + * @param {Object} parserOptions The options that were passed to the parser + * @param {string} parserName The name of the parser in the config + * @param {Object} settings The settings that were enabled in the config + * @param {string} filename The reported filename of the code + * @param {boolean} disableFixes If true, it doesn't make `fix` properties. + * @param {string | undefined} cwd cwd of the cli + * @returns {Problem[]} An array of reported problems + */ +function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd) { + const emitter = createEmitter(); + const nodeQueue = []; + let currentNode = sourceCode.ast; + + Traverser.traverse(sourceCode.ast, { + enter(node, parent) { + node.parent = parent; + nodeQueue.push({ isEntering: true, node }); + }, + leave(node) { + nodeQueue.push({ isEntering: false, node }); + }, + visitorKeys: sourceCode.visitorKeys + }); + + /* + * Create a frozen object with the ruleContext properties and methods that are shared by all rules. + * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the + * properties once for each rule. + */ + const sharedTraversalContext = Object.freeze( + Object.assign( + Object.create(BASE_TRAVERSAL_CONTEXT), + { + getAncestors: () => getAncestors(currentNode), + getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), + getCwd: () => cwd, + getFilename: () => filename, + getScope: () => getScope(sourceCode.scopeManager, currentNode), + getSourceCode: () => sourceCode, + markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name), + parserOptions, + parserPath: parserName, + parserServices: sourceCode.parserServices, + settings + } + ) + ); + + + const lintingProblems = []; + + Object.keys(configuredRules).forEach(ruleId => { + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + + // not load disabled rules + if (severity === 0) { + return; + } + + const rule = ruleMapper(ruleId); + + if (rule === null) { + lintingProblems.push(createLintingProblem({ ruleId })); + return; + } + + const messageIds = rule.meta && rule.meta.messages; + let reportTranslator = null; + const ruleContext = Object.freeze( + Object.assign( + Object.create(sharedTraversalContext), + { + id: ruleId, + options: getRuleOptions(configuredRules[ruleId]), + report(...args) { + + /* + * Create a report translator lazily. + * In a vast majority of cases, any given rule reports zero errors on a given + * piece of code. Creating a translator lazily avoids the performance cost of + * creating a new translator function for each rule that usually doesn't get + * called. + * + * Using lazy report translators improves end-to-end performance by about 3% + * with Node 8.4.0. + */ + if (reportTranslator === null) { + reportTranslator = createReportTranslator({ + ruleId, + severity, + sourceCode, + messageIds, + disableFixes + }); + } + const problem = reportTranslator(...args); + + if (problem.fix && rule.meta && !rule.meta.fixable) { + throw new Error("Fixable rules should export a `meta.fixable` property."); + } + lintingProblems.push(problem); + } + } + ) + ); + + const ruleListeners = createRuleListeners(rule, ruleContext); + + // add all the selectors from the rule as listeners + Object.keys(ruleListeners).forEach(selector => { + emitter.on( + selector, + timing.enabled + ? timing.time(ruleId, ruleListeners[selector]) + : ruleListeners[selector] + ); + }); + }); + + // only run code path analyzer if the top level node is "Program", skip otherwise + const eventGenerator = nodeQueue[0].node.type === "Program" ? new CodePathAnalyzer(new NodeEventGenerator(emitter)) : new NodeEventGenerator(emitter); + + nodeQueue.forEach(traversalInfo => { + currentNode = traversalInfo.node; + + try { + if (traversalInfo.isEntering) { + eventGenerator.enterNode(currentNode); + } else { + eventGenerator.leaveNode(currentNode); + } + } catch (err) { + err.currentNode = currentNode; + throw err; + } + }); + + return lintingProblems; +} + +/** + * Ensure the source code to be a string. + * @param {string|SourceCode} textOrSourceCode The text or source code object. + * @returns {string} The source code text. + */ +function ensureText(textOrSourceCode) { + if (typeof textOrSourceCode === "object") { + const { hasBOM, text } = textOrSourceCode; + const bom = hasBOM ? "\uFEFF" : ""; + + return bom + text; + } + + return String(textOrSourceCode); +} + +/** + * Get an environment. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} envId The environment ID to get. + * @returns {Environment|null} The environment. + */ +function getEnv(slots, envId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginEnvironments.get(envId)) || + BuiltInEnvironments.get(envId) || + null + ); +} + +/** + * Get a rule. + * @param {LinterInternalSlots} slots The internal slots of Linter. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|null} The rule. + */ +function getRule(slots, ruleId) { + return ( + (slots.lastConfigArray && slots.lastConfigArray.pluginRules.get(ruleId)) || + slots.ruleMap.get(ruleId) + ); +} + +/** + * Normalize the value of the cwd + * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined. + * @returns {string | undefined} normalized cwd + */ +function normalizeCwd(cwd) { + if (cwd) { + return cwd; + } + if (typeof process === "object") { + return process.cwd(); + } + + // It's more explicit to assign the undefined + // eslint-disable-next-line no-undefined + return undefined; +} + +/** + * The map to store private data. + * @type {WeakMap} + */ +const internalSlotsMap = new WeakMap(); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object that is responsible for verifying JavaScript text + * @name eslint + */ +class Linter { + + /** + * Initialize the Linter. + * @param {Object} [config] the config object + * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined. + */ + constructor({ cwd } = {}) { + internalSlotsMap.set(this, { + cwd: normalizeCwd(cwd), + lastConfigArray: null, + lastSourceCode: null, + parserMap: new Map([["espree", espree]]), + ruleMap: new Rules() + }); + + this.version = pkg.version; + } + + /** + * Getter for package version. + * @static + * @returns {string} The version from package.json. + */ + static get version() { + return pkg.version; + } + + /** + * Same as linter.verify, except without support for processors. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData} providedConfig An ESLintConfig instance to configure everything. + * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + _verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { + const slots = internalSlotsMap.get(this); + const config = providedConfig || {}; + const options = normalizeVerifyOptions(providedOptions, config); + let text; + + // evaluate arguments + if (typeof textOrSourceCode === "string") { + slots.lastSourceCode = null; + text = textOrSourceCode; + } else { + slots.lastSourceCode = textOrSourceCode; + text = textOrSourceCode.text; + } + + // Resolve parser. + let parserName = DEFAULT_PARSER_NAME; + let parser = espree; + + if (typeof config.parser === "object" && config.parser !== null) { + parserName = config.parser.filePath; + parser = config.parser.definition; + } else if (typeof config.parser === "string") { + if (!slots.parserMap.has(config.parser)) { + return [{ + ruleId: null, + fatal: true, + severity: 2, + message: `Configured parser '${config.parser}' was not found.`, + line: 0, + column: 0 + }]; + } + parserName = config.parser; + parser = slots.parserMap.get(config.parser); + } + + // search and apply "eslint-env *". + const envInFile = options.allowInlineConfig && !options.warnInlineConfig + ? findEslintEnv(text) + : {}; + const resolvedEnvConfig = Object.assign({ builtin: true }, config.env, envInFile); + const enabledEnvs = Object.keys(resolvedEnvConfig) + .filter(envName => resolvedEnvConfig[envName]) + .map(envName => getEnv(slots, envName)) + .filter(env => env); + + const parserOptions = resolveParserOptions(parserName, config.parserOptions || {}, enabledEnvs); + const configuredGlobals = resolveGlobals(config.globals || {}, enabledEnvs); + const settings = config.settings || {}; + + if (!slots.lastSourceCode) { + const parseResult = parse( + text, + parser, + parserOptions, + options.filename + ); + + if (!parseResult.success) { + return [parseResult.error]; + } + + slots.lastSourceCode = parseResult.sourceCode; + } else { + + /* + * If the given source code object as the first argument does not have scopeManager, analyze the scope. + * This is for backward compatibility (SourceCode is frozen so it cannot rebind). + */ + if (!slots.lastSourceCode.scopeManager) { + slots.lastSourceCode = new SourceCode({ + text: slots.lastSourceCode.text, + ast: slots.lastSourceCode.ast, + parserServices: slots.lastSourceCode.parserServices, + visitorKeys: slots.lastSourceCode.visitorKeys, + scopeManager: analyzeScope(slots.lastSourceCode.ast, parserOptions) + }); + } + } + + const sourceCode = slots.lastSourceCode; + const commentDirectives = options.allowInlineConfig + ? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) + : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; + + // augment global scope with declared global variables + addDeclaredGlobals( + sourceCode.scopeManager.scopes[0], + configuredGlobals, + { exportedVariables: commentDirectives.exportedVariables, enabledGlobals: commentDirectives.enabledGlobals } + ); + + const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); + + let lintingProblems; + + try { + lintingProblems = runRules( + sourceCode, + configuredRules, + ruleId => getRule(slots, ruleId), + parserOptions, + parserName, + settings, + options.filename, + options.disableFixes, + slots.cwd + ); + } catch (err) { + err.message += `\nOccurred while linting ${options.filename}`; + debug("An error occurred while traversing"); + debug("Filename:", options.filename); + if (err.currentNode) { + const { line } = err.currentNode.loc.start; + + debug("Line:", line); + err.message += `:${line}`; + } + debug("Parser Options:", parserOptions); + debug("Parser Path:", parserName); + debug("Settings:", settings); + throw err; + } + + return applyDisableDirectives({ + directives: commentDirectives.disableDirectives, + problems: lintingProblems + .concat(commentDirectives.problems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); + } + + /** + * Verifies the text against the rules specified by the second argument. + * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. + * @param {ConfigData|ConfigArray} config An ESLintConfig instance to configure everything. + * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked. + * If this is not set, the filename will default to '' in the rule context. If + * an object, then it has "filename", "allowInlineConfig", and some properties. + * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages. + */ + verify(textOrSourceCode, config, filenameOrOptions) { + debug("Verify"); + const options = typeof filenameOrOptions === "string" + ? { filename: filenameOrOptions } + : filenameOrOptions || {}; + + // CLIEngine passes a `ConfigArray` object. + if (config && typeof config.extractConfig === "function") { + return this._verifyWithConfigArray(textOrSourceCode, config, options); + } + + /* + * `Linter` doesn't support `overrides` property in configuration. + * So we cannot apply multiple processors. + */ + if (options.preprocess || options.postprocess) { + return this._verifyWithProcessor(textOrSourceCode, config, options); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify a given code with `ConfigArray`. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigArray} configArray The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithConfigArray(textOrSourceCode, configArray, options) { + debug("With ConfigArray: %s", options.filename); + + // Store the config array in order to get plugin envs and rules later. + internalSlotsMap.get(this).lastConfigArray = configArray; + + // Extract the final config for this file. + const config = configArray.extractConfig(options.filename); + const processor = + config.processor && + configArray.pluginProcessors.get(config.processor); + + // Verify. + if (processor) { + debug("Apply the processor: %o", config.processor); + const { preprocess, postprocess, supportsAutofix } = processor; + const disableFixes = options.disableFixes || !supportsAutofix; + + return this._verifyWithProcessor( + textOrSourceCode, + config, + { ...options, disableFixes, postprocess, preprocess }, + configArray + ); + } + return this._verifyWithoutProcessors(textOrSourceCode, config, options); + } + + /** + * Verify with a processor. + * @param {string|SourceCode} textOrSourceCode The source code. + * @param {ConfigData|ExtractedConfig} config The config array. + * @param {VerifyOptions&ProcessorOptions} options The options. + * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. + * @returns {LintMessage[]} The found problems. + */ + _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { + const filename = options.filename || ""; + const filenameToExpose = normalizeFilename(filename); + const text = ensureText(textOrSourceCode); + const preprocess = options.preprocess || (rawText => [rawText]); + const postprocess = options.postprocess || lodash.flatten; + const filterCodeBlock = + options.filterCodeBlock || + (blockFilename => blockFilename.endsWith(".js")); + const originalExtname = path.extname(filename); + const messageLists = preprocess(text, filenameToExpose).map((block, i) => { + debug("A code block was found: %o", block.filename || "(unnamed)"); + + // Keep the legacy behavior. + if (typeof block === "string") { + return this._verifyWithoutProcessors(block, config, options); + } + + const blockText = block.text; + const blockName = path.join(filename, `${i}_${block.filename}`); + + // Skip this block if filtered. + if (!filterCodeBlock(blockName, blockText)) { + debug("This code block was skipped."); + return []; + } + + // Resolve configuration again if the file extension was changed. + if (configForRecursive && path.extname(blockName) !== originalExtname) { + debug("Resolving configuration again because the file extension was changed."); + return this._verifyWithConfigArray( + blockText, + configForRecursive, + { ...options, filename: blockName } + ); + } + + // Does lint. + return this._verifyWithoutProcessors( + blockText, + config, + { ...options, filename: blockName } + ); + }); + + return postprocess(messageLists, filenameToExpose); + } + + /** + * Gets the SourceCode object representing the parsed source. + * @returns {SourceCode} The SourceCode object. + */ + getSourceCode() { + return internalSlotsMap.get(this).lastSourceCode; + } + + /** + * Defines a new linting rule. + * @param {string} ruleId A unique rule identifier + * @param {Function | Rule} ruleModule Function from context to object mapping AST node types to event handlers + * @returns {void} + */ + defineRule(ruleId, ruleModule) { + internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule); + } + + /** + * Defines many new linting rules. + * @param {Record} rulesToDefine map from unique rule identifier to rule + * @returns {void} + */ + defineRules(rulesToDefine) { + Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { + this.defineRule(ruleId, rulesToDefine[ruleId]); + }); + } + + /** + * Gets an object with all loaded rules. + * @returns {Map} All loaded rules + */ + getRules() { + const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); + + return new Map(function *() { + yield* ruleMap; + + if (lastConfigArray) { + yield* lastConfigArray.pluginRules; + } + }()); + } + + /** + * Define a new parser module + * @param {string} parserId Name of the parser + * @param {Parser} parserModule The parser object + * @returns {void} + */ + defineParser(parserId, parserModule) { + internalSlotsMap.get(this).parserMap.set(parserId, parserModule); + } + + /** + * Performs multiple autofix passes over the text until as many fixes as possible + * have been applied. + * @param {string} text The source text to apply fixes to. + * @param {ConfigData|ConfigArray} config The ESLint config object to use. + * @param {VerifyOptions&ProcessorOptions&FixOptions} options The ESLint options object to use. + * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the + * SourceCodeFixer. + */ + verifyAndFix(text, config, options) { + let messages = [], + fixedResult, + fixed = false, + passNumber = 0, + currentText = text; + const debugTextDescription = options && options.filename || `${text.slice(0, 10)}...`; + const shouldFix = options && typeof options.fix !== "undefined" ? options.fix : true; + + /** + * This loop continues until one of the following is true: + * + * 1. No more fixes have been applied. + * 2. Ten passes have been made. + * + * That means anytime a fix is successfully applied, there will be another pass. + * Essentially, guaranteeing a minimum of two passes. + */ + do { + passNumber++; + + debug(`Linting code for ${debugTextDescription} (pass ${passNumber})`); + messages = this.verify(currentText, config, options); + + debug(`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`); + fixedResult = SourceCodeFixer.applyFixes(currentText, messages, shouldFix); + + /* + * stop if there are any syntax errors. + * 'fixedResult.output' is a empty string. + */ + if (messages.length === 1 && messages[0].fatal) { + break; + } + + // keep track if any fixes were ever applied - important for return value + fixed = fixed || fixedResult.fixed; + + // update to use the fixed output instead of the original text + currentText = fixedResult.output; + + } while ( + fixedResult.fixed && + passNumber < MAX_AUTOFIX_PASSES + ); + + /* + * If the last result had fixes, we need to lint again to be sure we have + * the most up-to-date information. + */ + if (fixedResult.fixed) { + fixedResult.messages = this.verify(currentText, config, options); + } + + // ensure the last result properly reflects if fixes were done + fixedResult.fixed = fixed; + fixedResult.output = currentText; + + return fixedResult; + } +} + +module.exports = { + Linter, + + /** + * Get the internal slots of a given Linter instance for tests. + * @param {Linter} instance The Linter instance to get. + * @returns {LinterInternalSlots} The internal slots. + */ + getLinterInternalSlots(instance) { + return internalSlotsMap.get(instance); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/node-event-generator.js b/day1/cli-study/node_modules/eslint/lib/linter/node-event-generator.js new file mode 100644 index 0000000..6f3b251 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/node-event-generator.js @@ -0,0 +1,311 @@ +/** + * @fileoverview The event generator for AST nodes. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esquery = require("esquery"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An object describing an AST selector + * @typedef {Object} ASTSelector + * @property {string} rawSelector The string that was parsed into this selector + * @property {boolean} isExit `true` if this should be emitted when exiting the node rather than when entering + * @property {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @property {string[]|null} listenerTypes A list of node types that could possibly cause the selector to match, + * or `null` if all node types could cause a match + * @property {number} attributeCount The total number of classes, pseudo-classes, and attribute queries in this selector + * @property {number} identifierCount The total number of identifier queries in this selector + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the possible types of a selector + * @param {Object} parsedSelector An object (from esquery) describing the matching behavior of the selector + * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it + */ +function getPossibleTypes(parsedSelector) { + switch (parsedSelector.type) { + case "identifier": + return [parsedSelector.value]; + + case "matches": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes); + + if (typesForComponents.every(Boolean)) { + return lodash.union(...typesForComponents); + } + return null; + } + + case "compound": { + const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(typesForComponent => typesForComponent); + + // If all of the components could match any type, then the compound could also match any type. + if (!typesForComponents.length) { + return null; + } + + /* + * If at least one of the components could only match a particular type, the compound could only match + * the intersection of those types. + */ + return lodash.intersection(...typesForComponents); + } + + case "child": + case "descendant": + case "sibling": + case "adjacent": + return getPossibleTypes(parsedSelector.right); + + default: + return null; + + } +} + +/** + * Counts the number of class, pseudo-class, and attribute queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of class, pseudo-class, and attribute queries in this selector + */ +function countClassAttributes(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0); + + case "attribute": + case "field": + case "nth-child": + case "nth-last-child": + return 1; + + default: + return 0; + } +} + +/** + * Counts the number of identifier queries in this selector + * @param {Object} parsedSelector An object (from esquery) describing the selector's matching behavior + * @returns {number} The number of identifier queries + */ +function countIdentifiers(parsedSelector) { + switch (parsedSelector.type) { + case "child": + case "descendant": + case "sibling": + case "adjacent": + return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right); + + case "compound": + case "not": + case "matches": + return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0); + + case "identifier": + return 1; + + default: + return 0; + } +} + +/** + * Compares the specificity of two selector objects, with CSS-like rules. + * @param {ASTSelector} selectorA An AST selector descriptor + * @param {ASTSelector} selectorB Another AST selector descriptor + * @returns {number} + * a value less than 0 if selectorA is less specific than selectorB + * a value greater than 0 if selectorA is more specific than selectorB + * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically + * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically + */ +function compareSpecificity(selectorA, selectorB) { + return selectorA.attributeCount - selectorB.attributeCount || + selectorA.identifierCount - selectorB.identifierCount || + (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1); +} + +/** + * Parses a raw selector string, and throws a useful error if parsing fails. + * @param {string} rawSelector A raw AST selector + * @returns {Object} An object (from esquery) describing the matching behavior of this selector + * @throws {Error} An error if the selector is invalid + */ +function tryParseSelector(rawSelector) { + try { + return esquery.parse(rawSelector.replace(/:exit$/u, "")); + } catch (err) { + if (err.location && err.location.start && typeof err.location.start.offset === "number") { + throw new SyntaxError(`Syntax error in selector "${rawSelector}" at position ${err.location.start.offset}: ${err.message}`); + } + throw err; + } +} + +/** + * Parses a raw selector string, and returns the parsed selector along with specificity and type information. + * @param {string} rawSelector A raw AST selector + * @returns {ASTSelector} A selector descriptor + */ +const parseSelector = lodash.memoize(rawSelector => { + const parsedSelector = tryParseSelector(rawSelector); + + return { + rawSelector, + isExit: rawSelector.endsWith(":exit"), + parsedSelector, + listenerTypes: getPossibleTypes(parsedSelector), + attributeCount: countClassAttributes(parsedSelector), + identifierCount: countIdentifiers(parsedSelector) + }; +}); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for AST nodes. + * This implements below interface. + * + * ```ts + * interface EventGenerator { + * emitter: SafeEmitter; + * enterNode(node: ASTNode): void; + * leaveNode(node: ASTNode): void; + * } + * ``` + */ +class NodeEventGenerator { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SafeEmitter} emitter + * An SafeEmitter which is the destination of events. This emitter must already + * have registered listeners for all of the events that it needs to listen for. + * (See lib/linter/safe-emitter.js for more details on `SafeEmitter`.) + * @returns {NodeEventGenerator} new instance + */ + constructor(emitter) { + this.emitter = emitter; + this.currentAncestry = []; + this.enterSelectorsByNodeType = new Map(); + this.exitSelectorsByNodeType = new Map(); + this.anyTypeEnterSelectors = []; + this.anyTypeExitSelectors = []; + + emitter.eventNames().forEach(rawSelector => { + const selector = parseSelector(rawSelector); + + if (selector.listenerTypes) { + const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType; + + selector.listenerTypes.forEach(nodeType => { + if (!typeMap.has(nodeType)) { + typeMap.set(nodeType, []); + } + typeMap.get(nodeType).push(selector); + }); + return; + } + const selectors = selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + selectors.push(selector); + }); + + this.anyTypeEnterSelectors.sort(compareSpecificity); + this.anyTypeExitSelectors.sort(compareSpecificity); + this.enterSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + this.exitSelectorsByNodeType.forEach(selectorList => selectorList.sort(compareSpecificity)); + } + + /** + * Checks a selector against a node, and emits it if it matches + * @param {ASTNode} node The node to check + * @param {ASTSelector} selector An AST selector descriptor + * @returns {void} + */ + applySelector(node, selector) { + if (esquery.matches(node, selector.parsedSelector, this.currentAncestry)) { + this.emitter.emit(selector.rawSelector, node); + } + } + + /** + * Applies all appropriate selectors to a node, in specificity order + * @param {ASTNode} node The node to check + * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited + * @returns {void} + */ + applySelectors(node, isExit) { + const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || []; + const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors; + + /* + * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor. + * Iterate through each of them, applying selectors in the right order. + */ + let selectorsByTypeIndex = 0; + let anyTypeSelectorsIndex = 0; + + while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) { + if ( + selectorsByTypeIndex >= selectorsByNodeType.length || + anyTypeSelectorsIndex < anyTypeSelectors.length && + compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0 + ) { + this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]); + } else { + this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]); + } + } + } + + /** + * Emits an event of entering AST node. + * @param {ASTNode} node A node which was entered. + * @returns {void} + */ + enterNode(node) { + if (node.parent) { + this.currentAncestry.unshift(node.parent); + } + this.applySelectors(node, false); + } + + /** + * Emits an event of leaving AST node. + * @param {ASTNode} node A node which was left. + * @returns {void} + */ + leaveNode(node) { + this.applySelectors(node, true); + this.currentAncestry.shift(); + } +} + +module.exports = NodeEventGenerator; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/report-translator.js b/day1/cli-study/node_modules/eslint/lib/linter/report-translator.js new file mode 100644 index 0000000..eef5165 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/report-translator.js @@ -0,0 +1,347 @@ +/** + * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const ruleFixer = require("./rule-fixer"); +const interpolate = require("./interpolate"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An error message description + * @typedef {Object} MessageDescriptor + * @property {ASTNode} [node] The reported node + * @property {Location} loc The location of the problem. + * @property {string} message The problem message. + * @property {Object} [data] Optional data to use to fill in placeholders in the + * message. + * @property {Function} [fix] The function to call that creates a fix command. + * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes. + */ + +/** + * Information about the report + * @typedef {Object} ReportInfo + * @property {string} ruleId + * @property {(0|1|2)} severity + * @property {(string|undefined)} message + * @property {(string|undefined)} [messageId] + * @property {number} line + * @property {number} column + * @property {(number|undefined)} [endLine] + * @property {(number|undefined)} [endColumn] + * @property {(string|null)} nodeType + * @property {string} source + * @property {({text: string, range: (number[]|null)}|null)} [fix] + * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] + */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + + +/** + * Translates a multi-argument context.report() call into a single object argument call + * @param {...*} args A list of arguments passed to `context.report` + * @returns {MessageDescriptor} A normalized object containing report information + */ +function normalizeMultiArgReportCall(...args) { + + // If there is one argument, it is considered to be a new-style call already. + if (args.length === 1) { + + // Shallow clone the object to avoid surprises if reusing the descriptor + return Object.assign({}, args[0]); + } + + // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. + if (typeof args[1] === "string") { + return { + node: args[0], + message: args[1], + data: args[2], + fix: args[3] + }; + } + + // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. + return { + node: args[0], + loc: args[1], + message: args[2], + data: args[3], + fix: args[4] + }; +} + +/** + * Asserts that either a loc or a node was provided, and the node is valid if it was provided. + * @param {MessageDescriptor} descriptor A descriptor to validate + * @returns {void} + * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object + */ +function assertValidNodeInfo(descriptor) { + if (descriptor.node) { + assert(typeof descriptor.node === "object", "Node must be an object"); + } else { + assert(descriptor.loc, "Node must be provided when reporting error if location is not provided"); + } +} + +/** + * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties + * @param {MessageDescriptor} descriptor A descriptor for the report from a rule. + * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties + * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor. + */ +function normalizeReportLoc(descriptor) { + if (descriptor.loc) { + if (descriptor.loc.start) { + return descriptor.loc; + } + return { start: descriptor.loc, end: null }; + } + return descriptor.node.loc; +} + +/** + * Compares items in a fixes array by range. + * @param {Fix} a The first message. + * @param {Fix} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareFixesByRange(a, b) { + return a.range[0] - b.range[0] || a.range[1] - b.range[1]; +} + +/** + * Merges the given fixes array into one. + * @param {Fix[]} fixes The fixes to merge. + * @param {SourceCode} sourceCode The source code object to get the text between fixes. + * @returns {{text: string, range: number[]}} The merged fixes + */ +function mergeFixes(fixes, sourceCode) { + if (fixes.length === 0) { + return null; + } + if (fixes.length === 1) { + return fixes[0]; + } + + fixes.sort(compareFixesByRange); + + const originalText = sourceCode.text; + const start = fixes[0].range[0]; + const end = fixes[fixes.length - 1].range[1]; + let text = ""; + let lastPos = Number.MIN_SAFE_INTEGER; + + for (const fix of fixes) { + assert(fix.range[0] >= lastPos, "Fix objects must not be overlapped in a report."); + + if (fix.range[0] >= 0) { + text += originalText.slice(Math.max(0, start, lastPos), fix.range[0]); + } + text += fix.text; + lastPos = fix.range[1]; + } + text += originalText.slice(Math.max(0, start, lastPos), end); + + return { range: [start, end], text }; +} + +/** + * Gets one fix object from the given descriptor. + * If the descriptor retrieves multiple fixes, this merges those to one. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @returns {({text: string, range: number[]}|null)} The fix for the descriptor + */ +function normalizeFixes(descriptor, sourceCode) { + if (typeof descriptor.fix !== "function") { + return null; + } + + // @type {null | Fix | Fix[] | IterableIterator} + const fix = descriptor.fix(ruleFixer); + + // Merge to one. + if (fix && Symbol.iterator in fix) { + return mergeFixes(Array.from(fix), sourceCode); + } + return fix; +} + +/** + * Gets an array of suggestion objects from the given descriptor. + * @param {MessageDescriptor} descriptor The report descriptor. + * @param {SourceCode} sourceCode The source code object to get text between fixes. + * @param {Object} messages Object of meta messages for the rule. + * @returns {Array} The suggestions for the descriptor + */ +function mapSuggestions(descriptor, sourceCode, messages) { + if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) { + return []; + } + + return descriptor.suggest.map(suggestInfo => { + const computedDesc = suggestInfo.desc || messages[suggestInfo.messageId]; + + return { + ...suggestInfo, + desc: interpolate(computedDesc, suggestInfo.data), + fix: normalizeFixes(suggestInfo, sourceCode) + }; + }); +} + +/** + * Creates information about the report from a descriptor + * @param {Object} options Information about the problem + * @param {string} options.ruleId Rule ID + * @param {(0|1|2)} options.severity Rule severity + * @param {(ASTNode|null)} options.node Node + * @param {string} options.message Error message + * @param {string} [options.messageId] The error message ID. + * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location + * @param {{text: string, range: (number[]|null)}} options.fix The fix object + * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ +function createProblem(options) { + const problem = { + ruleId: options.ruleId, + severity: options.severity, + message: options.message, + line: options.loc.start.line, + column: options.loc.start.column + 1, + nodeType: options.node && options.node.type || null + }; + + /* + * If this isn’t in the conditional, some of the tests fail + * because `messageId` is present in the problem object + */ + if (options.messageId) { + problem.messageId = options.messageId; + } + + if (options.loc.end) { + problem.endLine = options.loc.end.line; + problem.endColumn = options.loc.end.column + 1; + } + + if (options.fix) { + problem.fix = options.fix; + } + + if (options.suggestions && options.suggestions.length > 0) { + problem.suggestions = options.suggestions; + } + + return problem; +} + +/** + * Validates that suggestions are properly defined. Throws if an error is detected. + * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data. + * @param {Object} messages Object of meta messages for the rule. + * @returns {void} + */ +function validateSuggestions(suggest, messages) { + if (suggest && Array.isArray(suggest)) { + suggest.forEach(suggestion => { + if (suggestion.messageId) { + const { messageId } = suggestion; + + if (!messages) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`); + } + + if (!messages[messageId]) { + throw new TypeError(`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + + if (suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one."); + } + } else if (!suggestion.desc) { + throw new TypeError("context.report() called with a suggest option that doesn't have either a `desc` or `messageId`"); + } + + if (typeof suggestion.fix !== "function") { + throw new TypeError(`context.report() called with a suggest option without a fix function. See: ${suggestion}`); + } + }); + } +} + +/** + * Returns a function that converts the arguments of a `context.report` call from a rule into a reported + * problem for the Node.js API. + * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean}} metadata Metadata for the reported problem + * @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted + * @returns {function(...args): ReportInfo} Function that returns information about the report + */ + +module.exports = function createReportTranslator(metadata) { + + /* + * `createReportTranslator` gets called once per enabled rule per file. It needs to be very performant. + * The report translator itself (i.e. the function that `createReportTranslator` returns) gets + * called every time a rule reports a problem, which happens much less frequently (usually, the vast + * majority of rules don't report any problems for a given file). + */ + return (...args) => { + const descriptor = normalizeMultiArgReportCall(...args); + const messages = metadata.messageIds; + + assertValidNodeInfo(descriptor); + + let computedMessage; + + if (descriptor.messageId) { + if (!messages) { + throw new TypeError("context.report() called with a messageId, but no messages were present in the rule metadata."); + } + const id = descriptor.messageId; + + if (descriptor.message) { + throw new TypeError("context.report() called with a message and a messageId. Please only pass one."); + } + if (!messages || !Object.prototype.hasOwnProperty.call(messages, id)) { + throw new TypeError(`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`); + } + computedMessage = messages[id]; + } else if (descriptor.message) { + computedMessage = descriptor.message; + } else { + throw new TypeError("Missing `message` property in report() call; add a message that describes the linting problem."); + } + + validateSuggestions(descriptor.suggest, messages); + + return createProblem({ + ruleId: metadata.ruleId, + severity: metadata.severity, + node: descriptor.node, + message: interpolate(computedMessage, descriptor.data), + messageId: descriptor.messageId, + loc: normalizeReportLoc(descriptor), + fix: metadata.disableFixes ? null : normalizeFixes(descriptor, metadata.sourceCode), + suggestions: metadata.disableFixes ? [] : mapSuggestions(descriptor, metadata.sourceCode, messages) + }); + }; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/rule-fixer.js b/day1/cli-study/node_modules/eslint/lib/linter/rule-fixer.js new file mode 100644 index 0000000..bdd80d1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/rule-fixer.js @@ -0,0 +1,140 @@ +/** + * @fileoverview An object that creates fix commands for rules. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates a fix command that inserts text at the specified index in the source text. + * @param {int} index The 0-based index at which to insert the new text. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + * @private + */ +function insertTextAt(index, text) { + return { + range: [index, index], + text + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates code fixing commands for rules. + */ + +const ruleFixer = Object.freeze({ + + /** + * Creates a fix command that inserts text after the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert after. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfter(nodeOrToken, text) { + return this.insertTextAfterRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text after the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfterRange(range, text) { + return insertTextAt(range[1], text); + }, + + /** + * Creates a fix command that inserts text before the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert before. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBefore(nodeOrToken, text) { + return this.insertTextBeforeRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text before the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBeforeRange(range, text) { + return insertTextAt(range[0], text); + }, + + /** + * Creates a fix command that replaces text at the node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceText(nodeOrToken, text) { + return this.replaceTextRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that replaces text at the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + return { + range, + text + }; + }, + + /** + * Creates a fix command that removes the node or token from the source. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.removeRange(nodeOrToken.range); + }, + + /** + * Creates a fix command that removes the specified range of text from the source. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to remove, first item is start of range, second + * is end of range. + * @returns {Object} The fix command. + */ + removeRange(range) { + return { + range, + text: "" + }; + } + +}); + + +module.exports = ruleFixer; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/rules.js b/day1/cli-study/node_modules/eslint/lib/linter/rules.js new file mode 100644 index 0000000..a153266 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/rules.js @@ -0,0 +1,77 @@ +/** + * @fileoverview Defines a storage for rules. + * @author Nicholas C. Zakas + * @author aladdin-add + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const builtInRules = require("../rules"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Normalizes a rule module to the new-style API + * @param {(Function|{create: Function})} rule A rule object, which can either be a function + * ("old-style") or an object with a `create` method ("new-style") + * @returns {{create: Function}} A new-style rule. + */ +function normalizeRule(rule) { + return typeof rule === "function" ? Object.assign({ create: rule }, rule) : rule; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class Rules { + constructor() { + this._rules = Object.create(null); + } + + /** + * Registers a rule module for rule id in storage. + * @param {string} ruleId Rule id (file name). + * @param {Function} ruleModule Rule handler. + * @returns {void} + */ + define(ruleId, ruleModule) { + this._rules[ruleId] = normalizeRule(ruleModule); + } + + /** + * Access rule handler by id (file name). + * @param {string} ruleId Rule id (file name). + * @returns {{create: Function, schema: JsonSchema[]}} + * A rule. This is normalized to always have the new-style shape with a `create` method. + */ + get(ruleId) { + if (typeof this._rules[ruleId] === "string") { + this.define(ruleId, require(this._rules[ruleId])); + } + if (this._rules[ruleId]) { + return this._rules[ruleId]; + } + if (builtInRules.has(ruleId)) { + return builtInRules.get(ruleId); + } + + return null; + } + + *[Symbol.iterator]() { + yield* builtInRules; + + for (const ruleId of Object.keys(this._rules)) { + yield [ruleId, this.get(ruleId)]; + } + } +} + +module.exports = Rules; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/safe-emitter.js b/day1/cli-study/node_modules/eslint/lib/linter/safe-emitter.js new file mode 100644 index 0000000..ab21223 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/safe-emitter.js @@ -0,0 +1,52 @@ +/** + * @fileoverview A variant of EventEmitter which does not give listeners information about each other + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An event emitter + * @typedef {Object} SafeEmitter + * @property {function(eventName: string, listenerFunc: Function): void} on Adds a listener for a given event name + * @property {function(eventName: string, arg1?: any, arg2?: any, arg3?: any)} emit Emits an event with a given name. + * This calls all the listeners that were listening for that name, with `arg1`, `arg2`, and `arg3` as arguments. + * @property {function(): string[]} eventNames Gets the list of event names that have registered listeners. + */ + +/** + * Creates an object which can listen for and emit events. + * This is similar to the EventEmitter API in Node's standard library, but it has a few differences. + * The goal is to allow multiple modules to attach arbitrary listeners to the same emitter, without + * letting the modules know about each other at all. + * 1. It has no special keys like `error` and `newListener`, which would allow modules to detect when + * another module throws an error or registers a listener. + * 2. It calls listener functions without any `this` value. (`EventEmitter` calls listeners with a + * `this` value of the emitter instance, which would give listeners access to other listeners.) + * @returns {SafeEmitter} An emitter + */ +module.exports = () => { + const listeners = Object.create(null); + + return Object.freeze({ + on(eventName, listener) { + if (eventName in listeners) { + listeners[eventName].push(listener); + } else { + listeners[eventName] = [listener]; + } + }, + emit(eventName, ...args) { + if (eventName in listeners) { + listeners[eventName].forEach(listener => listener(...args)); + } + }, + eventNames() { + return Object.keys(listeners); + } + }); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/source-code-fixer.js b/day1/cli-study/node_modules/eslint/lib/linter/source-code-fixer.js new file mode 100644 index 0000000..53dc1dc --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/source-code-fixer.js @@ -0,0 +1,152 @@ +/** + * @fileoverview An object that caches and applies source code fixes. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const debug = require("debug")("eslint:source-code-fixer"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const BOM = "\uFEFF"; + +/** + * Compares items in a messages array by range. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByFixRange(a, b) { + return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1]; +} + +/** + * Compares items in a messages array by line and column. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByLocation(a, b) { + return a.line - b.line || a.column - b.column; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Utility for apply fixes to source code. + * @constructor + */ +function SourceCodeFixer() { + Object.freeze(this); +} + +/** + * Applies the fixes specified by the messages to the given text. Tries to be + * smart about the fixes and won't apply fixes over the same area in the text. + * @param {string} sourceText The text to apply the changes to. + * @param {Message[]} messages The array of messages reported by ESLint. + * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed + * @returns {Object} An object containing the fixed text and any unfixed messages. + */ +SourceCodeFixer.applyFixes = function(sourceText, messages, shouldFix) { + debug("Applying fixes"); + + if (shouldFix === false) { + debug("shouldFix parameter was false, not attempting fixes"); + return { + fixed: false, + messages, + output: sourceText + }; + } + + // clone the array + const remainingMessages = [], + fixes = [], + bom = sourceText.startsWith(BOM) ? BOM : "", + text = bom ? sourceText.slice(1) : sourceText; + let lastPos = Number.NEGATIVE_INFINITY, + output = bom; + + /** + * Try to use the 'fix' from a problem. + * @param {Message} problem The message object to apply fixes from + * @returns {boolean} Whether fix was successfully applied + */ + function attemptFix(problem) { + const fix = problem.fix; + const start = fix.range[0]; + const end = fix.range[1]; + + // Remain it as a problem if it's overlapped or it's a negative range + if (lastPos >= start || start > end) { + remainingMessages.push(problem); + return false; + } + + // Remove BOM. + if ((start < 0 && end >= 0) || (start === 0 && fix.text.startsWith(BOM))) { + output = ""; + } + + // Make output to this fix. + output += text.slice(Math.max(0, lastPos), Math.max(0, start)); + output += fix.text; + lastPos = end; + return true; + } + + messages.forEach(problem => { + if (Object.prototype.hasOwnProperty.call(problem, "fix")) { + fixes.push(problem); + } else { + remainingMessages.push(problem); + } + }); + + if (fixes.length) { + debug("Found fixes to apply"); + let fixesWereApplied = false; + + for (const problem of fixes.sort(compareMessagesByFixRange)) { + if (typeof shouldFix !== "function" || shouldFix(problem)) { + attemptFix(problem); + + /* + * The only time attemptFix will fail is if a previous fix was + * applied which conflicts with it. So we can mark this as true. + */ + fixesWereApplied = true; + } else { + remainingMessages.push(problem); + } + } + output += text.slice(Math.max(0, lastPos)); + + return { + fixed: fixesWereApplied, + messages: remainingMessages.sort(compareMessagesByLocation), + output + }; + } + + debug("No fixes to apply"); + return { + fixed: false, + messages, + output: bom + text + }; + +}; + +module.exports = SourceCodeFixer; diff --git a/day1/cli-study/node_modules/eslint/lib/linter/timing.js b/day1/cli-study/node_modules/eslint/lib/linter/timing.js new file mode 100644 index 0000000..8396d92 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/linter/timing.js @@ -0,0 +1,139 @@ +/** + * @fileoverview Tracks performance of individual rules. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* istanbul ignore next */ +/** + * Align the string to left + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignLeft(str, len, ch) { + return str + new Array(len - str.length + 1).join(ch || " "); +} + +/* istanbul ignore next */ +/** + * Align the string to right + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ +function alignRight(str, len, ch) { + return new Array(len - str.length + 1).join(ch || " ") + str; +} + +//------------------------------------------------------------------------------ +// Module definition +//------------------------------------------------------------------------------ + +const enabled = !!process.env.TIMING; + +const HEADERS = ["Rule", "Time (ms)", "Relative"]; +const ALIGN = [alignLeft, alignRight, alignRight]; + +/* istanbul ignore next */ +/** + * display the data + * @param {Object} data Data object to be displayed + * @returns {void} prints modified string with console.log + * @private + */ +function display(data) { + let total = 0; + const rows = Object.keys(data) + .map(key => { + const time = data[key]; + + total += time; + return [key, time]; + }) + .sort((a, b) => b[1] - a[1]) + .slice(0, 10); + + rows.forEach(row => { + row.push(`${(row[1] * 100 / total).toFixed(1)}%`); + row[1] = row[1].toFixed(3); + }); + + rows.unshift(HEADERS); + + const widths = []; + + rows.forEach(row => { + const len = row.length; + + for (let i = 0; i < len; i++) { + const n = row[i].length; + + if (!widths[i] || n > widths[i]) { + widths[i] = n; + } + } + }); + + const table = rows.map(row => ( + row + .map((cell, index) => ALIGN[index](cell, widths[index])) + .join(" | ") + )); + + table.splice(1, 0, widths.map((width, index) => { + const extraAlignment = index !== 0 && index !== widths.length - 1 ? 2 : 1; + + return ALIGN[index](":", width + extraAlignment, "-"); + }).join("|")); + + console.log(table.join("\n")); // eslint-disable-line no-console +} + +/* istanbul ignore next */ +module.exports = (function() { + + const data = Object.create(null); + + /** + * Time the run + * @param {*} key key from the data object + * @param {Function} fn function to be called + * @returns {Function} function to be executed + * @private + */ + function time(key, fn) { + if (typeof data[key] === "undefined") { + data[key] = 0; + } + + return function(...args) { + let t = process.hrtime(); + + fn(...args); + t = process.hrtime(t); + data[key] += t[0] * 1e3 + t[1] / 1e6; + }; + } + + if (enabled) { + process.on("exit", () => { + display(data); + }); + } + + return { + time, + enabled + }; + +}()); diff --git a/day1/cli-study/node_modules/eslint/lib/options.js b/day1/cli-study/node_modules/eslint/lib/options.js new file mode 100644 index 0000000..1681f1d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/options.js @@ -0,0 +1,262 @@ +/** + * @fileoverview Options configuration for optionator. + * @author George Zahariev + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const optionator = require("optionator"); + +//------------------------------------------------------------------------------ +// Initialization and Public Interface +//------------------------------------------------------------------------------ + +// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" +module.exports = optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true + }, + options: [ + { + heading: "Basic configuration" + }, + { + option: "eslintrc", + type: "Boolean", + default: "true", + description: "Disable use of configuration from .eslintrc.*" + }, + { + option: "config", + alias: "c", + type: "path::String", + description: "Use this configuration, overriding .eslintrc.* config options if present" + }, + { + option: "env", + type: "[String]", + description: "Specify environments" + }, + { + option: "ext", + type: "[String]", + description: "Specify JavaScript file extensions" + }, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + { + option: "resolve-plugins-relative-to", + type: "path::String", + description: "A folder where plugins should be resolved from, CWD by default" + }, + { + heading: "Specifying rules and plugins" + }, + { + option: "rulesdir", + type: "[path::String]", + description: "Use additional rules from this directory" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + { + heading: "Fixing problems" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "fix-dry-run", + type: "Boolean", + default: false, + description: "Automatically fix problems without saving the changes to the file system" + }, + { + option: "fix-type", + type: "Array", + description: "Specify the types of fixes to apply (problem, suggestion, layout)" + }, + { + heading: "Ignoring files" + }, + { + option: "ignore-path", + type: "path::String", + description: "Specify path of ignore file" + }, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of ignore files and patterns" + }, + { + option: "ignore-pattern", + type: "[String]", + description: "Pattern of files to ignore (in addition to those in .eslintignore)", + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Using stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handling warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + alias: "no-color", + description: "Force enabling/disabling of color" + }, + { + heading: "Inline configuration comments" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Prevent comments from changing config or rules" + }, + { + option: "report-unused-disable-directives", + type: "Boolean", + default: void 0, + description: "Adds reported errors for unused eslint-disable directives" + }, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "env-info", + type: "Boolean", + default: "false", + description: "Output execution environment information" + }, + { + option: "error-on-unmatched-pattern", + type: "Boolean", + default: "true", + description: "Prevent errors when pattern is unmatched" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "print-config", + type: "path::String", + description: "Print the configuration for the given file" + } + ] +}); diff --git a/day1/cli-study/node_modules/eslint/lib/rule-tester/index.js b/day1/cli-study/node_modules/eslint/lib/rule-tester/index.js new file mode 100644 index 0000000..f52d140 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rule-tester/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + RuleTester: require("./rule-tester") +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rule-tester/rule-tester.js b/day1/cli-study/node_modules/eslint/lib/rule-tester/rule-tester.js new file mode 100644 index 0000000..3e39157 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rule-tester/rule-tester.js @@ -0,0 +1,893 @@ +/** + * @fileoverview Mocha test wrapper + * @author Ilya Volodin + */ +"use strict"; + +/* global describe, it */ + +/* + * This is a wrapper around mocha to allow for DRY unittests for eslint + * Format: + * RuleTester.run("{ruleName}", { + * valid: [ + * "{code}", + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings} } + * ], + * invalid: [ + * { code: "{code}", errors: {numErrors} }, + * { code: "{code}", errors: ["{errorMessage}"] }, + * { code: "{code}", options: {options}, globals: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] } + * ] + * }); + * + * Variables: + * {code} - String that represents the code to be tested + * {options} - Arguments that are passed to the configurable rules. + * {globals} - An object representing a list of variables that are + * registered as globals + * {parser} - String representing the parser to use + * {settings} - An object representing global settings for all rules + * {numErrors} - If failing case doesn't need to check error message, + * this integer will specify how many errors should be + * received + * {errorMessage} - Message that is returned by the rule on failure + * {errorNodeType} - AST node type that is returned by they rule as + * a cause of the failure. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + assert = require("assert"), + path = require("path"), + util = require("util"), + lodash = require("lodash"), + Traverser = require("../../lib/shared/traverser"), + { getRuleOptionsSchema, validate } = require("../shared/config-validator"), + { Linter, SourceCodeFixer, interpolate } = require("../linter"); + +const ajv = require("../shared/ajv")({ strictDefaults: true }); + +const espreePath = require.resolve("espree"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").Parser} Parser */ + +/** + * A test case that is expected to pass lint. + * @typedef {Object} ValidTestCase + * @property {string} code Code for the test case. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A test case that is expected to fail lint. + * @typedef {Object} InvalidTestCase + * @property {string} code Code for the test case. + * @property {number | Array} errors Expected errors. + * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested. + * @property {any[]} [options] Options for the test case. + * @property {{ [name: string]: any }} [settings] Settings for the test case. + * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames. + * @property {string} [parser] The absolute path for the parser. + * @property {{ [name: string]: any }} [parserOptions] Options for the parser. + * @property {{ [name: string]: "readonly" | "writable" | "off" }} [globals] The additional global variables. + * @property {{ [name: string]: boolean }} [env] Environments for the test case. + */ + +/** + * A description of a reported error used in a rule tester test. + * @typedef {Object} TestCaseError + * @property {string | RegExp} [message] Message. + * @property {string} [messageId] Message ID. + * @property {string} [type] The type of the reported AST node. + * @property {{ [name: string]: string }} [data] The data used to fill the message template. + * @property {number} [line] The 1-based line number of the reported start location. + * @property {number} [column] The 1-based column number of the reported start location. + * @property {number} [endLine] The 1-based line number of the reported end location. + * @property {number} [endColumn] The 1-based column number of the reported end location. + */ + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +const testerDefaultConfig = { rules: {} }; +let defaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +const RuleTesterParameters = [ + "code", + "filename", + "options", + "errors", + "output" +]; + +/* + * All allowed property names in error objects. + */ +const errorObjectParameters = new Set([ + "message", + "messageId", + "data", + "type", + "line", + "column", + "endLine", + "endColumn", + "suggestions" +]); +const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +/* + * All allowed property names in suggestion objects. + */ +const suggestionObjectParameters = new Set([ + "desc", + "messageId", + "data", + "output" +]); +const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; + +const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * @param {any} x A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + const retv = {}; + + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * @param {any} x A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (const key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +/** + * Replace control characters by `\u00xx` form. + * @param {string} text The text to sanitize. + * @returns {string} The sanitized text. + */ +function sanitize(text) { + return text.replace( + /[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex + c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}` + ); +} + +/** + * Define `start`/`end` properties as throwing error. + * @param {string} objName Object name used for error messages. + * @param {ASTNode} node The node to define. + * @returns {void} + */ +function defineStartEndAsError(objName, node) { + Object.defineProperties(node, { + start: { + get() { + throw new Error(`Use ${objName}.range[0] instead of ${objName}.start`); + }, + configurable: true, + enumerable: false + }, + end: { + get() { + throw new Error(`Use ${objName}.range[1] instead of ${objName}.end`); + }, + configurable: true, + enumerable: false + } + }); +} + +/** + * Define `start`/`end` properties of all nodes of the given AST as throwing error. + * @param {ASTNode} ast The root node to errorize `start`/`end` properties. + * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast. + * @returns {void} + */ +function defineStartEndAsErrorInTree(ast, visitorKeys) { + Traverser.traverse(ast, { visitorKeys, enter: defineStartEndAsError.bind(null, "node") }); + ast.tokens.forEach(defineStartEndAsError.bind(null, "token")); + ast.comments.forEach(defineStartEndAsError.bind(null, "token")); +} + +/** + * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes. + * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties. + * @param {Parser} parser Parser object. + * @returns {Parser} Wrapped parser object. + */ +function wrapParser(parser) { + if (typeof parser.parseForESLint === "function") { + return { + parseForESLint(...args) { + const ret = parser.parseForESLint(...args); + + defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys); + return ret; + } + }; + } + return { + parse(...args) { + const ast = parser.parse(...args); + + defineStartEndAsErrorInTree(ast); + return ast; + } + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +// default separators for testing +const DESCRIBE = Symbol("describe"); +const IT = Symbol("it"); + +/** + * This is `it` default handler if `it` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function itDefaultHandler(text, method) { + try { + return method.call(this); + } catch (err) { + if (err instanceof assert.AssertionError) { + err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`; + } + throw err; + } +} + +/** + * This is `describe` default handler if `describe` don't exist. + * @this {Mocha} + * @param {string} text The description of the test case. + * @param {Function} method The logic of the test case. + * @returns {any} Returned value of `method`. + */ +function describeDefaultHandler(text, method) { + return method.call(this); +} + +class RuleTester { + + /** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + */ + constructor(testerConfig) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = lodash.merge( + + // we have to clone because merge uses the first argument for recipient + lodash.cloneDeep(defaultConfig), + testerConfig, + { rules: { "rule-tester/validate-ast": "error" } } + ); + + /** + * Rule definitions to define before tests. + * @type {Object} + */ + this.rules = {}; + this.linter = new Linter(); + } + + /** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @returns {void} + */ + static setDefaultConfig(config) { + if (typeof config !== "object") { + throw new TypeError("RuleTester.setDefaultConfig: config must be an object"); + } + defaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + defaultConfig.rules = defaultConfig.rules || {}; + } + + /** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ + static getDefaultConfig() { + return defaultConfig; + } + + /** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ + static resetDefaultConfig() { + defaultConfig = lodash.cloneDeep(testerDefaultConfig); + } + + + /* + * If people use `mocha test.js --watch` command, `describe` and `it` function + * instances are different for each execution. So `describe` and `it` should get fresh instance + * always. + */ + static get describe() { + return ( + this[DESCRIBE] || + (typeof describe === "function" ? describe : describeDefaultHandler) + ); + } + + static set describe(value) { + this[DESCRIBE] = value; + } + + static get it() { + return ( + this[IT] || + (typeof it === "function" ? it : itDefaultHandler) + ); + } + + static set it(value) { + this[IT] = value; + } + + /** + * Define a rule for one particular run of tests. + * @param {string} name The name of the rule to define. + * @param {Function} rule The rule definition. + * @returns {void} + */ + defineRule(name, rule) { + this.rules[name] = rule; + } + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Function} rule The rule to test. + * @param {{ + * valid: (ValidTestCase | string)[], + * invalid: InvalidTestCase[] + * }} test The collection of tests to run. + * @returns {void} + */ + run(ruleName, rule, test) { + + const testerConfig = this.testerConfig, + requiredScenarios = ["valid", "invalid"], + scenarioErrors = [], + linter = this.linter; + + if (lodash.isNil(test) || typeof test !== "object") { + throw new TypeError(`Test Scenarios for rule ${ruleName} : Could not find test scenario object`); + } + + requiredScenarios.forEach(scenarioType => { + if (lodash.isNil(test[scenarioType])) { + scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); + } + }); + + if (scenarioErrors.length > 0) { + throw new Error([ + `Test Scenarios for rule ${ruleName} is invalid:` + ].concat(scenarioErrors).join("\n")); + } + + + linter.defineRule(ruleName, Object.assign({}, rule, { + + // Create a wrapper rule that freezes the `context` properties. + create(context) { + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + return (typeof rule === "function" ? rule : rule.create)(context); + } + })); + + linter.defineRules(this.rules); + + /** + * Run the rule for the given item + * @param {string|Object} item Item to run the rule against + * @returns {Object} Eslint run result + * @private + */ + function runRuleForItem(item) { + let config = lodash.cloneDeep(testerConfig), + code, filename, output, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + /* + * Assumes everything on the item is a config except for the + * parameters used by this tester + */ + const itemConfig = lodash.omit(item, RuleTesterParameters); + + /* + * Create the config object from the tester config and this item + * specific configurations. + */ + config = lodash.merge( + config, + itemConfig + ); + } + + if (item.filename) { + filename = item.filename; + } + + if (hasOwnProperty(item, "options")) { + assert(Array.isArray(item.options), "options must be an array"); + config.rules[ruleName] = [1].concat(item.options); + } else { + config.rules[ruleName] = 1; + } + + const schema = getRuleOptionsSchema(rule); + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + linter.defineRule("rule-tester/validate-ast", () => ({ + Program(node) { + beforeAST = cloneDeeplyExcludesParent(node); + }, + "Program:exit"(node) { + afterAST = node; + } + })); + + if (typeof config.parser === "string") { + assert(path.isAbsolute(config.parser), "Parsers provided as strings to RuleTester must be absolute paths"); + } else { + config.parser = espreePath; + } + + linter.defineParser(config.parser, wrapParser(require(config.parser))); + + if (schema) { + ajv.validateSchema(schema); + + if (ajv.errors) { + const errors = ajv.errors.map(error => { + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `\t${field}: ${error.message}`; + }).join("\n"); + + throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]); + } + + /* + * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"), + * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling + * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result, + * the schema is compiled here separately from checking for `validateSchema` errors. + */ + try { + ajv.compile(schema); + } catch (err) { + throw new Error(`Schema for rule ${ruleName} is invalid: ${err.message}`); + } + } + + validate(config, "rule-tester", id => (id === ruleName ? rule : null)); + + // Verify the code. + const messages = linter.verify(code, config, filename); + const fatalErrorMessage = messages.find(m => m.fatal); + + assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); + + // Verify if autofix makes a syntax error or not. + if (messages.some(m => m.fix)) { + output = SourceCodeFixer.applyFixes(code, messages).output; + const errorMessageInFix = linter.verify(output, config, filename).find(m => m.fatal); + + assert(!errorMessageInFix, [ + "A fatal parsing error occurred in autofix.", + `Error: ${errorMessageInFix && errorMessageInFix.message}`, + "Autofix output:", + output + ].join("\n")); + } else { + output = code; + } + + return { + messages, + output, + beforeAST, + afterAST: cloneDeeplyExcludesParent(afterAST) + }; + } + + /** + * Check if the AST was changed + * @param {ASTNode} beforeAST AST node before running + * @param {ASTNode} afterAST AST node after running + * @returns {void} + * @private + */ + function assertASTDidntChange(beforeAST, afterAST) { + if (!lodash.isEqual(beforeAST, afterAST)) { + assert.fail("Rule should not modify AST."); + } + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(item) { + const result = runRuleForItem(item); + const messages = result.messages; + + assert.strictEqual(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, util.inspect(messages))); + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /** + * Asserts that the message matches its expected value. If the expected + * value is a regular expression, it is checked against the actual + * value. + * @param {string} actual Actual value + * @param {string|RegExp} expected Expected value + * @returns {void} + * @private + */ + function assertMessageMatches(actual, expected) { + if (expected instanceof RegExp) { + + // assert.js doesn't have a built-in RegExp match function + assert.ok( + expected.test(actual), + `Expected '${actual}' to match ${expected}` + ); + } else { + assert.strictEqual(actual, expected); + } + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string|Object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(item) { + assert.ok(item.errors || item.errors === 0, + `Did not specify errors for an invalid test of ${ruleName}`); + + if (Array.isArray(item.errors) && item.errors.length === 0) { + assert.fail("Invalid cases must have at least one error"); + } + + const ruleHasMetaMessages = hasOwnProperty(rule, "meta") && hasOwnProperty(rule.meta, "messages"); + const friendlyIDList = ruleHasMetaMessages ? `[${Object.keys(rule.meta.messages).map(key => `'${key}'`).join(", ")}]` : null; + + const result = runRuleForItem(item); + const messages = result.messages; + + if (typeof item.errors === "number") { + + if (item.errors === 0) { + assert.fail("Invalid cases must have 'error' value greater than 0"); + } + + assert.strictEqual(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages))); + } else { + assert.strictEqual( + messages.length, item.errors.length, + util.format( + "Should have %d error%s but had %d: %s", + item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages) + ) + ); + + const hasMessageOfThisRule = messages.some(m => m.ruleId === ruleName); + + for (let i = 0, l = item.errors.length; i < l; i++) { + const error = item.errors[i]; + const message = messages[i]; + + assert(hasMessageOfThisRule, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof error === "string" || error instanceof RegExp) { + + // Just an error message. + assertMessageMatches(message.message, error); + } else if (typeof error === "object" && error !== null) { + + /* + * Error object. + * This may have a message, messageId, data, node type, line, and/or + * column. + */ + + Object.keys(error).forEach(propertyName => { + assert.ok( + errorObjectParameters.has(propertyName), + `Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.` + ); + }); + + if (hasOwnProperty(error, "message")) { + assert.ok(!hasOwnProperty(error, "messageId"), "Error should not specify both 'message' and a 'messageId'."); + assert.ok(!hasOwnProperty(error, "data"), "Error should not specify both 'data' and 'message'."); + assertMessageMatches(message.message, error.message); + } else if (hasOwnProperty(error, "messageId")) { + assert.ok( + ruleHasMetaMessages, + "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'." + ); + if (!hasOwnProperty(rule.meta.messages, error.messageId)) { + assert(false, `Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`); + } + assert.strictEqual( + message.messageId, + error.messageId, + `messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.` + ); + if (hasOwnProperty(error, "data")) { + + /* + * if data was provided, then directly compare the returned message to a synthetic + * interpolated message using the same message ID and data provided in the test. + * See https://github.com/eslint/eslint/issues/9890 for context. + */ + const unformattedOriginalMessage = rule.meta.messages[error.messageId]; + const rehydratedMessage = interpolate(unformattedOriginalMessage, error.data); + + assert.strictEqual( + message.message, + rehydratedMessage, + `Hydrated message "${rehydratedMessage}" does not match "${message.message}"` + ); + } + } + + assert.ok( + hasOwnProperty(error, "data") ? hasOwnProperty(error, "messageId") : true, + "Error must specify 'messageId' if 'data' is used." + ); + + if (error.type) { + assert.strictEqual(message.nodeType, error.type, `Error type should be ${error.type}, found ${message.nodeType}`); + } + + if (hasOwnProperty(error, "line")) { + assert.strictEqual(message.line, error.line, `Error line should be ${error.line}`); + } + + if (hasOwnProperty(error, "column")) { + assert.strictEqual(message.column, error.column, `Error column should be ${error.column}`); + } + + if (hasOwnProperty(error, "endLine")) { + assert.strictEqual(message.endLine, error.endLine, `Error endLine should be ${error.endLine}`); + } + + if (hasOwnProperty(error, "endColumn")) { + assert.strictEqual(message.endColumn, error.endColumn, `Error endColumn should be ${error.endColumn}`); + } + + if (hasOwnProperty(error, "suggestions")) { + + // Support asserting there are no suggestions + if (!error.suggestions || (Array.isArray(error.suggestions) && error.suggestions.length === 0)) { + if (Array.isArray(message.suggestions) && message.suggestions.length > 0) { + assert.fail(`Error should have no suggestions on error with message: "${message.message}"`); + } + } else { + assert.strictEqual(Array.isArray(message.suggestions), true, `Error should have an array of suggestions. Instead received "${message.suggestions}" on error with message: "${message.message}"`); + assert.strictEqual(message.suggestions.length, error.suggestions.length, `Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`); + + error.suggestions.forEach((expectedSuggestion, index) => { + assert.ok( + typeof expectedSuggestion === "object" && expectedSuggestion !== null, + "Test suggestion in 'suggestions' array must be an object." + ); + Object.keys(expectedSuggestion).forEach(propertyName => { + assert.ok( + suggestionObjectParameters.has(propertyName), + `Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.` + ); + }); + + const actualSuggestion = message.suggestions[index]; + const suggestionPrefix = `Error Suggestion at index ${index} :`; + + if (hasOwnProperty(expectedSuggestion, "desc")) { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test should not specify both 'desc' and 'data'.` + ); + assert.strictEqual( + actualSuggestion.desc, + expectedSuggestion.desc, + `${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "messageId")) { + assert.ok( + ruleHasMetaMessages, + `${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.` + ); + assert.ok( + hasOwnProperty(rule.meta.messages, expectedSuggestion.messageId), + `${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.` + ); + assert.strictEqual( + actualSuggestion.messageId, + expectedSuggestion.messageId, + `${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.` + ); + if (hasOwnProperty(expectedSuggestion, "data")) { + const unformattedMetaMessage = rule.meta.messages[expectedSuggestion.messageId]; + const rehydratedDesc = interpolate(unformattedMetaMessage, expectedSuggestion.data); + + assert.strictEqual( + actualSuggestion.desc, + rehydratedDesc, + `${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".` + ); + } + } else { + assert.ok( + !hasOwnProperty(expectedSuggestion, "data"), + `${suggestionPrefix} Test must specify 'messageId' if 'data' is used.` + ); + } + + if (hasOwnProperty(expectedSuggestion, "output")) { + const codeWithAppliedSuggestion = SourceCodeFixer.applyFixes(item.code, [actualSuggestion]).output; + + assert.strictEqual(codeWithAppliedSuggestion, expectedSuggestion.output, `Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`); + } + }); + } + } + } else { + + // Message was an unexpected type + assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`); + } + } + } + + if (hasOwnProperty(item, "output")) { + if (item.output === null) { + assert.strictEqual( + result.output, + item.code, + "Expected no autofixes to be suggested" + ); + } else { + assert.strictEqual(result.output, item.output, "Output is incorrect."); + } + } else { + assert.strictEqual( + result.output, + item.code, + "The rule fixed the code. Please add 'output' property." + ); + } + + assertASTDidntChange(result.beforeAST, result.afterAST); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + */ + RuleTester.describe(ruleName, () => { + RuleTester.describe("valid", () => { + test.valid.forEach(valid => { + RuleTester.it(sanitize(typeof valid === "object" ? valid.code : valid), () => { + testValidTemplate(valid); + }); + }); + }); + + RuleTester.describe("invalid", () => { + test.invalid.forEach(invalid => { + RuleTester.it(sanitize(invalid.code), () => { + testInvalidTemplate(invalid); + }); + }); + }); + }); + } +} + +RuleTester[DESCRIBE] = RuleTester[IT] = null; + +module.exports = RuleTester; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/accessor-pairs.js b/day1/cli-study/node_modules/eslint/lib/rules/accessor-pairs.js new file mode 100644 index 0000000..cf994ad --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/accessor-pairs.js @@ -0,0 +1,367 @@ +/** + * @fileoverview Rule to enforce getter and setter pairs in objects and classes. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +/** + * Checks whether or not a given node is an `Identifier` node which was named a given name. + * @param {ASTNode} node A node to check. + * @param {string} name An expected name of the node. + * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. + */ +function isIdentifier(node, name) { + return node.type === "Identifier" && node.name === name; +} + +/** + * Checks whether or not a given node is an argument of a specified method call. + * @param {ASTNode} node A node to check. + * @param {number} index An expected index of the node in arguments. + * @param {string} object An expected name of the object of the method. + * @param {string} property An expected name of the method. + * @returns {boolean} `true` if the node is an argument of the specified method call. + */ +function isArgumentOfMethodCall(node, index, object, property) { + const parent = node.parent; + + return ( + parent.type === "CallExpression" && + parent.callee.type === "MemberExpression" && + parent.callee.computed === false && + isIdentifier(parent.callee.object, object) && + isIdentifier(parent.callee.property, property) && + parent.arguments[index] === node + ); +} + +/** + * Checks whether or not a given node is a property descriptor. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node) { + + // Object.defineProperty(obj, "foo", {set: ...}) + if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || + isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") + ) { + return true; + } + + /* + * Object.defineProperties(obj, {foo: {set: ...}}) + * Object.create(proto, {foo: {set: ...}}) + */ + const grandparent = node.parent.parent; + + return grandparent.type === "ObjectExpression" && ( + isArgumentOfMethodCall(grandparent, 1, "Object", "create") || + isArgumentOfMethodCall(grandparent, 1, "Object", "defineProperties") + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce getter and setter pairs in objects and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/accessor-pairs" + }, + + schema: [{ + type: "object", + properties: { + getWithoutSet: { + type: "boolean", + default: false + }, + setWithoutGet: { + type: "boolean", + default: true + }, + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + messages: { + missingGetterInPropertyDescriptor: "Getter is not present in property descriptor.", + missingSetterInPropertyDescriptor: "Setter is not present in property descriptor.", + missingGetterInObjectLiteral: "Getter is not present for {{ name }}.", + missingSetterInObjectLiteral: "Setter is not present for {{ name }}.", + missingGetterInClass: "Getter is not present for class {{ name }}.", + missingSetterInClass: "Setter is not present for class {{ name }}." + } + }, + create(context) { + const config = context.options[0] || {}; + const checkGetWithoutSet = config.getWithoutSet === true; + const checkSetWithoutGet = config.setWithoutGet !== false; + const enforceForClassMembers = config.enforceForClassMembers !== false; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node The node to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function report(node, messageKind) { + if (node.type === "Property") { + context.report({ + node, + messageId: `${messageKind}InObjectLiteral`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else if (node.type === "MethodDefinition") { + context.report({ + node, + messageId: `${messageKind}InClass`, + loc: astUtils.getFunctionHeadLoc(node.value, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node.value) } + }); + } else { + context.report({ + node, + messageId: `${messageKind}InPropertyDescriptor` + }); + } + } + + /** + * Reports each of the nodes in the given list using the same messageId. + * @param {ASTNode[]} nodes Nodes to report. + * @param {string} messageKind "missingGetter" or "missingSetter". + * @returns {void} + * @private + */ + function reportList(nodes, messageKind) { + for (const node of nodes) { + report(node, messageKind); + } + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @returns {void} + * @private + */ + function checkList(nodes) { + const accessors = nodes + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + if (checkSetWithoutGet && setters.length && !getters.length) { + reportList(setters, "missingGetter"); + } + if (checkGetWithoutSet && getters.length && !setters.length) { + reportList(getters, "missingSetter"); + } + } + } + + /** + * Checks accessor pairs in an object literal. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectLiteral(node) { + checkList(node.properties.filter(p => p.type === "Property")); + } + + /** + * Checks accessor pairs in a property descriptor. + * @param {ASTNode} node Property descriptor `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkPropertyDescriptor(node) { + const namesToCheck = node.properties + .filter(p => p.type === "Property" && p.kind === "init" && !p.computed) + .map(({ key }) => key.name); + + const hasGetter = namesToCheck.includes("get"); + const hasSetter = namesToCheck.includes("set"); + + if (checkSetWithoutGet && hasSetter && !hasGetter) { + report(node, "missingGetter"); + } + if (checkGetWithoutSet && hasGetter && !hasSetter) { + report(node, "missingSetter"); + } + } + + /** + * Checks the given object expression as an object literal and as a possible property descriptor. + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {void} + * @private + */ + function checkObjectExpression(node) { + checkObjectLiteral(node); + if (isPropertyDescriptor(node)) { + checkPropertyDescriptor(node); + } + } + + /** + * Checks the given class body. + * @param {ASTNode} node `ClassBody` node to check. + * @returns {void} + * @private + */ + function checkClassBody(node) { + const methodDefinitions = node.body.filter(m => m.type === "MethodDefinition"); + + checkList(methodDefinitions.filter(m => m.static)); + checkList(methodDefinitions.filter(m => !m.static)); + } + + const listeners = {}; + + if (checkSetWithoutGet || checkGetWithoutSet) { + listeners.ObjectExpression = checkObjectExpression; + if (enforceForClassMembers) { + listeners.ClassBody = checkClassBody; + } + } + + return listeners; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-newline.js new file mode 100644 index 0000000..b4b4dd4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -0,0 +1,258 @@ +/** + * @fileoverview Rule to enforce linebreaks after open and before close array brackets + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce linebreaks after opening and before closing array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedOpeningLinebreak: "There should be no linebreak after '['.", + unexpectedClosingLinebreak: "There should be no linebreak before ']'.", + missingOpeningLinebreak: "A linebreak is required after '['.", + missingClosingLinebreak: "A linebreak is required before ']'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} option An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(option) { + let consistent = false; + let multiline = false; + let minItems = 0; + + if (option) { + if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else if (option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + } else { + consistent = false; + multiline = true; + minItems = Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedOpeningLinebreak", + fix(fixer) { + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }); + + if (astUtils.isCommentToken(nextToken)) { + return null; + } + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "unexpectedClosingLinebreak", + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (astUtils.isCommentToken(previousToken)) { + return null; + } + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a linebreak after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningLinebreak", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + /** + * Reports that there should be a linebreak before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingLinebreak(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingLinebreak", + fix(fixer) { + return fixer.insertTextBefore(token, "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + const openBracket = sourceCode.getFirstToken(node); + const closeBracket = sourceCode.getLastToken(node); + const firstIncComment = sourceCode.getTokenAfter(openBracket, { includeComments: true }); + const lastIncComment = sourceCode.getTokenBefore(closeBracket, { includeComments: true }); + const first = sourceCode.getTokenAfter(openBracket); + const last = sourceCode.getTokenBefore(closeBracket); + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elements.length > 0 && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line + ) || + ( + elements.length === 0 && + firstIncComment.type === "Block" && + firstIncComment.loc.start.line !== lastIncComment.loc.end.line && + firstIncComment === lastIncComment + ) || + ( + options.consistent && + openBracket.loc.end.line !== first.loc.start.line + ) + ); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether linebreaks are needed. + * This allows: + * var arr = [ // eslint-disable-line foo + * 'a' + * ] + */ + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(openBracket, first)) { + reportRequiredBeginningLinebreak(node, openBracket); + } + if (astUtils.isTokenOnSameLine(last, closeBracket)) { + reportRequiredEndingLinebreak(node, closeBracket); + } + } else { + if (!astUtils.isTokenOnSameLine(openBracket, first)) { + reportNoBeginningLinebreak(node, openBracket); + } + if (!astUtils.isTokenOnSameLine(last, closeBracket)) { + reportNoEndingLinebreak(node, closeBracket); + } + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-spacing.js new file mode 100644 index 0000000..c2b77a6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Disallows or enforces spaces inside of array brackets. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside array brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-bracket-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + singleValue: { + type: "boolean" + }, + objectsInArrays: { + type: "boolean" + }, + arraysInArrays: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'.", + missingSpaceBefore: "A space is required before '{{tokenValue}}'." + } + }, + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = sourceCode.getTokenAfter(token); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = sourceCode.getTokenBefore(token); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if a node is an object type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } + + /** + * Determines if a node is an array type + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + } + + /** + * Validates the spacing around array brackets + * @param {ASTNode} node The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + second = sourceCode.getFirstToken(node, 1), + last = node.typeAnnotation + ? sourceCode.getTokenBefore(node.typeAnnotation) + : sourceCode.getLastToken(node), + penultimate = sourceCode.getTokenBefore(last), + firstElement = node.elements[0], + lastElement = node.elements[node.elements.length - 1]; + + const openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + const closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/array-callback-return.js b/day1/cli-study/node_modules/eslint/lib/rules/array-callback-return.js new file mode 100644 index 0000000..62ba7b7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,287 @@ +/** + * @fileoverview Rule to enforce return statements in callbacks of array's methods + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isTargetMethod(node) { + return ( + node.type === "MemberExpression" && + TARGET_METHODS.test(astUtils.getStaticPropertyName(node) || "") + ); +} + +/** + * Checks whether or not a given node is a function expression which is the + * callback of an array method, returning the method name. + * @param {ASTNode} node A node to check. This is one of + * FunctionExpression or ArrowFunctionExpression. + * @returns {string} The method name if the node is a callback method, + * null otherwise. + */ +function getArrayMethodName(node) { + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. e.g., + * foo.every(nativeFoo || function foo() { ... }); + */ + case "LogicalExpression": + case "ConditionalExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * foo.every((function() { + * // setup... + * return function callback() { ... }; + * })()); + */ + case "ReturnStatement": { + const func = astUtils.getUpperFunction(parent); + + if (func === null || !astUtils.isCallee(func)) { + return null; + } + currentNode = func.parent; + break; + } + + /* + * e.g. + * Array.from([], function() {}); + * list.every(function() {}); + */ + case "CallExpression": + if (astUtils.isArrayFromMethod(parent.callee)) { + if ( + parent.arguments.length >= 2 && + parent.arguments[1] === currentNode + ) { + return "from"; + } + } + if (isTargetMethod(parent.callee)) { + if ( + parent.arguments.length >= 1 && + parent.arguments[0] === currentNode + ) { + return astUtils.getStaticPropertyName(parent.callee); + } + } + return null; + + // Otherwise this node is not target. + default: + return null; + } + } + + /* istanbul ignore next: unreachable */ + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in callbacks of array methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/array-callback-return" + }, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + }, + checkForEach: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectedAtEnd: "Expected to return a value at the end of {{name}}.", + expectedInside: "Expected to return a value in {{name}}.", + expectedReturnValue: "{{name}} expected a return value.", + expectedNoReturnValue: "{{name}} did not expect a return value." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false, checkForEach: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + arrayMethodName: null, + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + if (options.checkForEach && node.type === "ArrowFunctionExpression" && node.expression) { + messageId = "expectedNoReturnValue"; + } + } else { + if (node.body.type === "BlockStatement" && funcInfo.codePath.currentSegments.some(isReachable)) { + messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; + } + } + + if (messageId) { + let name = astUtils.getFunctionNameWithKind(node); + + name = messageId === "expectedNoReturnValue" ? lodash.upperFirst(name) : name; + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId, + data: { name } + }); + } + } + + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + + let methodName = null; + + if (TARGET_NODE_TYPE.test(node.type)) { + methodName = getArrayMethodName(node); + } + + funcInfo = { + arrayMethodName: methodName, + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: + methodName && + !node.async && + !node.generator, + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + + if (!funcInfo.shouldCheck) { + return; + } + + funcInfo.hasReturn = true; + + let messageId = null; + + if (funcInfo.arrayMethodName === "forEach") { + + // if checkForEach: true, returning a value at any path inside a forEach is not allowed + if (options.checkForEach && node.argument) { + messageId = "expectedNoReturnValue"; + } + } else { + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + messageId = "expectedReturnValue"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + name: lodash.upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + } + }); + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/array-element-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/array-element-newline.js new file mode 100644 index 0000000..b7a9678 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/array-element-newline.js @@ -0,0 +1,301 @@ +/** + * @fileoverview Rule to enforce line breaks after each array element + * @author Jan Peer Stöcklmair + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks after each array element", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/array-element-newline" + }, + + fixable: "whitespace", + + schema: { + definitions: { + basicConfig: { + oneOf: [ + { + enum: ["always", "never", "consistent"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minItems: { + type: ["integer", "null"], + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + }, + items: [ + { + oneOf: [ + { + $ref: "#/definitions/basicConfig" + }, + { + type: "object", + properties: { + ArrayExpression: { + $ref: "#/definitions/basicConfig" + }, + ArrayPattern: { + $ref: "#/definitions/basicConfig" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ] + }, + + messages: { + unexpectedLineBreak: "There should be no linebreak here.", + missingLineBreak: "There should be a linebreak after this element." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} providedOption An option value to parse. + * @returns {{multiline: boolean, minItems: number}} Normalized option object. + */ + function normalizeOptionValue(providedOption) { + let consistent = false; + let multiline = false; + let minItems; + + const option = providedOption || "always"; + + if (!option || option === "always" || option.minItems === 0) { + minItems = 0; + } else if (option === "never") { + minItems = Number.POSITIVE_INFINITY; + } else if (option === "consistent") { + consistent = true; + minItems = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(option.multiline); + minItems = option.minItems || Number.POSITIVE_INFINITY; + } + + return { consistent, multiline, minItems }; + } + + /** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object. + */ + function normalizeOptions(options) { + if (options && (options.ArrayExpression || options.ArrayPattern)) { + let expressionOptions, patternOptions; + + if (options.ArrayExpression) { + expressionOptions = normalizeOptionValue(options.ArrayExpression); + } + + if (options.ArrayPattern) { + patternOptions = normalizeOptionValue(options.ArrayPattern); + } + + return { ArrayExpression: expressionOptions, ArrayPattern: patternOptions }; + } + + const value = normalizeOptionValue(options); + + return { ArrayExpression: value, ArrayPattern: value }; + } + + /** + * Reports that there shouldn't be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "unexpectedLineBreak", + fix(fixer) { + if (astUtils.isCommentToken(tokenBefore)) { + return null; + } + + if (!astUtils.isTokenOnSameLine(tokenBefore, token)) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " "); + } + + /* + * This will check if the comma is on the same line as the next element + * Following array: + * [ + * 1 + * , 2 + * , 3 + * ] + * + * will be fixed to: + * [ + * 1, 2, 3 + * ] + */ + const twoTokensBefore = sourceCode.getTokenBefore(tokenBefore, { includeComments: true }); + + if (astUtils.isCommentToken(twoTokensBefore)) { + return null; + } + + return fixer.replaceTextRange([twoTokensBefore.range[1], tokenBefore.range[0]], ""); + + } + }); + } + + /** + * Reports that there should be a line break after the first token + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredLineBreak(token) { + const tokenBefore = sourceCode.getTokenBefore(token, { includeComments: true }); + + context.report({ + loc: { + start: tokenBefore.loc.end, + end: token.loc.start + }, + messageId: "missingLineBreak", + fix(fixer) { + return fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n"); + } + }); + } + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node. + * @returns {void} + */ + function check(node) { + const elements = node.elements; + const normalizedOptions = normalizeOptions(context.options[0]); + const options = normalizedOptions[node.type]; + + if (!options) { + return; + } + + let elementBreak = false; + + /* + * MULTILINE: true + * loop through every element and check + * if at least one element has linebreaks inside + * this ensures that following is not valid (due to elements are on the same line): + * + * [ + * 1, + * 2, + * 3 + * ] + */ + if (options.multiline) { + elementBreak = elements + .filter(element => element !== null) + .some(element => element.loc.start.line !== element.loc.end.line); + } + + const linebreaksCount = node.elements.map((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return false; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + return !astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement); + }).filter(isBreak => isBreak === true).length; + + const needsLinebreaks = ( + elements.length >= options.minItems || + ( + options.multiline && + elementBreak + ) || + ( + options.consistent && + linebreaksCount > 0 && + linebreaksCount < node.elements.length + ) + ); + + elements.forEach((element, i) => { + const previousElement = elements[i - 1]; + + if (i === 0 || element === null || previousElement === null) { + return; + } + + const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); + const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); + const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); + + if (needsLinebreaks) { + if (astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportRequiredLineBreak(firstTokenOfCurrentElement); + } + } else { + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + reportNoLineBreak(firstTokenOfCurrentElement); + } + } + }); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + ArrayPattern: check, + ArrayExpression: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/arrow-body-style.js b/day1/cli-study/node_modules/eslint/lib/rules/arrow-body-style.js new file mode 100644 index 0000000..9d5c77d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,251 @@ +/** + * @fileoverview Rule to require braces in arrow function body. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require braces around arrow function bodies", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-body-style" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["as-needed"] + }, + { + type: "object", + properties: { + requireReturnForObjectLiteral: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + unexpectedOtherBlock: "Unexpected block statement surrounding arrow body.", + unexpectedEmptyBlock: "Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.", + unexpectedObjectBlock: "Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.", + unexpectedSingleBlock: "Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.", + expectedBlock: "Expected block statement surrounding arrow body." + } + }, + + create(context) { + const options = context.options; + const always = options[0] === "always"; + const asNeeded = !options[0] || options[0] === "as-needed"; + const never = options[0] === "never"; + const requireReturnForObjectLiteral = options[1] && options[1].requireReturnForObjectLiteral; + const sourceCode = context.getSourceCode(); + + /** + * Checks whether the given node has ASI problem or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed. + */ + function hasASIProblem(token) { + return token && token.type === "Punctuator" && /^[([/`+-]/u.test(token.value); + } + + /** + * Gets the closing parenthesis which is the pair of the given opening parenthesis. + * @param {Token} token The opening parenthesis token to get. + * @returns {Token} The found closing parenthesis token. + */ + function findClosingParen(token) { + let node = sourceCode.getNodeByRangeIndex(token.range[0]); + + while (!astUtils.isParenthesised(sourceCode, node)) { + node = node.parent; + } + return sourceCode.getTokenAfter(node); + } + + /** + * Determines whether a arrow function body needs braces + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function validate(node) { + const arrowBody = node.body; + + if (arrowBody.type === "BlockStatement") { + const blockBody = arrowBody.body; + + if (blockBody.length !== 1 && !never) { + return; + } + + if (asNeeded && requireReturnForObjectLiteral && blockBody[0].type === "ReturnStatement" && + blockBody[0].argument && blockBody[0].argument.type === "ObjectExpression") { + return; + } + + if (never || asNeeded && blockBody[0].type === "ReturnStatement") { + let messageId; + + if (blockBody.length === 0) { + messageId = "unexpectedEmptyBlock"; + } else if (blockBody.length > 1) { + messageId = "unexpectedOtherBlock"; + } else if (blockBody[0].argument === null) { + messageId = "unexpectedSingleBlock"; + } else if (astUtils.isOpeningBraceToken(sourceCode.getFirstToken(blockBody[0], { skip: 1 }))) { + messageId = "unexpectedObjectBlock"; + } else { + messageId = "unexpectedSingleBlock"; + } + + context.report({ + node, + loc: arrowBody.loc.start, + messageId, + fix(fixer) { + const fixes = []; + + if (blockBody.length !== 1 || + blockBody[0].type !== "ReturnStatement" || + !blockBody[0].argument || + hasASIProblem(sourceCode.getTokenAfter(arrowBody)) + ) { + return fixes; + } + + const openingBrace = sourceCode.getFirstToken(arrowBody); + const closingBrace = sourceCode.getLastToken(arrowBody); + const firstValueToken = sourceCode.getFirstToken(blockBody[0], 1); + const lastValueToken = sourceCode.getLastToken(blockBody[0]); + const commentsExist = + sourceCode.commentsExistBetween(openingBrace, firstValueToken) || + sourceCode.commentsExistBetween(lastValueToken, closingBrace); + + /* + * Remove tokens around the return value. + * If comments don't exist, remove extra spaces as well. + */ + if (commentsExist) { + fixes.push( + fixer.remove(openingBrace), + fixer.remove(closingBrace), + fixer.remove(sourceCode.getTokenAfter(openingBrace)) // return keyword + ); + } else { + fixes.push( + fixer.removeRange([openingBrace.range[0], firstValueToken.range[0]]), + fixer.removeRange([lastValueToken.range[1], closingBrace.range[1]]) + ); + } + + /* + * If the first token of the reutrn value is `{` or the return value is a sequence expression, + * enclose the return value by parentheses to avoid syntax error. + */ + if (astUtils.isOpeningBraceToken(firstValueToken) || blockBody[0].argument.type === "SequenceExpression") { + fixes.push( + fixer.insertTextBefore(firstValueToken, "("), + fixer.insertTextAfter(lastValueToken, ")") + ); + } + + /* + * If the last token of the return statement is semicolon, remove it. + * Non-block arrow body is an expression, not a statement. + */ + if (astUtils.isSemicolonToken(lastValueToken)) { + fixes.push(fixer.remove(lastValueToken)); + } + + return fixes; + } + }); + } + } else { + if (always || (asNeeded && requireReturnForObjectLiteral && arrowBody.type === "ObjectExpression")) { + context.report({ + node, + loc: arrowBody.loc.start, + messageId: "expectedBlock", + fix(fixer) { + const fixes = []; + const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); + const [firstTokenAfterArrow, secondTokenAfterArrow] = sourceCode.getTokensAfter(arrowToken, { count: 2 }); + const lastToken = sourceCode.getLastToken(node); + const isParenthesisedObjectLiteral = + astUtils.isOpeningParenToken(firstTokenAfterArrow) && + astUtils.isOpeningBraceToken(secondTokenAfterArrow); + + // If the value is object literal, remove parentheses which were forced by syntax. + if (isParenthesisedObjectLiteral) { + const openingParenToken = firstTokenAfterArrow; + const openingBraceToken = secondTokenAfterArrow; + + if (astUtils.isTokenOnSameLine(openingParenToken, openingBraceToken)) { + fixes.push(fixer.replaceText(openingParenToken, "{return ")); + } else { + + // Avoid ASI + fixes.push( + fixer.replaceText(openingParenToken, "{"), + fixer.insertTextBefore(openingBraceToken, "return ") + ); + } + + // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() + fixes.push(fixer.remove(findClosingParen(openingBraceToken))); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + + } else { + fixes.push(fixer.insertTextBefore(firstTokenAfterArrow, "{return ")); + fixes.push(fixer.insertTextAfter(lastToken, "}")); + } + + return fixes; + } + }); + } + } + } + + return { + "ArrowFunctionExpression:exit": validate + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/arrow-parens.js b/day1/cli-study/node_modules/eslint/lib/rules/arrow-parens.js new file mode 100644 index 0000000..bfd3244 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/arrow-parens.js @@ -0,0 +1,200 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get location should be reported by AST node. + * @param {ASTNode} node AST Node. + * @returns {Location} Location information. + */ +function getLocation(node) { + return { + start: node.params[0].loc.start, + end: node.params[node.params.length - 1].loc.end + }; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around arrow function arguments", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-parens" + }, + + fixable: "code", + + schema: [ + { + enum: ["always", "as-needed"] + }, + { + type: "object", + properties: { + requireForBlockBody: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedParens: "Unexpected parentheses around single function argument.", + expectedParens: "Expected parentheses around arrow function argument.", + + unexpectedParensInline: "Unexpected parentheses around single function argument having a body with no curly braces.", + expectedParensBlock: "Expected parentheses around arrow function argument having a body with curly braces." + } + }, + + create(context) { + const asNeeded = context.options[0] === "as-needed"; + const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true; + + const sourceCode = context.getSourceCode(); + + /** + * Determines whether a arrow function argument end with `)` + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function parens(node) { + const isAsync = node.async; + const firstTokenOfParam = sourceCode.getFirstToken(node, isAsync ? 1 : 0); + + /** + * Remove the parenthesis around a parameter + * @param {Fixer} fixer Fixer + * @returns {string} fixed parameter + */ + function fixParamsWithParenthesis(fixer) { + const paramToken = sourceCode.getTokenAfter(firstTokenOfParam); + + /* + * ES8 allows Trailing commas in function parameter lists and calls + * https://github.com/eslint/eslint/issues/8834 + */ + const closingParenToken = sourceCode.getTokenAfter(paramToken, astUtils.isClosingParenToken); + const asyncToken = isAsync ? sourceCode.getTokenBefore(firstTokenOfParam) : null; + const shouldAddSpaceForAsync = asyncToken && (asyncToken.range[1] === firstTokenOfParam.range[0]); + + return fixer.replaceTextRange([ + firstTokenOfParam.range[0], + closingParenToken.range[1] + ], `${shouldAddSpaceForAsync ? " " : ""}${paramToken.value}`); + } + + /** + * Checks whether there are comments inside the params or not. + * @returns {boolean} `true` if there are comments inside of parens, else `false` + */ + function hasCommentsInParens() { + if (astUtils.isOpeningParenToken(firstTokenOfParam)) { + const closingParenToken = sourceCode.getTokenAfter(node.params[0], astUtils.isClosingParenToken); + + return closingParenToken && sourceCode.commentsExistBetween(firstTokenOfParam, closingParenToken); + } + return false; + + } + + if (hasCommentsInParens()) { + return; + } + + // "as-needed", { "requireForBlockBody": true }: x => x + if ( + requireForBlockBody && + node.params[0].type === "Identifier" && + !node.params[0].typeAnnotation && + node.body.type !== "BlockStatement" && + !node.returnType + ) { + if (astUtils.isOpeningParenToken(firstTokenOfParam)) { + context.report({ + node, + messageId: "unexpectedParensInline", + loc: getLocation(node), + fix: fixParamsWithParenthesis + }); + } + return; + } + + if ( + requireForBlockBody && + node.body.type === "BlockStatement" + ) { + if (!astUtils.isOpeningParenToken(firstTokenOfParam)) { + context.report({ + node, + messageId: "expectedParensBlock", + loc: getLocation(node), + fix(fixer) { + return fixer.replaceText(firstTokenOfParam, `(${firstTokenOfParam.value})`); + } + }); + } + return; + } + + // "as-needed": x => x + if (asNeeded && + node.params[0].type === "Identifier" && + !node.params[0].typeAnnotation && + !node.returnType + ) { + if (astUtils.isOpeningParenToken(firstTokenOfParam)) { + context.report({ + node, + messageId: "unexpectedParens", + loc: getLocation(node), + fix: fixParamsWithParenthesis + }); + } + return; + } + + if (firstTokenOfParam.type === "Identifier") { + const after = sourceCode.getTokenAfter(firstTokenOfParam); + + // (x) => x + if (after.value !== ")") { + context.report({ + node, + messageId: "expectedParens", + loc: getLocation(node), + fix(fixer) { + return fixer.replaceText(firstTokenOfParam, `(${firstTokenOfParam.value})`); + } + }); + } + } + } + + return { + "ArrowFunctionExpression[params.length=1]": parens + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/arrow-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/arrow-spacing.js new file mode 100644 index 0000000..e5110c6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,161 @@ +/** + * @fileoverview Rule to define spacing before/after arrow function's arrow. + * @author Jxck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after the arrow in arrow functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/arrow-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: true + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + expectedBefore: "Missing space before =>.", + unexpectedBefore: "Unexpected space before =>.", + + expectedAfter: "Missing space after =>.", + unexpectedAfter: "Unexpected space after =>." + } + }, + + create(context) { + + // merge rules with default + const rule = Object.assign({}, context.options[0]); + + rule.before = rule.before !== false; + rule.after = rule.after !== false; + + const sourceCode = context.getSourceCode(); + + /** + * Get tokens of arrow(`=>`) and before/after arrow. + * @param {ASTNode} node The arrow function node. + * @returns {Object} Tokens of arrow and before/after arrow. + */ + function getTokens(node) { + const arrow = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + + return { + before: sourceCode.getTokenBefore(arrow), + arrow, + after: sourceCode.getTokenAfter(arrow) + }; + } + + /** + * Count spaces before/after arrow(`=>`) token. + * @param {Object} tokens Tokens before/after arrow. + * @returns {Object} count of space before/after arrow. + */ + function countSpaces(tokens) { + const before = tokens.arrow.range[0] - tokens.before.range[1]; + const after = tokens.after.range[0] - tokens.arrow.range[1]; + + return { before, after }; + } + + /** + * Determines whether space(s) before after arrow(`=>`) is satisfy rule. + * if before/after value is `true`, there should be space(s). + * if before/after value is `false`, there should be no space. + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function spaces(node) { + const tokens = getTokens(node); + const countSpace = countSpaces(tokens); + + if (rule.before) { + + // should be space(s) before arrow + if (countSpace.before === 0) { + context.report({ + node: tokens.before, + messageId: "expectedBefore", + fix(fixer) { + return fixer.insertTextBefore(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space before arrow + if (countSpace.before > 0) { + context.report({ + node: tokens.before, + messageId: "unexpectedBefore", + fix(fixer) { + return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); + } + }); + } + } + + if (rule.after) { + + // should be space(s) after arrow + if (countSpace.after === 0) { + context.report({ + node: tokens.after, + messageId: "expectedAfter", + fix(fixer) { + return fixer.insertTextAfter(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space after arrow + if (countSpace.after > 0) { + context.report({ + node: tokens.after, + messageId: "unexpectedAfter", + fix(fixer) { + return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); + } + }); + } + } + } + + return { + ArrowFunctionExpression: spaces + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/block-scoped-var.js b/day1/cli-study/node_modules/eslint/lib/rules/block-scoped-var.js new file mode 100644 index 0000000..481057b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/block-scoped-var.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to check for "block scoped" variables by binding context + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of variables within the scope they are defined", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/block-scoped-var" + }, + + schema: [], + + messages: { + outOfScope: "'{{name}}' used outside of binding context." + } + }, + + create(context) { + let stack = []; + + /** + * Makes a block scope. + * @param {ASTNode} node A node of a scope. + * @returns {void} + */ + function enterScope(node) { + stack.push(node.range); + } + + /** + * Pops the last block scope. + * @returns {void} + */ + function exitScope() { + stack.pop(); + } + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + const identifier = reference.identifier; + + context.report({ node: identifier, messageId: "outOfScope", data: { name: identifier.name } }); + } + + /** + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node A node to get variables. + * @returns {void} + */ + function checkForVariables(node) { + if (node.kind !== "var") { + return; + } + + // Defines a predicate to check whether or not a given reference is outside of valid scope. + const scopeRange = stack[stack.length - 1]; + + /** + * Check if a reference is out of scope + * @param {ASTNode} reference node to examine + * @returns {boolean} True is its outside the scope + * @private + */ + function isOutsideOfScope(reference) { + const idRange = reference.identifier.range; + + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; + } + + // Gets declared variables, and checks its references. + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(report); + } + } + + return { + Program(node) { + stack = [node.range]; + }, + + // Manages scopes. + BlockStatement: enterScope, + "BlockStatement:exit": exitScope, + ForStatement: enterScope, + "ForStatement:exit": exitScope, + ForInStatement: enterScope, + "ForInStatement:exit": exitScope, + ForOfStatement: enterScope, + "ForOfStatement:exit": exitScope, + SwitchStatement: enterScope, + "SwitchStatement:exit": exitScope, + CatchClause: enterScope, + "CatchClause:exit": exitScope, + + // Finds and reports references which are outside of valid scope. + VariableDeclaration: checkForVariables + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/block-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/block-spacing.js new file mode 100644 index 0000000..c4b30b0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/block-spacing.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. + * @author Toru Nagashima + */ + +"use strict"; + +const util = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow or enforce spaces inside of blocks after opening block and before closing block", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/block-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + + messages: { + missing: "Requires a space {{location}} '{{token}}'.", + extra: "Unexpected space(s) {{location}} '{{token}}'." + } + }, + + create(context) { + const always = (context.options[0] !== "never"), + messageId = always ? "missing" : "extra", + sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + if (node.cases.length > 0) { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getLastToken(node, 1); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param {Token} left A token to check. + * @param {Token} right The token which is next to `left`. + * @returns {boolean} + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left, right) { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === always + ); + } + + /** + * Reports invalid spacing style inside braces. + * @param {ASTNode} node A BlockStatement/SwitchStatement node to get. + * @returns {void} + */ + function checkSpacingInsideBraces(node) { + + // Gets braces and the first/last token of content. + const openBrace = getOpenBrace(node); + const closeBrace = sourceCode.getLastToken(node); + const firstToken = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + const lastToken = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + // Skip if the node is invalid or empty. + if (openBrace.type !== "Punctuator" || + openBrace.value !== "{" || + closeBrace.type !== "Punctuator" || + closeBrace.value !== "}" || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === "Line") { + return; + } + + // Check. + if (!isValid(openBrace, firstToken)) { + let loc = openBrace.loc; + + if (messageId === "extra") { + loc = { + start: openBrace.loc.end, + end: firstToken.loc.start + }; + } + + context.report({ + node, + loc, + messageId, + data: { + location: "after", + token: openBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, " "); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + } + }); + } + if (!isValid(lastToken, closeBrace)) { + let loc = closeBrace.loc; + + if (messageId === "extra") { + loc = { + start: lastToken.loc.end, + end: closeBrace.loc.start + }; + } + context.report({ + node, + loc, + messageId, + data: { + location: "before", + token: closeBrace.value + }, + fix(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, " "); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + } + }); + } + } + + return { + BlockStatement: checkSpacingInsideBraces, + SwitchStatement: checkSpacingInsideBraces + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/brace-style.js b/day1/cli-study/node_modules/eslint/lib/rules/brace-style.js new file mode 100644 index 0000000..07223d1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/brace-style.js @@ -0,0 +1,188 @@ +/** + * @fileoverview Rule to flag block statements that do not use the one true brace style + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent brace style for blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/brace-style" + }, + + schema: [ + { + enum: ["1tbs", "stroustrup", "allman"] + }, + { + type: "object", + properties: { + allowSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + nextLineOpen: "Opening curly brace does not appear on the same line as controlling statement.", + sameLineOpen: "Opening curly brace appears on the same line as controlling statement.", + blockSameLine: "Statement inside of curly braces should be on next line.", + nextLineClose: "Closing curly brace does not appear on the same line as the subsequent block.", + singleLineClose: "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", + sameLineClose: "Closing curly brace appears on the same line as the subsequent block." + } + }, + + create(context) { + const style = context.options[0] || "1tbs", + params = context.options[1] || {}, + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Fixes a place where a newline unexpectedly appears + * @param {Token} firstToken The token before the unexpected newline + * @param {Token} secondToken The token after the unexpected newline + * @returns {Function} A fixer function to remove the newlines between the tokens + */ + function removeNewlineBetween(firstToken, secondToken) { + const textRange = [firstToken.range[1], secondToken.range[0]]; + const textBetween = sourceCode.text.slice(textRange[0], textRange[1]); + + // Don't do a fix if there is a comment between the tokens + if (textBetween.trim()) { + return null; + } + return fixer => fixer.replaceTextRange(textRange, " "); + } + + /** + * Validates a pair of curly brackets based on the user's config + * @param {Token} openingCurly The opening curly bracket + * @param {Token} closingCurly The closing curly bracket + * @returns {void} + */ + function validateCurlyPair(openingCurly, closingCurly) { + const tokenBeforeOpeningCurly = sourceCode.getTokenBefore(openingCurly); + const tokenAfterOpeningCurly = sourceCode.getTokenAfter(openingCurly); + const tokenBeforeClosingCurly = sourceCode.getTokenBefore(closingCurly); + const singleLineException = params.allowSingleLine && astUtils.isTokenOnSameLine(openingCurly, closingCurly); + + if (style !== "allman" && !astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly)) { + context.report({ + node: openingCurly, + messageId: "nextLineOpen", + fix: removeNewlineBetween(tokenBeforeOpeningCurly, openingCurly) + }); + } + + if (style === "allman" && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "sameLineOpen", + fix: fixer => fixer.insertTextBefore(openingCurly, "\n") + }); + } + + if (astUtils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) { + context.report({ + node: openingCurly, + messageId: "blockSameLine", + fix: fixer => fixer.insertTextAfter(openingCurly, "\n") + }); + } + + if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) { + context.report({ + node: closingCurly, + messageId: "singleLineClose", + fix: fixer => fixer.insertTextBefore(closingCurly, "\n") + }); + } + } + + /** + * Validates the location of a token that appears before a keyword (e.g. a newline before `else`) + * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`). + * @returns {void} + */ + function validateCurlyBeforeKeyword(curlyToken) { + const keywordToken = sourceCode.getTokenAfter(curlyToken); + + if (style === "1tbs" && !astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "nextLineClose", + fix: removeNewlineBetween(curlyToken, keywordToken) + }); + } + + if (style !== "1tbs" && astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { + context.report({ + node: curlyToken, + messageId: "sameLineClose", + fix: fixer => fixer.insertTextAfter(curlyToken, "\n") + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BlockStatement(node) { + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + } + }, + ClassBody(node) { + validateCurlyPair(sourceCode.getFirstToken(node), sourceCode.getLastToken(node)); + }, + SwitchStatement(node) { + const closingCurly = sourceCode.getLastToken(node); + const openingCurly = sourceCode.getTokenBefore(node.cases.length ? node.cases[0] : closingCurly); + + validateCurlyPair(openingCurly, closingCurly); + }, + IfStatement(node) { + if (node.consequent.type === "BlockStatement" && node.alternate) { + + // Handle the keyword after the `if` block (before `else`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.consequent)); + } + }, + TryStatement(node) { + + // Handle the keyword after the `try` block (before `catch` or `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block)); + + if (node.handler && node.finalizer) { + + // Handle the keyword after the `catch` block (before `finally`) + validateCurlyBeforeKeyword(sourceCode.getLastToken(node.handler.body)); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/callback-return.js b/day1/cli-study/node_modules/eslint/lib/rules/callback-return.js new file mode 100644 index 0000000..ba13c9a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/callback-return.js @@ -0,0 +1,186 @@ +/** + * @fileoverview Enforce return after a callback. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `return` statements after callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/callback-return" + }, + + schema: [{ + type: "array", + items: { type: "string" } + }], + + messages: { + missingReturn: "Expected return with your callback function." + } + }, + + create(context) { + + const callbacks = context.options[0] || ["callback", "cb", "next"], + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Find the closest parent matching a list of types. + * @param {ASTNode} node The node whose parents we are searching + * @param {Array} types The node types to match + * @returns {ASTNode} The matched node or undefined. + */ + function findClosestParentOfType(node, types) { + if (!node.parent) { + return null; + } + if (types.indexOf(node.parent.type) === -1) { + return findClosestParentOfType(node.parent, types); + } + return node.parent; + } + + /** + * Check to see if a node contains only identifers + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the node contains only identifers + */ + function containsOnlyIdentifiers(node) { + if (node.type === "Identifier") { + return true; + } + + if (node.type === "MemberExpression") { + if (node.object.type === "Identifier") { + return true; + } + if (node.object.type === "MemberExpression") { + return containsOnlyIdentifiers(node.object); + } + } + + return false; + } + + /** + * Check to see if a CallExpression is in our callback list. + * @param {ASTNode} node The node to check against our callback names list. + * @returns {boolean} Whether or not this function matches our callback name. + */ + function isCallback(node) { + return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1; + } + + /** + * Determines whether or not the callback is part of a callback expression. + * @param {ASTNode} node The callback node + * @param {ASTNode} parentNode The expression node + * @returns {boolean} Whether or not this is part of a callback expression + */ + function isCallbackExpression(node, parentNode) { + + // ensure the parent node exists and is an expression + if (!parentNode || parentNode.type !== "ExpressionStatement") { + return false; + } + + // cb() + if (parentNode.expression === node) { + return true; + } + + // special case for cb && cb() and similar + if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { + if (parentNode.expression.right === node) { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + + // if we're not a callback we can return + if (!isCallback(node)) { + return; + } + + // find the closest block, return or loop + const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; + + // if our parent is a return we know we're ok + if (closestBlock.type === "ReturnStatement") { + return; + } + + // arrow functions don't always have blocks and implicitly return + if (closestBlock.type === "ArrowFunctionExpression") { + return; + } + + // block statements are part of functions and most if statements + if (closestBlock.type === "BlockStatement") { + + // find the last item in the block + const lastItem = closestBlock.body[closestBlock.body.length - 1]; + + // if the callback is the last thing in a block that might be ok + if (isCallbackExpression(node, lastItem)) { + + const parentType = closestBlock.parent.type; + + // but only if the block is part of a function + if (parentType === "FunctionExpression" || + parentType === "FunctionDeclaration" || + parentType === "ArrowFunctionExpression" + ) { + return; + } + + } + + // ending a block with a return is also ok + if (lastItem.type === "ReturnStatement") { + + // but only if the callback is immediately before + if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) { + return; + } + } + + } + + // as long as you're the child of a function at this point you should be asked to return + if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { + context.report({ node, messageId: "missingReturn" }); + } + + } + + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/camelcase.js b/day1/cli-study/node_modules/eslint/lib/rules/camelcase.js new file mode 100644 index 0000000..0436083 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/camelcase.js @@ -0,0 +1,278 @@ +/** + * @fileoverview Rule to flag non-camelcased identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce camelcase naming convention", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/camelcase" + }, + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { + type: "boolean", + default: false + }, + ignoreImports: { + type: "boolean", + default: false + }, + properties: { + enum: ["always", "never"] + }, + allow: { + type: "array", + items: [ + { + type: "string" + } + ], + minItems: 0, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + notCamelCase: "Identifier '{{name}}' is not in camel case." + } + }, + + create(context) { + + const options = context.options[0] || {}; + let properties = options.properties || ""; + const ignoreDestructuring = options.ignoreDestructuring; + const ignoreImports = options.ignoreImports; + const allow = options.allow || []; + + if (properties !== "always" && properties !== "never") { + properties = "always"; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = []; + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + + /** + * Checks if a string contains an underscore and isn't all upper-case + * @param {string} name The string to check. + * @returns {boolean} if the string is underscored + * @private + */ + function isUnderscored(name) { + + // if there's an underscore, it might be A_CONSTANT, which is okay + return name.includes("_") && name !== name.toUpperCase(); + } + + /** + * Checks if a string match the ignore list + * @param {string} name The string to check. + * @returns {boolean} if the string is ignored + * @private + */ + function isAllowed(name) { + return allow.some( + entry => name === entry || name.match(new RegExp(entry, "u")) + ); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let current = node; + + while (current) { + const parent = current.parent; + + if (parent && parent.type === "Property" && parent.computed && parent.key === current) { + return false; + } + + if (current.type === "ObjectPattern") { + return true; + } + + current = parent; + } + + return false; + } + + /** + * Checks whether the given node represents assignment target property in destructuring. + * + * For examples: + * ({a: b.foo} = c); // => true for `foo` + * ([a.foo] = b); // => true for `foo` + * ([a.foo = 1] = b); // => true for `foo` + * ({...a.foo} = b); // => true for `foo` + * @param {ASTNode} node An Identifier node to check + * @returns {boolean} True if the node is an assignment target property in destructuring. + */ + function isAssignmentTargetPropertyInDestructuring(node) { + if ( + node.parent.type === "MemberExpression" && + node.parent.property === node && + !node.parent.computed + ) { + const effectiveParent = node.parent.parent; + + return ( + effectiveParent.type === "Property" && + effectiveParent.value === node.parent && + effectiveParent.parent.type === "ObjectPattern" || + effectiveParent.type === "ArrayPattern" || + effectiveParent.type === "RestElement" || + ( + effectiveParent.type === "AssignmentPattern" && + effectiveParent.left === node.parent + ) + ); + } + return false; + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.includes(node)) { + reported.push(node); + context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + } + } + + return { + + Identifier(node) { + + /* + * Leading and trailing underscores are commonly used to flag + * private/protected identifiers, strip them before checking if underscored + */ + const name = node.name, + nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/gu, "")), + effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + + // First, we ignore the node if it match the ignore list + if (isAllowed(name)) { + return; + } + + // MemberExpressions get special rules + if (node.parent.type === "MemberExpression") { + + // "never" check properties + if (properties === "never") { + return; + } + + // Always report underscored object names + if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) { + report(node); + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { + report(node); + + } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) { + report(node); + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { + + if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { + if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) { + report(node); + } + + const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; + + if (nameIsUnderscored && node.parent.computed) { + report(node); + } + + // prevent checking righthand side of destructured object + if (node.parent.key === node && node.parent.value !== node) { + return; + } + + const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // "never" check properties or always ignore destructuring + if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + report(node); + } + + // Check if it's an import specifier + } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) { + + if (node.parent.type === "ImportSpecifier" && ignoreImports) { + return; + } + + // Report only if the local imported identifier is underscored + if ( + node.parent.local && + node.parent.local.name === node.name && + nameIsUnderscored + ) { + report(node); + } + + // Report anything that is underscored that isn't a CallExpression + } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + report(node); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/capitalized-comments.js b/day1/cli-study/node_modules/eslint/lib/rules/capitalized-comments.js new file mode 100644 index 0000000..d7524b8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/capitalized-comments.js @@ -0,0 +1,300 @@ +/** + * @fileoverview enforce or disallow capitalization of the first letter of a comment + * @author Kevin Partington + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const LETTER_PATTERN = require("./utils/patterns/letters"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, + WHITESPACE = /\s/gu, + MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u; // TODO: Combine w/ max-len pattern? + +/* + * Base schema body for defining the basic capitalization rule, ignorePattern, + * and ignoreInlineComments values. + * This can be used in a few different ways in the actual schema. + */ +const SCHEMA_BODY = { + type: "object", + properties: { + ignorePattern: { + type: "string" + }, + ignoreInlineComments: { + type: "boolean" + }, + ignoreConsecutiveComments: { + type: "boolean" + } + }, + additionalProperties: false +}; +const DEFAULTS = { + ignorePattern: "", + ignoreInlineComments: false, + ignoreConsecutiveComments: false +}; + +/** + * Get normalized options for either block or line comments from the given + * user-provided options. + * - If the user-provided options is just a string, returns a normalized + * set of options using default values for all other options. + * - If the user-provided options is an object, then a normalized option + * set is returned. Options specified in overrides will take priority + * over options specified in the main options object, which will in + * turn take priority over the rule's defaults. + * @param {Object|string} rawOptions The user-provided options. + * @param {string} which Either "line" or "block". + * @returns {Object} The normalized options. + */ +function getNormalizedOptions(rawOptions, which) { + return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions); +} + +/** + * Get normalized options for block and line comments. + * @param {Object|string} rawOptions The user-provided options. + * @returns {Object} An object with "Line" and "Block" keys and corresponding + * normalized options objects. + */ +function getAllNormalizedOptions(rawOptions = {}) { + return { + Line: getNormalizedOptions(rawOptions, "line"), + Block: getNormalizedOptions(rawOptions, "block") + }; +} + +/** + * Creates a regular expression for each ignorePattern defined in the rule + * options. + * + * This is done in order to avoid invoking the RegExp constructor repeatedly. + * @param {Object} normalizedOptions The normalized rule options. + * @returns {void} + */ +function createRegExpForIgnorePatterns(normalizedOptions) { + Object.keys(normalizedOptions).forEach(key => { + const ignorePatternStr = normalizedOptions[key].ignorePattern; + + if (ignorePatternStr) { + const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u"); + + normalizedOptions[key].ignorePatternRegExp = regExp; + } + }); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce or disallow capitalization of the first letter of a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/capitalized-comments" + }, + + fixable: "code", + + schema: [ + { enum: ["always", "never"] }, + { + oneOf: [ + SCHEMA_BODY, + { + type: "object", + properties: { + line: SCHEMA_BODY, + block: SCHEMA_BODY + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedLowercaseComment: "Comments should not begin with a lowercase character.", + unexpectedUppercaseComment: "Comments should not begin with an uppercase character." + } + }, + + create(context) { + + const capitalize = context.options[0] || "always", + normalizedOptions = getAllNormalizedOptions(context.options[1]), + sourceCode = context.getSourceCode(); + + createRegExpForIgnorePatterns(normalizedOptions); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks whether a comment is an inline comment. + * + * For the purpose of this rule, a comment is inline if: + * 1. The comment is preceded by a token on the same line; and + * 2. The command is followed by a token on the same line. + * + * Note that the comment itself need not be single-line! + * + * Also, it follows from this definition that only block comments can + * be considered as possibly inline. This is because line comments + * would consume any following tokens on the same line as the comment. + * @param {ASTNode} comment The comment node to check. + * @returns {boolean} True if the comment is an inline comment, false + * otherwise. + */ + function isInlineComment(comment) { + const previousToken = sourceCode.getTokenBefore(comment, { includeComments: true }), + nextToken = sourceCode.getTokenAfter(comment, { includeComments: true }); + + return Boolean( + previousToken && + nextToken && + comment.loc.start.line === previousToken.loc.end.line && + comment.loc.end.line === nextToken.loc.start.line + ); + } + + /** + * Determine if a comment follows another comment. + * @param {ASTNode} comment The comment to check. + * @returns {boolean} True if the comment follows a valid comment. + */ + function isConsecutiveComment(comment) { + const previousTokenOrComment = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return Boolean( + previousTokenOrComment && + ["Block", "Line"].indexOf(previousTokenOrComment.type) !== -1 + ); + } + + /** + * Check a comment to determine if it is valid for this rule. + * @param {ASTNode} comment The comment node to process. + * @param {Object} options The options for checking this comment. + * @returns {boolean} True if the comment is valid, false otherwise. + */ + function isCommentValid(comment, options) { + + // 1. Check for default ignore pattern. + if (DEFAULT_IGNORE_PATTERN.test(comment.value)) { + return true; + } + + // 2. Check for custom ignore pattern. + const commentWithoutAsterisks = comment.value + .replace(/\*/gu, ""); + + if (options.ignorePatternRegExp && options.ignorePatternRegExp.test(commentWithoutAsterisks)) { + return true; + } + + // 3. Check for inline comments. + if (options.ignoreInlineComments && isInlineComment(comment)) { + return true; + } + + // 4. Is this a consecutive comment (and are we tolerating those)? + if (options.ignoreConsecutiveComments && isConsecutiveComment(comment)) { + return true; + } + + // 5. Does the comment start with a possible URL? + if (MAYBE_URL.test(commentWithoutAsterisks)) { + return true; + } + + // 6. Is the initial word character a letter? + const commentWordCharsOnly = commentWithoutAsterisks + .replace(WHITESPACE, ""); + + if (commentWordCharsOnly.length === 0) { + return true; + } + + const firstWordChar = commentWordCharsOnly[0]; + + if (!LETTER_PATTERN.test(firstWordChar)) { + return true; + } + + // 7. Check the case of the initial word character. + const isUppercase = firstWordChar !== firstWordChar.toLocaleLowerCase(), + isLowercase = firstWordChar !== firstWordChar.toLocaleUpperCase(); + + if (capitalize === "always" && isLowercase) { + return false; + } + if (capitalize === "never" && isUppercase) { + return false; + } + + return true; + } + + /** + * Process a comment to determine if it needs to be reported. + * @param {ASTNode} comment The comment node to process. + * @returns {void} + */ + function processComment(comment) { + const options = normalizedOptions[comment.type], + commentValid = isCommentValid(comment, options); + + if (!commentValid) { + const messageId = capitalize === "always" + ? "unexpectedLowercaseComment" + : "unexpectedUppercaseComment"; + + context.report({ + node: null, // Intentionally using loc instead + loc: comment.loc, + messageId, + fix(fixer) { + const match = comment.value.match(LETTER_PATTERN); + + return fixer.replaceTextRange( + + // Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*) + [comment.range[0] + match.index + 2, comment.range[0] + match.index + 3], + capitalize === "always" ? match[0].toLocaleUpperCase() : match[0].toLocaleLowerCase() + ); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(processComment); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/class-methods-use-this.js b/day1/cli-study/node_modules/eslint/lib/rules/class-methods-use-this.js new file mode 100644 index 0000000..2cc5cc4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Rule to enforce that all class methods use 'this'. + * @author Patrick Williams + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce that class methods utilize `this`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/class-methods-use-this" + }, + + schema: [{ + type: "object", + properties: { + exceptMethods: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + missingThis: "Expected 'this' to be used by class {{name}}." + } + }, + create(context) { + const config = Object.assign({}, context.options[0]); + const exceptMethods = new Set(config.exceptMethods || []); + + const stack = []; + + /** + * Initializes the current context to false and pushes it onto the stack. + * These booleans represent whether 'this' has been used in the context. + * @returns {void} + * @private + */ + function enterFunction() { + stack.push(false); + } + + /** + * Check if the node is an instance method + * @param {ASTNode} node node to check + * @returns {boolean} True if its an instance method + * @private + */ + function isInstanceMethod(node) { + return !node.static && node.kind !== "constructor" && node.type === "MethodDefinition"; + } + + /** + * Check if the node is an instance method not excluded by config + * @param {ASTNode} node node to check + * @returns {boolean} True if it is an instance method, and not excluded by config + * @private + */ + function isIncludedInstanceMethod(node) { + return isInstanceMethod(node) && + (node.computed || !exceptMethods.has(node.key.name)); + } + + /** + * Checks if we are leaving a function that is a method, and reports if 'this' has not been used. + * Static methods and the constructor are exempt. + * Then pops the context off the stack. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + * @private + */ + function exitFunction(node) { + const methodUsesThis = stack.pop(); + + if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { + context.report({ + node, + messageId: "missingThis", + data: { + name: astUtils.getFunctionNameWithKind(node) + } + }); + } + } + + /** + * Mark the current context as having used 'this'. + * @returns {void} + * @private + */ + function markThisUsed() { + if (stack.length) { + stack[stack.length - 1] = true; + } + } + + return { + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markThisUsed, + Super: markThisUsed + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/comma-dangle.js b/day1/cli-study/node_modules/eslint/lib/rules/comma-dangle.js new file mode 100644 index 0000000..9ca5efa --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/comma-dangle.js @@ -0,0 +1,341 @@ +/** + * @fileoverview Rule to forbid or enforce dangling commas. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_OPTIONS = Object.freeze({ + arrays: "never", + objects: "never", + imports: "never", + exports: "never", + functions: "never" +}); + +/** + * Checks whether or not a trailing comma is allowed in a given node. + * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas. + * @param {ASTNode} lastItem The node of the last element in the given node. + * @returns {boolean} `true` if a trailing comma is allowed. + */ +function isTrailingCommaAllowed(lastItem) { + return !( + lastItem.type === "RestElement" || + lastItem.type === "RestProperty" || + lastItem.type === "ExperimentalRestProperty" + ); +} + +/** + * Normalize option value. + * @param {string|Object|undefined} optionValue The 1st option value to normalize. + * @param {number} ecmaVersion The normalized ECMAScript version. + * @returns {Object} The normalized option value. + */ +function normalizeOptions(optionValue, ecmaVersion) { + if (typeof optionValue === "string") { + return { + arrays: optionValue, + objects: optionValue, + imports: optionValue, + exports: optionValue, + functions: (!ecmaVersion || ecmaVersion < 8) ? "ignore" : optionValue + }; + } + if (typeof optionValue === "object" && optionValue !== null) { + return { + arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays, + objects: optionValue.objects || DEFAULT_OPTIONS.objects, + imports: optionValue.imports || DEFAULT_OPTIONS.imports, + exports: optionValue.exports || DEFAULT_OPTIONS.exports, + functions: optionValue.functions || DEFAULT_OPTIONS.functions + }; + } + + return DEFAULT_OPTIONS; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow trailing commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-dangle" + }, + + fixable: "code", + + schema: { + definitions: { + value: { + enum: [ + "always-multiline", + "always", + "never", + "only-multiline" + ] + }, + valueWithIgnore: { + enum: [ + "always-multiline", + "always", + "ignore", + "never", + "only-multiline" + ] + } + }, + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + arrays: { $ref: "#/definitions/valueWithIgnore" }, + objects: { $ref: "#/definitions/valueWithIgnore" }, + imports: { $ref: "#/definitions/valueWithIgnore" }, + exports: { $ref: "#/definitions/valueWithIgnore" }, + functions: { $ref: "#/definitions/valueWithIgnore" } + }, + additionalProperties: false + } + ] + } + ], + additionalItems: false + }, + + messages: { + unexpected: "Unexpected trailing comma.", + missing: "Missing trailing comma." + } + }, + + create(context) { + const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); + + const sourceCode = context.getSourceCode(); + + /** + * Gets the last item of the given node. + * @param {ASTNode} node The node to get. + * @returns {ASTNode|null} The last node or null. + */ + function getLastItem(node) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + return lodash.last(node.properties); + case "ArrayExpression": + case "ArrayPattern": + return lodash.last(node.elements); + case "ImportDeclaration": + case "ExportNamedDeclaration": + return lodash.last(node.specifiers); + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + return lodash.last(node.params); + case "CallExpression": + case "NewExpression": + return lodash.last(node.arguments); + default: + return null; + } + } + + /** + * Gets the trailing comma token of the given node. + * If the trailing comma does not exist, this returns the token which is + * the insertion point of the trailing comma token. + * @param {ASTNode} node The node to get. + * @param {ASTNode} lastItem The last item of the node. + * @returns {Token} The trailing comma token or the insertion point. + */ + function getTrailingToken(node, lastItem) { + switch (node.type) { + case "ObjectExpression": + case "ArrayExpression": + case "CallExpression": + case "NewExpression": + return sourceCode.getLastToken(node, 1); + default: { + const nextToken = sourceCode.getTokenAfter(lastItem); + + if (astUtils.isCommaToken(nextToken)) { + return nextToken; + } + return sourceCode.getLastToken(lastItem); + } + } + } + + /** + * Checks whether or not a given node is multiline. + * This rule handles a given node as multiline when the closing parenthesis + * and the last element are not on the same line. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is multiline. + */ + function isMultiline(node) { + const lastItem = getLastItem(node); + + if (!lastItem) { + return false; + } + + const penultimateToken = getTrailingToken(node, lastItem); + const lastToken = sourceCode.getTokenAfter(penultimateToken); + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + /** + * Reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forbidTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (astUtils.isCommaToken(trailingToken)) { + context.report({ + node: lastItem, + loc: trailingToken.loc, + messageId: "unexpected", + fix(fixer) { + return fixer.remove(trailingToken); + } + }); + } + } + + /** + * Reports the last element of a given node if it does not have a trailing + * comma. + * + * If a given node is `ArrayPattern` which has `RestElement`, the trailing + * comma is disallowed, so report if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingComma(node) { + const lastItem = getLastItem(node); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + if (!isTrailingCommaAllowed(lastItem)) { + forbidTrailingComma(node); + return; + } + + const trailingToken = getTrailingToken(node, lastItem); + + if (trailingToken.value !== ",") { + context.report({ + node: lastItem, + loc: { + start: trailingToken.loc.end, + end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(trailingToken, ","); + } + }); + } + } + + /** + * If a given node is multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + /** + * Only if a given node is not multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * @param {ASTNode} node A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + const predicate = { + always: forceTrailingComma, + "always-multiline": forceTrailingCommaIfMultiline, + "only-multiline": allowTrailingCommaIfMultiline, + never: forbidTrailingComma, + ignore: lodash.noop + }; + + return { + ObjectExpression: predicate[options.objects], + ObjectPattern: predicate[options.objects], + + ArrayExpression: predicate[options.arrays], + ArrayPattern: predicate[options.arrays], + + ImportDeclaration: predicate[options.imports], + + ExportNamedDeclaration: predicate[options.exports], + + FunctionDeclaration: predicate[options.functions], + FunctionExpression: predicate[options.functions], + ArrowFunctionExpression: predicate[options.functions], + CallExpression: predicate[options.functions], + NewExpression: predicate[options.functions] + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/comma-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/comma-spacing.js new file mode 100644 index 0000000..73c10a7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/comma-spacing.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Comma spacing - validates spacing before and after comma + * @author Vignesh Anand aka vegetableman. + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after commas", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + missing: "A space is required {{loc}} ','.", + unexpected: "There should be no space {{loc}} ','." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + const tokensAndComments = sourceCode.tokensAndComments; + + const options = { + before: context.options[0] ? context.options[0].before : false, + after: context.options[0] ? context.options[0].after : true + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // list of comma tokens to ignore for the check of leading whitespace + const commaTokensToIgnore = []; + + /** + * Reports a spacing error with an appropriate message. + * @param {ASTNode} node The binary expression node to report. + * @param {string} loc Is the error "before" or "after" the comma? + * @param {ASTNode} otherNode The node at the left or right of `node` + * @returns {void} + * @private + */ + function report(node, loc, otherNode) { + context.report({ + node, + fix(fixer) { + if (options[loc]) { + if (loc === "before") { + return fixer.insertTextBefore(node, " "); + } + return fixer.insertTextAfter(node, " "); + + } + let start, end; + const newText = ""; + + if (loc === "before") { + start = otherNode.range[1]; + end = node.range[0]; + } else { + start = node.range[1]; + end = otherNode.range[0]; + } + + return fixer.replaceTextRange([start, end], newText); + + }, + messageId: options[loc] ? "missing" : "unexpected", + data: { + loc + } + }); + } + + /** + * Validates the spacing around a comma token. + * @param {Object} tokens The tokens to be validated. + * @param {Token} tokens.comma The token representing the comma. + * @param {Token} [tokens.left] The last token before the comma. + * @param {Token} [tokens.right] The first token after the comma. + * @param {Token|ASTNode} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(tokens, reportItem) { + if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && + (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) + ) { + report(reportItem, "before", tokens.left); + } + + if (tokens.right && astUtils.isClosingParenToken(tokens.right)) { + return; + } + + if (tokens.right && !options.after && tokens.right.type === "Line") { + return; + } + + if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && + (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) + ) { + report(reportItem, "after", tokens.right); + } + } + + /** + * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. + * @param {ASTNode} node An ArrayExpression or ArrayPattern node. + * @returns {void} + */ + function addNullElementsToIgnoreList(node) { + let previousToken = sourceCode.getFirstToken(node); + + node.elements.forEach(element => { + let token; + + if (element === null) { + token = sourceCode.getTokenAfter(previousToken); + + if (astUtils.isCommaToken(token)) { + commaTokensToIgnore.push(token); + } + } else { + token = sourceCode.getTokenAfter(element); + } + + previousToken = token; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"() { + tokensAndComments.forEach((token, i) => { + + if (!astUtils.isCommaToken(token)) { + return; + } + + if (token && token.type === "JSXText") { + return; + } + + const previousToken = tokensAndComments[i - 1]; + const nextToken = tokensAndComments[i + 1]; + + validateCommaItemSpacing({ + comma: token, + left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, + right: astUtils.isCommaToken(nextToken) ? null : nextToken + }, token); + }); + }, + ArrayExpression: addNullElementsToIgnoreList, + ArrayPattern: addNullElementsToIgnoreList + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/comma-style.js b/day1/cli-study/node_modules/eslint/lib/rules/comma-style.js new file mode 100644 index 0000000..f1a23d6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/comma-style.js @@ -0,0 +1,310 @@ +/** + * @fileoverview Comma style - enforces comma styles of two types: last and first + * @author Vignesh Anand aka vegetableman + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent comma style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/comma-style" + }, + + fixable: "code", + + schema: [ + { + enum: ["first", "last"] + }, + { + type: "object", + properties: { + exceptions: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLineBeforeAndAfterComma: "Bad line breaking before and after ','.", + expectedCommaFirst: "',' should be placed first.", + expectedCommaLast: "',' should be placed last." + } + }, + + create(context) { + const style = context.options[0] || "last", + sourceCode = context.getSourceCode(); + const exceptions = { + ArrayPattern: true, + ArrowFunctionExpression: true, + CallExpression: true, + FunctionDeclaration: true, + FunctionExpression: true, + ImportDeclaration: true, + ObjectPattern: true, + NewExpression: true + }; + + if (context.options.length === 2 && Object.prototype.hasOwnProperty.call(context.options[1], "exceptions")) { + const keys = Object.keys(context.options[1].exceptions); + + for (let i = 0; i < keys.length; i++) { + exceptions[keys[i]] = context.options[1].exceptions[keys[i]]; + } + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Modified text based on the style + * @param {string} styleType Style type + * @param {string} text Source code text + * @returns {string} modified text + * @private + */ + function getReplacedText(styleType, text) { + switch (styleType) { + case "between": + return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`; + + case "first": + return `${text},`; + + case "last": + return `,${text}`; + + default: + return ""; + } + } + + /** + * Determines the fixer function for a given style. + * @param {string} styleType comma style + * @param {ASTNode} previousItemToken The token to check. + * @param {ASTNode} commaToken The token to check. + * @param {ASTNode} currentItemToken The token to check. + * @returns {Function} Fixer function + * @private + */ + function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { + const text = + sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); + const range = [previousItemToken.range[1], currentItemToken.range[0]]; + + return function(fixer) { + return fixer.replaceTextRange(range, getReplacedText(styleType, text)); + }; + } + + /** + * Validates the spacing around single items in lists. + * @param {Token} previousItemToken The last token from the previous item. + * @param {Token} commaToken The token representing the comma. + * @param {Token} currentItemToken The first token of the current item. + * @param {Token} reportItem The item to use when reporting an error. + * @returns {void} + * @private + */ + function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { + + // if single line + if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + // do nothing. + + } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + + const comment = sourceCode.getCommentsAfter(commaToken)[0]; + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) + ? style + : "between"; + + // lone comma + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "unexpectedLineBeforeAndAfterComma", + fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaFirst", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + + } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { + + context.report({ + node: reportItem, + loc: commaToken.loc, + messageId: "expectedCommaLast", + fix: getFixerFunction(style, previousItemToken, commaToken, currentItemToken) + }); + } + } + + /** + * Checks the comma placement with regards to a declaration/property/element + * @param {ASTNode} node The binary expression node to check + * @param {string} property The property of the node containing child nodes. + * @private + * @returns {void} + */ + function validateComma(node, property) { + const items = node[property], + arrayLiteral = (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + + if (items.length > 1 || arrayLiteral) { + + // seed as opening [ + let previousItemToken = sourceCode.getFirstToken(node); + + items.forEach(item => { + const commaToken = item ? sourceCode.getTokenBefore(item) : previousItemToken, + currentItemToken = item ? sourceCode.getFirstToken(item) : sourceCode.getTokenAfter(commaToken), + reportItem = item || currentItemToken; + + /* + * This works by comparing three token locations: + * - previousItemToken is the last token of the previous item + * - commaToken is the location of the comma before the current item + * - currentItemToken is the first token of the current item + * + * These values get switched around if item is undefined. + * previousItemToken will refer to the last token not belonging + * to the current item, which could be a comma or an opening + * square bracket. currentItemToken could be a comma. + * + * All comparisons are done based on these tokens directly, so + * they are always valid regardless of an undefined item. + */ + if (astUtils.isCommaToken(commaToken)) { + validateCommaItemSpacing(previousItemToken, commaToken, + currentItemToken, reportItem); + } + + if (item) { + const tokenAfterItem = sourceCode.getTokenAfter(item, astUtils.isNotClosingParenToken); + + previousItemToken = tokenAfterItem + ? sourceCode.getTokenBefore(tokenAfterItem) + : sourceCode.ast.tokens[sourceCode.ast.tokens.length - 1]; + } + }); + + /* + * Special case for array literals that have empty last items, such + * as [ 1, 2, ]. These arrays only have two items show up in the + * AST, so we need to look at the token to verify that there's no + * dangling comma. + */ + if (arrayLiteral) { + + const lastToken = sourceCode.getLastToken(node), + nextToLastToken = sourceCode.getTokenBefore(lastToken); + + if (astUtils.isCommaToken(nextToLastToken)) { + validateCommaItemSpacing( + sourceCode.getTokenBefore(nextToLastToken), + nextToLastToken, + lastToken, + lastToken + ); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const nodes = {}; + + if (!exceptions.VariableDeclaration) { + nodes.VariableDeclaration = function(node) { + validateComma(node, "declarations"); + }; + } + if (!exceptions.ObjectExpression) { + nodes.ObjectExpression = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ObjectPattern) { + nodes.ObjectPattern = function(node) { + validateComma(node, "properties"); + }; + } + if (!exceptions.ArrayExpression) { + nodes.ArrayExpression = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.ArrayPattern) { + nodes.ArrayPattern = function(node) { + validateComma(node, "elements"); + }; + } + if (!exceptions.FunctionDeclaration) { + nodes.FunctionDeclaration = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.FunctionExpression) { + nodes.FunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.ArrowFunctionExpression) { + nodes.ArrowFunctionExpression = function(node) { + validateComma(node, "params"); + }; + } + if (!exceptions.CallExpression) { + nodes.CallExpression = function(node) { + validateComma(node, "arguments"); + }; + } + if (!exceptions.ImportDeclaration) { + nodes.ImportDeclaration = function(node) { + validateComma(node, "specifiers"); + }; + } + if (!exceptions.NewExpression) { + nodes.NewExpression = function(node) { + validateComma(node, "arguments"); + }; + } + + return nodes; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/complexity.js b/day1/cli-study/node_modules/eslint/lib/rules/complexity.js new file mode 100644 index 0000000..7fc8bf9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/complexity.js @@ -0,0 +1,160 @@ +/** + * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity. + * Counts the number of if, conditional, for, while, try, switch/case, + * @author Patrick Brosset + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum cyclomatic complexity allowed in a program", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/complexity" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + complex: "{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let THRESHOLD = 20; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store complexity (handling nested functions) + const fns = []; + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + fns.push(1); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + const complexity = fns.pop(); + + if (complexity > THRESHOLD) { + context.report({ + node, + messageId: "complex", + data: { name, complexity, max: THRESHOLD } + }); + } + } + + /** + * Increase the complexity of the function in context + * @returns {void} + * @private + */ + function increaseComplexity() { + if (fns.length) { + fns[fns.length - 1]++; + } + } + + /** + * Increase the switch complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function increaseSwitchComplexity(node) { + + // Avoiding `default` + if (node.test) { + increaseComplexity(); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + CatchClause: increaseComplexity, + ConditionalExpression: increaseComplexity, + LogicalExpression: increaseComplexity, + ForStatement: increaseComplexity, + ForInStatement: increaseComplexity, + ForOfStatement: increaseComplexity, + IfStatement: increaseComplexity, + SwitchCase: increaseSwitchComplexity, + WhileStatement: increaseComplexity, + DoWhileStatement: increaseComplexity + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/computed-property-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/computed-property-spacing.js new file mode 100644 index 0000000..53fdb8f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Disallows or enforces spaces inside computed properties. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside computed property brackets", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/computed-property-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceBefore: "There should be no space before '{{tokenValue}}'.", + unexpectedSpaceAfter: "There should be no space after '{{tokenValue}}'.", + + missingSpaceBefore: "A space is required before '{{tokenValue}}'.", + missingSpaceAfter: "A space is required after '{{tokenValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" + const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenAfter The token after `token`. + * @returns {void} + */ + function reportNoBeginningSpace(node, token, tokenAfter) { + context.report({ + node, + loc: { start: token.loc.end, end: tokenAfter.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @param {Token} tokenBefore The token before `token`. + * @returns {void} + */ + function reportNoEndingSpace(node, token, tokenBefore) { + context.report({ + node, + loc: { start: tokenBefore.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceAfter", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "missingSpaceBefore", + data: { + tokenValue: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Returns a function that checks the spacing of a node on the property name + * that was passed in. + * @param {string} propertyName The property on the node to check for spacing + * @returns {Function} A function that will check spacing on a node + */ + function checkSpacing(propertyName) { + return function(node) { + if (!node.computed) { + return; + } + + const property = node[propertyName]; + + const before = sourceCode.getTokenBefore(property, astUtils.isOpeningBracketToken), + first = sourceCode.getTokenAfter(before, { includeComments: true }), + after = sourceCode.getTokenAfter(property, astUtils.isClosingBracketToken), + last = sourceCode.getTokenBefore(after, { includeComments: true }); + + if (astUtils.isTokenOnSameLine(before, first)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { + reportRequiredBeginningSpace(node, before); + } + } else { + if (sourceCode.isSpaceBetweenTokens(before, first)) { + reportNoBeginningSpace(node, before, first); + } + } + } + + if (astUtils.isTokenOnSameLine(last, after)) { + if (propertyNameMustBeSpaced) { + if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { + reportRequiredEndingSpace(node, after); + } + } else { + if (sourceCode.isSpaceBetweenTokens(last, after)) { + reportNoEndingSpace(node, after, last); + } + } + } + }; + } + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + const listeners = { + Property: checkSpacing("key"), + MemberExpression: checkSpacing("property") + }; + + if (enforceForClassMembers) { + listeners.MethodDefinition = checkSpacing("key"); + } + + return listeners; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/consistent-return.js b/day1/cli-study/node_modules/eslint/lib/rules/consistent-return.js new file mode 100644 index 0000000..22667fa --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/consistent-return.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Rule to flag consistent return values + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is an `Identifier` node which was named a given name. + * @param {ASTNode} node A node to check. + * @param {string} name An expected name of the node. + * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. + */ +function isIdentifier(node, name) { + return node.type === "Identifier" && node.name === name; +} + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * Checks whether a given node is a `constructor` method in an ES6 class + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is a `constructor` method + */ +function isClassConstructor(node) { + return node.type === "FunctionExpression" && + node.parent && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `return` statements to either always or never specify values", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-return" + }, + + schema: [{ + type: "object", + properties: { + treatUndefinedAsUnspecified: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + missingReturn: "Expected to return a value at the end of {{name}}.", + missingReturnValue: "{{name}} expected a return value.", + unexpectedReturnValue: "{{name}} expected no return value." + } + }, + + create(context) { + const options = context.options[0] || {}; + const treatUndefinedAsUnspecified = options.treatUndefinedAsUnspecified === true; + let funcInfo = null; + + /** + * Checks whether of not the implicit returning is consistent if the last + * code path segment is reachable. + * @param {ASTNode} node A program/function node to check. + * @returns {void} + */ + function checkLastSegment(node) { + let loc, name; + + /* + * Skip if it expected no return value or unreachable. + * When unreachable, all paths are returned or thrown. + */ + if (!funcInfo.hasReturnValue || + funcInfo.codePath.currentSegments.every(isUnreachable) || + astUtils.isES5Constructor(node) || + isClassConstructor(node) + ) { + return; + } + + // Adjust a location and a message. + if (node.type === "Program") { + + // The head of program. + loc = { line: 1, column: 0 }; + name = "program"; + } else if (node.type === "ArrowFunctionExpression") { + + // `=>` token + loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc.start; + } else if ( + node.parent.type === "MethodDefinition" || + (node.parent.type === "Property" && node.parent.method) + ) { + + // Method name. + loc = node.parent.key.loc.start; + } else { + + // Function name or `function` keyword. + loc = (node.id || node).loc.start; + } + + if (!name) { + name = astUtils.getFunctionNameWithKind(node); + } + + // Reports. + context.report({ + node, + loc, + messageId: "missingReturn", + data: { name } + }); + } + + return { + + // Initializes/Disposes state of each code path. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + hasReturnValue: false, + messageId: "", + node + }; + }, + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Reports a given return statement if it's inconsistent. + ReturnStatement(node) { + const argument = node.argument; + let hasReturnValue = Boolean(argument); + + if (treatUndefinedAsUnspecified && hasReturnValue) { + hasReturnValue = !isIdentifier(argument, "undefined") && argument.operator !== "void"; + } + + if (!funcInfo.hasReturn) { + funcInfo.hasReturn = true; + funcInfo.hasReturnValue = hasReturnValue; + funcInfo.messageId = hasReturnValue ? "missingReturnValue" : "unexpectedReturnValue"; + funcInfo.data = { + name: funcInfo.node.type === "Program" + ? "Program" + : lodash.upperFirst(astUtils.getFunctionNameWithKind(funcInfo.node)) + }; + } else if (funcInfo.hasReturnValue !== hasReturnValue) { + context.report({ + node, + messageId: funcInfo.messageId, + data: funcInfo.data + }); + } + }, + + // Reports a given program/function if the implicit returning is not consistent. + "Program:exit": checkLastSegment, + "FunctionDeclaration:exit": checkLastSegment, + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/consistent-this.js b/day1/cli-study/node_modules/eslint/lib/rules/consistent-this.js new file mode 100644 index 0000000..e5bc967 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/consistent-this.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce consistent naming of "this" context variables + * @author Raphael Pigulla + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent naming when capturing the current execution context", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/consistent-this" + }, + + schema: { + type: "array", + items: { + type: "string", + minLength: 1 + }, + uniqueItems: true + }, + + messages: { + aliasNotAssignedToThis: "Designated alias '{{name}}' is not assigned to 'this'.", + unexpectedAlias: "Unexpected alias '{{name}}' for 'this'." + } + }, + + create(context) { + let aliases = []; + + if (context.options.length === 0) { + aliases.push("that"); + } else { + aliases = context.options; + } + + /** + * Reports that a variable declarator or assignment expression is assigning + * a non-'this' value to the specified alias. + * @param {ASTNode} node The assigning node. + * @param {string} name the name of the alias that was incorrectly used. + * @returns {void} + */ + function reportBadAssignment(node, name) { + context.report({ node, messageId: "aliasNotAssignedToThis", data: { name } }); + } + + /** + * Checks that an assignment to an identifier only assigns 'this' to the + * appropriate alias, and the alias is only assigned to 'this'. + * @param {ASTNode} node The assigning node. + * @param {Identifier} name The name of the variable assigned to. + * @param {Expression} value The value of the assignment. + * @returns {void} + */ + function checkAssignment(node, name, value) { + const isThis = value.type === "ThisExpression"; + + if (aliases.indexOf(name) !== -1) { + if (!isThis || node.operator && node.operator !== "=") { + reportBadAssignment(node, name); + } + } else if (isThis) { + context.report({ node, messageId: "unexpectedAlias", data: { name } }); + } + } + + /** + * Ensures that a variable declaration of the alias in a program or function + * is assigned to the correct value. + * @param {string} alias alias the check the assignment of. + * @param {Object} scope scope of the current code we are checking. + * @private + * @returns {void} + */ + function checkWasAssigned(alias, scope) { + const variable = scope.set.get(alias); + + if (!variable) { + return; + } + + if (variable.defs.some(def => def.node.type === "VariableDeclarator" && + def.node.init !== null)) { + return; + } + + /* + * The alias has been declared and not assigned: check it was + * assigned later in the same scope. + */ + if (!variable.references.some(reference => { + const write = reference.writeExpr; + + return ( + reference.from === scope && + write && write.type === "ThisExpression" && + write.parent.operator === "=" + ); + })) { + variable.defs.map(def => def.node).forEach(node => { + reportBadAssignment(node, alias); + }); + } + } + + /** + * Check each alias to ensure that is was assigned to the correct value. + * @returns {void} + */ + function ensureWasAssigned() { + const scope = context.getScope(); + + aliases.forEach(alias => { + checkWasAssigned(alias, scope); + }); + } + + return { + "Program:exit": ensureWasAssigned, + "FunctionExpression:exit": ensureWasAssigned, + "FunctionDeclaration:exit": ensureWasAssigned, + + VariableDeclarator(node) { + const id = node.id; + const isDestructuring = + id.type === "ArrayPattern" || id.type === "ObjectPattern"; + + if (node.init !== null && !isDestructuring) { + checkAssignment(node, id.name, node.init); + } + }, + + AssignmentExpression(node) { + if (node.left.type === "Identifier") { + checkAssignment(node, node.left.name, node.right); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/constructor-super.js b/day1/cli-study/node_modules/eslint/lib/rules/constructor-super.js new file mode 100644 index 0000000..5a848f2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/constructor-super.js @@ -0,0 +1,395 @@ +/** + * @fileoverview A rule to verify `super()` callings in constructor. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given code path segment is reachable or not. + * @param {CodePathSegment} segment A code path segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +/** + * Checks whether a given node can be a constructor or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node can be a constructor. + */ +function isPossibleConstructor(node) { + if (!node) { + return false; + } + + switch (node.type) { + case "ClassExpression": + case "FunctionExpression": + case "ThisExpression": + case "MemberExpression": + case "CallExpression": + case "NewExpression": + case "YieldExpression": + case "TaggedTemplateExpression": + case "MetaProperty": + return true; + + case "Identifier": + return node.name !== "undefined"; + + case "AssignmentExpression": + return isPossibleConstructor(node.right); + + case "LogicalExpression": + return ( + isPossibleConstructor(node.left) || + isPossibleConstructor(node.right) + ); + + case "ConditionalExpression": + return ( + isPossibleConstructor(node.alternate) || + isPossibleConstructor(node.consequent) + ); + + case "SequenceExpression": { + const lastExpression = node.expressions[node.expressions.length - 1]; + + return isPossibleConstructor(lastExpression); + } + + default: + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require `super()` calls in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/constructor-super" + }, + + schema: [], + + messages: { + missingSome: "Lacked a call of 'super()' in some code paths.", + missingAll: "Expected to call 'super()'.", + + duplicate: "Unexpected duplicate 'super()'.", + badSuper: "Unexpected 'super()' because 'super' is not a constructor.", + unexpected: "Unexpected 'super()'." + } + }, + + create(context) { + + /* + * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether own class has a valid `extends` + * part. + * - scope: The scope of own class. + * - codePath: The code path object of the constructor. + */ + let funcInfo = null; + + /* + * {Map} + * Information for each code path segment. + * - calledInSomePaths: A flag of be called `super()` in some code paths. + * - calledInEveryPaths: A flag of be called `super()` in all code paths. + * - validNodes: + */ + let segInfoMap = Object.create(null); + + /** + * Gets the flag which shows `super()` is called in some paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in some paths + */ + function isCalledInSomePath(segment) { + return segment.reachable && segInfoMap[segment.id].calledInSomePaths; + } + + /** + * Gets the flag which shows `super()` is called in all paths. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in all paths. + */ + function isCalledInEveryPath(segment) { + + /* + * If specific segment is the looped segment of the current segment, + * skip the segment. + * If not skipped, this never becomes true after a loop. + */ + if (segment.nextSegments.length === 1 && + segment.nextSegments[0].isLoopedPrevSegment(segment) + ) { + return true; + } + return segment.reachable && segInfoMap[segment.id].calledInEveryPaths; + } + + return { + + /** + * Stacks a constructor information. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + const superClass = classNode.superClass; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean(superClass), + superIsConstructor: isPossibleConstructor(superClass), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + superIsConstructor: false, + codePath + }; + } + }, + + /** + * Pops a constructor information. + * And reports if `super()` lacked. + * @param {CodePath} codePath A code path which was ended. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathEnd(codePath, node) { + const hasExtends = funcInfo.hasExtends; + + // Pop. + funcInfo = funcInfo.upper; + + if (!hasExtends) { + return; + } + + // Reports if `super()` lacked. + const segments = codePath.returnedSegments; + const calledInEveryPaths = segments.every(isCalledInEveryPath); + const calledInSomePaths = segments.some(isCalledInSomePath); + + if (!calledInEveryPaths) { + context.report({ + messageId: calledInSomePaths + ? "missingSome" + : "missingAll", + node: node.parent + }); + } + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Initialize info. + const info = segInfoMap[segment.id] = { + calledInSomePaths: false, + calledInEveryPaths: false, + validNodes: [] + }; + + // When there are previous segments, aggregates these. + const prevSegments = segment.prevSegments; + + if (prevSegments.length > 0) { + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + } + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Update information inside of the loop. + const isRealLoop = toSegment.prevSegments.length >= 2; + + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + segment => { + const info = segInfoMap[segment.id]; + const prevSegments = segment.prevSegments; + + // Updates flags. + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + + // If flags become true anew, reports the valid nodes. + if (info.calledInSomePaths || isRealLoop) { + const nodes = info.validNodes; + + info.validNodes = []; + + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + + context.report({ + messageId: "duplicate", + node + }); + } + } + } + ); + }, + + /** + * Checks for a call of `super()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (!(funcInfo && funcInfo.isConstructor)) { + return; + } + + // Skips except `super()`. + if (node.callee.type !== "Super") { + return; + } + + // Reports if needed. + if (funcInfo.hasExtends) { + const segments = funcInfo.codePath.currentSegments; + let duplicate = false; + let info = null; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + info = segInfoMap[segment.id]; + + duplicate = duplicate || info.calledInSomePaths; + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + + if (info) { + if (duplicate) { + context.report({ + messageId: "duplicate", + node + }); + } else if (!funcInfo.superIsConstructor) { + context.report({ + messageId: "badSuper", + node + }); + } else { + info.validNodes.push(node); + } + } + } else if (funcInfo.codePath.currentSegments.some(isReachable)) { + context.report({ + messageId: "unexpected", + node + }); + } + }, + + /** + * Set the mark to the returned path as `super()` was called. + * @param {ASTNode} node A ReturnStatement node to check. + * @returns {void} + */ + ReturnStatement(node) { + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { + return; + } + + // Skips if no argument. + if (!node.argument) { + return; + } + + // Returning argument is a substitute of 'super()'. + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + const info = segInfoMap[segment.id]; + + info.calledInSomePaths = info.calledInEveryPaths = true; + } + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/curly.js b/day1/cli-study/node_modules/eslint/lib/rules/curly.js new file mode 100644 index 0000000..92d31a6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/curly.js @@ -0,0 +1,495 @@ +/** + * @fileoverview Rule to flag statements without curly braces + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent brace style for all control statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/curly" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["all"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["multi", "multi-line", "multi-or-nest"] + }, + { + enum: ["consistent"] + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + + messages: { + missingCurlyAfter: "Expected { after '{{name}}'.", + missingCurlyAfterCondition: "Expected { after '{{name}}' condition.", + unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.", + unexpectedCurlyAfterCondition: "Unnecessary { after '{{name}}' condition." + } + }, + + create(context) { + + const multiOnly = (context.options[0] === "multi"); + const multiLine = (context.options[0] === "multi-line"); + const multiOrNest = (context.options[0] === "multi-or-nest"); + const consistent = (context.options[1] === "consistent"); + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines if a given node is a one-liner that's on the same line as it's preceding code. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code. + * @private + */ + function isCollapsedOneLiner(node) { + const before = sourceCode.getTokenBefore(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return before.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if a given node is a one-liner. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner. + * @private + */ + function isOneLiner(node) { + if (node.type === "EmptyStatement") { + return true; + } + + const first = sourceCode.getFirstToken(node); + const last = sourceCode.getLastToken(node); + const lastExcludingSemicolon = astUtils.isSemicolonToken(last) ? sourceCode.getTokenBefore(last) : last; + + return first.loc.start.line === lastExcludingSemicolon.loc.end.line; + } + + /** + * Determines if the given node is a lexical declaration (let, const, function, or class) + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lexical declaration + * @private + */ + function isLexicalDeclaration(node) { + if (node.type === "VariableDeclaration") { + return node.kind === "const" || node.kind === "let"; + } + + return node.type === "FunctionDeclaration" || node.type === "ClassDeclaration"; + } + + /** + * Checks if the given token is an `else` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an `else` token. + */ + function isElseKeywordToken(token) { + return token.value === "else" && token.type === "Keyword"; + } + + /** + * Gets the `else` keyword token of a given `IfStatement` node. + * @param {ASTNode} node A `IfStatement` node to get. + * @returns {Token} The `else` keyword token. + */ + function getElseKeyword(node) { + return node.alternate && sourceCode.getFirstTokenBetween(node.consequent, node.alternate, isElseKeywordToken); + } + + /** + * Determines whether the given node has an `else` keyword token as the first token after. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is followed by an `else` keyword token. + */ + function isFollowedByElseKeyword(node) { + const nextToken = sourceCode.getTokenAfter(node); + + return Boolean(nextToken) && isElseKeywordToken(nextToken); + } + + /** + * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError. + * @param {Token} closingBracket The } token + * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block. + */ + function needsSemicolon(closingBracket) { + const tokenBefore = sourceCode.getTokenBefore(closingBracket); + const tokenAfter = sourceCode.getTokenAfter(closingBracket); + const lastBlockNode = sourceCode.getNodeByRangeIndex(tokenBefore.range[0]); + + if (astUtils.isSemicolonToken(tokenBefore)) { + + // If the last statement already has a semicolon, don't add another one. + return false; + } + + if (!tokenAfter) { + + // If there are no statements after this block, there is no need to add a semicolon. + return false; + } + + if (lastBlockNode.type === "BlockStatement" && lastBlockNode.parent.type !== "FunctionExpression" && lastBlockNode.parent.type !== "ArrowFunctionExpression") { + + /* + * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression), + * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause + * a SyntaxError if it was followed by `else`. + */ + return false; + } + + if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) { + + // If the next token is on the same line, insert a semicolon. + return true; + } + + if (/^[([/`+-]/u.test(tokenAfter.value)) { + + // If the next token starts with a character that would disrupt ASI, insert a semicolon. + return true; + } + + if (tokenBefore.type === "Punctuator" && (tokenBefore.value === "++" || tokenBefore.value === "--")) { + + // If the last token is ++ or --, insert a semicolon to avoid disrupting ASI. + return true; + } + + // Otherwise, do not insert a semicolon. + return false; + } + + /** + * Determines whether the code represented by the given node contains an `if` statement + * that would become associated with an `else` keyword directly appended to that code. + * + * Examples where it returns `true`: + * + * if (a) + * foo(); + * + * if (a) { + * foo(); + * } + * + * if (a) + * foo(); + * else if (b) + * bar(); + * + * while (a) + * if (b) + * if(c) + * foo(); + * else + * bar(); + * + * Examples where it returns `false`: + * + * if (a) + * foo(); + * else + * bar(); + * + * while (a) { + * if (b) + * if(c) + * foo(); + * else + * bar(); + * } + * + * while (a) + * if (b) { + * if(c) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node Node representing the code to check. + * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code. + */ + function hasUnsafeIf(node) { + switch (node.type) { + case "IfStatement": + if (!node.alternate) { + return true; + } + return hasUnsafeIf(node.alternate); + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + case "LabeledStatement": + case "WithStatement": + case "WhileStatement": + return hasUnsafeIf(node.body); + default: + return false; + } + } + + /** + * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code. + * The braces, which make the given block body, are necessary in either of the following situations: + * + * 1. The statement is a lexical declaration. + * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace: + * + * if (a) { + * if (b) + * foo(); + * } + * else + * bar(); + * + * if (a) + * while (b) + * while (c) { + * while (d) + * if (e) + * while(f) + * foo(); + * } + * else + * bar(); + * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements. + * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content) + * would change the semantics of the code or produce a syntax error. + */ + function areBracesNecessary(node) { + const statement = node.body[0]; + + return isLexicalDeclaration(statement) || + hasUnsafeIf(statement) && isFollowedByElseKeyword(node); + } + + /** + * Prepares to check the body of a node to see if it's a block statement. + * @param {ASTNode} node The node to report if there's a problem. + * @param {ASTNode} body The body node to check for blocks. + * @param {string} name The name to report if there's a problem. + * @param {{ condition: boolean }} opts Options to pass to the report functions + * @returns {Object} a prepared check object, with "actual", "expected", "check" properties. + * "actual" will be `true` or `false` whether the body is already a block statement. + * "expected" will be `true` or `false` if the body should be a block statement or not, or + * `null` if it doesn't matter, depending on the rule options. It can be modified to change + * the final behavior of "check". + * "check" will be a function reporting appropriate problems depending on the other + * properties. + */ + function prepareCheck(node, body, name, opts) { + const hasBlock = (body.type === "BlockStatement"); + let expected = null; + + if (hasBlock && (body.body.length !== 1 || areBracesNecessary(body))) { + expected = true; + } else if (multiOnly) { + expected = false; + } else if (multiLine) { + if (!isCollapsedOneLiner(body)) { + expected = true; + } + + // otherwise, the body is allowed to have braces or not to have braces + + } else if (multiOrNest) { + if (hasBlock) { + const statement = body.body[0]; + const leadingCommentsInBlock = sourceCode.getCommentsBefore(statement); + + expected = !isOneLiner(statement) || leadingCommentsInBlock.length > 0; + } else { + expected = !isOneLiner(body); + } + } else { + + // default "all" + expected = true; + } + + return { + actual: hasBlock, + expected, + check() { + if (this.expected !== null && this.expected !== this.actual) { + if (this.expected) { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "missingCurlyAfterCondition" : "missingCurlyAfter", + data: { + name + }, + fix: fixer => fixer.replaceText(body, `{${sourceCode.getText(body)}}`) + }); + } else { + context.report({ + node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + messageId: opts && opts.condition ? "unexpectedCurlyAfterCondition" : "unexpectedCurlyAfter", + data: { + name + }, + fix(fixer) { + + /* + * `do while` expressions sometimes need a space to be inserted after `do`. + * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)` + */ + const needsPrecedingSpace = node.type === "DoWhileStatement" && + sourceCode.getTokenBefore(body).range[1] === body.range[0] && + !astUtils.canTokensBeAdjacent("do", sourceCode.getFirstToken(body, { skip: 1 })); + + const openingBracket = sourceCode.getFirstToken(body); + const closingBracket = sourceCode.getLastToken(body); + const lastTokenInBlock = sourceCode.getTokenBefore(closingBracket); + + if (needsSemicolon(closingBracket)) { + + /* + * If removing braces would cause a SyntaxError due to multiple statements on the same line (or + * change the semantics of the code due to ASI), don't perform a fix. + */ + return null; + } + + const resultingBodyText = sourceCode.getText().slice(openingBracket.range[1], lastTokenInBlock.range[0]) + + sourceCode.getText(lastTokenInBlock) + + sourceCode.getText().slice(lastTokenInBlock.range[1], closingBracket.range[0]); + + return fixer.replaceText(body, (needsPrecedingSpace ? " " : "") + resultingBodyText); + } + }); + } + } + } + }; + } + + /** + * Prepares to check the bodies of a "if", "else if" and "else" chain. + * @param {ASTNode} node The first IfStatement node of the chain. + * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more + * information. + */ + function prepareIfChecks(node) { + const preparedChecks = []; + + for (let currentNode = node; currentNode; currentNode = currentNode.alternate) { + preparedChecks.push(prepareCheck(currentNode, currentNode.consequent, "if", { condition: true })); + if (currentNode.alternate && currentNode.alternate.type !== "IfStatement") { + preparedChecks.push(prepareCheck(currentNode, currentNode.alternate, "else")); + break; + } + } + + if (consistent) { + + /* + * If any node should have or already have braces, make sure they + * all have braces. + * If all nodes shouldn't have braces, make sure they don't. + */ + const expected = preparedChecks.some(preparedCheck => { + if (preparedCheck.expected !== null) { + return preparedCheck.expected; + } + return preparedCheck.actual; + }); + + preparedChecks.forEach(preparedCheck => { + preparedCheck.expected = expected; + }); + } + + return preparedChecks; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + IfStatement(node) { + const parent = node.parent; + const isElseIf = parent.type === "IfStatement" && parent.alternate === node; + + if (!isElseIf) { + + // This is a top `if`, check the whole `if-else-if` chain + prepareIfChecks(node).forEach(preparedCheck => { + preparedCheck.check(); + }); + } + + // Skip `else if`, it's already checked (when the top `if` was visited) + }, + + WhileStatement(node) { + prepareCheck(node, node.body, "while", { condition: true }).check(); + }, + + DoWhileStatement(node) { + prepareCheck(node, node.body, "do").check(); + }, + + ForStatement(node) { + prepareCheck(node, node.body, "for", { condition: true }).check(); + }, + + ForInStatement(node) { + prepareCheck(node, node.body, "for-in").check(); + }, + + ForOfStatement(node) { + prepareCheck(node, node.body, "for-of").check(); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/default-case-last.js b/day1/cli-study/node_modules/eslint/lib/rules/default-case-last.js new file mode 100644 index 0000000..80c5d6b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/default-case-last.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to enforce default clauses in switch statements to be last + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default clauses in switch statements to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case-last" + }, + + schema: [], + + messages: { + notLast: "Default clause should be the last clause." + } + }, + + create(context) { + return { + SwitchStatement(node) { + const cases = node.cases, + indexOfDefault = cases.findIndex(c => c.test === null); + + if (indexOfDefault !== -1 && indexOfDefault !== cases.length - 1) { + const defaultClause = cases[indexOfDefault]; + + context.report({ node: defaultClause, messageId: "notLast" }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/default-case.js b/day1/cli-study/node_modules/eslint/lib/rules/default-case.js new file mode 100644 index 0000000..821e0d7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/default-case.js @@ -0,0 +1,97 @@ +/** + * @fileoverview require default case in switch statements + * @author Aliaksei Shytkin + */ +"use strict"; + +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `default` cases in `switch` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-case" + }, + + schema: [{ + type: "object", + properties: { + commentPattern: { + type: "string" + } + }, + additionalProperties: false + }], + + messages: { + missingDefaultCase: "Expected a default case." + } + }, + + create(context) { + const options = context.options[0] || {}; + const commentPattern = options.commentPattern + ? new RegExp(options.commentPattern, "u") + : DEFAULT_COMMENT_PATTERN; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Shortcut to get last element of array + * @param {*[]} collection Array + * @returns {*} Last element + */ + function last(collection) { + return collection[collection.length - 1]; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + SwitchStatement(node) { + + if (!node.cases.length) { + + /* + * skip check of empty switch because there is no easy way + * to extract comments inside it now + */ + return; + } + + const hasDefault = node.cases.some(v => v.test === null); + + if (!hasDefault) { + + let comment; + + const lastCase = last(node.cases); + const comments = sourceCode.getCommentsAfter(lastCase); + + if (comments.length) { + comment = last(comments); + } + + if (!comment || !commentPattern.test(comment.value.trim())) { + context.report({ node, messageId: "missingDefaultCase" }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/default-param-last.js b/day1/cli-study/node_modules/eslint/lib/rules/default-param-last.js new file mode 100644 index 0000000..12e0b59 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/default-param-last.js @@ -0,0 +1,62 @@ +/** + * @fileoverview enforce default parameters to be last + * @author Chiawen Chen + */ + +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce default parameters to be last", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/default-param-last" + }, + + schema: [], + + messages: { + shouldBeLast: "Default parameters should be last." + } + }, + + create(context) { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + let hasSeenPlainParam = false; + + for (let i = node.params.length - 1; i >= 0; i -= 1) { + const param = node.params[i]; + + if ( + param.type !== "AssignmentPattern" && + param.type !== "RestElement" + ) { + hasSeenPlainParam = true; + continue; + } + + if (hasSeenPlainParam && param.type === "AssignmentPattern") { + context.report({ + node: param, + messageId: "shouldBeLast" + }); + } + } + } + + return { + FunctionDeclaration: handleFunction, + FunctionExpression: handleFunction, + ArrowFunctionExpression: handleFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/dot-location.js b/day1/cli-study/node_modules/eslint/lib/rules/dot-location.js new file mode 100644 index 0000000..d483e21 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/dot-location.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Validates newlines before and after dots + * @author Greg Cochard + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent newlines before and after dots", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-location" + }, + + schema: [ + { + enum: ["object", "property"] + } + ], + + fixable: "code", + + messages: { + expectedDotAfterObject: "Expected dot to be on same line as object.", + expectedDotBeforeProperty: "Expected dot to be on same line as property." + } + }, + + create(context) { + + const config = context.options[0]; + + // default to onObject if no preference is passed + const onObject = config === "object" || !config; + + const sourceCode = context.getSourceCode(); + + /** + * Reports if the dot between object and property is on the correct loccation. + * @param {ASTNode} node The `MemberExpression` node. + * @returns {void} + */ + function checkDotLocation(node) { + const property = node.property; + const dot = sourceCode.getTokenBefore(property); + + // `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node. + const tokenBeforeDot = sourceCode.getTokenBefore(dot); + + const textBeforeDot = sourceCode.getText().slice(tokenBeforeDot.range[1], dot.range[0]); + const textAfterDot = sourceCode.getText().slice(dot.range[1], property.range[0]); + + if (onObject) { + if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dot)) { + const neededTextAfterToken = astUtils.isDecimalIntegerNumericToken(tokenBeforeDot) ? " " : ""; + + context.report({ + node, + loc: dot.loc, + messageId: "expectedDotAfterObject", + fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], property.range[0]], `${neededTextAfterToken}.${textBeforeDot}${textAfterDot}`) + }); + } + } else if (!astUtils.isTokenOnSameLine(dot, property)) { + context.report({ + node, + loc: dot.loc, + messageId: "expectedDotBeforeProperty", + fix: fixer => fixer.replaceTextRange([tokenBeforeDot.range[1], property.range[0]], `${textBeforeDot}${textAfterDot}.`) + }); + } + } + + /** + * Checks the spacing of the dot within a member expression. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + if (!node.computed) { + checkDotLocation(node); + } + } + + return { + MemberExpression: checkNode + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/dot-notation.js b/day1/cli-study/node_modules/eslint/lib/rules/dot-notation.js new file mode 100644 index 0000000..2e8fff8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/dot-notation.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. + * @author Josh Perez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; + +// `null` literal must be handled separately. +const literalTypesToCheck = new Set(["string", "boolean"]); + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce dot notation whenever possible", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/dot-notation" + }, + + schema: [ + { + type: "object", + properties: { + allowKeywords: { + type: "boolean", + default: true + }, + allowPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + useDot: "[{{key}}] is better written in dot notation.", + useBrackets: ".{{key}} is a syntax error." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowKeywords = options.allowKeywords === void 0 || options.allowKeywords; + const sourceCode = context.getSourceCode(); + + let allowPattern; + + if (options.allowPattern) { + allowPattern = new RegExp(options.allowPattern, "u"); + } + + /** + * Check if the property is valid dot notation + * @param {ASTNode} node The dot notation node + * @param {string} value Value which is to be checked + * @returns {void} + */ + function checkComputedProperty(node, value) { + if ( + validIdentifier.test(value) && + (allowKeywords || keywords.indexOf(String(value)) === -1) && + !(allowPattern && allowPattern.test(value)) + ) { + const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; + + context.report({ + node: node.property, + messageId: "useDot", + data: { + key: formattedValue + }, + fix(fixer) { + const leftBracket = sourceCode.getTokenAfter(node.object, astUtils.isOpeningBracketToken); + const rightBracket = sourceCode.getLastToken(node); + + if (sourceCode.getFirstTokenBetween(leftBracket, rightBracket, { includeComments: true, filter: astUtils.isCommentToken })) { + + // Don't perform any fixes if there are comments inside the brackets. + return null; + } + + const tokenAfterProperty = sourceCode.getTokenAfter(rightBracket); + const needsSpaceAfterProperty = tokenAfterProperty && + rightBracket.range[1] === tokenAfterProperty.range[0] && + !astUtils.canTokensBeAdjacent(String(value), tokenAfterProperty); + + const textBeforeDot = astUtils.isDecimalInteger(node.object) ? " " : ""; + const textAfterProperty = needsSpaceAfterProperty ? " " : ""; + + return fixer.replaceTextRange( + [leftBracket.range[0], rightBracket.range[1]], + `${textBeforeDot}.${value}${textAfterProperty}` + ); + } + }); + } + } + + return { + MemberExpression(node) { + if ( + node.computed && + node.property.type === "Literal" && + (literalTypesToCheck.has(typeof node.property.value) || astUtils.isNullLiteral(node.property)) + ) { + checkComputedProperty(node, node.property.value); + } + if ( + node.computed && + node.property.type === "TemplateLiteral" && + node.property.expressions.length === 0 + ) { + checkComputedProperty(node, node.property.quasis[0].value.cooked); + } + if ( + !allowKeywords && + !node.computed && + keywords.indexOf(String(node.property.name)) !== -1 + ) { + context.report({ + node: node.property, + messageId: "useBrackets", + data: { + key: node.property.name + }, + fix(fixer) { + const dot = sourceCode.getTokenBefore(node.property); + const textAfterDot = sourceCode.text.slice(dot.range[1], node.property.range[0]); + + if (textAfterDot.trim()) { + + // Don't perform any fixes if there are comments between the dot and the property name. + return null; + } + + if (node.object.type === "Identifier" && node.object.name === "let") { + + /* + * A statement that starts with `let[` is parsed as a destructuring variable declaration, not + * a MemberExpression. + */ + return null; + } + + return fixer.replaceTextRange( + [dot.range[0], node.property.range[1]], + `[${textAfterDot}"${node.property.name}"]` + ); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/eol-last.js b/day1/cli-study/node_modules/eslint/lib/rules/eol-last.js new file mode 100644 index 0000000..fbba6c8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/eol-last.js @@ -0,0 +1,112 @@ +/** + * @fileoverview Require or disallow newline at the end of files + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newline at the end of files", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/eol-last" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "unix", "windows"] + } + ], + + messages: { + missing: "Newline required at end of file but not found.", + unexpected: "Newline not allowed at end of file." + } + }, + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkBadEOF(node) { + const sourceCode = context.getSourceCode(), + src = sourceCode.getText(), + location = { + column: lodash.last(sourceCode.lines).length, + line: sourceCode.lines.length + }, + LF = "\n", + CRLF = `\r${LF}`, + endsWithNewline = lodash.endsWith(src, LF); + + /* + * Empty source is always valid: No content in file so we don't + * need to lint for a newline on the last line of content. + */ + if (!src.length) { + return; + } + + let mode = context.options[0] || "always", + appendCRLF = false; + + if (mode === "unix") { + + // `"unix"` should behave exactly as `"always"` + mode = "always"; + } + if (mode === "windows") { + + // `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility + mode = "always"; + appendCRLF = true; + } + if (mode === "always" && !endsWithNewline) { + + // File is not newline-terminated, but should be + context.report({ + node, + loc: location, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfterRange([0, src.length], appendCRLF ? CRLF : LF); + } + }); + } else if (mode === "never" && endsWithNewline) { + + // File is newline-terminated, but shouldn't be + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + const finalEOLs = /(?:\r?\n)+$/u, + match = finalEOLs.exec(sourceCode.text), + start = match.index, + end = sourceCode.text.length; + + return fixer.replaceTextRange([start, end], ""); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/eqeqeq.js b/day1/cli-study/node_modules/eslint/lib/rules/eqeqeq.js new file mode 100644 index 0000000..57926db --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/eqeqeq.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Rule to flag statements that use != and == instead of !== and === + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require the use of `===` and `!==`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/eqeqeq" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + null: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ], + additionalItems: false + }, + { + type: "array", + items: [ + { + enum: ["smart", "allow-null"] + } + ], + additionalItems: false + } + ] + }, + + fixable: "code", + + messages: { + unexpected: "Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'." + } + }, + + create(context) { + const config = context.options[0] || "always"; + const options = context.options[1] || {}; + const sourceCode = context.getSourceCode(); + + const nullOption = (config === "always") + ? options.null || "always" + : "ignore"; + const enforceRuleForNull = (nullOption === "always"); + const enforceInverseRuleForNull = (nullOption === "never"); + + /** + * Checks if an expression is a typeof expression + * @param {ASTNode} node The node to check + * @returns {boolean} if the node is a typeof expression + */ + function isTypeOf(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + /** + * Checks if either operand of a binary expression is a typeof operation + * @param {ASTNode} node The node to check + * @returns {boolean} if one of the operands is typeof + * @private + */ + function isTypeOfBinary(node) { + return isTypeOf(node.left) || isTypeOf(node.right); + } + + /** + * Checks if operands are literals of the same type (via typeof) + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are of same type + * @private + */ + function areLiteralsAndSameType(node) { + return node.left.type === "Literal" && node.right.type === "Literal" && + typeof node.left.value === typeof node.right.value; + } + + /** + * Checks if one of the operands is a literal null + * @param {ASTNode} node The node to check + * @returns {boolean} if operands are null + * @private + */ + function isNullCheck(node) { + return astUtils.isNullLiteral(node.right) || astUtils.isNullLiteral(node.left); + } + + /** + * Reports a message for this rule. + * @param {ASTNode} node The binary expression node that was checked + * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==') + * @returns {void} + * @private + */ + function report(node, expectedOperator) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpected", + data: { expectedOperator, actualOperator: node.operator }, + fix(fixer) { + + // If the comparison is a `typeof` comparison or both sides are literals with the same type, then it's safe to fix. + if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) { + return fixer.replaceText(operatorToken, expectedOperator); + } + return null; + } + }); + } + + return { + BinaryExpression(node) { + const isNull = isNullCheck(node); + + if (node.operator !== "==" && node.operator !== "!=") { + if (enforceInverseRuleForNull && isNull) { + report(node, node.operator.slice(0, -1)); + } + return; + } + + if (config === "smart" && (isTypeOfBinary(node) || + areLiteralsAndSameType(node) || isNull)) { + return; + } + + if (!enforceRuleForNull && isNull) { + return; + } + + report(node, `${node.operator}=`); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/for-direction.js b/day1/cli-study/node_modules/eslint/lib/rules/for-direction.js new file mode 100644 index 0000000..c15d10e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/for-direction.js @@ -0,0 +1,126 @@ +/** + * @fileoverview enforce "for" loop update clause moving the counter in the right direction.(for-direction) + * @author Aladdin-ADD + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce \"for\" loop update clause moving the counter in the right direction.", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/for-direction" + }, + + fixable: null, + schema: [], + + messages: { + incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." + } + }, + + create(context) { + + /** + * report an error. + * @param {ASTNode} node the node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "incorrectDirection" + }); + } + + /** + * check the right side of the assignment + * @param {ASTNode} update UpdateExpression to check + * @param {int} dir expected direction that could either be turned around or invalidated + * @returns {int} return dir, the negated dir or zero if it's not clear for identifiers + */ + function getRightDirection(update, dir) { + if (update.right.type === "UnaryExpression") { + if (update.right.operator === "-") { + return -dir; + } + } else if (update.right.type === "Identifier") { + return 0; + } + return dir; + } + + /** + * check UpdateExpression add/sub the counter + * @param {ASTNode} update UpdateExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getUpdateDirection(update, counter) { + if (update.argument.type === "Identifier" && update.argument.name === counter) { + if (update.operator === "++") { + return 1; + } + if (update.operator === "--") { + return -1; + } + } + return 0; + } + + /** + * check AssignmentExpression add/sub the counter + * @param {ASTNode} update AssignmentExpression to check + * @param {string} counter variable name to check + * @returns {int} if add return 1, if sub return -1, if nochange, return 0 + */ + function getAssignmentDirection(update, counter) { + if (update.left.name === counter) { + if (update.operator === "+=") { + return getRightDirection(update, 1); + } + if (update.operator === "-=") { + return getRightDirection(update, -1); + } + } + return 0; + } + return { + ForStatement(node) { + + if (node.test && node.test.type === "BinaryExpression" && node.test.left.type === "Identifier" && node.update) { + const counter = node.test.left.name; + const operator = node.test.operator; + const update = node.update; + + let wrongDirection; + + if (operator === "<" || operator === "<=") { + wrongDirection = -1; + } else if (operator === ">" || operator === ">=") { + wrongDirection = 1; + } else { + return; + } + + if (update.type === "UpdateExpression") { + if (getUpdateDirection(update, counter) === wrongDirection) { + report(node); + } + } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { + report(node); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/func-call-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/func-call-spacing.js new file mode 100644 index 0000000..5ecb63e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/func-call-spacing.js @@ -0,0 +1,194 @@ +/** + * @fileoverview Rule to control spacing within function calls + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between function identifiers and their invocations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-call-spacing" + }, + + fixable: "whitespace", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + allowNewlines: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpectedWhitespace: "Unexpected whitespace between function name and paren.", + unexpectedNewline: "Unexpected newline between function name and paren.", + missing: "Missing space between function name and paren." + } + }, + + create(context) { + + const never = context.options[0] !== "always"; + const allowNewlines = !never && context.options[1] && context.options[1].allowNewlines; + const sourceCode = context.getSourceCode(); + const text = sourceCode.getText(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee. + * @param {Token} rightToken Tha first token of the arguments. this is the opening parenthesis that encloses the arguments. + * @returns {void} + * @private + */ + function checkSpacing(node, leftToken, rightToken) { + const textBetweenTokens = text.slice(leftToken.range[1], rightToken.range[0]).replace(/\/\*.*?\*\//gu, ""); + const hasWhitespace = /\s/u.test(textBetweenTokens); + const hasNewline = hasWhitespace && astUtils.LINEBREAK_MATCHER.test(textBetweenTokens); + + /* + * never allowNewlines hasWhitespace hasNewline message + * F F F F Missing space between function name and paren. + * F F F T (Invalid `!hasWhitespace && hasNewline`) + * F F T T Unexpected newline between function name and paren. + * F F T F (OK) + * F T T F (OK) + * F T T T (OK) + * F T F T (Invalid `!hasWhitespace && hasNewline`) + * F T F F Missing space between function name and paren. + * T T F F (Invalid `never && allowNewlines`) + * T T F T (Invalid `!hasWhitespace && hasNewline`) + * T T T T (Invalid `never && allowNewlines`) + * T T T F (Invalid `never && allowNewlines`) + * T F T F Unexpected space between function name and paren. + * T F T T Unexpected space between function name and paren. + * T F F T (Invalid `!hasWhitespace && hasNewline`) + * T F F F (OK) + * + * T T Unexpected space between function name and paren. + * F F Missing space between function name and paren. + * F F T Unexpected newline between function name and paren. + */ + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: { + line: rightToken.loc.start.line, + column: rightToken.loc.start.column - 1 + } + }, + messageId: "unexpectedWhitespace", + fix(fixer) { + + /* + * Only autofix if there is no newline + * https://github.com/eslint/eslint/issues/7787 + */ + if (!hasNewline) { + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + + return null; + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: { + line: leftToken.loc.end.line, + column: leftToken.loc.end.column - 1 + }, + end: rightToken.loc.start + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextBefore(rightToken, " "); + } + }); + } else if (!never && !allowNewlines && hasNewline) { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedNewline", + fix(fixer) { + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " "); + } + }); + } + } + + return { + "CallExpression, NewExpression"(node) { + const lastToken = sourceCode.getLastToken(node); + const lastCalleeToken = sourceCode.getLastToken(node.callee); + const parenToken = sourceCode.getFirstTokenBetween(lastCalleeToken, lastToken, astUtils.isOpeningParenToken); + const prevToken = parenToken && sourceCode.getTokenBefore(parenToken); + + // Parens in NewExpression are optional + if (!(parenToken && parenToken.range[1] < node.range[1])) { + return; + } + + checkSpacing(node, prevToken, parenToken); + }, + + ImportExpression(node) { + const leftToken = sourceCode.getFirstToken(node); + const rightToken = sourceCode.getTokenAfter(leftToken); + + checkSpacing(node, leftToken, rightToken); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/func-name-matching.js b/day1/cli-study/node_modules/eslint/lib/rules/func-name-matching.js new file mode 100644 index 0000000..83430ff --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/func-name-matching.js @@ -0,0 +1,252 @@ +/** + * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned. + * @author Annie Zhang, Pavel Strashkin + */ + +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); +const esutils = require("esutils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines if a pattern is `module.exports` or `module["exports"]` + * @param {ASTNode} pattern The left side of the AssignmentExpression + * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]` + */ +function isModuleExports(pattern) { + if (pattern.type === "MemberExpression" && pattern.object.type === "Identifier" && pattern.object.name === "module") { + + // module.exports + if (pattern.property.type === "Identifier" && pattern.property.name === "exports") { + return true; + } + + // module["exports"] + if (pattern.property.type === "Literal" && pattern.property.value === "exports") { + return true; + } + } + return false; +} + +/** + * Determines if a string name is a valid identifier + * @param {string} name The string to be checked + * @param {int} ecmaVersion The ECMAScript version if specified in the parserOptions config + * @returns {boolean} True if the string is a valid identifier + */ +function isIdentifier(name, ecmaVersion) { + if (ecmaVersion >= 6) { + return esutils.keyword.isIdentifierES6(name); + } + return esutils.keyword.isIdentifierES5(name); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const alwaysOrNever = { enum: ["always", "never"] }; +const optionsObject = { + type: "object", + properties: { + considerPropertyDescriptor: { + type: "boolean" + }, + includeCommonJSModuleExports: { + type: "boolean" + } + }, + additionalProperties: false +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require function names to match the name of the variable or property to which they are assigned", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-name-matching" + }, + + schema: { + anyOf: [{ + type: "array", + additionalItems: false, + items: [alwaysOrNever, optionsObject] + }, { + type: "array", + additionalItems: false, + items: [optionsObject] + }] + }, + + messages: { + matchProperty: "Function name `{{funcName}}` should match property name `{{name}}`.", + matchVariable: "Function name `{{funcName}}` should match variable name `{{name}}`.", + notMatchProperty: "Function name `{{funcName}}` should not match property name `{{name}}`.", + notMatchVariable: "Function name `{{funcName}}` should not match variable name `{{name}}`." + } + }, + + create(context) { + const options = (typeof context.options[0] === "object" ? context.options[0] : context.options[1]) || {}; + const nameMatches = typeof context.options[0] === "string" ? context.options[0] : "always"; + const considerPropertyDescriptor = options.considerPropertyDescriptor; + const includeModuleExports = options.includeCommonJSModuleExports; + const ecmaVersion = context.parserOptions && context.parserOptions.ecmaVersion ? context.parserOptions.ecmaVersion : 5; + + /** + * Check whether node is a certain CallExpression. + * @param {string} objName object name + * @param {string} funcName function name + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if node matches CallExpression + */ + function isPropertyCall(objName, funcName, node) { + if (!node) { + return false; + } + return node.type === "CallExpression" && + node.callee.type === "MemberExpression" && + node.callee.object.name === objName && + node.callee.property.name === funcName; + } + + /** + * Compares identifiers based on the nameMatches option + * @param {string} x the first identifier + * @param {string} y the second identifier + * @returns {boolean} whether the two identifiers should warn. + */ + function shouldWarn(x, y) { + return (nameMatches === "always" && x !== y) || (nameMatches === "never" && x === y); + } + + /** + * Reports + * @param {ASTNode} node The node to report + * @param {string} name The variable or property name + * @param {string} funcName The function name + * @param {boolean} isProp True if the reported node is a property assignment + * @returns {void} + */ + function report(node, name, funcName, isProp) { + let messageId; + + if (nameMatches === "always" && isProp) { + messageId = "matchProperty"; + } else if (nameMatches === "always") { + messageId = "matchVariable"; + } else if (isProp) { + messageId = "notMatchProperty"; + } else { + messageId = "notMatchVariable"; + } + context.report({ + node, + messageId, + data: { + name, + funcName + } + }); + } + + /** + * Determines whether a given node is a string literal + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a string literal + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator(node) { + if (!node.init || node.init.type !== "FunctionExpression" || node.id.type !== "Identifier") { + return; + } + if (node.init.id && shouldWarn(node.id.name, node.init.id.name)) { + report(node, node.id.name, node.init.id.name, false); + } + }, + + AssignmentExpression(node) { + if ( + node.right.type !== "FunctionExpression" || + (node.left.computed && node.left.property.type !== "Literal") || + (!includeModuleExports && isModuleExports(node.left)) || + (node.left.type !== "Identifier" && node.left.type !== "MemberExpression") + ) { + return; + } + + const isProp = node.left.type === "MemberExpression"; + const name = isProp ? astUtils.getStaticPropertyName(node.left) : node.left.name; + + if (node.right.id && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { + report(node, name, node.right.id.name, isProp); + } + }, + + Property(node) { + if (node.value.type !== "FunctionExpression" || !node.value.id || node.computed && !isStringLiteral(node.key)) { + return; + } + + if (node.key.type === "Identifier") { + const functionName = node.value.id.name; + let propertyName = node.key.name; + + if (considerPropertyDescriptor && propertyName === "value") { + if (isPropertyCall("Object", "defineProperty", node.parent.parent) || isPropertyCall("Reflect", "defineProperty", node.parent.parent)) { + const property = node.parent.parent.arguments[1]; + + if (isStringLiteral(property) && shouldWarn(property.value, functionName)) { + report(node, property.value, functionName, true); + } + } else if (isPropertyCall("Object", "defineProperties", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (isPropertyCall("Object", "create", node.parent.parent.parent.parent)) { + propertyName = node.parent.parent.key.name; + if (!node.parent.parent.computed && shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + } else if (shouldWarn(propertyName, functionName)) { + report(node, propertyName, functionName, true); + } + return; + } + + if ( + isStringLiteral(node.key) && + isIdentifier(node.key.value, ecmaVersion) && + shouldWarn(node.key.value, node.value.id.name) + ) { + report(node, node.key.value, node.value.id.name, true); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/func-names.js b/day1/cli-study/node_modules/eslint/lib/rules/func-names.js new file mode 100644 index 0000000..ecfedb9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/func-names.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Rule to warn when a function expression does not have a name. + * @author Kyle T. Nunery + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow named `function` expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-names" + }, + + schema: { + definitions: { + value: { + enum: [ + "always", + "as-needed", + "never" + ] + } + }, + items: [ + { + $ref: "#/definitions/value" + }, + { + type: "object", + properties: { + generators: { + $ref: "#/definitions/value" + } + }, + additionalProperties: false + } + ] + }, + + messages: { + unnamed: "Unexpected unnamed {{name}}.", + named: "Unexpected named {{name}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the config option for the given node. + * @param {ASTNode} node A node to get the config for. + * @returns {string} The config option. + */ + function getConfigForNode(node) { + if ( + node.generator && + context.options.length > 1 && + context.options[1].generators + ) { + return context.options[1].generators; + } + + return context.options[0] || "always"; + } + + /** + * Determines whether the current FunctionExpression node is a get, set, or + * shorthand method in an object literal or a class. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a get, set, or shorthand method. + */ + function isObjectOrClassMethod(node) { + const parent = node.parent; + + return (parent.type === "MethodDefinition" || ( + parent.type === "Property" && ( + parent.method || + parent.kind === "get" || + parent.kind === "set" + ) + )); + } + + /** + * Determines whether the current FunctionExpression node has a name that would be + * inferred from context in a conforming ES6 environment. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node would have a name assigned automatically. + */ + function hasInferredName(node) { + const parent = node.parent; + + return isObjectOrClassMethod(node) || + (parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) || + (parent.type === "Property" && parent.value === node) || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) || + (parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node); + } + + /** + * Reports that an unnamed function should be named + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedUnnamedFunction(node) { + context.report({ + node, + messageId: "unnamed", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * Reports that a named function should be unnamed + * @param {ASTNode} node The node to report in the event of an error. + * @returns {void} + */ + function reportUnexpectedNamedFunction(node) { + context.report({ + node, + messageId: "named", + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + + /** + * The listener for function nodes. + * @param {ASTNode} node function node + * @returns {void} + */ + function handleFunction(node) { + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + const hasName = Boolean(node.id && node.id.name); + const config = getConfigForNode(node); + + if (config === "never") { + if (hasName && node.type !== "FunctionDeclaration") { + reportUnexpectedNamedFunction(node); + } + } else if (config === "as-needed") { + if (!hasName && !hasInferredName(node)) { + reportUnexpectedUnnamedFunction(node); + } + } else { + if (!hasName && !isObjectOrClassMethod(node)) { + reportUnexpectedUnnamedFunction(node); + } + } + } + + return { + "FunctionExpression:exit": handleFunction, + "ExportDefaultDeclaration > FunctionDeclaration": handleFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/func-style.js b/day1/cli-study/node_modules/eslint/lib/rules/func-style.js new file mode 100644 index 0000000..e150b1a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/func-style.js @@ -0,0 +1,98 @@ +/** + * @fileoverview Rule to enforce a particular function style + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of either `function` declarations or expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/func-style" + }, + + schema: [ + { + enum: ["declaration", "expression"] + }, + { + type: "object", + properties: { + allowArrowFunctions: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expression: "Expected a function expression.", + declaration: "Expected a function declaration." + } + }, + + create(context) { + + const style = context.options[0], + allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions, + enforceDeclarations = (style === "declaration"), + stack = []; + + const nodesToCheck = { + FunctionDeclaration(node) { + stack.push(false); + + if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") { + context.report({ node, messageId: "expression" }); + } + }, + "FunctionDeclaration:exit"() { + stack.pop(); + }, + + FunctionExpression(node) { + stack.push(false); + + if (enforceDeclarations && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }, + "FunctionExpression:exit"() { + stack.pop(); + }, + + ThisExpression() { + if (stack.length > 0) { + stack[stack.length - 1] = true; + } + } + }; + + if (!allowArrowFunctions) { + nodesToCheck.ArrowFunctionExpression = function() { + stack.push(false); + }; + + nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { + const hasThisExpr = stack.pop(); + + if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { + context.report({ node: node.parent, messageId: "declaration" }); + } + }; + } + + return nodesToCheck; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/function-call-argument-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/function-call-argument-newline.js new file mode 100644 index 0000000..b6abbe9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce line breaks between arguments of a function call + * @author Alexey Gonchar + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce line breaks between arguments of a function call", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-call-argument-newline" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never", "consistent"] + } + ], + + messages: { + unexpectedLineBreak: "There should be no line break here.", + missingLineBreak: "There should be a line break after this argument." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const checkers = { + unexpected: { + messageId: "unexpectedLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line !== currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], " ") + }, + missing: { + messageId: "missingLineBreak", + check: (prevToken, currentToken) => prevToken.loc.end.line === currentToken.loc.start.line, + createFix: (token, tokenBefore) => fixer => + fixer.replaceTextRange([tokenBefore.range[1], token.range[0]], "\n") + } + }; + + /** + * Check all arguments for line breaks in the CallExpression + * @param {CallExpression} node node to evaluate + * @param {{ messageId: string, check: Function }} checker selected checker + * @returns {void} + * @private + */ + function checkArguments(node, checker) { + for (let i = 1; i < node.arguments.length; i++) { + const prevArgToken = sourceCode.getLastToken(node.arguments[i - 1]); + const currentArgToken = sourceCode.getFirstToken(node.arguments[i]); + + if (checker.check(prevArgToken, currentArgToken)) { + const tokenBefore = sourceCode.getTokenBefore( + currentArgToken, + { includeComments: true } + ); + + const hasLineCommentBefore = tokenBefore.type === "Line"; + + context.report({ + node, + loc: { + start: tokenBefore.loc.end, + end: currentArgToken.loc.start + }, + messageId: checker.messageId, + fix: hasLineCommentBefore ? null : checker.createFix(currentArgToken, tokenBefore) + }); + } + } + } + + /** + * Check if open space is present in a function name + * @param {CallExpression} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if (node.arguments.length < 2) { + return; + } + + const option = context.options[0] || "always"; + + if (option === "never") { + checkArguments(node, checkers.unexpected); + } else if (option === "always") { + checkArguments(node, checkers.missing); + } else if (option === "consistent") { + const firstArgToken = sourceCode.getLastToken(node.arguments[0]); + const secondArgToken = sourceCode.getFirstToken(node.arguments[1]); + + if (firstArgToken.loc.end.line === secondArgToken.loc.start.line) { + checkArguments(node, checkers.unexpected); + } else { + checkArguments(node, checkers.missing); + } + } + } + + return { + CallExpression: check, + NewExpression: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/function-paren-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/function-paren-newline.js new file mode 100644 index 0000000..894c8e3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/function-paren-newline.js @@ -0,0 +1,281 @@ +/** + * @fileoverview enforce consistent line breaks inside function parentheses + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside function parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/function-paren-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consistent", "multiline", "multiline-arguments"] + }, + { + type: "object", + properties: { + minItems: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + expectedBefore: "Expected newline before ')'.", + expectedAfter: "Expected newline after '('.", + expectedBetween: "Expected newline between arguments/params.", + unexpectedBefore: "Unexpected newline before ')'.", + unexpectedAfter: "Unexpected newline after '('." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const rawOption = context.options[0] || "multiline"; + const multilineOption = rawOption === "multiline"; + const multilineArgumentsOption = rawOption === "multiline-arguments"; + const consistentOption = rawOption === "consistent"; + let minItems; + + if (typeof rawOption === "object") { + minItems = rawOption.minItems; + } else if (rawOption === "always") { + minItems = 0; + } else if (rawOption === "never") { + minItems = Infinity; + } else { + minItems = null; + } + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Determines whether there should be newlines inside function parens + * @param {ASTNode[]} elements The arguments or parameters in the list + * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code. + * @returns {boolean} `true` if there should be newlines inside the function parens + */ + function shouldHaveNewlines(elements, hasLeftNewline) { + if (multilineArgumentsOption && elements.length === 1) { + return hasLeftNewline; + } + if (multilineOption || multilineArgumentsOption) { + return elements.some((element, index) => index !== elements.length - 1 && element.loc.end.line !== elements[index + 1].loc.start.line); + } + if (consistentOption) { + return hasLeftNewline; + } + return elements.length >= minItems; + } + + /** + * Validates parens + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateParens(parens, elements) { + const leftParen = parens.leftParen; + const rightParen = parens.rightParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const hasRightNewline = !astUtils.isTokenOnSameLine(tokenBeforeRightParen, rightParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + if (hasLeftNewline && !needsNewlines) { + context.report({ + node: leftParen, + messageId: "unexpectedAfter", + fix(fixer) { + return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim() + + // If there is a comment between the ( and the first element, don't do a fix. + ? null + : fixer.removeRange([leftParen.range[1], tokenAfterLeftParen.range[0]]); + } + }); + } else if (!hasLeftNewline && needsNewlines) { + context.report({ + node: leftParen, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(leftParen, "\n") + }); + } + + if (hasRightNewline && !needsNewlines) { + context.report({ + node: rightParen, + messageId: "unexpectedBefore", + fix(fixer) { + return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim() + + // If there is a comment between the last element and the ), don't do a fix. + ? null + : fixer.removeRange([tokenBeforeRightParen.range[1], rightParen.range[0]]); + } + }); + } else if (!hasRightNewline && needsNewlines) { + context.report({ + node: rightParen, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(rightParen, "\n") + }); + } + } + + /** + * Validates a list of arguments or parameters + * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token + * @param {ASTNode[]} elements The arguments or parameters in the list + * @returns {void} + */ + function validateArguments(parens, elements) { + const leftParen = parens.leftParen; + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen); + const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen); + const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline); + + for (let i = 0; i <= elements.length - 2; i++) { + const currentElement = elements[i]; + const nextElement = elements[i + 1]; + const hasNewLine = currentElement.loc.end.line !== nextElement.loc.start.line; + + if (!hasNewLine && needsNewlines) { + context.report({ + node: currentElement, + messageId: "expectedBetween", + fix: fixer => fixer.insertTextBefore(nextElement, "\n") + }); + } + } + } + + /** + * Gets the left paren and right paren tokens of a node. + * @param {ASTNode} node The node with parens + * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token. + * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression + * with a single parameter) + */ + function getParenTokens(node) { + switch (node.type) { + case "NewExpression": + if (!node.arguments.length && !( + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, { skip: 1 })) && + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) + )) { + + // If the NewExpression does not have parens (e.g. `new Foo`), return null. + return null; + } + + // falls through + + case "CallExpression": + return { + leftParen: sourceCode.getTokenAfter(node.callee, astUtils.isOpeningParenToken), + rightParen: sourceCode.getLastToken(node) + }; + + case "FunctionDeclaration": + case "FunctionExpression": { + const leftParen = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const rightParen = node.params.length + ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken) + : sourceCode.getTokenAfter(leftParen); + + return { leftParen, rightParen }; + } + + case "ArrowFunctionExpression": { + const firstToken = sourceCode.getFirstToken(node); + + if (!astUtils.isOpeningParenToken(firstToken)) { + + // If the ArrowFunctionExpression has a single param without parens, return null. + return null; + } + + return { + leftParen: firstToken, + rightParen: sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken) + }; + } + + case "ImportExpression": { + const leftParen = sourceCode.getFirstToken(node, 1); + const rightParen = sourceCode.getLastToken(node); + + return { leftParen, rightParen }; + } + + default: + throw new TypeError(`unexpected node with type ${node.type}`); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + [[ + "ArrowFunctionExpression", + "CallExpression", + "FunctionDeclaration", + "FunctionExpression", + "ImportExpression", + "NewExpression" + ]](node) { + const parens = getParenTokens(node); + let params; + + if (node.type === "ImportExpression") { + params = [node.source]; + } else if (astUtils.isFunction(node)) { + params = node.params; + } else { + params = node.arguments; + } + + if (parens) { + validateParens(parens, params); + + if (multilineArgumentsOption) { + validateArguments(parens, params); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/generator-star-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/generator-star-spacing.js new file mode 100644 index 0000000..65534f7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -0,0 +1,206 @@ +/** + * @fileoverview Rule to check the spacing around the * in generator functions. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const OVERRIDE_SCHEMA = { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing around `*` operators in generator functions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/generator-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" }, + named: OVERRIDE_SCHEMA, + anonymous: OVERRIDE_SCHEMA, + method: OVERRIDE_SCHEMA + }, + additionalProperties: false + } + ] + } + ], + + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + + const optionDefinitions = { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }; + + /** + * Returns resolved option definitions based on an option and defaults + * @param {any} option The option object or string value + * @param {Object} defaults The defaults to use if options are not present + * @returns {Object} the resolved object definition + */ + function optionToDefinition(option, defaults) { + if (!option) { + return defaults; + } + + return typeof option === "string" + ? optionDefinitions[option] + : Object.assign({}, defaults, option); + } + + const modes = (function(option) { + const defaults = optionToDefinition(option, optionDefinitions.before); + + return { + named: optionToDefinition(option.named, defaults), + anonymous: optionToDefinition(option.anonymous, defaults), + method: optionToDefinition(option.method, defaults) + }; + }(context.options[0] || {})); + + const sourceCode = context.getSourceCode(); + + /** + * Checks if the given token is a star token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a star token. + */ + function isStarToken(token) { + return token.value === "*" && token.type === "Punctuator"; + } + + /** + * Gets the generator star token of the given function node. + * @param {ASTNode} node The function node to get. + * @returns {Token} Found star token. + */ + function getStarToken(node) { + return sourceCode.getFirstToken( + (node.parent.method || node.parent.type === "MethodDefinition") ? node.parent : node, + isStarToken + ); + } + + /** + * capitalize a given string. + * @param {string} str the given string. + * @returns {string} the capitalized string. + */ + function capitalize(str) { + return str[0].toUpperCase() + str.slice(1); + } + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} kind Either "named", "anonymous", or "method" + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(kind, side, leftToken, rightToken) { + if (!!(rightToken.range[0] - leftToken.range[1]) !== modes[kind][side]) { + const after = leftToken.value === "*"; + const spaceRequired = modes[kind][side]; + const node = after ? leftToken : rightToken; + const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`; + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a generator function. + * @param {ASTNode} node A function expression or declaration node. + * @returns {void} + */ + function checkFunction(node) { + if (!node.generator) { + return; + } + + const starToken = getStarToken(node); + const prevToken = sourceCode.getTokenBefore(starToken); + const nextToken = sourceCode.getTokenAfter(starToken); + + let kind = "named"; + + if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) { + kind = "method"; + } else if (!node.id) { + kind = "anonymous"; + } + + // Only check before when preceded by `function`|`static` keyword + if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) { + checkSpacing(kind, "before", prevToken, starToken); + } + + checkSpacing(kind, "after", starToken, nextToken); + } + + return { + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/getter-return.js b/day1/cli-study/node_modules/eslint/lib/rules/getter-return.js new file mode 100644 index 0000000..c54ebfb --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/getter-return.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Enforces that a return statement is present in property getters. + * @author Aladdin-ADD(hh_2013@foxmail.com) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ +const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; + +/** + * Checks a given code path segment is reachable. + * @param {CodePathSegment} segment A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce `return` statements in getters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/getter-return" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowImplicit: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + expected: "Expected to return a value in {{name}}.", + expectedAlways: "Expected {{name}} to always return a value." + } + }, + + create(context) { + + const options = context.options[0] || { allowImplicit: false }; + const sourceCode = context.getSourceCode(); + + let funcInfo = { + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false, + node: null + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + if (funcInfo.shouldCheck && + funcInfo.codePath.currentSegments.some(isReachable) + ) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: funcInfo.hasReturn ? "expectedAlways" : "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + + /** + * Checks whether a node means a getter function. + * @param {ASTNode} node a node to check. + * @returns {boolean} if node means a getter, return true; else return false. + */ + function isGetter(node) { + const parent = node.parent; + + if (TARGET_NODE_TYPE.test(node.type) && node.body.type === "BlockStatement") { + if (parent.kind === "get") { + return true; + } + if (parent.type === "Property" && astUtils.getStaticPropertyName(parent) === "get" && parent.parent.type === "ObjectExpression") { + + // Object.defineProperty() + if (parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.callee) === "defineProperty") { + return true; + } + + // Object.defineProperties() + if (parent.parent.parent.type === "Property" && + parent.parent.parent.parent.type === "ObjectExpression" && + parent.parent.parent.parent.parent.type === "CallExpression" && + astUtils.getStaticPropertyName(parent.parent.parent.parent.parent.callee) === "defineProperties") { + return true; + } + } + } + return false; + } + return { + + // Stacks this function's information. + onCodePathStart(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath, + hasReturn: false, + shouldCheck: isGetter(node), + node + }; + }, + + // Pops this function's information. + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + ReturnStatement(node) { + if (funcInfo.shouldCheck) { + funcInfo.hasReturn = true; + + // if allowImplicit: false, should also check node.argument + if (!options.allowImplicit && !node.argument) { + context.report({ + node, + messageId: "expected", + data: { + name: astUtils.getFunctionNameWithKind(funcInfo.node) + } + }); + } + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/global-require.js b/day1/cli-study/node_modules/eslint/lib/rules/global-require.js new file mode 100644 index 0000000..469c017 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/global-require.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Rule for disallowing require() outside of the top-level module context + * @author Jamund Ferguson + */ + +"use strict"; + +const ACCEPTABLE_PARENTS = [ + "AssignmentExpression", + "VariableDeclarator", + "MemberExpression", + "ExpressionStatement", + "CallExpression", + "ConditionalExpression", + "Program", + "VariableDeclaration" +]; + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + /* istanbul ignore else: correctly returns null */ + if (references.length === 1) { + return references[0]; + } + return null; + +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {ASTNode} node The identifier node to check. + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require `require()` calls to be placed at top-level module scope", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/global-require" + }, + + schema: [], + messages: { + unexpected: "Unexpected require()." + } + }, + + create(context) { + return { + CallExpression(node) { + const currentScope = context.getScope(); + + if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { + const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); + + if (!isGoodRequire) { + context.report({ node, messageId: "unexpected" }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/day1/cli-study/node_modules/eslint/lib/rules/grouped-accessor-pairs.js new file mode 100644 index 0000000..a790f83 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -0,0 +1,224 @@ +/** + * @fileoverview Rule to require grouped accessor pairs in object literals and classes + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Property name if it can be computed statically, otherwise the list of the tokens of the key node. + * @typedef {string|Token[]} Key + */ + +/** + * Accessor nodes with the same key. + * @typedef {Object} AccessorData + * @property {Key} key Accessor's key + * @property {ASTNode[]} getters List of getter nodes. + * @property {ASTNode[]} setters List of setter nodes. + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not the given lists represent the equal tokens in the same order. + * Tokens are compared by their properties, not by instance. + * @param {Token[]} left First list of tokens. + * @param {Token[]} right Second list of tokens. + * @returns {boolean} `true` if the lists have same tokens. + */ +function areEqualTokenLists(left, right) { + if (left.length !== right.length) { + return false; + } + + for (let i = 0; i < left.length; i++) { + const leftToken = left[i], + rightToken = right[i]; + + if (leftToken.type !== rightToken.type || leftToken.value !== rightToken.value) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not the given keys are equal. + * @param {Key} left First key. + * @param {Key} right Second key. + * @returns {boolean} `true` if the keys are equal. + */ +function areEqualKeys(left, right) { + if (typeof left === "string" && typeof right === "string") { + + // Statically computed names. + return left === right; + } + if (Array.isArray(left) && Array.isArray(right)) { + + // Token lists. + return areEqualTokenLists(left, right); + } + + return false; +} + +/** + * Checks whether or not a given node is of an accessor kind ('get' or 'set'). + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is of an accessor kind. + */ +function isAccessorKind(node) { + return node.kind === "get" || node.kind === "set"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require grouped accessor pairs in object literals and classes", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/grouped-accessor-pairs" + }, + + schema: [ + { + enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] + } + ], + + messages: { + notGrouped: "Accessor pair {{ formerName }} and {{ latterName }} should be grouped.", + invalidOrder: "Expected {{ latterName }} to be before {{ formerName }}." + } + }, + + create(context) { + const order = context.options[0] || "anyOrder"; + const sourceCode = context.getSourceCode(); + + /** + * Reports the given accessor pair. + * @param {string} messageId messageId to report. + * @param {ASTNode} formerNode getter/setter node that is defined before `latterNode`. + * @param {ASTNode} latterNode getter/setter node that is defined after `formerNode`. + * @returns {void} + * @private + */ + function report(messageId, formerNode, latterNode) { + context.report({ + node: latterNode, + messageId, + loc: astUtils.getFunctionHeadLoc(latterNode.value, sourceCode), + data: { + formerName: astUtils.getFunctionNameWithKind(formerNode.value), + latterName: astUtils.getFunctionNameWithKind(latterNode.value) + } + }); + } + + /** + * Creates a new `AccessorData` object for the given getter or setter node. + * @param {ASTNode} node A getter or setter node. + * @returns {AccessorData} New `AccessorData` object that contains the given node. + * @private + */ + function createAccessorData(node) { + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + return { + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }; + } + + /** + * Merges the given `AccessorData` object into the given accessors list. + * @param {AccessorData[]} accessors The list to merge into. + * @param {AccessorData} accessorData The object to merge. + * @returns {AccessorData[]} The same instance with the merged object. + * @private + */ + function mergeAccessorData(accessors, accessorData) { + const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); + + if (equalKeyElement) { + equalKeyElement.getters.push(...accessorData.getters); + equalKeyElement.setters.push(...accessorData.setters); + } else { + accessors.push(accessorData); + } + + return accessors; + } + + /** + * Checks accessor pairs in the given list of nodes. + * @param {ASTNode[]} nodes The list to check. + * @param {Function} shouldCheck – Predicate that returns `true` if the node should be checked. + * @returns {void} + * @private + */ + function checkList(nodes, shouldCheck) { + const accessors = nodes + .filter(shouldCheck) + .filter(isAccessorKind) + .map(createAccessorData) + .reduce(mergeAccessorData, []); + + for (const { getters, setters } of accessors) { + + // Don't report accessor properties that have duplicate getters or setters. + if (getters.length === 1 && setters.length === 1) { + const [getter] = getters, + [setter] = setters, + getterIndex = nodes.indexOf(getter), + setterIndex = nodes.indexOf(setter), + formerNode = getterIndex < setterIndex ? getter : setter, + latterNode = getterIndex < setterIndex ? setter : getter; + + if (Math.abs(getterIndex - setterIndex) > 1) { + report("notGrouped", formerNode, latterNode); + } else if ( + (order === "getBeforeSet" && getterIndex > setterIndex) || + (order === "setBeforeGet" && getterIndex < setterIndex) + ) { + report("invalidOrder", formerNode, latterNode); + } + } + } + } + + return { + ObjectExpression(node) { + checkList(node.properties, n => n.type === "Property"); + }, + ClassBody(node) { + checkList(node.body, n => n.type === "MethodDefinition" && !n.static); + checkList(node.body, n => n.type === "MethodDefinition" && n.static); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/guard-for-in.js b/day1/cli-study/node_modules/eslint/lib/rules/guard-for-in.js new file mode 100644 index 0000000..2c0976d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/guard-for-in.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag for-in loops without if statements inside + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `for-in` loops to include an `if` statement", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/guard-for-in" + }, + + schema: [], + messages: { + wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." + } + }, + + create(context) { + + return { + + ForInStatement(node) { + const body = node.body; + + // empty statement + if (body.type === "EmptyStatement") { + return; + } + + // if statement + if (body.type === "IfStatement") { + return; + } + + // empty block + if (body.type === "BlockStatement" && body.body.length === 0) { + return; + } + + // block with just if statement + if (body.type === "BlockStatement" && body.body.length === 1 && body.body[0].type === "IfStatement") { + return; + } + + // block that starts with if statement + if (body.type === "BlockStatement" && body.body.length >= 1 && body.body[0].type === "IfStatement") { + const i = body.body[0]; + + // ... whose consequent is a continue + if (i.consequent.type === "ContinueStatement") { + return; + } + + // ... whose consequent is a block that contains only a continue + if (i.consequent.type === "BlockStatement" && i.consequent.body.length === 1 && i.consequent.body[0].type === "ContinueStatement") { + return; + } + } + + context.report({ node, messageId: "wrap" }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/handle-callback-err.js b/day1/cli-study/node_modules/eslint/lib/rules/handle-callback-err.js new file mode 100644 index 0000000..b92490a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/handle-callback-err.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Ensure handling of errors when we know they exist. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "require error handling in callbacks", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/handle-callback-err" + }, + + schema: [ + { + type: "string" + } + ], + messages: { + expected: "Expected error to be handled." + } + }, + + create(context) { + + const errorArgument = context.options[0] || "err"; + + /** + * Checks if the given argument should be interpreted as a regexp pattern. + * @param {string} stringToCheck The string which should be checked. + * @returns {boolean} Whether or not the string should be interpreted as a pattern. + */ + function isPattern(stringToCheck) { + const firstChar = stringToCheck[0]; + + return firstChar === "^"; + } + + /** + * Checks if the given name matches the configured error argument. + * @param {string} name The name which should be compared. + * @returns {boolean} Whether or not the given name matches the configured error variable name. + */ + function matchesConfiguredErrorName(name) { + if (isPattern(errorArgument)) { + const regexp = new RegExp(errorArgument, "u"); + + return regexp.test(name); + } + return name === errorArgument; + } + + /** + * Get the parameters of a given function scope. + * @param {Object} scope The function scope. + * @returns {Array} All parameters of the given scope. + */ + function getParameters(scope) { + return scope.variables.filter(variable => variable.defs[0] && variable.defs[0].type === "Parameter"); + } + + /** + * Check to see if we're handling the error object properly. + * @param {ASTNode} node The AST node to check. + * @returns {void} + */ + function checkForError(node) { + const scope = context.getScope(), + parameters = getParameters(scope), + firstParameter = parameters[0]; + + if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { + if (firstParameter.references.length === 0) { + context.report({ node, messageId: "expected" }); + } + } + } + + return { + FunctionDeclaration: checkForError, + FunctionExpression: checkForError, + ArrowFunctionExpression: checkForError + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/id-blacklist.js b/day1/cli-study/node_modules/eslint/lib/rules/id-blacklist.js new file mode 100644 index 0000000..d77a35d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/id-blacklist.js @@ -0,0 +1,230 @@ +/** + * @fileoverview Rule that warns when identifier names that are + * blacklisted in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given node represents assignment target in a normal assignment or destructuring. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is assignment target. + */ +function isAssignmentTarget(node) { + const parent = node.parent; + + return ( + + // normal assignment + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // destructuring + parent.type === "ArrayPattern" || + parent.type === "RestElement" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Checks whether the given node represents an imported name that is renamed in the same import/export specifier. + * + * Examples: + * import { a as b } from 'mod'; // node `a` is renamed import + * export { a as b } from 'mod'; // node `a` is renamed import + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed import. + */ +function isRenamedImport(node) { + const parent = node.parent; + + return ( + ( + parent.type === "ImportSpecifier" && + parent.imported !== parent.local && + parent.imported === node + ) || + ( + parent.type === "ExportSpecifier" && + parent.parent.source && // re-export + parent.local !== parent.exported && + parent.local === node + ) + ); +} + +/** + * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring. + * + * Examples: + * const { a : b } = foo; // node `a` is renamed node. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring. + */ +function isRenamedInDestructuring(node) { + const parent = node.parent; + + return ( + ( + !parent.computed && + parent.type === "Property" && + parent.parent.type === "ObjectPattern" && + parent.value !== node && + parent.key === node + ) + ); +} + +/** + * Checks whether the given node represents shorthand definition of a property in an object literal. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a shorthand property definition. + */ +function isShorthandPropertyDefinition(node) { + const parent = node.parent; + + return ( + parent.type === "Property" && + parent.parent.type === "ObjectExpression" && + parent.shorthand + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-blacklist" + }, + + schema: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + messages: { + blacklisted: "Identifier '{{name}}' is blacklisted." + } + }, + + create(context) { + + const blacklist = new Set(context.options); + const reportedNodes = new Set(); + + let globalScope; + + /** + * Checks whether the given name is blacklisted. + * @param {string} name The name to check. + * @returns {boolean} `true` if the name is blacklisted. + * @private + */ + function isBlacklisted(name) { + return blacklist.has(name); + } + + /** + * Checks whether the given node represents a reference to a global variable that is not declared in the source code. + * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} `true` if the node is a reference to a global variable. + */ + function isReferenceToGlobalVariable(node) { + const variable = globalScope.set.get(node.name); + + return variable && variable.defs.length === 0 && + variable.references.some(ref => ref.identifier === node); + } + + /** + * Determines whether the given node should be checked. + * @param {ASTNode} node `Identifier` node. + * @returns {boolean} `true` if the node should be checked. + */ + function shouldCheck(node) { + const parent = node.parent; + + /* + * Member access has special rules for checking property names. + * Read access to a property with a blacklisted name is allowed, because it can be on an object that user has no control over. + * Write access isn't allowed, because it potentially creates a new property with a blacklisted name. + */ + if ( + parent.type === "MemberExpression" && + parent.property === node && + !parent.computed + ) { + return isAssignmentTarget(parent); + } + + return ( + parent.type !== "CallExpression" && + parent.type !== "NewExpression" && + !isRenamedImport(node) && + !isRenamedInDestructuring(node) && + !( + isReferenceToGlobalVariable(node) && + !isShorthandPropertyDefinition(node) + ) + ); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reportedNodes.has(node)) { + context.report({ + node, + messageId: "blacklisted", + data: { + name: node.name + } + }); + reportedNodes.add(node); + } + } + + return { + + Program() { + globalScope = context.getScope(); + }, + + Identifier(node) { + if (isBlacklisted(node.name) && shouldCheck(node)) { + report(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/id-length.js b/day1/cli-study/node_modules/eslint/lib/rules/id-length.js new file mode 100644 index 0000000..a68873a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/id-length.js @@ -0,0 +1,132 @@ +/** + * @fileoverview Rule that warns when identifier names are shorter or longer + * than the values provided in configuration. + * @author Burak Yigit Kaya aka BYK + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce minimum and maximum identifier lengths", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-length" + }, + + schema: [ + { + type: "object", + properties: { + min: { + type: "integer", + default: 2 + }, + max: { + type: "integer" + }, + exceptions: { + type: "array", + uniqueItems: true, + items: { + type: "string" + } + }, + properties: { + enum: ["always", "never"] + } + }, + additionalProperties: false + } + ], + messages: { + tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}})." + } + }, + + create(context) { + const options = context.options[0] || {}; + const minLength = typeof options.min !== "undefined" ? options.min : 2; + const maxLength = typeof options.max !== "undefined" ? options.max : Infinity; + const properties = options.properties !== "never"; + const exceptions = (options.exceptions ? options.exceptions : []) + .reduce((obj, item) => { + obj[item] = true; + + return obj; + }, {}); + const reportedNode = new Set(); + + const SUPPORTED_EXPRESSIONS = { + MemberExpression: properties && function(parent) { + return !parent.computed && ( + + // regular property assignment + (parent.parent.left === parent && parent.parent.type === "AssignmentExpression" || + + // or the last identifier in an ObjectPattern destructuring + parent.parent.type === "Property" && parent.parent.value === parent && + parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent) + ); + }, + AssignmentPattern(parent, node) { + return parent.left === node; + }, + VariableDeclarator(parent, node) { + return parent.id === node; + }, + Property(parent, node) { + + if (parent.parent.type === "ObjectPattern") { + return ( + parent.value !== parent.key && parent.value === node || + parent.value === parent.key && parent.key === node && properties + ); + } + return properties && !parent.computed && parent.key === node; + }, + ImportDefaultSpecifier: true, + RestElement: true, + FunctionExpression: true, + ArrowFunctionExpression: true, + ClassDeclaration: true, + FunctionDeclaration: true, + MethodDefinition: true, + CatchClause: true, + ArrayPattern: true + }; + + return { + Identifier(node) { + const name = node.name; + const parent = node.parent; + + const isShort = name.length < minLength; + const isLong = name.length > maxLength; + + if (!(isShort || isLong) || exceptions[name]) { + return; // Nothing to report + } + + const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + + if (isValidExpression && !reportedNode.has(node) && (isValidExpression === true || isValidExpression(parent, node))) { + reportedNode.add(node); + context.report({ + node, + messageId: isShort ? "tooShort" : "tooLong", + data: { name, min: minLength, max: maxLength } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/id-match.js b/day1/cli-study/node_modules/eslint/lib/rules/id-match.js new file mode 100644 index 0000000..7e400d0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/id-match.js @@ -0,0 +1,226 @@ +/** + * @fileoverview Rule to flag non-matching identifiers + * @author Matthieu Larcher + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require identifiers to match a specified regular expression", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/id-match" + }, + + schema: [ + { + type: "string" + }, + { + type: "object", + properties: { + properties: { + type: "boolean", + default: false + }, + onlyDeclarations: { + type: "boolean", + default: false + }, + ignoreDestructuring: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Options + //-------------------------------------------------------------------------- + const pattern = context.options[0] || "^.+$", + regexp = new RegExp(pattern, "u"); + + const options = context.options[1] || {}, + properties = !!options.properties, + onlyDeclarations = !!options.onlyDeclarations, + ignoreDestructuring = !!options.ignoreDestructuring; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = new Map(); + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); + const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + + /** + * Checks if a string matches the provided pattern + * @param {string} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return !regexp.test(name); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let { parent } = node; + + while (parent) { + if (parent.type === "ObjectPattern") { + return true; + } + + parent = parent.parent; + } + + return false; + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {string} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return (!onlyDeclarations || DECLARATION_TYPES.has(effectiveParent.type)) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (!reported.has(node)) { + context.report({ + node, + messageId: "notMatch", + data: { + name: node.name, + pattern + } + }); + reported.set(node, true); + } + } + + return { + + Identifier(node) { + const name = node.name, + parent = node.parent, + effectiveParent = (parent.type === "MemberExpression") ? parent.parent : parent; + + if (parent.type === "MemberExpression") { + + if (!properties) { + return; + } + + // Always check object names + if (parent.object.type === "Identifier" && + parent.object.name === name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions left side's assigned variable id + } else if (effectiveParent.type === "AssignmentExpression" && + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && effectiveParent.right.type !== "MemberExpression") { + if (isInvalid(name)) { + report(node); + } + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (parent.type === "Property" || parent.type === "AssignmentPattern") { + + if (parent.parent && parent.parent.type === "ObjectPattern") { + if (parent.shorthand && parent.value.left && isInvalid(name)) { + + report(node); + } + + const assignmentKeyEqualsValue = parent.key.name === parent.value.name; + + // prevent checking righthand side of destructured object + if (!assignmentKeyEqualsValue && parent.key === node) { + return; + } + + const valueIsInvalid = parent.value.name && isInvalid(name); + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsInvalid && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // never check properties or always ignore destructuring + if (!properties || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (parent.right !== node && shouldReport(effectiveParent, name)) { + report(node); + } + + // Check if it's an import specifier + } else if (IMPORT_TYPES.has(parent.type)) { + + // Report only if the local imported identifier is invalid + if (parent.local && parent.local.name === node.name && isInvalid(name)) { + report(node); + } + + // Report anything that is invalid that isn't a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/day1/cli-study/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js new file mode 100644 index 0000000..409145e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -0,0 +1,81 @@ +/** + * @fileoverview enforce the location of arrow function bodies + * @author Sharmila Jesupaul + */ +"use strict"; + +const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of arrow function bodies", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/implicit-arrow-linebreak" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["beside", "below"] + } + ], + messages: { + expected: "Expected a linebreak before this expression.", + unexpected: "Expected no linebreak before this expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "beside"; + + /** + * Validates the location of an arrow function body + * @param {ASTNode} node The arrow function body + * @returns {void} + */ + function validateExpression(node) { + if (node.body.type === "BlockStatement") { + return; + } + + const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken); + const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken); + + if (arrowToken.loc.end.line === firstTokenOfBody.loc.start.line && option === "below") { + context.report({ + node: firstTokenOfBody, + messageId: "expected", + fix: fixer => fixer.insertTextBefore(firstTokenOfBody, "\n") + }); + } else if (arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line && option === "beside") { + context.report({ + node: firstTokenOfBody, + messageId: "unexpected", + fix(fixer) { + if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, filter: isCommentToken })) { + return null; + } + + return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ArrowFunctionExpression: node => validateExpression(node) + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/indent-legacy.js b/day1/cli-study/node_modules/eslint/lib/rules/indent-legacy.js new file mode 100644 index 0000000..50010d3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/indent-legacy.js @@ -0,0 +1,1125 @@ +/** + * @fileoverview This option sets a specific tab width for your code + * + * This rule has been ported and modified from nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/* istanbul ignore next: this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. */ +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent-legacy" + }, + + deprecated: true, + + replacedBy: ["indent"], + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0 + }, + VariableDeclarator: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + var: { + type: "integer", + minimum: 0 + }, + let: { + type: "integer", + minimum: 0 + }, + const: { + type: "integer", + minimum: 0 + } + } + } + ] + }, + outerIIFEBody: { + type: "integer", + minimum: 0 + }, + MemberExpression: { + type: "integer", + minimum: 0 + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + FunctionExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + body: { + type: "integer", + minimum: 0 + } + } + }, + CallExpression: { + type: "object", + properties: { + parameters: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + } + }, + ArrayExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + }, + ObjectExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first"] + } + ] + } + }, + additionalProperties: false + } + ], + messages: { + expected: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: null, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + ArrayExpression: 1, + ObjectExpression: 1 + }; + + const sourceCode = context.getSourceCode(); + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + const opts = context.options[1]; + + options.SwitchCase = opts.SwitchCase || 0; + const variableDeclaratorRules = opts.VariableDeclarator; + + if (typeof variableDeclaratorRules === "number") { + options.VariableDeclarator = { + var: variableDeclaratorRules, + let: variableDeclaratorRules, + const: variableDeclaratorRules + }; + } else if (typeof variableDeclaratorRules === "object") { + Object.assign(options.VariableDeclarator, variableDeclaratorRules); + } + + if (typeof opts.outerIIFEBody === "number") { + options.outerIIFEBody = opts.outerIIFEBody; + } + + if (typeof opts.MemberExpression === "number") { + options.MemberExpression = opts.MemberExpression; + } + + if (typeof opts.FunctionDeclaration === "object") { + Object.assign(options.FunctionDeclaration, opts.FunctionDeclaration); + } + + if (typeof opts.FunctionExpression === "object") { + Object.assign(options.FunctionExpression, opts.FunctionExpression); + } + + if (typeof opts.CallExpression === "object") { + Object.assign(options.CallExpression, opts.CallExpression); + } + + if (typeof opts.ArrayExpression === "number" || typeof opts.ArrayExpression === "string") { + options.ArrayExpression = opts.ArrayExpression; + } + + if (typeof opts.ObjectExpression === "number" || typeof opts.ObjectExpression === "string") { + options.ObjectExpression = opts.ObjectExpression; + } + } + } + + const caseIndentStore = {}; + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0 && actualTabs > 0) { + foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" + } else if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {ASTNode} node Node violating the indent rule + * @param {int} needed Expected indentation character count + * @param {int} gottenSpaces Indentation space count in the actual node/code + * @param {int} gottenTabs Indentation tab count in the actual node/code + * @param {Object} [loc] Error line and column location + * @param {boolean} isLastNodeCheck Is the error for last node check + * @returns {void} + */ + function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) { + if (gottenSpaces && gottenTabs) { + + // To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs. + return; + } + + const desiredIndent = (indentType === "space" ? " " : "\t").repeat(needed); + + const textRange = isLastNodeCheck + ? [node.range[1] - node.loc.end.column, node.range[1] - node.loc.end.column + gottenSpaces + gottenTabs] + : [node.range[0] - node.loc.start.column, node.range[0] - node.loc.start.column + gottenSpaces + gottenTabs]; + + context.report({ + node, + loc, + messageId: "expected", + data: createErrorMessageData(needed, gottenSpaces, gottenTabs), + fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) + }); + } + + /** + * Get the actual indent of node + * @param {ASTNode|Token} node Node to examine + * @param {boolean} [byLastLine=false] get indent of node's last line + * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also + * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and + * `badChar` is the amount of the other indentation character. + */ + function getNodeIndent(node, byLastLine) { + const token = byLastLine ? sourceCode.getLastToken(node) : sourceCode.getFirstToken(node); + const srcCharsBeforeNode = sourceCode.getText(token, token.loc.start.column).split(""); + const indentChars = srcCharsBeforeNode.slice(0, srcCharsBeforeNode.findIndex(char => char !== " " && char !== "\t")); + const spaces = indentChars.filter(char => char === " ").length; + const tabs = indentChars.filter(char => char === "\t").length; + + return { + space: spaces, + tab: tabs, + goodChar: indentType === "space" ? spaces : tabs, + badChar: indentType === "space" ? tabs : spaces + }; + } + + /** + * Checks node is the first in its own start line. By default it looks by start line. + * @param {ASTNode} node The node to check + * @param {boolean} [byEndLocation=false] Lookup based on start position or end + * @returns {boolean} true if its the first in the its start line + */ + function isNodeFirstInLine(node, byEndLocation) { + const firstToken = byEndLocation === true ? sourceCode.getLastToken(node, 1) : sourceCode.getTokenBefore(node), + startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, + endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; + } + + /** + * Check indent for node + * @param {ASTNode} node Node to check + * @param {int} neededIndent needed indent + * @returns {void} + */ + function checkNodeIndent(node, neededIndent) { + const actualIndent = getNodeIndent(node, false); + + if ( + node.type !== "ArrayExpression" && + node.type !== "ObjectExpression" && + (actualIndent.goodChar !== neededIndent || actualIndent.badChar !== 0) && + isNodeFirstInLine(node) + ) { + report(node, neededIndent, actualIndent.space, actualIndent.tab); + } + + if (node.type === "IfStatement" && node.alternate) { + const elseToken = sourceCode.getTokenBefore(node.alternate); + + checkNodeIndent(elseToken, neededIndent); + + if (!isNodeFirstInLine(node.alternate)) { + checkNodeIndent(node.alternate, neededIndent); + } + } + + if (node.type === "TryStatement" && node.handler) { + const catchToken = sourceCode.getFirstToken(node.handler); + + checkNodeIndent(catchToken, neededIndent); + } + + if (node.type === "TryStatement" && node.finalizer) { + const finallyToken = sourceCode.getTokenBefore(node.finalizer); + + checkNodeIndent(finallyToken, neededIndent); + } + + if (node.type === "DoWhileStatement") { + const whileToken = sourceCode.getTokenAfter(node.body); + + checkNodeIndent(whileToken, neededIndent); + } + } + + /** + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {int} indent needed indent + * @returns {void} + */ + function checkNodesIndent(nodes, indent) { + nodes.forEach(node => checkNodeIndent(node, indent)); + } + + /** + * Check last node line indent this detects, that block closed correctly + * @param {ASTNode} node Node to examine + * @param {int} lastLineIndent needed indent + * @returns {void} + */ + function checkLastNodeLineIndent(node, lastLineIndent) { + const lastToken = sourceCode.getLastToken(node); + const endIndent = getNodeIndent(lastToken, true); + + if ((endIndent.goodChar !== lastLineIndent || endIndent.badChar !== 0) && isNodeFirstInLine(node, true)) { + report( + node, + lastLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check last node line indent this detects, that block closed correctly + * This function for more complicated return statement case, where closing parenthesis may be followed by ';' + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent first line needed indent + * @returns {void} + */ + function checkLastReturnStatementLineIndent(node, firstLineIndent) { + + /* + * in case if return statement ends with ');' we have traverse back to ')' + * otherwise we'll measure indent for ';' and replace ')' + */ + const lastToken = sourceCode.getLastToken(node, astUtils.isClosingParenToken); + const textBeforeClosingParenthesis = sourceCode.getText(lastToken, lastToken.loc.start.column).slice(0, -1); + + if (textBeforeClosingParenthesis.trim()) { + + // There are tokens before the closing paren, don't report this case + return; + } + + const endIndent = getNodeIndent(lastToken, true); + + if (endIndent.goodChar !== firstLineIndent) { + report( + node, + firstLineIndent, + endIndent.space, + endIndent.tab, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); + } + } + + /** + * Check first node line indent is correct + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent needed indent + * @returns {void} + */ + function checkFirstNodeLineIndent(node, firstLineIndent) { + const startIndent = getNodeIndent(node, false); + + if ((startIndent.goodChar !== firstLineIndent || startIndent.badChar !== 0) && isNodeFirstInLine(node)) { + report( + node, + firstLineIndent, + startIndent.space, + startIndent.tab, + { line: node.loc.start.line, column: node.loc.start.column } + ); + } + } + + /** + * Returns a parent node of given node based on a specified type + * if not present then return null + * @param {ASTNode} node node to examine + * @param {string} type type that is being looked for + * @param {string} stopAtList end points for the evaluating code + * @returns {ASTNode|void} if found then node otherwise null + */ + function getParentNodeByType(node, type, stopAtList) { + let parent = node.parent; + const stopAtSet = new Set(stopAtList || ["Program"]); + + while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") { + parent = parent.parent; + } + + return parent.type === type ? parent : null; + } + + /** + * Returns the VariableDeclarator based on the current node + * if not present then return null + * @param {ASTNode} node node to examine + * @returns {ASTNode|void} if found then node otherwise null + */ + function getVariableDeclaratorNode(node) { + return getParentNodeByType(node, "VariableDeclarator"); + } + + /** + * Check to see if the node is part of the multi-line variable declaration. + * Also if its on the same line as the varNode + * @param {ASTNode} node node to check + * @param {ASTNode} varNode variable declaration node to check against + * @returns {boolean} True if all the above condition satisfy + */ + function isNodeInVarOnTop(node, varNode) { + return varNode && + varNode.parent.loc.start.line === node.loc.start.line && + varNode.parent.declarations.length > 1; + } + + /** + * Check to see if the argument before the callee node is multi-line and + * there should only be 1 argument before the callee node + * @param {ASTNode} node node to check + * @returns {boolean} True if arguments are multi-line + */ + function isArgBeforeCalleeNodeMultiline(node) { + const parent = node.parent; + + if (parent.arguments.length >= 2 && parent.arguments[1] === node) { + return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; + } + + return false; + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + const parent = node.parent; + let stmt = parent.parent; + + /* + * Verify that the node is an IIEF + */ + if ( + parent.type !== "CallExpression" || + parent.callee !== node) { + + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIEF is outer + */ + while ( + stmt.type === "UnaryExpression" && ( + stmt.operator === "!" || + stmt.operator === "~" || + stmt.operator === "+" || + stmt.operator === "-") || + stmt.type === "AssignmentExpression" || + stmt.type === "LogicalExpression" || + stmt.type === "SequenceExpression" || + stmt.type === "VariableDeclarator") { + + stmt = stmt.parent; + } + + return (( + stmt.type === "ExpressionStatement" || + stmt.type === "VariableDeclaration") && + stmt.parent && stmt.parent.type === "Program" + ); + } + + /** + * Check indent for function block content + * @param {ASTNode} node A BlockStatement node that is inside of a function. + * @returns {void} + */ + function checkIndentInFunctionBlock(node) { + + /* + * Search first caller in chain. + * Ex.: + * + * Models <- Identifier + * .User + * .find() + * .exec(function() { + * // function body + * }); + * + * Looks for 'Models' + */ + const calleeNode = node.parent; // FunctionExpression + let indent; + + if (calleeNode.parent && + (calleeNode.parent.type === "Property" || + calleeNode.parent.type === "ArrayExpression")) { + + // If function is part of array or object, comma can be put at left + indent = getNodeIndent(calleeNode, false).goodChar; + } else { + + // If function is standalone, simple calculate indent + indent = getNodeIndent(calleeNode).goodChar; + } + + if (calleeNode.parent.type === "CallExpression") { + const calleeParent = calleeNode.parent; + + if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { + if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { + indent = getNodeIndent(calleeParent).goodChar; + } + } else { + if (isArgBeforeCalleeNodeMultiline(calleeNode) && + calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && + !isNodeFirstInLine(calleeNode)) { + indent = getNodeIndent(calleeParent).goodChar; + } + } + } + + /* + * function body indent should be indent + indent size, unless this + * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled. + */ + let functionOffset = indentSize; + + if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) { + functionOffset = options.outerIIFEBody * indentSize; + } else if (calleeNode.type === "FunctionExpression") { + functionOffset = options.FunctionExpression.body * indentSize; + } else if (calleeNode.type === "FunctionDeclaration") { + functionOffset = options.FunctionDeclaration.body * indentSize; + } + indent += functionOffset; + + // check if the node is inside a variable + const parentVarNode = getVariableDeclaratorNode(node); + + if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { + indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + if (node.body.length > 0) { + checkNodesIndent(node.body, indent); + } + + checkLastNodeLineIndent(node, indent - functionOffset); + } + + + /** + * Checks if the given node starts and ends on the same line + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the block starts and ends on the same line. + */ + function isSingleLineNode(node) { + const lastToken = sourceCode.getLastToken(node), + startLine = node.loc.start.line, + endLine = lastToken.loc.end.line; + + return startLine === endLine; + } + + /** + * Check indent for array block content or object block content + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInArrayOrObjectBlock(node) { + + // Skip inline + if (isSingleLineNode(node)) { + return; + } + + let elements = (node.type === "ArrayExpression") ? node.elements : node.properties; + + // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null + elements = elements.filter(elem => elem !== null); + + let nodeIndent; + let elementsIndent; + const parentVarNode = getVariableDeclaratorNode(node); + + // TODO - come up with a better strategy in future + if (isNodeFirstInLine(node)) { + const parent = node.parent; + + nodeIndent = getNodeIndent(parent).goodChar; + if (!parentVarNode || parentVarNode.loc.start.line !== node.loc.start.line) { + if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { + if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === parent.loc.start.line) { + nodeIndent += (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if (parent.type === "ObjectExpression" || parent.type === "ArrayExpression") { + const parentElements = node.parent.type === "ObjectExpression" ? node.parent.properties : node.parent.elements; + + if (parentElements[0] && + parentElements[0].loc.start.line === parent.loc.start.line && + parentElements[0].loc.end.line !== parent.loc.start.line) { + + /* + * If the first element of the array spans multiple lines, don't increase the expected indentation of the rest. + * e.g. [{ + * foo: 1 + * }, + * { + * bar: 1 + * }] + * the second object is not indented. + */ + } else if (typeof options[parent.type] === "number") { + nodeIndent += options[parent.type] * indentSize; + } else { + nodeIndent = parentElements[0].loc.start.column; + } + } else if (parent.type === "CallExpression" || parent.type === "NewExpression") { + if (typeof options.CallExpression.arguments === "number") { + nodeIndent += options.CallExpression.arguments * indentSize; + } else if (options.CallExpression.arguments === "first") { + if (parent.arguments.indexOf(node) !== -1) { + nodeIndent = parent.arguments[0].loc.start.column; + } + } else { + nodeIndent += indentSize; + } + } else if (parent.type === "LogicalExpression" || parent.type === "ArrowFunctionExpression") { + nodeIndent += indentSize; + } + } + } + + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node).goodChar; + } + + if (options[node.type] === "first") { + elementsIndent = elements.length ? elements[0].loc.start.column : 0; // If there are no elements, elementsIndent doesn't matter. + } else { + elementsIndent = nodeIndent + indentSize * options[node.type]; + } + + /* + * Check if the node is a multiple variable declaration; if so, then + * make sure indentation takes that into account. + */ + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + checkNodesIndent(elements, elementsIndent); + + if (elements.length > 0) { + + // Skip last block line check if last item in same line + if (elements[elements.length - 1].loc.end.line === node.loc.end.line) { + return; + } + } + + checkLastNodeLineIndent(node, nodeIndent + + (isNodeInVarOnTop(node, parentVarNode) ? options.VariableDeclarator[parentVarNode.parent.kind] * indentSize : 0)); + } + + /** + * Check if the node or node body is a BlockStatement or not + * @param {ASTNode} node node to test + * @returns {boolean} True if it or its body is a block statement + */ + function isNodeBodyBlock(node) { + return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") || + (node.consequent && node.consequent.type === "BlockStatement"); + } + + /** + * Check indentation for blocks + * @param {ASTNode} node node to check + * @returns {void} + */ + function blockIndentationCheck(node) { + + // Skip inline blocks + if (isSingleLineNode(node)) { + return; + } + + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression") + ) { + checkIndentInFunctionBlock(node); + return; + } + + let indent; + let nodesToCheck = []; + + /* + * For this statements we should check indent from statement beginning, + * not from the beginning of the block. + */ + const statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration", "TryStatement" + ]; + + if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent).goodChar; + } else if (node.parent && node.parent.type === "CatchClause") { + indent = getNodeIndent(node.parent.parent).goodChar; + } else { + indent = getNodeIndent(node).goodChar; + } + + if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { + nodesToCheck = [node.consequent]; + } else if (Array.isArray(node.body)) { + nodesToCheck = node.body; + } else { + nodesToCheck = [node.body]; + } + + if (nodesToCheck.length > 0) { + checkNodesIndent(nodesToCheck, indent + indentSize); + } + + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } + } + + /** + * Filter out the elements which are on the same line of each other or the node. + * basically have only 1 elements from each line except the variable declaration line. + * @param {ASTNode} node Variable declaration node + * @returns {ASTNode[]} Filtered elements + */ + function filterOutSameLineVars(node) { + return node.declarations.reduce((finalCollection, elem) => { + const lastElem = finalCollection[finalCollection.length - 1]; + + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); + } + + /** + * Check indentation for variable declarations + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkIndentInVariableDeclarations(node) { + const elements = filterOutSameLineVars(node); + const nodeIndent = getNodeIndent(node).goodChar; + const lastElement = elements[elements.length - 1]; + + const elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; + + checkNodesIndent(elements, elementsIndent); + + // Only check the last line if there is any token after the last item + if (sourceCode.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { + return; + } + + const tokenBeforeLastElement = sourceCode.getTokenBefore(lastElement); + + if (tokenBeforeLastElement.value === ",") { + + // Special case for comma-first syntax where the semicolon is indented + checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement).goodChar); + } else { + checkLastNodeLineIndent(node, elementsIndent - indentSize); + } + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function blockLessNodes(node) { + if (node.body.type !== "BlockStatement") { + blockIndentationCheck(node); + } + } + + /** + * Returns the expected indentation for the case statement + * @param {ASTNode} node node to examine + * @param {int} [providedSwitchIndent] indent for switch statement + * @returns {int} indent size + */ + function expectedCaseIndent(node, providedSwitchIndent) { + const switchNode = (node.type === "SwitchStatement") ? node : node.parent; + const switchIndent = typeof providedSwitchIndent === "undefined" + ? getNodeIndent(switchNode).goodChar + : providedSwitchIndent; + let caseIndent; + + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } + + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); + } + + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + + } + + /** + * Checks wether a return statement is wrapped in () + * @param {ASTNode} node node to examine + * @returns {boolean} the result + */ + function isWrappedInParenthesis(node) { + const regex = /^return\s*?\(\s*?\);*?/u; + + const statementWithoutArgument = sourceCode.getText(node).replace( + sourceCode.getText(node.argument), "" + ); + + return regex.test(statementWithoutArgument); + } + + return { + Program(node) { + if (node.body.length > 0) { + + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node).goodChar); + } + }, + + ClassBody: blockIndentationCheck, + + BlockStatement: blockIndentationCheck, + + WhileStatement: blockLessNodes, + + ForStatement: blockLessNodes, + + ForInStatement: blockLessNodes, + + ForOfStatement: blockLessNodes, + + DoWhileStatement: blockLessNodes, + + IfStatement(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } + }, + + VariableDeclaration(node) { + if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); + } + }, + + ObjectExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + ArrayExpression(node) { + checkIndentInArrayOrObjectBlock(node); + }, + + MemberExpression(node) { + + if (typeof options.MemberExpression === "undefined") { + return; + } + + if (isSingleLineNode(node)) { + return; + } + + /* + * The typical layout of variable declarations and assignments + * alter the expectation of correct indentation. Skip them. + * TODO: Add appropriate configuration options for variable + * declarations and assignments. + */ + if (getParentNodeByType(node, "VariableDeclarator", ["FunctionExpression", "ArrowFunctionExpression"])) { + return; + } + + if (getParentNodeByType(node, "AssignmentExpression", ["FunctionExpression"])) { + return; + } + + const propertyIndent = getNodeIndent(node).goodChar + indentSize * options.MemberExpression; + + const checkNodes = [node.property]; + + const dot = sourceCode.getTokenBefore(node.property); + + if (dot.type === "Punctuator" && dot.value === ".") { + checkNodes.push(dot); + } + + checkNodesIndent(checkNodes, propertyIndent); + }, + + SwitchStatement(node) { + + // Switch is not a 'BlockStatement' + const switchIndent = getNodeIndent(node).goodChar; + const caseIndent = expectedCaseIndent(node, switchIndent); + + checkNodesIndent(node.cases, caseIndent); + + + checkLastNodeLineIndent(node, switchIndent); + }, + + SwitchCase(node) { + + // Skip inline cases + if (isSingleLineNode(node)) { + return; + } + const caseIndent = expectedCaseIndent(node); + + checkNodesIndent(node.consequent, caseIndent + indentSize); + }, + + FunctionDeclaration(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionDeclaration.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionDeclaration.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionDeclaration.parameters); + } + }, + + FunctionExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.FunctionExpression.parameters === "first" && node.params.length) { + checkNodesIndent(node.params.slice(1), node.params[0].loc.start.column); + } else if (options.FunctionExpression.parameters !== null) { + checkNodesIndent(node.params, getNodeIndent(node).goodChar + indentSize * options.FunctionExpression.parameters); + } + }, + + ReturnStatement(node) { + if (isSingleLineNode(node)) { + return; + } + + const firstLineIndent = getNodeIndent(node).goodChar; + + // in case if return statement is wrapped in parenthesis + if (isWrappedInParenthesis(node)) { + checkLastReturnStatementLineIndent(node, firstLineIndent); + } else { + checkNodeIndent(node, firstLineIndent); + } + }, + + CallExpression(node) { + if (isSingleLineNode(node)) { + return; + } + if (options.CallExpression.arguments === "first" && node.arguments.length) { + checkNodesIndent(node.arguments.slice(1), node.arguments[0].loc.start.column); + } else if (options.CallExpression.arguments !== null) { + checkNodesIndent(node.arguments, getNodeIndent(node).goodChar + indentSize * options.CallExpression.arguments); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/indent.js b/day1/cli-study/node_modules/eslint/lib/rules/indent.js new file mode 100644 index 0000000..d576fde --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/indent.js @@ -0,0 +1,1686 @@ +/** + * @fileoverview This rule sets a specific indentation style and width for your code + * + * @author Teddy Katz + * @author Vitaly Puzrin + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); +const createTree = require("functional-red-black-tree"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const KNOWN_NODES = new Set([ + "AssignmentExpression", + "AssignmentPattern", + "ArrayExpression", + "ArrayPattern", + "ArrowFunctionExpression", + "AwaitExpression", + "BlockStatement", + "BinaryExpression", + "BreakStatement", + "CallExpression", + "CatchClause", + "ClassBody", + "ClassDeclaration", + "ClassExpression", + "ConditionalExpression", + "ContinueStatement", + "DoWhileStatement", + "DebuggerStatement", + "EmptyStatement", + "ExperimentalRestProperty", + "ExperimentalSpreadProperty", + "ExpressionStatement", + "ForStatement", + "ForInStatement", + "ForOfStatement", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "IfStatement", + "Literal", + "LabeledStatement", + "LogicalExpression", + "MemberExpression", + "MetaProperty", + "MethodDefinition", + "NewExpression", + "ObjectExpression", + "ObjectPattern", + "Program", + "Property", + "RestElement", + "ReturnStatement", + "SequenceExpression", + "SpreadElement", + "Super", + "SwitchCase", + "SwitchStatement", + "TaggedTemplateExpression", + "TemplateElement", + "TemplateLiteral", + "ThisExpression", + "ThrowStatement", + "TryStatement", + "UnaryExpression", + "UpdateExpression", + "VariableDeclaration", + "VariableDeclarator", + "WhileStatement", + "WithStatement", + "YieldExpression", + "JSXFragment", + "JSXOpeningFragment", + "JSXClosingFragment", + "JSXIdentifier", + "JSXNamespacedName", + "JSXMemberExpression", + "JSXEmptyExpression", + "JSXExpressionContainer", + "JSXElement", + "JSXClosingElement", + "JSXOpeningElement", + "JSXAttribute", + "JSXSpreadAttribute", + "JSXText", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ExportAllDeclaration", + "ExportSpecifier", + "ImportDeclaration", + "ImportSpecifier", + "ImportDefaultSpecifier", + "ImportNamespaceSpecifier", + "ImportExpression" +]); + +/* + * General rule strategy: + * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another + * specified token or to the first column. + * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a + * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly + * brace of the BlockStatement. + * 3. After traversing the AST, calculate the expected indentation levels of every token according to the + * OffsetStorage container. + * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, + * and report the token if the two values are not equal. + */ + + +/** + * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. + * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation + * can easily be swapped out. + */ +class BinarySearchTree { + + /** + * Creates an empty tree + */ + constructor() { + this._rbTree = createTree(); + } + + /** + * Inserts an entry into the tree. + * @param {number} key The entry's key + * @param {*} value The entry's value + * @returns {void} + */ + insert(key, value) { + const iterator = this._rbTree.find(key); + + if (iterator.valid) { + this._rbTree = iterator.update(value); + } else { + this._rbTree = this._rbTree.insert(key, value); + } + } + + /** + * Finds the entry with the largest key less than or equal to the provided key + * @param {number} key The provided key + * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists. + */ + findLe(key) { + const iterator = this._rbTree.le(key); + + return iterator && { key: iterator.key, value: iterator.value }; + } + + /** + * Deletes all of the keys in the interval [start, end) + * @param {number} start The start of the range + * @param {number} end The end of the range + * @returns {void} + */ + deleteRange(start, end) { + + // Exit without traversing the tree if the range has zero size. + if (start === end) { + return; + } + const iterator = this._rbTree.ge(start); + + while (iterator.valid && iterator.key < end) { + this._rbTree = this._rbTree.remove(iterator.key); + iterator.next(); + } + } +} + +/** + * A helper class to get token-based info related to indentation + */ +class TokenInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {SourceCode} sourceCode A SourceCode object + */ + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce((map, token) => { + if (!map.has(token.loc.start.line)) { + map.set(token.loc.start.line, token); + } + if (!map.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { + map.set(token.loc.end.line, token); + } + return map; + }, new Map()); + } + + /** + * Gets the first token on a given token's line + * @param {Token|ASTNode} token a node or token + * @returns {Token} The first token on the given line + */ + getFirstTokenOfLine(token) { + return this.firstTokensByLineNumber.get(token.loc.start.line); + } + + /** + * Determines whether a token is the first token in its line + * @param {Token} token The token + * @returns {boolean} `true` if the token is the first on its line + */ + isFirstTokenOfLine(token) { + return this.getFirstTokenOfLine(token) === token; + } + + /** + * Get the actual indent of a token + * @param {Token} token Token to examine. This should be the first token on its line. + * @returns {string} The indentation characters that precede the token + */ + getTokenIndent(token) { + return this.sourceCode.text.slice(token.range[0] - token.loc.start.column, token.range[0]); + } +} + +/** + * A class to store information on desired offsets of tokens from each other + */ +class OffsetStorage { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {TokenInfo} tokenInfo a TokenInfo instance + * @param {number} indentSize The desired size of each indentation level + * @param {string} indentType The indentation character + */ + constructor(tokenInfo, indentSize, indentType) { + this._tokenInfo = tokenInfo; + this._indentSize = indentSize; + this._indentType = indentType; + + this._tree = new BinarySearchTree(); + this._tree.insert(0, { offset: 0, from: null, force: false }); + + this._lockedFirstTokens = new WeakMap(); + this._desiredIndentCache = new WeakMap(); + this._ignoredTokens = new WeakSet(); + } + + _getOffsetDescriptor(token) { + return this._tree.findLe(token.range[0]).value; + } + + /** + * Sets the offset column of token B to match the offset column of token A. + * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In + * most cases, `setDesiredOffset` should be used instead. + * @param {Token} baseToken The first token + * @param {Token} offsetToken The second token, whose offset should be matched to the first token + * @returns {void} + */ + matchOffsetOf(baseToken, offsetToken) { + + /* + * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to + * the token that it depends on. For example, with the `ArrayExpression: first` option, the first + * token of each element in the array after the first will be mapped to the first token of the first + * element. The desired indentation of each of these tokens is computed based on the desired indentation + * of the "first" element, rather than through the normal offset mechanism. + */ + this._lockedFirstTokens.set(offsetToken, baseToken); + } + + /** + * Sets the desired offset of a token. + * + * This uses a line-based offset collapsing behavior to handle tokens on the same line. + * For example, consider the following two cases: + * + * ( + * [ + * bar + * ] + * ) + * + * ([ + * bar + * ]) + * + * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from + * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is + * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) + * from the start of its line. + * + * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level + * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the + * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented + * by 1 indent level from the start of the line. + * + * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, + * without needing to check which lines those tokens are on. + * + * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive + * behavior can occur. For example, consider the following cases: + * + * foo( + * ). + * bar( + * baz + * ) + * + * foo( + * ).bar( + * baz + * ) + * + * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` + * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` + * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no + * collapsing would occur). + * + * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and + * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed + * in the second case. + * @param {Token} token The token + * @param {Token} fromToken The token that `token` should be offset from + * @param {number} offset The desired indent level + * @returns {void} + */ + setDesiredOffset(token, fromToken, offset) { + return this.setDesiredOffsets(token.range, fromToken, offset); + } + + /** + * Sets the desired offset of all tokens in a range + * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. + * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains + * it). This means that the offset of each token is updated O(AST depth) times. + * It would not be performant to store and update the offsets for each token independently, because the rule would end + * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. + * + * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following + * list could represent the state of the offset tree at a given point: + * + * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file + * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token + * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token + * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token + * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token + * + * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: + * `setDesiredOffsets([30, 43], fooToken, 1);` + * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. + * @param {Token} fromToken The token that this is offset from + * @param {number} offset The desired indent level + * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. + * @returns {void} + */ + setDesiredOffsets(range, fromToken, offset, force) { + + /* + * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset + * descriptor. The tree for the example above would have the following nodes: + * + * * key: 0, value: { offset: 0, from: null } + * * key: 15, value: { offset: 1, from: barToken } + * * key: 30, value: { offset: 1, from: fooToken } + * * key: 43, value: { offset: 2, from: barToken } + * * key: 820, value: { offset: 1, from: bazToken } + * + * To find the offset descriptor for any given token, one needs to find the node with the largest key + * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary + * search tree indexed by key. + */ + + const descriptorToInsert = { offset, from: fromToken, force }; + + const descriptorAfterRange = this._tree.findLe(range[1]).value; + + const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; + const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); + + // First, remove any existing nodes in the range from the tree. + this._tree.deleteRange(range[0] + 1, range[1]); + + // Insert a new node into the tree for this range + this._tree.insert(range[0], descriptorToInsert); + + /* + * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, + * even if it's in the current range. + */ + if (fromTokenIsInRange) { + this._tree.insert(fromToken.range[0], fromTokenDescriptor); + this._tree.insert(fromToken.range[1], descriptorToInsert); + } + + /* + * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following + * tokens the same as it was before. + */ + this._tree.insert(range[1], descriptorAfterRange); + } + + /** + * Gets the desired indent of a token + * @param {Token} token The token + * @returns {string} The desired indent of the token + */ + getDesiredIndent(token) { + if (!this._desiredIndentCache.has(token)) { + + if (this._ignoredTokens.has(token)) { + + /* + * If the token is ignored, use the actual indent of the token as the desired indent. + * This ensures that no errors are reported for this token. + */ + this._desiredIndentCache.set( + token, + this._tokenInfo.getTokenIndent(token) + ); + } else if (this._lockedFirstTokens.has(token)) { + const firstToken = this._lockedFirstTokens.get(token); + + this._desiredIndentCache.set( + token, + + // (indentation for the first element's line) + this.getDesiredIndent(this._tokenInfo.getFirstTokenOfLine(firstToken)) + + + // (space between the start of the first element's line and the first element) + this._indentType.repeat(firstToken.loc.start.column - this._tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column) + ); + } else { + const offsetInfo = this._getOffsetDescriptor(token); + const offset = ( + offsetInfo.from && + offsetInfo.from.loc.start.line === token.loc.start.line && + !/^\s*?\n/u.test(token.value) && + !offsetInfo.force + ) ? 0 : offsetInfo.offset * this._indentSize; + + this._desiredIndentCache.set( + token, + (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : "") + this._indentType.repeat(offset) + ); + } + } + return this._desiredIndentCache.get(token); + } + + /** + * Ignores a token, preventing it from being reported. + * @param {Token} token The token + * @returns {void} + */ + ignoreToken(token) { + if (this._tokenInfo.isFirstTokenOfLine(token)) { + this._ignoredTokens.add(token); + } + } + + /** + * Gets the first token that the given token's indentation is dependent on + * @param {Token} token The token + * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level + */ + getFirstDependency(token) { + return this._getOffsetDescriptor(token).from; + } +} + +const ELEMENT_LIST_SCHEMA = { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["first", "off"] + } + ] +}; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent indentation", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/indent" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["tab"] + }, + { + type: "integer", + minimum: 0 + } + ] + }, + { + type: "object", + properties: { + SwitchCase: { + type: "integer", + minimum: 0, + default: 0 + }, + VariableDeclarator: { + oneOf: [ + ELEMENT_LIST_SCHEMA, + { + type: "object", + properties: { + var: ELEMENT_LIST_SCHEMA, + let: ELEMENT_LIST_SCHEMA, + const: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + } + ] + }, + outerIIFEBody: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + MemberExpression: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + enum: ["off"] + } + ] + }, + FunctionDeclaration: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + FunctionExpression: { + type: "object", + properties: { + parameters: ELEMENT_LIST_SCHEMA, + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, + CallExpression: { + type: "object", + properties: { + arguments: ELEMENT_LIST_SCHEMA + }, + additionalProperties: false + }, + ArrayExpression: ELEMENT_LIST_SCHEMA, + ObjectExpression: ELEMENT_LIST_SCHEMA, + ImportDeclaration: ELEMENT_LIST_SCHEMA, + flatTernaryExpressions: { + type: "boolean", + default: false + }, + offsetTernaryExpressions: { + type: "boolean", + default: false + }, + ignoredNodes: { + type: "array", + items: { + type: "string", + not: { + pattern: ":exit$" + } + } + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." + } + }, + + create(context) { + const DEFAULT_VARIABLE_INDENT = 1; + const DEFAULT_PARAMETER_INDENT = 1; + const DEFAULT_FUNCTION_BODY_INDENT = 1; + + let indentType = "space"; + let indentSize = 4; + const options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + }, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + FunctionExpression: { + parameters: DEFAULT_PARAMETER_INDENT, + body: DEFAULT_FUNCTION_BODY_INDENT + }, + CallExpression: { + arguments: DEFAULT_PARAMETER_INDENT + }, + MemberExpression: 1, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoredNodes: [], + ignoreComments: false + }; + + if (context.options.length) { + if (context.options[0] === "tab") { + indentSize = 1; + indentType = "tab"; + } else { + indentSize = context.options[0]; + indentType = "space"; + } + + if (context.options[1]) { + Object.assign(options, context.options[1]); + + if (typeof options.VariableDeclarator === "number" || options.VariableDeclarator === "first") { + options.VariableDeclarator = { + var: options.VariableDeclarator, + let: options.VariableDeclarator, + const: options.VariableDeclarator + }; + } + } + } + + const sourceCode = context.getSourceCode(); + const tokenInfo = new TokenInfo(sourceCode); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t"); + const parameterParens = new WeakSet(); + + /** + * Creates an error message for a line, given the expected/actual indentation. + * @param {int} expectedAmount The expected amount of indentation characters for this line + * @param {int} actualSpaces The actual number of indentation spaces that were found on this line + * @param {int} actualTabs The actual number of indentation tabs that were found on this line + * @returns {string} An error message for this line + */ + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { + const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" + const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" + const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" + let foundStatement; + + if (actualSpaces > 0) { + + /* + * Abbreviate the message if the expected indentation is also spaces. + * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' + */ + foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; + } else if (actualTabs > 0) { + foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; + } else { + foundStatement = "0"; + } + return { + expected: expectedStatement, + actual: foundStatement + }; + } + + /** + * Reports a given indent violation + * @param {Token} token Token violating the indent rule + * @param {string} neededIndent Expected indentation string + * @returns {void} + */ + function report(token, neededIndent) { + const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); + const numSpaces = actualIndent.filter(char => char === " ").length; + const numTabs = actualIndent.filter(char => char === "\t").length; + + context.report({ + node: token, + messageId: "wrongIndentation", + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), + loc: { + start: { line: token.loc.start.line, column: 0 }, + end: { line: token.loc.start.line, column: token.loc.start.column } + }, + fix(fixer) { + const range = [token.range[0] - token.loc.start.column, token.range[0]]; + const newText = neededIndent; + + return fixer.replaceTextRange(range, newText); + } + }); + } + + /** + * Checks if a token's indentation is correct + * @param {Token} token Token to examine + * @param {string} desiredIndent Desired indentation of the string + * @returns {boolean} `true` if the token's indentation is correct + */ + function validateTokenIndent(token, desiredIndent) { + const indentation = tokenInfo.getTokenIndent(token); + + return indentation === desiredIndent || + + // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. + indentation.includes(" ") && indentation.includes("\t"); + } + + /** + * Check to see if the node is a file level IIFE + * @param {ASTNode} node The function node to check. + * @returns {boolean} True if the node is the outer IIFE + */ + function isOuterIIFE(node) { + + /* + * Verify that the node is an IIFE + */ + if (!node.parent || node.parent.type !== "CallExpression" || node.parent.callee !== node) { + return false; + } + + /* + * Navigate legal ancestors to determine whether this IIFE is outer. + * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. + * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. + */ + let statement = node.parent && node.parent.parent; + + while ( + statement.type === "UnaryExpression" && ["!", "~", "+", "-"].indexOf(statement.operator) > -1 || + statement.type === "AssignmentExpression" || + statement.type === "LogicalExpression" || + statement.type === "SequenceExpression" || + statement.type === "VariableDeclarator" + ) { + statement = statement.parent; + } + + return (statement.type === "ExpressionStatement" || statement.type === "VariableDeclaration") && statement.parent.type === "Program"; + } + + /** + * Counts the number of linebreaks that follow the last non-whitespace character in a string + * @param {string} string The string to check + * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character, + * or the total number of linebreaks if the string is all whitespace. + */ + function countTrailingLinebreaks(string) { + const trailingWhitespace = string.match(/\s*$/u)[0]; + const linebreakMatches = trailingWhitespace.match(astUtils.createGlobalLinebreakMatcher()); + + return linebreakMatches === null ? 0 : linebreakMatches.length; + } + + /** + * Check indentation for lists of elements (arrays, objects, function params) + * @param {ASTNode[]} elements List of elements that should be offset + * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '[' + * @param {Token} endToken The end token of the list, e.g. ']' + * @param {number|string} offset The amount that the elements should be offset + * @returns {void} + */ + function addElementListIndent(elements, startToken, endToken, offset) { + + /** + * Gets the first token of a given element, including surrounding parentheses. + * @param {ASTNode} element A node in the `elements` list + * @returns {Token} The first token of this element + */ + function getFirstToken(element) { + let token = sourceCode.getTokenBefore(element); + + while (astUtils.isOpeningParenToken(token) && token !== startToken) { + token = sourceCode.getTokenBefore(token); + } + return sourceCode.getTokenAfter(token); + } + + // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) + offsets.setDesiredOffsets( + [startToken.range[1], endToken.range[0]], + startToken, + typeof offset === "number" ? offset : 1 + ); + offsets.setDesiredOffset(endToken, startToken, 0); + + // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. + if (offset === "first" && elements.length && !elements[0]) { + return; + } + elements.forEach((element, index) => { + if (!element) { + + // Skip holes in arrays + return; + } + if (offset === "off") { + + // Ignore the first token of every element if the "off" option is used + offsets.ignoreToken(getFirstToken(element)); + } + + // Offset the following elements correctly relative to the first element + if (index === 0) { + return; + } + if (offset === "first" && tokenInfo.isFirstTokenOfLine(getFirstToken(element))) { + offsets.matchOffsetOf(getFirstToken(elements[0]), getFirstToken(element)); + } else { + const previousElement = elements[index - 1]; + const firstTokenOfPreviousElement = previousElement && getFirstToken(previousElement); + const previousElementLastToken = previousElement && sourceCode.getLastToken(previousElement); + + if ( + previousElement && + previousElementLastToken.loc.end.line - countTrailingLinebreaks(previousElementLastToken.value) > startToken.loc.end.line + ) { + offsets.setDesiredOffsets( + [previousElement.range[1], element.range[1]], + firstTokenOfPreviousElement, + 0 + ); + } + } + }); + } + + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function addBlocklessNodeIndent(node) { + if (node.type !== "BlockStatement") { + const lastParentToken = sourceCode.getTokenBefore(node, astUtils.isNotOpeningParenToken); + + let firstBodyToken = sourceCode.getFirstToken(node); + let lastBodyToken = sourceCode.getLastToken(node); + + while ( + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)) && + astUtils.isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken)) + ) { + firstBodyToken = sourceCode.getTokenBefore(firstBodyToken); + lastBodyToken = sourceCode.getTokenAfter(lastBodyToken); + } + + offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1); + + /* + * For blockless nodes with semicolon-first style, don't indent the semicolon. + * e.g. + * if (foo) bar() + * ; [1, 2, 3].map(foo) + */ + const lastToken = sourceCode.getLastToken(node); + + if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) { + offsets.setDesiredOffset(lastToken, lastParentToken, 0); + } + } + } + + /** + * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`) + * @param {ASTNode} node A CallExpression or NewExpression node + * @returns {void} + */ + function addFunctionCallIndent(node) { + let openingParen; + + if (node.arguments.length) { + openingParen = sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], astUtils.isOpeningParenToken); + } else { + openingParen = sourceCode.getLastToken(node, 1); + } + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + + const offsetAfterToken = node.callee.type === "TaggedTemplateExpression" ? sourceCode.getFirstToken(node.callee.quasi) : openingParen; + const offsetToken = sourceCode.getTokenBefore(offsetAfterToken); + + offsets.setDesiredOffset(openingParen, offsetToken, 0); + + addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments); + } + + /** + * Checks the indentation of parenthesized values, given a list of tokens in a program + * @param {Token[]} tokens A list of tokens + * @returns {void} + */ + function addParensIndent(tokens) { + const parenStack = []; + const parenPairs = []; + + tokens.forEach(nextToken => { + + // Accumulate a list of parenthesis pairs + if (astUtils.isOpeningParenToken(nextToken)) { + parenStack.push(nextToken); + } else if (astUtils.isClosingParenToken(nextToken)) { + parenPairs.unshift({ left: parenStack.pop(), right: nextToken }); + } + }); + + parenPairs.forEach(pair => { + const leftParen = pair.left; + const rightParen = pair.right; + + // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. + if (!parameterParens.has(leftParen) && !parameterParens.has(rightParen)) { + const parenthesizedTokens = new Set(sourceCode.getTokensBetween(leftParen, rightParen)); + + parenthesizedTokens.forEach(token => { + if (!parenthesizedTokens.has(offsets.getFirstDependency(token))) { + offsets.setDesiredOffset(token, leftParen, 1); + } + }); + } + + offsets.setDesiredOffset(rightParen, leftParen, 0); + }); + } + + /** + * Ignore all tokens within an unknown node whose offset do not depend + * on another token's offset within the unknown node + * @param {ASTNode} node Unknown Node + * @returns {void} + */ + function ignoreNode(node) { + const unknownNodeTokens = new Set(sourceCode.getTokens(node, { includeComments: true })); + + unknownNodeTokens.forEach(token => { + if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { + const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); + + if (token === firstTokenOfLine) { + offsets.ignoreToken(token); + } else { + offsets.setDesiredOffset(token, firstTokenOfLine, 0); + } + } + }); + } + + /** + * Check whether the given token is on the first line of a statement. + * @param {Token} token The token to check. + * @param {ASTNode} leafNode The expression node that the token belongs directly. + * @returns {boolean} `true` if the token is on the first line of a statement. + */ + function isOnFirstLineOfStatement(token, leafNode) { + let node = leafNode; + + while (node.parent && !node.parent.type.endsWith("Statement") && !node.parent.type.endsWith("Declaration")) { + node = node.parent; + } + node = node.parent; + + return !node || node.loc.start.line === token.loc.start.line; + } + + /** + * Check whether there are any blank (whitespace-only) lines between + * two tokens on separate lines. + * @param {Token} firstToken The first token. + * @param {Token} secondToken The second token. + * @returns {boolean} `true` if the tokens are on separate lines and + * there exists a blank line between them, `false` otherwise. + */ + function hasBlankLinesBetween(firstToken, secondToken) { + const firstTokenLine = firstToken.loc.end.line; + const secondTokenLine = secondToken.loc.start.line; + + if (firstTokenLine === secondTokenLine || firstTokenLine === secondTokenLine - 1) { + return false; + } + + for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { + if (!tokenInfo.firstTokensByLineNumber.has(line)) { + return true; + } + } + + return false; + } + + const ignoredNodeFirstTokens = new Set(); + + const baseOffsetListeners = { + "ArrayExpression, ArrayPattern"(node) { + const openingBracket = sourceCode.getFirstToken(node); + const closingBracket = sourceCode.getTokenAfter(lodash.findLast(node.elements) || openingBracket, astUtils.isClosingBracketToken); + + addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression); + }, + + "ObjectExpression, ObjectPattern"(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getTokenAfter( + node.properties.length ? node.properties[node.properties.length - 1] : openingCurly, + astUtils.isClosingBraceToken + ); + + addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression); + }, + + ArrowFunctionExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + + if (astUtils.isOpeningParenToken(firstToken)) { + const openingParen = firstToken; + const closingParen = sourceCode.getTokenBefore(node.body, astUtils.isClosingParenToken); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options.FunctionExpression.parameters); + } + addBlocklessNodeIndent(node.body); + }, + + AssignmentExpression(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + offsets.setDesiredOffsets([operator.range[0], node.range[1]], sourceCode.getLastToken(node.left), 1); + offsets.ignoreToken(operator); + offsets.ignoreToken(sourceCode.getTokenAfter(operator)); + }, + + "BinaryExpression, LogicalExpression"(node) { + const operator = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + + /* + * For backwards compatibility, don't check BinaryExpression indents, e.g. + * var foo = bar && + * baz; + */ + + const tokenAfterOperator = sourceCode.getTokenAfter(operator); + + offsets.ignoreToken(operator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffset(tokenAfterOperator, operator, 0); + }, + + "BlockStatement, ClassBody"(node) { + let blockIndentLevel; + + if (node.parent && isOuterIIFE(node.parent)) { + blockIndentLevel = options.outerIIFEBody; + } else if (node.parent && (node.parent.type === "FunctionExpression" || node.parent.type === "ArrowFunctionExpression")) { + blockIndentLevel = options.FunctionExpression.body; + } else if (node.parent && node.parent.type === "FunctionDeclaration") { + blockIndentLevel = options.FunctionDeclaration.body; + } else { + blockIndentLevel = 1; + } + + /* + * For blocks that aren't lone statements, ensure that the opening curly brace + * is aligned with the parent. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) { + offsets.setDesiredOffset(sourceCode.getFirstToken(node), sourceCode.getFirstToken(node.parent), 0); + } + + addElementListIndent(node.body, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), blockIndentLevel); + }, + + CallExpression: addFunctionCallIndent, + + "ClassDeclaration[superClass], ClassExpression[superClass]"(node) { + const classToken = sourceCode.getFirstToken(node); + const extendsToken = sourceCode.getTokenBefore(node.superClass, astUtils.isNotOpeningParenToken); + + offsets.setDesiredOffsets([extendsToken.range[0], node.body.range[0]], classToken, 1); + }, + + ConditionalExpression(node) { + const firstToken = sourceCode.getFirstToken(node); + + // `flatTernaryExpressions` option is for the following style: + // var a = + // foo > 0 ? bar : + // foo < 0 ? baz : + // /*else*/ qiz ; + if (!options.flatTernaryExpressions || + !astUtils.isTokenOnSameLine(node.test, node.consequent) || + isOnFirstLineOfStatement(firstToken, node) + ) { + const questionMarkToken = sourceCode.getFirstTokenBetween(node.test, node.consequent, token => token.type === "Punctuator" && token.value === "?"); + const colonToken = sourceCode.getFirstTokenBetween(node.consequent, node.alternate, token => token.type === "Punctuator" && token.value === ":"); + + const firstConsequentToken = sourceCode.getTokenAfter(questionMarkToken); + const lastConsequentToken = sourceCode.getTokenBefore(colonToken); + const firstAlternateToken = sourceCode.getTokenAfter(colonToken); + + offsets.setDesiredOffset(questionMarkToken, firstToken, 1); + offsets.setDesiredOffset(colonToken, firstToken, 1); + + offsets.setDesiredOffset(firstConsequentToken, firstToken, + options.offsetTernaryExpressions ? 2 : 1); + + /* + * The alternate and the consequent should usually have the same indentation. + * If they share part of a line, align the alternate against the first token of the consequent. + * This allows the alternate to be indented correctly in cases like this: + * foo ? ( + * bar + * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` + * baz // as a result, `baz` is offset by 1 rather than 2 + * ) + */ + if (lastConsequentToken.loc.end.line === firstAlternateToken.loc.start.line) { + offsets.setDesiredOffset(firstAlternateToken, firstConsequentToken, 0); + } else { + + /** + * If the alternate and consequent do not share part of a line, offset the alternate from the first + * token of the conditional expression. For example: + * foo ? bar + * : baz + * + * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up + * having no expected indentation. + */ + offsets.setDesiredOffset(firstAlternateToken, firstToken, + firstAlternateToken.type === "Punctuator" && + options.offsetTernaryExpressions ? 2 : 1); + } + } + }, + + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body), + + ExportNamedDeclaration(node) { + if (node.declaration === null) { + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + // Indent the specifiers in `export {foo, bar, baz}` + addElementListIndent(node.specifiers, sourceCode.getFirstToken(node, { skip: 1 }), closingCurly, 1); + + if (node.source) { + + // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` + offsets.setDesiredOffsets([closingCurly.range[1], node.range[1]], sourceCode.getFirstToken(node), 1); + } + } + }, + + ForStatement(node) { + const forOpeningParen = sourceCode.getFirstToken(node, 1); + + if (node.init) { + offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); + } + if (node.test) { + offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); + } + if (node.update) { + offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); + } + addBlocklessNodeIndent(node.body); + }, + + "FunctionDeclaration, FunctionExpression"(node) { + const closingParen = sourceCode.getTokenBefore(node.body); + const openingParen = sourceCode.getTokenBefore(node.params.length ? node.params[0] : closingParen); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + addElementListIndent(node.params, openingParen, closingParen, options[node.type].parameters); + }, + + IfStatement(node) { + addBlocklessNodeIndent(node.consequent); + if (node.alternate && node.alternate.type !== "IfStatement") { + addBlocklessNodeIndent(node.alternate); + } + }, + + ImportDeclaration(node) { + if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) { + const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node, astUtils.isClosingBraceToken); + + addElementListIndent(node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"), openingCurly, closingCurly, options.ImportDeclaration); + } + + const fromToken = sourceCode.getLastToken(node, token => token.type === "Identifier" && token.value === "from"); + const sourceToken = sourceCode.getLastToken(node, token => token.type === "String"); + const semiToken = sourceCode.getLastToken(node, token => token.type === "Punctuator" && token.value === ";"); + + if (fromToken) { + const end = semiToken && semiToken.range[1] === sourceToken.range[1] ? node.range[1] : sourceToken.range[1]; + + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); + } + }, + + ImportExpression(node) { + const openingParen = sourceCode.getFirstToken(node, 1); + const closingParen = sourceCode.getLastToken(node); + + parameterParens.add(openingParen); + parameterParens.add(closingParen); + offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0); + + addElementListIndent([node.source], openingParen, closingParen, options.CallExpression.arguments); + }, + + "MemberExpression, JSXMemberExpression, MetaProperty"(node) { + const object = node.type === "MetaProperty" ? node.meta : node.object; + const firstNonObjectToken = sourceCode.getFirstTokenBetween(object, node.property, astUtils.isNotClosingParenToken); + const secondNonObjectToken = sourceCode.getTokenAfter(firstNonObjectToken); + + const objectParenCount = sourceCode.getTokensBetween(object, node.property, { filter: astUtils.isClosingParenToken }).length; + const firstObjectToken = objectParenCount + ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 }) + : sourceCode.getFirstToken(object); + const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken); + const firstPropertyToken = node.computed ? firstNonObjectToken : secondNonObjectToken; + + if (node.computed) { + + // For computed MemberExpressions, match the closing bracket with the opening bracket. + offsets.setDesiredOffset(sourceCode.getLastToken(node), firstNonObjectToken, 0); + offsets.setDesiredOffsets(node.property.range, firstNonObjectToken, 1); + } + + /* + * If the object ends on the same line that the property starts, match against the last token + * of the object, to ensure that the MemberExpression is not indented. + * + * Otherwise, match against the first token of the object, e.g. + * foo + * .bar + * .baz // <-- offset by 1 from `foo` + */ + const offsetBase = lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line + ? lastObjectToken + : firstObjectToken; + + if (typeof options.MemberExpression === "number") { + + // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, options.MemberExpression); + + /* + * For computed MemberExpressions, match the first token of the property against the opening bracket. + * Otherwise, match the first token of the property against the object. + */ + offsets.setDesiredOffset(secondNonObjectToken, node.computed ? firstNonObjectToken : offsetBase, options.MemberExpression); + } else { + + // If the MemberExpression option is off, ignore the dot and the first token of the property. + offsets.ignoreToken(firstNonObjectToken); + offsets.ignoreToken(secondNonObjectToken); + + // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. + offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); + offsets.setDesiredOffset(secondNonObjectToken, firstNonObjectToken, 0); + } + }, + + NewExpression(node) { + + // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` + if (node.arguments.length > 0 || + astUtils.isClosingParenToken(sourceCode.getLastToken(node)) && + astUtils.isOpeningParenToken(sourceCode.getLastToken(node, 1))) { + addFunctionCallIndent(node); + } + }, + + Property(node) { + if (!node.shorthand && !node.method && node.kind === "init") { + const colon = sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isColonToken); + + offsets.ignoreToken(sourceCode.getTokenAfter(colon)); + } + }, + + SwitchStatement(node) { + const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets([openingCurly.range[1], closingCurly.range[0]], openingCurly, options.SwitchCase); + + if (node.cases.length) { + sourceCode.getTokensBetween( + node.cases[node.cases.length - 1], + closingCurly, + { includeComments: true, filter: astUtils.isCommentToken } + ).forEach(token => offsets.ignoreToken(token)); + } + }, + + SwitchCase(node) { + if (!(node.consequent.length === 1 && node.consequent[0].type === "BlockStatement")) { + const caseKeyword = sourceCode.getFirstToken(node); + const tokenAfterCurrentCase = sourceCode.getTokenAfter(node); + + offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); + } + }, + + TemplateLiteral(node) { + node.expressions.forEach((expression, index) => { + const previousQuasi = node.quasis[index]; + const nextQuasi = node.quasis[index + 1]; + const tokenToAlignFrom = previousQuasi.loc.start.line === previousQuasi.loc.end.line + ? sourceCode.getFirstToken(previousQuasi) + : null; + + offsets.setDesiredOffsets([previousQuasi.range[1], nextQuasi.range[0]], tokenToAlignFrom, 1); + offsets.setDesiredOffset(sourceCode.getFirstToken(nextQuasi), tokenToAlignFrom, 0); + }); + }, + + VariableDeclaration(node) { + let variableIndent = Object.prototype.hasOwnProperty.call(options.VariableDeclarator, node.kind) + ? options.VariableDeclarator[node.kind] + : DEFAULT_VARIABLE_INDENT; + + const firstToken = sourceCode.getFirstToken(node), + lastToken = sourceCode.getLastToken(node); + + if (options.VariableDeclarator[node.kind] === "first") { + if (node.declarations.length > 1) { + addElementListIndent( + node.declarations, + firstToken, + lastToken, + "first" + ); + return; + } + + variableIndent = DEFAULT_VARIABLE_INDENT; + } + + if (node.declarations[node.declarations.length - 1].loc.start.line > node.loc.start.line) { + + /* + * VariableDeclarator indentation is a bit different from other forms of indentation, in that the + * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, + * the following indentations are correct: + * + * var foo = { + * ok: true + * }; + * + * var foo = { + * ok: true, + * }, + * bar = 1; + * + * Account for when exiting the AST (after indentations have already been set for the nodes in + * the declaration) by manually increasing the indentation level of the tokens in this declarator + * on the same line as the start of the declaration, provided that there are declarators that + * follow this one. + */ + offsets.setDesiredOffsets(node.range, firstToken, variableIndent, true); + } else { + offsets.setDesiredOffsets(node.range, firstToken, variableIndent); + } + + if (astUtils.isSemicolonToken(lastToken)) { + offsets.ignoreToken(lastToken); + } + }, + + VariableDeclarator(node) { + if (node.init) { + const equalOperator = sourceCode.getTokenBefore(node.init, astUtils.isNotOpeningParenToken); + const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator); + + offsets.ignoreToken(equalOperator); + offsets.ignoreToken(tokenAfterOperator); + offsets.setDesiredOffsets([tokenAfterOperator.range[0], node.range[1]], equalOperator, 1); + offsets.setDesiredOffset(equalOperator, sourceCode.getLastToken(node.id), 0); + } + }, + + "JSXAttribute[value]"(node) { + const equalsToken = sourceCode.getFirstTokenBetween(node.name, node.value, token => token.type === "Punctuator" && token.value === "="); + + offsets.setDesiredOffsets([equalsToken.range[0], node.value.range[1]], sourceCode.getFirstToken(node.name), 1); + }, + + JSXElement(node) { + if (node.closingElement) { + addElementListIndent(node.children, sourceCode.getFirstToken(node.openingElement), sourceCode.getFirstToken(node.closingElement), 1); + } + }, + + JSXOpeningElement(node) { + const firstToken = sourceCode.getFirstToken(node); + let closingToken; + + if (node.selfClosing) { + closingToken = sourceCode.getLastToken(node, { skip: 1 }); + offsets.setDesiredOffset(sourceCode.getLastToken(node), closingToken, 0); + } else { + closingToken = sourceCode.getLastToken(node); + } + offsets.setDesiredOffsets(node.name.range, sourceCode.getFirstToken(node)); + addElementListIndent(node.attributes, firstToken, closingToken, 1); + }, + + JSXClosingElement(node) { + const firstToken = sourceCode.getFirstToken(node); + + offsets.setDesiredOffsets(node.name.range, firstToken, 1); + }, + + JSXFragment(node) { + const firstOpeningToken = sourceCode.getFirstToken(node.openingFragment); + const firstClosingToken = sourceCode.getFirstToken(node.closingFragment); + + addElementListIndent(node.children, firstOpeningToken, firstClosingToken, 1); + }, + + JSXOpeningFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const closingToken = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, closingToken); + }, + + JSXClosingFragment(node) { + const firstToken = sourceCode.getFirstToken(node); + const slashToken = sourceCode.getLastToken(node, { skip: 1 }); + const closingToken = sourceCode.getLastToken(node); + const tokenToMatch = astUtils.isTokenOnSameLine(slashToken, closingToken) ? slashToken : closingToken; + + offsets.setDesiredOffsets(node.range, firstToken, 1); + offsets.matchOffsetOf(firstToken, tokenToMatch); + }, + + JSXExpressionContainer(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + JSXSpreadAttribute(node) { + const openingCurly = sourceCode.getFirstToken(node); + const closingCurly = sourceCode.getLastToken(node); + + offsets.setDesiredOffsets( + [openingCurly.range[1], closingCurly.range[0]], + openingCurly, + 1 + ); + }, + + "*"(node) { + const firstToken = sourceCode.getFirstToken(node); + + // Ensure that the children of every node are indented at least as much as the first token. + if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { + offsets.setDesiredOffsets(node.range, firstToken, 0); + } + } + }; + + const listenerCallQueue = []; + + /* + * To ignore the indentation of a node: + * 1. Don't call the node's listener when entering it (if it has a listener) + * 2. Don't set any offsets against the first token of the node. + * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. + */ + const offsetListeners = lodash.mapValues( + baseOffsetListeners, + + /* + * Offset listener calls are deferred until traversal is finished, and are called as + * part of the final `Program:exit` listener. This is necessary because a node might + * be matched by multiple selectors. + * + * Example: Suppose there is an offset listener for `Identifier`, and the user has + * specified in configuration that `MemberExpression > Identifier` should be ignored. + * Due to selector specificity rules, the `Identifier` listener will get called first. However, + * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener + * should not have been called at all. Without doing extra selector matching, we don't know + * whether the Identifier matches the `MemberExpression > Identifier` selector until the + * `MemberExpression > Identifier` listener is called. + * + * To avoid this, the `Identifier` listener isn't called until traversal finishes and all + * ignored nodes are known. + */ + listener => + node => + listenerCallQueue.push({ listener, node }) + ); + + // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. + const ignoredNodes = new Set(); + + /** + * Ignores a node + * @param {ASTNode} node The node to ignore + * @returns {void} + */ + function addToIgnoredNodes(node) { + ignoredNodes.add(node); + ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); + } + + const ignoredNodeListeners = options.ignoredNodes.reduce( + (listeners, ignoredSelector) => Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), + {} + ); + + /* + * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation + * at the end. + * + * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears + * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, + * so those listeners wouldn't be called anyway. + */ + return Object.assign( + offsetListeners, + ignoredNodeListeners, + { + "*:exit"(node) { + + // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. + if (!KNOWN_NODES.has(node.type)) { + addToIgnoredNodes(node); + } + }, + "Program:exit"() { + + // If ignoreComments option is enabled, ignore all comment tokens. + if (options.ignoreComments) { + sourceCode.getAllComments() + .forEach(comment => offsets.ignoreToken(comment)); + } + + // Invoke the queued offset listeners for the nodes that aren't ignored. + listenerCallQueue + .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) + .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); + + // Update the offsets for ignored nodes to prevent their child tokens from being reported. + ignoredNodes.forEach(ignoreNode); + + addParensIndent(sourceCode.ast.tokens); + + /* + * Create a Map from (tokenOrComment) => (precedingToken). + * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. + */ + const precedingTokens = sourceCode.ast.comments.reduce((commentMap, comment) => { + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return commentMap.set(comment, commentMap.has(tokenOrCommentBefore) ? commentMap.get(tokenOrCommentBefore) : tokenOrCommentBefore); + }, new WeakMap()); + + sourceCode.lines.forEach((line, lineIndex) => { + const lineNumber = lineIndex + 1; + + if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { + + // Don't check indentation on blank lines + return; + } + + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(lineNumber); + + if (firstTokenOfLine.loc.start.line !== lineNumber) { + + // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. + return; + } + + if (astUtils.isCommentToken(firstTokenOfLine)) { + const tokenBefore = precedingTokens.get(firstTokenOfLine); + const tokenAfter = tokenBefore ? sourceCode.getTokenAfter(tokenBefore) : sourceCode.ast.tokens[0]; + const mayAlignWithBefore = tokenBefore && !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); + const mayAlignWithAfter = tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); + + /* + * If a comment precedes a line that begins with a semicolon token, align to that token, i.e. + * + * let foo + * // comment + * ;(async () => {})() + */ + if (tokenAfter && astUtils.isSemicolonToken(tokenAfter) && !astUtils.isTokenOnSameLine(firstTokenOfLine, tokenAfter)) { + offsets.setDesiredOffset(firstTokenOfLine, tokenAfter, 0); + } + + // If a comment matches the expected indentation of the token immediately before or after, don't report it. + if ( + mayAlignWithBefore && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore)) || + mayAlignWithAfter && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)) + ) { + return; + } + } + + // If the token matches the expected indentation, don't report it. + if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { + return; + } + + // Otherwise, report the token/comment. + report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); + }); + } + } + ); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/index.js b/day1/cli-study/node_modules/eslint/lib/rules/index.js new file mode 100644 index 0000000..567cd4a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/index.js @@ -0,0 +1,296 @@ +/** + * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without + * using the file-system directly. + * @author Peter (Somogyvari) Metz + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map"); + +/** @type {Map} */ +module.exports = new LazyLoadingRuleMap(Object.entries({ + "accessor-pairs": () => require("./accessor-pairs"), + "array-bracket-newline": () => require("./array-bracket-newline"), + "array-bracket-spacing": () => require("./array-bracket-spacing"), + "array-callback-return": () => require("./array-callback-return"), + "array-element-newline": () => require("./array-element-newline"), + "arrow-body-style": () => require("./arrow-body-style"), + "arrow-parens": () => require("./arrow-parens"), + "arrow-spacing": () => require("./arrow-spacing"), + "block-scoped-var": () => require("./block-scoped-var"), + "block-spacing": () => require("./block-spacing"), + "brace-style": () => require("./brace-style"), + "callback-return": () => require("./callback-return"), + camelcase: () => require("./camelcase"), + "capitalized-comments": () => require("./capitalized-comments"), + "class-methods-use-this": () => require("./class-methods-use-this"), + "comma-dangle": () => require("./comma-dangle"), + "comma-spacing": () => require("./comma-spacing"), + "comma-style": () => require("./comma-style"), + complexity: () => require("./complexity"), + "computed-property-spacing": () => require("./computed-property-spacing"), + "consistent-return": () => require("./consistent-return"), + "consistent-this": () => require("./consistent-this"), + "constructor-super": () => require("./constructor-super"), + curly: () => require("./curly"), + "default-case": () => require("./default-case"), + "default-case-last": () => require("./default-case-last"), + "default-param-last": () => require("./default-param-last"), + "dot-location": () => require("./dot-location"), + "dot-notation": () => require("./dot-notation"), + "eol-last": () => require("./eol-last"), + eqeqeq: () => require("./eqeqeq"), + "for-direction": () => require("./for-direction"), + "func-call-spacing": () => require("./func-call-spacing"), + "func-name-matching": () => require("./func-name-matching"), + "func-names": () => require("./func-names"), + "func-style": () => require("./func-style"), + "function-call-argument-newline": () => require("./function-call-argument-newline"), + "function-paren-newline": () => require("./function-paren-newline"), + "generator-star-spacing": () => require("./generator-star-spacing"), + "getter-return": () => require("./getter-return"), + "global-require": () => require("./global-require"), + "grouped-accessor-pairs": () => require("./grouped-accessor-pairs"), + "guard-for-in": () => require("./guard-for-in"), + "handle-callback-err": () => require("./handle-callback-err"), + "id-blacklist": () => require("./id-blacklist"), + "id-length": () => require("./id-length"), + "id-match": () => require("./id-match"), + "implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"), + indent: () => require("./indent"), + "indent-legacy": () => require("./indent-legacy"), + "init-declarations": () => require("./init-declarations"), + "jsx-quotes": () => require("./jsx-quotes"), + "key-spacing": () => require("./key-spacing"), + "keyword-spacing": () => require("./keyword-spacing"), + "line-comment-position": () => require("./line-comment-position"), + "linebreak-style": () => require("./linebreak-style"), + "lines-around-comment": () => require("./lines-around-comment"), + "lines-around-directive": () => require("./lines-around-directive"), + "lines-between-class-members": () => require("./lines-between-class-members"), + "max-classes-per-file": () => require("./max-classes-per-file"), + "max-depth": () => require("./max-depth"), + "max-len": () => require("./max-len"), + "max-lines": () => require("./max-lines"), + "max-lines-per-function": () => require("./max-lines-per-function"), + "max-nested-callbacks": () => require("./max-nested-callbacks"), + "max-params": () => require("./max-params"), + "max-statements": () => require("./max-statements"), + "max-statements-per-line": () => require("./max-statements-per-line"), + "multiline-comment-style": () => require("./multiline-comment-style"), + "multiline-ternary": () => require("./multiline-ternary"), + "new-cap": () => require("./new-cap"), + "new-parens": () => require("./new-parens"), + "newline-after-var": () => require("./newline-after-var"), + "newline-before-return": () => require("./newline-before-return"), + "newline-per-chained-call": () => require("./newline-per-chained-call"), + "no-alert": () => require("./no-alert"), + "no-array-constructor": () => require("./no-array-constructor"), + "no-async-promise-executor": () => require("./no-async-promise-executor"), + "no-await-in-loop": () => require("./no-await-in-loop"), + "no-bitwise": () => require("./no-bitwise"), + "no-buffer-constructor": () => require("./no-buffer-constructor"), + "no-caller": () => require("./no-caller"), + "no-case-declarations": () => require("./no-case-declarations"), + "no-catch-shadow": () => require("./no-catch-shadow"), + "no-class-assign": () => require("./no-class-assign"), + "no-compare-neg-zero": () => require("./no-compare-neg-zero"), + "no-cond-assign": () => require("./no-cond-assign"), + "no-confusing-arrow": () => require("./no-confusing-arrow"), + "no-console": () => require("./no-console"), + "no-const-assign": () => require("./no-const-assign"), + "no-constant-condition": () => require("./no-constant-condition"), + "no-constructor-return": () => require("./no-constructor-return"), + "no-continue": () => require("./no-continue"), + "no-control-regex": () => require("./no-control-regex"), + "no-debugger": () => require("./no-debugger"), + "no-delete-var": () => require("./no-delete-var"), + "no-div-regex": () => require("./no-div-regex"), + "no-dupe-args": () => require("./no-dupe-args"), + "no-dupe-class-members": () => require("./no-dupe-class-members"), + "no-dupe-else-if": () => require("./no-dupe-else-if"), + "no-dupe-keys": () => require("./no-dupe-keys"), + "no-duplicate-case": () => require("./no-duplicate-case"), + "no-duplicate-imports": () => require("./no-duplicate-imports"), + "no-else-return": () => require("./no-else-return"), + "no-empty": () => require("./no-empty"), + "no-empty-character-class": () => require("./no-empty-character-class"), + "no-empty-function": () => require("./no-empty-function"), + "no-empty-pattern": () => require("./no-empty-pattern"), + "no-eq-null": () => require("./no-eq-null"), + "no-eval": () => require("./no-eval"), + "no-ex-assign": () => require("./no-ex-assign"), + "no-extend-native": () => require("./no-extend-native"), + "no-extra-bind": () => require("./no-extra-bind"), + "no-extra-boolean-cast": () => require("./no-extra-boolean-cast"), + "no-extra-label": () => require("./no-extra-label"), + "no-extra-parens": () => require("./no-extra-parens"), + "no-extra-semi": () => require("./no-extra-semi"), + "no-fallthrough": () => require("./no-fallthrough"), + "no-floating-decimal": () => require("./no-floating-decimal"), + "no-func-assign": () => require("./no-func-assign"), + "no-global-assign": () => require("./no-global-assign"), + "no-implicit-coercion": () => require("./no-implicit-coercion"), + "no-implicit-globals": () => require("./no-implicit-globals"), + "no-implied-eval": () => require("./no-implied-eval"), + "no-import-assign": () => require("./no-import-assign"), + "no-inline-comments": () => require("./no-inline-comments"), + "no-inner-declarations": () => require("./no-inner-declarations"), + "no-invalid-regexp": () => require("./no-invalid-regexp"), + "no-invalid-this": () => require("./no-invalid-this"), + "no-irregular-whitespace": () => require("./no-irregular-whitespace"), + "no-iterator": () => require("./no-iterator"), + "no-label-var": () => require("./no-label-var"), + "no-labels": () => require("./no-labels"), + "no-lone-blocks": () => require("./no-lone-blocks"), + "no-lonely-if": () => require("./no-lonely-if"), + "no-loop-func": () => require("./no-loop-func"), + "no-loss-of-precision": () => require("./no-loss-of-precision"), + "no-magic-numbers": () => require("./no-magic-numbers"), + "no-misleading-character-class": () => require("./no-misleading-character-class"), + "no-mixed-operators": () => require("./no-mixed-operators"), + "no-mixed-requires": () => require("./no-mixed-requires"), + "no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"), + "no-multi-assign": () => require("./no-multi-assign"), + "no-multi-spaces": () => require("./no-multi-spaces"), + "no-multi-str": () => require("./no-multi-str"), + "no-multiple-empty-lines": () => require("./no-multiple-empty-lines"), + "no-native-reassign": () => require("./no-native-reassign"), + "no-negated-condition": () => require("./no-negated-condition"), + "no-negated-in-lhs": () => require("./no-negated-in-lhs"), + "no-nested-ternary": () => require("./no-nested-ternary"), + "no-new": () => require("./no-new"), + "no-new-func": () => require("./no-new-func"), + "no-new-object": () => require("./no-new-object"), + "no-new-require": () => require("./no-new-require"), + "no-new-symbol": () => require("./no-new-symbol"), + "no-new-wrappers": () => require("./no-new-wrappers"), + "no-obj-calls": () => require("./no-obj-calls"), + "no-octal": () => require("./no-octal"), + "no-octal-escape": () => require("./no-octal-escape"), + "no-param-reassign": () => require("./no-param-reassign"), + "no-path-concat": () => require("./no-path-concat"), + "no-plusplus": () => require("./no-plusplus"), + "no-process-env": () => require("./no-process-env"), + "no-process-exit": () => require("./no-process-exit"), + "no-promise-executor-return": () => require("./no-promise-executor-return"), + "no-proto": () => require("./no-proto"), + "no-prototype-builtins": () => require("./no-prototype-builtins"), + "no-redeclare": () => require("./no-redeclare"), + "no-regex-spaces": () => require("./no-regex-spaces"), + "no-restricted-exports": () => require("./no-restricted-exports"), + "no-restricted-globals": () => require("./no-restricted-globals"), + "no-restricted-imports": () => require("./no-restricted-imports"), + "no-restricted-modules": () => require("./no-restricted-modules"), + "no-restricted-properties": () => require("./no-restricted-properties"), + "no-restricted-syntax": () => require("./no-restricted-syntax"), + "no-return-assign": () => require("./no-return-assign"), + "no-return-await": () => require("./no-return-await"), + "no-script-url": () => require("./no-script-url"), + "no-self-assign": () => require("./no-self-assign"), + "no-self-compare": () => require("./no-self-compare"), + "no-sequences": () => require("./no-sequences"), + "no-setter-return": () => require("./no-setter-return"), + "no-shadow": () => require("./no-shadow"), + "no-shadow-restricted-names": () => require("./no-shadow-restricted-names"), + "no-spaced-func": () => require("./no-spaced-func"), + "no-sparse-arrays": () => require("./no-sparse-arrays"), + "no-sync": () => require("./no-sync"), + "no-tabs": () => require("./no-tabs"), + "no-template-curly-in-string": () => require("./no-template-curly-in-string"), + "no-ternary": () => require("./no-ternary"), + "no-this-before-super": () => require("./no-this-before-super"), + "no-throw-literal": () => require("./no-throw-literal"), + "no-trailing-spaces": () => require("./no-trailing-spaces"), + "no-undef": () => require("./no-undef"), + "no-undef-init": () => require("./no-undef-init"), + "no-undefined": () => require("./no-undefined"), + "no-underscore-dangle": () => require("./no-underscore-dangle"), + "no-unexpected-multiline": () => require("./no-unexpected-multiline"), + "no-unmodified-loop-condition": () => require("./no-unmodified-loop-condition"), + "no-unneeded-ternary": () => require("./no-unneeded-ternary"), + "no-unreachable": () => require("./no-unreachable"), + "no-unreachable-loop": () => require("./no-unreachable-loop"), + "no-unsafe-finally": () => require("./no-unsafe-finally"), + "no-unsafe-negation": () => require("./no-unsafe-negation"), + "no-unused-expressions": () => require("./no-unused-expressions"), + "no-unused-labels": () => require("./no-unused-labels"), + "no-unused-vars": () => require("./no-unused-vars"), + "no-use-before-define": () => require("./no-use-before-define"), + "no-useless-backreference": () => require("./no-useless-backreference"), + "no-useless-call": () => require("./no-useless-call"), + "no-useless-catch": () => require("./no-useless-catch"), + "no-useless-computed-key": () => require("./no-useless-computed-key"), + "no-useless-concat": () => require("./no-useless-concat"), + "no-useless-constructor": () => require("./no-useless-constructor"), + "no-useless-escape": () => require("./no-useless-escape"), + "no-useless-rename": () => require("./no-useless-rename"), + "no-useless-return": () => require("./no-useless-return"), + "no-var": () => require("./no-var"), + "no-void": () => require("./no-void"), + "no-warning-comments": () => require("./no-warning-comments"), + "no-whitespace-before-property": () => require("./no-whitespace-before-property"), + "no-with": () => require("./no-with"), + "nonblock-statement-body-position": () => require("./nonblock-statement-body-position"), + "object-curly-newline": () => require("./object-curly-newline"), + "object-curly-spacing": () => require("./object-curly-spacing"), + "object-property-newline": () => require("./object-property-newline"), + "object-shorthand": () => require("./object-shorthand"), + "one-var": () => require("./one-var"), + "one-var-declaration-per-line": () => require("./one-var-declaration-per-line"), + "operator-assignment": () => require("./operator-assignment"), + "operator-linebreak": () => require("./operator-linebreak"), + "padded-blocks": () => require("./padded-blocks"), + "padding-line-between-statements": () => require("./padding-line-between-statements"), + "prefer-arrow-callback": () => require("./prefer-arrow-callback"), + "prefer-const": () => require("./prefer-const"), + "prefer-destructuring": () => require("./prefer-destructuring"), + "prefer-exponentiation-operator": () => require("./prefer-exponentiation-operator"), + "prefer-named-capture-group": () => require("./prefer-named-capture-group"), + "prefer-numeric-literals": () => require("./prefer-numeric-literals"), + "prefer-object-spread": () => require("./prefer-object-spread"), + "prefer-promise-reject-errors": () => require("./prefer-promise-reject-errors"), + "prefer-reflect": () => require("./prefer-reflect"), + "prefer-regex-literals": () => require("./prefer-regex-literals"), + "prefer-rest-params": () => require("./prefer-rest-params"), + "prefer-spread": () => require("./prefer-spread"), + "prefer-template": () => require("./prefer-template"), + "quote-props": () => require("./quote-props"), + quotes: () => require("./quotes"), + radix: () => require("./radix"), + "require-atomic-updates": () => require("./require-atomic-updates"), + "require-await": () => require("./require-await"), + "require-jsdoc": () => require("./require-jsdoc"), + "require-unicode-regexp": () => require("./require-unicode-regexp"), + "require-yield": () => require("./require-yield"), + "rest-spread-spacing": () => require("./rest-spread-spacing"), + semi: () => require("./semi"), + "semi-spacing": () => require("./semi-spacing"), + "semi-style": () => require("./semi-style"), + "sort-imports": () => require("./sort-imports"), + "sort-keys": () => require("./sort-keys"), + "sort-vars": () => require("./sort-vars"), + "space-before-blocks": () => require("./space-before-blocks"), + "space-before-function-paren": () => require("./space-before-function-paren"), + "space-in-parens": () => require("./space-in-parens"), + "space-infix-ops": () => require("./space-infix-ops"), + "space-unary-ops": () => require("./space-unary-ops"), + "spaced-comment": () => require("./spaced-comment"), + strict: () => require("./strict"), + "switch-colon-spacing": () => require("./switch-colon-spacing"), + "symbol-description": () => require("./symbol-description"), + "template-curly-spacing": () => require("./template-curly-spacing"), + "template-tag-spacing": () => require("./template-tag-spacing"), + "unicode-bom": () => require("./unicode-bom"), + "use-isnan": () => require("./use-isnan"), + "valid-jsdoc": () => require("./valid-jsdoc"), + "valid-typeof": () => require("./valid-typeof"), + "vars-on-top": () => require("./vars-on-top"), + "wrap-iife": () => require("./wrap-iife"), + "wrap-regex": () => require("./wrap-regex"), + "yield-star-spacing": () => require("./yield-star-spacing"), + yoda: () => require("./yoda") +})); diff --git a/day1/cli-study/node_modules/eslint/lib/rules/init-declarations.js b/day1/cli-study/node_modules/eslint/lib/rules/init-declarations.js new file mode 100644 index 0000000..6cfdf92 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/init-declarations.js @@ -0,0 +1,139 @@ +/** + * @fileoverview A rule to control the style of variable initializations. + * @author Colin Ihrig + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a for loop. + * @param {ASTNode} block A node to check. + * @returns {boolean} `true` when the node is a for loop. + */ +function isForLoop(block) { + return block.type === "ForInStatement" || + block.type === "ForOfStatement" || + block.type === "ForStatement"; +} + +/** + * Checks whether or not a given declarator node has its initializer. + * @param {ASTNode} node A declarator node to check. + * @returns {boolean} `true` when the node has its initializer. + */ +function isInitialized(node) { + const declaration = node.parent; + const block = declaration.parent; + + if (isForLoop(block)) { + if (block.type === "ForStatement") { + return block.init === declaration; + } + return block.left === declaration; + } + return Boolean(node.init); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow initialization in variable declarations", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/init-declarations" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + ignoreForLoopInit: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + messages: { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration." + } + }, + + create(context) { + + const MODE_ALWAYS = "always", + MODE_NEVER = "never"; + + const mode = context.options[0] || MODE_ALWAYS; + const params = context.options[1] || {}; + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration:exit"(node) { + + const kind = node.kind, + declarations = node.declarations; + + for (let i = 0; i < declarations.length; ++i) { + const declaration = declarations[i], + id = declaration.id, + initialized = isInitialized(declaration), + isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); + let messageId = ""; + + if (mode === MODE_ALWAYS && !initialized) { + messageId = "initialized"; + } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + messageId = "notInitialized"; + } + + if (id.type === "Identifier" && messageId) { + context.report({ + node: declaration, + messageId, + data: { + idName: id.name + } + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/jsx-quotes.js b/day1/cli-study/node_modules/eslint/lib/rules/jsx-quotes.js new file mode 100644 index 0000000..3b282df --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/jsx-quotes.js @@ -0,0 +1,95 @@ +/** + * @fileoverview A rule to ensure consistent quotes used in jsx syntax. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + "prefer-double": { + quote: "\"", + description: "singlequote", + convert(str) { + return str.replace(/'/gu, "\""); + } + }, + "prefer-single": { + quote: "'", + description: "doublequote", + convert(str) { + return str.replace(/"/gu, "'"); + } + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either double or single quotes in JSX attributes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/jsx-quotes" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["prefer-single", "prefer-double"] + } + ], + messages: { + unexpected: "Unexpected usage of {{description}}." + } + }, + + create(context) { + const quoteOption = context.options[0] || "prefer-double", + setting = QUOTE_SETTINGS[quoteOption]; + + /** + * Checks if the given string literal node uses the expected quotes + * @param {ASTNode} node A string literal node. + * @returns {boolean} Whether or not the string literal used the expected quotes. + * @public + */ + function usesExpectedQuotes(node) { + return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); + } + + return { + JSXAttribute(node) { + const attributeValue = node.value; + + if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { + context.report({ + node: attributeValue, + messageId: "unexpected", + data: { + description: setting.description + }, + fix(fixer) { + return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/key-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/key-spacing.js new file mode 100644 index 0000000..fc885a1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/key-spacing.js @@ -0,0 +1,674 @@ +/** + * @fileoverview Rule to specify spacing of object literal keys and values + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a string contains a line terminator as defined in + * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3 + * @param {string} str String to test. + * @returns {boolean} True if str contains a line terminator. + */ +function containsLineTerminator(str) { + return astUtils.LINEBREAK_MATCHER.test(str); +} + +/** + * Gets the last element of an array. + * @param {Array} arr An array. + * @returns {any} Last element of arr. + */ +function last(arr) { + return arr[arr.length - 1]; +} + +/** + * Checks whether a node is contained on a single line. + * @param {ASTNode} node AST Node being evaluated. + * @returns {boolean} True if the node is a single line. + */ +function isSingleLine(node) { + return (node.loc.end.line === node.loc.start.line); +} + +/** + * Checks whether the properties on a single line. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {boolean} True if all properties is on a single line. + */ +function isSingleLineProperties(properties) { + const [firstProp] = properties, + lastProp = last(properties); + + return firstProp.loc.start.line === lastProp.loc.end.line; +} + +/** + * Initializes a single option property from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptionProperty(toOptions, fromOptions) { + toOptions.mode = fromOptions.mode || "strict"; + + // Set value of beforeColon + if (typeof fromOptions.beforeColon !== "undefined") { + toOptions.beforeColon = +fromOptions.beforeColon; + } else { + toOptions.beforeColon = 0; + } + + // Set value of afterColon + if (typeof fromOptions.afterColon !== "undefined") { + toOptions.afterColon = +fromOptions.afterColon; + } else { + toOptions.afterColon = 1; + } + + // Set align if exists + if (typeof fromOptions.align !== "undefined") { + if (typeof fromOptions.align === "object") { + toOptions.align = fromOptions.align; + } else { // "string" + toOptions.align = { + on: fromOptions.align, + mode: toOptions.mode, + beforeColon: toOptions.beforeColon, + afterColon: toOptions.afterColon + }; + } + } + + return toOptions; +} + +/** + * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptions(toOptions, fromOptions) { + if (typeof fromOptions.align === "object") { + + // Initialize the alignment configuration + toOptions.align = initOptionProperty({}, fromOptions.align); + toOptions.align.on = fromOptions.align.on || "colon"; + toOptions.align.mode = fromOptions.align.mode || "strict"; + + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + } else { // string or undefined + toOptions.multiLine = initOptionProperty({}, (fromOptions.multiLine || fromOptions)); + toOptions.singleLine = initOptionProperty({}, (fromOptions.singleLine || fromOptions)); + + // If alignment options are defined in multiLine, pull them out into the general align configuration + if (toOptions.multiLine.align) { + toOptions.align = { + on: toOptions.multiLine.align.on, + mode: toOptions.multiLine.align.mode || toOptions.multiLine.mode, + beforeColon: toOptions.multiLine.align.beforeColon, + afterColon: toOptions.multiLine.align.afterColon + }; + } + } + + return toOptions; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing between keys and values in object literal properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/key-spacing" + }, + + fixable: "whitespace", + + schema: [{ + anyOf: [ + { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + align: { + anyOf: [ + { + enum: ["colon", "value"] + }, + { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + singleLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + multiLine: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + }, + align: { + type: "object", + properties: { + mode: { + enum: ["strict", "minimum"] + }, + on: { + enum: ["colon", "value"] + }, + beforeColon: { + type: "boolean" + }, + afterColon: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ] + }], + messages: { + extraKey: "Extra space after {{computed}}key '{{key}}'.", + extraValue: "Extra space before value for {{computed}}key '{{key}}'.", + missingKey: "Missing space after {{computed}}key '{{key}}'.", + missingValue: "Missing space before value for {{computed}}key '{{key}}'." + } + }, + + create(context) { + + /** + * OPTIONS + * "key-spacing": [2, { + * beforeColon: false, + * afterColon: true, + * align: "colon" // Optional, or "value" + * } + */ + const options = context.options[0] || {}, + ruleOptions = initOptions({}, options), + multiLineOptions = ruleOptions.multiLine, + singleLineOptions = ruleOptions.singleLine, + alignmentOptions = ruleOptions.align || null; + + const sourceCode = context.getSourceCode(); + + /** + * Checks whether a property is a member of the property group it follows. + * @param {ASTNode} lastMember The last Property known to be in the group. + * @param {ASTNode} candidate The next Property that might be in the group. + * @returns {boolean} True if the candidate property is part of the group. + */ + function continuesPropertyGroup(lastMember, candidate) { + const groupEndLine = lastMember.loc.start.line, + candidateStartLine = candidate.loc.start.line; + + if (candidateStartLine - groupEndLine <= 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 1 && + candidateStartLine - last(leadingComments).loc.end.line <= 1 + ) { + for (let i = 1; i < leadingComments.length; i++) { + if (leadingComments[i].loc.start.line - leadingComments[i - 1].loc.end.line > 1) { + return false; + } + } + return true; + } + + return false; + } + + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + (property.method || + property.shorthand || + property.kind !== "init" || property.type !== "Property") // Could be "ExperimentalSpreadProperty" or "SpreadElement" + ); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + const colonToken = sourceCode.getTokenAfter(node, astUtils.isColonToken); + + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + return sourceCode.getTokenAfter(node, astUtils.isColonToken); + } + + /** + * Gets an object literal property's key as the identifier name or string value. + * @param {ASTNode} property Property node whose key to retrieve. + * @returns {string} The property's key. + */ + function getKey(property) { + const key = property.key; + + if (property.computed) { + return sourceCode.getText().slice(key.range[0], key.range[1]); + } + return astUtils.getStaticPropertyName(property); + } + + /** + * Reports an appropriately-formatted error if spacing is incorrect on one + * side of the colon. + * @param {ASTNode} property Key-value pair in an object literal. + * @param {string} side Side being verified - either "key" or "value". + * @param {string} whitespace Actual whitespace string. + * @param {int} expected Expected whitespace length. + * @param {string} mode Value of the mode as "strict" or "minimum" + * @returns {void} + */ + function report(property, side, whitespace, expected, mode) { + const diff = whitespace.length - expected, + nextColon = getNextColon(property.key), + tokenBeforeColon = sourceCode.getTokenBefore(nextColon, { includeComments: true }), + tokenAfterColon = sourceCode.getTokenAfter(nextColon, { includeComments: true }), + isKeySide = side === "key", + isExtra = diff > 0, + diffAbs = Math.abs(diff), + spaces = Array(diffAbs + 1).join(" "); + + const locStart = isKeySide ? tokenBeforeColon.loc.end : nextColon.loc.start; + const locEnd = isKeySide ? nextColon.loc.start : tokenAfterColon.loc.start; + const missingLoc = isKeySide ? tokenBeforeColon.loc : tokenAfterColon.loc; + const loc = isExtra ? { start: locStart, end: locEnd } : missingLoc; + + if (( + diff && mode === "strict" || + diff < 0 && mode === "minimum" || + diff > 0 && !expected && mode === "minimum") && + !(expected && containsLineTerminator(whitespace)) + ) { + let fix; + + if (isExtra) { + let range; + + // Remove whitespace + if (isKeySide) { + range = [tokenBeforeColon.range[1], tokenBeforeColon.range[1] + diffAbs]; + } else { + range = [tokenAfterColon.range[0] - diffAbs, tokenAfterColon.range[0]]; + } + fix = function(fixer) { + return fixer.removeRange(range); + }; + } else { + + // Add whitespace + if (isKeySide) { + fix = function(fixer) { + return fixer.insertTextAfter(tokenBeforeColon, spaces); + }; + } else { + fix = function(fixer) { + return fixer.insertTextBefore(tokenAfterColon, spaces); + }; + } + } + + let messageId = ""; + + if (isExtra) { + messageId = side === "key" ? "extraKey" : "extraValue"; + } else { + messageId = side === "key" ? "missingKey" : "missingValue"; + } + + context.report({ + node: property[side], + loc, + messageId, + data: { + computed: property.computed ? "computed " : "", + key: getKey(property) + }, + fix + }); + } + } + + /** + * Gets the number of characters in a key, including quotes around string + * keys and braces around computed property keys. + * @param {ASTNode} property Property of on object literal. + * @returns {int} Width of the key. + */ + function getKeyWidth(property) { + const startToken = sourceCode.getFirstToken(property); + const endToken = getLastTokenBeforeColon(property.key); + + return endToken.range[1] - startToken.range[0]; + } + + /** + * Gets the whitespace around the colon in an object literal property. + * @param {ASTNode} property Property node from an object literal. + * @returns {Object} Whitespace before and after the property's colon. + */ + function getPropertyWhitespace(property) { + const whitespace = /(\s*):(\s*)/u.exec(sourceCode.getText().slice( + property.key.range[1], property.value.range[0] + )); + + if (whitespace) { + return { + beforeColon: whitespace[1], + afterColon: whitespace[2] + }; + } + return null; + } + + /** + * Creates groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {Array.} Groups of property AST node lists. + */ + function createGroups(node) { + if (node.properties.length === 1) { + return [node.properties]; + } + + return node.properties.reduce((groups, property) => { + const currentGroup = last(groups), + prev = last(currentGroup); + + if (!prev || continuesPropertyGroup(prev, property)) { + currentGroup.push(property); + } else { + groups.push([property]); + } + + return groups; + }, [ + [] + ]); + } + + /** + * Verifies correct vertical alignment of a group of properties. + * @param {ASTNode[]} properties List of Property AST nodes. + * @returns {void} + */ + function verifyGroupAlignment(properties) { + const length = properties.length, + widths = properties.map(getKeyWidth), // Width of keys, including quotes + align = alignmentOptions.on; // "value" or "colon" + let targetWidth = Math.max(...widths), + beforeColon, afterColon, mode; + + if (alignmentOptions && length > 1) { // When aligning values within a group, use the alignment configuration. + beforeColon = alignmentOptions.beforeColon; + afterColon = alignmentOptions.afterColon; + mode = alignmentOptions.mode; + } else { + beforeColon = multiLineOptions.beforeColon; + afterColon = multiLineOptions.afterColon; + mode = alignmentOptions.mode; + } + + // Conditionally include one space before or after colon + targetWidth += (align === "colon" ? beforeColon : afterColon); + + for (let i = 0; i < length; i++) { + const property = properties[i]; + const whitespace = getPropertyWhitespace(property); + + if (whitespace) { // Object literal getters/setters lack a colon + const width = widths[i]; + + if (align === "value") { + report(property, "key", whitespace.beforeColon, beforeColon, mode); + report(property, "value", whitespace.afterColon, targetWidth - width, mode); + } else { // align = "colon" + report(property, "key", whitespace.beforeColon, targetWidth - width, mode); + report(property, "value", whitespace.afterColon, afterColon, mode); + } + } + } + } + + /** + * Verifies spacing of property conforms to specified options. + * @param {ASTNode} node Property node being evaluated. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifySpacing(node, lineOptions) { + const actual = getPropertyWhitespace(node); + + if (actual) { // Object literal getters/setters lack colons + report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode); + report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode); + } + } + + /** + * Verifies spacing of each property in a list. + * @param {ASTNode[]} properties List of Property AST nodes. + * @param {Object} lineOptions Configured singleLine or multiLine options + * @returns {void} + */ + function verifyListSpacing(properties, lineOptions) { + const length = properties.length; + + for (let i = 0; i < length; i++) { + verifySpacing(properties[i], lineOptions); + } + } + + /** + * Verifies vertical alignment, taking into account groups of properties. + * @param {ASTNode} node ObjectExpression node being evaluated. + * @returns {void} + */ + function verifyAlignment(node) { + createGroups(node).forEach(group => { + const properties = group.filter(isKeyValueProperty); + + if (properties.length > 0 && isSingleLineProperties(properties)) { + verifyListSpacing(properties, multiLineOptions); + } else { + verifyGroupAlignment(properties); + } + }); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + if (alignmentOptions) { // Verify vertical alignment + + return { + ObjectExpression(node) { + if (isSingleLine(node)) { + verifyListSpacing(node.properties.filter(isKeyValueProperty), singleLineOptions); + } else { + verifyAlignment(node); + } + } + }; + + } + + // Obey beforeColon and afterColon in each property as configured + return { + Property(node) { + verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); + } + }; + + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/keyword-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/keyword-spacing.js new file mode 100644 index 0000000..99979a3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,573 @@ +/** + * @fileoverview Rule to enforce spacing before and after keywords. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const PREV_TOKEN = /^[)\]}>]$/u; +const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u; +const PREV_TOKEN_M = /^[)\]}>*]$/u; +const NEXT_TOKEN_M = /^[{*]$/u; +const TEMPLATE_OPEN_PAREN = /\$\{$/u; +const TEMPLATE_CLOSE_PAREN = /^\}/u; +const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/u; +const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); + +// check duplications. +(function() { + KEYS.sort(); + for (let i = 1; i < KEYS.length; ++i) { + if (KEYS[i] === KEYS[i - 1]) { + throw new Error(`Duplication was found in the keyword list: ${KEYS[i]}`); + } + } +}()); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given token is a "Template" token ends with "${". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token ends with "${". + */ +function isOpenParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value); +} + +/** + * Checks whether or not a given token is a "Template" token starts with "}". + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is a "Template" token starts with "}". + */ +function isCloseParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after keywords", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/keyword-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: true }, + after: { type: "boolean", default: true }, + overrides: { + type: "object", + properties: KEYS.reduce((retv, key) => { + retv[key] = { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + }; + return retv; + }, {}), + additionalProperties: false + } + }, + additionalProperties: false + } + ], + messages: { + expectedBefore: "Expected space(s) before \"{{value}}\".", + expectedAfter: "Expected space(s) after \"{{value}}\".", + unexpectedBefore: "Unexpected space(s) before \"{{value}}\".", + unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a given token if there are not space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function expectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + !sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc.start, + messageId: "expectedBefore", + data: token, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) before the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the previous token to check. + * @returns {void} + */ + function unexpectSpaceBefore(token, pattern) { + const prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "unexpectedBefore", + data: token, + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + } + + /** + * Reports a given token if there are not space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function expectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + !sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc.start, + messageId: "expectedAfter", + data: token, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) after the token. + * @param {Token} token A token to report. + * @param {RegExp} pattern A pattern of the next token to check. + * @returns {void} + */ + function unexpectSpaceAfter(token, pattern) { + const nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + + context.report({ + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedAfter", + data: token, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + } + + /** + * Parses the option object and determines check methods for each keyword. + * @param {Object|undefined} options The option object to parse. + * @returns {Object} - Normalized option object. + * Keys are keywords (there are for every keyword). + * Values are instances of `{"before": function, "after": function}`. + */ + function parseOptions(options = {}) { + const before = options.before !== false; + const after = options.after !== false; + const defaultValue = { + before: before ? expectSpaceBefore : unexpectSpaceBefore, + after: after ? expectSpaceAfter : unexpectSpaceAfter + }; + const overrides = (options && options.overrides) || {}; + const retv = Object.create(null); + + for (let i = 0; i < KEYS.length; ++i) { + const key = KEYS[i]; + const override = overrides[key]; + + if (override) { + const thisBefore = ("before" in override) ? override.before : before; + const thisAfter = ("after" in override) ? override.after : after; + + retv[key] = { + before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, + after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter + }; + } else { + retv[key] = defaultValue; + } + } + + return retv; + } + + const checkMethodMap = parseOptions(context.options[0]); + + /** + * Reports a given token if usage of spacing followed by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function checkSpacingBefore(token, pattern) { + checkMethodMap[token.value].before(token, pattern || PREV_TOKEN); + } + + /** + * Reports a given token if usage of spacing preceded by the token is + * invalid. + * @param {Token} token A token to report. + * @param {RegExp} [pattern] Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function checkSpacingAfter(token, pattern) { + checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN); + } + + /** + * Reports a given token if usage of spacing around the token is invalid. + * @param {Token} token A token to report. + * @returns {void} + */ + function checkSpacingAround(token) { + checkSpacingBefore(token); + checkSpacingAfter(token); + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingAround(firstToken); + } + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing followed by the token is invalid. + * + * This is used for unary operators (e.g. `typeof`), `function`, and `super`. + * Other rules are handling usage of spacing preceded by those keywords. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingBeforeFirstToken(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports the previous token of a given node if the token is a keyword and + * usage of spacing around the token is invalid. + * @param {ASTNode|null} node A node to report. + * @returns {void} + */ + function checkSpacingAroundTokenBefore(node) { + if (node) { + const token = sourceCode.getTokenBefore(node, astUtils.isKeywordToken); + + checkSpacingAround(token); + } + } + + /** + * Reports `async` or `function` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForFunction(node) { + const firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && + ((firstToken.type === "Keyword" && firstToken.value === "function") || + firstToken.value === "async") + ) { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports `class` and `extends` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForClass(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.superClass); + } + + /** + * Reports `if` and `else` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForIfStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.alternate); + } + + /** + * Reports `try`, `catch`, and `finally` keywords of a given node if usage + * of spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForTryStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundFirstToken(node.handler); + checkSpacingAroundTokenBefore(node.finalizer); + } + + /** + * Reports `do` and `while` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForDoWhileStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.test); + } + + /** + * Reports `for` and `in` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForInStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.right); + } + + /** + * Reports `for` and `of` keywords of a given node if usage of spacing + * around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForForOfStatement(node) { + if (node.await) { + checkSpacingBefore(sourceCode.getFirstToken(node, 0)); + checkSpacingAfter(sourceCode.getFirstToken(node, 1)); + } else { + checkSpacingAroundFirstToken(node); + } + checkSpacingAround(sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken)); + } + + /** + * Reports `import`, `export`, `as`, and `from` keywords of a given node if + * usage of spacing around those keywords is invalid. + * + * This rule handles the `*` token in module declarations. + * + * import*as A from "./a"; /*error Expected space(s) after "import". + * error Expected space(s) before "as". + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForModuleDeclaration(node) { + const firstToken = sourceCode.getFirstToken(node); + + checkSpacingBefore(firstToken, PREV_TOKEN_M); + checkSpacingAfter(firstToken, NEXT_TOKEN_M); + + if (node.type === "ExportDefaultDeclaration") { + checkSpacingAround(sourceCode.getTokenAfter(firstToken)); + } + + if (node.type === "ExportAllDeclaration" && node.exported) { + const asToken = sourceCode.getTokenBefore(node.exported); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + if (node.source) { + const fromToken = sourceCode.getTokenBefore(node.source); + + checkSpacingBefore(fromToken, PREV_TOKEN_M); + checkSpacingAfter(fromToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForImportNamespaceSpecifier(node) { + const asToken = sourceCode.getFirstToken(node, 1); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + /** + * Reports `static`, `get`, and `set` keywords of a given node if usage of + * spacing around those keywords is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForProperty(node) { + if (node.static) { + checkSpacingAroundFirstToken(node); + } + if (node.kind === "get" || + node.kind === "set" || + ( + (node.method || node.type === "MethodDefinition") && + node.value.async + ) + ) { + const token = sourceCode.getTokenBefore( + node.key, + tok => { + switch (tok.value) { + case "get": + case "set": + case "async": + return true; + default: + return false; + } + } + ); + + if (!token) { + throw new Error("Failed to find token get, set, or async beside method name"); + } + + + checkSpacingAround(token); + } + } + + /** + * Reports `await` keyword of a given node if usage of spacing before + * this keyword is invalid. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function checkSpacingForAwaitExpression(node) { + checkSpacingBefore(sourceCode.getFirstToken(node)); + } + + return { + + // Statements + DebuggerStatement: checkSpacingAroundFirstToken, + WithStatement: checkSpacingAroundFirstToken, + + // Statements - Control flow + BreakStatement: checkSpacingAroundFirstToken, + ContinueStatement: checkSpacingAroundFirstToken, + ReturnStatement: checkSpacingAroundFirstToken, + ThrowStatement: checkSpacingAroundFirstToken, + TryStatement: checkSpacingForTryStatement, + + // Statements - Choice + IfStatement: checkSpacingForIfStatement, + SwitchStatement: checkSpacingAroundFirstToken, + SwitchCase: checkSpacingAroundFirstToken, + + // Statements - Loops + DoWhileStatement: checkSpacingForDoWhileStatement, + ForInStatement: checkSpacingForForInStatement, + ForOfStatement: checkSpacingForForOfStatement, + ForStatement: checkSpacingAroundFirstToken, + WhileStatement: checkSpacingAroundFirstToken, + + // Statements - Declarations + ClassDeclaration: checkSpacingForClass, + ExportNamedDeclaration: checkSpacingForModuleDeclaration, + ExportDefaultDeclaration: checkSpacingForModuleDeclaration, + ExportAllDeclaration: checkSpacingForModuleDeclaration, + FunctionDeclaration: checkSpacingForFunction, + ImportDeclaration: checkSpacingForModuleDeclaration, + VariableDeclaration: checkSpacingAroundFirstToken, + + // Expressions + ArrowFunctionExpression: checkSpacingForFunction, + AwaitExpression: checkSpacingForAwaitExpression, + ClassExpression: checkSpacingForClass, + FunctionExpression: checkSpacingForFunction, + NewExpression: checkSpacingBeforeFirstToken, + Super: checkSpacingBeforeFirstToken, + ThisExpression: checkSpacingBeforeFirstToken, + UnaryExpression: checkSpacingBeforeFirstToken, + YieldExpression: checkSpacingBeforeFirstToken, + + // Others + ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, + MethodDefinition: checkSpacingForProperty, + Property: checkSpacingForProperty + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/line-comment-position.js b/day1/cli-study/node_modules/eslint/lib/rules/line-comment-position.js new file mode 100644 index 0000000..77ee147 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/line-comment-position.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to enforce the position of line comments + * @author Alberto Rodríguez + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce position of line comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/line-comment-position" + }, + + schema: [ + { + oneOf: [ + { + enum: ["above", "beside"] + }, + { + type: "object", + properties: { + position: { + enum: ["above", "beside"] + }, + ignorePattern: { + type: "string" + }, + applyDefaultPatterns: { + type: "boolean" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + above: "Expected comment to be above code.", + beside: "Expected comment to be beside code." + } + }, + + create(context) { + const options = context.options[0]; + + let above, + ignorePattern, + applyDefaultIgnorePatterns = true; + + if (!options || typeof options === "string") { + above = !options || options === "above"; + + } else { + above = !options.position || options.position === "above"; + ignorePattern = options.ignorePattern; + + if (Object.prototype.hasOwnProperty.call(options, "applyDefaultIgnorePatterns")) { + applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns; + } else { + applyDefaultIgnorePatterns = options.applyDefaultPatterns !== false; + } + } + + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const fallThroughRegExp = /^\s*falls?\s?through/u; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type === "Line").forEach(node => { + if (applyDefaultIgnorePatterns && (defaultIgnoreRegExp.test(node.value) || fallThroughRegExp.test(node.value))) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(node.value)) { + return; + } + + const previous = sourceCode.getTokenBefore(node, { includeComments: true }); + const isOnSameLine = previous && previous.loc.end.line === node.loc.start.line; + + if (above) { + if (isOnSameLine) { + context.report({ + node, + messageId: "above" + }); + } + } else { + if (!isOnSameLine) { + context.report({ + node, + messageId: "beside" + }); + } + } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/linebreak-style.js b/day1/cli-study/node_modules/eslint/lib/rules/linebreak-style.js new file mode 100644 index 0000000..b3b393e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/linebreak-style.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to enforce a single linebreak style. + * @author Erik Mueller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/linebreak-style" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["unix", "windows"] + } + ], + messages: { + expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.", + expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Builds a fix function that replaces text at the specified range in the source text. + * @param {int[]} range The range to replace + * @param {string} text The text to insert. + * @returns {Function} Fixer function + * @private + */ + function createFix(range, text) { + return function(fixer) { + return fixer.replaceTextRange(range, text); + }; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkForLinebreakStyle(node) { + const linebreakStyle = context.options[0] || "unix", + expectedLF = linebreakStyle === "unix", + expectedLFChars = expectedLF ? "\n" : "\r\n", + source = sourceCode.getText(), + pattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + let i = 0; + + while ((match = pattern.exec(source)) !== null) { + i++; + if (match[0] === expectedLFChars) { + continue; + } + + const index = match.index; + const range = [index, index + match[0].length]; + + context.report({ + node, + loc: { + start: { + line: i, + column: sourceCode.lines[i - 1].length + }, + end: { + line: i + 1, + column: 0 + } + }, + messageId: expectedLF ? "expectedLF" : "expectedCRLF", + fix: createFix(range, expectedLFChars) + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/lines-around-comment.js b/day1/cli-study/node_modules/eslint/lib/rules/lines-around-comment.js new file mode 100644 index 0000000..5e1b83c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/lines-around-comment.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Enforces empty lines around comments. + * @author Jamund Ferguson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Return an array with with any line numbers that are empty. + * @param {Array} lines An array of each line of the file. + * @returns {Array} An array of line numbers. + */ +function getEmptyLineNums(lines) { + const emptyLines = lines.map((line, i) => ({ + code: line.trim(), + num: i + 1 + })).filter(line => !line.code).map(line => line.num); + + return emptyLines; +} + +/** + * Return an array with with any line numbers that contain comments. + * @param {Array} comments An array of comment tokens. + * @returns {Array} An array of line numbers. + */ +function getCommentLineNums(comments) { + const lines = []; + + comments.forEach(token => { + const start = token.loc.start.line; + const end = token.loc.end.line; + + lines.push(start, end); + }); + return lines; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require empty lines around comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-comment" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + beforeBlockComment: { + type: "boolean", + default: true + }, + afterBlockComment: { + type: "boolean", + default: false + }, + beforeLineComment: { + type: "boolean", + default: false + }, + afterLineComment: { + type: "boolean", + default: false + }, + allowBlockStart: { + type: "boolean", + default: false + }, + allowBlockEnd: { + type: "boolean", + default: false + }, + allowClassStart: { + type: "boolean" + }, + allowClassEnd: { + type: "boolean" + }, + allowObjectStart: { + type: "boolean" + }, + allowObjectEnd: { + type: "boolean" + }, + allowArrayStart: { + type: "boolean" + }, + allowArrayEnd: { + type: "boolean" + }, + ignorePattern: { + type: "string" + }, + applyDefaultIgnorePatterns: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + after: "Expected line after comment.", + before: "Expected line before comment." + } + }, + + create(context) { + + const options = Object.assign({}, context.options[0]); + const ignorePattern = options.ignorePattern; + const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; + const customIgnoreRegExp = new RegExp(ignorePattern, "u"); + const applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns !== false; + + options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; + + const sourceCode = context.getSourceCode(); + + const lines = sourceCode.lines, + numLines = lines.length + 1, + comments = sourceCode.getAllComments(), + commentLines = getCommentLineNums(comments), + emptyLines = getEmptyLineNums(lines), + commentAndEmptyLines = commentLines.concat(emptyLines); + + /** + * Returns whether or not comments are on lines starting with or ending with code + * @param {token} token The comment token to check. + * @returns {boolean} True if the comment is not alone. + */ + function codeAroundComment(token) { + let currentToken = token; + + do { + currentToken = sourceCode.getTokenBefore(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(currentToken, token)) { + return true; + } + + currentToken = token; + do { + currentToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + } while (currentToken && astUtils.isCommentToken(currentToken)); + + if (currentToken && astUtils.isTokenOnSameLine(token, currentToken)) { + return true; + } + + return false; + } + + /** + * Returns whether or not comments are inside a node type or not. + * @param {ASTNode} parent The Comment parent node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is inside nodeType. + */ + function isParentNodeType(parent, nodeType) { + return parent.type === nodeType || + (parent.body && parent.body.type === nodeType) || + (parent.consequent && parent.consequent.type === nodeType); + } + + /** + * Returns the parent node that contains the given token. + * @param {token} token The token to check. + * @returns {ASTNode} The parent node that contains the given token. + */ + function getParentNodeOfToken(token) { + return sourceCode.getNodeByRangeIndex(token.range[0]); + } + + /** + * Returns whether or not comments are at the parent start or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent start. + */ + function isCommentAtParentStart(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + token.loc.start.line - parent.loc.start.line === 1; + } + + /** + * Returns whether or not comments are at the parent end or not. + * @param {token} token The Comment token. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent end. + */ + function isCommentAtParentEnd(token, nodeType) { + const parent = getParentNodeOfToken(token); + + return parent && isParentNodeType(parent, nodeType) && + parent.loc.end.line - token.loc.end.line === 1; + } + + /** + * Returns whether or not comments are at the block start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block start. + */ + function isCommentAtBlockStart(token) { + return isCommentAtParentStart(token, "ClassBody") || isCommentAtParentStart(token, "BlockStatement") || isCommentAtParentStart(token, "SwitchCase"); + } + + /** + * Returns whether or not comments are at the block end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at block end. + */ + function isCommentAtBlockEnd(token) { + return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); + } + + /** + * Returns whether or not comments are at the class start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class start. + */ + function isCommentAtClassStart(token) { + return isCommentAtParentStart(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the class end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at class end. + */ + function isCommentAtClassEnd(token) { + return isCommentAtParentEnd(token, "ClassBody"); + } + + /** + * Returns whether or not comments are at the object start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object start. + */ + function isCommentAtObjectStart(token) { + return isCommentAtParentStart(token, "ObjectExpression") || isCommentAtParentStart(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the object end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at object end. + */ + function isCommentAtObjectEnd(token) { + return isCommentAtParentEnd(token, "ObjectExpression") || isCommentAtParentEnd(token, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the array start or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array start. + */ + function isCommentAtArrayStart(token) { + return isCommentAtParentStart(token, "ArrayExpression") || isCommentAtParentStart(token, "ArrayPattern"); + } + + /** + * Returns whether or not comments are at the array end or not. + * @param {token} token The Comment token. + * @returns {boolean} True if the comment is at array end. + */ + function isCommentAtArrayEnd(token) { + return isCommentAtParentEnd(token, "ArrayExpression") || isCommentAtParentEnd(token, "ArrayPattern"); + } + + /** + * Checks if a comment token has lines around it (ignores inline comments) + * @param {token} token The Comment token. + * @param {Object} opts Options to determine the newline. + * @param {boolean} opts.after Should have a newline after this line. + * @param {boolean} opts.before Should have a newline before this line. + * @returns {void} + */ + function checkForEmptyLine(token, opts) { + if (applyDefaultIgnorePatterns && defaultIgnoreRegExp.test(token.value)) { + return; + } + + if (ignorePattern && customIgnoreRegExp.test(token.value)) { + return; + } + + let after = opts.after, + before = opts.before; + + const prevLineNum = token.loc.start.line - 1, + nextLineNum = token.loc.end.line + 1, + commentIsNotAlone = codeAroundComment(token); + + const blockStartAllowed = options.allowBlockStart && + isCommentAtBlockStart(token) && + !(options.allowClassStart === false && + isCommentAtClassStart(token)), + blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(token) && !(options.allowClassEnd === false && isCommentAtClassEnd(token)), + classStartAllowed = options.allowClassStart && isCommentAtClassStart(token), + classEndAllowed = options.allowClassEnd && isCommentAtClassEnd(token), + objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(token), + objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(token), + arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(token), + arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(token); + + const exceptionStartAllowed = blockStartAllowed || classStartAllowed || objectStartAllowed || arrayStartAllowed; + const exceptionEndAllowed = blockEndAllowed || classEndAllowed || objectEndAllowed || arrayEndAllowed; + + // ignore top of the file and bottom of the file + if (prevLineNum < 1) { + before = false; + } + if (nextLineNum >= numLines) { + after = false; + } + + // we ignore all inline comments + if (commentIsNotAlone) { + return; + } + + const previousTokenOrComment = sourceCode.getTokenBefore(token, { includeComments: true }); + const nextTokenOrComment = sourceCode.getTokenAfter(token, { includeComments: true }); + + // check for newline before + if (!exceptionStartAllowed && before && !lodash.includes(commentAndEmptyLines, prevLineNum) && + !(astUtils.isCommentToken(previousTokenOrComment) && astUtils.isTokenOnSameLine(previousTokenOrComment, token))) { + const lineStart = token.range[0] - token.loc.start.column; + const range = [lineStart, lineStart]; + + context.report({ + node: token, + messageId: "before", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\n"); + } + }); + } + + // check for newline after + if (!exceptionEndAllowed && after && !lodash.includes(commentAndEmptyLines, nextLineNum) && + !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { + context.report({ + node: token, + messageId: "after", + fix(fixer) { + return fixer.insertTextAfter(token, "\n"); + } + }); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + comments.forEach(token => { + if (token.type === "Line") { + if (options.beforeLineComment || options.afterLineComment) { + checkForEmptyLine(token, { + after: options.afterLineComment, + before: options.beforeLineComment + }); + } + } else if (token.type === "Block") { + if (options.beforeBlockComment || options.afterBlockComment) { + checkForEmptyLine(token, { + after: options.afterBlockComment, + before: options.beforeBlockComment + }); + } + } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/lines-around-directive.js b/day1/cli-study/node_modules/eslint/lib/rules/lines-around-directive.js new file mode 100644 index 0000000..fb439da --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/lines-around-directive.js @@ -0,0 +1,201 @@ +/** + * @fileoverview Require or disallow newlines around directives. + * @author Kai Cataldo + * @deprecated + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow newlines around directives", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-around-directive" + }, + + schema: [{ + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + before: { + enum: ["always", "never"] + }, + after: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 2 + } + ] + }], + + fixable: "whitespace", + messages: { + expected: "Expected newline {{location}} \"{{value}}\" directive.", + unexpected: "Unexpected newline {{location}} \"{{value}}\" directive." + }, + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const config = context.options[0] || "always"; + const expectLineBefore = typeof config === "string" ? config : config.before; + const expectLineAfter = typeof config === "string" ? config : config.after; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if node is preceded by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is preceded by a blank newline. + */ + function hasNewlineBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node, { includeComments: true }); + const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0; + + return node.loc.start.line - tokenLineBefore >= 2; + } + + /** + * Gets the last token of a node that is on the same line as the rest of the node. + * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing + * semicolon on a different line. + * @param {ASTNode} node A directive node + * @returns {Token} The last token of the node on the line + */ + function getLastTokenOnLine(node) { + const lastToken = sourceCode.getLastToken(node); + const secondToLastToken = sourceCode.getTokenBefore(lastToken); + + return astUtils.isSemicolonToken(lastToken) && lastToken.loc.start.line > secondToLastToken.loc.end.line + ? secondToLastToken + : lastToken; + } + + /** + * Check if node is followed by a blank newline. + * @param {ASTNode} node Node to check. + * @returns {boolean} Whether or not the passed in node is followed by a blank newline. + */ + function hasNewlineAfter(node) { + const lastToken = getLastTokenOnLine(node); + const tokenAfter = sourceCode.getTokenAfter(lastToken, { includeComments: true }); + + return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2; + } + + /** + * Report errors for newlines around directives. + * @param {ASTNode} node Node to check. + * @param {string} location Whether the error was found before or after the directive. + * @param {boolean} expected Whether or not a newline was expected or unexpected. + * @returns {void} + */ + function reportError(node, location, expected) { + context.report({ + node, + messageId: expected ? "expected" : "unexpected", + data: { + value: node.expression.value, + location + }, + fix(fixer) { + const lastToken = getLastTokenOnLine(node); + + if (expected) { + return location === "before" ? fixer.insertTextBefore(node, "\n") : fixer.insertTextAfter(lastToken, "\n"); + } + return fixer.removeRange(location === "before" ? [node.range[0] - 1, node.range[0]] : [lastToken.range[1], lastToken.range[1] + 1]); + } + }); + } + + /** + * Check lines around directives in node + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDirectives(node) { + const directives = astUtils.getDirectivePrologue(node); + + if (!directives.length) { + return; + } + + const firstDirective = directives[0]; + const leadingComments = sourceCode.getCommentsBefore(firstDirective); + + /* + * Only check before the first directive if it is preceded by a comment or if it is at the top of + * the file and expectLineBefore is set to "never". This is to not force a newline at the top of + * the file if there are no comments as well as for compatibility with padded-blocks. + */ + if (leadingComments.length) { + if (expectLineBefore === "always" && !hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", true); + } + + if (expectLineBefore === "never" && hasNewlineBefore(firstDirective)) { + reportError(firstDirective, "before", false); + } + } else if ( + node.type === "Program" && + expectLineBefore === "never" && + !leadingComments.length && + hasNewlineBefore(firstDirective) + ) { + reportError(firstDirective, "before", false); + } + + const lastDirective = directives[directives.length - 1]; + const statements = node.type === "Program" ? node.body : node.body.body; + + /* + * Do not check after the last directive if the body only + * contains a directive prologue and isn't followed by a comment to ensure + * this rule behaves well with padded-blocks. + */ + if (lastDirective === statements[statements.length - 1] && !lastDirective.trailingComments) { + return; + } + + if (expectLineAfter === "always" && !hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", true); + } + + if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) { + reportError(lastDirective, "after", false); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: checkDirectives, + FunctionDeclaration: checkDirectives, + FunctionExpression: checkDirectives, + ArrowFunctionExpression: checkDirectives + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/lines-between-class-members.js b/day1/cli-study/node_modules/eslint/lib/rules/lines-between-class-members.js new file mode 100644 index 0000000..9723530 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Rule to check empty newline between class members + * @author 薛定谔的猫 + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line between class members", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/lines-between-class-members" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptAfterSingleLine: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + never: "Unexpected blank line between class members.", + always: "Expected blank line between class members." + } + }, + + create(context) { + + const options = []; + + options[0] = context.options[0] || "always"; + options[1] = context.options[1] || { exceptAfterSingleLine: false }; + + const sourceCode = context.getSourceCode(); + + /** + * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The last token among the consecutive tokens. + */ + function findLastConsecutiveTokenAfter(prevLastToken, nextFirstToken, maxLine) { + const after = sourceCode.getTokenAfter(prevLastToken, { includeComments: true }); + + if (after !== nextFirstToken && after.loc.start.line - prevLastToken.loc.end.line <= maxLine) { + return findLastConsecutiveTokenAfter(after, nextFirstToken, maxLine); + } + return prevLastToken; + } + + /** + * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member. + * @param {Token} nextFirstToken The first token in the next member node. + * @param {Token} prevLastToken The last token in the previous member node. + * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens. + * @returns {Token} The first token among the consecutive tokens. + */ + function findFirstConsecutiveTokenBefore(nextFirstToken, prevLastToken, maxLine) { + const before = sourceCode.getTokenBefore(nextFirstToken, { includeComments: true }); + + if (before !== prevLastToken && nextFirstToken.loc.start.line - before.loc.end.line <= maxLine) { + return findFirstConsecutiveTokenBefore(before, prevLastToken, maxLine); + } + return nextFirstToken; + } + + /** + * Checks if there is a token or comment between two tokens. + * @param {Token} before The token before. + * @param {Token} after The token after. + * @returns {boolean} True if there is a token or comment between two tokens. + */ + function hasTokenOrCommentBetween(before, after) { + return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0; + } + + return { + ClassBody(node) { + const body = node.body; + + for (let i = 0; i < body.length - 1; i++) { + const curFirst = sourceCode.getFirstToken(body[i]); + const curLast = sourceCode.getLastToken(body[i]); + const nextFirst = sourceCode.getFirstToken(body[i + 1]); + const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast); + const skip = !isMulti && options[1].exceptAfterSingleLine; + const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1); + const afterPadding = findFirstConsecutiveTokenBefore(nextFirst, curLast, 1); + const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1; + const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding); + const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0); + + if ((options[0] === "always" && !skip && !isPadded) || + (options[0] === "never" && isPadded)) { + context.report({ + node: body[i + 1], + messageId: isPadded ? "never" : "always", + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return isPadded + ? fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n") + : fixer.insertTextAfter(curLineLastToken, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-classes-per-file.js b/day1/cli-study/node_modules/eslint/lib/rules/max-classes-per-file.js new file mode 100644 index 0000000..bb48a54 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-classes-per-file.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Enforce a maximum number of classes per file + * @author James Garbutt + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of classes per file", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/max-classes-per-file" + }, + + schema: [ + { + type: "integer", + minimum: 1 + } + ], + + messages: { + maximumExceeded: "File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}." + } + }, + create(context) { + + const maxClasses = context.options[0] || 1; + + let classCount = 0; + + return { + Program() { + classCount = 0; + }, + "Program:exit"(node) { + if (classCount > maxClasses) { + context.report({ + node, + messageId: "maximumExceeded", + data: { + classCount, + max: maxClasses + } + }); + } + }, + "ClassDeclaration, ClassExpression"() { + classCount++; + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-depth.js b/day1/cli-study/node_modules/eslint/lib/rules/max-depth.js new file mode 100644 index 0000000..5c5296b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-depth.js @@ -0,0 +1,154 @@ +/** + * @fileoverview A rule to set the maximum depth block can be nested in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that blocks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-depth" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + tooDeeply: "Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0]; + let maxDepth = 4; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxDepth = option.maximum || option.max; + } + if (typeof option === "number") { + maxDepth = option; + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * When parsing is done then pop out the reference + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + } + + /** + * Save the block and Evaluate the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function pushBlock(node) { + const len = ++functionStack[functionStack.length - 1]; + + if (len > maxDepth) { + context.report({ node, messageId: "tooDeeply", data: { depth: len, maxDepth } }); + } + } + + /** + * Pop the saved block + * @returns {void} + * @private + */ + function popBlock() { + functionStack[functionStack.length - 1]--; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + IfStatement(node) { + if (node.parent.type !== "IfStatement") { + pushBlock(node); + } + }, + SwitchStatement: pushBlock, + TryStatement: pushBlock, + DoWhileStatement: pushBlock, + WhileStatement: pushBlock, + WithStatement: pushBlock, + ForStatement: pushBlock, + ForInStatement: pushBlock, + ForOfStatement: pushBlock, + + "IfStatement:exit": popBlock, + "SwitchStatement:exit": popBlock, + "TryStatement:exit": popBlock, + "DoWhileStatement:exit": popBlock, + "WhileStatement:exit": popBlock, + "WithStatement:exit": popBlock, + "ForStatement:exit": popBlock, + "ForInStatement:exit": popBlock, + "ForOfStatement:exit": popBlock, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + "Program:exit": endFunction + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-len.js b/day1/cli-study/node_modules/eslint/lib/rules/max-len.js new file mode 100644 index 0000000..995e0c5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-len.js @@ -0,0 +1,422 @@ +/** + * @fileoverview Rule to check for max length on a line. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + code: { + type: "integer", + minimum: 0 + }, + comments: { + type: "integer", + minimum: 0 + }, + tabWidth: { + type: "integer", + minimum: 0 + }, + ignorePattern: { + type: "string" + }, + ignoreComments: { + type: "boolean" + }, + ignoreStrings: { + type: "boolean" + }, + ignoreUrls: { + type: "boolean" + }, + ignoreTemplateLiterals: { + type: "boolean" + }, + ignoreRegExpLiterals: { + type: "boolean" + }, + ignoreTrailingComments: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + anyOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 0 + } + ] +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum line length", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-len" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_SCHEMA + ], + messages: { + max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.", + maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}." + } + }, + + create(context) { + + /* + * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however: + * - They're matching an entire string that we know is a URI + * - We're matching part of a string where we think there *might* be a URL + * - We're only concerned about URLs, as picking out any URI would cause + * too many false positives + * - We don't care about matching the entire URL, any small segment is fine + */ + const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; + + const sourceCode = context.getSourceCode(); + + /** + * Computes the length of a line that may contain tabs. The width of each + * tab will be the number of spaces to the next tab stop. + * @param {string} line The line. + * @param {int} tabWidth The width of each tab stop in spaces. + * @returns {int} The computed line length. + * @private + */ + function computeLineLength(line, tabWidth) { + let extraCharacterCount = 0; + + line.replace(/\t/gu, (match, offset) => { + const totalOffset = offset + extraCharacterCount, + previousTabStopOffset = tabWidth ? totalOffset % tabWidth : 0, + spaceCount = tabWidth - previousTabStopOffset; + + extraCharacterCount += spaceCount - 1; // -1 for the replaced tab + }); + return Array.from(line).length + extraCharacterCount; + } + + // The options object must be the last option specified… + const options = Object.assign({}, context.options[context.options.length - 1]); + + // …but max code length… + if (typeof context.options[0] === "number") { + options.code = context.options[0]; + } + + // …and tabWidth can be optionally specified directly as integers. + if (typeof context.options[1] === "number") { + options.tabWidth = context.options[1]; + } + + const maxLength = typeof options.code === "number" ? options.code : 80, + tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 4, + ignoreComments = !!options.ignoreComments, + ignoreStrings = !!options.ignoreStrings, + ignoreTemplateLiterals = !!options.ignoreTemplateLiterals, + ignoreRegExpLiterals = !!options.ignoreRegExpLiterals, + ignoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments, + ignoreUrls = !!options.ignoreUrls, + maxCommentLength = options.comments; + let ignorePattern = options.ignorePattern || null; + + if (ignorePattern) { + ignorePattern = new RegExp(ignorePattern, "u"); + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a given comment is trailing: it starts on the current line and + * extends to or past the end of the current line. + * @param {string} line The source line we want to check for a trailing comment on + * @param {number} lineNumber The one-indexed line number for line + * @param {ASTNode} comment The comment to inspect + * @returns {boolean} If the comment is trailing on the given line + */ + function isTrailingComment(line, lineNumber, comment) { + return comment && + (comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line) && + (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); + } + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim(); + + return comment && + (start.line < lineNumber || (start.line === lineNumber && isFirstTokenOnLine)) && + (end.line > lineNumber || (end.line === lineNumber && end.column === line.length)); + } + + /** + * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer. + */ + function isJSXEmptyExpressionInSingleLineContainer(node) { + if (!node || !node.parent || node.type !== "JSXEmptyExpression" || node.parent.type !== "JSXExpressionContainer") { + return false; + } + + const parent = node.parent; + + return parent.loc.start.line === parent.loc.end.line; + } + + /** + * Gets the line after the comment and any remaining trailing whitespace is + * stripped. + * @param {string} line The source line with a trailing comment + * @param {ASTNode} comment The comment to remove + * @returns {string} Line without comment and trailing whitespace + */ + function stripTrailingComment(line, comment) { + + // loc.column is zero-indexed + return line.slice(0, comment.loc.start.column).replace(/\s+$/u, ""); + } + + /** + * Ensure that an array exists at [key] on `object`, and add `value` to it. + * @param {Object} object the object to mutate + * @param {string} key the object's key + * @param {*} value the value to add + * @returns {void} + * @private + */ + function ensureArrayAndPush(object, key, value) { + if (!Array.isArray(object[key])) { + object[key] = []; + } + object[key].push(value); + } + + /** + * Retrieves an array containing all strings (" or ') in the source code. + * @returns {ASTNode[]} An array of string nodes. + */ + function getAllStrings() { + return sourceCode.ast.tokens.filter(token => (token.type === "String" || + (token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute"))); + } + + /** + * Retrieves an array containing all template literals in the source code. + * @returns {ASTNode[]} An array of template literal nodes. + */ + function getAllTemplateLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "Template"); + } + + + /** + * Retrieves an array containing all RegExp literals in the source code. + * @returns {ASTNode[]} An array of RegExp literal nodes. + */ + function getAllRegExpLiterals() { + return sourceCode.ast.tokens.filter(token => token.type === "RegularExpression"); + } + + + /** + * A reducer to group an AST node by line number, both start and end. + * @param {Object} acc the accumulator + * @param {ASTNode} node the AST node in question + * @returns {Object} the modified accumulator + * @private + */ + function groupByLineNumber(acc, node) { + for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) { + ensureArrayAndPush(acc, i, node); + } + return acc; + } + + /** + * Returns an array of all comments in the source code. + * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer, + * the element is changed with JSXExpressionContainer node. + * @returns {ASTNode[]} An array of comment nodes + */ + function getAllComments() { + const comments = []; + + sourceCode.getAllComments() + .forEach(commentNode => { + const containingNode = sourceCode.getNodeByRangeIndex(commentNode.range[0]); + + if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) { + + // push a unique node only + if (comments[comments.length - 1] !== containingNode.parent) { + comments.push(containingNode.parent); + } + } else { + comments.push(commentNode); + } + }); + + return comments; + } + + /** + * Check the program for max length + * @param {ASTNode} node Node to examine + * @returns {void} + * @private + */ + function checkProgramForMaxLength(node) { + + // split (honors line-ending) + const lines = sourceCode.lines, + + // list of comments to ignore + comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? getAllComments() : []; + + // we iterate over comments in parallel with the lines + let commentsIndex = 0; + + const strings = getAllStrings(); + const stringsByLine = strings.reduce(groupByLineNumber, {}); + + const templateLiterals = getAllTemplateLiterals(); + const templateLiteralsByLine = templateLiterals.reduce(groupByLineNumber, {}); + + const regExpLiterals = getAllRegExpLiterals(); + const regExpLiteralsByLine = regExpLiterals.reduce(groupByLineNumber, {}); + + lines.forEach((line, i) => { + + // i is zero-indexed, line numbers are one-indexed + const lineNumber = i + 1; + + /* + * if we're checking comment length; we need to know whether this + * line is a comment + */ + let lineIsComment = false; + let textToMeasure; + + /* + * We can short-circuit the comment checks if we're already out of + * comments to check. + */ + if (commentsIndex < comments.length) { + let comment = null; + + // iterate over comments until we find one past the current line + do { + comment = comments[++commentsIndex]; + } while (comment && comment.loc.start.line <= lineNumber); + + // and step back by one + comment = comments[--commentsIndex]; + + if (isFullLineComment(line, lineNumber, comment)) { + lineIsComment = true; + textToMeasure = line; + } else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) { + textToMeasure = stripTrailingComment(line, comment); + + // ignore multiple trailing comments in the same line + let lastIndex = commentsIndex; + + while (isTrailingComment(textToMeasure, lineNumber, comments[--lastIndex])) { + textToMeasure = stripTrailingComment(textToMeasure, comments[lastIndex]); + } + } else { + textToMeasure = line; + } + } else { + textToMeasure = line; + } + if (ignorePattern && ignorePattern.test(textToMeasure) || + ignoreUrls && URL_REGEXP.test(textToMeasure) || + ignoreStrings && stringsByLine[lineNumber] || + ignoreTemplateLiterals && templateLiteralsByLine[lineNumber] || + ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber] + ) { + + // ignore this line + return; + } + + const lineLength = computeLineLength(textToMeasure, tabWidth); + const commentLengthApplies = lineIsComment && maxCommentLength; + + if (lineIsComment && ignoreComments) { + return; + } + + if (commentLengthApplies) { + if (lineLength > maxCommentLength) { + context.report({ + node, + loc: { line: lineNumber, column: 0 }, + messageId: "maxComment", + data: { + lineLength, + maxCommentLength + } + }); + } + } else if (lineLength > maxLength) { + context.report({ + node, + loc: { line: lineNumber, column: 0 }, + messageId: "max", + data: { + lineLength, + maxLength + } + }); + } + }); + } + + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: checkProgramForMaxLength + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-lines-per-function.js b/day1/cli-study/node_modules/eslint/lib/rules/max-lines-per-function.js new file mode 100644 index 0000000..aa423a6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -0,0 +1,214 @@ +/** + * @fileoverview A rule to set the maximum number of line of code in a function. + * @author Pete Ward + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const OPTIONS_SCHEMA = { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + }, + IIFEs: { + type: "boolean" + } + }, + additionalProperties: false +}; + +const OPTIONS_OR_INTEGER_SCHEMA = { + oneOf: [ + OPTIONS_SCHEMA, + { + type: "integer", + minimum: 1 + } + ] +}; + +/** + * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values. + * @param {Array} comments An array of comment nodes. + * @returns {Map.} A map with numeric keys (source code line numbers) and comment token values. + */ +function getCommentLineNumbers(comments) { + const map = new Map(); + + comments.forEach(comment => { + for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) { + map.set(i, comment); + } + }); + return map; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of line of code in a function", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines-per-function" + }, + + schema: [ + OPTIONS_OR_INTEGER_SCHEMA + ], + messages: { + exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const lines = sourceCode.lines; + + const option = context.options[0]; + let maxLines = 50; + let skipComments = false; + let skipBlankLines = false; + let IIFEs = false; + + if (typeof option === "object") { + maxLines = typeof option.max === "number" ? option.max : 50; + skipComments = !!option.skipComments; + skipBlankLines = !!option.skipBlankLines; + IIFEs = !!option.IIFEs; + } else if (typeof option === "number") { + maxLines = option; + } + + const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + const start = comment.loc.start, + end = comment.loc.end, + isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), + isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); + + return comment && + (start.line < lineNumber || isFirstTokenOnLine) && + (end.line > lineNumber || isLastTokenOnLine); + } + + /** + * Identifies is a node is a FunctionExpression which is part of an IIFE + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's an IIFE + */ + function isIIFE(node) { + return (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && node.parent && node.parent.type === "CallExpression" && node.parent.callee === node; + } + + /** + * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property + * @param {ASTNode} node Node to test + * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property + */ + function isEmbedded(node) { + if (!node.parent) { + return false; + } + if (node !== node.parent.value) { + return false; + } + if (node.parent.type === "MethodDefinition") { + return true; + } + if (node.parent.type === "Property") { + return node.parent.method === true || node.parent.kind === "get" || node.parent.kind === "set"; + } + return false; + } + + /** + * Count the lines in the function + * @param {ASTNode} funcNode Function AST node + * @returns {void} + * @private + */ + function processFunction(funcNode) { + const node = isEmbedded(funcNode) ? funcNode.parent : funcNode; + + if (!IIFEs && isIIFE(node)) { + return; + } + let lineCount = 0; + + for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) { + const line = lines[i]; + + if (skipComments) { + if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) { + continue; + } + } + + if (skipBlankLines) { + if (line.match(/^\s*$/u)) { + continue; + } + } + + lineCount++; + } + + if (lineCount > maxLines) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(funcNode)); + + context.report({ + node, + messageId: "exceed", + data: { name, lineCount, maxLines } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: processFunction, + FunctionExpression: processFunction, + ArrowFunctionExpression: processFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-lines.js b/day1/cli-study/node_modules/eslint/lib/rules/max-lines.js new file mode 100644 index 0000000..f33adbd --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-lines.js @@ -0,0 +1,174 @@ +/** + * @fileoverview enforce a maximum file length + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of lines per file", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-lines" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + skipComments: { + type: "boolean" + }, + skipBlankLines: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: + "File has too many lines ({{actual}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const option = context.options[0]; + let max = 300; + + if ( + typeof option === "object" && + Object.prototype.hasOwnProperty.call(option, "max") + ) { + max = option.max; + } else if (typeof option === "number") { + max = option; + } + + const skipComments = option && option.skipComments; + const skipBlankLines = option && option.skipBlankLines; + + const sourceCode = context.getSourceCode(); + + /** + * Returns whether or not a token is a comment node type + * @param {Token} token The token to check + * @returns {boolean} True if the token is a comment node + */ + function isCommentNodeType(token) { + return token && (token.type === "Block" || token.type === "Line"); + } + + /** + * Returns the line numbers of a comment that don't have any code on the same line + * @param {Node} comment The comment node to check + * @returns {number[]} The line numbers + */ + function getLinesWithoutCode(comment) { + let start = comment.loc.start.line; + let end = comment.loc.end.line; + + let token; + + token = comment; + do { + token = sourceCode.getTokenBefore(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(token, comment)) { + start += 1; + } + + token = comment; + do { + token = sourceCode.getTokenAfter(token, { + includeComments: true + }); + } while (isCommentNodeType(token)); + + if (token && astUtils.isTokenOnSameLine(comment, token)) { + end -= 1; + } + + if (start <= end) { + return lodash.range(start, end + 1); + } + return []; + } + + return { + "Program:exit"() { + let lines = sourceCode.lines.map((text, i) => ({ + lineNumber: i + 1, + text + })); + + if (skipBlankLines) { + lines = lines.filter(l => l.text.trim() !== ""); + } + + if (skipComments) { + const comments = sourceCode.getAllComments(); + + const commentLines = lodash.flatten( + comments.map(comment => getLinesWithoutCode(comment)) + ); + + lines = lines.filter( + l => !lodash.includes(commentLines, l.lineNumber) + ); + } + + if (lines.length > max) { + const loc = { + start: { + line: lines[max].lineNumber, + column: 0 + }, + end: { + line: sourceCode.lines.length, + column: lodash.last(sourceCode.lines).length + } + }; + + context.report({ + loc, + messageId: "exceed", + data: { + max, + actual: lines.length + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-nested-callbacks.js b/day1/cli-study/node_modules/eslint/lib/rules/max-nested-callbacks.js new file mode 100644 index 0000000..df1bace --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -0,0 +1,117 @@ +/** + * @fileoverview Rule to enforce a maximum number of nested callbacks. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum depth that callbacks can be nested", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-nested-callbacks" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Constants + //-------------------------------------------------------------------------- + const option = context.options[0]; + let THRESHOLD = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + THRESHOLD = option.maximum || option.max; + } else if (typeof option === "number") { + THRESHOLD = option; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const callbackStack = []; + + /** + * Checks a given function node for too many callbacks. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + const parent = node.parent; + + if (parent.type === "CallExpression") { + callbackStack.push(node); + } + + if (callbackStack.length > THRESHOLD) { + const opts = { num: callbackStack.length, max: THRESHOLD }; + + context.report({ node, messageId: "exceed", data: opts }); + } + } + + /** + * Pops the call stack. + * @returns {void} + * @private + */ + function popStack() { + callbackStack.pop(); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: checkFunction, + "ArrowFunctionExpression:exit": popStack, + + FunctionExpression: checkFunction, + "FunctionExpression:exit": popStack + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-params.js b/day1/cli-study/node_modules/eslint/lib/rules/max-params.js new file mode 100644 index 0000000..4eebe2d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-params.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to flag when a function has too many parameters + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of parameters in function definitions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-params" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + } + ], + messages: { + exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0]; + let numParams = 3; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + numParams = option.maximum || option.max; + } + if (typeof option === "number") { + numParams = option; + } + + /** + * Checks a function to see if it has too many parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkFunction(node) { + if (node.params.length > numParams) { + context.report({ + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + node, + messageId: "exceed", + data: { + name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)), + count: node.params.length, + max: numParams + } + }); + } + } + + return { + FunctionDeclaration: checkFunction, + ArrowFunctionExpression: checkFunction, + FunctionExpression: checkFunction + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-statements-per-line.js b/day1/cli-study/node_modules/eslint/lib/rules/max-statements-per-line.js new file mode 100644 index 0000000..5407cff --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -0,0 +1,196 @@ +/** + * @fileoverview Specify the maximum number of statements allowed per line. + * @author Kenneth Williams + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce a maximum number of statements allowed per line", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements-per-line" + }, + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 1, + default: 1 + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; + + let lastStatementLine = 0, + numberOfStatementsOnThisLine = 0, + firstExtraStatement; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const SINGLE_CHILD_ALLOWED = /^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u; + + /** + * Reports with the first extra statement, and clears it. + * @returns {void} + */ + function reportFirstExtraStatementAndClear() { + if (firstExtraStatement) { + context.report({ + node: firstExtraStatement, + messageId: "exceed", + data: { + numberOfStatementsOnThisLine, + maxStatementsPerLine, + statements: numberOfStatementsOnThisLine === 1 ? "statement" : "statements" + } + }); + } + firstExtraStatement = null; + } + + /** + * Gets the actual last token of a given node. + * @param {ASTNode} node A node to get. This is a node except EmptyStatement. + * @returns {Token} The actual last token. + */ + function getActualLastToken(node) { + return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + } + + /** + * Addresses a given node. + * It updates the state of this rule, then reports the node if the node violated this rule. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function enterStatement(node) { + const line = node.loc.start.line; + + /* + * Skip to allow non-block statements if this is direct child of control statements. + * `if (a) foo();` is counted as 1. + * But `if (a) foo(); else foo();` should be counted as 2. + */ + if (SINGLE_CHILD_ALLOWED.test(node.parent.type) && + node.parent.alternate !== node + ) { + return; + } + + // Update state. + if (line === lastStatementLine) { + numberOfStatementsOnThisLine += 1; + } else { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + + // Reports if the node violated this rule. + if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) { + firstExtraStatement = firstExtraStatement || node; + } + } + + /** + * Updates the state of this rule with the end line of leaving node to check with the next statement. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function leaveStatement(node) { + const line = getActualLastToken(node).loc.end.line; + + // Update state. + if (line !== lastStatementLine) { + reportFirstExtraStatementAndClear(); + numberOfStatementsOnThisLine = 1; + lastStatementLine = line; + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + BreakStatement: enterStatement, + ClassDeclaration: enterStatement, + ContinueStatement: enterStatement, + DebuggerStatement: enterStatement, + DoWhileStatement: enterStatement, + ExpressionStatement: enterStatement, + ForInStatement: enterStatement, + ForOfStatement: enterStatement, + ForStatement: enterStatement, + FunctionDeclaration: enterStatement, + IfStatement: enterStatement, + ImportDeclaration: enterStatement, + LabeledStatement: enterStatement, + ReturnStatement: enterStatement, + SwitchStatement: enterStatement, + ThrowStatement: enterStatement, + TryStatement: enterStatement, + VariableDeclaration: enterStatement, + WhileStatement: enterStatement, + WithStatement: enterStatement, + ExportNamedDeclaration: enterStatement, + ExportDefaultDeclaration: enterStatement, + ExportAllDeclaration: enterStatement, + + "BreakStatement:exit": leaveStatement, + "ClassDeclaration:exit": leaveStatement, + "ContinueStatement:exit": leaveStatement, + "DebuggerStatement:exit": leaveStatement, + "DoWhileStatement:exit": leaveStatement, + "ExpressionStatement:exit": leaveStatement, + "ForInStatement:exit": leaveStatement, + "ForOfStatement:exit": leaveStatement, + "ForStatement:exit": leaveStatement, + "FunctionDeclaration:exit": leaveStatement, + "IfStatement:exit": leaveStatement, + "ImportDeclaration:exit": leaveStatement, + "LabeledStatement:exit": leaveStatement, + "ReturnStatement:exit": leaveStatement, + "SwitchStatement:exit": leaveStatement, + "ThrowStatement:exit": leaveStatement, + "TryStatement:exit": leaveStatement, + "VariableDeclaration:exit": leaveStatement, + "WhileStatement:exit": leaveStatement, + "WithStatement:exit": leaveStatement, + "ExportNamedDeclaration:exit": leaveStatement, + "ExportDefaultDeclaration:exit": leaveStatement, + "ExportAllDeclaration:exit": leaveStatement, + "Program:exit": reportFirstExtraStatementAndClear + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/max-statements.js b/day1/cli-study/node_modules/eslint/lib/rules/max-statements.js new file mode 100644 index 0000000..437b393 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/max-statements.js @@ -0,0 +1,175 @@ +/** + * @fileoverview A rule to set the maximum number of statements in a function. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a maximum number of statements allowed in function blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/max-statements" + }, + + schema: [ + { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + type: "object", + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + max: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + ignoreTopLevelFunctions: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + messages: { + exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = [], + option = context.options[0], + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + let maxStatements = 10; + + if ( + typeof option === "object" && + (Object.prototype.hasOwnProperty.call(option, "maximum") || Object.prototype.hasOwnProperty.call(option, "max")) + ) { + maxStatements = option.maximum || option.max; + } else if (typeof option === "number") { + maxStatements = option; + } + + /** + * Reports a node if it has too many statements + * @param {ASTNode} node node to evaluate + * @param {int} count Number of statements in node + * @param {int} max Maximum number of statements allowed + * @returns {void} + * @private + */ + function reportIfTooManyStatements(node, count, max) { + if (count > max) { + const name = lodash.upperFirst(astUtils.getFunctionNameWithKind(node)); + + context.report({ + node, + messageId: "exceed", + data: { name, count, max } + }); + } + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push(0); + } + + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function endFunction(node) { + const count = functionStack.pop(); + + if (ignoreTopLevelFunctions && functionStack.length === 0) { + topLevelFunctions.push({ node, count }); + } else { + reportIfTooManyStatements(node, count, maxStatements); + } + } + + /** + * Increment the count of the functions + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function countStatements(node) { + functionStack[functionStack.length - 1] += node.body.length; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + + BlockStatement: countStatements, + + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction, + + "Program:exit"() { + if (topLevelFunctions.length === 1) { + return; + } + + topLevelFunctions.forEach(element => { + const count = element.count; + const node = element.node; + + reportIfTooManyStatements(node, count, maxStatements); + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/multiline-comment-style.js b/day1/cli-study/node_modules/eslint/lib/rules/multiline-comment-style.js new file mode 100644 index 0000000..9524818 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -0,0 +1,435 @@ +/** + * @fileoverview enforce a particular style for multiline comments + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce a particular style for multiline comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-comment-style" + }, + + fixable: "whitespace", + schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], + messages: { + expectedBlock: "Expected a block comment instead of consecutive line comments.", + expectedBareBlock: "Expected a block comment without padding stars.", + startNewline: "Expected a linebreak after '/*'.", + endNewline: "Expected a linebreak before '*/'.", + missingStar: "Expected a '*' at the start of this line.", + alignment: "Expected this line to be aligned with the start of the comment.", + expectedLines: "Expected multiple line comments instead of a block comment." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "starred-block"; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks if a comment line is starred. + * @param {string} line A string representing a comment line. + * @returns {boolean} Whether or not the comment line is starred. + */ + function isStarredCommentLine(line) { + return /^\s*\*/u.test(line); + } + + /** + * Checks if a comment group is in starred-block form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in starred block form. + */ + function isStarredBlockComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + // The first and last lines can only contain whitespace. + return lines.length > 0 && lines.every((line, i) => (i === 0 || i === lines.length - 1 ? /^\s*$/u : /^\s*\*/u).test(line)); + } + + /** + * Checks if a comment group is in JSDoc form. + * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment. + * @returns {boolean} Whether or not the comment group is in JSDoc form. + */ + function isJSDocComment([firstComment]) { + if (firstComment.type !== "Block") { + return false; + } + + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + + return /^\*\s*$/u.test(lines[0]) && + lines.slice(1, -1).every(line => /^\s* /u.test(line)) && + /^\s*$/u.test(lines[lines.length - 1]); + } + + /** + * Processes a comment group that is currently in separate-line form, calculating the offset for each line. + * @param {Token[]} commentGroup A group of comments containing multiple line comments. + * @returns {string[]} An array of the processed lines. + */ + function processSeparateLineComments(commentGroup) { + const allLinesHaveLeadingSpace = commentGroup + .map(({ value }) => value) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return commentGroup.map(({ value }) => (allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value)); + } + + /** + * Processes a comment group that is currently in starred-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in starred-block form. + * @returns {string[]} An array of the processed lines. + */ + function processStarredBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER) + .filter((line, i, linesArr) => !(i === 0 || i === linesArr.length - 1)) + .map(line => line.replace(/^\s*$/u, "")); + const allLinesHaveLeadingSpace = lines + .map(line => line.replace(/\s*\*/u, "")) + .filter(line => line.trim().length) + .every(line => line.startsWith(" ")); + + return lines.map(line => line.replace(allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u, "")); + } + + /** + * Processes a comment group that is currently in bare-block form, calculating the offset for each line. + * @param {Token} comment A single block comment token in bare-block form. + * @returns {string[]} An array of the processed lines. + */ + function processBareBlockComment(comment) { + const lines = comment.value.split(astUtils.LINEBREAK_MATCHER).map(line => line.replace(/^\s*$/u, "")); + const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])} `; + let offset = ""; + + /* + * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines. + * The first line should not be checked because it is inline with the opening block comment delimiter. + */ + for (const [i, line] of lines.entries()) { + if (!line.trim().length || i === 0) { + continue; + } + + const [, lineOffset] = line.match(/^(\s*\*?\s*)/u); + + if (lineOffset.length < leadingWhitespace.length) { + const newOffset = leadingWhitespace.slice(lineOffset.length - leadingWhitespace.length); + + if (newOffset.length > offset.length) { + offset = newOffset; + } + } + } + + return lines.map(line => { + const match = line.match(/^(\s*\*?\s*)(.*)/u); + const [, lineOffset, lineContents] = match; + + if (lineOffset.length > leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`; + } + + if (lineOffset.length < leadingWhitespace.length) { + return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`; + } + + return lineContents; + }); + } + + /** + * Gets a list of comment lines in a group, formatting leading whitespace as necessary. + * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment. + * @returns {string[]} A list of comment lines. + */ + function getCommentLines(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type === "Line") { + return processSeparateLineComments(commentGroup); + } + + if (isStarredBlockComment(commentGroup)) { + return processStarredBlockComment(firstComment); + } + + return processBareBlockComment(firstComment); + } + + /** + * Gets the initial offset (whitespace) from the beginning of a line to a given comment token. + * @param {Token} comment The token to check. + * @returns {string} The offset from the beginning of a line to the token. + */ + function getInitialOffset(comment) { + return sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0]); + } + + /** + * Converts a comment into starred-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers + */ + function convertToStarredBlock(firstComment, commentLinesList) { + const initialOffset = getInitialOffset(firstComment); + + return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`; + } + + /** + * Converts a comment into separate-line form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in separate-line form + */ + function convertToSeparateLines(firstComment, commentLinesList) { + return commentLinesList.map(line => `// ${line}`).join(`\n${getInitialOffset(firstComment)}`); + } + + /** + * Converts a comment into bare-block form + * @param {Token} firstComment The first comment of the group being converted + * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment + * @returns {string} A representation of the comment value in bare-block form + */ + function convertToBlock(firstComment, commentLinesList) { + return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)} `)} */`; + } + + /** + * Each method checks a group of comments to see if it's valid according to the given option. + * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single + * block comment or multiple line comments. + * @returns {void} + */ + const commentGroupCheckers = { + "starred-block"(commentGroup) { + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + if (commentLines.some(value => value.includes("*/"))) { + return; + } + + if (commentGroup.length > 1) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + const range = [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]]; + + return commentLines.some(value => value.startsWith("/")) + ? null + : fixer.replaceTextRange(range, convertToStarredBlock(firstComment, commentLines)); + } + }); + } else { + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); + const expectedLeadingWhitespace = getInitialOffset(firstComment); + const expectedLinePrefix = `${expectedLeadingWhitespace} *`; + + if (!/^\*?\s*$/u.test(lines[0])) { + const start = firstComment.value.startsWith("*") ? firstComment.range[0] + 1 : firstComment.range[0]; + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "startNewline", + fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) + }); + } + + if (!/^\s*$/u.test(lines[lines.length - 1])) { + context.report({ + loc: { + start: { line: firstComment.loc.end.line, column: firstComment.loc.end.column - 2 }, + end: firstComment.loc.end + }, + messageId: "endNewline", + fix: fixer => fixer.replaceTextRange([firstComment.range[1] - 2, firstComment.range[1]], `\n${expectedLinePrefix}/`) + }); + } + + for (let lineNumber = firstComment.loc.start.line + 1; lineNumber <= firstComment.loc.end.line; lineNumber++) { + const lineText = sourceCode.lines[lineNumber - 1]; + const errorType = isStarredCommentLine(lineText) + ? "alignment" + : "missingStar"; + + if (!lineText.startsWith(expectedLinePrefix)) { + context.report({ + loc: { + start: { line: lineNumber, column: 0 }, + end: { line: lineNumber, column: lineText.length } + }, + messageId: errorType, + fix(fixer) { + const lineStartIndex = sourceCode.getIndexFromLoc({ line: lineNumber, column: 0 }); + + if (errorType === "alignment") { + const [, commentTextPrefix = ""] = lineText.match(/^(\s*\*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], expectedLinePrefix); + } + + const [, commentTextPrefix = ""] = lineText.match(/^(\s*)/u) || []; + const commentTextStartIndex = lineStartIndex + commentTextPrefix.length; + let offset; + + for (const [idx, line] of lines.entries()) { + if (!/\S+/u.test(line)) { + continue; + } + + const lineTextToAlignWith = sourceCode.lines[firstComment.loc.start.line - 1 + idx]; + const [, prefix = "", initialOffset = ""] = lineTextToAlignWith.match(/^(\s*(?:\/?\*)?(\s*))/u) || []; + + offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`; + + if (/^\s*\//u.test(lineText) && offset.length === 0) { + offset += " "; + } + break; + } + + return fixer.replaceTextRange([lineStartIndex, commentTextStartIndex], `${expectedLinePrefix}${offset}`); + } + }); + } + } + } + }, + "separate-lines"(commentGroup) { + const [firstComment] = commentGroup; + + if (firstComment.type !== "Block" || isJSDocComment(commentGroup)) { + return; + } + + const commentLines = getCommentLines(commentGroup); + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); + + if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { + return; + } + + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedLines", + fix(fixer) { + return fixer.replaceText(firstComment, convertToSeparateLines(firstComment, commentLines)); + } + }); + }, + "bare-block"(commentGroup) { + if (isJSDocComment(commentGroup)) { + return; + } + + const [firstComment] = commentGroup; + const commentLines = getCommentLines(commentGroup); + + // Disallows consecutive line comments in favor of using a block comment. + if (firstComment.type === "Line" && commentLines.length > 1 && + !commentLines.some(value => value.includes("*/"))) { + context.report({ + loc: { + start: firstComment.loc.start, + end: commentGroup[commentGroup.length - 1].loc.end + }, + messageId: "expectedBlock", + fix(fixer) { + return fixer.replaceTextRange( + [firstComment.range[0], commentGroup[commentGroup.length - 1].range[1]], + convertToBlock(firstComment, commentLines) + ); + } + }); + } + + // Prohibits block comments from having a * at the beginning of each line. + if (isStarredBlockComment(commentGroup)) { + context.report({ + loc: { + start: firstComment.loc.start, + end: { line: firstComment.loc.start.line, column: firstComment.loc.start.column + 2 } + }, + messageId: "expectedBareBlock", + fix(fixer) { + return fixer.replaceText(firstComment, convertToBlock(firstComment, commentLines)); + } + }); + } + } + }; + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + Program() { + return sourceCode.getAllComments() + .filter(comment => comment.type !== "Shebang") + .filter(comment => !astUtils.COMMENTS_IGNORE_PATTERN.test(comment.value)) + .filter(comment => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + return !tokenBefore || tokenBefore.loc.end.line < comment.loc.start.line; + }) + .reduce((commentGroups, comment, index, commentList) => { + const tokenBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + + if ( + comment.type === "Line" && + index && commentList[index - 1].type === "Line" && + tokenBefore && tokenBefore.loc.end.line === comment.loc.start.line - 1 && + tokenBefore === commentList[index - 1] + ) { + commentGroups[commentGroups.length - 1].push(comment); + } else { + commentGroups.push([comment]); + } + + return commentGroups; + }, []) + .filter(commentGroup => !(commentGroup.length === 1 && commentGroup[0].loc.start.line === commentGroup[0].loc.end.line)) + .forEach(commentGroupCheckers[option]); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/multiline-ternary.js b/day1/cli-study/node_modules/eslint/lib/rules/multiline-ternary.js new file mode 100644 index 0000000..6668bff --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/multiline-ternary.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Enforce newlines between operands of ternary expressions + * @author Kai Cataldo + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce newlines between operands of ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/multiline-ternary" + }, + + schema: [ + { + enum: ["always", "always-multiline", "never"] + } + ], + messages: { + expectedTestCons: "Expected newline between test and consequent of ternary expression.", + expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", + unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", + unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." + } + }, + + create(context) { + const option = context.options[0]; + const multiline = option !== "never"; + const allowSingleLine = option === "always-multiline"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression(node) { + const questionToken = sourceCode.getTokenAfter(node.test, astUtils.isNotClosingParenToken); + const colonToken = sourceCode.getTokenAfter(node.consequent, astUtils.isNotClosingParenToken); + + const firstTokenOfTest = sourceCode.getFirstToken(node); + const lastTokenOfTest = sourceCode.getTokenBefore(questionToken); + const firstTokenOfConsequent = sourceCode.getTokenAfter(questionToken); + const lastTokenOfConsequent = sourceCode.getTokenBefore(colonToken); + const firstTokenOfAlternate = sourceCode.getTokenAfter(colonToken); + + const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); + const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); + + if (!multiline) { + if (!areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "unexpectedTestCons" + }); + } + + if (!areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "unexpectedConsAlt" + }); + } + } else { + if (allowSingleLine && node.loc.start.line === node.loc.end.line) { + return; + } + + if (areTestAndConsequentOnSameLine) { + context.report({ + node: node.test, + loc: { + start: firstTokenOfTest.loc.start, + end: lastTokenOfTest.loc.end + }, + messageId: "expectedTestCons" + }); + } + + if (areConsequentAndAlternateOnSameLine) { + context.report({ + node: node.consequent, + loc: { + start: firstTokenOfConsequent.loc.start, + end: lastTokenOfConsequent.loc.end + }, + messageId: "expectedConsAlt" + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/new-cap.js b/day1/cli-study/node_modules/eslint/lib/rules/new-cap.js new file mode 100644 index 0000000..0faf45e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/new-cap.js @@ -0,0 +1,279 @@ +/** + * @fileoverview Rule to flag use of constructors without capital letters + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const CAPS_ALLOWED = [ + "Array", + "Boolean", + "Date", + "Error", + "Function", + "Number", + "Object", + "RegExp", + "String", + "Symbol", + "BigInt" +]; + +/** + * Ensure that if the key is provided, it must be an array. + * @param {Object} obj Object to check with `key`. + * @param {string} key Object key to check on `obj`. + * @param {*} fallback If obj[key] is not present, this will be returned. + * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` + */ +function checkArray(obj, key, fallback) { + + /* istanbul ignore if */ + if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { + throw new TypeError(`${key}, if provided, must be an Array`); + } + return obj[key] || fallback; +} + +/** + * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. + * @param {Object} map Accumulator object for the reduce. + * @param {string} key Object key to set to `true`. + * @returns {Object} Returns the updated Object for further reduction. + */ +function invert(map, key) { + map[key] = true; + return map; +} + +/** + * Creates an object with the cap is new exceptions as its keys and true as their values. + * @param {Object} config Rule configuration + * @returns {Object} Object with cap is new exceptions. + */ +function calculateCapIsNewExceptions(config) { + let capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); + + if (capIsNewExceptions !== CAPS_ALLOWED) { + capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); + } + + return capIsNewExceptions.reduce(invert, {}); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require constructor names to begin with a capital letter", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-cap" + }, + + schema: [ + { + type: "object", + properties: { + newIsCap: { + type: "boolean", + default: true + }, + capIsNew: { + type: "boolean", + default: true + }, + newIsCapExceptions: { + type: "array", + items: { + type: "string" + } + }, + newIsCapExceptionPattern: { + type: "string" + }, + capIsNewExceptions: { + type: "array", + items: { + type: "string" + } + }, + capIsNewExceptionPattern: { + type: "string" + }, + properties: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + messages: { + upper: "A function with a name starting with an uppercase letter should only be used as a constructor.", + lower: "A constructor name should not start with a lowercase letter." + } + }, + + create(context) { + + const config = Object.assign({}, context.options[0]); + + config.newIsCap = config.newIsCap !== false; + config.capIsNew = config.capIsNew !== false; + const skipProperties = config.properties === false; + + const newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); + const newIsCapExceptionPattern = config.newIsCapExceptionPattern ? new RegExp(config.newIsCapExceptionPattern, "u") : null; + + const capIsNewExceptions = calculateCapIsNewExceptions(config); + const capIsNewExceptionPattern = config.capIsNewExceptionPattern ? new RegExp(config.capIsNewExceptionPattern, "u") : null; + + const listeners = {}; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Get exact callee name from expression + * @param {ASTNode} node CallExpression or NewExpression node + * @returns {string} name + */ + function extractNameFromExpression(node) { + + let name = ""; + + if (node.callee.type === "MemberExpression") { + name = astUtils.getStaticPropertyName(node.callee) || ""; + } else { + name = node.callee.name; + } + return name; + } + + /** + * Returns the capitalization state of the string - + * Whether the first character is uppercase, lowercase, or non-alphabetic + * @param {string} str String + * @returns {string} capitalization state: "non-alpha", "lower", or "upper" + */ + function getCap(str) { + const firstChar = str.charAt(0); + + const firstCharLower = firstChar.toLowerCase(); + const firstCharUpper = firstChar.toUpperCase(); + + if (firstCharLower === firstCharUpper) { + + // char has no uppercase variant, so it's non-alphabetic + return "non-alpha"; + } + if (firstChar === firstCharLower) { + return "lower"; + } + return "upper"; + + } + + /** + * Check if capitalization is allowed for a CallExpression + * @param {Object} allowedMap Object mapping calleeName to a Boolean + * @param {ASTNode} node CallExpression node + * @param {string} calleeName Capitalized callee name from a CallExpression + * @param {Object} pattern RegExp object from options pattern + * @returns {boolean} Returns true if the callee may be capitalized + */ + function isCapAllowed(allowedMap, node, calleeName, pattern) { + const sourceText = sourceCode.getText(node.callee); + + if (allowedMap[calleeName] || allowedMap[sourceText]) { + return true; + } + + if (pattern && pattern.test(sourceText)) { + return true; + } + + if (calleeName === "UTC" && node.callee.type === "MemberExpression") { + + // allow if callee is Date.UTC + return node.callee.object.type === "Identifier" && + node.callee.object.name === "Date"; + } + + return skipProperties && node.callee.type === "MemberExpression"; + } + + /** + * Reports the given messageId for the given node. The location will be the start of the property or the callee. + * @param {ASTNode} node CallExpression or NewExpression node. + * @param {string} messageId The messageId to report. + * @returns {void} + */ + function report(node, messageId) { + let callee = node.callee; + + if (callee.type === "MemberExpression") { + callee = callee.property; + } + + context.report({ node, loc: callee.loc, messageId }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + if (config.newIsCap) { + listeners.NewExpression = function(node) { + + const constructorName = extractNameFromExpression(node); + + if (constructorName) { + const capitalization = getCap(constructorName); + const isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName, newIsCapExceptionPattern); + + if (!isAllowed) { + report(node, "lower"); + } + } + }; + } + + if (config.capIsNew) { + listeners.CallExpression = function(node) { + + const calleeName = extractNameFromExpression(node); + + if (calleeName) { + const capitalization = getCap(calleeName); + const isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName, capIsNewExceptionPattern); + + if (!isAllowed) { + report(node, "upper"); + } + } + }; + } + + return listeners; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/new-parens.js b/day1/cli-study/node_modules/eslint/lib/rules/new-parens.js new file mode 100644 index 0000000..405ec1b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/new-parens.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to flag when using constructor without parentheses + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce or disallow parentheses when invoking a constructor with no arguments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/new-parens" + }, + + fixable: "code", + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "never"] + } + ], + minItems: 0, + maxItems: 1 + } + ] + }, + messages: { + missing: "Missing '()' invoking a constructor.", + unnecessary: "Unnecessary '()' invoking a constructor with no arguments." + } + }, + + create(context) { + const options = context.options; + const always = options[0] !== "never"; // Default is always + + const sourceCode = context.getSourceCode(); + + return { + NewExpression(node) { + if (node.arguments.length !== 0) { + return; // if there are arguments, there have to be parens + } + + const lastToken = sourceCode.getLastToken(node); + const hasLastParen = lastToken && astUtils.isClosingParenToken(lastToken); + + // `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens + const hasParens = hasLastParen && + astUtils.isOpeningParenToken(sourceCode.getTokenBefore(lastToken)) && + node.callee.range[1] < node.range[1]; + + if (always) { + if (!hasParens) { + context.report({ + node, + messageId: "missing", + fix: fixer => fixer.insertTextAfter(node, "()") + }); + } + } else { + if (hasParens) { + context.report({ + node, + messageId: "unnecessary", + fix: fixer => [ + fixer.remove(sourceCode.getTokenBefore(lastToken)), + fixer.remove(lastToken), + fixer.insertTextBefore(node, "("), + fixer.insertTextAfter(node, ")") + ] + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/newline-after-var.js b/day1/cli-study/node_modules/eslint/lib/rules/newline-after-var.js new file mode 100644 index 0000000..4809d9b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/newline-after-var.js @@ -0,0 +1,255 @@ +/** + * @fileoverview Rule to check empty newline after "var" statement + * @author Gopal Venkatesan + * @deprecated + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow an empty line after variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-after-var" + }, + schema: [ + { + enum: ["never", "always"] + } + ], + fixable: "whitespace", + messages: { + expected: "Expected blank line after variable declarations.", + unexpected: "Unexpected blank line after variable declarations." + }, + + deprecated: true, + + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Default `mode` to "always". + const mode = context.options[0] === "never" ? "never" : "always"; + + // Cache starting and ending line numbers of comments for faster lookup + const commentEndLine = sourceCode.getAllComments().reduce((result, token) => { + result[token.loc.start.line] = token.loc.end.line; + return result; + }, {}); + + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a token from the given node to compare line to the next statement. + * + * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy. + * + * - The last token is semicolon. + * - The semicolon is on a different line from the previous token of the semicolon. + * + * This behavior would address semicolon-less style code. e.g.: + * + * var foo = 1 + * + * ;(a || b).doSomething() + * @param {ASTNode} node The node to get. + * @returns {Token} The token to compare line to the next statement. + */ + function getLastToken(node) { + const lastToken = sourceCode.getLastToken(node); + + if (lastToken.type === "Punctuator" && lastToken.value === ";") { + const prevToken = sourceCode.getTokenBefore(lastToken); + + if (prevToken.loc.end.line !== lastToken.loc.start.line) { + return prevToken; + } + } + + return lastToken; + } + + /** + * Determine if provided keyword is a variable declaration + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a type of var + */ + function isVar(keyword) { + return keyword === "var" || keyword === "let" || keyword === "const"; + } + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Determine if provided keyword is an export specifiers + * @private + * @param {string} nodeType nodeType to test + * @returns {boolean} True if `nodeType` is an export specifier + */ + function isExportSpecifier(nodeType) { + return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" || + nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; + } + + /** + * Determine if provided node is the last of their parent block. + * @private + * @param {ASTNode} node node to test + * @returns {boolean} True if `node` is last of their parent block. + */ + function isLastNode(node) { + const token = sourceCode.getTokenAfter(node); + + return !token || (token.type === "Punctuator" && token.value === "}"); + } + + /** + * Gets the last line of a group of consecutive comments + * @param {number} commentStartLine The starting line of the group + * @returns {number} The number of the last comment line of the group + */ + function getLastCommentLineOfBlock(commentStartLine) { + const currentCommentEnd = commentEndLine[commentStartLine]; + + return commentEndLine[currentCommentEnd + 1] ? getLastCommentLineOfBlock(currentCommentEnd + 1) : currentCommentEnd; + } + + /** + * Determine if a token starts more than one line after a comment ends + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment + */ + function hasBlankLineAfterComment(token, commentStartLine) { + return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1; + } + + /** + * Checks that a blank line exists after a variable declaration when mode is + * set to "always", or checks that there is no blank line when mode is set + * to "never" + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForBlankLine(node) { + + /* + * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will + * sometimes be second-last if there is a semicolon on a different line. + */ + const lastToken = getLastToken(node), + + /* + * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken + * is the last token of the node. + */ + nextToken = lastToken === sourceCode.getLastToken(node) ? sourceCode.getTokenAfter(node) : sourceCode.getLastToken(node), + nextLineNum = lastToken.loc.end.line + 1; + + // Ignore if there is no following statement + if (!nextToken) { + return; + } + + // Ignore if parent of node is a for variant + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + // Ignore if parent of node is an export specifier + if (isExportSpecifier(node.parent.type)) { + return; + } + + /* + * Some coding styles use multiple `var` statements, so do nothing if + * the next token is a `var` statement. + */ + if (nextToken.type === "Keyword" && isVar(nextToken.value)) { + return; + } + + // Ignore if it is last statement in a block + if (isLastNode(node)) { + return; + } + + // Next statement is not a `var`... + const noNextLineToken = nextToken.loc.start.line > nextLineNum; + const hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); + + if (mode === "never" && noNextLineToken && !hasNextLineComment) { + context.report({ + node, + messageId: "unexpected", + data: { identifier: node.name }, + fix(fixer) { + const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); + + return fixer.replaceTextRange([lastToken.range[1], nextToken.range[0]], `${linesBetween.slice(0, -1).join("")}\n${linesBetween[linesBetween.length - 1]}`); + } + }); + } + + // Token on the next line, or comment without blank line + if ( + mode === "always" && ( + !noNextLineToken || + hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) + ) + ) { + context.report({ + node, + messageId: "expected", + data: { identifier: node.name }, + fix(fixer) { + if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { + return fixer.insertTextBefore(nextToken, "\n\n"); + } + + return fixer.insertTextBeforeRange([nextToken.range[0] - nextToken.loc.start.column, nextToken.range[1]], "\n"); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForBlankLine + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/newline-before-return.js b/day1/cli-study/node_modules/eslint/lib/rules/newline-before-return.js new file mode 100644 index 0000000..65ca323 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/newline-before-return.js @@ -0,0 +1,217 @@ +/** + * @fileoverview Rule to require newlines before `return` statement + * @author Kai Cataldo + * @deprecated + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require an empty line before `return` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-before-return" + }, + + fixable: "whitespace", + schema: [], + messages: { + expected: "Expected newline before return statement." + }, + + deprecated: true, + replacedBy: ["padding-line-between-statements"] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tests whether node is preceded by supplied tokens + * @param {ASTNode} node node to check + * @param {Array} testTokens array of tokens to test against + * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens + * @private + */ + function isPrecededByTokens(node, testTokens) { + const tokenBefore = sourceCode.getTokenBefore(node); + + return testTokens.some(token => tokenBefore.value === token); + } + + /** + * Checks whether node is the first node after statement or in block + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is the first node after statement or in block + * @private + */ + function isFirstNode(node) { + const parentType = node.parent.type; + + if (node.parent.body) { + return Array.isArray(node.parent.body) + ? node.parent.body[0] === node + : node.parent.body === node; + } + + if (parentType === "IfStatement") { + return isPrecededByTokens(node, ["else", ")"]); + } + if (parentType === "DoWhileStatement") { + return isPrecededByTokens(node, ["do"]); + } + if (parentType === "SwitchCase") { + return isPrecededByTokens(node, [":"]); + } + return isPrecededByTokens(node, [")"]); + + } + + /** + * Returns the number of lines of comments that precede the node + * @param {ASTNode} node node to check for overlapping comments + * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments + * @returns {number} Number of lines of comments that precede the node + * @private + */ + function calcCommentLines(node, lineNumTokenBefore) { + const comments = sourceCode.getCommentsBefore(node); + let numLinesComments = 0; + + if (!comments.length) { + return numLinesComments; + } + + comments.forEach(comment => { + numLinesComments++; + + if (comment.type === "Block") { + numLinesComments += comment.loc.end.line - comment.loc.start.line; + } + + // avoid counting lines with inline comments twice + if (comment.loc.start.line === lineNumTokenBefore) { + numLinesComments--; + } + + if (comment.loc.end.line === node.loc.start.line) { + numLinesComments--; + } + }); + + return numLinesComments; + } + + /** + * Returns the line number of the token before the node that is passed in as an argument + * @param {ASTNode} node The node to use as the start of the calculation + * @returns {number} Line number of the token before `node` + * @private + */ + function getLineNumberOfTokenBefore(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + let lineNumTokenBefore; + + /** + * Global return (at the beginning of a script) is a special case. + * If there is no token before `return`, then we expect no line + * break before the return. Comments are allowed to occupy lines + * before the global return, just no blank lines. + * Setting lineNumTokenBefore to zero in that case results in the + * desired behavior. + */ + if (tokenBefore) { + lineNumTokenBefore = tokenBefore.loc.end.line; + } else { + lineNumTokenBefore = 0; // global return at beginning of script + } + + return lineNumTokenBefore; + } + + /** + * Checks whether node is preceded by a newline + * @param {ASTNode} node node to check + * @returns {boolean} Whether or not the node is preceded by a newline + * @private + */ + function hasNewlineBefore(node) { + const lineNumNode = node.loc.start.line; + const lineNumTokenBefore = getLineNumberOfTokenBefore(node); + const commentLines = calcCommentLines(node, lineNumTokenBefore); + + return (lineNumNode - lineNumTokenBefore - commentLines) > 1; + } + + /** + * Checks whether it is safe to apply a fix to a given return statement. + * + * The fix is not considered safe if the given return statement has leading comments, + * as we cannot safely determine if the newline should be added before or after the comments. + * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211 + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if it can fix the node. + * @private + */ + function canFix(node) { + const leadingComments = sourceCode.getCommentsBefore(node); + const lastLeadingComment = leadingComments[leadingComments.length - 1]; + const tokenBefore = sourceCode.getTokenBefore(node); + + if (leadingComments.length === 0) { + return true; + } + + /* + * if the last leading comment ends in the same line as the previous token and + * does not share a line with the `return` node, we can consider it safe to fix. + * Example: + * function a() { + * var b; //comment + * return; + * } + */ + if (lastLeadingComment.loc.end.line === tokenBefore.loc.end.line && + lastLeadingComment.loc.end.line !== node.loc.start.line) { + return true; + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ReturnStatement(node) { + if (!isFirstNode(node) && !hasNewlineBefore(node)) { + context.report({ + node, + messageId: "expected", + fix(fixer) { + if (canFix(node)) { + const tokenBefore = sourceCode.getTokenBefore(node); + const newlines = node.loc.start.line === tokenBefore.loc.end.line ? "\n\n" : "\n"; + + return fixer.insertTextBefore(node, newlines); + } + return null; + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/newline-per-chained-call.js b/day1/cli-study/node_modules/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 0000000..4254fec --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @author Burak Yigit Kaya + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require a newline after each call in a method chain", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/newline-per-chained-call" + }, + + fixable: "whitespace", + + schema: [{ + type: "object", + properties: { + ignoreChainWithDepth: { + type: "integer", + minimum: 1, + maximum: 10, + default: 2 + } + }, + additionalProperties: false + }], + messages: { + expected: "Expected line break before `{{callee}}`." + } + }, + + create(context) { + + const options = context.options[0] || {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + const sourceCode = context.getSourceCode(); + + /** + * Get the prefix of a given MemberExpression node. + * If the MemberExpression node is a computed value it returns a + * left bracket. If not it returns a period. + * @param {ASTNode} node A MemberExpression node to get + * @returns {string} The prefix of the node. + */ + function getPrefix(node) { + return node.computed ? "[" : "."; + } + + /** + * Gets the property text of a given MemberExpression node. + * If the text is multiline, this returns only the first line. + * @param {ASTNode} node A MemberExpression node to get. + * @returns {string} The property text of the node. + */ + function getPropertyText(node) { + const prefix = getPrefix(node); + const lines = sourceCode.getText(node.property).split(astUtils.LINEBREAK_MATCHER); + const suffix = node.computed && lines.length === 1 ? "]" : ""; + + return prefix + lines[0] + suffix; + } + + return { + "CallExpression:exit"(node) { + if (!node.callee || node.callee.type !== "MemberExpression") { + return; + } + + const callee = node.callee; + let parent = callee.object; + let depth = 1; + + while (parent && parent.callee) { + depth += 1; + parent = parent.callee.object; + } + + if (depth > ignoreChainWithDepth && astUtils.isTokenOnSameLine(callee.object, callee.property)) { + const firstTokenAfterObject = sourceCode.getTokenAfter(callee.object, astUtils.isNotClosingParenToken); + + context.report({ + node: callee.property, + loc: { + start: firstTokenAfterObject.loc.start, + end: callee.loc.end + }, + messageId: "expected", + data: { + callee: getPropertyText(callee) + }, + fix(fixer) { + return fixer.insertTextBefore(firstTokenAfterObject, "\n"); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-alert.js b/day1/cli-study/node_modules/eslint/lib/rules/no-alert.js new file mode 100644 index 0000000..22d0dd5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-alert.js @@ -0,0 +1,129 @@ +/** + * @fileoverview Rule to flag use of alert, confirm, prompt + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getStaticPropertyName: getPropertyName, + getVariableByName +} = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given name is a prohibited identifier. + * @param {string} name The name to check + * @returns {boolean} Whether or not the name is prohibited. + */ +function isProhibitedIdentifier(name) { + return /^(alert|confirm|prompt)$/u.test(name); +} + +/** + * Finds the eslint-scope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]); + + if (references.length === 1) { + return references[0]; + } + return null; +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + const reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +/** + * Checks if the given identifier node is a ThisExpression in the global scope or the global window property. + * @param {Object} scope The current scope. + * @param {string} node The identifier node to check + * @returns {boolean} Whether or not the node is a reference to the global object. + */ +function isGlobalThisReferenceOrGlobalWindow(scope, node) { + if (scope.type === "global" && node.type === "ThisExpression") { + return true; + } + if (node.name === "window" || (node.name === "globalThis" && getVariableByName(scope, "globalThis"))) { + return !isShadowed(scope, node); + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `alert`, `confirm`, and `prompt`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-alert" + }, + + schema: [], + + messages: { + unexpected: "Unexpected {{name}}." + } + }, + + create(context) { + return { + CallExpression(node) { + const callee = node.callee, + currentScope = context.getScope(); + + // without window. + if (callee.type === "Identifier") { + const name = callee.name; + + if (!isShadowed(currentScope, callee) && isProhibitedIdentifier(callee.name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + + } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, callee.object)) { + const name = getPropertyName(callee); + + if (isProhibitedIdentifier(name)) { + context.report({ + node, + messageId: "unexpected", + data: { name } + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-array-constructor.js b/day1/cli-study/node_modules/eslint/lib/rules/no-array-constructor.js new file mode 100644 index 0000000..90c6d6b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-array-constructor.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Disallow construction of dense arrays using the Array constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Array` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-array-constructor" + }, + + schema: [], + + messages: { + preferLiteral: "The array literal notation [] is preferable." + } + }, + + create(context) { + + /** + * Disallow construction of dense arrays using the Array constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function check(node) { + if ( + node.arguments.length !== 1 && + node.callee.type === "Identifier" && + node.callee.name === "Array" + ) { + context.report({ node, messageId: "preferLiteral" }); + } + } + + return { + CallExpression: check, + NewExpression: check + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-async-promise-executor.js b/day1/cli-study/node_modules/eslint/lib/rules/no-async-promise-executor.js new file mode 100644 index 0000000..553311e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview disallow using an async function as a Promise executor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow using an async function as a Promise executor", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-async-promise-executor" + }, + + fixable: null, + schema: [], + messages: { + async: "Promise executor functions should not be async." + } + }, + + create(context) { + return { + "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), + messageId: "async" + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-await-in-loop.js b/day1/cli-study/node_modules/eslint/lib/rules/no-await-in-loop.js new file mode 100644 index 0000000..9ca8986 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Rule to disallow uses of await inside of loops. + * @author Nat Mote (nmote) + */ +"use strict"; + +/** + * Check whether it should stop traversing ancestors at the given node. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if it should stop traversing. + */ +function isBoundary(node) { + const t = node.type; + + return ( + t === "FunctionDeclaration" || + t === "FunctionExpression" || + t === "ArrowFunctionExpression" || + + /* + * Don't report the await expressions on for-await-of loop since it's + * asynchronous iteration intentionally. + */ + (t === "ForOfStatement" && node.await === true) + ); +} + +/** + * Check whether the given node is in loop. + * @param {ASTNode} node A node to check. + * @param {ASTNode} parent A parent node to check. + * @returns {boolean} `true` if the node is in loop. + */ +function isLooped(node, parent) { + switch (parent.type) { + case "ForStatement": + return ( + node === parent.test || + node === parent.update || + node === parent.body + ); + + case "ForOfStatement": + case "ForInStatement": + return node === parent.body; + + case "WhileStatement": + case "DoWhileStatement": + return node === parent.test || node === parent.body; + + default: + return false; + } +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `await` inside of loops", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-await-in-loop" + }, + + schema: [], + + messages: { + unexpectedAwait: "Unexpected `await` inside a loop." + } + }, + create(context) { + + /** + * Validate an await expression. + * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate. + * @returns {void} + */ + function validate(awaitNode) { + if (awaitNode.type === "ForOfStatement" && !awaitNode.await) { + return; + } + + let node = awaitNode; + let parent = node.parent; + + while (parent && !isBoundary(parent)) { + if (isLooped(node, parent)) { + context.report({ + node: awaitNode, + messageId: "unexpectedAwait" + }); + return; + } + node = parent; + parent = parent.parent; + } + } + + return { + AwaitExpression: validate, + ForOfStatement: validate + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-bitwise.js b/day1/cli-study/node_modules/eslint/lib/rules/no-bitwise.js new file mode 100644 index 0000000..a9c3360 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-bitwise.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag bitwise identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +/* + * + * Set of bitwise operators. + * + */ +const BITWISE_OPERATORS = [ + "^", "|", "&", "<<", ">>", ">>>", + "^=", "|=", "&=", "<<=", ">>=", ">>>=", + "~" +]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow bitwise operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-bitwise" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + enum: BITWISE_OPERATORS + }, + uniqueItems: true + }, + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected use of '{{operator}}'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + const int32Hint = options.int32Hint === true; + + /** + * Reports an unexpected use of a bitwise operator. + * @param {ASTNode} node Node which contains the bitwise operator. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "unexpected", data: { operator: node.operator } }); + } + + /** + * Checks if the given node has a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function hasBitwiseOperator(node) { + return BITWISE_OPERATORS.indexOf(node.operator) !== -1; + } + + /** + * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function allowedOperator(node) { + return allowed.indexOf(node.operator) !== -1; + } + + /** + * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is used in integer typecasting. + */ + function isInt32Hint(node) { + return int32Hint && node.operator === "|" && node.right && + node.right.type === "Literal" && node.right.value === 0; + } + + /** + * Report if the given node contains a bitwise operator. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNodeForBitwiseOperator(node) { + if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) { + report(node); + } + } + + return { + AssignmentExpression: checkNodeForBitwiseOperator, + BinaryExpression: checkNodeForBitwiseOperator, + UnaryExpression: checkNodeForBitwiseOperator + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-buffer-constructor.js b/day1/cli-study/node_modules/eslint/lib/rules/no-buffer-constructor.js new file mode 100644 index 0000000..152dda0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-buffer-constructor.js @@ -0,0 +1,49 @@ +/** + * @fileoverview disallow use of the Buffer() constructor + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "problem", + + docs: { + description: "disallow use of the `Buffer()` constructor", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-buffer-constructor" + }, + + schema: [], + + messages: { + deprecated: "{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead." + } + }, + + create(context) { + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + "CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(node) { + context.report({ + node, + messageId: "deprecated", + data: { expr: node.type === "CallExpression" ? "Buffer()" : "new Buffer()" } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-caller.js b/day1/cli-study/node_modules/eslint/lib/rules/no-caller.js new file mode 100644 index 0000000..5fe1bd4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-caller.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag use of arguments.callee and arguments.caller. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `arguments.caller` or `arguments.callee`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-caller" + }, + + schema: [], + + messages: { + unexpected: "Avoid arguments.{{prop}}." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/u)) { + context.report({ node, messageId: "unexpected", data: { prop: propertyName } }); + } + + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-case-declarations.js b/day1/cli-study/node_modules/eslint/lib/rules/no-case-declarations.js new file mode 100644 index 0000000..1d54e22 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag use of an lexical declarations inside a case clause + * @author Erik Arvidsson + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow lexical declarations in case clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-case-declarations" + }, + + schema: [], + + messages: { + unexpected: "Unexpected lexical declaration in case block." + } + }, + + create(context) { + + /** + * Checks whether or not a node is a lexical declaration. + * @param {ASTNode} node A direct child statement of a switch case. + * @returns {boolean} Whether or not the node is a lexical declaration. + */ + function isLexicalDeclaration(node) { + switch (node.type) { + case "FunctionDeclaration": + case "ClassDeclaration": + return true; + case "VariableDeclaration": + return node.kind !== "var"; + default: + return false; + } + } + + return { + SwitchCase(node) { + for (let i = 0; i < node.consequent.length; i++) { + const statement = node.consequent[i]; + + if (isLexicalDeclaration(statement)) { + context.report({ + node: statement, + messageId: "unexpected" + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-catch-shadow.js b/day1/cli-study/node_modules/eslint/lib/rules/no-catch-shadow.js new file mode 100644 index 0000000..4917af8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier + * @author Ian Christian Myers + * @deprecated in ESLint v5.1.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `catch` clause parameters from shadowing variables in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-catch-shadow" + }, + + replacedBy: ["no-shadow"], + + deprecated: true, + schema: [], + + messages: { + mutable: "Value of '{{name}}' may be overwritten in IE 8 and earlier." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the parameters are been shadowed + * @param {Object} scope current scope + * @param {string} name parameter name + * @returns {boolean} True is its been shadowed + */ + function paramIsShadowing(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "CatchClause[param!=null]"(node) { + let scope = context.getScope(); + + /* + * When ecmaVersion >= 6, CatchClause creates its own scope + * so start from one upper scope to exclude the current node + */ + if (scope.block === node) { + scope = scope.upper; + } + + if (paramIsShadowing(scope, node.param.name)) { + context.report({ node, messageId: "mutable", data: { name: node.param.name } }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-class-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-class-assign.js new file mode 100644 index 0000000..887058b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-class-assign.js @@ -0,0 +1,61 @@ +/** + * @fileoverview A rule to disallow modifying variables of class declarations + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-class-assign" + }, + + schema: [], + + messages: { + class: "'{{name}}' is a class." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "class", data: { name: reference.identifier.name } }); + + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check. + * @returns {void} + */ + function checkForClass(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + ClassDeclaration: checkForClass, + ClassExpression: checkForClass + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/day1/cli-study/node_modules/eslint/lib/rules/no-compare-neg-zero.js new file mode 100644 index 0000000..0c6865a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -0,0 +1,60 @@ +/** + * @fileoverview The rule should warn against code that tries to compare against -0. + * @author Aladdin-ADD + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparing against -0", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-compare-neg-zero" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Do not use the '{{operator}}' operator to compare against -0." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks a given node is -0 + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is -0. + */ + function isNegZero(node) { + return node.type === "UnaryExpression" && node.operator === "-" && node.argument.type === "Literal" && node.argument.value === 0; + } + const OPERATORS_TO_CHECK = new Set([">", ">=", "<", "<=", "==", "===", "!=", "!=="]); + + return { + BinaryExpression(node) { + if (OPERATORS_TO_CHECK.has(node.operator)) { + if (isNegZero(node.left) || isNegZero(node.right)) { + context.report({ + node, + messageId: "unexpected", + data: { operator: node.operator } + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-cond-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-cond-assign.js new file mode 100644 index 0000000..3843a7a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-cond-assign.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to flag assignment in a conditional statement's test expression + * @author Stephen Murray + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TEST_CONDITION_PARENT_TYPES = new Set(["IfStatement", "WhileStatement", "DoWhileStatement", "ForStatement", "ConditionalExpression"]); + +const NODE_DESCRIPTIONS = { + DoWhileStatement: "a 'do...while' statement", + ForStatement: "a 'for' statement", + IfStatement: "an 'if' statement", + WhileStatement: "a 'while' statement" +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignment operators in conditional expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-cond-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + unexpected: "Unexpected assignment within {{type}}.", + + // must match JSHint's error message + missing: "Expected a conditional expression and instead saw an assignment." + } + }, + + create(context) { + + const prohibitAssign = (context.options[0] || "except-parens"); + + const sourceCode = context.getSourceCode(); + + /** + * Check whether an AST node is the test expression for a conditional statement. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`. + */ + function isConditionalTestExpression(node) { + return node.parent && + TEST_CONDITION_PARENT_TYPES.has(node.parent.type) && + node === node.parent.test; + } + + /** + * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement. + * @param {!Object} node The node to use at the start of the search. + * @returns {?Object} The closest ancestor node that represents a conditional statement. + */ + function findConditionalAncestor(node) { + let currentAncestor = node; + + do { + if (isConditionalTestExpression(currentAncestor)) { + return currentAncestor.parent; + } + } while ((currentAncestor = currentAncestor.parent) && !astUtils.isFunction(currentAncestor)); + + return null; + } + + /** + * Check whether the code represented by an AST node is enclosed in two sets of parentheses. + * @param {!Object} node The node to test. + * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return astUtils.isParenthesised(sourceCode, node) && + previousToken && astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + /** + * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses. + * @param {!Object} node The node for the conditional statement. + * @returns {void} + */ + function testForAssign(node) { + if (node.test && + (node.test.type === "AssignmentExpression") && + (node.type === "ForStatement" + ? !astUtils.isParenthesised(sourceCode, node.test) + : !isParenthesisedTwice(node.test) + ) + ) { + + context.report({ + node: node.test, + messageId: "missing" + }); + } + } + + /** + * Check whether an assignment expression is descended from a conditional statement's test expression. + * @param {!Object} node The node for the assignment expression. + * @returns {void} + */ + function testForConditionalAncestor(node) { + const ancestor = findConditionalAncestor(node); + + if (ancestor) { + context.report({ + node, + messageId: "unexpected", + data: { + type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type + } + }); + } + } + + if (prohibitAssign === "always") { + return { + AssignmentExpression: testForConditionalAncestor + }; + } + + return { + DoWhileStatement: testForAssign, + ForStatement: testForAssign, + IfStatement: testForAssign, + WhileStatement: testForAssign, + ConditionalExpression: testForAssign + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-confusing-arrow.js b/day1/cli-study/node_modules/eslint/lib/rules/no-confusing-arrow.js new file mode 100644 index 0000000..9009b64 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,85 @@ +/** + * @fileoverview A rule to warn against using arrow functions when they could be + * confused with comparisons + * @author Jxck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a conditional expression. + * @param {ASTNode} node node to test + * @returns {boolean} `true` if the node is a conditional expression. + */ +function isConditional(node) { + return node && node.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow arrow functions where they could be confused with comparisons", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-confusing-arrow" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + allowParens: { type: "boolean", default: true } + }, + additionalProperties: false + }], + + messages: { + confusing: "Arrow function used ambiguously with a conditional expression." + } + }, + + create(context) { + const config = context.options[0] || {}; + const allowParens = config.allowParens || (config.allowParens === void 0); + const sourceCode = context.getSourceCode(); + + + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + const body = node.body; + + if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) { + context.report({ + node, + messageId: "confusing", + fix(fixer) { + + // if `allowParens` is not set to true don't bother wrapping in parens + return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`); + } + }); + } + } + + return { + ArrowFunctionExpression: checkArrowFunc + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-console.js b/day1/cli-study/node_modules/eslint/lib/rules/no-console.js new file mode 100644 index 0000000..56dbbc3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-console.js @@ -0,0 +1,134 @@ +/** + * @fileoverview Rule to flag use of console object + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `console`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-console" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected console statement." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + /** + * Checks whether the given reference is 'console' or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is 'console'. + */ + function isConsole(reference) { + const id = reference.identifier; + + return id && id.name === "console"; + } + + /** + * Checks whether the property name of the given MemberExpression node + * is allowed by options or not. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if the property name of the node is allowed. + */ + function isAllowed(node) { + const propertyName = astUtils.getStaticPropertyName(node); + + return propertyName && allowed.indexOf(propertyName) !== -1; + } + + /** + * Checks whether the given reference is a member access which is not + * allowed by options or not. + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is a member access which + * is not allowed by options. + */ + function isMemberAccessExceptAllowed(reference) { + const node = reference.identifier; + const parent = node.parent; + + return ( + parent.type === "MemberExpression" && + parent.object === node && + !isAllowed(parent) + ); + } + + /** + * Reports the given reference as a violation. + * @param {eslint-scope.Reference} reference The reference to report. + * @returns {void} + */ + function report(reference) { + const node = reference.identifier.parent; + + context.report({ + node, + loc: node.loc, + messageId: "unexpected" + }); + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const consoleVar = astUtils.getVariableByName(scope, "console"); + const shadowed = consoleVar && consoleVar.defs.length > 0; + + /* + * 'scope.through' includes all references to undefined + * variables. If the variable 'console' is not defined, it uses + * 'scope.through'. + */ + const references = consoleVar + ? consoleVar.references + : scope.through.filter(isConsole); + + if (!shadowed) { + references + .filter(isMemberAccessExceptAllowed) + .forEach(report); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-const-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-const-assign.js new file mode 100644 index 0000000..e4ae891 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-const-assign.js @@ -0,0 +1,54 @@ +/** + * @fileoverview A rule to disallow modifying variables that are declared using `const` + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `const` variables", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-const-assign" + }, + + schema: [], + + messages: { + const: "'{{name}}' is constant." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "const", data: { name: reference.identifier.name } }); + }); + } + + return { + VariableDeclaration(node) { + if (node.kind === "const") { + context.getDeclaredVariables(node).forEach(checkVariable); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-constant-condition.js b/day1/cli-study/node_modules/eslint/lib/rules/no-constant-condition.js new file mode 100644 index 0000000..5e58386 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-constant-condition.js @@ -0,0 +1,253 @@ +/** + * @fileoverview Rule to flag use constant conditions + * @author Christian Schulz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const EQUALITY_OPERATORS = ["===", "!==", "==", "!="]; +const RELATIONAL_OPERATORS = [">", "<", ">=", "<=", "in", "instanceof"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow constant expressions in conditions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-constant-condition" + }, + + schema: [ + { + type: "object", + properties: { + checkLoops: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected constant condition." + } + }, + + create(context) { + const options = context.options[0] || {}, + checkLoops = options.checkLoops !== false, + loopSetStack = []; + + let loopsInCurrentScope = new Set(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Checks if a branch node of LogicalExpression short circuits the whole condition + * @param {ASTNode} node The branch of main condition which needs to be checked + * @param {string} operator The operator of the main LogicalExpression. + * @returns {boolean} true when condition short circuits whole condition + */ + function isLogicalIdentity(node, operator) { + switch (node.type) { + case "Literal": + return (operator === "||" && node.value === true) || + (operator === "&&" && node.value === false); + + case "UnaryExpression": + return (operator === "&&" && node.operator === "void"); + + case "LogicalExpression": + return isLogicalIdentity(node.left, node.operator) || + isLogicalIdentity(node.right, node.operator); + + // no default + } + return false; + } + + /** + * Checks if a node has a constant truthiness value. + * @param {ASTNode} node The AST node to check. + * @param {boolean} inBooleanPosition `false` if checking branch of a condition. + * `true` in all other cases + * @returns {Bool} true when node's truthiness is constant + * @private + */ + function isConstant(node, inBooleanPosition) { + + // node.elements can return null values in the case of sparse arrays ex. [,] + if (!node) { + return true; + } + switch (node.type) { + case "Literal": + case "ArrowFunctionExpression": + case "FunctionExpression": + case "ObjectExpression": + return true; + case "TemplateLiteral": + return (inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length)) || + node.expressions.every(exp => isConstant(exp, inBooleanPosition)); + + case "ArrayExpression": { + if (node.parent.type === "BinaryExpression" && node.parent.operator === "+") { + return node.elements.every(element => isConstant(element, false)); + } + return true; + } + + case "UnaryExpression": + if (node.operator === "void") { + return true; + } + + return (node.operator === "typeof" && inBooleanPosition) || + isConstant(node.argument, true); + + case "BinaryExpression": + return isConstant(node.left, false) && + isConstant(node.right, false) && + node.operator !== "in"; + + case "LogicalExpression": { + const isLeftConstant = isConstant(node.left, inBooleanPosition); + const isRightConstant = isConstant(node.right, inBooleanPosition); + const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); + const isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator)); + + return (isLeftConstant && isRightConstant) || + ( + + // in the case of an "OR", we need to know if the right constant value is truthy + node.operator === "||" && + isRightConstant && + node.right.value && + ( + !node.parent || + node.parent.type !== "BinaryExpression" || + !(EQUALITY_OPERATORS.includes(node.parent.operator) || RELATIONAL_OPERATORS.includes(node.parent.operator)) + ) + ) || + isLeftShortCircuit || + isRightShortCircuit; + } + + case "AssignmentExpression": + return (node.operator === "=") && isConstant(node.right, inBooleanPosition); + + case "SequenceExpression": + return isConstant(node.expressions[node.expressions.length - 1], inBooleanPosition); + + // no default + } + return false; + } + + /** + * Tracks when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function trackConstantConditionLoop(node) { + if (node.test && isConstant(node.test, true)) { + loopsInCurrentScope.add(node); + } + } + + /** + * Reports when the set contains the given constant condition node + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkConstantConditionLoopInSet(node) { + if (loopsInCurrentScope.has(node)) { + loopsInCurrentScope.delete(node); + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Reports when the given node contains a constant condition. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function reportIfConstant(node) { + if (node.test && isConstant(node.test, true)) { + context.report({ node: node.test, messageId: "unexpected" }); + } + } + + /** + * Stores current set of constant loops in loopSetStack temporarily + * and uses a new set to track constant loops + * @returns {void} + * @private + */ + function enterFunction() { + loopSetStack.push(loopsInCurrentScope); + loopsInCurrentScope = new Set(); + } + + /** + * Reports when the set still contains stored constant conditions + * @returns {void} + * @private + */ + function exitFunction() { + loopsInCurrentScope = loopSetStack.pop(); + } + + /** + * Checks node when checkLoops option is enabled + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkLoop(node) { + if (checkLoops) { + trackConstantConditionLoop(node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ConditionalExpression: reportIfConstant, + IfStatement: reportIfConstant, + WhileStatement: checkLoop, + "WhileStatement:exit": checkConstantConditionLoopInSet, + DoWhileStatement: checkLoop, + "DoWhileStatement:exit": checkConstantConditionLoopInSet, + ForStatement: checkLoop, + "ForStatement > .test": node => checkLoop(node.parent), + "ForStatement:exit": checkConstantConditionLoopInSet, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + YieldExpression: () => loopsInCurrentScope.clear() + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-constructor-return.js b/day1/cli-study/node_modules/eslint/lib/rules/no-constructor-return.js new file mode 100644 index 0000000..4757770 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-constructor-return.js @@ -0,0 +1,62 @@ +/** + * @fileoverview Rule to disallow returning value from constructor. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning value from constructor", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-constructor-return" + }, + + schema: {}, + + fixable: null, + + messages: { + unexpected: "Unexpected return statement in constructor." + } + }, + + create(context) { + const stack = []; + + return { + onCodePathStart(_, node) { + stack.push(node); + }, + onCodePathEnd() { + stack.pop(); + }, + ReturnStatement(node) { + const last = stack[stack.length - 1]; + + if (!last.parent) { + return; + } + + if ( + last.parent.type === "MethodDefinition" && + last.parent.kind === "constructor" && + (node.parent.parent === last || node.argument) + ) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-continue.js b/day1/cli-study/node_modules/eslint/lib/rules/no-continue.js new file mode 100644 index 0000000..96718d1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-continue.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of continue statement + * @author Borislav Zhivkov + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `continue` statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-continue" + }, + + schema: [], + + messages: { + unexpected: "Unexpected use of continue statement." + } + }, + + create(context) { + + return { + ContinueStatement(node) { + context.report({ node, messageId: "unexpected" }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-control-regex.js b/day1/cli-study/node_modules/eslint/lib/rules/no-control-regex.js new file mode 100644 index 0000000..146c4f2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-control-regex.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to forbid control characters from regular expressions. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const RegExpValidator = require("regexpp").RegExpValidator; +const collector = new (class { + constructor() { + this.ecmaVersion = 2018; + this._source = ""; + this._controlChars = []; + this._validator = new RegExpValidator(this); + } + + onPatternEnter() { + this._controlChars = []; + } + + onCharacter(start, end, cp) { + if (cp >= 0x00 && + cp <= 0x1F && + ( + this._source.codePointAt(start) === cp || + this._source.slice(start, end).startsWith("\\x") || + this._source.slice(start, end).startsWith("\\u") + ) + ) { + this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`); + } + } + + collectControlChars(regexpStr) { + try { + this._source = regexpStr; + this._validator.validatePattern(regexpStr); // Call onCharacter hook + } catch { + + // Ignore syntax errors in RegExp. + } + return this._controlChars; + } +})(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control characters in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-control-regex" + }, + + schema: [], + + messages: { + unexpected: "Unexpected control character(s) in regular expression: {{controlChars}}." + } + }, + + create(context) { + + /** + * Get the regex expression + * @param {ASTNode} node node to evaluate + * @returns {RegExp|null} Regex if found else null + * @private + */ + function getRegExpPattern(node) { + if (node.regex) { + return node.regex.pattern; + } + if (typeof node.value === "string" && + (node.parent.type === "NewExpression" || node.parent.type === "CallExpression") && + node.parent.callee.type === "Identifier" && + node.parent.callee.name === "RegExp" && + node.parent.arguments[0] === node + ) { + return node.value; + } + + return null; + } + + return { + Literal(node) { + const pattern = getRegExpPattern(node); + + if (pattern) { + const controlCharacters = collector.collectControlChars(pattern); + + if (controlCharacters.length > 0) { + context.report({ + node, + messageId: "unexpected", + data: { + controlChars: controlCharacters.join(", ") + } + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-debugger.js b/day1/cli-study/node_modules/eslint/lib/rules/no-debugger.js new file mode 100644 index 0000000..95a28a8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-debugger.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag use of a debugger statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of `debugger`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-debugger" + }, + + fixable: null, + schema: [], + + messages: { + unexpected: "Unexpected 'debugger' statement." + } + }, + + create(context) { + + return { + DebuggerStatement(node) { + context.report({ + node, + messageId: "unexpected" + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-delete-var.js b/day1/cli-study/node_modules/eslint/lib/rules/no-delete-var.js new file mode 100644 index 0000000..aeab951 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-delete-var.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Rule to flag when deleting variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow deleting variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-delete-var" + }, + + schema: [], + + messages: { + unexpected: "Variables should not be deleted." + } + }, + + create(context) { + + return { + + UnaryExpression(node) { + if (node.operator === "delete" && node.argument.type === "Identifier") { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-div-regex.js b/day1/cli-study/node_modules/eslint/lib/rules/no-div-regex.js new file mode 100644 index 0000000..0ccabdc --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-div-regex.js @@ -0,0 +1,53 @@ +/** + * @fileoverview Rule to check for ambiguous div operator in regexes + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow division operators explicitly at the beginning of regular expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-div-regex" + }, + + fixable: "code", + + schema: [], + + messages: { + unexpected: "A regular expression literal can be confused with '/='." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && token.value[1] === "=") { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + return fixer.replaceTextRange([token.range[0] + 1, token.range[0] + 2], "[=]"); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-args.js b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-args.js new file mode 100644 index 0000000..817277f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-args.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag duplicate arguments + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate arguments in `function` definitions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-args" + }, + + schema: [], + + messages: { + unexpected: "Duplicate param '{{name}}'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether or not a given definition is a parameter's. + * @param {eslint-scope.DefEntry} def A definition to check. + * @returns {boolean} `true` if the definition is a parameter's. + */ + function isParameter(def) { + return def.type === "Parameter"; + } + + /** + * Determines if a given node has duplicate parameters. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkParams(node) { + const variables = context.getDeclaredVariables(node); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Checks and reports duplications. + const defs = variable.defs.filter(isParameter); + + if (defs.length >= 2) { + context.report({ + node, + messageId: "unexpected", + data: { name: variable.name } + }); + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkParams, + FunctionExpression: checkParams + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-class-members.js b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-class-members.js new file mode 100644 index 0000000..b12939d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,103 @@ +/** + * @fileoverview A rule to disallow duplicate name in class members. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate class members", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-class-members" + }, + + schema: [], + + messages: { + unexpected: "Duplicate name '{{name}}'." + } + }, + + create(context) { + let stack = []; + + /** + * Gets state of a given member name. + * @param {string} name A name of a member. + * @param {boolean} isStatic A flag which specifies that is a static member. + * @returns {Object} A state of a given member name. + * - retv.init {boolean} A flag which shows the name is declared as normal member. + * - retv.get {boolean} A flag which shows the name is declared as getter. + * - retv.set {boolean} A flag which shows the name is declared as setter. + */ + function getState(name, isStatic) { + const stateMap = stack[stack.length - 1]; + const key = `$${name}`; // to avoid "__proto__". + + if (!stateMap[key]) { + stateMap[key] = { + nonStatic: { init: false, get: false, set: false }, + static: { init: false, get: false, set: false } + }; + } + + return stateMap[key][isStatic ? "static" : "nonStatic"]; + } + + return { + + // Initializes the stack of state of member declarations. + Program() { + stack = []; + }, + + // Initializes state of member declarations for the class. + ClassBody() { + stack.push(Object.create(null)); + }, + + // Disposes the state for the class. + "ClassBody:exit"() { + stack.pop(); + }, + + // Reports the node if its name has been declared already. + MethodDefinition(node) { + const name = astUtils.getStaticPropertyName(node); + + if (name === null || node.kind === "constructor") { + return; + } + + const state = getState(name, node.static); + let isDuplicate = false; + + if (node.kind === "get") { + isDuplicate = (state.init || state.get); + state.get = true; + } else if (node.kind === "set") { + isDuplicate = (state.init || state.set); + state.set = true; + } else { + isDuplicate = (state.init || state.get || state.set); + state.init = true; + } + + if (isDuplicate) { + context.report({ node, messageId: "unexpected", data: { name } }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-else-if.js b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-else-if.js new file mode 100644 index 0000000..cbeb437 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Rule to disallow duplicate conditions in if-else-if chains + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the first given array is a subset of the second given array. + * @param {Function} comparator A function to compare two elements, should return `true` if they are equal. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`. + */ +function isSubsetByComparator(comparator, arrA, arrB) { + return arrA.every(a => arrB.some(b => comparator(a, b))); +} + +/** + * Splits the given node by the given logical operator. + * @param {string} operator Logical operator `||` or `&&`. + * @param {ASTNode} node The node to split. + * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator. + */ +function splitByLogicalOperator(operator, node) { + if (node.type === "LogicalExpression" && node.operator === operator) { + return [...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right)]; + } + return [node]; +} + +const splitByOr = splitByLogicalOperator.bind(null, "||"); +const splitByAnd = splitByLogicalOperator.bind(null, "&&"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate conditions in if-else-if chains", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-else-if" + }, + + schema: [], + + messages: { + unexpected: "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes + * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators. + * @param {ASTNode} a First node. + * @param {ASTNode} b Second node. + * @returns {boolean} `true` if the nodes are considered to be equal. + */ + function equal(a, b) { + if (a.type !== b.type) { + return false; + } + + if ( + a.type === "LogicalExpression" && + (a.operator === "||" || a.operator === "&&") && + a.operator === b.operator + ) { + return equal(a.left, b.left) && equal(a.right, b.right) || + equal(a.left, b.right) && equal(a.right, b.left); + } + + return astUtils.equalTokens(a, b, sourceCode); + } + + const isSubset = isSubsetByComparator.bind(null, equal); + + return { + IfStatement(node) { + const test = node.test, + conditionsToCheck = test.type === "LogicalExpression" && test.operator === "&&" + ? [test, ...splitByAnd(test)] + : [test]; + let current = node, + listToCheck = conditionsToCheck.map(c => splitByOr(c).map(splitByAnd)); + + while (current.parent && current.parent.type === "IfStatement" && current.parent.alternate === current) { + current = current.parent; + + const currentOrOperands = splitByOr(current.test).map(splitByAnd); + + listToCheck = listToCheck.map(orOperands => orOperands.filter( + orOperand => !currentOrOperands.some(currentOrOperand => isSubset(currentOrOperand, orOperand)) + )); + + if (listToCheck.some(orOperands => orOperands.length === 0)) { + context.report({ node: test, messageId: "unexpected" }); + break; + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-keys.js b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-keys.js new file mode 100644 index 0000000..89e1f2d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-dupe-keys.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Rule to flag use of duplicate keys in an object. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const GET_KIND = /^(?:init|get)$/u; +const SET_KIND = /^(?:init|set)$/u; + +/** + * The class which stores properties' information of an object. + */ +class ObjectInfo { + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ObjectInfo|null} upper The information of the outer object. + * @param {ASTNode} node The ObjectExpression node of this information. + */ + constructor(upper, node) { + this.upper = upper; + this.node = node; + this.properties = new Map(); + } + + /** + * Gets the information of the given Property node. + * @param {ASTNode} node The Property node to get. + * @returns {{get: boolean, set: boolean}} The information of the property. + */ + getPropertyInfo(node) { + const name = astUtils.getStaticPropertyName(node); + + if (!this.properties.has(name)) { + this.properties.set(name, { get: false, set: false }); + } + return this.properties.get(name); + } + + /** + * Checks whether the given property has been defined already or not. + * @param {ASTNode} node The Property node to check. + * @returns {boolean} `true` if the property has been defined. + */ + isPropertyDefined(node) { + const entry = this.getPropertyInfo(node); + + return ( + (GET_KIND.test(node.kind) && entry.get) || + (SET_KIND.test(node.kind) && entry.set) + ); + } + + /** + * Defines the given property. + * @param {ASTNode} node The Property node to define. + * @returns {void} + */ + defineProperty(node) { + const entry = this.getPropertyInfo(node); + + if (GET_KIND.test(node.kind)) { + entry.get = true; + } + if (SET_KIND.test(node.kind)) { + entry.set = true; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate keys in object literals", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-dupe-keys" + }, + + schema: [], + + messages: { + unexpected: "Duplicate key '{{name}}'." + } + }, + + create(context) { + let info = null; + + return { + ObjectExpression(node) { + info = new ObjectInfo(info, node); + }, + "ObjectExpression:exit"() { + info = info.upper; + }, + + Property(node) { + const name = astUtils.getStaticPropertyName(node); + + // Skip destructuring. + if (node.parent.type !== "ObjectExpression") { + return; + } + + // Skip if the name is not static. + if (name === null) { + return; + } + + // Reports if the name is defined already. + if (info.isPropertyDefined(node)) { + context.report({ + node: info.node, + loc: node.key.loc, + messageId: "unexpected", + data: { name } + }); + } + + // Update info. + info.defineProperty(node); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-case.js b/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-case.js new file mode 100644 index 0000000..c8a0fa9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to disallow a duplicate case label. + * @author Dieter Oberkofler + * @author Burak Yigit Kaya + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate case labels", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-duplicate-case" + }, + + schema: [], + + messages: { + unexpected: "Duplicate case label." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + SwitchStatement(node) { + const previousKeys = new Set(); + + for (const switchCase of node.cases) { + if (switchCase.test) { + const key = sourceCode.getText(switchCase.test); + + if (previousKeys.has(key)) { + context.report({ node: switchCase, messageId: "unexpected" }); + } else { + previousKeys.add(key); + } + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-imports.js b/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-imports.js new file mode 100644 index 0000000..7218dc6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Restrict usage of duplicate imports. + * @author Simen Bekkhus + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the name of the module imported or re-exported. + * @param {ASTNode} node A node to get. + * @returns {string} the name of the module, or empty string if no name. + */ +function getValue(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + + return ""; +} + +/** + * Checks if the name of the import or export exists in the given array, and reports if so. + * @param {RuleContext} context The ESLint rule context object. + * @param {ASTNode} node A node to get. + * @param {string} value The name of the imported or exported module. + * @param {string[]} array The array containing other imports or exports in the file. + * @param {string} messageId A messageId to be reported after the name of the module + * + * @returns {void} No return value + */ +function checkAndReport(context, node, value, array, messageId) { + if (array.indexOf(value) !== -1) { + context.report({ + node, + messageId, + data: { + module: value + } + }); + } +} + +/** + * @callback nodeCallback + * @param {ASTNode} node A node to handle. + */ + +/** + * Returns a function handling the imports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {boolean} includeExports Whether or not to check for exports in addition to imports. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleImports(context, includeExports, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, importsInFile, "import"); + + if (includeExports) { + checkAndReport(context, node, value, exportsInFile, "importAs"); + } + + importsInFile.push(value); + } + }; +} + +/** + * Returns a function handling the exports of a given file + * @param {RuleContext} context The ESLint rule context object. + * @param {string[]} importsInFile The array containing other imports in the file. + * @param {string[]} exportsInFile The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleExports(context, importsInFile, exportsInFile) { + return function(node) { + const value = getValue(node); + + if (value) { + checkAndReport(context, node, value, exportsInFile, "export"); + checkAndReport(context, node, value, importsInFile, "exportAs"); + + exportsInFile.push(value); + } + }; +} + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow duplicate module imports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-duplicate-imports" + }, + + schema: [{ + type: "object", + properties: { + includeExports: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + messages: { + import: "'{{module}}' import is duplicated.", + importAs: "'{{module}}' import is duplicated as export.", + export: "'{{module}}' export is duplicated.", + exportAs: "'{{module}}' export is duplicated as import." + } + }, + + create(context) { + const includeExports = (context.options[0] || {}).includeExports, + importsInFile = [], + exportsInFile = []; + + const handlers = { + ImportDeclaration: handleImports(context, includeExports, importsInFile, exportsInFile) + }; + + if (includeExports) { + handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); + handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); + } + + return handlers; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-else-return.js b/day1/cli-study/node_modules/eslint/lib/rules/no-else-return.js new file mode 100644 index 0000000..84409fa --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-else-return.js @@ -0,0 +1,404 @@ +/** + * @fileoverview Rule to flag `else` after a `return` in `if` + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `else` blocks after `return` statements in `if` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-else-return" + }, + + schema: [{ + type: "object", + properties: { + allowElseIf: { + type: "boolean", + default: true + } + }, + additionalProperties: false + }], + + fixable: "code", + + messages: { + unexpected: "Unnecessary 'else' after 'return'." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whether the given names can be safely used to declare block-scoped variables + * in the given scope. Name collisions can produce redeclaration syntax errors, + * or silently change references and modify behavior of the original code. + * + * This is not a generic function. In particular, it is assumed that the scope is a function scope or + * a function's inner scope, and that the names can be valid identifiers in the given scope. + * @param {string[]} names Array of variable names. + * @param {eslint-scope.Scope} scope Function scope or a function's inner scope. + * @returns {boolean} True if all names can be safely declared, false otherwise. + */ + function isSafeToDeclare(names, scope) { + + if (names.length === 0) { + return true; + } + + const functionScope = scope.variableScope; + + /* + * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments", + * all function-scoped variables ('var'), and block-scoped variables defined in the scope. + * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope. + * + * Redeclaring any of these would cause a syntax error, except for the implicit variables. + */ + const declaredVariables = scope.variables.filter(({ defs }) => defs.length > 0); + + if (declaredVariables.some(({ name }) => names.includes(name))) { + return false; + } + + // Redeclaring a catch variable would also cause a syntax error. + if (scope !== functionScope && scope.upper.type === "catch") { + if (scope.upper.variables.some(({ name }) => names.includes(name))) { + return false; + } + } + + /* + * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error. + * However, if the variable was used, declaring a new one with the same name would change references + * and modify behavior. + */ + const usedImplicitVariables = scope.variables.filter(({ defs, references }) => + defs.length === 0 && references.length > 0); + + if (usedImplicitVariables.some(({ name }) => names.includes(name))) { + return false; + } + + /* + * Declaring a variable with a name that was already used to reference a variable from an upper scope + * would change references and modify behavior. + */ + if (scope.through.some(t => names.includes(t.identifier.name))) { + return false; + } + + /* + * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside + * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope. + * + * For example, this would be a syntax error "Identifier 'a' has already been declared": + * function foo() { if (bar) { let a; if (baz) { var a; } } } + */ + if (scope !== functionScope) { + const scopeNodeRange = scope.block.range; + const variablesToCheck = functionScope.variables.filter(({ name }) => names.includes(name)); + + if (variablesToCheck.some(v => v.defs.some(({ node: { range } }) => + scopeNodeRange[0] <= range[0] && range[1] <= scopeNodeRange[1]))) { + return false; + } + } + + return true; + } + + + /** + * Checks whether the removal of `else` and its braces is safe from variable name collisions. + * @param {Node} node The 'else' node. + * @param {eslint-scope.Scope} scope The scope in which the node and the whole 'if' statement is. + * @returns {boolean} True if it is safe, false otherwise. + */ + function isSafeFromNameCollisions(node, scope) { + + if (node.type === "FunctionDeclaration") { + + // Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently. + return false; + } + + if (node.type !== "BlockStatement") { + return true; + } + + const elseBlockScope = scope.childScopes.find(({ block }) => block === node); + + if (!elseBlockScope) { + + // ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions. + return true; + } + + /* + * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains + * only block-scoped variables (such as let and const variables or class and function declarations) + * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions. + */ + const namesToCheck = elseBlockScope.variables.map(({ name }) => name); + + return isSafeToDeclare(namesToCheck, scope); + } + + /** + * Display the context report if rule is violated + * @param {Node} node The 'else' node + * @returns {void} + */ + function displayReport(node) { + const currentScope = context.getScope(); + + context.report({ + node, + messageId: "unexpected", + fix: fixer => { + + if (!isSafeFromNameCollisions(node, currentScope)) { + return null; + } + + const sourceCode = context.getSourceCode(); + const startToken = sourceCode.getFirstToken(node); + const elseToken = sourceCode.getTokenBefore(startToken); + const source = sourceCode.getText(node); + const lastIfToken = sourceCode.getTokenBefore(elseToken); + let fixedSource, firstTokenOfElseBlock; + + if (startToken.type === "Punctuator" && startToken.value === "{") { + firstTokenOfElseBlock = sourceCode.getTokenAfter(startToken); + } else { + firstTokenOfElseBlock = startToken; + } + + /* + * If the if block does not have curly braces and does not end in a semicolon + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else keyword, because ASI will not add a semicolon + * after the if block + */ + const ifBlockMaybeUnsafe = node.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; + const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); + + if (ifBlockMaybeUnsafe && elseBlockUnsafe) { + return null; + } + + const endToken = sourceCode.getLastToken(node); + const lastTokenOfElseBlock = sourceCode.getTokenBefore(endToken); + + if (lastTokenOfElseBlock.value !== ";") { + const nextToken = sourceCode.getTokenAfter(endToken); + + const nextTokenUnsafe = nextToken && /^[([/+`-]/u.test(nextToken.value); + const nextTokenOnSameLine = nextToken && nextToken.loc.start.line === lastTokenOfElseBlock.loc.start.line; + + /* + * If the else block contents does not end in a semicolon, + * and the else block starts with (, [, /, +, ` or -, then it is not + * safe to remove the else block, because ASI will not add a semicolon + * after the remaining else block contents + */ + if (nextTokenUnsafe || (nextTokenOnSameLine && nextToken.value !== "}")) { + return null; + } + } + + if (startToken.type === "Punctuator" && startToken.value === "{") { + fixedSource = source.slice(1, -1); + } else { + fixedSource = source; + } + + /* + * Extend the replacement range to include the entire + * function to avoid conflicting with no-useless-return. + * https://github.com/eslint/eslint/issues/8026 + * + * Also, to avoid name collisions between two else blocks. + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .replaceTextRange([elseToken.range[0], node.range[1]], fixedSource); + } + }); + } + + /** + * Check to see if the node is a ReturnStatement + * @param {Node} node The node being evaluated + * @returns {boolean} True if node is a return + */ + function checkForReturn(node) { + return node.type === "ReturnStatement"; + } + + /** + * Naive return checking, does not iterate through the whole + * BlockStatement because we make the assumption that the ReturnStatement + * will be the last node in the body of the BlockStatement. + * @param {Node} node The consequent/alternate node + * @returns {boolean} True if it has a return + */ + function naiveHasReturn(node) { + if (node.type === "BlockStatement") { + const body = node.body, + lastChildNode = body[body.length - 1]; + + return lastChildNode && checkForReturn(lastChildNode); + } + return checkForReturn(node); + } + + /** + * Check to see if the node is valid for evaluation, + * meaning it has an else. + * @param {Node} node The node being evaluated + * @returns {boolean} True if the node is valid + */ + function hasElse(node) { + return node.alternate && node.consequent; + } + + /** + * If the consequent is an IfStatement, check to see if it has an else + * and both its consequent and alternate path return, meaning this is + * a nested case of rule violation. If-Else not considered currently. + * @param {Node} node The consequent node + * @returns {boolean} True if this is a nested rule violation + */ + function checkForIf(node) { + return node.type === "IfStatement" && hasElse(node) && + naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent); + } + + /** + * Check the consequent/body node to make sure it is not + * a ReturnStatement or an IfStatement that returns on both + * code paths. + * @param {Node} node The consequent or body node + * @returns {boolean} `true` if it is a Return/If node that always returns. + */ + function checkForReturnOrIf(node) { + return checkForReturn(node) || checkForIf(node); + } + + + /** + * Check whether a node returns in every codepath. + * @param {Node} node The node to be checked + * @returns {boolean} `true` if it returns on every codepath. + */ + function alwaysReturns(node) { + if (node.type === "BlockStatement") { + + // If we have a BlockStatement, check each consequent body node. + return node.body.some(checkForReturnOrIf); + } + + /* + * If not a block statement, make sure the consequent isn't a + * ReturnStatement or an IfStatement with returns on both paths. + */ + return checkForReturnOrIf(node); + } + + + /** + * Check the if statement, but don't catch else-if blocks. + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithoutElse(node) { + const parent = node.parent; + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const consequents = []; + let alternate; + + for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) { + if (!currentNode.alternate) { + return; + } + consequents.push(currentNode.consequent); + alternate = currentNode.alternate; + } + + if (consequents.every(alwaysReturns)) { + displayReport(alternate); + } + } + + /** + * Check the if statement + * @returns {void} + * @param {Node} node The node for the if statement to check + * @private + */ + function checkIfWithElse(node) { + const parent = node.parent; + + + /* + * Fixing this would require splitting one statement into two, so no error should + * be reported if this node is in a position where only one statement is allowed. + */ + if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) { + return; + } + + const alternate = node.alternate; + + if (alternate && alwaysReturns(node.consequent)) { + displayReport(alternate); + } + } + + const allowElseIf = !(context.options[0] && context.options[0].allowElseIf === false); + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + "IfStatement:exit": allowElseIf ? checkIfWithoutElse : checkIfWithElse + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-empty-character-class.js b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-character-class.js new file mode 100644 index 0000000..7dc219f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag the use of empty character classes in regular expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/* + * plain-English description of the following regexp: + * 0. `^` fix the match at the beginning of the string + * 1. `\/`: the `/` that begins the regexp + * 2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following + * 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) + * 2.1. `\\.`: an escape sequence + * 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty + * 3. `\/` the `/` that ends the regexp + * 4. `[gimuy]*`: optional regexp flags + * 5. `$`: fix the match at the end of the string + */ +const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty character classes in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-character-class" + }, + + schema: [], + + messages: { + unexpected: "Empty class." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node); + + if (token.type === "RegularExpression" && !regex.test(token.value)) { + context.report({ node, messageId: "unexpected" }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-empty-function.js b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-function.js new file mode 100644 index 0000000..c512f8c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to disallow empty functions. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ALLOW_OPTIONS = Object.freeze([ + "functions", + "arrowFunctions", + "generatorFunctions", + "methods", + "generatorMethods", + "getters", + "setters", + "constructors", + "asyncFunctions", + "asyncMethods" +]); + +/** + * Gets the kind of a given function node. + * @param {ASTNode} node A function node to get. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {string} The kind of the function. This is one of "functions", + * "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods", + * "generatorMethods", "asyncMethods", "getters", "setters", and + * "constructors". + */ +function getKind(node) { + const parent = node.parent; + let kind = ""; + + if (node.type === "ArrowFunctionExpression") { + return "arrowFunctions"; + } + + // Detects main kind. + if (parent.type === "Property") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + kind = parent.method ? "methods" : "functions"; + + } else if (parent.type === "MethodDefinition") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + if (parent.kind === "constructor") { + return "constructors"; + } + kind = "methods"; + + } else { + kind = "functions"; + } + + // Detects prefix. + let prefix = ""; + + if (node.generator) { + prefix = "generator"; + } else if (node.async) { + prefix = "async"; + } else { + return kind; + } + return prefix + kind[0].toUpperCase() + kind.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty functions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-empty-function" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { enum: ALLOW_OPTIONS }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Unexpected empty {{name}}." + } + }, + + create(context) { + const options = context.options[0] || {}; + const allowed = options.allow || []; + + const sourceCode = context.getSourceCode(); + + /** + * Reports a given function node if the node matches the following patterns. + * + * - Not allowed by options. + * - The body is empty. + * - The body doesn't have any comments. + * @param {ASTNode} node A function node to report. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {void} + */ + function reportIfEmpty(node) { + const kind = getKind(node); + const name = astUtils.getFunctionNameWithKind(node); + const innerComments = sourceCode.getTokens(node.body, { + includeComments: true, + filter: astUtils.isCommentToken + }); + + if (allowed.indexOf(kind) === -1 && + node.body.type === "BlockStatement" && + node.body.body.length === 0 && + innerComments.length === 0 + ) { + context.report({ + node, + loc: node.body.loc, + messageId: "unexpected", + data: { name } + }); + } + } + + return { + ArrowFunctionExpression: reportIfEmpty, + FunctionDeclaration: reportIfEmpty, + FunctionExpression: reportIfEmpty + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-empty-pattern.js b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-pattern.js new file mode 100644 index 0000000..9f34bfd --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to disallow an empty pattern + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow empty destructuring patterns", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty-pattern" + }, + + schema: [], + + messages: { + unexpected: "Unexpected empty {{type}} pattern." + } + }, + + create(context) { + return { + ObjectPattern(node) { + if (node.properties.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "object" } }); + } + }, + ArrayPattern(node) { + if (node.elements.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "array" } }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-empty.js b/day1/cli-study/node_modules/eslint/lib/rules/no-empty.js new file mode 100644 index 0000000..45bf03c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-empty.js @@ -0,0 +1,86 @@ +/** + * @fileoverview Rule to flag use of an empty block statement + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow empty block statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-empty" + }, + + schema: [ + { + type: "object", + properties: { + allowEmptyCatch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "Empty {{type}} statement." + } + }, + + create(context) { + const options = context.options[0] || {}, + allowEmptyCatch = options.allowEmptyCatch || false; + + const sourceCode = context.getSourceCode(); + + return { + BlockStatement(node) { + + // if the body is not empty, we can just return immediately + if (node.body.length !== 0) { + return; + } + + // a function is generally allowed to be empty + if (astUtils.isFunction(node.parent)) { + return; + } + + if (allowEmptyCatch && node.parent.type === "CatchClause") { + return; + } + + // any other block is only allowed to be empty, if it contains a comment + if (sourceCode.getCommentsInside(node).length > 0) { + return; + } + + context.report({ node, messageId: "unexpected", data: { type: "block" } }); + }, + + SwitchStatement(node) { + + if (typeof node.cases === "undefined" || node.cases.length === 0) { + context.report({ node, messageId: "unexpected", data: { type: "switch" } }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-eq-null.js b/day1/cli-study/node_modules/eslint/lib/rules/no-eq-null.js new file mode 100644 index 0000000..b8dead9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-eq-null.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Rule to flag comparisons to null without a type-checking + * operator. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `null` comparisons without type-checking operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eq-null" + }, + + schema: [], + + messages: { + unexpected: "Use '===' to compare with null." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + const badOperator = node.operator === "==" || node.operator === "!="; + + if (node.right.type === "Literal" && node.right.raw === "null" && badOperator || + node.left.type === "Literal" && node.left.raw === "null" && badOperator) { + context.report({ node, messageId: "unexpected" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-eval.js b/day1/cli-study/node_modules/eslint/lib/rules/no-eval.js new file mode 100644 index 0000000..811ad4e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-eval.js @@ -0,0 +1,307 @@ +/** + * @fileoverview Rule to flag use of eval() statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const candidatesOfGlobalObject = Object.freeze([ + "global", + "window", + "globalThis" +]); + +/** + * Checks a given node is a Identifier node of the specified name. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a Identifier node of the name. + */ +function isIdentifier(node, name) { + return node.type === "Identifier" && node.name === name; +} + +/** + * Checks a given node is a Literal node of the specified string value. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a Literal node of the name. + */ +function isConstant(node, name) { + switch (node.type) { + case "Literal": + return node.value === name; + + case "TemplateLiteral": + return ( + node.expressions.length === 0 && + node.quasis[0].value.cooked === name + ); + + default: + return false; + } +} + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @param {string} name A name to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isMember(node, name) { + return ( + node.type === "MemberExpression" && + (node.computed ? isConstant : isIdentifier)(node.property, name) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-eval" + }, + + schema: [ + { + type: "object", + properties: { + allowIndirect: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "eval can be harmful." + } + }, + + create(context) { + const allowIndirect = Boolean( + context.options[0] && + context.options[0].allowIndirect + ); + const sourceCode = context.getSourceCode(); + let funcInfo = null; + + /** + * Pushs a variable scope (Program or Function) information to the stack. + * + * This is used in order to check whether or not `this` binding is a + * reference to the global object. + * @param {ASTNode} node A node of the scope. This is one of Program, + * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. + * @returns {void} + */ + function enterVarScope(node) { + const strict = context.getScope().isStrict; + + funcInfo = { + upper: funcInfo, + node, + strict, + defaultThis: false, + initialized: strict + }; + } + + /** + * Pops a variable scope from the stack. + * @returns {void} + */ + function exitVarScope() { + funcInfo = funcInfo.upper; + } + + /** + * Reports a given node. + * + * `node` is `Identifier` or `MemberExpression`. + * The parent of `node` might be `CallExpression`. + * + * The location of the report is always `eval` `Identifier` (or possibly + * `Literal`). The type of the report is `CallExpression` if the parent is + * `CallExpression`. Otherwise, it's the given node type. + * @param {ASTNode} node A node to report. + * @returns {void} + */ + function report(node) { + const parent = node.parent; + const locationNode = node.type === "MemberExpression" + ? node.property + : node; + + const reportNode = parent.type === "CallExpression" && parent.callee === node + ? parent + : node; + + context.report({ + node: reportNode, + loc: locationNode.loc, + messageId: "unexpected" + }); + } + + /** + * Reports accesses of `eval` via the global object. + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEvalViaGlobalObject(globalScope) { + for (let i = 0; i < candidatesOfGlobalObject.length; ++i) { + const name = candidatesOfGlobalObject[i]; + const variable = astUtils.getVariableByName(globalScope, name); + + if (!variable) { + continue; + } + + const references = variable.references; + + for (let j = 0; j < references.length; ++j) { + const identifier = references[j].identifier; + let node = identifier.parent; + + // To detect code like `window.window.eval`. + while (isMember(node, name)) { + node = node.parent; + } + + // Reports. + if (isMember(node, "eval")) { + report(node); + } + } + } + } + + /** + * Reports all accesses of `eval` (excludes direct calls to eval). + * @param {eslint-scope.Scope} globalScope The global scope. + * @returns {void} + */ + function reportAccessingEval(globalScope) { + const variable = astUtils.getVariableByName(globalScope, "eval"); + + if (!variable) { + return; + } + + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + const id = reference.identifier; + + if (id.name === "eval" && !astUtils.isCallee(id)) { + + // Is accessing to eval (excludes direct calls to eval) + report(id); + } + } + } + + if (allowIndirect) { + + // Checks only direct calls to eval. It's simple! + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + if (isIdentifier(callee, "eval")) { + report(callee); + } + } + }; + } + + return { + "CallExpression:exit"(node) { + const callee = node.callee; + + if (isIdentifier(callee, "eval")) { + report(callee); + } + }, + + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}, + strict = + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict); + + funcInfo = { + upper: null, + node, + strict, + defaultThis: true, + initialized: true + }; + }, + + "Program:exit"() { + const globalScope = context.getScope(); + + exitVarScope(); + reportAccessingEval(globalScope); + reportAccessingEvalViaGlobalObject(globalScope); + }, + + FunctionDeclaration: enterVarScope, + "FunctionDeclaration:exit": exitVarScope, + FunctionExpression: enterVarScope, + "FunctionExpression:exit": exitVarScope, + ArrowFunctionExpression: enterVarScope, + "ArrowFunctionExpression:exit": exitVarScope, + + ThisExpression(node) { + if (!isMember(node.parent, "eval")) { + return; + } + + /* + * `this.eval` is found. + * Checks whether or not the value of `this` is the global object. + */ + if (!funcInfo.initialized) { + funcInfo.initialized = true; + funcInfo.defaultThis = astUtils.isDefaultThisBinding( + funcInfo.node, + sourceCode + ); + } + + if (!funcInfo.strict && funcInfo.defaultThis) { + + // `this.eval` is possible built-in `eval`. + report(node.parent); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-ex-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-ex-assign.js new file mode 100644 index 0000000..1163920 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-ex-assign.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag assignment of the exception parameter + * @author Stephen Murray + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning exceptions in `catch` clauses", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-ex-assign" + }, + + schema: [], + + messages: { + unexpected: "Do not assign to the exception parameter." + } + }, + + create(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(reference => { + context.report({ node: reference.identifier, messageId: "unexpected" }); + }); + } + + return { + CatchClause(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extend-native.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extend-native.js new file mode 100644 index 0000000..7ab25ab --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extend-native.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag adding properties to native object's prototypes. + * @author David Nelson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const globals = require("globals"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const propertyDefinitionMethods = new Set(["defineProperty", "defineProperties"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow extending native types", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extend-native" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpected: "{{builtin}} prototype is read only, properties should not be added." + } + }, + + create(context) { + + const config = context.options[0] || {}; + const exceptions = new Set(config.exceptions || []); + const modifiedBuiltins = new Set( + Object.keys(globals.builtin) + .filter(builtin => builtin[0].toUpperCase() === builtin[0]) + .filter(builtin => !exceptions.has(builtin)) + ); + + /** + * Reports a lint error for the given node. + * @param {ASTNode} node The node to report. + * @param {string} builtin The name of the native builtin being extended. + * @returns {void} + */ + function reportNode(node, builtin) { + context.report({ + node, + messageId: "unexpected", + data: { + builtin + } + }); + } + + /** + * Check to see if the `prototype` property of the given object + * identifier node is being accessed. + * @param {ASTNode} identifierNode The Identifier representing the object + * to check. + * @returns {boolean} True if the identifier is the object of a + * MemberExpression and its `prototype` property is being accessed, + * false otherwise. + */ + function isPrototypePropertyAccessed(identifierNode) { + return Boolean( + identifierNode && + identifierNode.parent && + identifierNode.parent.type === "MemberExpression" && + identifierNode.parent.object === identifierNode && + astUtils.getStaticPropertyName(identifierNode.parent) === "prototype" + ); + } + + /** + * Checks that an identifier is an object of a prototype whose member + * is being assigned in an AssignmentExpression. + * Example: Object.prototype.foo = "bar" + * @param {ASTNode} identifierNode The identifier to check. + * @returns {boolean} True if the identifier's prototype is modified. + */ + function isInPrototypePropertyAssignment(identifierNode) { + return Boolean( + isPrototypePropertyAccessed(identifierNode) && + identifierNode.parent.parent.type === "MemberExpression" && + identifierNode.parent.parent.parent.type === "AssignmentExpression" && + identifierNode.parent.parent.parent.left === identifierNode.parent.parent + ); + } + + /** + * Checks that an identifier is an object of a prototype whose member + * is being extended via the Object.defineProperty() or + * Object.defineProperties() methods. + * Example: Object.defineProperty(Array.prototype, "foo", ...) + * Example: Object.defineProperties(Array.prototype, ...) + * @param {ASTNode} identifierNode The identifier to check. + * @returns {boolean} True if the identifier's prototype is modified. + */ + function isInDefinePropertyCall(identifierNode) { + return Boolean( + isPrototypePropertyAccessed(identifierNode) && + identifierNode.parent.parent.type === "CallExpression" && + identifierNode.parent.parent.arguments[0] === identifierNode.parent && + identifierNode.parent.parent.callee.type === "MemberExpression" && + identifierNode.parent.parent.callee.object.type === "Identifier" && + identifierNode.parent.parent.callee.object.name === "Object" && + identifierNode.parent.parent.callee.property.type === "Identifier" && + propertyDefinitionMethods.has(identifierNode.parent.parent.callee.property.name) + ); + } + + /** + * Check to see if object prototype access is part of a prototype + * extension. There are three ways a prototype can be extended: + * 1. Assignment to prototype property (Object.prototype.foo = 1) + * 2. Object.defineProperty()/Object.defineProperties() on a prototype + * If prototype extension is detected, report the AssignmentExpression + * or CallExpression node. + * @param {ASTNode} identifierNode The Identifier representing the object + * which prototype is being accessed and possibly extended. + * @returns {void} + */ + function checkAndReportPrototypeExtension(identifierNode) { + if (isInPrototypePropertyAssignment(identifierNode)) { + + // Identifier --> MemberExpression --> MemberExpression --> AssignmentExpression + reportNode(identifierNode.parent.parent.parent, identifierNode.name); + } else if (isInDefinePropertyCall(identifierNode)) { + + // Identifier --> MemberExpression --> CallExpression + reportNode(identifierNode.parent.parent, identifierNode.name); + } + } + + return { + + "Program:exit"() { + const globalScope = context.getScope(); + + modifiedBuiltins.forEach(builtin => { + const builtinVar = globalScope.set.get(builtin); + + if (builtinVar && builtinVar.references) { + builtinVar.references + .map(ref => ref.identifier) + .forEach(checkAndReportPrototypeExtension); + } + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extra-bind.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-bind.js new file mode 100644 index 0000000..df69592 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-bind.js @@ -0,0 +1,173 @@ +/** + * @fileoverview Rule to flag unnecessary bind calls + * @author Bence Dányi + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.bind()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-bind" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "The function binding is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks if a node is free of side effects. + * + * This check is stricter than it needs to be, in order to keep the implementation simple. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is known to be side-effect free, false otherwise. + */ + function isSideEffectFree(node) { + return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type); + } + + /** + * Reports a given function node. + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {void} + */ + function report(node) { + context.report({ + node: node.parent.parent, + messageId: "unexpected", + loc: node.parent.property.loc, + fix(fixer) { + if (node.parent.parent.arguments.length && !isSideEffectFree(node.parent.parent.arguments[0])) { + return null; + } + + const firstTokenToRemove = sourceCode + .getFirstTokenBetween(node.parent.object, node.parent.property, astUtils.isNotClosingParenToken); + const lastTokenToRemove = sourceCode.getLastToken(node.parent.parent); + + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return null; + } + + return fixer.removeRange([firstTokenToRemove.range[0], node.parent.parent.range[1]]); + } + }); + } + + /** + * Checks whether or not a given function node is the callee of `.bind()` + * method. + * + * e.g. `(function() {}.bind(foo))` + * @param {ASTNode} node A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callee of `.bind()` method. + */ + function isCalleeOfBindMethod(node) { + const parent = node.parent; + const grandparent = parent.parent; + + return ( + grandparent && + grandparent.type === "CallExpression" && + grandparent.callee === parent && + grandparent.arguments.length === 1 && + grandparent.arguments[0].type !== "SpreadElement" && + parent.type === "MemberExpression" && + parent.object === node && + astUtils.getStaticPropertyName(parent) === "bind" + ); + } + + /** + * Adds a scope information object to the stack. + * @param {ASTNode} node A node to add. This node is a FunctionExpression + * or a FunctionDeclaration node. + * @returns {void} + */ + function enterFunction(node) { + scopeInfo = { + isBound: isCalleeOfBindMethod(node), + thisFound: false, + upper: scopeInfo + }; + } + + /** + * Removes the scope information object from the top of the stack. + * At the same time, this reports the function node if the function has + * `.bind()` and the `this` keywords found. + * @param {ASTNode} node A node to remove. This node is a + * FunctionExpression or a FunctionDeclaration node. + * @returns {void} + */ + function exitFunction(node) { + if (scopeInfo.isBound && !scopeInfo.thisFound) { + report(node); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Reports a given arrow function if the function is callee of `.bind()` + * method. + * @param {ASTNode} node A node to report. This node is an + * ArrowFunctionExpression. + * @returns {void} + */ + function exitArrowFunction(node) { + if (isCalleeOfBindMethod(node)) { + report(node); + } + } + + /** + * Set the mark as the `this` keyword was found in this scope. + * @returns {void} + */ + function markAsThisFound() { + if (scopeInfo) { + scopeInfo.thisFound = true; + } + } + + return { + "ArrowFunctionExpression:exit": exitArrowFunction, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + ThisExpression: markAsThisFound + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-boolean-cast.js new file mode 100644 index 0000000..b90757b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-boolean-cast.js @@ -0,0 +1,309 @@ +/** + * @fileoverview Rule to flag unnecessary double negation in Boolean contexts + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +const precedence = astUtils.getPrecedence; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary boolean casts", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-boolean-cast" + }, + + schema: [{ + type: "object", + properties: { + enforceForLogicalOperands: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unexpectedCall: "Redundant Boolean call.", + unexpectedNegation: "Redundant double negation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + // Node types which have a test which will coerce values to booleans. + const BOOLEAN_NODE_TYPES = [ + "IfStatement", + "DoWhileStatement", + "WhileStatement", + "ConditionalExpression", + "ForStatement" + ]; + + /** + * Check if a node is a Boolean function or constructor. + * @param {ASTNode} node the node + * @returns {boolean} If the node is Boolean function or constructor + */ + function isBooleanFunctionOrConstructorCall(node) { + + // Boolean() and new Boolean() + return (node.type === "CallExpression" || node.type === "NewExpression") && + node.callee.type === "Identifier" && + node.callee.name === "Boolean"; + } + + /** + * Checks whether the node is a logical expression and that the option is enabled + * @param {ASTNode} node the node + * @returns {boolean} if the node is a logical expression and option is enabled + */ + function isLogicalContext(node) { + return node.type === "LogicalExpression" && + (node.operator === "||" || node.operator === "&&") && + (context.options.length && context.options[0].enforceForLogicalOperands === true); + + } + + + /** + * Check if a node is in a context where its value would be coerced to a boolean at runtime. + * @param {ASTNode} node The node + * @returns {boolean} If it is in a boolean context + */ + function isInBooleanContext(node) { + return ( + (isBooleanFunctionOrConstructorCall(node.parent) && + node === node.parent.arguments[0]) || + + (BOOLEAN_NODE_TYPES.indexOf(node.parent.type) !== -1 && + node === node.parent.test) || + + // ! + (node.parent.type === "UnaryExpression" && + node.parent.operator === "!") + ); + } + + /** + * Checks whether the node is a context that should report an error + * Acts recursively if it is in a logical context + * @param {ASTNode} node the node + * @returns {boolean} If the node is in one of the flagged contexts + */ + function isInFlaggedContext(node) { + return isInBooleanContext(node) || + (isLogicalContext(node.parent) && + + // For nested logical statements + isInFlaggedContext(node.parent) + ); + } + + + /** + * Check if a node has comments inside. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if it has comments inside. + */ + function hasCommentsInside(node) { + return Boolean(sourceCode.getCommentsInside(node).length); + } + + /** + * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is parenthesized. + * @private + */ + function isParenthesized(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Determines whether the given node needs to be parenthesized when replacing the previous node. + * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list + * of possible parent node types. By the same assumption, the node's role in a particular parent is already known. + * For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child. + * @param {ASTNode} previousNode Previous node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node needs to be parenthesized. + */ + function needsParens(previousNode, node) { + if (isParenthesized(previousNode)) { + + // parentheses around the previous node will stay, so there is no need for an additional pair + return false; + } + + // parent of the previous node will become parent of the replacement node + const parent = previousNode.parent; + + switch (parent.type) { + case "CallExpression": + case "NewExpression": + return node.type === "SequenceExpression"; + case "IfStatement": + case "DoWhileStatement": + case "WhileStatement": + case "ForStatement": + return false; + case "ConditionalExpression": + return precedence(node) <= precedence(parent); + case "UnaryExpression": + return precedence(node) < precedence(parent); + case "LogicalExpression": + if (astUtils.isMixedLogicalAndCoalesceExpressions(node, parent)) { + return true; + } + if (previousNode === parent.left) { + return precedence(node) < precedence(parent); + } + return precedence(node) <= precedence(parent); + + /* istanbul ignore next */ + default: + throw new Error(`Unexpected parent type: ${parent.type}`); + } + } + + return { + UnaryExpression(node) { + const parent = node.parent; + + + // Exit early if it's guaranteed not to match + if (node.operator !== "!" || + parent.type !== "UnaryExpression" || + parent.operator !== "!") { + return; + } + + + if (isInFlaggedContext(parent)) { + context.report({ + node: parent, + messageId: "unexpectedNegation", + fix(fixer) { + if (hasCommentsInside(parent)) { + return null; + } + + if (needsParens(parent, node.argument)) { + return fixer.replaceText(parent, `(${sourceCode.getText(node.argument)})`); + } + + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + const firstReplacementToken = sourceCode.getFirstToken(node.argument); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + sourceCode.getText(node.argument)); + } + }); + } + }, + + CallExpression(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") { + return; + } + + if (isInFlaggedContext(node)) { + context.report({ + node, + messageId: "unexpectedCall", + fix(fixer) { + const parent = node.parent; + + if (node.arguments.length === 0) { + if (parent.type === "UnaryExpression" && parent.operator === "!") { + + /* + * !Boolean() -> true + */ + + if (hasCommentsInside(parent)) { + return null; + } + + const replacement = "true"; + let prefix = ""; + const tokenBefore = sourceCode.getTokenBefore(parent); + + if ( + tokenBefore && + tokenBefore.range[1] === parent.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + return fixer.replaceText(parent, prefix + replacement); + } + + /* + * Boolean() -> false + */ + + if (hasCommentsInside(node)) { + return null; + } + + return fixer.replaceText(node, "false"); + } + + if (node.arguments.length === 1) { + const argument = node.arguments[0]; + + if (argument.type === "SpreadElement" || hasCommentsInside(node)) { + return null; + } + + /* + * Boolean(expression) -> expression + */ + + if (needsParens(node, argument)) { + return fixer.replaceText(node, `(${sourceCode.getText(argument)})`); + } + + return fixer.replaceText(node, sourceCode.getText(argument)); + } + + // two or more arguments + return null; + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extra-label.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-label.js new file mode 100644 index 0000000..81406e7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-label.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Rule to disallow unnecessary labels + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary labels", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-label" + }, + + schema: [], + fixable: "code", + + messages: { + unexpected: "This label '{{name}}' is unnecessary." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Creates a new scope with a breakable statement. + * @param {ASTNode} node A node to create. This is a BreakableStatement. + * @returns {void} + */ + function enterBreakableStatement(node) { + scopeInfo = { + label: node.parent.type === "LabeledStatement" ? node.parent.label : null, + breakable: true, + upper: scopeInfo + }; + } + + /** + * Removes the top scope of the stack. + * @returns {void} + */ + function exitBreakableStatement() { + scopeInfo = scopeInfo.upper; + } + + /** + * Creates a new scope with a labeled statement. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `enterBreakableStatement` function. + * @param {ASTNode} node A node to create. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = { + label: node.label, + breakable: false, + upper: scopeInfo + }; + } + } + + /** + * Removes the top scope of the stack. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `exitBreakableStatement` function. + * @param {ASTNode} node A node. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = scopeInfo.upper; + } + } + + /** + * Reports a given control node if it's unnecessary. + * @param {ASTNode} node A node. This is a BreakStatement or a + * ContinueStatement. + * @returns {void} + */ + function reportIfUnnecessary(node) { + if (!node.label) { + return; + } + + const labelNode = node.label; + + for (let info = scopeInfo; info !== null; info = info.upper) { + if (info.breakable || info.label && info.label.name === labelNode.name) { + if (info.breakable && info.label && info.label.name === labelNode.name) { + context.report({ + node: labelNode, + messageId: "unexpected", + data: labelNode, + fix(fixer) { + const breakOrContinueToken = sourceCode.getFirstToken(node); + + if (sourceCode.commentsExistBetween(breakOrContinueToken, labelNode)) { + return null; + } + + return fixer.removeRange([breakOrContinueToken.range[1], labelNode.range[1]]); + } + }); + } + return; + } + } + } + + return { + WhileStatement: enterBreakableStatement, + "WhileStatement:exit": exitBreakableStatement, + DoWhileStatement: enterBreakableStatement, + "DoWhileStatement:exit": exitBreakableStatement, + ForStatement: enterBreakableStatement, + "ForStatement:exit": exitBreakableStatement, + ForInStatement: enterBreakableStatement, + "ForInStatement:exit": exitBreakableStatement, + ForOfStatement: enterBreakableStatement, + "ForOfStatement:exit": exitBreakableStatement, + SwitchStatement: enterBreakableStatement, + "SwitchStatement:exit": exitBreakableStatement, + LabeledStatement: enterLabeledStatement, + "LabeledStatement:exit": exitLabeledStatement, + BreakStatement: reportIfUnnecessary, + ContinueStatement: reportIfUnnecessary + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extra-parens.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-parens.js new file mode 100644 index 0000000..bae1a49 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-parens.js @@ -0,0 +1,1139 @@ +/** + * @fileoverview Disallow parenthesising higher precedence subexpressions. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const { isParenthesized: isParenthesizedRaw } = require("eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow unnecessary parentheses", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-extra-parens" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["functions"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["all"] + }, + { + type: "object", + properties: { + conditionalAssign: { type: "boolean" }, + nestedBinaryExpressions: { type: "boolean" }, + returnAssign: { type: "boolean" }, + ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, + enforceForArrowConditionals: { type: "boolean" }, + enforceForSequenceExpressions: { type: "boolean" }, + enforceForNewInMemberExpressions: { type: "boolean" }, + enforceForFunctionPrototypeMethods: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + unexpected: "Unnecessary parentheses around expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const tokensToIgnore = new WeakSet(); + const precedence = astUtils.getPrecedence; + const ALL_NODES = context.options[0] !== "functions"; + const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + const NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false; + const EXCEPT_RETURN_ASSIGN = ALL_NODES && context.options[1] && context.options[1].returnAssign === false; + const IGNORE_JSX = ALL_NODES && context.options[1] && context.options[1].ignoreJSX; + const IGNORE_ARROW_CONDITIONALS = ALL_NODES && context.options[1] && + context.options[1].enforceForArrowConditionals === false; + const IGNORE_SEQUENCE_EXPRESSIONS = ALL_NODES && context.options[1] && + context.options[1].enforceForSequenceExpressions === false; + const IGNORE_NEW_IN_MEMBER_EXPR = ALL_NODES && context.options[1] && + context.options[1].enforceForNewInMemberExpressions === false; + const IGNORE_FUNCTION_PROTOTYPE_METHODS = ALL_NODES && context.options[1] && + context.options[1].enforceForFunctionPrototypeMethods === false; + + const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); + const PRECEDENCE_OF_UPDATE_EXPR = precedence({ type: "UpdateExpression" }); + + let reportsBuffer; + + /** + * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node. + * Example: function(){}.call() + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is an immediate `call` or `apply` method call. + * @private + */ + function isImmediateFunctionPrototypeMethodCall(node) { + return node.type === "CallExpression" && + node.callee.type === "MemberExpression" && + node.callee.object.type === "FunctionExpression" && + ["call", "apply"].includes(astUtils.getStaticPropertyName(node.callee)); + } + + /** + * Determines if this rule should be enforced for a node given the current configuration. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the rule should be enforced for this node. + * @private + */ + function ruleApplies(node) { + if (node.type === "JSXElement" || node.type === "JSXFragment") { + const isSingleLine = node.loc.start.line === node.loc.end.line; + + switch (IGNORE_JSX) { + + // Exclude this JSX element from linting + case "all": + return false; + + // Exclude this JSX element if it is multi-line element + case "multi-line": + return isSingleLine; + + // Exclude this JSX element if it is single-line element + case "single-line": + return !isSingleLine; + + // Nothing special to be done for JSX elements + case "none": + break; + + // no default + } + } + + if (node.type === "SequenceExpression" && IGNORE_SEQUENCE_EXPRESSIONS) { + return false; + } + + if (isImmediateFunctionPrototypeMethodCall(node) && IGNORE_FUNCTION_PROTOTYPE_METHODS) { + return false; + } + + return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; + } + + /** + * Determines if a node is surrounded by parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ + function isParenthesised(node) { + return isParenthesizedRaw(1, node, sourceCode); + } + + /** + * Determines if a node is surrounded by parentheses twice. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is doubly parenthesised. + * @private + */ + function isParenthesisedTwice(node) { + return isParenthesizedRaw(2, node, sourceCode); + } + + /** + * Determines if a node is surrounded by (potentially) invalid parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParens(node) { + return ruleApplies(node) && isParenthesised(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasDoubleExcessParens(node) { + return ruleApplies(node) && isParenthesisedTwice(node); + } + + /** + * Determines if a node that is expected to be parenthesised is surrounded by + * (potentially) invalid extra parentheses with considering precedence level of the node. + * If the preference level of the node is not higher or equal to precedence lower limit, it also checks + * whether the node is surrounded by parentheses twice or not. + * @param {ASTNode} node The node to be checked. + * @param {number} precedenceLowerLimit The lower limit of precedence. + * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. + * @private + */ + function hasExcessParensWithPrecedence(node, precedenceLowerLimit) { + if (ruleApplies(node) && isParenthesised(node)) { + if ( + precedence(node) >= precedenceLowerLimit || + isParenthesisedTwice(node) + ) { + return true; + } + } + return false; + } + + /** + * Determines if a node test expression is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isCondAssignException(node) { + return EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"; + } + + /** + * Determines if a node is in a return statement + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is in a return statement. + * @private + */ + function isInReturnStatement(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if ( + currentNode.type === "ReturnStatement" || + (currentNode.type === "ArrowFunctionExpression" && currentNode.body.type !== "BlockStatement") + ) { + return true; + } + } + + return false; + } + + /** + * Determines if a constructor function is newed-up with parens + * @param {ASTNode} newExpression The NewExpression node to be checked. + * @returns {boolean} True if the constructor is called with parens. + * @private + */ + function isNewExpressionWithParens(newExpression) { + const lastToken = sourceCode.getLastToken(newExpression); + const penultimateToken = sourceCode.getTokenBefore(lastToken); + + return newExpression.arguments.length > 0 || + ( + + // The expression should end with its own parens, e.g., new new foo() is not a new expression with parens + astUtils.isOpeningParenToken(penultimateToken) && + astUtils.isClosingParenToken(lastToken) && + newExpression.callee.range[1] < newExpression.range[1] + ); + } + + /** + * Determines if a node is or contains an assignment expression + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is or contains an assignment expression. + * @private + */ + function containsAssignment(node) { + if (node.type === "AssignmentExpression") { + return true; + } + if (node.type === "ConditionalExpression" && + (node.consequent.type === "AssignmentExpression" || node.alternate.type === "AssignmentExpression")) { + return true; + } + if ((node.left && node.left.type === "AssignmentExpression") || + (node.right && node.right.type === "AssignmentExpression")) { + return true; + } + + return false; + } + + /** + * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isReturnAssignException(node) { + if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) { + return false; + } + + if (node.type === "ReturnStatement") { + return node.argument && containsAssignment(node.argument); + } + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + return containsAssignment(node.body); + } + return containsAssignment(node); + + } + + /** + * Determines if a node following a [no LineTerminator here] restriction is + * surrounded by (potentially) invalid extra parentheses. + * @param {Token} token The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParensNoLineTerminator(token, node) { + if (token.loc.end.line === node.loc.start.line) { + return hasExcessParens(node); + } + + return hasDoubleExcessParens(node); + } + + /** + * Determines whether a node should be preceded by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted before the node + * @private + */ + function requiresLeadingSpace(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const tokenBeforeLeftParen = sourceCode.getTokenBefore(leftParenToken, { includeComments: true }); + const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParenToken, { includeComments: true }); + + return tokenBeforeLeftParen && + tokenBeforeLeftParen.range[1] === leftParenToken.range[0] && + leftParenToken.range[1] === tokenAfterLeftParen.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftParen, tokenAfterLeftParen); + } + + /** + * Determines whether a node should be followed by an additional space when removing parens + * @param {ASTNode} node node to evaluate; must be surrounded by parentheses + * @returns {boolean} `true` if a space should be inserted after the node + * @private + */ + function requiresTrailingSpace(node) { + const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 }); + const rightParenToken = nextTwoTokens[0]; + const tokenAfterRightParen = nextTwoTokens[1]; + const tokenBeforeRightParen = sourceCode.getLastToken(node); + + return rightParenToken && tokenAfterRightParen && + !sourceCode.isSpaceBetweenTokens(rightParenToken, tokenAfterRightParen) && + !astUtils.canTokensBeAdjacent(tokenBeforeRightParen, tokenAfterRightParen); + } + + /** + * Determines if a given expression node is an IIFE + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the given node is an IIFE + */ + function isIIFE(node) { + return node.type === "CallExpression" && node.callee.type === "FunctionExpression"; + } + + /** + * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment. + * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax, + * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary. + * @param {ASTNode} [node] The node to check + * @returns {boolean} `true` if the given node can be a valid assignment target + */ + function canBeAssignmentTarget(node) { + return node && (node.type === "Identifier" || node.type === "MemberExpression"); + } + + /** + * Report the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function report(node) { + const leftParenToken = sourceCode.getTokenBefore(node); + const rightParenToken = sourceCode.getTokenAfter(node); + + if (!isParenthesisedTwice(node)) { + if (tokensToIgnore.has(sourceCode.getFirstToken(node))) { + return; + } + + if (isIIFE(node) && !isParenthesised(node.callee)) { + return; + } + } + + /** + * Finishes reporting + * @returns {void} + * @private + */ + function finishReport() { + context.report({ + node, + loc: leftParenToken.loc, + messageId: "unexpected", + fix(fixer) { + const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); + + return fixer.replaceTextRange([ + leftParenToken.range[0], + rightParenToken.range[1] + ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); + } + }); + } + + if (reportsBuffer) { + reportsBuffer.reports.push({ node, finishReport }); + return; + } + + finishReport(); + } + + /** + * Evaluate a argument of the node. + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkArgumentWithPrecedence(node) { + if (hasExcessParensWithPrecedence(node.argument, precedence(node))) { + report(node.argument); + } + } + + /** + * Check if a member expression contains a call expression + * @param {ASTNode} node MemberExpression node to evaluate + * @returns {boolean} true if found, false if not + */ + function doesMemberExpressionContainCallExpression(node) { + let currentNode = node.object; + let currentNodeType = node.object.type; + + while (currentNodeType === "MemberExpression") { + currentNode = currentNode.object; + currentNodeType = currentNode.type; + } + + return currentNodeType === "CallExpression"; + } + + /** + * Evaluate a new call + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkCallNew(node) { + const callee = node.callee; + + if (hasExcessParensWithPrecedence(callee, precedence(node))) { + const hasNewParensException = callee.type === "NewExpression" && !isNewExpressionWithParens(callee); + + if ( + hasDoubleExcessParens(callee) || + !isIIFE(node) && !hasNewParensException && !( + + // Allow extra parens around a new expression if they are intervening parentheses. + node.type === "NewExpression" && + callee.type === "MemberExpression" && + doesMemberExpressionContainCallExpression(callee) + ) + ) { + report(node.callee); + } + } + node.arguments + .filter(arg => hasExcessParensWithPrecedence(arg, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + } + + /** + * Evaluate binary logicals + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinaryLogical(node) { + const prec = precedence(node); + const leftPrecedence = precedence(node.left); + const rightPrecedence = precedence(node.right); + const isExponentiation = node.operator === "**"; + const shouldSkipLeft = NESTED_BINARY && (node.left.type === "BinaryExpression" || node.left.type === "LogicalExpression"); + const shouldSkipRight = NESTED_BINARY && (node.right.type === "BinaryExpression" || node.right.type === "LogicalExpression"); + + if (!shouldSkipLeft && hasExcessParens(node.left)) { + if ( + !(node.left.type === "UnaryExpression" && isExponentiation) && + !astUtils.isMixedLogicalAndCoalesceExpressions(node.left, node) && + (leftPrecedence > prec || (leftPrecedence === prec && !isExponentiation)) || + isParenthesisedTwice(node.left) + ) { + report(node.left); + } + } + + if (!shouldSkipRight && hasExcessParens(node.right)) { + if ( + !astUtils.isMixedLogicalAndCoalesceExpressions(node.right, node) && + (rightPrecedence > prec || (rightPrecedence === prec && isExponentiation)) || + isParenthesisedTwice(node.right) + ) { + report(node.right); + } + } + } + + /** + * Check the parentheses around the super class of the given class definition. + * @param {ASTNode} node The node of class declarations to check. + * @returns {void} + */ + function checkClass(node) { + if (!node.superClass) { + return; + } + + /* + * If `node.superClass` is a LeftHandSideExpression, parentheses are extra. + * Otherwise, parentheses are needed. + */ + const hasExtraParens = precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR + ? hasExcessParens(node.superClass) + : hasDoubleExcessParens(node.superClass); + + if (hasExtraParens) { + report(node.superClass); + } + } + + /** + * Check the parentheses around the argument of the given spread operator. + * @param {ASTNode} node The node of spread elements/properties to check. + * @returns {void} + */ + function checkSpreadOperator(node) { + if (hasExcessParensWithPrecedence(node.argument, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.argument); + } + } + + /** + * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration + * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node + * @returns {void} + */ + function checkExpressionOrExportStatement(node) { + const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); + const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); + const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; + const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; + + if ( + astUtils.isOpeningParenToken(firstToken) && + ( + astUtils.isOpeningBraceToken(secondToken) || + secondToken.type === "Keyword" && ( + secondToken.value === "function" || + secondToken.value === "class" || + secondToken.value === "let" && + tokenAfterClosingParens && + ( + astUtils.isOpeningBracketToken(tokenAfterClosingParens) || + tokenAfterClosingParens.type === "Identifier" + ) + ) || + secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" + ) + ) { + tokensToIgnore.add(secondToken); + } + + const hasExtraParens = node.parent.type === "ExportDefaultDeclaration" + ? hasExcessParensWithPrecedence(node, PRECEDENCE_OF_ASSIGNMENT_EXPR) + : hasExcessParens(node); + + if (hasExtraParens) { + report(node); + } + } + + /** + * Finds the path from the given node to the specified ancestor. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} ancestor Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified ancestor. + */ + function pathToAncestor(node, ancestor) { + const path = [node]; + let currentNode = node; + + while (currentNode !== ancestor) { + + currentNode = currentNode.parent; + + /* istanbul ignore if */ + if (currentNode === null) { + throw new Error("Nodes are not in the ancestor-descendant relationship."); + } + + path.push(currentNode); + } + + return path; + } + + /** + * Finds the path from the given node to the specified descendant. + * @param {ASTNode} node First node in the path. + * @param {ASTNode} descendant Last node in the path. + * @returns {ASTNode[]} Path, including both nodes. + * @throws {Error} If the given node does not have the specified descendant. + */ + function pathToDescendant(node, descendant) { + return pathToAncestor(descendant, node).reverse(); + } + + /** + * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer + * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop. + * @param {ASTNode} node Ancestor of an 'in' expression. + * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself. + * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis. + */ + function isSafelyEnclosingInExpression(node, child) { + switch (node.type) { + case "ArrayExpression": + case "ArrayPattern": + case "BlockStatement": + case "ObjectExpression": + case "ObjectPattern": + case "TemplateLiteral": + return true; + case "ArrowFunctionExpression": + case "FunctionExpression": + return node.params.includes(child); + case "CallExpression": + case "NewExpression": + return node.arguments.includes(child); + case "MemberExpression": + return node.computed && node.property === child; + case "ConditionalExpression": + return node.consequent === child; + default: + return false; + } + } + + /** + * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately. + * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings. + * @returns {void} + */ + function startNewReportsBuffering() { + reportsBuffer = { + upper: reportsBuffer, + inExpressionNodes: [], + reports: [] + }; + } + + /** + * Ends the current reports buffering. + * @returns {void} + */ + function endCurrentReportsBuffering() { + const { upper, inExpressionNodes, reports } = reportsBuffer; + + if (upper) { + upper.inExpressionNodes.push(...inExpressionNodes); + upper.reports.push(...reports); + } else { + + // flush remaining reports + reports.forEach(({ finishReport }) => finishReport()); + } + + reportsBuffer = upper; + } + + /** + * Checks whether the given node is in the current reports buffer. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is in the current buffer, false otherwise. + */ + function isInCurrentReportsBuffer(node) { + return reportsBuffer.reports.some(r => r.node === node); + } + + /** + * Removes the given node from the current reports buffer. + * @param {ASTNode} node Node to remove. + * @returns {void} + */ + function removeFromCurrentReportsBuffer(node) { + reportsBuffer.reports = reportsBuffer.reports.filter(r => r.node !== node); + } + + return { + ArrayExpression(node) { + node.elements + .filter(e => e && hasExcessParensWithPrecedence(e, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(report); + }, + + ArrayPattern(node) { + node.elements + .filter(e => canBeAssignmentTarget(e) && hasExcessParens(e)) + .forEach(report); + }, + + ArrowFunctionExpression(node) { + if (isReturnAssignException(node)) { + return; + } + + if (node.body.type === "ConditionalExpression" && + IGNORE_ARROW_CONDITIONALS + ) { + return; + } + + if (node.body.type !== "BlockStatement") { + const firstBodyToken = sourceCode.getFirstToken(node.body, astUtils.isNotOpeningParenToken); + const tokenBeforeFirst = sourceCode.getTokenBefore(firstBodyToken); + + if (astUtils.isOpeningParenToken(tokenBeforeFirst) && astUtils.isOpeningBraceToken(firstBodyToken)) { + tokensToIgnore.add(firstBodyToken); + } + if (hasExcessParensWithPrecedence(node.body, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.body); + } + } + }, + + AssignmentExpression(node) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left)) { + report(node.left); + } + + if (!isReturnAssignException(node) && hasExcessParensWithPrecedence(node.right, precedence(node))) { + report(node.right); + } + }, + + BinaryExpression(node) { + if (reportsBuffer && node.operator === "in") { + reportsBuffer.inExpressionNodes.push(node); + } + + checkBinaryLogical(node); + }, + + CallExpression: checkCallNew, + + ClassBody(node) { + node.body + .filter(member => member.type === "MethodDefinition" && member.computed && member.key) + .filter(member => hasExcessParensWithPrecedence(member.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(member => report(member.key)); + }, + + ConditionalExpression(node) { + if (isReturnAssignException(node)) { + return; + } + if ( + !isCondAssignException(node) && + hasExcessParensWithPrecedence(node.test, precedence({ type: "LogicalExpression", operator: "||" })) + ) { + report(node.test); + } + + if (hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.consequent); + } + + if (hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.alternate); + } + }, + + DoWhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ExportDefaultDeclaration: node => checkExpressionOrExportStatement(node.declaration), + ExpressionStatement: node => checkExpressionOrExportStatement(node.expression), + + "ForInStatement, ForOfStatement"(node) { + if (node.left.type !== "VariableDeclarator") { + const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); + + if ( + firstLeftToken.value === "let" && ( + + /* + * If `let` is the only thing on the left side of the loop, it's the loop variable: `for ((let) of foo);` + * Removing it will cause a syntax error, because it will be parsed as the start of a VariableDeclarator. + */ + (firstLeftToken.range[1] === node.left.range[1] || /* + * If `let` is followed by a `[` token, it's a property access on the `let` value: `for ((let[foo]) of bar);` + * Removing it will cause the property access to be parsed as a destructuring declaration of `foo` instead. + */ + astUtils.isOpeningBracketToken( + sourceCode.getTokenAfter(firstLeftToken, astUtils.isNotClosingParenToken) + )) + ) + ) { + tokensToIgnore.add(firstLeftToken); + } + } + + if (node.type === "ForOfStatement") { + const hasExtraParens = node.right.type === "SequenceExpression" + ? hasDoubleExcessParens(node.right) + : hasExcessParens(node.right); + + if (hasExtraParens) { + report(node.right); + } + } else if (hasExcessParens(node.right)) { + report(node.right); + } + + if (hasExcessParens(node.left)) { + report(node.left); + } + }, + + ForStatement(node) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + + if (node.update && hasExcessParens(node.update)) { + report(node.update); + } + + if (node.init) { + startNewReportsBuffering(); + + if (hasExcessParens(node.init)) { + report(node.init); + } + } + }, + + "ForStatement > *.init:exit"(node) { + + /* + * Removing parentheses around `in` expressions might change semantics and cause errors. + * + * For example, this valid for loop: + * for (let a = (b in c); ;); + * after removing parentheses would be treated as an invalid for-in loop: + * for (let a = b in c; ;); + */ + + if (reportsBuffer.reports.length) { + reportsBuffer.inExpressionNodes.forEach(inExpressionNode => { + const path = pathToDescendant(node, inExpressionNode); + let nodeToExclude; + + for (let i = 0; i < path.length; i++) { + const pathNode = path[i]; + + if (i < path.length - 1) { + const nextPathNode = path[i + 1]; + + if (isSafelyEnclosingInExpression(pathNode, nextPathNode)) { + + // The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]'). + return; + } + } + + if (isParenthesised(pathNode)) { + if (isInCurrentReportsBuffer(pathNode)) { + + // This node was supposed to be reported, but parentheses might be necessary. + + if (isParenthesisedTwice(pathNode)) { + + /* + * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses. + * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses. + * The remaining pair is safely enclosing the 'in' expression. + */ + return; + } + + // Exclude the outermost node only. + if (!nodeToExclude) { + nodeToExclude = pathNode; + } + + // Don't break the loop here, there might be some safe nodes or parentheses that will stay inside. + + } else { + + // This node will stay parenthesised, the 'in' expression in safely enclosed by '()'. + return; + } + } + } + + // Exclude the node from the list (i.e. treat parentheses as necessary) + removeFromCurrentReportsBuffer(nodeToExclude); + }); + } + + endCurrentReportsBuffering(); + }, + + IfStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + ImportExpression(node) { + const { source } = node; + + if (source.type === "SequenceExpression") { + if (hasDoubleExcessParens(source)) { + report(source); + } + } else if (hasExcessParens(source)) { + report(source); + } + }, + + LogicalExpression: checkBinaryLogical, + + MemberExpression(node) { + const nodeObjHasExcessParens = hasExcessParens(node.object) && + !( + isImmediateFunctionPrototypeMethodCall(node.parent) && + node.parent.callee === node && + IGNORE_FUNCTION_PROTOTYPE_METHODS + ); + + if ( + nodeObjHasExcessParens && + precedence(node.object) >= precedence(node) && + ( + node.computed || + !( + astUtils.isDecimalInteger(node.object) || + + // RegExp literal is allowed to have parens (#1589) + (node.object.type === "Literal" && node.object.regex) + ) + ) + ) { + report(node.object); + } + + if (nodeObjHasExcessParens && + node.object.type === "CallExpression" && + node.parent.type !== "NewExpression") { + report(node.object); + } + + if (nodeObjHasExcessParens && + !IGNORE_NEW_IN_MEMBER_EXPR && + node.object.type === "NewExpression" && + isNewExpressionWithParens(node.object)) { + report(node.object); + } + + if (node.computed && hasExcessParens(node.property)) { + report(node.property); + } + }, + + NewExpression: checkCallNew, + + ObjectExpression(node) { + node.properties + .filter(property => property.value && hasExcessParensWithPrecedence(property.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) + .forEach(property => report(property.value)); + }, + + ObjectPattern(node) { + node.properties + .filter(property => { + const value = property.value; + + return canBeAssignmentTarget(value) && hasExcessParens(value); + }).forEach(property => report(property.value)); + }, + + Property(node) { + if (node.computed) { + const { key } = node; + + if (key && hasExcessParensWithPrecedence(key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(key); + } + } + }, + + RestElement(node) { + const argument = node.argument; + + if (canBeAssignmentTarget(argument) && hasExcessParens(argument)) { + report(argument); + } + }, + + ReturnStatement(node) { + const returnToken = sourceCode.getFirstToken(node); + + if (isReturnAssignException(node)) { + return; + } + + if (node.argument && + hasExcessParensNoLineTerminator(returnToken, node.argument) && + + // RegExp literal is allowed to have parens (#1589) + !(node.argument.type === "Literal" && node.argument.regex)) { + report(node.argument); + } + }, + + SequenceExpression(node) { + const precedenceOfNode = precedence(node); + + node.expressions + .filter(e => hasExcessParensWithPrecedence(e, precedenceOfNode)) + .forEach(report); + }, + + SwitchCase(node) { + if (node.test && hasExcessParens(node.test)) { + report(node.test); + } + }, + + SwitchStatement(node) { + if (hasExcessParens(node.discriminant)) { + report(node.discriminant); + } + }, + + ThrowStatement(node) { + const throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { + report(node.argument); + } + }, + + UnaryExpression: checkArgumentWithPrecedence, + UpdateExpression: checkArgumentWithPrecedence, + AwaitExpression: checkArgumentWithPrecedence, + + VariableDeclarator(node) { + if ( + node.init && hasExcessParensWithPrecedence(node.init, PRECEDENCE_OF_ASSIGNMENT_EXPR) && + + // RegExp literal is allowed to have parens (#1589) + !(node.init.type === "Literal" && node.init.regex) + ) { + report(node.init); + } + }, + + WhileStatement(node) { + if (hasExcessParens(node.test) && !isCondAssignException(node)) { + report(node.test); + } + }, + + WithStatement(node) { + if (hasExcessParens(node.object)) { + report(node.object); + } + }, + + YieldExpression(node) { + if (node.argument) { + const yieldToken = sourceCode.getFirstToken(node); + + if ((precedence(node.argument) >= precedence(node) && + hasExcessParensNoLineTerminator(yieldToken, node.argument)) || + hasDoubleExcessParens(node.argument)) { + report(node.argument); + } + } + }, + + ClassDeclaration: checkClass, + ClassExpression: checkClass, + + SpreadElement: checkSpreadOperator, + SpreadProperty: checkSpreadOperator, + ExperimentalSpreadProperty: checkSpreadOperator, + + TemplateLiteral(node) { + node.expressions + .filter(e => e && hasExcessParens(e)) + .forEach(report); + }, + + AssignmentPattern(node) { + const { left, right } = node; + + if (canBeAssignmentTarget(left) && hasExcessParens(left)) { + report(left); + } + + if (right && hasExcessParensWithPrecedence(right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(right); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-extra-semi.js b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-semi.js new file mode 100644 index 0000000..e0a8df0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-extra-semi.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Rule to flag use of unnecessary semicolons + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary semicolons", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-extra-semi" + }, + + fixable: "code", + schema: [], + + messages: { + unexpected: "Unnecessary semicolon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports an unnecessary semicolon error. + * @param {Node|Token} nodeOrToken A node or a token to be reported. + * @returns {void} + */ + function report(nodeOrToken) { + context.report({ + node: nodeOrToken, + messageId: "unexpected", + fix(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, context.getSourceCode()) + .retainSurroundingTokens(nodeOrToken) + .remove(nodeOrToken); + } + }); + } + + /** + * Checks for a part of a class body. + * This checks tokens from a specified token to a next MethodDefinition or the end of class body. + * @param {Token} firstToken The first token to check. + * @returns {void} + */ + function checkForPartOfClassBody(firstToken) { + for (let token = firstToken; + token.type === "Punctuator" && !astUtils.isClosingBraceToken(token); + token = sourceCode.getTokenAfter(token) + ) { + if (astUtils.isSemicolonToken(token)) { + report(token); + } + } + } + + return { + + /** + * Reports this empty statement, except if the parent node is a loop. + * @param {Node} node A EmptyStatement node to be reported. + * @returns {void} + */ + EmptyStatement(node) { + const parent = node.parent, + allowedParentTypes = [ + "ForStatement", + "ForInStatement", + "ForOfStatement", + "WhileStatement", + "DoWhileStatement", + "IfStatement", + "LabeledStatement", + "WithStatement" + ]; + + if (allowedParentTypes.indexOf(parent.type) === -1) { + report(node); + } + }, + + /** + * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. + * @param {Node} node A ClassBody node to check. + * @returns {void} + */ + ClassBody(node) { + checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`. + }, + + /** + * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. + * @param {Node} node A MethodDefinition node of the start point. + * @returns {void} + */ + MethodDefinition(node) { + checkForPartOfClassBody(sourceCode.getTokenAfter(node)); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-fallthrough.js b/day1/cli-study/node_modules/eslint/lib/rules/no-fallthrough.js new file mode 100644 index 0000000..dd1f3ed --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-fallthrough.js @@ -0,0 +1,142 @@ +/** + * @fileoverview Rule to flag fall-through cases in switch statements. + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; + +/** + * Checks whether or not a given node has a fallthrough comment. + * @param {ASTNode} node A SwitchCase node to get comments. + * @param {RuleContext} context A rule context which stores comments. + * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. + * @returns {boolean} `true` if the node has a valid fallthrough comment. + */ +function hasFallthroughComment(node, context, fallthroughCommentPattern) { + const sourceCode = context.getSourceCode(); + const comment = lodash.last(sourceCode.getCommentsBefore(node)); + + return Boolean(comment && fallthroughCommentPattern.test(comment.value)); +} + +/** + * Checks whether or not a given code path segment is reachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Checks whether a node and a token are separated by blank lines + * @param {ASTNode} node The node to check + * @param {Token} token The token to compare against + * @returns {boolean} `true` if there are blank lines between node and token + */ +function hasBlankLinesBetween(node, token) { + return token.loc.start.line > node.loc.end.line + 1; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow fallthrough of `case` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-fallthrough" + }, + + schema: [ + { + type: "object", + properties: { + commentPattern: { + type: "string", + default: "" + } + }, + additionalProperties: false + } + ], + messages: { + case: "Expected a 'break' statement before 'case'.", + default: "Expected a 'break' statement before 'default'." + } + }, + + create(context) { + const options = context.options[0] || {}; + let currentCodePath = null; + const sourceCode = context.getSourceCode(); + + /* + * We need to use leading comments of the next SwitchCase node because + * trailing comments is wrong if semicolons are omitted. + */ + let fallthroughCase = null; + let fallthroughCommentPattern = null; + + if (options.commentPattern) { + fallthroughCommentPattern = new RegExp(options.commentPattern, "u"); + } else { + fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT; + } + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + SwitchCase(node) { + + /* + * Checks whether or not there is a fallthrough comment. + * And reports the previous fallthrough node if that does not exist. + */ + if (fallthroughCase && !hasFallthroughComment(node, context, fallthroughCommentPattern)) { + context.report({ + messageId: node.test ? "case" : "default", + node + }); + } + fallthroughCase = null; + }, + + "SwitchCase:exit"(node) { + const nextToken = sourceCode.getTokenAfter(node); + + /* + * `reachable` meant fall through because statements preceded by + * `break`, `return`, or `throw` are unreachable. + * And allows empty cases and the last case. + */ + if (currentCodePath.currentSegments.some(isReachable) && + (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) && + lodash.last(node.parent.cases) !== node) { + fallthroughCase = node; + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-floating-decimal.js b/day1/cli-study/node_modules/eslint/lib/rules/no-floating-decimal.js new file mode 100644 index 0000000..b1d8832 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow leading or trailing decimal points in numeric literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-floating-decimal" + }, + + schema: [], + fixable: "code", + messages: { + leading: "A leading decimal point can be confused with a dot.", + trailing: "A trailing decimal point can be confused with a dot." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Literal(node) { + + if (typeof node.value === "number") { + if (node.raw.startsWith(".")) { + context.report({ + node, + messageId: "leading", + fix(fixer) { + const tokenBefore = sourceCode.getTokenBefore(node); + const needsSpaceBefore = tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, `0${node.raw}`); + + return fixer.insertTextBefore(node, needsSpaceBefore ? " 0" : "0"); + } + }); + } + if (node.raw.indexOf(".") === node.raw.length - 1) { + context.report({ + node, + messageId: "trailing", + fix: fixer => fixer.insertTextAfter(node, "0") + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-func-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-func-assign.js new file mode 100644 index 0000000..33d0ad9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-func-assign.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Rule to flag use of function declaration identifiers as variables. + * @author Ian Christian Myers + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow reassigning `function` declarations", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-func-assign" + }, + + schema: [], + + messages: { + isAFunction: "'{{name}}' is a function." + } + }, + + create(context) { + + /** + * Reports a reference if is non initializer and writable. + * @param {References} references Collection of reference to check. + * @returns {void} + */ + function checkReference(references) { + astUtils.getModifyingReferences(references).forEach(reference => { + context.report({ + node: reference.identifier, + messageId: "isAFunction", + data: { + name: reference.identifier.name + } + }); + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "FunctionName") { + checkReference(variable.references); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + FunctionDeclaration: checkForFunction, + FunctionExpression: checkForFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-global-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-global-assign.js new file mode 100644 index 0000000..ea854c4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-global-assign.js @@ -0,0 +1,94 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-global-assign" + }, + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "globalShouldNotBeModified", + data: { + name: identifier.name + } + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-coercion.js b/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-coercion.js new file mode 100644 index 0000000..6d5ee61 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,300 @@ +/** + * @fileoverview A rule to disallow the type conversions with shorter notations. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u; +const ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; + +/** + * Parses and normalizes an option object. + * @param {Object} options An option object to parse. + * @returns {Object} The parsed and normalized option object. + */ +function parseOptions(options) { + return { + boolean: "boolean" in options ? options.boolean : true, + number: "number" in options ? options.number : true, + string: "string" in options ? options.string : true, + allow: options.allow || [] + }; +} + +/** + * Checks whether or not a node is a double logical nigating. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a double logical nigating. + */ +function isDoubleLogicalNegating(node) { + return ( + node.operator === "!" && + node.argument.type === "UnaryExpression" && + node.argument.operator === "!" + ); +} + +/** + * Checks whether or not a node is a binary negating of `.indexOf()` method calling. + * @param {ASTNode} node An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. + */ +function isBinaryNegatingOfIndexOf(node) { + return ( + node.operator === "~" && + node.argument.type === "CallExpression" && + node.argument.callee.type === "MemberExpression" && + node.argument.callee.property.type === "Identifier" && + INDEX_OF_PATTERN.test(node.argument.callee.property.name) + ); +} + +/** + * Checks whether or not a node is a multiplying by one. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a multiplying by one. + */ +function isMultiplyByOne(node) { + return node.operator === "*" && ( + node.left.type === "Literal" && node.left.value === 1 || + node.right.type === "Literal" && node.right.value === 1 + ); +} + +/** + * Checks whether the result of a node is numeric or not + * @param {ASTNode} node The node to test + * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call + */ +function isNumeric(node) { + return ( + node.type === "Literal" && typeof node.value === "number" || + node.type === "CallExpression" && ( + node.callee.name === "Number" || + node.callee.name === "parseInt" || + node.callee.name === "parseFloat" + ) + ); +} + +/** + * Returns the first non-numeric operand in a BinaryExpression. Designed to be + * used from bottom to up since it walks up the BinaryExpression trees using + * node.parent to find the result. + * @param {BinaryExpression} node The BinaryExpression node to be walked up on + * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null + */ +function getNonNumericOperand(node) { + const left = node.left, + right = node.right; + + if (right.type !== "BinaryExpression" && !isNumeric(right)) { + return right; + } + + if (left.type !== "BinaryExpression" && !isNumeric(left)) { + return left; + } + + return null; +} + +/** + * Checks whether a node is an empty string literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the passed in node is an + * empty string literal or not. + */ +function isEmptyString(node) { + return astUtils.isStringLiteral(node) && (node.value === "" || (node.type === "TemplateLiteral" && node.quasis.length === 1 && node.quasis[0].value.cooked === "")); +} + +/** + * Checks whether or not a node is a concatenating with an empty string. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a concatenating with an empty string. + */ +function isConcatWithEmptyString(node) { + return node.operator === "+" && ( + (isEmptyString(node.left) && !astUtils.isStringLiteral(node.right)) || + (isEmptyString(node.right) && !astUtils.isStringLiteral(node.left)) + ); +} + +/** + * Checks whether or not a node is appended with an empty string. + * @param {ASTNode} node An AssignmentExpression node to check. + * @returns {boolean} Whether or not the node is appended with an empty string. + */ +function isAppendEmptyString(node) { + return node.operator === "+=" && isEmptyString(node.right); +} + +/** + * Returns the operand that is not an empty string from a flagged BinaryExpression. + * @param {ASTNode} node The flagged BinaryExpression node to check. + * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression. + */ +function getNonEmptyOperand(node) { + return isEmptyString(node.left) ? node.right : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow shorthand type conversions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-coercion" + }, + + fixable: "code", + + schema: [{ + type: "object", + properties: { + boolean: { + type: "boolean", + default: true + }, + number: { + type: "boolean", + default: true + }, + string: { + type: "boolean", + default: true + }, + allow: { + type: "array", + items: { + enum: ALLOWABLE_OPERATORS + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + useRecommendation: "use `{{recommendation}}` instead." + } + }, + + create(context) { + const options = parseOptions(context.options[0] || {}); + const sourceCode = context.getSourceCode(); + + /** + * Reports an error and autofixes the node + * @param {ASTNode} node An ast node to report the error on. + * @param {string} recommendation The recommended code for the issue + * @param {bool} shouldFix Whether this report should fix the node + * @returns {void} + */ + function report(node, recommendation, shouldFix) { + context.report({ + node, + messageId: "useRecommendation", + data: { + recommendation + }, + fix(fixer) { + if (!shouldFix) { + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, recommendation) + ) { + return fixer.replaceText(node, ` ${recommendation}`); + } + return fixer.replaceText(node, recommendation); + } + }); + } + + return { + UnaryExpression(node) { + let operatorAllowed; + + // !!foo + operatorAllowed = options.allow.indexOf("!!") >= 0; + if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { + const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; + + report(node, recommendation, true); + } + + // ~foo.indexOf(bar) + operatorAllowed = options.allow.indexOf("~") >= 0; + if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { + const recommendation = `${sourceCode.getText(node.argument)} !== -1`; + + report(node, recommendation, false); + } + + // +foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { + const recommendation = `Number(${sourceCode.getText(node.argument)})`; + + report(node, recommendation, true); + } + }, + + // Use `:exit` to prevent double reporting + "BinaryExpression:exit"(node) { + let operatorAllowed; + + // 1 * foo + operatorAllowed = options.allow.indexOf("*") >= 0; + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); + + if (nonNumericOperand) { + const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; + + report(node, recommendation, true); + } + + // "" + foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { + const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; + + report(node, recommendation, true); + } + }, + + AssignmentExpression(node) { + + // foo += "" + const operatorAllowed = options.allow.indexOf("+") >= 0; + + if (!operatorAllowed && options.string && isAppendEmptyString(node)) { + const code = sourceCode.getText(getNonEmptyOperand(node)); + const recommendation = `${code} = String(${code})`; + + report(node, recommendation, true); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-globals.js b/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-globals.js new file mode 100644 index 0000000..d4bfa3a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,140 @@ +/** + * @fileoverview Rule to check for implicit global variables, functions and classes. + * @author Joshua Peek + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow declarations in the global scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implicit-globals" + }, + + schema: [{ + type: "object", + properties: { + lexicalBindings: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + globalNonLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.", + globalLexicalBinding: "Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.", + globalVariableLeak: "Global variable leak, declare the variable if it is intended to be local.", + assignmentToReadonlyGlobal: "Unexpected assignment to read-only global variable.", + redeclarationOfReadonlyGlobal: "Unexpected redeclaration of read-only global variable." + } + }, + + create(context) { + + const checkLexicalBindings = context.options[0] && context.options[0].lexicalBindings === true; + + /** + * Reports the node. + * @param {ASTNode} node Node to report. + * @param {string} messageId Id of the message to report. + * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class. + * @returns {void} + */ + function report(node, messageId, kind) { + context.report({ + node, + messageId, + data: { + kind + } + }); + } + + return { + Program() { + const scope = context.getScope(); + + scope.variables.forEach(variable => { + + // Only ESLint global variables have the `writable` key. + const isReadonlyEslintGlobalVariable = variable.writeable === false; + const isWritableEslintGlobalVariable = variable.writeable === true; + + if (isWritableEslintGlobalVariable) { + + // Everything is allowed with writable ESLint global variables. + return; + } + + variable.defs.forEach(def => { + const defNode = def.node; + + if (def.type === "FunctionName" || (def.type === "Variable" && def.parent.kind === "var")) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalNonLexicalBinding", + def.type === "FunctionName" ? "function" : `'${def.parent.kind}'` + ); + } + } + + if (checkLexicalBindings) { + if (def.type === "ClassName" || + (def.type === "Variable" && (def.parent.kind === "let" || def.parent.kind === "const"))) { + if (isReadonlyEslintGlobalVariable) { + report(defNode, "redeclarationOfReadonlyGlobal"); + } else { + report( + defNode, + "globalLexicalBinding", + def.type === "ClassName" ? "class" : `'${def.parent.kind}'` + ); + } + } + } + }); + }); + + // Undeclared assigned variables. + scope.implicit.variables.forEach(variable => { + const scopeVariable = scope.set.get(variable.name); + let messageId; + + if (scopeVariable) { + + // ESLint global variable + if (scopeVariable.writeable) { + return; + } + messageId = "assignmentToReadonlyGlobal"; + + } else { + + // Reference to an unknown variable, possible global leak. + messageId = "globalVariableLeak"; + } + + // def.node is an AssignmentExpression, ForInStatement or ForOfStatement. + variable.defs.forEach(def => { + report(def.node, messageId); + }); + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-implied-eval.js b/day1/cli-study/node_modules/eslint/lib/rules/no-implied-eval.js new file mode 100644 index 0000000..1668a04 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-implied-eval.js @@ -0,0 +1,152 @@ +/** + * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { getStaticValue } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `eval()`-like methods", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-implied-eval" + }, + + schema: [], + + messages: { + impliedEval: "Implied eval. Consider passing a function instead of a string." + } + }, + + create(context) { + const EVAL_LIKE_FUNCS = Object.freeze(["setTimeout", "execScript", "setInterval"]); + const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); + + /** + * Checks whether a node is evaluated as a string or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} True if the node is evaluated as a string. + */ + function isEvaluatedString(node) { + if ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ) { + return true; + } + if (node.type === "BinaryExpression" && node.operator === "+") { + return isEvaluatedString(node.left) || isEvaluatedString(node.right); + } + return false; + } + + /** + * Checks whether a node is an Identifier node named one of the specified names. + * @param {ASTNode} node A node to check. + * @param {string[]} specifiers Array of specified name. + * @returns {boolean} True if the node is a Identifier node which has specified name. + */ + function isSpecifiedIdentifier(node, specifiers) { + return node.type === "Identifier" && specifiers.includes(node.name); + } + + /** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * @param {ASTNode} node A node to check. + * @param {string[]} specifiers Array of specified name. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ + function isSpecifiedMember(node, specifiers) { + return node.type === "MemberExpression" && specifiers.includes(astUtils.getStaticPropertyName(node)); + } + + /** + * Reports if the `CallExpression` node has evaluated argument. + * @param {ASTNode} node A CallExpression to check. + * @returns {void} + */ + function reportImpliedEvalCallExpression(node) { + const [firstArgument] = node.arguments; + + if (firstArgument) { + + const staticValue = getStaticValue(firstArgument, context.getScope()); + const isStaticString = staticValue && typeof staticValue.value === "string"; + const isString = isStaticString || isEvaluatedString(firstArgument); + + if (isString) { + context.report({ + node, + messageId: "impliedEval" + }); + } + } + + } + + /** + * Reports calls of `implied eval` via the global references. + * @param {Variable} globalVar A global variable to check. + * @returns {void} + */ + function reportImpliedEvalViaGlobal(globalVar) { + const { references, name } = globalVar; + + references.forEach(ref => { + const identifier = ref.identifier; + let node = identifier.parent; + + while (isSpecifiedMember(node, [name])) { + node = node.parent; + } + + if (isSpecifiedMember(node, EVAL_LIKE_FUNCS)) { + const parent = node.parent; + + if (parent.type === "CallExpression" && parent.callee === node) { + reportImpliedEvalCallExpression(parent); + } + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + CallExpression(node) { + if (isSpecifiedIdentifier(node.callee, EVAL_LIKE_FUNCS)) { + reportImpliedEvalCallExpression(node); + } + }, + "Program:exit"() { + const globalScope = context.getScope(); + + GLOBAL_CANDIDATES + .map(candidate => astUtils.getVariableByName(globalScope, candidate)) + .filter(globalVar => !!globalVar && globalVar.defs.length === 0) + .forEach(reportImpliedEvalViaGlobal); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-import-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-import-assign.js new file mode 100644 index 0000000..32e445f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-import-assign.js @@ -0,0 +1,238 @@ +/** + * @fileoverview Rule to flag updates of imported bindings. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const { findVariable, getPropertyName } = require("eslint-utils"); + +const MutationMethods = { + Object: new Set([ + "assign", "defineProperties", "defineProperty", "freeze", + "setPrototypeOf" + ]), + Reflect: new Set([ + "defineProperty", "deleteProperty", "set", "setPrototypeOf" + ]) +}; + +/** + * Check if a given node is LHS of an assignment node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is LHS. + */ +function isAssignmentLeft(node) { + const { parent } = node; + + return ( + ( + parent.type === "AssignmentExpression" && + parent.left === node + ) || + + // Destructuring assignments + parent.type === "ArrayPattern" || + ( + parent.type === "Property" && + parent.value === node && + parent.parent.type === "ObjectPattern" + ) || + parent.type === "RestElement" || + ( + parent.type === "AssignmentPattern" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is the operand of mutation unary operator. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the operand of mutation unary operator. + */ +function isOperandOfMutationUnaryOperator(node) { + const { parent } = node; + + return ( + ( + parent.type === "UpdateExpression" && + parent.argument === node + ) || + ( + parent.type === "UnaryExpression" && + parent.operator === "delete" && + parent.argument === node + ) + ); +} + +/** + * Check if a given node is the iteration variable of `for-in`/`for-of` syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is the iteration variable. + */ +function isIterationVariable(node) { + const { parent } = node; + + return ( + ( + parent.type === "ForInStatement" && + parent.left === node + ) || + ( + parent.type === "ForOfStatement" && + parent.left === node + ) + ); +} + +/** + * Check if a given node is the iteration variable of `for-in`/`for-of` syntax. + * @param {ASTNode} node The node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the node is the iteration variable. + */ +function isArgumentOfWellKnownMutationFunction(node, scope) { + const { parent } = node; + + if ( + parent.type === "CallExpression" && + parent.arguments[0] === node && + parent.callee.type === "MemberExpression" && + parent.callee.object.type === "Identifier" + ) { + const { callee } = parent; + const { object } = callee; + + if (Object.keys(MutationMethods).includes(object.name)) { + const variable = findVariable(scope, object); + + return ( + variable !== null && + variable.scope.type === "global" && + MutationMethods[object.name].has(getPropertyName(callee, scope)) + ); + } + } + + return false; +} + +/** + * Check if the identifier node is placed at to update members. + * @param {ASTNode} id The Identifier node to check. + * @param {Scope} scope A `escope.Scope` object to find variable (whichever). + * @returns {boolean} `true` if the member of `id` was updated. + */ +function isMemberWrite(id, scope) { + const { parent } = id; + + return ( + ( + parent.type === "MemberExpression" && + parent.object === id && + ( + isAssignmentLeft(parent) || + isOperandOfMutationUnaryOperator(parent) || + isIterationVariable(parent) + ) + ) || + isArgumentOfWellKnownMutationFunction(id, scope) + ); +} + +/** + * Get the mutation node. + * @param {ASTNode} id The Identifier node to get. + * @returns {ASTNode} The mutation node. + */ +function getWriteNode(id) { + let node = id.parent; + + while ( + node && + node.type !== "AssignmentExpression" && + node.type !== "UpdateExpression" && + node.type !== "UnaryExpression" && + node.type !== "CallExpression" && + node.type !== "ForInStatement" && + node.type !== "ForOfStatement" + ) { + node = node.parent; + } + + return node || id; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assigning to imported bindings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-import-assign" + }, + + schema: [], + + messages: { + readonly: "'{{name}}' is read-only.", + readonlyMember: "The members of '{{name}}' are read-only." + } + }, + + create(context) { + return { + ImportDeclaration(node) { + const scope = context.getScope(); + + for (const variable of context.getDeclaredVariables(node)) { + const shouldCheckMembers = variable.defs.some( + d => d.node.type === "ImportNamespaceSpecifier" + ); + let prevIdNode = null; + + for (const reference of variable.references) { + const idNode = reference.identifier; + + /* + * AssignmentPattern (e.g. `[a = 0] = b`) makes two write + * references for the same identifier. This should skip + * the one of the two in order to prevent redundant reports. + */ + if (idNode === prevIdNode) { + continue; + } + prevIdNode = idNode; + + if (reference.isWrite()) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonly", + data: { name: idNode.name } + }); + } else if (shouldCheckMembers && isMemberWrite(idNode, scope)) { + context.report({ + node: getWriteNode(idNode), + messageId: "readonlyMember", + data: { name: idNode.name } + }); + } + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-inline-comments.js b/day1/cli-study/node_modules/eslint/lib/rules/no-inline-comments.js new file mode 100644 index 0000000..41b0f1e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-inline-comments.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Enforces or disallows inline comments. + * @author Greg Cochard + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow inline comments after code", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-inline-comments" + }, + + schema: [], + + messages: { + unexpectedInlineComment: "Unexpected comment inline with code." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Will check that comments are not on lines starting with or ending with code + * @param {ASTNode} node The comment node to check + * @private + * @returns {void} + */ + function testCodeAroundComment(node) { + + const startLine = String(sourceCode.lines[node.loc.start.line - 1]), + endLine = String(sourceCode.lines[node.loc.end.line - 1]), + preamble = startLine.slice(0, node.loc.start.column).trim(), + postamble = endLine.slice(node.loc.end.column).trim(), + isPreambleEmpty = !preamble, + isPostambleEmpty = !postamble; + + // Nothing on both sides + if (isPreambleEmpty && isPostambleEmpty) { + return; + } + + // JSX Exception + if ( + (isPreambleEmpty || preamble === "{") && + (isPostambleEmpty || postamble === "}") + ) { + const enclosingNode = sourceCode.getNodeByRangeIndex(node.range[0]); + + if (enclosingNode && enclosingNode.type === "JSXEmptyExpression") { + return; + } + } + + // Don't report ESLint directive comments + if (astUtils.isDirectiveComment(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedInlineComment" + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(testCodeAroundComment); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-inner-declarations.js b/day1/cli-study/node_modules/eslint/lib/rules/no-inner-declarations.js new file mode 100644 index 0000000..0768bc6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -0,0 +1,88 @@ +/** + * @fileoverview Rule to enforce declarations in program or function body root. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const validParent = new Set(["Program", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); +const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow variable or `function` declarations in nested blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-inner-declarations" + }, + + schema: [ + { + enum: ["functions", "both"] + } + ], + + messages: { + moveDeclToRoot: "Move {{type}} declaration to {{body}} root." + } + }, + + create(context) { + + /** + * Ensure that a given node is at a program or function body's root. + * @param {ASTNode} node Declaration node to check. + * @returns {void} + */ + function check(node) { + const parent = node.parent; + + if ( + parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type) + ) { + return; + } + + if (validParent.has(parent.type)) { + return; + } + + const upperFunction = astUtils.getUpperFunction(parent); + + context.report({ + node, + messageId: "moveDeclToRoot", + data: { + type: (node.type === "FunctionDeclaration" ? "function" : "variable"), + body: (upperFunction === null ? "program" : "function body") + } + }); + } + + + return { + + FunctionDeclaration: check, + VariableDeclaration(node) { + if (context.options[0] === "both" && node.kind === "var") { + check(node); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-regexp.js b/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-regexp.js new file mode 100644 index 0000000..48b7188 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Validate strings passed to the RegExp constructor + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const RegExpValidator = require("regexpp").RegExpValidator; +const validator = new RegExpValidator({ ecmaVersion: 2018 }); +const validFlags = /[gimuys]/gu; +const undefined1 = void 0; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow invalid regular expression strings in `RegExp` constructors", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-invalid-regexp" + }, + + schema: [{ + type: "object", + properties: { + allowConstructorFlags: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }], + + messages: { + regexMessage: "{{message}}." + } + }, + + create(context) { + + const options = context.options[0]; + let allowedFlags = null; + + if (options && options.allowConstructorFlags) { + const temp = options.allowConstructorFlags.join("").replace(validFlags, ""); + + if (temp) { + allowedFlags = new RegExp(`[${temp}]`, "giu"); + } + } + + /** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ + function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Check syntax error in a given pattern. + * @param {string} pattern The RegExp pattern to validate. + * @param {boolean} uFlag The Unicode flag. + * @returns {string|null} The syntax error. + */ + function validateRegExpPattern(pattern, uFlag) { + try { + validator.validatePattern(pattern, undefined1, undefined1, uFlag); + return null; + } catch (err) { + return err.message; + } + } + + /** + * Check syntax error in a given flags. + * @param {string} flags The RegExp flags to validate. + * @returns {string|null} The syntax error. + */ + function validateRegExpFlags(flags) { + try { + validator.validateFlags(flags); + return null; + } catch { + return `Invalid flags supplied to RegExp constructor '${flags}'`; + } + } + + return { + "CallExpression, NewExpression"(node) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp" || !isString(node.arguments[0])) { + return; + } + const pattern = node.arguments[0].value; + let flags = isString(node.arguments[1]) ? node.arguments[1].value : ""; + + if (allowedFlags) { + flags = flags.replace(allowedFlags, ""); + } + + // If flags are unknown, check both are errored or not. + const message = validateRegExpFlags(flags) || ( + flags + ? validateRegExpPattern(pattern, flags.indexOf("u") !== -1) + : validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) + ); + + if (message) { + context.report({ + node, + messageId: "regexMessage", + data: { message } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-this.js b/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-this.js new file mode 100644 index 0000000..a79c586 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,145 @@ +/** + * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `this` keywords outside of classes or class-like objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-invalid-this" + }, + + schema: [ + { + type: "object", + properties: { + capIsConstructor: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedThis: "Unexpected 'this'." + } + }, + + create(context) { + const options = context.options[0] || {}; + const capIsConstructor = options.capIsConstructor !== false; + const stack = [], + sourceCode = context.getSourceCode(); + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + const current = this[this.length - 1]; + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode, + { capIsConstructor } + ); + } + return current; + }; + + /** + * Pushs new checking context into the stack. + * + * The checking context is not initialized yet. + * Because most functions don't have `this` keyword. + * When `this` keyword was found, the checking context is initialized. + * @param {ASTNode} node A function node that was entered. + * @returns {void} + */ + function enterFunction(node) { + + // `this` can be invalid only under strict mode. + stack.push({ + init: !context.getScope().isStrict, + node, + valid: true + }); + } + + /** + * Pops the current checking context from the stack. + * @returns {void} + */ + function exitFunction() { + stack.pop(); + } + + return { + + /* + * `this` is invalid only under strict mode. + * Modules is always strict mode. + */ + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}; + + stack.push({ + init: true, + node, + valid: !( + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + }, + + "Program:exit"() { + stack.pop(); + }, + + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + + // Reports if `this` of the current context is invalid. + ThisExpression(node) { + const current = stack.getCurrent(); + + if (current && !current.valid) { + context.report({ + node, + messageId: "unexpectedThis" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/day1/cli-study/node_modules/eslint/lib/rules/no-irregular-whitespace.js new file mode 100644 index 0000000..2184233 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -0,0 +1,251 @@ +/** + * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed + * @author Jonathan Kingston + * @author Christophe Porteneuve + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u; +const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mgu; +const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/mgu; +const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow irregular whitespace", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-irregular-whitespace" + }, + + schema: [ + { + type: "object", + properties: { + skipComments: { + type: "boolean", + default: false + }, + skipStrings: { + type: "boolean", + default: true + }, + skipTemplates: { + type: "boolean", + default: false + }, + skipRegExps: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noIrregularWhitespace: "Irregular whitespace not allowed." + } + }, + + create(context) { + + // Module store of errors that we have found + let errors = []; + + // Lookup the `skipComments` option, which defaults to `false`. + const options = context.options[0] || {}; + const skipComments = !!options.skipComments; + const skipStrings = options.skipStrings !== false; + const skipRegExps = !!options.skipRegExps; + const skipTemplates = !!options.skipTemplates; + + const sourceCode = context.getSourceCode(); + const commentNodes = sourceCode.getAllComments(); + + /** + * Removes errors that occur inside a string node + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeWhitespaceError(node) { + const locStart = node.loc.start; + const locEnd = node.loc.end; + + errors = errors.filter(({ loc: errorLoc }) => { + if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { + if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { + return false; + } + } + return true; + }); + } + + /** + * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInIdentifierOrLiteral(node) { + const shouldCheckStrings = skipStrings && (typeof node.value === "string"); + const shouldCheckRegExps = skipRegExps && Boolean(node.regex); + + if (shouldCheckStrings || shouldCheckRegExps) { + + // If we have irregular characters remove them from the errors list + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInTemplateLiteral(node) { + if (typeof node.value.raw === "string") { + if (ALL_IRREGULARS.test(node.value.raw)) { + removeWhitespaceError(node); + } + } + } + + /** + * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInComment(node) { + if (ALL_IRREGULARS.test(node.value)) { + removeWhitespaceError(node); + } + } + + /** + * Checks the program source for irregular whitespace + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularWhitespace(node) { + const sourceLines = sourceCode.lines; + + sourceLines.forEach((sourceLine, lineIndex) => { + const lineNumber = lineIndex + 1; + let match; + + while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) { + const location = { + line: lineNumber, + column: match.index + }; + + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: location + }); + } + }); + } + + /** + * Checks the program source for irregular line terminators + * @param {ASTNode} node The program node + * @returns {void} + * @private + */ + function checkForIrregularLineTerminators(node) { + const source = sourceCode.getText(), + sourceLines = sourceCode.lines, + linebreaks = source.match(LINE_BREAK); + let lastLineIndex = -1, + match; + + while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) { + const lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; + const location = { + line: lineIndex + 1, + column: sourceLines[lineIndex].length + }; + + errors.push({ + node, + messageId: "noIrregularWhitespace", + loc: location + }); + lastLineIndex = lineIndex; + } + } + + /** + * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + + const nodes = {}; + + if (ALL_IRREGULARS.test(sourceCode.getText())) { + nodes.Program = function(node) { + + /* + * As we can easily fire warnings for all white space issues with + * all the source its simpler to fire them here. + * This means we can check all the application code without having + * to worry about issues caused in the parser tokens. + * When writing this code also evaluating per node was missing out + * connecting tokens in some cases. + * We can later filter the errors when they are found to be not an + * issue in nodes we don't care about. + */ + checkForIrregularWhitespace(node); + checkForIrregularLineTerminators(node); + }; + + nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop; + nodes["Program:exit"] = function() { + if (skipComments) { + + // First strip errors occurring in comment nodes. + commentNodes.forEach(removeInvalidNodeErrorsInComment); + } + + // If we have any errors remaining report on them + errors.forEach(error => context.report(error)); + }; + } else { + nodes.Program = noop; + } + + return nodes; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-iterator.js b/day1/cli-study/node_modules/eslint/lib/rules/no-iterator.js new file mode 100644 index 0000000..9ba1e7a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-iterator.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to flag usage of __iterator__ property + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__iterator__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-iterator" + }, + + schema: [], + + messages: { + noIterator: "Reserved name '__iterator__'." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + + if (getStaticPropertyName(node) === "__iterator__") { + context.report({ + node, + messageId: "noIterator" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-label-var.js b/day1/cli-study/node_modules/eslint/lib/rules/no-label-var.js new file mode 100644 index 0000000..570db03 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-label-var.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Rule to flag labels that are the same as an identifier + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labels that share a name with a variable", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-label-var" + }, + + schema: [], + + messages: { + identifierClashWithLabel: "Found identifier with same name as label." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the identifier is present inside current scope + * @param {Object} scope current scope + * @param {string} name To evaluate + * @returns {boolean} True if its present + * @private + */ + function findIdentifier(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + LabeledStatement(node) { + + // Fetch the innermost scope. + const scope = context.getScope(); + + /* + * Recursively find the identifier walking up the scope, starting + * with the innermost scope. + */ + if (findIdentifier(scope, node.label.name)) { + context.report({ + node, + messageId: "identifierClashWithLabel" + }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-labels.js b/day1/cli-study/node_modules/eslint/lib/rules/no-labels.js new file mode 100644 index 0000000..85760d8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-labels.js @@ -0,0 +1,149 @@ +/** + * @fileoverview Disallow Labeled Statements + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow labeled statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-labels" + }, + + schema: [ + { + type: "object", + properties: { + allowLoop: { + type: "boolean", + default: false + }, + allowSwitch: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedLabel: "Unexpected labeled statement.", + unexpectedLabelInBreak: "Unexpected label in break statement.", + unexpectedLabelInContinue: "Unexpected label in continue statement." + } + }, + + create(context) { + const options = context.options[0]; + const allowLoop = options && options.allowLoop; + const allowSwitch = options && options.allowSwitch; + let scopeInfo = null; + + /** + * Gets the kind of a given node. + * @param {ASTNode} node A node to get. + * @returns {string} The kind of the node. + */ + function getBodyKind(node) { + if (astUtils.isLoop(node)) { + return "loop"; + } + if (node.type === "SwitchStatement") { + return "switch"; + } + return "other"; + } + + /** + * Checks whether the label of a given kind is allowed or not. + * @param {string} kind A kind to check. + * @returns {boolean} `true` if the kind is allowed. + */ + function isAllowed(kind) { + switch (kind) { + case "loop": return allowLoop; + case "switch": return allowSwitch; + default: return false; + } + } + + /** + * Checks whether a given name is a label of a loop or not. + * @param {string} label A name of a label to check. + * @returns {boolean} `true` if the name is a label of a loop. + */ + function getKind(label) { + let info = scopeInfo; + + while (info) { + if (info.label === label) { + return info.kind; + } + info = info.upper; + } + + /* istanbul ignore next: syntax error */ + return "other"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + LabeledStatement(node) { + scopeInfo = { + label: node.label.name, + kind: getBodyKind(node.body), + upper: scopeInfo + }; + }, + + "LabeledStatement:exit"(node) { + if (!isAllowed(scopeInfo.kind)) { + context.report({ + node, + messageId: "unexpectedLabel" + }); + } + + scopeInfo = scopeInfo.upper; + }, + + BreakStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInBreak" + }); + } + }, + + ContinueStatement(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node, + messageId: "unexpectedLabelInContinue" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-lone-blocks.js b/day1/cli-study/node_modules/eslint/lib/rules/no-lone-blocks.js new file mode 100644 index 0000000..290784b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -0,0 +1,128 @@ +/** + * @fileoverview Rule to flag blocks with no reason to exist + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary nested blocks", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-lone-blocks" + }, + + schema: [], + + messages: { + redundantBlock: "Block is redundant.", + redundantNestedBlock: "Nested block is redundant." + } + }, + + create(context) { + + // A stack of lone blocks to be checked for block-level bindings + const loneBlocks = []; + let ruleDef; + + /** + * Reports a node as invalid. + * @param {ASTNode} node The node to be reported. + * @returns {void} + */ + function report(node) { + const messageId = node.parent.type === "BlockStatement" ? "redundantNestedBlock" : "redundantBlock"; + + context.report({ + node, + messageId + }); + } + + /** + * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear + * @param {ASTNode} node The node to check + * @returns {boolean} True if the node is a lone block. + */ + function isLoneBlock(node) { + return node.parent.type === "BlockStatement" || + node.parent.type === "Program" || + + // Don't report blocks in switch cases if the block is the only statement of the case. + node.parent.type === "SwitchCase" && !(node.parent.consequent[0] === node && node.parent.consequent.length === 1); + } + + /** + * Checks the enclosing block of the current node for block-level bindings, + * and "marks it" as valid if any. + * @returns {void} + */ + function markLoneBlock() { + if (loneBlocks.length === 0) { + return; + } + + const block = context.getAncestors().pop(); + + if (loneBlocks[loneBlocks.length - 1] === block) { + loneBlocks.pop(); + } + } + + // Default rule definition: report all lone blocks + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + report(node); + } + } + }; + + // ES6: report blocks without block-level bindings, or that's only child of another block + if (context.parserOptions.ecmaVersion >= 6) { + ruleDef = { + BlockStatement(node) { + if (isLoneBlock(node)) { + loneBlocks.push(node); + } + }, + "BlockStatement:exit"(node) { + if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) { + loneBlocks.pop(); + report(node); + } else if ( + node.parent.type === "BlockStatement" && + node.parent.body.length === 1 + ) { + report(node); + } + } + }; + + ruleDef.VariableDeclaration = function(node) { + if (node.kind === "let" || node.kind === "const") { + markLoneBlock(); + } + }; + + ruleDef.FunctionDeclaration = function() { + if (context.getScope().isStrict) { + markLoneBlock(); + } + }; + + ruleDef.ClassDeclaration = markLoneBlock; + } + + return ruleDef; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-lonely-if.js b/day1/cli-study/node_modules/eslint/lib/rules/no-lonely-if.js new file mode 100644 index 0000000..6552adc --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-lonely-if.js @@ -0,0 +1,89 @@ +/** + * @fileoverview Rule to disallow if as the only statement in an else block + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `if` statements as the only statement in `else` blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-lonely-if" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedLonelyIf: "Unexpected if as the only statement in an else block." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + IfStatement(node) { + const ancestors = context.getAncestors(), + parent = ancestors.pop(), + grandparent = ancestors.pop(); + + if (parent && parent.type === "BlockStatement" && + parent.body.length === 1 && grandparent && + grandparent.type === "IfStatement" && + parent === grandparent.alternate) { + context.report({ + node, + messageId: "unexpectedLonelyIf", + fix(fixer) { + const openingElseCurly = sourceCode.getFirstToken(parent); + const closingElseCurly = sourceCode.getLastToken(parent); + const elseKeyword = sourceCode.getTokenBefore(openingElseCurly); + const tokenAfterElseBlock = sourceCode.getTokenAfter(closingElseCurly); + const lastIfToken = sourceCode.getLastToken(node.consequent); + const sourceText = sourceCode.getText(); + + if (sourceText.slice(openingElseCurly.range[1], + node.range[0]).trim() || sourceText.slice(node.range[1], closingElseCurly.range[0]).trim()) { + + // Don't fix if there are any non-whitespace characters interfering (e.g. comments) + return null; + } + + if ( + node.consequent.type !== "BlockStatement" && lastIfToken.value !== ";" && tokenAfterElseBlock && + ( + node.consequent.loc.end.line === tokenAfterElseBlock.loc.start.line || + /^[([/+`-]/u.test(tokenAfterElseBlock.value) || + lastIfToken.value === "++" || + lastIfToken.value === "--" + ) + ) { + + /* + * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing + * the issue would not change semantics due to ASI. If this would happen, don't do a fix. + */ + return null; + } + + return fixer.replaceTextRange( + [openingElseCurly.range[0], closingElseCurly.range[1]], + (elseKeyword.range[1] === openingElseCurly.range[0] ? " " : "") + sourceCode.getText(node) + ); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-loop-func.js b/day1/cli-study/node_modules/eslint/lib/rules/no-loop-func.js new file mode 100644 index 0000000..13ebd3e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-loop-func.js @@ -0,0 +1,204 @@ +/** + * @fileoverview Rule to flag creation of function inside a loop + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * @param {ASTNode} node An AST node to get. + * @returns {ASTNode|null} The containing loop node of the specified node, or + * `null`. + */ +function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + + switch (parent.type) { + case "WhileStatement": + case "DoWhileStatement": + return parent; + + case "ForStatement": + + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + + case "ForInStatement": + case "ForOfStatement": + + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + + case "ArrowFunctionExpression": + case "FunctionExpression": + case "FunctionDeclaration": + + // We don't need to check nested functions. + return null; + + default: + break; + } + } + + return null; +} + +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param {ASTNode} node A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode A node that the result node should not + * include. + * @returns {ASTNode} The most outer loop node. + */ +function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + + return retv; +} + +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param {ASTNode} loopNode A containing loop node. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is safe or not. + */ +function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable && variable.defs[0]; + const declaration = definition && definition.parent; + const kind = (declaration && declaration.type === "VariableDeclaration") + ? declaration.kind + : ""; + + // Variables which are declared by `const` is safe. + if (kind === "const") { + return true; + } + + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === "let" && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode( + loopNode, + (kind === "let") ? declaration : null + ).range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safeafe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * @param {eslint-scope.Reference} upperRef A reference to check. + * @returns {boolean} `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + variable.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border + ); + } + + return Boolean(variable) && variable.references.every(isSafeReference); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow function declarations that contain unsafe references inside loop statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-loop-func" + }, + + schema: [], + + messages: { + unsafeRefs: "Function declared in a loop contains unsafe references to variable(s) {{ varNames }}." + } + }, + + create(context) { + + /** + * Reports functions which match the following condition: + * + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} Whether or not the node is within a loop. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; + } + + const references = context.getScope().through; + const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name); + + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: "unsafeRefs", + data: { varNames: `'${unsafeRefs.join("', '")}'` } + }); + } + } + + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-loss-of-precision.js b/day1/cli-study/node_modules/eslint/lib/rules/no-loss-of-precision.js new file mode 100644 index 0000000..b95677c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -0,0 +1,198 @@ +/** + * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime + * @author Jacob Moore + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow literal numbers that lose precision", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-loss-of-precision" + }, + schema: [], + messages: { + noLossOfPrecision: "This number literal will lose precision at runtime." + } + }, + + create(context) { + + /** + * Returns whether the node is number literal + * @param {Node} node the node literal being evaluated + * @returns {boolean} true if the node is a number literal + */ + function isNumber(node) { + return typeof node.value === "number"; + } + + + /** + * Checks whether the number is base ten + * @param {ASTNode} node the node being evaluated + * @returns {boolean} true if the node is in base ten + */ + function isBaseTen(node) { + const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"]; + + return prefixes.every(prefix => !node.raw.startsWith(prefix)) && + !/^0[0-7]+$/u.test(node.raw); + } + + /** + * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function notBaseTenLosesPrecision(node) { + const rawString = node.raw.toUpperCase(); + let base = 0; + + if (rawString.startsWith("0B")) { + base = 2; + } else if (rawString.startsWith("0X")) { + base = 16; + } else { + base = 8; + } + + return !rawString.endsWith(node.value.toString(base).toUpperCase()); + } + + /** + * Adds a decimal point to the numeric string at index 1 + * @param {string} stringNumber the numeric string without any decimal point + * @returns {string} the numeric string with a decimal point in the proper place + */ + function addDecimalPointToNumber(stringNumber) { + return `${stringNumber.slice(0, 1)}.${stringNumber.slice(1)}`; + } + + /** + * Returns the number stripped of leading zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeLeadingZeros(numberAsString) { + return numberAsString.replace(/^0*/u, ""); + } + + /** + * Returns the number stripped of trailing zeros + * @param {string} numberAsString the string representation of the number + * @returns {string} the stripped string + */ + function removeTrailingZeros(numberAsString) { + return numberAsString.replace(/0*$/u, ""); + } + + /** + * Converts an integer to to an object containing the the integer's coefficient and order of magnitude + * @param {string} stringInteger the string representation of the integer being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeInteger(stringInteger) { + const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger)); + + return { + magnitude: stringInteger.startsWith("0") ? stringInteger.length - 2 : stringInteger.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + } + + /** + * + * Converts a float to to an object containing the the floats's coefficient and order of magnitude + * @param {string} stringFloat the string representation of the float being converted + * @returns {Object} the object containing the the integer's coefficient and order of magnitude + */ + function normalizeFloat(stringFloat) { + const trimmedFloat = removeLeadingZeros(stringFloat); + + if (trimmedFloat.startsWith(".")) { + const decimalDigits = trimmedFloat.split(".").pop(); + const significantDigits = removeLeadingZeros(decimalDigits); + + return { + magnitude: significantDigits.length - decimalDigits.length - 1, + coefficient: addDecimalPointToNumber(significantDigits) + }; + + } + return { + magnitude: trimmedFloat.indexOf(".") - 1, + coefficient: addDecimalPointToNumber(trimmedFloat.replace(".", "")) + + }; + } + + + /** + * Converts a base ten number to proper scientific notation + * @param {string} stringNumber the string representation of the base ten number to be converted + * @returns {string} the number converted to scientific notation + */ + function convertNumberToScientificNotation(stringNumber) { + const splitNumber = stringNumber.replace("E", "e").split("e"); + const originalCoefficient = splitNumber[0]; + const normalizedNumber = stringNumber.includes(".") ? normalizeFloat(originalCoefficient) + : normalizeInteger(originalCoefficient); + const normalizedCoefficient = normalizedNumber.coefficient; + const magnitude = splitNumber.length > 1 ? (parseInt(splitNumber[1], 10) + normalizedNumber.magnitude) + : normalizedNumber.magnitude; + + return `${normalizedCoefficient}e${magnitude}`; + + } + + /** + * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function baseTenLosesPrecision(node) { + const normalizedRawNumber = convertNumberToScientificNotation(node.raw); + const requestedPrecision = normalizedRawNumber.split("e")[0].replace(".", "").length; + + if (requestedPrecision > 100) { + return true; + } + const storedNumber = node.value.toPrecision(requestedPrecision); + const normalizedStoredNumber = convertNumberToScientificNotation(storedNumber); + + return normalizedRawNumber !== normalizedStoredNumber; + } + + + /** + * Checks that the user-intended number equals the actual number after is has been converted to the Number type + * @param {Node} node the node being evaluated + * @returns {boolean} true if they do not match + */ + function losesPrecision(node) { + return isBaseTen(node) ? baseTenLosesPrecision(node) : notBaseTenLosesPrecision(node); + } + + + return { + Literal(node) { + if (node.value && isNumber(node) && losesPrecision(node)) { + context.report({ + messageId: "noLossOfPrecision", + node + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-magic-numbers.js b/day1/cli-study/node_modules/eslint/lib/rules/no-magic-numbers.js new file mode 100644 index 0000000..cd07f5c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) + * @author Vincent Lemeunier + */ + +"use strict"; + +const { isNumericLiteral } = require("./utils/ast-utils"); + +// Maximum array length by the ECMAScript Specification. +const MAX_ARRAY_LENGTH = 2 ** 32 - 1; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Convert the value to bigint if it's a string. Otherwise return the value as-is. + * @param {bigint|number|string} x The value to normalize. + * @returns {bigint|number} The normalized value. + */ +function normalizeIgnoreValue(x) { + if (typeof x === "string") { + return BigInt(x.slice(0, -1)); + } + return x; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow magic numbers", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-magic-numbers" + }, + + schema: [{ + type: "object", + properties: { + detectObjects: { + type: "boolean", + default: false + }, + enforceConst: { + type: "boolean", + default: false + }, + ignore: { + type: "array", + items: { + anyOf: [ + { type: "number" }, + { type: "string", pattern: "^[+-]?(?:0|[1-9][0-9]*)n$" } + ] + }, + uniqueItems: true + }, + ignoreArrayIndexes: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + useConst: "Number constants declarations must use 'const'.", + noMagic: "No magic number: {{raw}}." + } + }, + + create(context) { + const config = context.options[0] || {}, + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = (config.ignore || []).map(normalizeIgnoreValue), + ignoreArrayIndexes = !!config.ignoreArrayIndexes; + + const okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; + + /** + * Returns whether the rule is configured to ignore the given value + * @param {bigint|number} value The value to check + * @returns {boolean} true if the value is ignored + */ + function isIgnoredValue(value) { + return ignore.indexOf(value) !== -1; + } + + /** + * Returns whether the given node is used as a radix within parseInt() or Number.parseInt() + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is radix + */ + function isParseIntRadix(fullNumberNode) { + const parent = fullNumberNode.parent; + + return parent.type === "CallExpression" && fullNumberNode === parent.arguments[1] && + ( + parent.callee.name === "parseInt" || + ( + parent.callee.type === "MemberExpression" && + parent.callee.object.name === "Number" && + parent.callee.property.name === "parseInt" + ) + ); + } + + /** + * Returns whether the given node is a direct child of a JSX node. + * In particular, it aims to detect numbers used as prop values in JSX tags. + * Example: + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the node is a JSX number + */ + function isJSXNumber(fullNumberNode) { + return fullNumberNode.parent.type.indexOf("JSX") === 0; + } + + /** + * Returns whether the given node is used as an array index. + * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294". + * + * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties, + * which can be created and accessed on an array in addition to the array index properties, + * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc. + * + * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295, + * thus the maximum valid index is 2 ** 32 - 2 = 4294967294. + * + * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294". + * + * Valid examples: + * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n] + * a[-0] (same as a[0] because -0 coerces to "0") + * a[-0n] (-0n evaluates to 0n) + * + * Invalid examples: + * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1] + * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"]) + * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"]) + * a[1e310] (same as a["Infinity"]) + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @param {bigint|number} value Value expressed by the fullNumberNode + * @returns {boolean} true if the node is a valid array index + */ + function isArrayIndex(fullNumberNode, value) { + const parent = fullNumberNode.parent; + + return parent.type === "MemberExpression" && parent.property === fullNumberNode && + (Number.isInteger(value) || typeof value === "bigint") && + value >= 0 && value < MAX_ARRAY_LENGTH; + } + + return { + Literal(node) { + if (!isNumericLiteral(node)) { + return; + } + + let fullNumberNode; + let value; + let raw; + + // Treat unary minus as a part of the number + if (node.parent.type === "UnaryExpression" && node.parent.operator === "-") { + fullNumberNode = node.parent; + value = -node.value; + raw = `-${node.raw}`; + } else { + fullNumberNode = node; + value = node.value; + raw = node.raw; + } + + // Always allow radix arguments and JSX props + if ( + isIgnoredValue(value) || + isParseIntRadix(fullNumberNode) || + isJSXNumber(fullNumberNode) || + (ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) + ) { + return; + } + + const parent = fullNumberNode.parent; + + if (parent.type === "VariableDeclarator") { + if (enforceConst && parent.parent.kind !== "const") { + context.report({ + node: fullNumberNode, + messageId: "useConst" + }); + } + } else if ( + okTypes.indexOf(parent.type) === -1 || + (parent.type === "AssignmentExpression" && parent.left.type === "Identifier") + ) { + context.report({ + node: fullNumberNode, + messageId: "noMagic", + data: { + raw + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-misleading-character-class.js b/day1/cli-study/node_modules/eslint/lib/rules/no-misleading-character-class.js new file mode 100644 index 0000000..3d00461 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -0,0 +1,200 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Iterate character sequences of a given nodes. + * + * CharacterClassRange syntax can steal a part of character sequence, + * so this function reverts CharacterClassRange syntax and restore the sequence. + * @param {regexpp.AST.CharacterClassElement[]} nodes The node list to iterate character sequences. + * @returns {IterableIterator} The list of character sequences. + */ +function *iterateCharacterSequence(nodes) { + let seq = []; + + for (const node of nodes) { + switch (node.type) { + case "Character": + seq.push(node.value); + break; + + case "CharacterClassRange": + seq.push(node.min.value); + yield seq; + seq = [node.max.value]; + break; + + case "CharacterSet": + if (seq.length > 0) { + yield seq; + seq = []; + } + break; + + // no default + } + } + + if (seq.length > 0) { + yield seq; + } +} + +const hasCharacterSequence = { + surrogatePairWithoutUFlag(chars) { + return chars.some((c, i) => i !== 0 && isSurrogatePair(chars[i - 1], c)); + }, + + combiningClass(chars) { + return chars.some((c, i) => ( + i !== 0 && + isCombiningCharacter(c) && + !isCombiningCharacter(chars[i - 1]) + )); + }, + + emojiModifier(chars) { + return chars.some((c, i) => ( + i !== 0 && + isEmojiModifier(c) && + !isEmojiModifier(chars[i - 1]) + )); + }, + + regionalIndicatorSymbol(chars) { + return chars.some((c, i) => ( + i !== 0 && + isRegionalIndicatorSymbol(c) && + isRegionalIndicatorSymbol(chars[i - 1]) + )); + }, + + zwj(chars) { + const lastIndex = chars.length - 1; + + return chars.some((c, i) => ( + i !== 0 && + i !== lastIndex && + c === 0x200d && + chars[i - 1] !== 0x200d && + chars[i + 1] !== 0x200d + )); + } +}; + +const kinds = Object.keys(hasCharacterSequence); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow characters which are made with multiple code points in character class syntax", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-misleading-character-class" + }, + + schema: [], + + messages: { + surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.", + combiningClass: "Unexpected combined character in character class.", + emojiModifier: "Unexpected modified Emoji in character class.", + regionalIndicatorSymbol: "Unexpected national flag in character class.", + zwj: "Unexpected joined character sequence in character class." + } + }, + create(context) { + const parser = new RegExpParser(); + + /** + * Verify a given regular expression. + * @param {Node} node The node to report. + * @param {string} pattern The regular expression pattern to verify. + * @param {string} flags The flags of the regular expression. + * @returns {void} + */ + function verify(node, pattern, flags) { + const has = { + surrogatePairWithoutUFlag: false, + combiningClass: false, + variationSelector: false, + emojiModifier: false, + regionalIndicatorSymbol: false, + zwj: false + }; + let patternNode; + + try { + patternNode = parser.parsePattern( + pattern, + 0, + pattern.length, + flags.includes("u") + ); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(patternNode, { + onCharacterClassEnter(ccNode) { + for (const chars of iterateCharacterSequence(ccNode.elements)) { + for (const kind of kinds) { + has[kind] = has[kind] || hasCharacterSequence[kind](chars); + } + } + } + }); + + for (const kind of kinds) { + if (has[kind]) { + context.report({ node, messageId: kind }); + } + } + } + + return { + "Literal[regex]"(node) { + verify(node, node.regex.pattern, node.regex.flags); + }, + "Program"() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + + /* + * Iterate calls of RegExp. + * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`, + * `const {RegExp: a} = window; new a()`, etc... + */ + for (const { node } of tracker.iterateGlobalReferences({ + RegExp: { [CALL]: true, [CONSTRUCT]: true } + })) { + const [patternNode, flagsNode] = node.arguments; + const pattern = getStringIfConstant(patternNode, scope); + const flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + verify(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-operators.js b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-operators.js new file mode 100644 index 0000000..f0290e9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -0,0 +1,243 @@ +/** + * @fileoverview Rule to disallow mixed binary operators. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"]; +const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; +const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; +const LOGICAL_OPERATORS = ["&&", "||"]; +const RELATIONAL_OPERATORS = ["in", "instanceof"]; +const TERNARY_OPERATOR = ["?:"]; +const COALESCE_OPERATOR = ["??"]; +const ALL_OPERATORS = [].concat( + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS, + TERNARY_OPERATOR, + COALESCE_OPERATOR +); +const DEFAULT_GROUPS = [ + ARITHMETIC_OPERATORS, + BITWISE_OPERATORS, + COMPARISON_OPERATORS, + LOGICAL_OPERATORS, + RELATIONAL_OPERATORS +]; +const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u; + +/** + * Normalizes options. + * @param {Object|undefined} options A options object to normalize. + * @returns {Object} Normalized option object. + */ +function normalizeOptions(options = {}) { + const hasGroups = options.groups && options.groups.length > 0; + const groups = hasGroups ? options.groups : DEFAULT_GROUPS; + const allowSamePrecedence = options.allowSamePrecedence !== false; + + return { + groups, + allowSamePrecedence + }; +} + +/** + * Checks whether any group which includes both given operator exists or not. + * @param {Array.} groups A list of groups to check. + * @param {string} left An operator. + * @param {string} right Another operator. + * @returns {boolean} `true` if such group existed. + */ +function includesBothInAGroup(groups, left, right) { + return groups.some(group => group.indexOf(left) !== -1 && group.indexOf(right) !== -1); +} + +/** + * Checks whether the given node is a conditional expression and returns the test node else the left node. + * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node. + * This parent node can be BinaryExpression, LogicalExpression + * , or a ConditionalExpression node + * @returns {ASTNode} node the appropriate node(left or test). + */ +function getChildNode(node) { + return node.type === "ConditionalExpression" ? node.test : node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow mixed binary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-operators" + }, + + schema: [ + { + type: "object", + properties: { + groups: { + type: "array", + items: { + type: "array", + items: { enum: ALL_OPERATORS }, + minItems: 2, + uniqueItems: true + }, + uniqueItems: true + }, + allowSamePrecedence: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = normalizeOptions(context.options[0]); + + /** + * Checks whether a given node should be ignored by options or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node should be ignored. + */ + function shouldIgnore(node) { + const a = node; + const b = node.parent; + + return ( + !includesBothInAGroup(options.groups, a.operator, b.type === "ConditionalExpression" ? "?:" : b.operator) || + ( + options.allowSamePrecedence && + astUtils.getPrecedence(a) === astUtils.getPrecedence(b) + ) + ); + } + + /** + * Checks whether the operator of a given node is mixed with parent + * node's operator or not. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithParent(node) { + + return ( + node.operator !== node.parent.operator && + !astUtils.isParenthesised(sourceCode, node) + ); + } + + /** + * Checks whether the operator of a given node is mixed with a + * conditional expression. + * @param {ASTNode} node A node to check. This is a conditional + * expression node + * @returns {boolean} `true` if the node was mixed. + */ + function isMixedWithConditionalParent(node) { + return !astUtils.isParenthesised(sourceCode, node) && !astUtils.isParenthesised(sourceCode, node.test); + } + + /** + * Gets the operator token of a given node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. + * @returns {Token} The operator token of the node. + */ + function getOperatorToken(node) { + return sourceCode.getTokenAfter(getChildNode(node), astUtils.isNotClosingParenToken); + } + + /** + * Reports both the operator of a given node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. This is a BinaryExpression + * node or a LogicalExpression node. This parent node is one of + * them, too. + * @returns {void} + */ + function reportBothOperators(node) { + const parent = node.parent; + const left = (getChildNode(parent) === node) ? node : parent; + const right = (getChildNode(parent) !== node) ? node : parent; + const data = { + leftOperator: left.operator || "?:", + rightOperator: right.operator || "?:" + }; + + context.report({ + node: left, + loc: getOperatorToken(left).loc, + messageId: "unexpectedMixedOperator", + data + }); + context.report({ + node: right, + loc: getOperatorToken(right).loc, + messageId: "unexpectedMixedOperator", + data + }); + } + + /** + * Checks between the operator of this node and the operator of the + * parent node. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function check(node) { + if (TARGET_NODE_TYPE.test(node.parent.type)) { + if (node.parent.type === "ConditionalExpression" && !shouldIgnore(node) && isMixedWithConditionalParent(node.parent)) { + reportBothOperators(node); + } else { + if (TARGET_NODE_TYPE.test(node.parent.type) && + isMixedWithParent(node) && + !shouldIgnore(node) + ) { + reportBothOperators(node); + } + } + } + + } + + return { + BinaryExpression: check, + LogicalExpression: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-requires.js b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-requires.js new file mode 100644 index 0000000..a02de91 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-requires.js @@ -0,0 +1,237 @@ +/** + * @fileoverview Rule to enforce grouped require statements for Node.JS + * @author Raphael Pigulla + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `require` calls to be mixed with regular variable declarations", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-mixed-requires" + }, + + schema: [ + { + oneOf: [ + { + type: "boolean" + }, + { + type: "object", + properties: { + grouping: { + type: "boolean" + }, + allowCall: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + noMixRequire: "Do not mix 'require' and other declarations.", + noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." + } + }, + + create(context) { + + const options = context.options[0]; + let grouping = false, + allowCall = false; + + if (typeof options === "object") { + grouping = options.grouping; + allowCall = options.allowCall; + } else { + grouping = !!options; + } + + /** + * Returns the list of built-in modules. + * @returns {string[]} An array of built-in Node.js modules. + */ + function getBuiltinModules() { + + /* + * This list is generated using: + * `require("repl")._builtinLibs.concat('repl').sort()` + * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + */ + return [ + "assert", "buffer", "child_process", "cluster", "crypto", + "dgram", "dns", "domain", "events", "fs", "http", "https", + "net", "os", "path", "punycode", "querystring", "readline", + "repl", "smalloc", "stream", "string_decoder", "tls", "tty", + "url", "util", "v8", "vm", "zlib" + ]; + } + + const BUILTIN_MODULES = getBuiltinModules(); + + const DECL_REQUIRE = "require", + DECL_UNINITIALIZED = "uninitialized", + DECL_OTHER = "other"; + + const REQ_CORE = "core", + REQ_FILE = "file", + REQ_MODULE = "module", + REQ_COMPUTED = "computed"; + + /** + * Determines the type of a declaration statement. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The type of declaration represented by the expression. + */ + function getDeclarationType(initExpression) { + if (!initExpression) { + + // "var x;" + return DECL_UNINITIALIZED; + } + + if (initExpression.type === "CallExpression" && + initExpression.callee.type === "Identifier" && + initExpression.callee.name === "require" + ) { + + // "var x = require('util');" + return DECL_REQUIRE; + } + if (allowCall && + initExpression.type === "CallExpression" && + initExpression.callee.type === "CallExpression" + ) { + + // "var x = require('diagnose')('sub-module');" + return getDeclarationType(initExpression.callee); + } + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return getDeclarationType(initExpression.object); + } + + // "var x = 42;" + return DECL_OTHER; + } + + /** + * Determines the type of module that is loaded via require. + * @param {ASTNode} initExpression The init node of the VariableDeclarator. + * @returns {string} The module type. + */ + function inferModuleType(initExpression) { + if (initExpression.type === "MemberExpression") { + + // "var x = require('glob').Glob;" + return inferModuleType(initExpression.object); + } + if (initExpression.arguments.length === 0) { + + // "var x = require();" + return REQ_COMPUTED; + } + + const arg = initExpression.arguments[0]; + + if (arg.type !== "Literal" || typeof arg.value !== "string") { + + // "var x = require(42);" + return REQ_COMPUTED; + } + + if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { + + // "var fs = require('fs');" + return REQ_CORE; + } + if (/^\.{0,2}\//u.test(arg.value)) { + + // "var utils = require('./utils');" + return REQ_FILE; + } + + // "var async = require('async');" + return REQ_MODULE; + + } + + /** + * Check if the list of variable declarations is mixed, i.e. whether it + * contains both require and other declarations. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are mixed, false if not. + */ + function isMixed(declarations) { + const contains = {}; + + declarations.forEach(declaration => { + const type = getDeclarationType(declaration.init); + + contains[type] = true; + }); + + return !!( + contains[DECL_REQUIRE] && + (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) + ); + } + + /** + * Check if all require declarations in the given list are of the same + * type. + * @param {ASTNode} declarations The list of VariableDeclarators. + * @returns {boolean} True if the declarations are grouped, false if not. + */ + function isGrouped(declarations) { + const found = {}; + + declarations.forEach(declaration => { + if (getDeclarationType(declaration.init) === DECL_REQUIRE) { + found[inferModuleType(declaration.init)] = true; + } + }); + + return Object.keys(found).length <= 1; + } + + + return { + + VariableDeclaration(node) { + + if (isMixed(node.declarations)) { + context.report({ + node, + messageId: "noMixRequire" + }); + } else if (grouping && !isGrouped(node.declarations)) { + context.report({ + node, + messageId: "noMixCoreModuleFileComputed" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js new file mode 100644 index 0000000..287cbda --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Disallow mixed spaces and tabs for indentation + * @author Jary Niebur + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow mixed spaces and tabs for indentation", + category: "Stylistic Issues", + recommended: true, + url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs" + }, + + schema: [ + { + enum: ["smart-tabs", true, false] + } + ], + + messages: { + mixedSpacesAndTabs: "Mixed spaces and tabs." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + let smartTabs; + + switch (context.options[0]) { + case true: // Support old syntax, maybe add deprecation warning here + case "smart-tabs": + smartTabs = true; + break; + default: + smartTabs = false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + "Program:exit"(node) { + const lines = sourceCode.lines, + comments = sourceCode.getAllComments(), + ignoredCommentLines = new Set(); + + // Add all lines except the first ones. + comments.forEach(comment => { + for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) { + ignoredCommentLines.add(i); + } + }); + + /* + * At least one space followed by a tab + * or the reverse before non-tab/-space + * characters begin. + */ + let regex = /^(?=( +|\t+))\1(?:\t| )/u; + + if (smartTabs) { + + /* + * At least one space followed by a tab + * before non-tab/-space characters begin. + */ + regex = /^(?=(\t*))\1(?=( +))\2\t/u; + } + + lines.forEach((line, i) => { + const match = regex.exec(line); + + if (match) { + const lineNumber = i + 1; + const loc = { + start: { + line: lineNumber, + column: match[0].length - 2 + }, + end: { + line: lineNumber, + column: match[0].length + } + }; + + if (!ignoredCommentLines.has(lineNumber)) { + const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start)); + + if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) { + context.report({ + node, + loc, + messageId: "mixedSpacesAndTabs" + }); + } + } + } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-multi-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-assign.js new file mode 100644 index 0000000..ab6430c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-assign.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to check use of chained assignment expressions + * @author Stewart Rand + */ + +"use strict"; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of chained assignment expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-assign" + }, + + schema: [], + + messages: { + unexpectedChain: "Unexpected chained assignment." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + AssignmentExpression(node) { + if (["AssignmentExpression", "VariableDeclarator"].indexOf(node.parent.type) !== -1) { + context.report({ + node, + messageId: "unexpectedChain" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-multi-spaces.js b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-spaces.js new file mode 100644 index 0000000..d43ed73 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Disallow use of multiple spaces. + * @author Nicholas C. Zakas + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple spaces", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "object", + patternProperties: { + "^([A-Z][a-z]*)+$": { + type: "boolean" + } + }, + additionalProperties: false + }, + ignoreEOLComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + multipleSpaces: "Multiple spaces found before '{{displayValue}}'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const ignoreEOLComments = options.ignoreEOLComments; + const exceptions = Object.assign({ Property: true }, options.exceptions); + const hasExceptions = Object.keys(exceptions).filter(key => exceptions[key]).length > 0; + + /** + * Formats value of given comment token for error message by truncating its length. + * @param {Token} token comment token + * @returns {string} formatted value + * @private + */ + function formatReportedCommentValue(token) { + const valueLines = token.value.split("\n"); + const value = valueLines[0]; + const formattedValue = `${value.slice(0, 12)}...`; + + return valueLines.length === 1 && value.length <= 12 ? value : formattedValue; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program() { + sourceCode.tokensAndComments.forEach((leftToken, leftIndex, tokensAndComments) => { + if (leftIndex === tokensAndComments.length - 1) { + return; + } + const rightToken = tokensAndComments[leftIndex + 1]; + + // Ignore tokens that don't have 2 spaces between them or are on different lines + if ( + !sourceCode.text.slice(leftToken.range[1], rightToken.range[0]).includes(" ") || + leftToken.loc.end.line < rightToken.loc.start.line + ) { + return; + } + + // Ignore comments that are the last token on their line if `ignoreEOLComments` is active. + if ( + ignoreEOLComments && + astUtils.isCommentToken(rightToken) && + ( + leftIndex === tokensAndComments.length - 2 || + rightToken.loc.end.line < tokensAndComments[leftIndex + 2].loc.start.line + ) + ) { + return; + } + + // Ignore tokens that are in a node in the "exceptions" object + if (hasExceptions) { + const parentNode = sourceCode.getNodeByRangeIndex(rightToken.range[0] - 1); + + if (parentNode && exceptions[parentNode.type]) { + return; + } + } + + let displayValue; + + if (rightToken.type === "Block") { + displayValue = `/*${formatReportedCommentValue(rightToken)}*/`; + } else if (rightToken.type === "Line") { + displayValue = `//${formatReportedCommentValue(rightToken)}`; + } else { + displayValue = rightToken.value; + } + + context.report({ + node: rightToken, + loc: { start: leftToken.loc.end, end: rightToken.loc.start }, + messageId: "multipleSpaces", + data: { displayValue }, + fix: fixer => fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ") + }); + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-multi-str.js b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-str.js new file mode 100644 index 0000000..7cf1ae3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-multi-str.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to flag when using multiline strings + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiline strings", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-multi-str" + }, + + schema: [], + + messages: { + multilineString: "Multiline support is limited to browsers supporting ES5 only." + } + }, + + create(context) { + + /** + * Determines if a given node is part of JSX syntax. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a JSX node, false if not. + * @private + */ + function isJSXElement(node) { + return node.type.indexOf("JSX") === 0; + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + Literal(node) { + if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) { + context.report({ + node, + messageId: "multilineString" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/day1/cli-study/node_modules/eslint/lib/rules/no-multiple-empty-lines.js new file mode 100644 index 0000000..9cccef3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Disallows multiple blank lines. + * implementation adapted from the no-trailing-spaces rule. + * @author Greg Cochard + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow multiple empty lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-multiple-empty-lines" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + max: { + type: "integer", + minimum: 0 + }, + maxEOF: { + type: "integer", + minimum: 0 + }, + maxBOF: { + type: "integer", + minimum: 0 + } + }, + required: ["max"], + additionalProperties: false + } + ], + + messages: { + blankBeginningOfFile: "Too many blank lines at the beginning of file. Max of {{max}} allowed.", + blankEndOfFile: "Too many blank lines at the end of file. Max of {{max}} allowed.", + consecutiveBlank: "More than {{max}} blank {{pluralizedLines}} not allowed." + } + }, + + create(context) { + + // Use options.max or 2 as default + let max = 2, + maxEOF = max, + maxBOF = max; + + if (context.options.length) { + max = context.options[0].max; + maxEOF = typeof context.options[0].maxEOF !== "undefined" ? context.options[0].maxEOF : max; + maxBOF = typeof context.options[0].maxBOF !== "undefined" ? context.options[0].maxBOF : max; + } + + const sourceCode = context.getSourceCode(); + + // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue + const allLines = sourceCode.lines[sourceCode.lines.length - 1] === "" ? sourceCode.lines.slice(0, -1) : sourceCode.lines; + const templateLiteralLines = new Set(); + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + TemplateLiteral(node) { + node.quasis.forEach(literalPart => { + + // Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines. + for (let ignoredLine = literalPart.loc.start.line; ignoredLine < literalPart.loc.end.line; ignoredLine++) { + templateLiteralLines.add(ignoredLine); + } + }); + }, + "Program:exit"(node) { + return allLines + + // Given a list of lines, first get a list of line numbers that are non-empty. + .reduce((nonEmptyLineNumbers, line, index) => { + if (line.trim() || templateLiteralLines.has(index + 1)) { + nonEmptyLineNumbers.push(index + 1); + } + return nonEmptyLineNumbers; + }, []) + + // Add a value at the end to allow trailing empty lines to be checked. + .concat(allLines.length + 1) + + // Given two line numbers of non-empty lines, report the lines between if the difference is too large. + .reduce((lastLineNumber, lineNumber) => { + let messageId, maxAllowed; + + if (lastLineNumber === 0) { + messageId = "blankBeginningOfFile"; + maxAllowed = maxBOF; + } else if (lineNumber === allLines.length + 1) { + messageId = "blankEndOfFile"; + maxAllowed = maxEOF; + } else { + messageId = "consecutiveBlank"; + maxAllowed = max; + } + + if (lineNumber - lastLineNumber - 1 > maxAllowed) { + context.report({ + node, + loc: { + start: { line: lastLineNumber + maxAllowed + 1, column: 0 }, + end: { line: lineNumber, column: 0 } + }, + messageId, + data: { + max: maxAllowed, + pluralizedLines: maxAllowed === 1 ? "line" : "lines" + }, + fix(fixer) { + const rangeStart = sourceCode.getIndexFromLoc({ line: lastLineNumber + 1, column: 0 }); + + /* + * The end of the removal range is usually the start index of the next line. + * However, at the end of the file there is no next line, so the end of the + * range is just the length of the text. + */ + const lineNumberAfterRemovedLines = lineNumber - maxAllowed; + const rangeEnd = lineNumberAfterRemovedLines <= allLines.length + ? sourceCode.getIndexFromLoc({ line: lineNumberAfterRemovedLines, column: 0 }) + : sourceCode.text.length; + + return fixer.removeRange([rangeStart, rangeEnd]); + } + }); + } + + return lineNumber; + }, 0); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-native-reassign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-native-reassign.js new file mode 100644 index 0000000..833e3b7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-native-reassign.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Rule to disallow assignments to native objects or read-only global variables + * @author Ilya Volodin + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignments to native objects or read-only global variables", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-native-reassign" + }, + + deprecated: true, + + replacedBy: ["no-global-assign"], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { type: "string" }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + nativeReassign: "Read-only global '{{name}}' should not be modified." + } + }, + + create(context) { + const config = context.options[0]; + const exceptions = (config && config.exceptions) || []; + + /** + * Reports write references. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + messageId: "nativeReassign", + data: identifier + }); + } + } + + /** + * Reports write references if a given variable is read-only builtin. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } + + return { + Program() { + const globalScope = context.getScope(); + + globalScope.variables.forEach(checkVariable); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-negated-condition.js b/day1/cli-study/node_modules/eslint/lib/rules/no-negated-condition.js new file mode 100644 index 0000000..8a9eba8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-negated-condition.js @@ -0,0 +1,95 @@ +/** + * @fileoverview Rule to disallow a negated condition + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow negated conditions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-condition" + }, + + schema: [], + + messages: { + unexpectedNegated: "Unexpected negated condition." + } + }, + + create(context) { + + /** + * Determines if a given node is an if-else without a condition on the else + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has an else without an if. + * @private + */ + function hasElseWithoutCondition(node) { + return node.alternate && node.alternate.type !== "IfStatement"; + } + + /** + * Determines if a given node is a negated unary expression + * @param {Object} test The test object to check. + * @returns {boolean} True if the node is a negated unary expression. + * @private + */ + function isNegatedUnaryExpression(test) { + return test.type === "UnaryExpression" && test.operator === "!"; + } + + /** + * Determines if a given node is a negated binary expression + * @param {Test} test The test to check. + * @returns {boolean} True if the node is a negated binary expression. + * @private + */ + function isNegatedBinaryExpression(test) { + return test.type === "BinaryExpression" && + (test.operator === "!=" || test.operator === "!=="); + } + + /** + * Determines if a given node has a negated if expression + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has a negated if expression. + * @private + */ + function isNegatedIf(node) { + return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); + } + + return { + IfStatement(node) { + if (!hasElseWithoutCondition(node)) { + return; + } + + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + }, + ConditionalExpression(node) { + if (isNegatedIf(node)) { + context.report({ + node, + messageId: "unexpectedNegated" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/day1/cli-study/node_modules/eslint/lib/rules/no-negated-in-lhs.js new file mode 100644 index 0000000..1229ced --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -0,0 +1,46 @@ +/** + * @fileoverview A rule to disallow negated left operands of the `in` operator + * @author Michael Ficarra + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand in `in` expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-negated-in-lhs" + }, + + replacedBy: ["no-unsafe-negation"], + + deprecated: true, + schema: [], + + messages: { + negatedLHS: "The 'in' expression's left operand is negated." + } + }, + + create(context) { + + return { + + BinaryExpression(node) { + if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { + context.report({ node, messageId: "negatedLHS" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-nested-ternary.js b/day1/cli-study/node_modules/eslint/lib/rules/no-nested-ternary.js new file mode 100644 index 0000000..383bb23 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to flag nested ternary expressions + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow nested ternary expressions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-nested-ternary" + }, + + schema: [], + + messages: { + noNestedTernary: "Do not nest ternary expressions." + } + }, + + create(context) { + + return { + ConditionalExpression(node) { + if (node.alternate.type === "ConditionalExpression" || + node.consequent.type === "ConditionalExpression") { + context.report({ + node, + messageId: "noNestedTernary" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new-func.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new-func.js new file mode 100644 index 0000000..9af4e31 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new-func.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Rule to flag when using new Function + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `Function` object", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-func" + }, + + schema: [], + + messages: { + noFunctionConstructor: "The Function constructor is eval." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Function"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const { parent } = node; + + if ( + parent && + (parent.type === "NewExpression" || parent.type === "CallExpression") && + node === parent.callee + ) { + context.report({ + node: parent, + messageId: "noFunctionConstructor" + }); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new-object.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new-object.js new file mode 100644 index 0000000..e9f915d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new-object.js @@ -0,0 +1,57 @@ +/** + * @fileoverview A rule to disallow calls to the Object constructor + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `Object` constructors", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-object" + }, + + schema: [], + + messages: { + preferLiteral: "The object literal notation {} is preferrable." + } + }, + + create(context) { + return { + NewExpression(node) { + const variable = astUtils.getVariableByName( + context.getScope(), + node.callee.name + ); + + if (variable && variable.identifiers.length > 0) { + return; + } + + if (node.callee.name === "Object") { + context.report({ + node, + messageId: "preferLiteral" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new-require.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new-require.js new file mode 100644 index 0000000..063f783 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new-require.js @@ -0,0 +1,49 @@ +/** + * @fileoverview Rule to disallow use of new operator with the `require` function + * @author Wil Moore III + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow `new` operators with calls to `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-require" + }, + + schema: [], + + messages: { + noNewRequire: "Unexpected use of new with require." + } + }, + + create(context) { + + return { + + NewExpression(node) { + if (node.callee.type === "Identifier" && node.callee.name === "require") { + context.report({ + node, + messageId: "noNewRequire" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new-symbol.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new-symbol.js new file mode 100644 index 0000000..aeb509c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,54 @@ +/** + * @fileoverview Rule to disallow use of the new operator with the `Symbol` object + * @author Alberto Rodríguez + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `new` operators with the `Symbol` object", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-new-symbol" + }, + + schema: [], + + messages: { + noNewSymbol: "`Symbol` cannot be called as a constructor." + } + }, + + create(context) { + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const variable = globalScope.set.get("Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const node = ref.identifier; + const parent = node.parent; + + if (parent && parent.type === "NewExpression" && parent.callee === node) { + context.report({ + node, + messageId: "noNewSymbol" + }); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new-wrappers.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new-wrappers.js new file mode 100644 index 0000000..d276c48 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using constructor for wrapper objects + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new-wrappers" + }, + + schema: [], + + messages: { + noConstructor: "Do not use {{fn}} as a constructor." + } + }, + + create(context) { + + return { + + NewExpression(node) { + const wrapperObjects = ["String", "Number", "Boolean"]; + + if (wrapperObjects.indexOf(node.callee.name) > -1) { + context.report({ + node, + messageId: "noConstructor", + data: { fn: node.callee.name } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-new.js b/day1/cli-study/node_modules/eslint/lib/rules/no-new.js new file mode 100644 index 0000000..aa8a4e2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-new.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Rule to flag statements with function invocation preceded by + * "new" and not part of assignment + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `new` operators outside of assignments or comparisons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-new" + }, + + schema: [], + + messages: { + noNewStatement: "Do not use 'new' for side effects." + } + }, + + create(context) { + + return { + "ExpressionStatement > NewExpression"(node) { + context.report({ + node: node.parent, + messageId: "noNewStatement" + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-obj-calls.js b/day1/cli-study/node_modules/eslint/lib/rules/no-obj-calls.js new file mode 100644 index 0000000..6139ba2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-obj-calls.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker } = require("eslint-utils"); +const getPropertyName = require("./utils/ast-utils").getStaticPropertyName; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect"]; + +/** + * Returns the name of the node to report + * @param {ASTNode} node A node to report + * @returns {string} name to report + */ +function getReportNodeName(node) { + if (node.callee.type === "MemberExpression") { + return getPropertyName(node.callee); + } + return node.callee.name; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling global object properties as functions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-obj-calls" + }, + + schema: [], + + messages: { + unexpectedCall: "'{{name}}' is not a function.", + unexpectedRefCall: "'{{name}}' is reference to '{{ref}}', which is not a function." + } + }, + + create(context) { + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = {}; + + for (const g of nonCallableGlobals) { + traceMap[g] = { + [CALL]: true, + [CONSTRUCT]: true + }; + } + + for (const { node, path } of tracker.iterateGlobalReferences(traceMap)) { + const name = getReportNodeName(node); + const ref = path[0]; + const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; + + context.report({ node, messageId, data: { name, ref } }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-octal-escape.js b/day1/cli-study/node_modules/eslint/lib/rules/no-octal-escape.js new file mode 100644 index 0000000..5b4c7b2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-octal-escape.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Rule to flag octal escape sequences in string literals. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal escape sequences in string literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-octal-escape" + }, + + schema: [], + + messages: { + octalEscapeSequence: "Don't use octal: '\\{{sequence}}'. Use '\\u....' instead." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value !== "string") { + return; + } + + // \0 represents a valid NULL character if it isn't followed by a digit. + const match = node.raw.match( + /^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su + ); + + if (match) { + context.report({ + node, + messageId: "octalEscapeSequence", + data: { sequence: match[1] } + }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-octal.js b/day1/cli-study/node_modules/eslint/lib/rules/no-octal.js new file mode 100644 index 0000000..e9940be --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-octal.js @@ -0,0 +1,45 @@ +/** + * @fileoverview Rule to flag when initializing octal literal + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow octal literals", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-octal" + }, + + schema: [], + + messages: { + noOcatal: "Octal literals should not be used." + } + }, + + create(context) { + + return { + + Literal(node) { + if (typeof node.value === "number" && /^0[0-9]/u.test(node.raw)) { + context.report({ + node, + messageId: "noOcatal" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-param-reassign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-param-reassign.js new file mode 100644 index 0000000..6874af4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-param-reassign.js @@ -0,0 +1,229 @@ +/** + * @fileoverview Disallow reassignment of function parameters. + * @author Nat Burns + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow reassigning `function` parameters", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-param-reassign" + }, + + schema: [ + { + oneOf: [ + { + type: "object", + properties: { + props: { + enum: [false] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + props: { + enum: [true] + }, + ignorePropertyModificationsFor: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + ignorePropertyModificationsForRegex: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + assignmentToFunctionParam: "Assignment to function parameter '{{name}}'.", + assignmentToFunctionParamProp: "Assignment to property of function parameter '{{name}}'." + } + }, + + create(context) { + const props = context.options[0] && context.options[0].props; + const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; + const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; + + /** + * Checks whether or not the reference modifies properties of its variable. + * @param {Reference} reference A reference to check. + * @returns {boolean} Whether or not the reference modifies properties of its variable. + */ + function isModifyingProp(reference) { + let node = reference.identifier; + let parent = node.parent; + + while (parent && (!stopNodePattern.test(parent.type) || + parent.type === "ForInStatement" || parent.type === "ForOfStatement")) { + switch (parent.type) { + + // e.g. foo.a = 0; + case "AssignmentExpression": + return parent.left === node; + + // e.g. ++foo.a; + case "UpdateExpression": + return true; + + // e.g. delete foo.a; + case "UnaryExpression": + if (parent.operator === "delete") { + return true; + } + break; + + // e.g. for (foo.a in b) {} + case "ForInStatement": + case "ForOfStatement": + if (parent.left === node) { + return true; + } + + // this is a stop node for parent.right and parent.body + return false; + + // EXCLUDES: e.g. cache.get(foo.a).b = 0; + case "CallExpression": + if (parent.callee !== node) { + return false; + } + break; + + // EXCLUDES: e.g. cache[foo.a] = 0; + case "MemberExpression": + if (parent.property === node) { + return false; + } + break; + + // EXCLUDES: e.g. ({ [foo]: a }) = bar; + case "Property": + if (parent.key === node) { + return false; + } + + break; + + // EXCLUDES: e.g. (foo ? a : b).c = bar; + case "ConditionalExpression": + if (parent.test === node) { + return false; + } + + break; + + // no default + } + + node = parent; + parent = node.parent; + } + + return false; + } + + /** + * Tests that an identifier name matches any of the ignored property assignments. + * First we test strings in ignoredPropertyAssignmentsFor. + * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings. + * @param {string} identifierName A string that describes the name of an identifier to + * ignore property assignments for. + * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not. + */ + function isIgnoredPropertyAssignment(identifierName) { + return ignoredPropertyAssignmentsFor.includes(identifierName) || + ignoredPropertyAssignmentsForRegex.some(ignored => new RegExp(ignored, "u").test(identifierName)); + } + + /** + * Reports a reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + const identifier = reference.identifier; + + if (identifier && + !reference.init && + + /* + * Destructuring assignments can have multiple default value, + * so possibly there are multiple writeable references for the same identifier. + */ + (index === 0 || references[index - 1].identifier !== identifier) + ) { + if (reference.isWrite()) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParam", + data: { name: identifier.name } + }); + } else if (props && isModifyingProp(reference) && !isIgnoredPropertyAssignment(identifier.name)) { + context.report({ + node: identifier, + messageId: "assignmentToFunctionParamProp", + data: { name: identifier.name } + }); + } + } + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "Parameter") { + variable.references.forEach(checkReference); + } + } + + /** + * Checks parameters of a given function node. + * @param {ASTNode} node A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + + // `:exit` is needed for the `node.parent` property of identifier nodes. + "FunctionDeclaration:exit": checkForFunction, + "FunctionExpression:exit": checkForFunction, + "ArrowFunctionExpression:exit": checkForFunction + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-path-concat.js b/day1/cli-study/node_modules/eslint/lib/rules/no-path-concat.js new file mode 100644 index 0000000..fc1f894 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-path-concat.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Disallow string concatenation when using __dirname and __filename + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow string concatenation with `__dirname` and `__filename`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-path-concat" + }, + + schema: [], + + messages: { + usePathFunctions: "Use path.join() or path.resolve() instead of + to create paths." + } + }, + + create(context) { + + const MATCHER = /^__(?:dir|file)name$/u; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + BinaryExpression(node) { + + const left = node.left, + right = node.right; + + if (node.operator === "+" && + ((left.type === "Identifier" && MATCHER.test(left.name)) || + (right.type === "Identifier" && MATCHER.test(right.name))) + ) { + + context.report({ + node, + messageId: "usePathFunctions" + }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-plusplus.js b/day1/cli-study/node_modules/eslint/lib/rules/no-plusplus.js new file mode 100644 index 0000000..84d6c3e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-plusplus.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to flag use of unary increment and decrement operators. + * @author Ian Christian Myers + * @author Brody McKee (github.com/mrmckeb) + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is the update node of a `ForStatement`. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `ForStatement` update. + */ +function isForStatementUpdate(node) { + const parent = node.parent; + + return parent.type === "ForStatement" && parent.update === node; +} + +/** + * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule. + * In particular, it returns `true` if the given node is either: + * - The update node of a `ForStatement`: for (;; i++) {} + * - An operand of a sequence expression that is the update node: for (;; foo(), i++) {} + * - An operand of a sequence expression that is child of another sequence expression, etc., + * up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {} + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a for loop afterthought. + */ +function isForLoopAfterthought(node) { + const parent = node.parent; + + if (parent.type === "SequenceExpression") { + return isForLoopAfterthought(parent); + } + + return isForStatementUpdate(node); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the unary operators `++` and `--`", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-plusplus" + }, + + schema: [ + { + type: "object", + properties: { + allowForLoopAfterthoughts: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnaryOp: "Unary operator '{{operator}}' used." + } + }, + + create(context) { + + const config = context.options[0]; + let allowForLoopAfterthoughts = false; + + if (typeof config === "object") { + allowForLoopAfterthoughts = config.allowForLoopAfterthoughts === true; + } + + return { + + UpdateExpression(node) { + if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) { + return; + } + + context.report({ + node, + messageId: "unexpectedUnaryOp", + data: { + operator: node.operator + } + }); + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-process-env.js b/day1/cli-study/node_modules/eslint/lib/rules/no-process-env.js new file mode 100644 index 0000000..49d1734 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-process-env.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow the use of process.env() + * @author Vignesh Anand + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.env`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-env" + }, + + schema: [], + + messages: { + unexpectedProcessEnv: "Unexpected use of process.env." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + const objectName = node.object.name, + propertyName = node.property.name; + + if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { + context.report({ node, messageId: "unexpectedProcessEnv" }); + } + + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-process-exit.js b/day1/cli-study/node_modules/eslint/lib/rules/no-process-exit.js new file mode 100644 index 0000000..77c9cfd --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-process-exit.js @@ -0,0 +1,46 @@ +/** + * @fileoverview Disallow the use of process.exit() + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow the use of `process.exit()`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-process-exit" + }, + + schema: [], + + messages: { + noProcessExit: "Don't use process.exit(); throw an error instead." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(node) { + context.report({ node: node.parent, messageId: "noProcessExit" }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-promise-executor-return.js b/day1/cli-study/node_modules/eslint/lib/rules/no-promise-executor-return.js new file mode 100644 index 0000000..32ee6e1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-promise-executor-return.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to disallow returning values from Promise executor functions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const functionTypesToCheck = new Set(["ArrowFunctionExpression", "FunctionExpression"]); + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + return upper; +} + +/** + * Determines whether the given function node is used as a Promise executor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Function's own scope. + * @returns {boolean} `true` if the node is a Promise executor. + */ +function isPromiseExecutor(node, scope) { + const parent = node.parent; + + return parent.type === "NewExpression" && + parent.arguments[0] === node && + parent.callee.type === "Identifier" && + parent.callee.name === "Promise" && + isGlobalReference(parent.callee, getOuterScope(scope)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from Promise executor functions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-promise-executor-return" + }, + + schema: [], + + messages: { + returnsValue: "Return values from promise executor functions cannot be read." + } + }, + + create(context) { + + let funcInfo = null; + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + onCodePathStart(_, node) { + funcInfo = { + upper: funcInfo, + shouldCheck: functionTypesToCheck.has(node.type) && isPromiseExecutor(node, context.getScope()) + }; + + if (funcInfo.shouldCheck && node.type === "ArrowFunctionExpression" && node.expression) { + report(node.body); + } + }, + + onCodePathEnd() { + funcInfo = funcInfo.upper; + }, + + ReturnStatement(node) { + if (funcInfo.shouldCheck && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-proto.js b/day1/cli-study/node_modules/eslint/lib/rules/no-proto.js new file mode 100644 index 0000000..82ce02f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-proto.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag usage of __proto__ property + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticPropertyName } = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of the `__proto__` property", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-proto" + }, + + schema: [], + + messages: { + unexpectedProto: "The '__proto__' property is deprecated." + } + }, + + create(context) { + + return { + + MemberExpression(node) { + if (getStaticPropertyName(node) === "__proto__") { + context.report({ node, messageId: "unexpectedProto" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-prototype-builtins.js b/day1/cli-study/node_modules/eslint/lib/rules/no-prototype-builtins.js new file mode 100644 index 0000000..a00d370 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -0,0 +1,61 @@ +/** + * @fileoverview Rule to disallow use of Object.prototype builtins on objects + * @author Andrew Levine + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow calling some `Object.prototype` methods directly on objects", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-prototype-builtins" + }, + + schema: [], + + messages: { + prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object." + } + }, + + create(context) { + const DISALLOWED_PROPS = [ + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable" + ]; + + /** + * Reports if a disallowed property is used in a CallExpression + * @param {ASTNode} node The CallExpression node. + * @returns {void} + */ + function disallowBuiltIns(node) { + if (node.callee.type !== "MemberExpression" || node.callee.computed) { + return; + } + const propName = node.callee.property.name; + + if (DISALLOWED_PROPS.indexOf(propName) > -1) { + context.report({ + messageId: "prototypeBuildIn", + loc: node.callee.property.loc, + data: { prop: propName }, + node + }); + } + } + + return { + CallExpression: disallowBuiltIns + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-redeclare.js b/day1/cli-study/node_modules/eslint/lib/rules/no-redeclare.js new file mode 100644 index 0000000..6ddb21c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-redeclare.js @@ -0,0 +1,172 @@ +/** + * @fileoverview Rule to flag when the same variable is declared more then once. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable redeclaration", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-redeclare" + }, + + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration." + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: true } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const options = { + builtinGlobals: Boolean( + context.options.length === 0 || + context.options[0].builtinGlobals + ) + }; + const sourceCode = context.getSourceCode(); + + /** + * Iterate declarations of a given variable. + * @param {escope.variable} variable The variable object to iterate declarations. + * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations. + */ + function *iterateDeclarations(variable) { + if (options.builtinGlobals && ( + variable.eslintImplicitGlobalSetting === "readonly" || + variable.eslintImplicitGlobalSetting === "writable" + )) { + yield { type: "builtin" }; + } + + for (const id of variable.identifiers) { + yield { type: "syntax", node: id, loc: id.loc }; + } + + if (variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + type: "comment", + node: comment, + loc: astUtils.getNameLocationInGlobalDirectiveComment( + sourceCode, + comment, + variable.name + ) + }; + } + } + } + + /** + * Find variables in a given scope and flag redeclared ones. + * @param {Scope} scope An eslint-scope scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [ + declaration, + ...extraDeclarations + ] = iterateDeclarations(variable); + + if (extraDeclarations.length === 0) { + continue; + } + + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === "builtin" + ? "redeclaredAsBuiltin" + : "redeclaredBySyntax"; + const data = { id: variable.name }; + + // Report extra declarations. + for (const { type, node, loc } of extraDeclarations) { + const messageId = type === declaration.type + ? "redeclared" + : detailMessageId; + + context.report({ node, loc, messageId, data }); + } + } + } + + /** + * Find variables in the current scope. + * @param {ASTNode} node The node of the current scope. + * @returns {void} + * @private + */ + function checkForBlock(node) { + const scope = context.getScope(); + + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + + return { + Program() { + const scope = context.getScope(); + + findVariablesInScope(scope); + + // Node.js or ES modules has a special scope. + if ( + scope.type === "global" && + scope.childScopes[0] && + + // The special scope's block is the Program node. + scope.block === scope.childScopes[0].block + ) { + findVariablesInScope(scope.childScopes[0]); + } + }, + + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + ArrowFunctionExpression: checkForBlock, + + BlockStatement: checkForBlock, + ForStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + SwitchStatement: checkForBlock + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-regex-spaces.js b/day1/cli-study/node_modules/eslint/lib/rules/no-regex-spaces.js new file mode 100644 index 0000000..e6d4c9e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-regex-spaces.js @@ -0,0 +1,180 @@ +/** + * @fileoverview Rule to count multiple spaces in regular expressions + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const regExpParser = new regexpp.RegExpParser(); +const DOUBLE_SPACE = / {2}/u; + +/** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ +function isString(node) { + return node && node.type === "Literal" && typeof node.value === "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow multiple spaces in regular expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-regex-spaces" + }, + + schema: [], + fixable: "code", + + messages: { + multipleSpaces: "Spaces are hard to count. Use {{{length}}}." + } + }, + + create(context) { + + /** + * Validate regular expression + * @param {ASTNode} nodeToReport Node to report. + * @param {string} pattern Regular expression pattern to validate. + * @param {string} rawPattern Raw representation of the pattern in the source code. + * @param {number} rawPatternStartRange Start range of the pattern in the source code. + * @param {string} flags Regular expression flags. + * @returns {void} + * @private + */ + function checkRegex(nodeToReport, pattern, rawPattern, rawPatternStartRange, flags) { + + // Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ '). + if (!DOUBLE_SPACE.test(rawPattern)) { + return; + } + + const characterClassNodes = []; + let regExpAST; + + try { + regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + regexpp.visitRegExpAST(regExpAST, { + onCharacterClassEnter(ccNode) { + characterClassNodes.push(ccNode); + } + }); + + const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu; + let match; + + while ((match = spacesPattern.exec(pattern))) { + const { 1: { length }, index } = match; + + // Report only consecutive spaces that are not in character classes. + if ( + characterClassNodes.every(({ start, end }) => index < start || end <= index) + ) { + context.report({ + node: nodeToReport, + messageId: "multipleSpaces", + data: { length }, + fix(fixer) { + if (pattern !== rawPattern) { + return null; + } + return fixer.replaceTextRange( + [rawPatternStartRange + index, rawPatternStartRange + index + length], + ` {${length}}` + ); + } + }); + + // Report only the first occurrence of consecutive spaces + return; + } + } + } + + /** + * Validate regular expression literals + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkLiteral(node) { + if (node.regex) { + const pattern = node.regex.pattern; + const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/")); + const rawPatternStartRange = node.range[0] + 1; + const flags = node.regex.flags; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + /** + * Validate strings passed to the RegExp constructor + * @param {ASTNode} node node to validate + * @returns {void} + * @private + */ + function checkFunction(node) { + const scope = context.getScope(); + const regExpVar = astUtils.getVariableByName(scope, "RegExp"); + const shadowed = regExpVar && regExpVar.defs.length > 0; + const patternNode = node.arguments[0]; + const flagsNode = node.arguments[1]; + + if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(patternNode) && !shadowed) { + const pattern = patternNode.value; + const rawPattern = patternNode.raw.slice(1, -1); + const rawPatternStartRange = patternNode.range[0] + 1; + const flags = isString(flagsNode) ? flagsNode.value : ""; + + checkRegex( + node, + pattern, + rawPattern, + rawPatternStartRange, + flags + ); + } + } + + return { + Literal: checkLiteral, + CallExpression: checkFunction, + NewExpression: checkFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-exports.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-exports.js new file mode 100644 index 0000000..6031e26 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to disallow specified names in exports + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified names in exports", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-exports" + }, + + schema: [{ + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + restrictedNamed: "'{{name}}' is restricted from being used as an exported name." + } + }, + + create(context) { + + const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + + /** + * Checks and reports given exported identifier. + * @param {ASTNode} node exported `Identifer` node to check. + * @returns {void} + */ + function checkExportedName(node) { + const name = node.name; + + if (restrictedNames.has(name)) { + context.report({ + node, + messageId: "restrictedNamed", + data: { name } + }); + } + } + + return { + ExportAllDeclaration(node) { + if (node.exported) { + checkExportedName(node.exported); + } + }, + + ExportNamedDeclaration(node) { + const declaration = node.declaration; + + if (declaration) { + if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") { + checkExportedName(declaration.id); + } else if (declaration.type === "VariableDeclaration") { + context.getDeclaredVariables(declaration) + .map(v => v.defs.find(d => d.parent === declaration)) + .map(d => d.name) // Identifier nodes + .forEach(checkExportedName); + } + } else { + node.specifiers + .map(s => s.exported) + .forEach(checkExportedName); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-globals.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-globals.js new file mode 100644 index 0000000..2c932a7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -0,0 +1,122 @@ +/** + * @fileoverview Restrict usage of specified globals. + * @author Benoît Zugmeyer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified global variables", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-globals" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { type: "string" } + }, + required: ["name"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + defaultMessage: "Unexpected use of '{{name}}'.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" + } + }, + + create(context) { + + // If no globals are restricted, we don't need to do anything + if (context.options.length === 0) { + return {}; + } + + const restrictedGlobalMessages = context.options.reduce((memo, option) => { + if (typeof option === "string") { + memo[option] = null; + } else { + memo[option.name] = option.message; + } + + return memo; + }, {}); + + /** + * Report a variable to be used as a restricted global. + * @param {Reference} reference the variable reference + * @returns {void} + * @private + */ + function reportReference(reference) { + const name = reference.identifier.name, + customMessage = restrictedGlobalMessages[name], + messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node: reference.identifier, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted global name. + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted global or not + * @private + */ + function isRestricted(name) { + return Object.prototype.hasOwnProperty.call(restrictedGlobalMessages, name); + } + + return { + Program() { + const scope = context.getScope(); + + // Report variables declared elsewhere (ex: variables defined as "global" by eslint) + scope.variables.forEach(variable => { + if (!variable.defs.length && isRestricted(variable.name)) { + variable.references.forEach(reportReference); + } + }); + + // Report variables not declared at all + scope.through.forEach(reference => { + if (isRestricted(reference.identifier.name)) { + reportReference(reference); + } + }); + + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-imports.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-imports.js new file mode 100644 index 0000000..c205dad --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -0,0 +1,268 @@ +/** + * @fileoverview Restrict usage of specified node imports. + * @author Guy Ellis + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + }, + importNames: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `import`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-imports" + }, + + messages: { + path: "'{{importSource}}' import is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}", + + patterns: "'{{importSource}}' import is restricted from being used by a pattern.", + + everything: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + everythingWithCustomMessage: "* import is invalid because '{{importNames}}' from '{{importSource}}' is restricted. {{customMessage}}", + + importName: "'{{importName}}' import from '{{importSource}}' is restricted.", + // eslint-disable-next-line eslint-plugin/report-message-format + importNameWithCustomMessage: "'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: [{ + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }], + additionalItems: false + } + ] + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const restrictedPathMessages = restrictedPaths.reduce((memo, importSource) => { + if (typeof importSource === "string") { + memo[importSource] = { message: null }; + } else { + memo[importSource.name] = { + message: importSource.message, + importNames: importSource.importNames + }; + } + return memo; + }, {}); + + const restrictedPatternsMatcher = ignore().add(restrictedPatterns); + + /** + * Report a restricted path. + * @param {string} importSource path of the import + * @param {Map} importNames Map of import names that are being imported + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function checkRestrictedPathAndReport(importSource, importNames, node) { + if (!Object.prototype.hasOwnProperty.call(restrictedPathMessages, importSource)) { + return; + } + + const customMessage = restrictedPathMessages[importSource].message; + const restrictedImportNames = restrictedPathMessages[importSource].importNames; + + if (restrictedImportNames) { + if (importNames.has("*")) { + const specifierData = importNames.get("*")[0]; + + context.report({ + node, + messageId: customMessage ? "everythingWithCustomMessage" : "everything", + loc: specifierData.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } + + restrictedImportNames.forEach(importName => { + if (importNames.has(importName)) { + const specifiers = importNames.get(importName); + + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "importNameWithCustomMessage" : "importName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "pathWithCustomMessage" : "path", + data: { + importSource, + customMessage + } + }); + } + } + + /** + * Report a restricted path specifically for patterns. + * @param {node} node representing the restricted path reference + * @returns {void} + * @private + */ + function reportPathForPatterns(node) { + const importSource = node.source.value.trim(); + + context.report({ + node, + messageId: "patterns", + data: { + importSource + } + }); + } + + /** + * Check if the given importSource is restricted by a pattern. + * @param {string} importSource path of the import + * @returns {boolean} whether the variable is a restricted pattern or not + * @private + */ + function isRestrictedPattern(importSource) { + return restrictedPatterns.length > 0 && restrictedPatternsMatcher.ignores(importSource); + } + + /** + * Checks a node to see if any problems should be reported. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkNode(node) { + const importSource = node.source.value.trim(); + const importNames = new Map(); + + if (node.type === "ExportAllDeclaration") { + const starToken = sourceCode.getFirstToken(node, 1); + + importNames.set("*", [{ loc: starToken.loc }]); + } else if (node.specifiers) { + for (const specifier of node.specifiers) { + let name; + const specifierData = { loc: specifier.loc }; + + if (specifier.type === "ImportDefaultSpecifier") { + name = "default"; + } else if (specifier.type === "ImportNamespaceSpecifier") { + name = "*"; + } else if (specifier.imported) { + name = specifier.imported.name; + } else if (specifier.local) { + name = specifier.local.name; + } + + if (name) { + if (importNames.has(name)) { + importNames.get(name).push(specifierData); + } else { + importNames.set(name, [specifierData]); + } + } + } + } + + checkRestrictedPathAndReport(importSource, importNames, node); + + if (isRestrictedPattern(importSource)) { + reportPathForPatterns(node); + } + } + + return { + ImportDeclaration: checkNode, + ExportNamedDeclaration(node) { + if (node.source) { + checkNode(node); + } + }, + ExportAllDeclaration: checkNode + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-modules.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-modules.js new file mode 100644 index 0000000..d0b8a78 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -0,0 +1,214 @@ +/** + * @fileoverview Restrict usage of specified node modules. + * @author Christian Schulz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const ignore = require("ignore"); + +const arrayOfStrings = { + type: "array", + items: { type: "string" }, + uniqueItems: true +}; + +const arrayOfStringsOrObjects = { + type: "array", + items: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + name: { type: "string" }, + message: { + type: "string", + minLength: 1 + } + }, + additionalProperties: false, + required: ["name"] + } + ] + }, + uniqueItems: true +}; + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow specified modules when loaded by `require`", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-modules" + }, + + schema: { + anyOf: [ + arrayOfStringsOrObjects, + { + type: "array", + items: { + type: "object", + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStrings + }, + additionalProperties: false + }, + additionalItems: false + } + ] + }, + + messages: { + defaultMessage: "'{{name}}' module is restricted from being used.", + // eslint-disable-next-line eslint-plugin/report-message-format + customMessage: "'{{name}}' module is restricted from being used. {{customMessage}}", + patternMessage: "'{{name}}' module is restricted from being used by a pattern." + } + }, + + create(context) { + const options = Array.isArray(context.options) ? context.options : []; + const isPathAndPatternsObject = + typeof options[0] === "object" && + (Object.prototype.hasOwnProperty.call(options[0], "paths") || Object.prototype.hasOwnProperty.call(options[0], "patterns")); + + const restrictedPaths = (isPathAndPatternsObject ? options[0].paths : context.options) || []; + const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + + const restrictedPathMessages = restrictedPaths.reduce((memo, importName) => { + if (typeof importName === "string") { + memo[importName] = null; + } else { + memo[importName.name] = importName.message; + } + return memo; + }, {}); + + // if no imports are restricted we don"t need to check + if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { + return {}; + } + + const ig = ignore().add(restrictedPatterns); + + + /** + * Function to check if a node is a string literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string literal. + */ + function isStringLiteral(node) { + return node && node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Function to check if a node is a static string template literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string template literal. + */ + function isStaticTemplateLiteral(node) { + return node && node.type === "TemplateLiteral" && node.expressions.length === 0; + } + + /** + * Function to check if a node is a require call. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a require call. + */ + function isRequireCall(node) { + return node.callee.type === "Identifier" && node.callee.name === "require"; + } + + /** + * Extract string from Literal or TemplateLiteral node + * @param {ASTNode} node The node to extract from + * @returns {string|null} Extracted string or null if node doesn't represent a string + */ + function getFirstArgumentString(node) { + if (isStringLiteral(node)) { + return node.value.trim(); + } + + if (isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked.trim(); + } + + return null; + } + + /** + * Report a restricted path. + * @param {node} node representing the restricted path reference + * @param {string} name restricted path + * @returns {void} + * @private + */ + function reportPath(node, name) { + const customMessage = restrictedPathMessages[name]; + const messageId = customMessage + ? "customMessage" + : "defaultMessage"; + + context.report({ + node, + messageId, + data: { + name, + customMessage + } + }); + } + + /** + * Check if the given name is a restricted path name + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted path or not + * @private + */ + function isRestrictedPath(name) { + return Object.prototype.hasOwnProperty.call(restrictedPathMessages, name); + } + + return { + CallExpression(node) { + if (isRequireCall(node)) { + + // node has arguments + if (node.arguments.length) { + const name = getFirstArgumentString(node.arguments[0]); + + // if first argument is a string literal or a static string template literal + if (name) { + + // check if argument value is in restricted modules array + if (isRestrictedPath(name)) { + reportPath(node, name); + } + + if (restrictedPatterns.length > 0 && ig.ignores(name)) { + context.report({ + node, + messageId: "patternMessage", + data: { name } + }); + } + } + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-properties.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-properties.js new file mode 100644 index 0000000..7ab8399 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to disallow certain object properties + * @author Will Klein & Eli White + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow certain properties on certain objects", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-properties" + }, + + schema: { + type: "array", + items: { + anyOf: [ // `object` and `property` are both optional, but at least one of them must be provided. + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["object"] + }, + { + type: "object", + properties: { + object: { + type: "string" + }, + property: { + type: "string" + }, + message: { + type: "string" + } + }, + additionalProperties: false, + required: ["property"] + } + ] + }, + uniqueItems: true + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}", + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}" + } + }, + + create(context) { + const restrictedCalls = context.options; + + if (restrictedCalls.length === 0) { + return {}; + } + + const restrictedProperties = new Map(); + const globallyRestrictedObjects = new Map(); + const globallyRestrictedProperties = new Map(); + + restrictedCalls.forEach(option => { + const objectName = option.object; + const propertyName = option.property; + + if (typeof objectName === "undefined") { + globallyRestrictedProperties.set(propertyName, { message: option.message }); + } else if (typeof propertyName === "undefined") { + globallyRestrictedObjects.set(objectName, { message: option.message }); + } else { + if (!restrictedProperties.has(objectName)) { + restrictedProperties.set(objectName, new Map()); + } + + restrictedProperties.get(objectName).set(propertyName, { + message: option.message + }); + } + }); + + /** + * Checks to see whether a property access is restricted, and reports it if so. + * @param {ASTNode} node The node to report + * @param {string} objectName The name of the object + * @param {string} propertyName The name of the property + * @returns {undefined} + */ + function checkPropertyAccess(node, objectName, propertyName) { + if (propertyName === null) { + return; + } + const matchedObject = restrictedProperties.get(objectName); + const matchedObjectProperty = matchedObject ? matchedObject.get(propertyName) : globallyRestrictedObjects.get(objectName); + const globalMatchedProperty = globallyRestrictedProperties.get(propertyName); + + if (matchedObjectProperty) { + const message = matchedObjectProperty.message ? ` ${matchedObjectProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedObjectProperty", + data: { + objectName, + propertyName, + message + } + }); + } else if (globalMatchedProperty) { + const message = globalMatchedProperty.message ? ` ${globalMatchedProperty.message}` : ""; + + context.report({ + node, + messageId: "restrictedProperty", + data: { + propertyName, + message + } + }); + } + } + + /** + * Checks property accesses in a destructuring assignment expression, e.g. `var foo; ({foo} = bar);` + * @param {ASTNode} node An AssignmentExpression or AssignmentPattern node + * @returns {undefined} + */ + function checkDestructuringAssignment(node) { + if (node.right.type === "Identifier") { + const objectName = node.right.name; + + if (node.left.type === "ObjectPattern") { + node.left.properties.forEach(property => { + checkPropertyAccess(node.left, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + } + + return { + MemberExpression(node) { + checkPropertyAccess(node, node.object && node.object.name, astUtils.getStaticPropertyName(node)); + }, + VariableDeclarator(node) { + if (node.init && node.init.type === "Identifier") { + const objectName = node.init.name; + + if (node.id.type === "ObjectPattern") { + node.id.properties.forEach(property => { + checkPropertyAccess(node.id, objectName, astUtils.getStaticPropertyName(property)); + }); + } + } + }, + AssignmentExpression: checkDestructuringAssignment, + AssignmentPattern: checkDestructuringAssignment + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-syntax.js b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-syntax.js new file mode 100644 index 0000000..9572603 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule to flag use of certain node types + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified syntax", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-restricted-syntax" + }, + + schema: { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + selector: { type: "string" }, + message: { type: "string" } + }, + required: ["selector"], + additionalProperties: false + } + ] + }, + uniqueItems: true, + minItems: 0 + }, + + messages: { + // eslint-disable-next-line eslint-plugin/report-message-format + restrictedSyntax: "{{message}}" + } + }, + + create(context) { + return context.options.reduce((result, selectorOrObject) => { + const isStringFormat = (typeof selectorOrObject === "string"); + const hasCustomMessage = !isStringFormat && Boolean(selectorOrObject.message); + + const selector = isStringFormat ? selectorOrObject : selectorOrObject.selector; + const message = hasCustomMessage ? selectorOrObject.message : `Using '${selector}' is not allowed.`; + + return Object.assign(result, { + [selector](node) { + context.report({ + node, + messageId: "restrictedSyntax", + data: { message } + }); + } + }); + }, {}); + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-return-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-return-assign.js new file mode 100644 index 0000000..4b57d42 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-return-assign.js @@ -0,0 +1,80 @@ +/** + * @fileoverview Rule to flag when return statement contains assignment + * @author Ilya Volodin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow assignment operators in `return` statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-return-assign" + }, + + schema: [ + { + enum: ["except-parens", "always"] + } + ], + + messages: { + returnAssignment: "Return statement should not contain assignment.", + arrowAssignment: "Arrow function should not return assignment." + } + }, + + create(context) { + const always = (context.options[0] || "except-parens") !== "except-parens"; + const sourceCode = context.getSourceCode(); + + return { + AssignmentExpression(node) { + if (!always && astUtils.isParenthesised(sourceCode, node)) { + return; + } + + let currentChild = node; + let parent = currentChild.parent; + + // Find ReturnStatement or ArrowFunctionExpression in ancestors. + while (parent && !SENTINEL_TYPE.test(parent.type)) { + currentChild = parent; + parent = parent.parent; + } + + // Reports. + if (parent && parent.type === "ReturnStatement") { + context.report({ + node: parent, + messageId: "returnAssignment" + }); + } else if (parent && parent.type === "ArrowFunctionExpression" && parent.body === currentChild) { + context.report({ + node: parent, + messageId: "arrowAssignment" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-return-await.js b/day1/cli-study/node_modules/eslint/lib/rules/no-return-await.js new file mode 100644 index 0000000..d1d8982 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-return-await.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Disallows unnecessary `return await` + * @author Jordan Harband + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `return await`", + category: "Best Practices", + + recommended: false, + + url: "https://eslint.org/docs/rules/no-return-await" + }, + + fixable: null, + + schema: [ + ], + + messages: { + redundantUseOfAwait: "Redundant use of `await` on a return value." + } + }, + + create(context) { + + /** + * Reports a found unnecessary `await` expression. + * @param {ASTNode} node The node representing the `await` expression to report + * @returns {void} + */ + function reportUnnecessaryAwait(node) { + context.report({ + node: context.getSourceCode().getFirstToken(node), + loc: node.loc, + messageId: "redundantUseOfAwait" + }); + } + + /** + * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting + * this function. For example, a statement in a `try` block will always have an error handler. A statement in + * a `catch` block will only have an error handler if there is also a `finally` block. + * @param {ASTNode} node A node representing a location where an could be thrown + * @returns {boolean} `true` if a thrown error will be caught/handled in this function + */ + function hasErrorHandler(node) { + let ancestor = node; + + while (!astUtils.isFunction(ancestor) && ancestor.type !== "Program") { + if (ancestor.parent.type === "TryStatement" && (ancestor === ancestor.parent.block || ancestor === ancestor.parent.handler && ancestor.parent.finalizer)) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + + /** + * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression, + * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position. + * @param {ASTNode} node A node representing the `await` expression to check + * @returns {boolean} The checking result + */ + function isInTailCallPosition(node) { + if (node.parent.type === "ArrowFunctionExpression") { + return true; + } + if (node.parent.type === "ReturnStatement") { + return !hasErrorHandler(node.parent); + } + if (node.parent.type === "ConditionalExpression" && (node === node.parent.consequent || node === node.parent.alternate)) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "LogicalExpression" && node === node.parent.right) { + return isInTailCallPosition(node.parent); + } + if (node.parent.type === "SequenceExpression" && node === node.parent.expressions[node.parent.expressions.length - 1]) { + return isInTailCallPosition(node.parent); + } + return false; + } + + return { + AwaitExpression(node) { + if (isInTailCallPosition(node) && !hasErrorHandler(node)) { + reportUnnecessaryAwait(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-script-url.js b/day1/cli-study/node_modules/eslint/lib/rules/no-script-url.js new file mode 100644 index 0000000..2078fc1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-script-url.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag when using javascript: urls + * @author Ilya Volodin + */ +/* jshint scripturl: true */ +/* eslint no-script-url: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `javascript:` urls", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-script-url" + }, + + schema: [], + + messages: { + unexpectedScriptURL: "Script URL is a form of eval." + } + }, + + create(context) { + + return { + + Literal(node) { + if (node.value && typeof node.value === "string") { + const value = node.value.toLowerCase(); + + if (value.indexOf("javascript:") === 0) { + context.report({ node, messageId: "unexpectedScriptURL" }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-self-assign.js b/day1/cli-study/node_modules/eslint/lib/rules/no-self-assign.js new file mode 100644 index 0000000..170e46b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule to disallow assignments where both sides are exactly the same + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SPACES = /\s+/gu; + +/** + * Checks whether the property of 2 given member expression nodes are the same + * property or not. + * @param {ASTNode} left A member expression node to check. + * @param {ASTNode} right Another member expression node to check. + * @returns {boolean} `true` if the member expressions have the same property. + */ +function isSameProperty(left, right) { + if (left.property.type === "Identifier" && + left.property.type === right.property.type && + left.property.name === right.property.name && + left.computed === right.computed + ) { + return true; + } + + const lname = astUtils.getStaticPropertyName(left); + const rname = astUtils.getStaticPropertyName(right); + + return lname !== null && lname === rname; +} + +/** + * Checks whether 2 given member expression nodes are the reference to the same + * property or not. + * @param {ASTNode} left A member expression node to check. + * @param {ASTNode} right Another member expression node to check. + * @returns {boolean} `true` if the member expressions are the reference to the + * same property or not. + */ +function isSameMember(left, right) { + if (!isSameProperty(left, right)) { + return false; + } + + const lobj = left.object; + const robj = right.object; + + if (lobj.type !== robj.type) { + return false; + } + if (lobj.type === "MemberExpression") { + return isSameMember(lobj, robj); + } + if (lobj.type === "ThisExpression") { + return true; + } + return lobj.type === "Identifier" && lobj.name === robj.name; +} + +/** + * Traverses 2 Pattern nodes in parallel, then reports self-assignments. + * @param {ASTNode|null} left A left node to traverse. This is a Pattern or + * a Property. + * @param {ASTNode|null} right A right node to traverse. This is a Pattern or + * a Property. + * @param {boolean} props The flag to check member expressions as well. + * @param {Function} report A callback function to report. + * @returns {void} + */ +function eachSelfAssignment(left, right, props, report) { + if (!left || !right) { + + // do nothing + } else if ( + left.type === "Identifier" && + right.type === "Identifier" && + left.name === right.name + ) { + report(right); + } else if ( + left.type === "ArrayPattern" && + right.type === "ArrayExpression" + ) { + const end = Math.min(left.elements.length, right.elements.length); + + for (let i = 0; i < end; ++i) { + const leftElement = left.elements[i]; + const rightElement = right.elements[i]; + + // Avoid cases such as [...a] = [...a, 1] + if ( + leftElement && + leftElement.type === "RestElement" && + i < right.elements.length - 1 + ) { + break; + } + + eachSelfAssignment(leftElement, rightElement, props, report); + + // After a spread element, those indices are unknown. + if (rightElement && rightElement.type === "SpreadElement") { + break; + } + } + } else if ( + left.type === "RestElement" && + right.type === "SpreadElement" + ) { + eachSelfAssignment(left.argument, right.argument, props, report); + } else if ( + left.type === "ObjectPattern" && + right.type === "ObjectExpression" && + right.properties.length >= 1 + ) { + + /* + * Gets the index of the last spread property. + * It's possible to overwrite properties followed by it. + */ + let startJ = 0; + + for (let i = right.properties.length - 1; i >= 0; --i) { + const propType = right.properties[i].type; + + if (propType === "SpreadElement" || propType === "ExperimentalSpreadProperty") { + startJ = i + 1; + break; + } + } + + for (let i = 0; i < left.properties.length; ++i) { + for (let j = startJ; j < right.properties.length; ++j) { + eachSelfAssignment( + left.properties[i], + right.properties[j], + props, + report + ); + } + } + } else if ( + left.type === "Property" && + right.type === "Property" && + right.kind === "init" && + !right.method + ) { + const leftName = astUtils.getStaticPropertyName(left); + + if (leftName !== null && leftName === astUtils.getStaticPropertyName(right)) { + eachSelfAssignment(left.value, right.value, props, report); + } + } else if ( + props && + left.type === "MemberExpression" && + right.type === "MemberExpression" && + isSameMember(left, right) + ) { + report(right); + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments where both sides are exactly the same", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-self-assign" + }, + + schema: [ + { + type: "object", + properties: { + props: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + selfAssignment: "'{{name}}' is assigned to itself." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const [{ props = true } = {}] = context.options; + + /** + * Reports a given node as self assignments. + * @param {ASTNode} node A node to report. This is an Identifier node. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "selfAssignment", + data: { + name: sourceCode.getText(node).replace(SPACES, "") + } + }); + } + + return { + AssignmentExpression(node) { + if (node.operator === "=") { + eachSelfAssignment(node.left, node.right, props, report); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-self-compare.js b/day1/cli-study/node_modules/eslint/lib/rules/no-self-compare.js new file mode 100644 index 0000000..79b6ac7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-self-compare.js @@ -0,0 +1,60 @@ +/** + * @fileoverview Rule to flag comparison where left part is the same as the right + * part. + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow comparisons where both sides are exactly the same", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-self-compare" + }, + + schema: [], + + messages: { + comparingToSelf: "Comparing to itself is potentially pointless." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Determines whether two nodes are composed of the same tokens. + * @param {ASTNode} nodeA The first node + * @param {ASTNode} nodeB The second node + * @returns {boolean} true if the nodes have identical token representations + */ + function hasSameTokens(nodeA, nodeB) { + const tokensA = sourceCode.getTokens(nodeA); + const tokensB = sourceCode.getTokens(nodeB); + + return tokensA.length === tokensB.length && + tokensA.every((token, index) => token.type === tokensB[index].type && token.value === tokensB[index].value); + } + + return { + + BinaryExpression(node) { + const operators = new Set(["===", "==", "!==", "!=", ">", "<", ">=", "<="]); + + if (operators.has(node.operator) && hasSameTokens(node.left, node.right)) { + context.report({ node, messageId: "comparingToSelf" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-sequences.js b/day1/cli-study/node_modules/eslint/lib/rules/no-sequences.js new file mode 100644 index 0000000..d67635d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-sequences.js @@ -0,0 +1,119 @@ +/** + * @fileoverview Rule to flag use of comma operator + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow comma operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-sequences" + }, + + schema: [], + + messages: { + unexpectedCommaExpression: "Unexpected use of comma operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Parts of the grammar that are required to have parens. + */ + const parenthesized = { + DoWhileStatement: "test", + IfStatement: "test", + SwitchStatement: "discriminant", + WhileStatement: "test", + WithStatement: "object", + ArrowFunctionExpression: "body" + + /* + * Omitting CallExpression - commas are parsed as argument separators + * Omitting NewExpression - commas are parsed as argument separators + * Omitting ForInStatement - parts aren't individually parenthesised + * Omitting ForStatement - parts aren't individually parenthesised + */ + }; + + /** + * Determines whether a node is required by the grammar to be wrapped in + * parens, e.g. the test of an if statement. + * @param {ASTNode} node The AST node + * @returns {boolean} True if parens around node belong to parent node. + */ + function requiresExtraParens(node) { + return node.parent && parenthesized[node.parent.type] && + node === node.parent[parenthesized[node.parent.type]]; + } + + /** + * Check if a node is wrapped in parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if the node has a paren on each side. + */ + function isParenthesised(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if a node is wrapped in two levels of parens. + * @param {ASTNode} node The AST node + * @returns {boolean} True if two parens surround the node on each side. + */ + function isParenthesisedTwice(node) { + const previousToken = sourceCode.getTokenBefore(node, 1), + nextToken = sourceCode.getTokenAfter(node, 1); + + return isParenthesised(node) && previousToken && nextToken && + astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] && + astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1]; + } + + return { + SequenceExpression(node) { + + // Always allow sequences in for statement update + if (node.parent.type === "ForStatement" && + (node === node.parent.init || node === node.parent.update)) { + return; + } + + // Wrapping a sequence in extra parens indicates intent + if (requiresExtraParens(node)) { + if (isParenthesisedTwice(node)) { + return; + } + } else { + if (isParenthesised(node)) { + return; + } + } + + const firstCommaToken = sourceCode.getTokenAfter(node.expressions[0], astUtils.isCommaToken); + + context.report({ node, loc: firstCommaToken.loc, messageId: "unexpectedCommaExpression" }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-setter-return.js b/day1/cli-study/node_modules/eslint/lib/rules/no-setter-return.js new file mode 100644 index 0000000..a558640 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-setter-return.js @@ -0,0 +1,227 @@ +/** + * @fileoverview Rule to disallow returning values from setters + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ +function isGlobalReference(node, scope) { + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; +} + +/** + * Determines whether the given node is an argument of the specified global method call, at the given `index` position. + * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @param {string} objectName Name of the global object. + * @param {string} methodName Name of the method. + * @param {number} index The given position. + * @returns {boolean} `true` if the node is argument at the given position. + */ +function isArgumentOfGlobalMethodCall(node, scope, objectName, methodName, index) { + const parent = node.parent; + + return parent.type === "CallExpression" && + parent.arguments[index] === node && + parent.callee.type === "MemberExpression" && + astUtils.getStaticPropertyName(parent.callee) === methodName && + parent.callee.object.type === "Identifier" && + parent.callee.object.name === objectName && + isGlobalReference(parent.callee.object, scope); +} + +/** + * Determines whether the given node is used as a property descriptor. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node, scope) { + if ( + isArgumentOfGlobalMethodCall(node, scope, "Object", "defineProperty", 2) || + isArgumentOfGlobalMethodCall(node, scope, "Reflect", "defineProperty", 2) + ) { + return true; + } + + const parent = node.parent; + + if ( + parent.type === "Property" && + parent.value === node + ) { + const grandparent = parent.parent; + + if ( + grandparent.type === "ObjectExpression" && + ( + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "create", 1) || + isArgumentOfGlobalMethodCall(grandparent, scope, "Object", "defineProperties", 1) + ) + ) { + return true; + } + } + + return false; +} + +/** + * Determines whether the given function node is used as a setter function. + * @param {ASTNode} node The node to check. + * @param {Scope} scope Scope to which the node belongs. + * @returns {boolean} `true` if the node is a setter. + */ +function isSetter(node, scope) { + const parent = node.parent; + + if ( + parent.kind === "set" && + parent.value === node + ) { + + // Setter in an object literal or in a class + return true; + } + + if ( + parent.type === "Property" && + parent.value === node && + astUtils.getStaticPropertyName(parent) === "set" && + parent.parent.type === "ObjectExpression" && + isPropertyDescriptor(parent.parent, scope) + ) { + + // Setter in a property descriptor + return true; + } + + return false; +} + +/** + * Finds function's outer scope. + * @param {Scope} scope Function's own scope. + * @returns {Scope} Function's outer scope. + */ +function getOuterScope(scope) { + const upper = scope.upper; + + if (upper.type === "function-expression-name") { + return upper.upper; + } + + return upper; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow returning values from setters", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-setter-return" + }, + + schema: [], + + messages: { + returnsValue: "Setter cannot return a value." + } + }, + + create(context) { + let funcInfo = null; + + /** + * Creates and pushes to the stack a function info object for the given function node. + * @param {ASTNode} node The function node. + * @returns {void} + */ + function enterFunction(node) { + const outerScope = getOuterScope(context.getScope()); + + funcInfo = { + upper: funcInfo, + isSetter: isSetter(node, outerScope) + }; + } + + /** + * Pops the current function info object from the stack. + * @returns {void} + */ + function exitFunction() { + funcInfo = funcInfo.upper; + } + + /** + * Reports the given node. + * @param {ASTNode} node Node to report. + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "returnsValue" }); + } + + return { + + /* + * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid + * false positives, because a ReturnStatement node can belong to a function declaration inside a setter. + * + * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor, + * but that's out of scope for this rule. + */ + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression(node) { + enterFunction(node); + + if (funcInfo.isSetter && node.expression) { + + // { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement. + report(node.body); + } + }, + + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + ReturnStatement(node) { + + // Global returns (e.g., at the top level of a Node module) don't have `funcInfo`. + if (funcInfo && funcInfo.isSetter && node.argument) { + report(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/day1/cli-study/node_modules/eslint/lib/rules/no-shadow-restricted-names.js new file mode 100644 index 0000000..9647e9a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1) + * @author Michael Ficarra + */ +"use strict"; + +/** + * Determines if a variable safely shadows undefined. + * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value + * as the global). + * @param {eslintScope.Variable} variable The variable to check + * @returns {boolean} true if this variable safely shadows `undefined` + */ +function safelyShadowsUndefined(variable) { + return variable.name === "undefined" && + variable.references.every(ref => !ref.isWrite()) && + variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow identifiers from shadowing restricted names", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-shadow-restricted-names" + }, + + schema: [], + + messages: { + shadowingRestrictedName: "Shadowing of global property '{{name}}'." + } + }, + + create(context) { + + + const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + + return { + "VariableDeclaration, :function, CatchClause"(node) { + for (const variable of context.getDeclaredVariables(node)) { + if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { + context.report({ + node: variable.defs[0].name, + messageId: "shadowingRestrictedName", + data: { + name: variable.name + } + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-shadow.js b/day1/cli-study/node_modules/eslint/lib/rules/no-shadow.js new file mode 100644 index 0000000..1be8590 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-shadow.js @@ -0,0 +1,192 @@ +/** + * @fileoverview Rule to flag on declaring variables already declared in the outer scope + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow variable declarations from shadowing variables declared in the outer scope", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-shadow" + }, + + schema: [ + { + type: "object", + properties: { + builtinGlobals: { type: "boolean", default: false }, + hoist: { enum: ["all", "functions", "never"], default: "functions" }, + allow: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + } + ], + + messages: { + noShadow: "'{{name}}' is already declared in the upper scope." + } + }, + + create(context) { + + const options = { + builtinGlobals: context.options[0] && context.options[0].builtinGlobals, + hoist: (context.options[0] && context.options[0].hoist) || "functions", + allow: (context.options[0] && context.options[0].allow) || [] + }; + + /** + * Check if variable name is allowed. + * @param {ASTNode} variable The variable to check. + * @returns {boolean} Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return options.allow.indexOf(variable.name) !== -1; + } + + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param {Object} variable The variable to check. + * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + + return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; + } + + /** + * Checks if a variable is inside the initializer of scopeVar. + * + * To avoid reporting at declarations such as `var a = function a() {};`. + * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The scope variable to look for. + * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerScope = scopeVar.scope; + const outerDef = scopeVar.defs[0]; + const outer = outerDef && outerDef.parent && outerDef.parent.range; + const innerScope = variable.scope; + const innerDef = variable.defs[0]; + const inner = innerDef && innerDef.name.range; + + return ( + outer && + inner && + outer[0] < inner[0] && + inner[1] < outer[1] && + ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && + outerScope === innerScope.upper + ); + } + + /** + * Get a range of a variable's identifier node. + * @param {Object} variable The variable to get. + * @returns {Array|undefined} The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs[0]; + + return def && def.name.range; + } + + /** + * Checks if a variable is in TDZ of scopeVar. + * @param {Object} variable The variable to check. + * @param {Object} scopeVar The variable of TDZ. + * @returns {boolean} Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs[0]; + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + + return ( + inner && + outer && + inner[1] < outer[0] && + + // Excepts FunctionDeclaration if is {"hoist":"function"}. + (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") + ); + } + + /** + * Checks the current context for shadowed variables. + * @param {Scope} scope Fixme + * @returns {void} + */ + function checkForShadows(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. + if (variable.identifiers.length === 0 || + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) + ) { + continue; + } + + // Gets shadowed variable. + const shadowed = astUtils.getVariableByName(scope.upper, variable.name); + + if (shadowed && + (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== "all" && isInTdz(variable, shadowed)) + ) { + context.report({ + node: variable.identifiers[0], + messageId: "noShadow", + data: variable + }); + } + } + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + const stack = globalScope.childScopes.slice(); + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkForShadows(scope); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-spaced-func.js b/day1/cli-study/node_modules/eslint/lib/rules/no-spaced-func.js new file mode 100644 index 0000000..961bc68 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-spaced-func.js @@ -0,0 +1,83 @@ +/** + * @fileoverview Rule to check that spaced function application + * @author Matt DuVall + * @deprecated in ESLint v3.3.0 + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow spacing between function identifiers and their applications (deprecated)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-spaced-func" + }, + + deprecated: true, + + replacedBy: ["func-call-spacing"], + + fixable: "whitespace", + schema: [], + + messages: { + noSpacedFunction: "Unexpected space between function name and paren." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function detectOpenSpaces(node) { + const lastCalleeToken = sourceCode.getLastToken(node.callee); + let prevToken = lastCalleeToken, + parenToken = sourceCode.getTokenAfter(lastCalleeToken); + + // advances to an open parenthesis. + while ( + parenToken && + parenToken.range[1] < node.range[1] && + parenToken.value !== "(" + ) { + prevToken = parenToken; + parenToken = sourceCode.getTokenAfter(parenToken); + } + + // look for a space between the callee and the open paren + if (parenToken && + parenToken.range[1] < node.range[1] && + sourceCode.isSpaceBetweenTokens(prevToken, parenToken) + ) { + context.report({ + node, + loc: lastCalleeToken.loc.start, + messageId: "noSpacedFunction", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + } + }); + } + } + + return { + CallExpression: detectOpenSpaces, + NewExpression: detectOpenSpaces + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-sparse-arrays.js b/day1/cli-study/node_modules/eslint/lib/rules/no-sparse-arrays.js new file mode 100644 index 0000000..e8407c3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Disallow sparse arrays + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow sparse arrays", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-sparse-arrays" + }, + + schema: [], + + messages: { + unexpectedSparseArray: "Unexpected comma in middle of array." + } + }, + + create(context) { + + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + ArrayExpression(node) { + + const emptySpot = node.elements.indexOf(null) > -1; + + if (emptySpot) { + context.report({ node, messageId: "unexpectedSparseArray" }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-sync.js b/day1/cli-study/node_modules/eslint/lib/rules/no-sync.js new file mode 100644 index 0000000..06424e0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-sync.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Rule to check for properties whose identifier ends with the string Sync + * @author Matt DuVall + */ + +/* jshint node:true */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + deprecated: true, + + replacedBy: [], + + type: "suggestion", + + docs: { + description: "disallow synchronous methods", + category: "Node.js and CommonJS", + recommended: false, + url: "https://eslint.org/docs/rules/no-sync" + }, + + schema: [ + { + type: "object", + properties: { + allowAtRootLevel: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + noSync: "Unexpected sync method: '{{propertyName}}'." + } + }, + + create(context) { + const selector = context.options[0] && context.options[0].allowAtRootLevel + ? ":function MemberExpression[property.name=/.*Sync$/]" + : "MemberExpression[property.name=/.*Sync$/]"; + + return { + [selector](node) { + context.report({ + node, + messageId: "noSync", + data: { + propertyName: node.property.name + } + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-tabs.js b/day1/cli-study/node_modules/eslint/lib/rules/no-tabs.js new file mode 100644 index 0000000..ca7be26 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-tabs.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to check for tabs inside a file + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const tabRegex = /\t+/gu; +const anyNonWhitespaceRegex = /\S/u; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow all tabs", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-tabs" + }, + schema: [{ + type: "object", + properties: { + allowIndentationTabs: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + + messages: { + unexpectedTab: "Unexpected tab character." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; + + return { + Program(node) { + sourceCode.getLines().forEach((line, index) => { + let match; + + while ((match = tabRegex.exec(line)) !== null) { + if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { + continue; + } + + context.report({ + node, + loc: { + start: { + line: index + 1, + column: match.index + }, + end: { + line: index + 1, + column: match.index + match[0].length + } + }, + messageId: "unexpectedTab" + }); + } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/day1/cli-study/node_modules/eslint/lib/rules/no-template-curly-in-string.js new file mode 100644 index 0000000..539cd5b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-template-curly-in-string.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Warn when using template string syntax in regular strings + * @author Jeroen Engels + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow template literal placeholder syntax in regular strings", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-template-curly-in-string" + }, + + schema: [], + + messages: { + unexpectedTemplateExpression: "Unexpected template string expression." + } + }, + + create(context) { + const regex = /\$\{[^}]+\}/u; + + return { + Literal(node) { + if (typeof node.value === "string" && regex.test(node.value)) { + context.report({ + node, + messageId: "unexpectedTemplateExpression" + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-ternary.js b/day1/cli-study/node_modules/eslint/lib/rules/no-ternary.js new file mode 100644 index 0000000..b3ced86 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-ternary.js @@ -0,0 +1,41 @@ +/** + * @fileoverview Rule to flag use of ternary operators. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-ternary" + }, + + schema: [], + + messages: { + noTernaryOperator: "Ternary operator used." + } + }, + + create(context) { + + return { + + ConditionalExpression(node) { + context.report({ node, messageId: "noTernaryOperator" }); + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-this-before-super.js b/day1/cli-study/node_modules/eslint/lib/rules/no-this-before-super.js new file mode 100644 index 0000000..44288c0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-this-before-super.js @@ -0,0 +1,304 @@ +/** + * @fileoverview A rule to disallow using `this`/`super` before `super()`. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow `this`/`super` before calling `super()` in constructors", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/no-this-before-super" + }, + + schema: [], + + messages: { + noBeforeSuper: "'{{kind}}' is not allowed before 'super()'." + } + }, + + create(context) { + + /* + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether the owner class has a valid + * `extends` part. + * - scope: The scope of the owner class. + * - codePath: The code path of this constructor. + */ + let funcInfo = null; + + /* + * Information for each code path segment. + * Each key is the id of a code path segment. + * Each value is an object: + * - superCalled: The flag which shows `super()` called in all code paths. + * - invalidNodes: The array of invalid ThisExpression and Super nodes. + */ + let segInfoMap = Object.create(null); + + /** + * Gets whether or not `super()` is called in a given code path segment. + * @param {CodePathSegment} segment A code path segment to get. + * @returns {boolean} `true` if `super()` is called. + */ + function isCalled(segment) { + return !segment.reachable || segInfoMap[segment.id].superCalled; + } + + /** + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. + */ + function isInConstructorOfDerivedClass() { + return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); + } + + /** + * Checks whether or not this is before `super()` is called. + * @returns {boolean} `true` if this is before `super()` is called. + */ + function isBeforeCallOfSuper() { + return ( + isInConstructorOfDerivedClass() && + !funcInfo.codePath.currentSegments.every(isCalled) + ); + } + + /** + * Sets a given node as invalid. + * @param {ASTNode} node A node to set as invalid. This is one of + * a ThisExpression and a Super. + * @returns {void} + */ + function setInvalid(node) { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].invalidNodes.push(node); + } + } + } + + /** + * Sets the current segment as `super` was called. + * @returns {void} + */ + function setSuperCalled() { + const segments = funcInfo.codePath.currentSegments; + + for (let i = 0; i < segments.length; ++i) { + const segment = segments[i]; + + if (segment.reachable) { + segInfoMap[segment.id].superCalled = true; + } + } + } + + return { + + /** + * Adds information of a constructor into the stack. + * @param {CodePath} codePath A code path which was started. + * @param {ASTNode} node The current node. + * @returns {void} + */ + onCodePathStart(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + const classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath + }; + } + }, + + /** + * Removes the top of stack item. + * + * And this treverses all segments of this code path then reports every + * invalid node. + * @param {CodePath} codePath A code path which was ended. + * @returns {void} + */ + onCodePathEnd(codePath) { + const isDerivedClass = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + if (!isDerivedClass) { + return; + } + + codePath.traverseSegments((segment, controller) => { + const info = segInfoMap[segment.id]; + + for (let i = 0; i < info.invalidNodes.length; ++i) { + const invalidNode = info.invalidNodes[i]; + + context.report({ + messageId: "noBeforeSuper", + node: invalidNode, + data: { + kind: invalidNode.type === "Super" ? "super" : "this" + } + }); + } + + if (info.superCalled) { + controller.skip(); + } + }); + }, + + /** + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment A code path segment to initialize. + * @returns {void} + */ + onCodePathSegmentStart(segment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Initialize info. + segInfoMap[segment.id] = { + superCalled: ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ), + invalidNodes: [] + }; + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment A code path segment of the head + * of a loop. + * @returns {void} + */ + onCodePathSegmentLoop(fromSegment, toSegment) { + if (!isInConstructorOfDerivedClass()) { + return; + } + + // Update information inside of the loop. + funcInfo.codePath.traverseSegments( + { first: toSegment, last: fromSegment }, + (segment, controller) => { + const info = segInfoMap[segment.id]; + + if (info.superCalled) { + info.invalidNodes = []; + controller.skip(); + } else if ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ) { + info.superCalled = true; + info.invalidNodes = []; + } + } + ); + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + ThisExpression(node) { + if (isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Reports if this is before `super()`. + * @param {ASTNode} node A target node. + * @returns {void} + */ + Super(node) { + if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) { + setInvalid(node); + } + }, + + /** + * Marks `super()` called. + * @param {ASTNode} node A target node. + * @returns {void} + */ + "CallExpression:exit"(node) { + if (node.callee.type === "Super" && isBeforeCallOfSuper()) { + setSuperCalled(); + } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit"() { + segInfoMap = Object.create(null); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-throw-literal.js b/day1/cli-study/node_modules/eslint/lib/rules/no-throw-literal.js new file mode 100644 index 0000000..29fb371 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-throw-literal.js @@ -0,0 +1,51 @@ +/** + * @fileoverview Rule to restrict what can be thrown as an exception. + * @author Dieter Oberkofler + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow throwing literals as exceptions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-throw-literal" + }, + + schema: [], + + messages: { + object: "Expected an error object to be thrown.", + undef: "Do not throw undefined." + } + }, + + create(context) { + + return { + + ThrowStatement(node) { + if (!astUtils.couldBeError(node.argument)) { + context.report({ node, messageId: "object" }); + } else if (node.argument.type === "Identifier") { + if (node.argument.name === "undefined") { + context.report({ node, messageId: "undef" }); + } + } + + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-trailing-spaces.js b/day1/cli-study/node_modules/eslint/lib/rules/no-trailing-spaces.js new file mode 100644 index 0000000..98ae62c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -0,0 +1,190 @@ +/** + * @fileoverview Disallow trailing spaces at the end of lines. + * @author Nodeca Team + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow trailing whitespace at the end of lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-trailing-spaces" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + skipBlankLines: { + type: "boolean", + default: false + }, + ignoreComments: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + trailingSpace: "Trailing spaces not allowed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", + SKIP_BLANK = `^${BLANK_CLASS}*$`, + NONBLANK = `${BLANK_CLASS}+$`; + + const options = context.options[0] || {}, + skipBlankLines = options.skipBlankLines || false, + ignoreComments = options.ignoreComments || false; + + /** + * Report the error message + * @param {ASTNode} node node to report + * @param {int[]} location range information + * @param {int[]} fixRange Range based on the whole program + * @returns {void} + */ + function report(node, location, fixRange) { + + /* + * Passing node is a bit dirty, because message data will contain big + * text in `source`. But... who cares :) ? + * One more kludge will not make worse the bloody wizardry of this + * plugin. + */ + context.report({ + node, + loc: location, + messageId: "trailingSpace", + fix(fixer) { + return fixer.removeRange(fixRange); + } + }); + } + + /** + * Given a list of comment nodes, return the line numbers for those comments. + * @param {Array} comments An array of comment nodes. + * @returns {number[]} An array of line numbers containing comments. + */ + function getCommentLineNumbers(comments) { + const lines = new Set(); + + comments.forEach(comment => { + const endLine = comment.type === "Block" + ? comment.loc.end.line - 1 + : comment.loc.end.line; + + for (let i = comment.loc.start.line; i <= endLine; i++) { + lines.add(i); + } + }); + + return lines; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkTrailingSpaces(node) { + + /* + * Let's hack. Since Espree does not return whitespace nodes, + * fetch the source code and do matching via regexps. + */ + + const re = new RegExp(NONBLANK, "u"), + skipMatch = new RegExp(SKIP_BLANK, "u"), + lines = sourceCode.lines, + linebreaks = sourceCode.getText().match(astUtils.createGlobalLinebreakMatcher()), + comments = sourceCode.getAllComments(), + commentLineNumbers = getCommentLineNumbers(comments); + + let totalLength = 0, + fixRange = []; + + for (let i = 0, ii = lines.length; i < ii; i++) { + const lineNumber = i + 1; + + /* + * Always add linebreak length to line length to accommodate for line break (\n or \r\n) + * Because during the fix time they also reserve one spot in the array. + * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) + */ + const linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; + const lineLength = lines[i].length + linebreakLength; + + const matches = re.exec(lines[i]); + + if (matches) { + const location = { + start: { + line: lineNumber, + column: matches.index + }, + end: { + line: lineNumber, + column: lineLength - linebreakLength + } + }; + + const rangeStart = totalLength + location.start.column; + const rangeEnd = totalLength + location.end.column; + const containingNode = sourceCode.getNodeByRangeIndex(rangeStart); + + if (containingNode && containingNode.type === "TemplateElement" && + rangeStart > containingNode.parent.range[0] && + rangeEnd < containingNode.parent.range[1]) { + totalLength += lineLength; + continue; + } + + /* + * If the line has only whitespace, and skipBlankLines + * is true, don't report it + */ + if (skipBlankLines && skipMatch.test(lines[i])) { + totalLength += lineLength; + continue; + } + + fixRange = [rangeStart, rangeEnd]; + + if (!ignoreComments || !commentLineNumbers.has(lineNumber)) { + report(node, location, fixRange); + } + } + + totalLength += lineLength; + } + } + + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-undef-init.js b/day1/cli-study/node_modules/eslint/lib/rules/no-undef-init.js new file mode 100644 index 0000000..5c240fe --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-undef-init.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Rule to flag when initializing to undefined + * @author Ilya Volodin + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow initializing variables to `undefined`", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undef-init" + }, + + schema: [], + fixable: "code", + + messages: { + unnecessaryUndefinedInit: "It's not necessary to initialize '{{name}}' to undefined." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + return { + + VariableDeclarator(node) { + const name = sourceCode.getText(node.id), + init = node.init && node.init.name, + scope = context.getScope(), + undefinedVar = astUtils.getVariableByName(scope, "undefined"), + shadowed = undefinedVar && undefinedVar.defs.length > 0, + lastToken = sourceCode.getLastToken(node); + + if (init === "undefined" && node.parent.kind !== "const" && !shadowed) { + context.report({ + node, + messageId: "unnecessaryUndefinedInit", + data: { name }, + fix(fixer) { + if (node.parent.kind === "var") { + return null; + } + + if (node.id.type === "ArrayPattern" || node.id.type === "ObjectPattern") { + + // Don't fix destructuring assignment to `undefined`. + return null; + } + + if (sourceCode.commentsExistBetween(node.id, lastToken)) { + return null; + } + + return fixer.removeRange([node.id.range[1], node.range[1]]); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-undef.js b/day1/cli-study/node_modules/eslint/lib/rules/no-undef.js new file mode 100644 index 0000000..6b51408 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-undef.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag references to undeclared variables. + * @author Mark Macdonald + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if the given node is the argument of a typeof operator. + * @param {ASTNode} node The AST node being checked. + * @returns {boolean} Whether or not the node is the argument of a typeof operator. + */ +function hasTypeOfOperator(node) { + const parent = node.parent; + + return parent.type === "UnaryExpression" && parent.operator === "typeof"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-undef" + }, + + schema: [ + { + type: "object", + properties: { + typeof: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + undef: "'{{name}}' is not defined." + } + }, + + create(context) { + const options = context.options[0]; + const considerTypeOf = options && options.typeof === true || false; + + return { + "Program:exit"(/* node */) { + const globalScope = context.getScope(); + + globalScope.through.forEach(ref => { + const identifier = ref.identifier; + + if (!considerTypeOf && hasTypeOfOperator(identifier)) { + return; + } + + context.report({ + node: identifier, + messageId: "undef", + data: identifier + }); + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-undefined.js b/day1/cli-study/node_modules/eslint/lib/rules/no-undefined.js new file mode 100644 index 0000000..a075d90 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-undefined.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to flag references to the undefined variable. + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `undefined` as an identifier", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-undefined" + }, + + schema: [], + + messages: { + unexpectedUndefined: "Unexpected use of undefined." + } + }, + + create(context) { + + /** + * Report an invalid "undefined" identifier node. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedUndefined" + }); + } + + /** + * Checks the given scope for references to `undefined` and reports + * all references found. + * @param {eslint-scope.Scope} scope The scope to check. + * @returns {void} + */ + function checkScope(scope) { + const undefinedVar = scope.set.get("undefined"); + + if (!undefinedVar) { + return; + } + + const references = undefinedVar.references; + + const defs = undefinedVar.defs; + + // Report non-initializing references (those are covered in defs below) + references + .filter(ref => !ref.init) + .forEach(ref => report(ref.identifier)); + + defs.forEach(def => report(def.name)); + } + + return { + "Program:exit"() { + const globalScope = context.getScope(); + + const stack = [globalScope]; + + while (stack.length) { + const scope = stack.pop(); + + stack.push(...scope.childScopes); + checkScope(scope); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-underscore-dangle.js b/day1/cli-study/node_modules/eslint/lib/rules/no-underscore-dangle.js new file mode 100644 index 0000000..cac594e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -0,0 +1,232 @@ +/** + * @fileoverview Rule to flag trailing underscores in variable declarations. + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow dangling underscores in identifiers", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-underscore-dangle" + }, + + schema: [ + { + type: "object", + properties: { + allow: { + type: "array", + items: { + type: "string" + } + }, + allowAfterThis: { + type: "boolean", + default: false + }, + allowAfterSuper: { + type: "boolean", + default: false + }, + allowAfterThisConstructor: { + type: "boolean", + default: false + }, + enforceInMethodNames: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedUnderscore: "Unexpected dangling '_' in '{{identifier}}'." + } + }, + + create(context) { + + const options = context.options[0] || {}; + const ALLOWED_VARIABLES = options.allow ? options.allow : []; + const allowAfterThis = typeof options.allowAfterThis !== "undefined" ? options.allowAfterThis : false; + const allowAfterSuper = typeof options.allowAfterSuper !== "undefined" ? options.allowAfterSuper : false; + const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false; + const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false; + + //------------------------------------------------------------------------- + // Helpers + //------------------------------------------------------------------------- + + /** + * Check if identifier is present inside the allowed option + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function isAllowed(identifier) { + return ALLOWED_VARIABLES.some(ident => ident === identifier); + } + + /** + * Check if identifier has a underscore at the end + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function hasTrailingUnderscore(identifier) { + const len = identifier.length; + + return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); + } + + /** + * Check if identifier is a special case member expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierForMemberExpression(identifier) { + return identifier === "__proto__"; + } + + /** + * Check if identifier is a special case variable expression + * @param {string} identifier name of the node + * @returns {boolean} true if its is a special case + * @private + */ + function isSpecialCaseIdentifierInVariableExpression(identifier) { + + // Checks for the underscore library usage here + return identifier === "_"; + } + + /** + * Check if a node is a member reference of this.constructor + * @param {ASTNode} node node to evaluate + * @returns {boolean} true if it is a reference on this.constructor + * @private + */ + function isThisConstructorReference(node) { + return node.object.type === "MemberExpression" && + node.object.property.name === "constructor" && + node.object.object.type === "ThisExpression"; + } + + /** + * Check if function has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForTrailingUnderscoreInFunctionDeclaration(node) { + if (node.id) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + } + + /** + * Check if variable expression has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForTrailingUnderscoreInVariableExpression(node) { + const identifier = node.id.name; + + if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && + !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if member expression has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForTrailingUnderscoreInMemberExpression(node) { + const identifier = node.property.name, + isMemberOfThis = node.object.type === "ThisExpression", + isMemberOfSuper = node.object.type === "Super", + isMemberOfThisConstructor = isThisConstructorReference(node); + + if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && + !(isMemberOfThis && allowAfterThis) && + !(isMemberOfSuper && allowAfterSuper) && + !(isMemberOfThisConstructor && allowAfterThisConstructor) && + !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + /** + * Check if method declaration or method property has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkForTrailingUnderscoreInMethod(node) { + const identifier = node.key.name; + const isMethod = node.type === "MethodDefinition" || node.type === "Property" && node.method; + + if (typeof identifier !== "undefined" && enforceInMethodNames && isMethod && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) { + context.report({ + node, + messageId: "unexpectedUnderscore", + data: { + identifier + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + FunctionDeclaration: checkForTrailingUnderscoreInFunctionDeclaration, + VariableDeclarator: checkForTrailingUnderscoreInVariableExpression, + MemberExpression: checkForTrailingUnderscoreInMemberExpression, + MethodDefinition: checkForTrailingUnderscoreInMethod, + Property: checkForTrailingUnderscoreInMethod + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unexpected-multiline.js new file mode 100644 index 0000000..b5ec20d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. + * @author Glen Mailer + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow confusing multiline expressions", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unexpected-multiline" + }, + + schema: [], + messages: { + function: "Unexpected newline between function and ( of function call.", + property: "Unexpected newline between object and [ of property access.", + taggedTemplate: "Unexpected newline between template tag and template literal.", + division: "Unexpected newline between numerator and division operator." + } + }, + + create(context) { + + const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; + + const sourceCode = context.getSourceCode(); + + /** + * Check to see if there is a newline between the node and the following open bracket + * line's expression + * @param {ASTNode} node The node to check. + * @param {string} messageId The error messageId to use. + * @returns {void} + * @private + */ + function checkForBreakAfter(node, messageId) { + const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken); + const nodeExpressionEnd = sourceCode.getTokenBefore(openParen); + + if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { + context.report({ + node, + loc: openParen.loc, + messageId + }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + + MemberExpression(node) { + if (!node.computed) { + return; + } + checkForBreakAfter(node.object, "property"); + }, + + TaggedTemplateExpression(node) { + const { quasi } = node; + + // handles common tags, parenthesized tags, and typescript's generic type arguments + const tokenBefore = sourceCode.getTokenBefore(quasi); + + if (tokenBefore.loc.end.line !== quasi.loc.start.line) { + context.report({ + node, + loc: { + start: quasi.loc.start, + end: { + line: quasi.loc.start.line, + column: quasi.loc.start.column + 1 + } + }, + messageId: "taggedTemplate" + }); + } + }, + + CallExpression(node) { + if (node.arguments.length === 0) { + return; + } + checkForBreakAfter(node.callee, "function"); + }, + + "BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(node) { + const secondSlash = sourceCode.getTokenAfter(node, token => token.value === "/"); + const tokenAfterOperator = sourceCode.getTokenAfter(secondSlash); + + if ( + tokenAfterOperator.type === "Identifier" && + REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) && + secondSlash.range[1] === tokenAfterOperator.range[0] + ) { + checkForBreakAfter(node.left, "division"); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js new file mode 100644 index 0000000..7031a4d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,360 @@ +/** + * @fileoverview Rule to disallow use of unmodified expressions in loop conditions + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Traverser = require("../shared/traverser"), + astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_PATTERN = /(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u; +const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property. +const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u; +const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u; +const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; + +/** + * @typedef {Object} LoopConditionInfo + * @property {eslint-scope.Reference} reference - The reference. + * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes + * that the reference is belonging to. + * @property {Function} isInLoop - The predicate which checks a given reference + * is in this loop. + * @property {boolean} modified - The flag that the reference is modified in + * this loop. + */ + +/** + * Checks whether or not a given reference is a write reference. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is a write reference. + */ +function isWriteReference(reference) { + if (reference.init) { + const def = reference.resolved && reference.resolved.defs[0]; + + if (!def || def.type !== "Variable" || def.parent.kind !== "var") { + return false; + } + } + return reference.isWrite(); +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodified(condition) { + return !condition.modified; +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag and does not have the group this condition belongs to. + * @param {LoopConditionInfo} condition A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodifiedAndNotBelongToGroup(condition) { + return !(condition.modified || condition.group); +} + +/** + * Checks whether or not a given reference is inside of a given node. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the node. + */ +function isInRange(node, reference) { + const or = node.range; + const ir = reference.identifier.range; + + return or[0] <= ir[0] && ir[1] <= or[1]; +} + +/** + * Checks whether or not a given reference is inside of a loop node's condition. + * @param {ASTNode} node A node to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the loop node's + * condition. + */ +const isInLoop = { + WhileStatement: isInRange, + DoWhileStatement: isInRange, + ForStatement(node, reference) { + return ( + isInRange(node, reference) && + !(node.init && isInRange(node.init, reference)) + ); + } +}; + +/** + * Gets the function which encloses a given reference. + * This supports only FunctionDeclaration. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} The function node or null. + */ +function getEncloseFunctionDeclaration(reference) { + let node = reference.identifier; + + while (node) { + if (node.type === "FunctionDeclaration") { + return node.id ? node : null; + } + + node = node.parent; + } + + return null; +} + +/** + * Updates the "modified" flags of given loop conditions with given modifiers. + * @param {LoopConditionInfo[]} conditions The loop conditions to be updated. + * @param {eslint-scope.Reference[]} modifiers The references to update. + * @returns {void} + */ +function updateModifiedFlag(conditions, modifiers) { + + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + for (let j = 0; !condition.modified && j < modifiers.length; ++j) { + const modifier = modifiers[j]; + let funcNode, funcVar; + + /* + * Besides checking for the condition being in the loop, we want to + * check the function that this modifier is belonging to is called + * in the loop. + * FIXME: This should probably be extracted to a function. + */ + const inLoop = condition.isInLoop(modifier) || Boolean( + (funcNode = getEncloseFunctionDeclaration(modifier)) && + (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) && + funcVar.references.some(condition.isInLoop) + ); + + condition.modified = inLoop; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unmodified loop conditions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unmodified-loop-condition" + }, + + schema: [], + + messages: { + loopConditionNotModified: "'{{name}}' is not modified in this loop." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let groupMap = null; + + /** + * Reports a given condition info. + * @param {LoopConditionInfo} condition A loop condition info to report. + * @returns {void} + */ + function report(condition) { + const node = condition.reference.identifier; + + context.report({ + node, + messageId: "loopConditionNotModified", + data: node + }); + } + + /** + * Registers given conditions to the group the condition belongs to. + * @param {LoopConditionInfo[]} conditions A loop condition info to + * register. + * @returns {void} + */ + function registerConditionsToGroup(conditions) { + for (let i = 0; i < conditions.length; ++i) { + const condition = conditions[i]; + + if (condition.group) { + let group = groupMap.get(condition.group); + + if (!group) { + group = []; + groupMap.set(condition.group, group); + } + group.push(condition); + } + } + } + + /** + * Reports references which are inside of unmodified groups. + * @param {LoopConditionInfo[]} conditions A loop condition info to report. + * @returns {void} + */ + function checkConditionsInGroup(conditions) { + if (conditions.every(isUnmodified)) { + conditions.forEach(report); + } + } + + /** + * Checks whether or not a given group node has any dynamic elements. + * @param {ASTNode} root A node to check. + * This node is one of BinaryExpression or ConditionalExpression. + * @returns {boolean} `true` if the node is dynamic. + */ + function hasDynamicExpressions(root) { + let retv = false; + + Traverser.traverse(root, { + visitorKeys: sourceCode.visitorKeys, + enter(node) { + if (DYNAMIC_PATTERN.test(node.type)) { + retv = true; + this.break(); + } else if (SKIP_PATTERN.test(node.type)) { + this.skip(); + } + } + }); + + return retv; + } + + /** + * Creates the loop condition information from a given reference. + * @param {eslint-scope.Reference} reference A reference to create. + * @returns {LoopConditionInfo|null} Created loop condition info, or null. + */ + function toLoopCondition(reference) { + if (reference.init) { + return null; + } + + let group = null; + let child = reference.identifier; + let node = child.parent; + + while (node) { + if (SENTINEL_PATTERN.test(node.type)) { + if (LOOP_PATTERN.test(node.type) && node.test === child) { + + // This reference is inside of a loop condition. + return { + reference, + group, + isInLoop: isInLoop[node.type].bind(null, node), + modified: false + }; + } + + // This reference is outside of a loop condition. + break; + } + + /* + * If it's inside of a group, OK if either operand is modified. + * So stores the group this reference belongs to. + */ + if (GROUP_PATTERN.test(node.type)) { + + // If this expression is dynamic, no need to check. + if (hasDynamicExpressions(node)) { + break; + } else { + group = node; + } + } + + child = node; + node = node.parent; + } + + return null; + } + + /** + * Finds unmodified references which are inside of a loop condition. + * Then reports the references which are outside of groups. + * @param {eslint-scope.Variable} variable A variable to report. + * @returns {void} + */ + function checkReferences(variable) { + + // Gets references that exist in loop conditions. + const conditions = variable + .references + .map(toLoopCondition) + .filter(Boolean); + + if (conditions.length === 0) { + return; + } + + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); + + // Check the conditions are modified. + const modifiers = variable.references.filter(isWriteReference); + + if (modifiers.length > 0) { + updateModifiedFlag(conditions, modifiers); + } + + /* + * Reports the conditions which are not belonging to groups. + * Others will be reported after all variables are done. + */ + conditions + .filter(isUnmodifiedAndNotBelongToGroup) + .forEach(report); + } + + return { + "Program:exit"() { + const queue = [context.getScope()]; + + groupMap = new Map(); + + let scope; + + while ((scope = queue.pop())) { + queue.push(...scope.childScopes); + scope.variables.forEach(checkReferences); + } + + groupMap.forEach(checkConditionsInGroup); + groupMap = null; + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unneeded-ternary.js new file mode 100644 index 0000000..0fefc42 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Rule to flag no-unneeded-ternary + * @author Gyandeep Singh + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +// Operators that always result in a boolean value +const BOOLEAN_OPERATORS = new Set(["==", "===", "!=", "!==", ">", ">=", "<", "<=", "in", "instanceof"]); +const OPERATOR_INVERSES = { + "==": "!=", + "!=": "==", + "===": "!==", + "!==": "===" + + // Operators like < and >= are not true inverses, since both will return false with NaN. +}; +const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operator: "||" }); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow ternary operators when simpler alternatives exist", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-unneeded-ternary" + }, + + schema: [ + { + type: "object", + properties: { + defaultAssignment: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + unnecessaryConditionalExpression: "Unnecessary use of boolean literals in conditional expression.", + unnecessaryConditionalAssignment: "Unnecessary use of conditional expression for default assignment." + } + }, + + create(context) { + const options = context.options[0] || {}; + const defaultAssignment = options.defaultAssignment !== false; + const sourceCode = context.getSourceCode(); + + /** + * Test if the node is a boolean literal + * @param {ASTNode} node The node to report. + * @returns {boolean} True if the its a boolean literal + * @private + */ + function isBooleanLiteral(node) { + return node.type === "Literal" && typeof node.value === "boolean"; + } + + /** + * Creates an expression that represents the boolean inverse of the expression represented by the original node + * @param {ASTNode} node A node representing an expression + * @returns {string} A string representing an inverted expression + */ + function invertExpression(node) { + if (node.type === "BinaryExpression" && Object.prototype.hasOwnProperty.call(OPERATOR_INVERSES, node.operator)) { + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const text = sourceCode.getText(); + + return text.slice(node.range[0], + operatorToken.range[0]) + OPERATOR_INVERSES[node.operator] + text.slice(operatorToken.range[1], node.range[1]); + } + + if (astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression" })) { + return `!(${astUtils.getParenthesisedText(sourceCode, node)})`; + } + return `!${astUtils.getParenthesisedText(sourceCode, node)}`; + } + + /** + * Tests if a given node always evaluates to a boolean value + * @param {ASTNode} node An expression node + * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value + */ + function isBooleanExpression(node) { + return node.type === "BinaryExpression" && BOOLEAN_OPERATORS.has(node.operator) || + node.type === "UnaryExpression" && node.operator === "!"; + } + + /** + * Test if the node matches the pattern id ? id : expression + * @param {ASTNode} node The ConditionalExpression to check. + * @returns {boolean} True if the pattern is matched, and false otherwise + * @private + */ + function matchesDefaultAssignment(node) { + return node.test.type === "Identifier" && + node.consequent.type === "Identifier" && + node.test.name === node.consequent.name; + } + + return { + + ConditionalExpression(node) { + if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { + context.report({ + node, + loc: node.consequent.loc.start, + messageId: "unnecessaryConditionalExpression", + fix(fixer) { + if (node.consequent.value === node.alternate.value) { + + // Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true` + return node.test.type === "Identifier" ? fixer.replaceText(node, node.consequent.value.toString()) : null; + } + if (node.alternate.value) { + + // Replace `foo() ? false : true` with `!(foo())` + return fixer.replaceText(node, invertExpression(node.test)); + } + + // Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise. + + return fixer.replaceText(node, isBooleanExpression(node.test) ? astUtils.getParenthesisedText(sourceCode, node.test) : `!${invertExpression(node.test)}`); + } + }); + } else if (!defaultAssignment && matchesDefaultAssignment(node)) { + context.report({ + node, + loc: node.consequent.loc.start, + messageId: "unnecessaryConditionalAssignment", + fix: fixer => { + const shouldParenthesizeAlternate = + ( + astUtils.getPrecedence(node.alternate) < OR_PRECEDENCE || + astUtils.isCoalesceExpression(node.alternate) + ) && + !astUtils.isParenthesised(sourceCode, node.alternate); + const alternateText = shouldParenthesizeAlternate + ? `(${sourceCode.getText(node.alternate)})` + : astUtils.getParenthesisedText(sourceCode, node.alternate); + const testText = astUtils.getParenthesisedText(sourceCode, node.test); + + return fixer.replaceText(node, `${testText} || ${alternateText}`); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable-loop.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable-loop.js new file mode 100644 index 0000000..868a6ff --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to disallow loops with a body that allows only one iteration + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const allLoopTypes = ["WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "ForOfStatement"]; + +/** + * Determines whether the given node is the first node in the code path to which a loop statement + * 'loops' for the next iteration. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a looping target. + */ +function isLoopingTarget(node) { + const parent = node.parent; + + if (parent) { + switch (parent.type) { + case "WhileStatement": + return node === parent.test; + case "DoWhileStatement": + return node === parent.body; + case "ForStatement": + return node === (parent.update || parent.test || parent.body); + case "ForInStatement": + case "ForOfStatement": + return node === parent.left; + + // no default + } + } + + return false; +} + +/** + * Creates an array with elements from the first given array that are not included in the second given array. + * @param {Array} arrA The array to compare from. + * @param {Array} arrB The array to compare against. + * @returns {Array} a new array that represents `arrA \ arrB`. + */ +function getDifference(arrA, arrB) { + return arrA.filter(a => !arrB.includes(a)); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow loops with a body that allows only one iteration", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-unreachable-loop" + }, + + schema: [{ + type: "object", + properties: { + ignore: { + type: "array", + items: { + enum: allLoopTypes + }, + uniqueItems: true + } + }, + additionalProperties: false + }], + + messages: { + invalid: "Invalid loop. Its body allows only one iteration." + } + }, + + create(context) { + const ignoredLoopTypes = context.options[0] && context.options[0].ignore || [], + loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes), + loopSelector = loopTypesToCheck.join(","), + loopsByTargetSegments = new Map(), + loopsToReport = new Set(); + + let currentCodePath = null; + + return { + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + [loopSelector](node) { + + /** + * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. + * For unreachable segments, the code path analysis does not raise events required for this implementation. + */ + if (currentCodePath.currentSegments.some(segment => segment.reachable)) { + loopsToReport.add(node); + } + }, + + onCodePathSegmentStart(segment, node) { + if (isLoopingTarget(node)) { + const loop = node.parent; + + loopsByTargetSegments.set(segment, loop); + } + }, + + onCodePathSegmentLoop(_, toSegment, node) { + const loop = loopsByTargetSegments.get(toSegment); + + /** + * The second iteration is reachable, meaning that the loop is valid by the logic of this rule, + * only if there is at least one loop event with the appropriate target (which has been already + * determined in the `loopsByTargetSegments` map), raised from either: + * + * - the end of the loop's body (in which case `node === loop`) + * - a `continue` statement + * + * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes. + */ + if (node === loop || node.type === "ContinueStatement") { + + // Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw. + loopsToReport.delete(loop); + } + }, + + "Program:exit"() { + loopsToReport.forEach( + node => context.report({ node, messageId: "invalid" }) + ); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable.js new file mode 100644 index 0000000..415631a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unreachable.js @@ -0,0 +1,218 @@ +/** + * @fileoverview Checks for unreachable code due to return, throws, break, and continue. + * @author Joel Feenstra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable declarator has the initializer. + * @param {ASTNode} node A VariableDeclarator node to check. + * @returns {boolean} `true` if the node has the initializer. + */ +function isInitialized(node) { + return Boolean(node.init); +} + +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} + +/** + * The class to distinguish consecutive unreachable statements. + */ +class ConsecutiveRange { + constructor(sourceCode) { + this.sourceCode = sourceCode; + this.startNode = null; + this.endNode = null; + } + + /** + * The location object of this range. + * @type {Object} + */ + get location() { + return { + start: this.startNode.loc.start, + end: this.endNode.loc.end + }; + } + + /** + * `true` if this range is empty. + * @type {boolean} + */ + get isEmpty() { + return !(this.startNode && this.endNode); + } + + /** + * Checks whether the given node is inside of this range. + * @param {ASTNode|Token} node The node to check. + * @returns {boolean} `true` if the node is inside of this range. + */ + contains(node) { + return ( + node.range[0] >= this.startNode.range[0] && + node.range[1] <= this.endNode.range[1] + ); + } + + /** + * Checks whether the given node is consecutive to this range. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is consecutive to this range. + */ + isConsecutive(node) { + return this.contains(this.sourceCode.getTokenBefore(node)); + } + + /** + * Merges the given node to this range. + * @param {ASTNode} node The node to merge. + * @returns {void} + */ + merge(node) { + this.endNode = node; + } + + /** + * Resets this range by the given node or null. + * @param {ASTNode|null} node The node to reset, or null. + * @returns {void} + */ + reset(node) { + this.startNode = this.endNode = node; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unreachable" + }, + + schema: [], + + messages: { + unreachableCode: "Unreachable code." + } + }, + + create(context) { + let currentCodePath = null; + + const range = new ConsecutiveRange(context.getSourceCode()); + + /** + * Reports a given node if it's unreachable. + * @param {ASTNode} node A statement node to report. + * @returns {void} + */ + function reportIfUnreachable(node) { + let nextNode = null; + + if (node && currentCodePath.currentSegments.every(isUnreachable)) { + + // Store this statement to distinguish consecutive statements. + if (range.isEmpty) { + range.reset(node); + return; + } + + // Skip if this statement is inside of the current range. + if (range.contains(node)) { + return; + } + + // Merge if this statement is consecutive to the current range. + if (range.isConsecutive(node)) { + range.merge(node); + return; + } + + nextNode = node; + } + + /* + * Report the current range since this statement is reachable or is + * not consecutive to the current range. + */ + if (!range.isEmpty) { + context.report({ + messageId: "unreachableCode", + loc: range.location, + node: range.startNode + }); + } + + // Update the current range. + range.reset(nextNode); + } + + return { + + // Manages the current code path. + onCodePathStart(codePath) { + currentCodePath = codePath; + }, + + onCodePathEnd() { + currentCodePath = currentCodePath.upper; + }, + + // Registers for all statement nodes (excludes FunctionDeclaration). + BlockStatement: reportIfUnreachable, + BreakStatement: reportIfUnreachable, + ClassDeclaration: reportIfUnreachable, + ContinueStatement: reportIfUnreachable, + DebuggerStatement: reportIfUnreachable, + DoWhileStatement: reportIfUnreachable, + ExpressionStatement: reportIfUnreachable, + ForInStatement: reportIfUnreachable, + ForOfStatement: reportIfUnreachable, + ForStatement: reportIfUnreachable, + IfStatement: reportIfUnreachable, + ImportDeclaration: reportIfUnreachable, + LabeledStatement: reportIfUnreachable, + ReturnStatement: reportIfUnreachable, + SwitchStatement: reportIfUnreachable, + ThrowStatement: reportIfUnreachable, + TryStatement: reportIfUnreachable, + + VariableDeclaration(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); + } + }, + + WhileStatement: reportIfUnreachable, + WithStatement: reportIfUnreachable, + ExportNamedDeclaration: reportIfUnreachable, + ExportDefaultDeclaration: reportIfUnreachable, + ExportAllDeclaration: reportIfUnreachable, + + "Program:exit"() { + reportIfUnreachable(); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-finally.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-finally.js new file mode 100644 index 0000000..11bf06e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -0,0 +1,111 @@ +/** + * @fileoverview Rule to flag unsafe statements in finally block + * @author Onur Temizkan + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_NODE_TYPE_RETURN_THROW = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const SENTINEL_NODE_TYPE_BREAK = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u; +const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u; + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow control flow statements in `finally` blocks", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-finally" + }, + + schema: [], + + messages: { + unsafeUsage: "Unsafe usage of {{nodeType}}." + } + }, + create(context) { + + /** + * Checks if the node is the finalizer of a TryStatement + * @param {ASTNode} node node to check. + * @returns {boolean} - true if the node is the finalizer of a TryStatement + */ + function isFinallyBlock(node) { + return node.parent.type === "TryStatement" && node.parent.finalizer === node; + } + + /** + * Climbs up the tree if the node is not a sentinel node + * @param {ASTNode} node node to check. + * @param {string} label label of the break or continue statement + * @returns {boolean} - return whether the node is a finally block or a sentinel node + */ + function isInFinallyBlock(node, label) { + let labelInside = false; + let sentinelNodeType; + + if (node.type === "BreakStatement" && !node.label) { + sentinelNodeType = SENTINEL_NODE_TYPE_BREAK; + } else if (node.type === "ContinueStatement") { + sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE; + } else { + sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW; + } + + for ( + let currentNode = node; + currentNode && !sentinelNodeType.test(currentNode.type); + currentNode = currentNode.parent + ) { + if (currentNode.parent.label && label && (currentNode.parent.label.name === label.name)) { + labelInside = true; + } + if (isFinallyBlock(currentNode)) { + if (label && labelInside) { + return false; + } + return true; + } + } + return false; + } + + /** + * Checks whether the possibly-unsafe statement is inside a finally block. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + if (isInFinallyBlock(node, node.label)) { + context.report({ + messageId: "unsafeUsage", + data: { + nodeType: node.type + }, + node, + line: node.loc.line, + column: node.loc.column + }); + } + } + + return { + ReturnStatement: check, + ThrowStatement: check, + BreakStatement: check, + ContinueStatement: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-negation.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-negation.js new file mode 100644 index 0000000..a9c2ee7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to disallow negating the left operand of relational operators + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether the given operator is `in` or `instanceof` + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is `in` or `instanceof` + */ +function isInOrInstanceOfOperator(op) { + return op === "in" || op === "instanceof"; +} + +/** + * Checks whether the given operator is an ordering relational operator or not. + * @param {string} op The operator type to check. + * @returns {boolean} `true` if the operator is an ordering relational operator. + */ +function isOrderingRelationalOperator(op) { + return op === "<" || op === ">" || op === ">=" || op === "<="; +} + +/** + * Checks whether the given node is a logical negation expression or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a logical negation expression. + */ +function isNegation(node) { + return node.type === "UnaryExpression" && node.operator === "!"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow negating the left operand of relational operators", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/no-unsafe-negation", + suggestion: true + }, + + schema: [ + { + type: "object", + properties: { + enforceForOrderingRelations: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: null, + + messages: { + unexpected: "Unexpected negating the left operand of '{{operator}}' operator.", + suggestNegatedExpression: "Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.", + suggestParenthesisedNegation: "Wrap negation in '()' to make the intention explicit. This preserves the current behavior." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const enforceForOrderingRelations = options.enforceForOrderingRelations === true; + + return { + BinaryExpression(node) { + const operator = node.operator; + const orderingRelationRuleApplies = enforceForOrderingRelations && isOrderingRelationalOperator(operator); + + if ( + (isInOrInstanceOfOperator(operator) || orderingRelationRuleApplies) && + isNegation(node.left) && + !astUtils.isParenthesised(sourceCode, node.left) + ) { + context.report({ + node, + loc: node.left.loc, + messageId: "unexpected", + data: { operator }, + suggest: [ + { + messageId: "suggestNegatedExpression", + data: { operator }, + fix(fixer) { + const negationToken = sourceCode.getFirstToken(node.left); + const fixRange = [negationToken.range[1], node.range[1]]; + const text = sourceCode.text.slice(fixRange[0], fixRange[1]); + + return fixer.replaceTextRange(fixRange, `(${text})`); + } + }, + { + messageId: "suggestParenthesisedNegation", + fix(fixer) { + return fixer.replaceText(node.left, `(${sourceCode.getText(node.left)})`); + } + } + ] + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unused-expressions.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-expressions.js new file mode 100644 index 0000000..8c049f5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -0,0 +1,140 @@ +/** + * @fileoverview Flag expressions in statement position that do not side effect + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused expressions", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-unused-expressions" + }, + + schema: [ + { + type: "object", + properties: { + allowShortCircuit: { + type: "boolean", + default: false + }, + allowTernary: { + type: "boolean", + default: false + }, + allowTaggedTemplates: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + unusedExpression: "Expected an assignment or function call and instead saw an expression." + } + }, + + create(context) { + const config = context.options[0] || {}, + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false, + allowTaggedTemplates = config.allowTaggedTemplates || false; + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {Function} predicate ([a] -> Boolean) the function used to make the determination + * @param {a[]} list the input list + * @returns {a[]} the leading sequence of members in the given list that pass the given predicate + */ + function takeWhile(predicate, list) { + for (let i = 0; i < list.length; ++i) { + if (!predicate(list[i])) { + return list.slice(0, i); + } + } + return list.slice(); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node a Program or BlockStatement node + * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body + */ + function directives(node) { + return takeWhile(looksLikeDirective, node.body); + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @param {ASTNode[]} ancestors the given node's ancestors + * @returns {boolean} whether the given node is considered a directive in its current position + */ + function isDirective(node, ancestors) { + const parent = ancestors[ancestors.length - 1], + grandparent = ancestors[ancestors.length - 2]; + + return (parent.type === "Program" || parent.type === "BlockStatement" && + (/Function/u.test(grandparent.type))) && + directives(parent).indexOf(node) >= 0; + } + + /** + * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags. + * @param {ASTNode} node any node + * @returns {boolean} whether the given node is a valid expression + */ + function isValidExpression(node) { + if (allowTernary) { + + // Recursive check for ternary and logical expressions + if (node.type === "ConditionalExpression") { + return isValidExpression(node.consequent) && isValidExpression(node.alternate); + } + } + + if (allowShortCircuit) { + if (node.type === "LogicalExpression") { + return isValidExpression(node.right); + } + } + + if (allowTaggedTemplates && node.type === "TaggedTemplateExpression") { + return true; + } + + return /^(?:Assignment|Call|New|Update|Yield|Await|Import)Expression$/u.test(node.type) || + (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0); + } + + return { + ExpressionStatement(node) { + if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) { + context.report({ node, messageId: "unusedExpression" }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unused-labels.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-labels.js new file mode 100644 index 0000000..b33fcb7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to disallow unused labels. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unused labels", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-labels" + }, + + schema: [], + + fixable: "code", + + messages: { + unused: "'{{name}}:' is defined but never used." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Adds a scope info to the stack. + * @param {ASTNode} node A node to add. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledScope(node) { + scopeInfo = { + label: node.label.name, + used: false, + upper: scopeInfo + }; + } + + /** + * Removes the top of the stack. + * At the same time, this reports the label if it's never used. + * @param {ASTNode} node A node to report. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledScope(node) { + if (!scopeInfo.used) { + context.report({ + node: node.label, + messageId: "unused", + data: node.label, + fix(fixer) { + + /* + * Only perform a fix if there are no comments between the label and the body. This will be the case + * when there is exactly one token/comment (the ":") between the label and the body. + */ + if (sourceCode.getTokenAfter(node.label, { includeComments: true }) === + sourceCode.getTokenBefore(node.body, { includeComments: true })) { + return fixer.removeRange([node.range[0], node.body.range[0]]); + } + + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Marks the label of a given node as used. + * @param {ASTNode} node A node to mark. This is a BreakStatement or + * ContinueStatement. + * @returns {void} + */ + function markAsUsed(node) { + if (!node.label) { + return; + } + + const label = node.label.name; + let info = scopeInfo; + + while (info) { + if (info.label === label) { + info.used = true; + break; + } + info = info.upper; + } + } + + return { + LabeledStatement: enterLabeledScope, + "LabeledStatement:exit": exitLabeledScope, + BreakStatement: markAsUsed, + ContinueStatement: markAsUsed + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-unused-vars.js b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-vars.js new file mode 100644 index 0000000..4dc6dc2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-unused-vars.js @@ -0,0 +1,648 @@ +/** + * @fileoverview Rule to flag declared but unused variables + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * Bag of data used for formatting the `unusedVar` lint message. + * @typedef {Object} UnusedVarMessageData + * @property {string} varName The name of the unused var. + * @property {'defined'|'assigned a value'} action Description of the vars state. + * @property {string} additional Any additional info to be appended at the end. + */ + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow unused variables", + category: "Variables", + recommended: true, + url: "https://eslint.org/docs/rules/no-unused-vars" + }, + + schema: [ + { + oneOf: [ + { + enum: ["all", "local"] + }, + { + type: "object", + properties: { + vars: { + enum: ["all", "local"] + }, + varsIgnorePattern: { + type: "string" + }, + args: { + enum: ["all", "after-used", "none"] + }, + ignoreRestSiblings: { + type: "boolean" + }, + argsIgnorePattern: { + type: "string" + }, + caughtErrors: { + enum: ["all", "none"] + }, + caughtErrorsIgnorePattern: { + type: "string" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; + + const config = { + vars: "all", + args: "after-used", + ignoreRestSiblings: false, + caughtErrors: "none" + }; + + const firstOption = context.options[0]; + + if (firstOption) { + if (typeof firstOption === "string") { + config.vars = firstOption; + } else { + config.vars = firstOption.vars || config.vars; + config.args = firstOption.args || config.args; + config.ignoreRestSiblings = firstOption.ignoreRestSiblings || config.ignoreRestSiblings; + config.caughtErrors = firstOption.caughtErrors || config.caughtErrors; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, "u"); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, "u"); + } + + if (firstOption.caughtErrorsIgnorePattern) { + config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, "u"); + } + } + } + + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const defType = unusedVar.defs && unusedVar.defs[0] && unusedVar.defs[0].type; + let type; + let pattern; + + if (defType === "CatchClause" && config.caughtErrorsIgnorePattern) { + type = "args"; + pattern = config.caughtErrorsIgnorePattern.toString(); + } else if (defType === "Parameter" && config.argsIgnorePattern) { + type = "args"; + pattern = config.argsIgnorePattern.toString(); + } else if (defType !== "Parameter" && config.varsIgnorePattern) { + type = "vars"; + pattern = config.varsIgnorePattern.toString(); + } + + const additional = type ? `. Allowed unused ${type} must match ${pattern}` : ""; + + return { + varName: unusedVar.name, + action: "defined", + additional + }; + } + + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param {Variable} unusedVar eslint-scope variable object. + * @returns {UnusedVarMessageData} The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const additional = config.varsIgnorePattern ? `. Allowed unused vars must match ${config.varsIgnorePattern.toString()}` : ""; + + return { + varName: unusedVar.name, + action: "assigned a value", + additional + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const STATEMENT_TYPE = /(?:Statement|Declaration)$/u; + + /** + * Determines if a given variable is being exported from a module. + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function isExported(variable) { + + const definition = variable.defs[0]; + + if (definition) { + + let node = definition.node; + + if (node.type === "VariableDeclarator") { + node = node.parent; + } else if (definition.type === "Parameter") { + return false; + } + + return node.parent.type.indexOf("Export") === 0; + } + return false; + + } + + /** + * Determines if a variable has a sibling rest property + * @param {Variable} variable eslint-scope variable object. + * @returns {boolean} True if the variable is exported, false if not. + * @private + */ + function hasRestSpreadSibling(variable) { + if (config.ignoreRestSiblings) { + return variable.defs.some(def => { + const propertyNode = def.name.parent; + const patternNode = propertyNode.parent; + + return ( + propertyNode.type === "Property" && + patternNode.type === "ObjectPattern" && + REST_PROPERTY_TYPE.test(patternNode.properties[patternNode.properties.length - 1].type) + ); + }); + } + + return false; + } + + /** + * Determines if a reference is a read operation. + * @param {Reference} ref An eslint-scope Reference + * @returns {boolean} whether the given reference represents a read operation + * @private + */ + function isReadRef(ref) { + return ref.isRead(); + } + + /** + * Determine if an identifier is referencing an enclosing function name. + * @param {Reference} ref The reference to check. + * @param {ASTNode[]} nodes The candidate function nodes. + * @returns {boolean} True if it's a self-reference, false if not. + * @private + */ + function isSelfReference(ref, nodes) { + let scope = ref.from; + + while (scope) { + if (nodes.indexOf(scope.block) >= 0) { + return true; + } + + scope = scope.upper; + } + + return false; + } + + /** + * Gets a list of function definitions for a specified variable. + * @param {Variable} variable eslint-scope variable object. + * @returns {ASTNode[]} Function nodes. + * @private + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = []; + + variable.defs.forEach(def => { + const { type, node } = def; + + // FunctionDeclarations + if (type === "FunctionName") { + functionDefinitions.push(node); + } + + // FunctionExpressions + if (type === "Variable" && node.init && + (node.init.type === "FunctionExpression" || node.init.type === "ArrowFunctionExpression")) { + functionDefinitions.push(node.init); + } + }); + return functionDefinitions; + } + + /** + * Checks the position of given nodes. + * @param {ASTNode} inner A node which is expected as inside. + * @param {ASTNode} outer A node which is expected as outside. + * @returns {boolean} `true` if the `inner` node exists in the `outer` node. + * @private + */ + function isInside(inner, outer) { + return ( + inner.range[0] >= outer.range[0] && + inner.range[1] <= outer.range[1] + ); + } + + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} prevRhsNode The previous RHS node. + * @returns {ASTNode|null} The RHS node or null. + * @private + */ + function getRhsNode(ref, prevRhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + const refScope = ref.from.variableScope; + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || astUtils.isInLoop(id); + + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + + if (parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + id === parent.left && + !canBeUsedLater + ) { + return parent.right; + } + return null; + } + + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param {ASTNode} funcNode A function node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + * @private + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case "SequenceExpression": + if (parent.expressions[parent.expressions.length - 1] !== node) { + return false; + } + break; + + case "CallExpression": + case "NewExpression": + return parent.callee !== node; + + case "AssignmentExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + return true; + + default: + if (STATEMENT_TYPE.test(parent.type)) { + + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + + node = parent; + parent = parent.parent; + } + + return false; + } + + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param {ASTNode} id An Identifier node to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later. + * @private + */ + function isInsideOfStorableFunction(id, rhsNode) { + const funcNode = astUtils.getUpperFunction(id); + + return ( + funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode) + ); + } + + /** + * Checks whether a given reference is a read to update itself or not. + * @param {eslint-scope.Reference} ref A reference to check. + * @param {ASTNode} rhsNode The RHS node of the previous assignment. + * @returns {boolean} The reference is a read to update itself. + * @private + */ + function isReadForItself(ref, rhsNode) { + const id = ref.identifier; + const parent = id.parent; + const grandparent = parent.parent; + + return ref.isRead() && ( + + // self update. e.g. `a += 1`, `a++` + (// in RHS of an assignment for itself. e.g. `a = a + 1` + (( + parent.type === "AssignmentExpression" && + grandparent.type === "ExpressionStatement" && + parent.left === id + ) || + ( + parent.type === "UpdateExpression" && + grandparent.type === "ExpressionStatement" + ) || rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode))) + ); + } + + /** + * Determine if an identifier is used either in for-in loops. + * @param {Reference} ref The reference to check. + * @returns {boolean} whether reference is used in the for-in loops + * @private + */ + function isForInRef(ref) { + let target = ref.identifier.parent; + + + // "for (var ...) { return; }" + if (target.type === "VariableDeclarator") { + target = target.parent.parent; + } + + if (target.type !== "ForInStatement") { + return false; + } + + // "for (...) { return; }" + if (target.body.type === "BlockStatement") { + target = target.body.body[0]; + + // "for (...) return;" + } else { + target = target.body; + } + + // For empty loop body + if (!target) { + return false; + } + + return target.type === "ReturnStatement"; + } + + /** + * Determines if the variable is used. + * @param {Variable} variable The variable to check. + * @returns {boolean} True if the variable is used + * @private + */ + function isUsedVariable(variable) { + const functionNodes = getFunctionDefinitions(variable), + isFunctionDefinition = functionNodes.length > 0; + let rhsNode = null; + + return variable.references.some(ref => { + if (isForInRef(ref)) { + return true; + } + + const forItself = isReadForItself(ref, rhsNode); + + rhsNode = getRhsNode(ref, rhsNode); + + return ( + isReadRef(ref) && + !forItself && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) + ); + }); + } + + /** + * Checks whether the given variable is after the last used parameter. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is defined after the last + * used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = context.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + + /** + * Gets an array of variables without read references. + * @param {Scope} scope an eslint-scope Scope object. + * @param {Variable[]} unusedVars an array that saving result. + * @returns {Variable[]} unused variables of the scope and descendant scopes. + * @private + */ + function collectUnusedVariables(scope, unusedVars) { + const variables = scope.variables; + const childScopes = scope.childScopes; + let i, l; + + if (scope.type !== "global" || config.vars === "all") { + for (i = 0, l = variables.length; i < l; ++i) { + const variable = variables[i]; + + // skip a variable of class itself name in the class scope + if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { + continue; + } + + // skip function expression names and variables marked with markVariableAsUsed() + if (scope.functionExpressionScope || variable.eslintUsed) { + continue; + } + + // skip implicit "arguments" variable + if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { + continue; + } + + // explicit global variables don't have definitions. + const def = variable.defs[0]; + + if (def) { + const type = def.type; + + // skip catch variables + if (type === "CatchClause") { + if (config.caughtErrors === "none") { + continue; + } + + // skip ignored parameters + if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) { + continue; + } + } + + if (type === "Parameter") { + + // skip any setter argument + if ((def.node.parent.type === "Property" || def.node.parent.type === "MethodDefinition") && def.node.parent.kind === "set") { + continue; + } + + // if "args" option is "none", skip any parameter + if (config.args === "none") { + continue; + } + + // skip ignored parameters + if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { + continue; + } + + // if "args" option is "after-used", skip used variables + if (config.args === "after-used" && astUtils.isFunction(def.name.parent) && !isAfterLastUsedArg(variable)) { + continue; + } + } else { + + // skip ignored variables + if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { + continue; + } + } + } + + if (!isUsedVariable(variable) && !isExported(variable) && !hasRestSpreadSibling(variable)) { + unusedVars.push(variable); + } + } + } + + for (i = 0, l = childScopes.length; i < l; ++i) { + collectUnusedVariables(childScopes[i], unusedVars); + } + + return unusedVars; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "Program:exit"(programNode) { + const unusedVars = collectUnusedVariables(context.getScope(), []); + + for (let i = 0, l = unusedVars.length; i < l; ++i) { + const unusedVar = unusedVars[i]; + + // Report the first declaration. + if (unusedVar.defs.length > 0) { + context.report({ + node: unusedVar.references.length ? unusedVar.references[ + unusedVar.references.length - 1 + ].identifier : unusedVar.identifiers[0], + messageId: "unusedVar", + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar) + }); + + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } else if (unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + + context.report({ + node: programNode, + loc: astUtils.getNameLocationInGlobalDirectiveComment(sourceCode, directiveComment, unusedVar.name), + messageId: "unusedVar", + data: getDefinedMessageData(unusedVar) + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-use-before-define.js b/day1/cli-study/node_modules/eslint/lib/rules/no-use-before-define.js new file mode 100644 index 0000000..c730056 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-use-before-define.js @@ -0,0 +1,233 @@ +/** + * @fileoverview Rule to flag use of variables before they are defined + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; +const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; + +/** + * Parses a given value as options. + * @param {any} options A value to parse. + * @returns {Object} The parsed options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let variables = true; + + if (typeof options === "string") { + functions = (options !== "nofunc"); + } else if (typeof options === "object" && options !== null) { + functions = options.functions !== false; + classes = options.classes !== false; + variables = options.variables !== false; + } + + return { functions, classes, variables }; +} + +/** + * Checks whether or not a given variable is a function declaration. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a class declaration. + */ +function isOuterClass(variable, reference) { + return ( + variable.defs[0].type === "ClassName" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + * @param {eslint-scope.Variable} variable A variable to check. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the variable is a variable declaration. + */ +function isOuterVariable(variable, reference) { + return ( + variable.defs[0].type === "Variable" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given location is inside of the range of a given node. + * @param {ASTNode} node An node to check. + * @param {number} location A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; +} + +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * This returns `true` in the following cases: + * + * var a = a + * var [a = a] = list + * var {a = a} = obj + * for (var a in a) {} + * for (var a of a) {} + * @param {Variable} variable A variable to check. + * @param {Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the initializers. + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + if (FOR_IN_OF_TYPE.test(node.parent.parent.type) && + isInRange(node.parent.parent.right, location) + ) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow the use of variables before they are defined", + category: "Variables", + recommended: false, + url: "https://eslint.org/docs/rules/no-use-before-define" + }, + + schema: [ + { + oneOf: [ + { + enum: ["nofunc"] + }, + { + type: "object", + properties: { + functions: { type: "boolean" }, + classes: { type: "boolean" }, + variables: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + usedBeforeDefined: "'{{name}}' was used before it was defined." + } + }, + + create(context) { + const options = parseOptions(context.options[0]); + + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param {eslint-scope.Variable} variable The variable that gets used before being defined + * @param {eslint-scope.Reference} reference The reference to the variable + * @returns {boolean} `true` if the usage should be reported + */ + function isForbidden(variable, reference) { + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + return true; + } + + /** + * Finds and validates all variables in a given scope. + * @param {Scope} scope The scope object. + * @returns {void} + * @private + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + + /* + * Skips when the reference is: + * - initialization's. + * - referring to an undefined variable. + * - referring to a global environment variable (there're no identifiers). + * - located preceded by the variable (except in initializers). + * - allowed by options. + */ + if (reference.init || + !variable || + variable.identifiers.length === 0 || + (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) || + !isForbidden(variable, reference) + ) { + return; + } + + // Reports. + context.report({ + node: reference.identifier, + messageId: "usedBeforeDefined", + data: reference.identifier + }); + }); + + scope.childScopes.forEach(findVariablesInScope); + } + + return { + Program() { + findVariablesInScope(context.getScope()); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-backreference.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-backreference.js new file mode 100644 index 0000000..958e3d5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -0,0 +1,193 @@ +/** + * @fileoverview Rule to disallow useless backreferences in regular expressions + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("regexpp"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new RegExpParser(); + +/** + * Finds the path from the given `regexpp` AST node to the root node. + * @param {regexpp.Node} node Node. + * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node. + */ +function getPathToRoot(node) { + const path = []; + let current = node; + + do { + path.push(current); + current = current.parent; + } while (current); + + return path; +} + +/** + * Determines whether the given `regexpp` AST node is a lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a lookaround node. + */ +function isLookaround(node) { + return node.type === "Assertion" && + (node.kind === "lookahead" || node.kind === "lookbehind"); +} + +/** + * Determines whether the given `regexpp` AST node is a negative lookaround node. + * @param {regexpp.Node} node Node. + * @returns {boolean} `true` if it is a negative lookaround node. + */ +function isNegativeLookaround(node) { + return isLookaround(node) && node.negate; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow useless backreferences in regular expressions", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-backreference" + }, + + schema: [], + + messages: { + nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' from within that group.", + forward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears later in the pattern.", + backward: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which appears before in the same lookbehind.", + disjunctive: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in another alternative.", + intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in a negative lookaround." + } + }, + + create(context) { + + /** + * Checks and reports useless backreferences in the given regular expression. + * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call. + * @param {string} pattern Regular expression pattern. + * @param {string} flags Regular expression flags. + * @returns {void} + */ + function checkRegex(node, pattern, flags) { + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + visitRegExpAST(regExpAST, { + onBackreferenceEnter(bref) { + const group = bref.resolved, + brefPath = getPathToRoot(bref), + groupPath = getPathToRoot(group); + let messageId = null; + + if (brefPath.includes(group)) { + + // group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match. + messageId = "nested"; + } else { + + // Start from the root to find the lowest common ancestor. + let i = brefPath.length - 1, + j = groupPath.length - 1; + + do { + i--; + j--; + } while (brefPath[i] === groupPath[j]); + + const indexOfLowestCommonAncestor = j + 1, + groupCut = groupPath.slice(0, indexOfLowestCommonAncestor), + commonPath = groupPath.slice(indexOfLowestCommonAncestor), + lowestCommonLookaround = commonPath.find(isLookaround), + isMatchingBackward = lowestCommonLookaround && lowestCommonLookaround.kind === "lookbehind"; + + if (!isMatchingBackward && bref.end <= group.start) { + + // bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match. + messageId = "forward"; + } else if (isMatchingBackward && group.end <= bref.start) { + + // the opposite of the previous when the regex is matching backward in a lookbehind context. + messageId = "backward"; + } else if (lodash.last(groupCut).type === "Alternative") { + + // group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive. + messageId = "disjunctive"; + } else if (groupCut.some(isNegativeLookaround)) { + + // group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match. + messageId = "intoNegativeLookaround"; + } + } + + if (messageId) { + context.report({ + node, + messageId, + data: { + bref: bref.raw, + group: group.raw + } + }); + } + } + }); + } + + return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; + + checkRegex(node, pattern, flags); + }, + Program() { + const scope = context.getScope(), + tracker = new ReferenceTracker(scope), + traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const [patternNode, flagsNode] = node.arguments, + pattern = getStringIfConstant(patternNode, scope), + flags = getStringIfConstant(flagsNode, scope); + + if (typeof pattern === "string") { + checkRegex(node, pattern, flags || ""); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-call.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-call.js new file mode 100644 index 0000000..afc729d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-call.js @@ -0,0 +1,87 @@ +/** + * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.call()`/`.apply()`. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. + */ +function isCallOrNonVariadicApply(node) { + return ( + node.callee.type === "MemberExpression" && + node.callee.property.type === "Identifier" && + node.callee.computed === false && + ( + (node.callee.property.name === "call" && node.arguments.length >= 1) || + (node.callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") + ) + ); +} + + +/** + * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, sourceCode) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, sourceCode); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary calls to `.call()` and `.apply()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-call" + }, + + schema: [], + + messages: { + unnecessaryCall: "Unnecessary '.{{name}}()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isCallOrNonVariadicApply(node)) { + return; + } + + const applied = node.callee.object; + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ node, messageId: "unnecessaryCall", data: { name: node.callee.property.name } }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-catch.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-catch.js new file mode 100644 index 0000000..f303c27 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-catch.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Reports useless `catch` clauses that just rethrow their error. + * @author Teddy Katz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary `catch` clauses", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-catch" + }, + + schema: [], + + messages: { + unnecessaryCatchClause: "Unnecessary catch clause.", + unnecessaryCatch: "Unnecessary try/catch wrapper." + } + }, + + create(context) { + return { + CatchClause(node) { + if ( + node.param && + node.param.type === "Identifier" && + node.body.body.length && + node.body.body[0].type === "ThrowStatement" && + node.body.body[0].argument.type === "Identifier" && + node.body.body[0].argument.name === node.param.name + ) { + if (node.parent.finalizer) { + context.report({ + node, + messageId: "unnecessaryCatchClause" + }); + } else { + context.report({ + node: node.parent, + messageId: "unnecessaryCatch" + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-computed-key.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-computed-key.js new file mode 100644 index 0000000..e0505a3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -0,0 +1,103 @@ +/** + * @fileoverview Rule to disallow unnecessary computed property keys in object literals + * @author Burak Yigit Kaya + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary computed property keys in objects and classes", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-computed-key" + }, + + schema: [{ + type: "object", + properties: { + enforceForClassMembers: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], + fixable: "code", + + messages: { + unnecessarilyComputedProperty: "Unnecessarily computed property [{{property}}] found." + } + }, + create(context) { + const sourceCode = context.getSourceCode(); + const enforceForClassMembers = context.options[0] && context.options[0].enforceForClassMembers; + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function check(node) { + if (!node.computed) { + return; + } + + const key = node.key, + nodeType = typeof key.value; + + let allowedKey; + + if (node.type === "MethodDefinition") { + allowedKey = node.static ? "prototype" : "constructor"; + } else { + allowedKey = "__proto__"; + } + + if (key.type === "Literal" && (nodeType === "string" || nodeType === "number") && key.value !== allowedKey) { + context.report({ + node, + messageId: "unnecessarilyComputedProperty", + data: { property: sourceCode.getText(key) }, + fix(fixer) { + const leftSquareBracket = sourceCode.getTokenBefore(key, astUtils.isOpeningBracketToken); + const rightSquareBracket = sourceCode.getTokenAfter(key, astUtils.isClosingBracketToken); + + // If there are comments between the brackets and the property name, don't do a fix. + if (sourceCode.commentsExistBetween(leftSquareBracket, rightSquareBracket)) { + return null; + } + + const tokenBeforeLeftBracket = sourceCode.getTokenBefore(leftSquareBracket); + + // Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} }) + const needsSpaceBeforeKey = tokenBeforeLeftBracket.range[1] === leftSquareBracket.range[0] && + !astUtils.canTokensBeAdjacent(tokenBeforeLeftBracket, sourceCode.getFirstToken(key)); + + const replacementKey = (needsSpaceBeforeKey ? " " : "") + key.raw; + + return fixer.replaceTextRange([leftSquareBracket.range[0], rightSquareBracket.range[1]], replacementKey); + } + }); + } + } + + return { + Property: check, + MethodDefinition: enforceForClassMembers ? check : lodash.noop + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-concat.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-concat.js new file mode 100644 index 0000000..cfc60c8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,115 @@ +/** + * @fileoverview disallow unnecessary concatenation of template strings + * @author Henry Zhu + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Checks if the given token is a `+` token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a `+` token. + */ +function isConcatOperatorToken(token) { + return token.value === "+" && token.type === "Punctuator"; +} + +/** + * Get's the right most node on the left side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getLeft(node) { + let left = node.left; + + while (isConcatenation(left)) { + left = left.right; + } + return left; +} + +/** + * Get's the left most node on the right side of a BinaryExpression with + operator. + * @param {ASTNode} node A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getRight(node) { + let right = node.right; + + while (isConcatenation(right)) { + right = right.left; + } + return right; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary concatenation of literals or template literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-concat" + }, + + schema: [], + + messages: { + unexpectedConcat: "Unexpected string concatenation of literals." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + BinaryExpression(node) { + + // check if not concatenation + if (node.operator !== "+") { + return; + } + + // account for the `foo + "a" + "b"` case + const left = getLeft(node); + const right = getRight(node); + + if (astUtils.isStringLiteral(left) && + astUtils.isStringLiteral(right) && + astUtils.isTokenOnSameLine(left, right) + ) { + const operatorToken = sourceCode.getFirstTokenBetween(left, right, isConcatOperatorToken); + + context.report({ + node, + loc: operatorToken.loc, + messageId: "unexpectedConcat" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-constructor.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-constructor.js new file mode 100644 index 0000000..4c34aed --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Rule to flag the use of redundant constructors in classes. + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given array of statements is a single call of `super`. + * @param {ASTNode[]} body An array of statements to check. + * @returns {boolean} `true` if the body is a single call of `super`. + */ +function isSingleSuperCall(body) { + return ( + body.length === 1 && + body[0].type === "ExpressionStatement" && + body[0].expression.type === "CallExpression" && + body[0].expression.callee.type === "Super" + ); +} + +/** + * Checks whether a given node is a pattern which doesn't have any side effects. + * Default parameters and Destructuring parameters can have side effects. + * @param {ASTNode} node A pattern node. + * @returns {boolean} `true` if the node doesn't have any side effects. + */ +function isSimple(node) { + return node.type === "Identifier" || node.type === "RestElement"; +} + +/** + * Checks whether a given array of expressions is `...arguments` or not. + * `super(...arguments)` passes all arguments through. + * @param {ASTNode[]} superArgs An array of expressions to check. + * @returns {boolean} `true` if the superArgs is `...arguments`. + */ +function isSpreadArguments(superArgs) { + return ( + superArgs.length === 1 && + superArgs[0].type === "SpreadElement" && + superArgs[0].argument.type === "Identifier" && + superArgs[0].argument.name === "arguments" + ); +} + +/** + * Checks whether given 2 nodes are identifiers which have the same name or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are identifiers which have the same + * name. + */ +function isValidIdentifierPair(ctorParam, superArg) { + return ( + ctorParam.type === "Identifier" && + superArg.type === "Identifier" && + ctorParam.name === superArg.name + ); +} + +/** + * Checks whether given 2 nodes are a rest/spread pair which has the same values. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the + * same values. + */ +function isValidRestSpreadPair(ctorParam, superArg) { + return ( + ctorParam.type === "RestElement" && + superArg.type === "SpreadElement" && + isValidIdentifierPair(ctorParam.argument, superArg.argument) + ); +} + +/** + * Checks whether given 2 nodes have the same value or not. + * @param {ASTNode} ctorParam A node to check. + * @param {ASTNode} superArg A node to check. + * @returns {boolean} `true` if the nodes have the same value or not. + */ +function isValidPair(ctorParam, superArg) { + return ( + isValidIdentifierPair(ctorParam, superArg) || + isValidRestSpreadPair(ctorParam, superArg) + ); +} + +/** + * Checks whether the parameters of a constructor and the arguments of `super()` + * have the same values or not. + * @param {ASTNode} ctorParams The parameters of a constructor to check. + * @param {ASTNode} superArgs The arguments of `super()` to check. + * @returns {boolean} `true` if those have the same values. + */ +function isPassingThrough(ctorParams, superArgs) { + if (ctorParams.length !== superArgs.length) { + return false; + } + + for (let i = 0; i < ctorParams.length; ++i) { + if (!isValidPair(ctorParams[i], superArgs[i])) { + return false; + } + } + + return true; +} + +/** + * Checks whether the constructor body is a redundant super call. + * @param {Array} body constructor body content. + * @param {Array} ctorParams The params to check against super call. + * @returns {boolean} true if the constructor body is redundant + */ +function isRedundantSuperCall(body, ctorParams) { + return ( + isSingleSuperCall(body) && + ctorParams.every(isSimple) && + ( + isSpreadArguments(body[0].expression.arguments) || + isPassingThrough(ctorParams, body[0].expression.arguments) + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary constructors", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-constructor" + }, + + schema: [], + + messages: { + noUselessConstructor: "Useless constructor." + } + }, + + create(context) { + + /** + * Checks whether a node is a redundant constructor + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + const body = node.value.body.body; + const ctorParams = node.value.params; + const superClass = node.parent.parent.superClass; + + if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) { + context.report({ + node, + messageId: "noUselessConstructor" + }); + } + } + + return { + MethodDefinition: checkForConstructor + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-escape.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-escape.js new file mode 100644 index 0000000..8057e44 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-escape.js @@ -0,0 +1,252 @@ +/** + * @fileoverview Look for useless escapes in strings and regexes + * @author Onur Temizkan + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the union of two sets. + * @param {Set} setA The first set + * @param {Set} setB The second set + * @returns {Set} The union of the two sets + */ +function union(setA, setB) { + return new Set(function *() { + yield* setA; + yield* setB; + }()); +} + +const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS); +const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]"); +const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+?[{}|()Bk")); + +/** + * Parses a regular expression into a list of characters with character class info. + * @param {string} regExpText The raw text used to create the regular expression + * @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class. + * @example + * + * parseRegExp('a\\b[cd-]') + * + * returns: + * [ + * {text: 'a', index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'b', index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false}, + * {text: 'c', index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false}, + * {text: 'd', index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false}, + * {text: '-', index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false} + * ] + */ +function parseRegExp(regExpText) { + const charList = []; + + regExpText.split("").reduce((state, char, index) => { + if (!state.escapeNextChar) { + if (char === "\\") { + return Object.assign(state, { escapeNextChar: true }); + } + if (char === "[" && !state.inCharClass) { + return Object.assign(state, { inCharClass: true, startingCharClass: true }); + } + if (char === "]" && state.inCharClass) { + if (charList.length && charList[charList.length - 1].inCharClass) { + charList[charList.length - 1].endsCharClass = true; + } + return Object.assign(state, { inCharClass: false, startingCharClass: false }); + } + } + charList.push({ + text: char, + index, + escaped: state.escapeNextChar, + inCharClass: state.inCharClass, + startsCharClass: state.startingCharClass, + endsCharClass: false + }); + return Object.assign(state, { escapeNextChar: false, startingCharClass: false }); + }, { escapeNextChar: false, inCharClass: false, startingCharClass: false }); + + return charList; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow unnecessary escape characters", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-useless-escape", + suggestion: true + }, + + messages: { + unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", + removeEscape: "Remove the `\\`. This maintains the current functionality.", + escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character." + }, + + schema: [] + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports a node + * @param {ASTNode} node The node to report + * @param {number} startOffset The backslash's offset from the start of the node + * @param {string} character The uselessly escaped character (not including the backslash) + * @returns {void} + */ + function report(node, startOffset, character) { + const start = sourceCode.getLocFromIndex(sourceCode.getIndexFromLoc(node.loc.start) + startOffset); + const rangeStart = sourceCode.getIndexFromLoc(node.loc.start) + startOffset; + const range = [rangeStart, rangeStart + 1]; + + context.report({ + node, + loc: { + start, + end: { line: start.line, column: start.column + 1 } + }, + messageId: "unnecessaryEscape", + data: { character }, + suggest: [ + { + messageId: "removeEscape", + fix(fixer) { + return fixer.removeRange(range); + } + }, + { + messageId: "escapeBackslash", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\\"); + } + } + ] + }); + } + + /** + * Checks if the escape character in given string slice is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @param {string} match string slice to validate. + * @returns {void} + */ + function validateString(node, match) { + const isTemplateElement = node.type === "TemplateElement"; + const escapedChar = match[0][1]; + let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar); + let isQuoteEscape; + + if (isTemplateElement) { + isQuoteEscape = escapedChar === "`"; + + if (escapedChar === "$") { + + // Warn if `\$` is not followed by `{` + isUnnecessaryEscape = match.input[match.index + 2] !== "{"; + } else if (escapedChar === "{") { + + /* + * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping + * is necessary and the rule should not warn. If preceded by `/$`, the rule + * will warn for the `/$` instead, as it is the first unnecessarily escaped character. + */ + isUnnecessaryEscape = match.input[match.index - 1] !== "$"; + } + } else { + isQuoteEscape = escapedChar === node.raw[0]; + } + + if (isUnnecessaryEscape && !isQuoteEscape) { + report(node, match.index + 1, match[0].slice(1)); + } + } + + /** + * Checks if a node has an escape. + * @param {ASTNode} node node to check. + * @returns {void} + */ + function check(node) { + const isTemplateElement = node.type === "TemplateElement"; + + if ( + isTemplateElement && + node.parent && + node.parent.parent && + node.parent.parent.type === "TaggedTemplateExpression" && + node.parent === node.parent.parent.quasi + ) { + + // Don't report tagged template literals, because the backslash character is accessible to the tag function. + return; + } + + if (typeof node.value === "string" || isTemplateElement) { + + /* + * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/. + * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25. + */ + if (node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment") { + return; + } + + const value = isTemplateElement ? node.value.raw : node.raw.slice(1, -1); + const pattern = /\\[^\d]/gu; + let match; + + while ((match = pattern.exec(value))) { + validateString(node, match); + } + } else if (node.regex) { + parseRegExp(node.regex.pattern) + + /* + * The '-' character is a special case, because it's only valid to escape it if it's in a character + * class, and is not at either edge of the character class. To account for this, don't consider '-' + * characters to be valid in general, and filter out '-' characters that appear in the middle of a + * character class. + */ + .filter(charInfo => !(charInfo.text === "-" && charInfo.inCharClass && !charInfo.startsCharClass && !charInfo.endsCharClass)) + + /* + * The '^' character is also a special case; it must always be escaped outside of character classes, but + * it only needs to be escaped in character classes if it's at the beginning of the character class. To + * account for this, consider it to be a valid escape character outside of character classes, and filter + * out '^' characters that appear at the start of a character class. + */ + .filter(charInfo => !(charInfo.text === "^" && charInfo.startsCharClass)) + + // Filter out characters that aren't escaped. + .filter(charInfo => charInfo.escaped) + + // Filter out characters that are valid to escape, based on their position in the regular expression. + .filter(charInfo => !(charInfo.inCharClass ? REGEX_GENERAL_ESCAPES : REGEX_NON_CHARCLASS_ESCAPES).has(charInfo.text)) + + // Report all the remaining characters. + .forEach(charInfo => report(node, charInfo.index, charInfo.text)); + } + + } + + return { + Literal: check, + TemplateElement: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-rename.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-rename.js new file mode 100644 index 0000000..fa88f37 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-rename.js @@ -0,0 +1,168 @@ +/** + * @fileoverview Disallow renaming import, export, and destructured assignments to the same name. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow renaming import, export, and destructured assignments to the same name", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-rename" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { type: "boolean", default: false }, + ignoreImport: { type: "boolean", default: false }, + ignoreExport: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + options = context.options[0] || {}, + ignoreDestructuring = options.ignoreDestructuring === true, + ignoreImport = options.ignoreImport === true, + ignoreExport = options.ignoreExport === true; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports error for unnecessarily renamed assignments + * @param {ASTNode} node node to report + * @param {ASTNode} initial node with initial name value + * @param {ASTNode} result node with new name value + * @param {string} type the type of the offending node + * @returns {void} + */ + function reportError(node, initial, result, type) { + const name = initial.type === "Identifier" ? initial.name : initial.value; + + return context.report({ + node, + messageId: "unnecessarilyRenamed", + data: { + name, + type + }, + fix(fixer) { + if (sourceCode.commentsExistBetween(initial, result)) { + return null; + } + + const replacementText = result.type === "AssignmentPattern" + ? sourceCode.getText(result) + : name; + + return fixer.replaceTextRange([ + initial.range[0], + result.range[1] + ], replacementText); + } + }); + } + + /** + * Checks whether a destructured assignment is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkDestructured(node) { + if (ignoreDestructuring) { + return; + } + + for (const property of node.properties) { + + /* + * TODO: Remove after babel-eslint removes ExperimentalRestProperty + * https://github.com/eslint/eslint/issues/12335 + */ + if (property.type === "ExperimentalRestProperty") { + continue; + } + + /** + * Properties using shorthand syntax and rest elements can not be renamed. + * If the property is computed, we have no idea if a rename is useless or not. + */ + if (property.shorthand || property.type === "RestElement" || property.computed) { + continue; + } + + const key = (property.key.type === "Identifier" && property.key.name) || (property.key.type === "Literal" && property.key.value); + const renamedKey = property.value.type === "AssignmentPattern" ? property.value.left.name : property.value.name; + + if (key === renamedKey) { + reportError(property, property.key, property.value, "Destructuring assignment"); + } + } + } + + /** + * Checks whether an import is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkImport(node) { + if (ignoreImport) { + return; + } + + if (node.imported.name === node.local.name && + node.imported.range[0] !== node.local.range[0]) { + reportError(node, node.imported, node.local, "Import"); + } + } + + /** + * Checks whether an export is unnecessarily renamed + * @param {ASTNode} node node to check + * @returns {void} + */ + function checkExport(node) { + if (ignoreExport) { + return; + } + + if (node.local.name === node.exported.name && + node.local.range[0] !== node.exported.range[0]) { + reportError(node, node.local, node.exported, "Export"); + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ObjectPattern: checkDestructured, + ImportSpecifier: checkImport, + ExportSpecifier: checkExport + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-useless-return.js b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-return.js new file mode 100644 index 0000000..111cb21 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-useless-return.js @@ -0,0 +1,305 @@ +/** + * @fileoverview Disallow redundant return statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + FixTracker = require("./utils/fix-tracker"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Removes the given element from the array. + * @param {Array} array The source array to remove. + * @param {any} element The target item to remove. + * @returns {void} + */ +function remove(array, element) { + const index = array.indexOf(element); + + if (index !== -1) { + array.splice(index, 1); + } +} + +/** + * Checks whether it can remove the given return statement or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is removable. + */ +function isRemovable(node) { + return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); +} + +/** + * Checks whether the given return statement is in a `finally` block or not. + * @param {ASTNode} node The return statement node to check. + * @returns {boolean} `true` if the node is in a `finally` block. + */ +function isInFinally(node) { + for ( + let currentNode = node; + currentNode && currentNode.parent && !astUtils.isFunction(currentNode); + currentNode = currentNode.parent + ) { + if (currentNode.parent.type === "TryStatement" && currentNode.parent.finalizer === currentNode) { + return true; + } + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow redundant return statements", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-useless-return" + }, + + fixable: "code", + schema: [], + + messages: { + unnecessaryReturn: "Unnecessary return statement." + } + }, + + create(context) { + const segmentInfoMap = new WeakMap(); + const usedUnreachableSegments = new WeakSet(); + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Checks whether the given segment is terminated by a return statement or not. + * @param {CodePathSegment} segment The segment to check. + * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable. + */ + function isReturned(segment) { + const info = segmentInfoMap.get(segment); + + return !info || info.returned; + } + + /** + * Collects useless return statements from the given previous segments. + * + * A previous segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {ASTNode[]} uselessReturns The collected return statements. + * @param {CodePathSegment[]} prevSegments The previous segments to traverse. + * @param {WeakSet} [providedTraversedSegments] A set of segments that have already been traversed in this call + * @returns {ASTNode[]} `uselessReturns`. + */ + function getUselessReturns(uselessReturns, prevSegments, providedTraversedSegments) { + const traversedSegments = providedTraversedSegments || new WeakSet(); + + for (const segment of prevSegments) { + if (!segment.reachable) { + if (!traversedSegments.has(segment)) { + traversedSegments.add(segment); + getUselessReturns( + uselessReturns, + segment.allPrevSegments.filter(isReturned), + traversedSegments + ); + } + continue; + } + + uselessReturns.push(...segmentInfoMap.get(segment).uselessReturns); + } + + return uselessReturns; + } + + /** + * Removes the return statements on the given segment from the useless return + * statement list. + * + * This segment may be an unreachable segment. + * In that case, the information object of the unreachable segment is not + * initialized because `onCodePathSegmentStart` event is not notified for + * unreachable segments. + * This goes to the previous segments of the unreachable segment recursively + * if the unreachable segment was generated by a return statement. Otherwise, + * this ignores the unreachable segment. + * + * This behavior would simulate code paths for the case that the return + * statement does not exist. + * @param {CodePathSegment} segment The segment to get return statements. + * @returns {void} + */ + function markReturnStatementsOnSegmentAsUsed(segment) { + if (!segment.reachable) { + usedUnreachableSegments.add(segment); + segment.allPrevSegments + .filter(isReturned) + .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) + .forEach(markReturnStatementsOnSegmentAsUsed); + return; + } + + const info = segmentInfoMap.get(segment); + + for (const node of info.uselessReturns) { + remove(scopeInfo.uselessReturns, node); + } + info.uselessReturns = []; + } + + /** + * Removes the return statements on the current segments from the useless + * return statement list. + * + * This function will be called at every statement except FunctionDeclaration, + * BlockStatement, and BreakStatement. + * + * - FunctionDeclarations are always executed whether it's returned or not. + * - BlockStatements do nothing. + * - BreakStatements go the next merely. + * @returns {void} + */ + function markReturnStatementsOnCurrentSegmentsAsUsed() { + scopeInfo + .codePath + .currentSegments + .forEach(markReturnStatementsOnSegmentAsUsed); + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Makes and pushs a new scope information. + onCodePathStart(codePath) { + scopeInfo = { + upper: scopeInfo, + uselessReturns: [], + codePath + }; + }, + + // Reports useless return statements if exist. + onCodePathEnd() { + for (const node of scopeInfo.uselessReturns) { + context.report({ + node, + loc: node.loc, + messageId: "unnecessaryReturn", + fix(fixer) { + if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) { + + /* + * Extend the replacement range to include the + * entire function to avoid conflicting with + * no-else-return. + * https://github.com/eslint/eslint/issues/8026 + */ + return new FixTracker(fixer, sourceCode) + .retainEnclosingFunction(node) + .remove(node); + } + return null; + } + }); + } + + scopeInfo = scopeInfo.upper; + }, + + /* + * Initializes segments. + * NOTE: This event is notified for only reachable segments. + */ + onCodePathSegmentStart(segment) { + const info = { + uselessReturns: getUselessReturns([], segment.allPrevSegments), + returned: false + }; + + // Stores the info. + segmentInfoMap.set(segment, info); + }, + + // Adds ReturnStatement node to check whether it's useless or not. + ReturnStatement(node) { + if (node.argument) { + markReturnStatementsOnCurrentSegmentsAsUsed(); + } + if ( + node.argument || + astUtils.isInLoop(node) || + isInFinally(node) || + + // Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647). + !scopeInfo.codePath.currentSegments.some(s => s.reachable) + ) { + return; + } + + for (const segment of scopeInfo.codePath.currentSegments) { + const info = segmentInfoMap.get(segment); + + if (info) { + info.uselessReturns.push(node); + info.returned = true; + } + } + scopeInfo.uselessReturns.push(node); + }, + + /* + * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement. + * Removes return statements of the current segments from the useless return statement list. + */ + ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportDefaultDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed, + ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-var.js b/day1/cli-study/node_modules/eslint/lib/rules/no-var.js new file mode 100644 index 0000000..f2cb96b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-var.js @@ -0,0 +1,334 @@ +/** + * @fileoverview Rule to check for the usage of var. + * @author Jamund Ferguson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check whether a given variable is a global variable or not. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable is a global variable. + */ +function isGlobal(variable) { + return Boolean(variable.scope) && variable.scope.type === "global"; +} + +/** + * Finds the nearest function scope or global scope walking up the scope + * hierarchy. + * @param {eslint-scope.Scope} scope The scope to traverse. + * @returns {eslint-scope.Scope} a function scope or global scope containing the given + * scope. + */ +function getEnclosingFunctionScope(scope) { + let currentScope = scope; + + while (currentScope.type !== "function" && currentScope.type !== "global") { + currentScope = currentScope.upper; + } + return currentScope; +} + +/** + * Checks whether the given variable has any references from a more specific + * function expression (i.e. a closure). + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is used from a closure. + */ +function isReferencedInClosure(variable) { + const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope); + + return variable.references.some(reference => + getEnclosingFunctionScope(reference.from) !== enclosingFunctionScope); +} + +/** + * Checks whether the given node is the assignee of a loop. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration is assigned as part of loop + * iteration. + */ +function isLoopAssignee(node) { + return (node.parent.type === "ForOfStatement" || node.parent.type === "ForInStatement") && + node === node.parent.left; +} + +/** + * Checks whether the given variable declaration is immediately initialized. + * @param {ASTNode} node A VariableDeclaration node to check. + * @returns {boolean} `true` if the declaration has an initializer. + */ +function isDeclarationInitialized(node) { + return node.declarations.every(declarator => declarator.init !== null); +} + +const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u; + +/** + * Gets the scope node which directly contains a given node. + * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or + * an `Identifier`. + * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`, + * `SwitchStatement`, `ForStatement`, `ForInStatement`, and + * `ForOfStatement`. + */ +function getScopeNode(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (SCOPE_NODE_TYPE.test(currentNode.type)) { + return currentNode; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks whether a given variable is redeclared or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is redeclared. + */ +function isRedeclared(variable) { + return variable.defs.length >= 2; +} + +/** + * Checks whether a given variable is used from outside of the specified scope. + * @param {ASTNode} scopeNode A scope node to check. + * @returns {Function} The predicate function which checks whether a given + * variable is used from outside of the specified scope. + */ +function isUsedFromOutsideOf(scopeNode) { + + /** + * Checks whether a given reference is inside of the specified scope or not. + * @param {eslint-scope.Reference} reference A reference to check. + * @returns {boolean} `true` if the reference is inside of the specified + * scope. + */ + function isOutsideOfScope(reference) { + const scope = scopeNode.range; + const id = reference.identifier.range; + + return id[0] < scope[0] || id[1] > scope[1]; + } + + return function(variable) { + return variable.references.some(isOutsideOfScope); + }; +} + +/** + * Creates the predicate function which checks whether a variable has their references in TDZ. + * + * The predicate function would return `true`: + * + * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};) + * - if a reference is in the expression of their default value. E.g. (var {a = a} = {};) + * - if a reference is in the expression of their initializer. E.g. (var a = a;) + * @param {ASTNode} node The initializer node of VariableDeclarator. + * @returns {Function} The predicate function. + * @private + */ +function hasReferenceInTDZ(node) { + const initStart = node.range[0]; + const initEnd = node.range[1]; + + return variable => { + const id = variable.defs[0].name; + const idStart = id.range[0]; + const defaultValue = (id.parent.type === "AssignmentPattern" ? id.parent.right : null); + const defaultStart = defaultValue && defaultValue.range[0]; + const defaultEnd = defaultValue && defaultValue.range[1]; + + return variable.references.some(reference => { + const start = reference.identifier.range[0]; + const end = reference.identifier.range[1]; + + return !reference.init && ( + start < idStart || + (defaultValue !== null && start >= defaultStart && end <= defaultEnd) || + (start >= initStart && end <= initEnd) + ); + }); + }; +} + +/** + * Checks whether a given variable has name that is allowed for 'var' declarations, + * but disallowed for `let` declarations. + * @param {eslint-scope.Variable} variable The variable to check. + * @returns {boolean} `true` if the variable has a disallowed name. + */ +function hasNameDisallowedForLetDeclarations(variable) { + return variable.name === "let"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `let` or `const` instead of `var`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/no-var" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedVar: "Unexpected var, use let or const instead." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Checks whether the variables which are defined by the given declarator node have their references in TDZ. + * @param {ASTNode} declarator The VariableDeclarator node to check. + * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ. + */ + function hasSelfReferenceInTDZ(declarator) { + if (!declarator.init) { + return false; + } + const variables = context.getDeclaredVariables(declarator); + + return variables.some(hasReferenceInTDZ(declarator.init)); + } + + /** + * Checks whether it can fix a given variable declaration or not. + * It cannot fix if the following cases: + * + * - A variable is a global variable. + * - A variable is declared on a SwitchCase node. + * - A variable is redeclared. + * - A variable is used from outside the scope. + * - A variable is used from a closure within a loop. + * - A variable might be used before it is assigned within a loop. + * - A variable might be used in TDZ. + * - A variable is declared in statement position (e.g. a single-line `IfStatement`) + * - A variable has name that is disallowed for `let` declarations. + * + * ## A variable is declared on a SwitchCase node. + * + * If this rule modifies 'var' declarations on a SwitchCase node, it + * would generate the warnings of 'no-case-declarations' rule. And the + * 'eslint:recommended' preset includes 'no-case-declarations' rule, so + * this rule doesn't modify those declarations. + * + * ## A variable is redeclared. + * + * The language spec disallows redeclarations of `let` declarations. + * Those variables would cause syntax errors. + * + * ## A variable is used from outside the scope. + * + * The language spec disallows accesses from outside of the scope for + * `let` declarations. Those variables would cause reference errors. + * + * ## A variable is used from a closure within a loop. + * + * A `var` declaration within a loop shares the same variable instance + * across all loop iterations, while a `let` declaration creates a new + * instance for each iteration. This means if a variable in a loop is + * referenced by any closure, changing it from `var` to `let` would + * change the behavior in a way that is generally unsafe. + * + * ## A variable might be used before it is assigned within a loop. + * + * Within a loop, a `let` declaration without an initializer will be + * initialized to null, while a `var` declaration will retain its value + * from the previous iteration, so it is only safe to change `var` to + * `let` if we can statically determine that the variable is always + * assigned a value before its first access in the loop body. To keep + * the implementation simple, we only convert `var` to `let` within + * loops when the variable is a loop assignee or the declaration has an + * initializer. + * @param {ASTNode} node A variable declaration node to check. + * @returns {boolean} `true` if it can fix the node. + */ + function canFix(node) { + const variables = context.getDeclaredVariables(node); + const scopeNode = getScopeNode(node); + + if (node.parent.type === "SwitchCase" || + node.declarations.some(hasSelfReferenceInTDZ) || + variables.some(isGlobal) || + variables.some(isRedeclared) || + variables.some(isUsedFromOutsideOf(scopeNode)) || + variables.some(hasNameDisallowedForLetDeclarations) + ) { + return false; + } + + if (astUtils.isInLoop(node)) { + if (variables.some(isReferencedInClosure)) { + return false; + } + if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) { + return false; + } + } + + if ( + !isLoopAssignee(node) && + !(node.parent.type === "ForStatement" && node.parent.init === node) && + !astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type) + ) { + + // If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed. + return false; + } + + return true; + } + + /** + * Reports a given variable declaration node. + * @param {ASTNode} node A variable declaration node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "unexpectedVar", + + fix(fixer) { + const varToken = sourceCode.getFirstToken(node, { filter: t => t.value === "var" }); + + return canFix(node) + ? fixer.replaceText(varToken, "let") + : null; + } + }); + } + + return { + "VariableDeclaration:exit"(node) { + if (node.kind === "var") { + report(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-void.js b/day1/cli-study/node_modules/eslint/lib/rules/no-void.js new file mode 100644 index 0000000..99c8378 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-void.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to disallow use of void operator. + * @author Mike Sidorov + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `void` operators", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-void" + }, + + messages: { + noVoid: "Expected 'undefined' and instead saw 'void'." + }, + + schema: [ + { + type: "object", + properties: { + allowAsStatement: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ] + }, + + create(context) { + const allowAsStatement = + context.options[0] && context.options[0].allowAsStatement; + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + 'UnaryExpression[operator="void"]'(node) { + if ( + allowAsStatement && + node.parent && + node.parent.type === "ExpressionStatement" + ) { + return; + } + context.report({ + node, + messageId: "noVoid" + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-warning-comments.js b/day1/cli-study/node_modules/eslint/lib/rules/no-warning-comments.js new file mode 100644 index 0000000..d70bd5d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-warning-comments.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Rule that warns about used warning comments + * @author Alexander Schmidt + */ + +"use strict"; + +const { escapeRegExp } = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow specified warning terms in comments", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/no-warning-comments" + }, + + schema: [ + { + type: "object", + properties: { + terms: { + type: "array", + items: { + type: "string" + } + }, + location: { + enum: ["start", "anywhere"] + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedComment: "Unexpected '{{matchedTerm}}' comment." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(), + configuration = context.options[0] || {}, + warningTerms = configuration.terms || ["todo", "fixme", "xxx"], + location = configuration.location || "start", + selfConfigRegEx = /\bno-warning-comments\b/u; + + /** + * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified + * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not + * require word boundaries on that side. + * @param {string} term A term to convert to a RegExp + * @returns {RegExp} The term converted to a RegExp + */ + function convertToRegExp(term) { + const escaped = escapeRegExp(term); + const wordBoundary = "\\b"; + const eitherOrWordBoundary = `|${wordBoundary}`; + let prefix; + + /* + * If the term ends in a word character (a-z0-9_), ensure a word + * boundary at the end, so that substrings do not get falsely + * matched. eg "todo" in a string such as "mastodon". + * If the term ends in a non-word character, then \b won't match on + * the boundary to the next non-word character, which would likely + * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. + * In these cases, use no bounding match. Same applies for the + * prefix, handled below. + */ + const suffix = /\w$/u.test(term) ? "\\b" : ""; + + if (location === "start") { + + /* + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + */ + prefix = "^\\s*"; + } else if (/^\w/u.test(term)) { + prefix = wordBoundary; + } else { + prefix = ""; + } + + if (location === "start") { + + /* + * For location "start" the regex should be + * ^\s*TERM\b. This checks the word boundary + * at the beginning of the comment. + */ + return new RegExp(prefix + escaped + suffix, "iu"); + } + + /* + * For location "anywhere" the regex should be + * \bTERM\b|\bTERM\b, this checks the entire comment + * for the term. + */ + return new RegExp(prefix + escaped + suffix + eitherOrWordBoundary + term + wordBoundary, "iu"); + } + + const warningRegExps = warningTerms.map(convertToRegExp); + + /** + * Checks the specified comment for matches of the configured warning terms and returns the matches. + * @param {string} comment The comment which is checked. + * @returns {Array} All matched warning terms for this comment. + */ + function commentContainsWarningTerm(comment) { + const matches = []; + + warningRegExps.forEach((regex, index) => { + if (regex.test(comment)) { + matches.push(warningTerms[index]); + } + }); + + return matches; + } + + /** + * Checks the specified node for matching warning comments and reports them. + * @param {ASTNode} node The AST node being checked. + * @returns {void} undefined. + */ + function checkComment(node) { + if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) { + return; + } + + const matches = commentContainsWarningTerm(node.value); + + matches.forEach(matchedTerm => { + context.report({ + node, + messageId: "unexpectedComment", + data: { + matchedTerm + } + }); + }); + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(checkComment); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/day1/cli-study/node_modules/eslint/lib/rules/no-whitespace-before-property.js new file mode 100644 index 0000000..ccd0b09 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -0,0 +1,101 @@ +/** + * @fileoverview Rule to disallow whitespace before properties + * @author Kai Cataldo + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "disallow whitespace before properties", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/no-whitespace-before-property" + }, + + fixable: "whitespace", + schema: [], + + messages: { + unexpectedWhitespace: "Unexpected whitespace before property {{propName}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports whitespace before property token + * @param {ASTNode} node the node to report in the event of an error + * @param {Token} leftToken the left token + * @param {Token} rightToken the right token + * @returns {void} + * @private + */ + function reportError(node, leftToken, rightToken) { + const replacementText = node.computed ? "" : "."; + + context.report({ + node, + messageId: "unexpectedWhitespace", + data: { + propName: sourceCode.getText(node.property) + }, + fix(fixer) { + if (!node.computed && astUtils.isDecimalInteger(node.object)) { + + /* + * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError. + * Don't fix this case. + */ + return null; + } + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], replacementText); + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + MemberExpression(node) { + let rightToken; + let leftToken; + + if (!astUtils.isTokenOnSameLine(node.object, node.property)) { + return; + } + + if (node.computed) { + rightToken = sourceCode.getTokenBefore(node.property, astUtils.isOpeningBracketToken); + leftToken = sourceCode.getTokenBefore(rightToken); + } else { + rightToken = sourceCode.getFirstToken(node.property); + leftToken = sourceCode.getTokenBefore(rightToken, 1); + } + + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { + reportError(node, leftToken, rightToken); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/no-with.js b/day1/cli-study/node_modules/eslint/lib/rules/no-with.js new file mode 100644 index 0000000..d3e52e0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/no-with.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Rule to flag use of with statement + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `with` statements", + category: "Best Practices", + recommended: true, + url: "https://eslint.org/docs/rules/no-with" + }, + + schema: [], + + messages: { + unexpectedWith: "Unexpected use of 'with' statement." + } + }, + + create(context) { + + return { + WithStatement(node) { + context.report({ node, messageId: "unexpectedWith" }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/day1/cli-study/node_modules/eslint/lib/rules/nonblock-statement-body-position.js new file mode 100644 index 0000000..34e6eea --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -0,0 +1,124 @@ +/** + * @fileoverview enforce the location of single-line statements + * @author Teddy Katz + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the location of single-line statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/nonblock-statement-body-position" + }, + + fixable: "whitespace", + + schema: [ + POSITION_SCHEMA, + { + properties: { + overrides: { + properties: { + if: POSITION_SCHEMA, + else: POSITION_SCHEMA, + while: POSITION_SCHEMA, + do: POSITION_SCHEMA, + for: POSITION_SCHEMA + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + expectNoLinebreak: "Expected no linebreak before this statement.", + expectLinebreak: "Expected a linebreak before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Gets the applicable preference for a particular keyword + * @param {string} keywordName The name of a keyword, e.g. 'if' + * @returns {string} The applicable option for the keyword, e.g. 'beside' + */ + function getOption(keywordName) { + return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] || + context.options[0] || + "beside"; + } + + /** + * Validates the location of a single-line statement + * @param {ASTNode} node The single-line statement + * @param {string} keywordName The applicable keyword name for the single-line statement + * @returns {void} + */ + function validateStatement(node, keywordName) { + const option = getOption(keywordName); + + if (node.type === "BlockStatement" || option === "any") { + return; + } + + const tokenBefore = sourceCode.getTokenBefore(node); + + if (tokenBefore.loc.end.line === node.loc.start.line && option === "below") { + context.report({ + node, + messageId: "expectLinebreak", + fix: fixer => fixer.insertTextBefore(node, "\n") + }); + } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") { + context.report({ + node, + messageId: "expectNoLinebreak", + fix(fixer) { + if (sourceCode.getText().slice(tokenBefore.range[1], node.range[0]).trim()) { + return null; + } + return fixer.replaceTextRange([tokenBefore.range[1], node.range[0]], " "); + } + }); + } + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + IfStatement(node) { + validateStatement(node.consequent, "if"); + + // Check the `else` node, but don't check 'else if' statements. + if (node.alternate && node.alternate.type !== "IfStatement") { + validateStatement(node.alternate, "else"); + } + }, + WhileStatement: node => validateStatement(node.body, "while"), + DoWhileStatement: node => validateStatement(node.body, "do"), + ForStatement: node => validateStatement(node.body, "for"), + ForInStatement: node => validateStatement(node.body, "for"), + ForOfStatement: node => validateStatement(node.body, "for") + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/object-curly-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/object-curly-newline.js new file mode 100644 index 0000000..b48b252 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/object-curly-newline.js @@ -0,0 +1,306 @@ +/** + * @fileoverview Rule to require or disallow line breaks inside braces. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// Schema objects. +const OPTION_VALUE = { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + multiline: { + type: "boolean" + }, + minProperties: { + type: "integer", + minimum: 0 + }, + consistent: { + type: "boolean" + } + }, + additionalProperties: false, + minProperties: 1 + } + ] +}; + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} value An option value to parse. + * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object. + */ +function normalizeOptionValue(value) { + let multiline = false; + let minProperties = Number.POSITIVE_INFINITY; + let consistent = false; + + if (value) { + if (value === "always") { + minProperties = 0; + } else if (value === "never") { + minProperties = Number.POSITIVE_INFINITY; + } else { + multiline = Boolean(value.multiline); + minProperties = value.minProperties || Number.POSITIVE_INFINITY; + consistent = Boolean(value.consistent); + } + } else { + consistent = true; + } + + return { multiline, minProperties, consistent }; +} + +/** + * Normalizes a given option value. + * @param {string|Object|undefined} options An option value to parse. + * @returns {{ + * ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean}, + * ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean}, + * ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean}, + * ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean} + * }} Normalized option object. + */ +function normalizeOptions(options) { + const isNodeSpecificOption = lodash.overSome([lodash.isPlainObject, lodash.isString]); + + if (lodash.isPlainObject(options) && lodash.some(options, isNodeSpecificOption)) { + return { + ObjectExpression: normalizeOptionValue(options.ObjectExpression), + ObjectPattern: normalizeOptionValue(options.ObjectPattern), + ImportDeclaration: normalizeOptionValue(options.ImportDeclaration), + ExportNamedDeclaration: normalizeOptionValue(options.ExportDeclaration) + }; + } + + const value = normalizeOptionValue(options); + + return { ObjectExpression: value, ObjectPattern: value, ImportDeclaration: value, ExportNamedDeclaration: value }; +} + +/** + * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration + * node needs to be checked for missing line breaks + * @param {ASTNode} node Node under inspection + * @param {Object} options option specific to node type + * @param {Token} first First object property + * @param {Token} last Last object property + * @returns {boolean} `true` if node needs to be checked for missing line breaks + */ +function areLineBreaksRequired(node, options, first, last) { + let objectProperties; + + if (node.type === "ObjectExpression" || node.type === "ObjectPattern") { + objectProperties = node.properties; + } else { + + // is ImportDeclaration or ExportNamedDeclaration + objectProperties = node.specifiers + .filter(s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier"); + } + + return objectProperties.length >= options.minProperties || + ( + options.multiline && + objectProperties.length > 0 && + first.loc.start.line !== last.loc.end.line + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent line breaks inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-newline" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + OPTION_VALUE, + { + type: "object", + properties: { + ObjectExpression: OPTION_VALUE, + ObjectPattern: OPTION_VALUE, + ImportDeclaration: OPTION_VALUE, + ExportDeclaration: OPTION_VALUE + }, + additionalProperties: false, + minProperties: 1 + } + ] + } + ], + + messages: { + unexpectedLinebreakBeforeClosingBrace: "Unexpected line break before this closing brace.", + unexpectedLinebreakAfterOpeningBrace: "Unexpected line break after this opening brace.", + expectedLinebreakBeforeClosingBrace: "Expected a line break before this closing brace.", + expectedLinebreakAfterOpeningBrace: "Expected a line break after this opening brace." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const normalizedOptions = normalizeOptions(context.options[0]); + + /** + * Reports a given node if it violated this rule. + * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. + * @returns {void} + */ + function check(node) { + const options = normalizedOptions[node.type]; + + if ( + (node.type === "ImportDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) || + (node.type === "ExportNamedDeclaration" && + !node.specifiers.some(specifier => specifier.type === "ExportSpecifier")) + ) { + return; + } + + const openBrace = sourceCode.getFirstToken(node, token => token.value === "{"); + + let closeBrace; + + if (node.typeAnnotation) { + closeBrace = sourceCode.getTokenBefore(node.typeAnnotation); + } else { + closeBrace = sourceCode.getLastToken(node, token => token.value === "}"); + } + + let first = sourceCode.getTokenAfter(openBrace, { includeComments: true }); + let last = sourceCode.getTokenBefore(closeBrace, { includeComments: true }); + + const needsLineBreaks = areLineBreaksRequired(node, options, first, last); + + const hasCommentsFirstToken = astUtils.isCommentToken(first); + const hasCommentsLastToken = astUtils.isCommentToken(last); + + /* + * Use tokens or comments to check multiline or not. + * But use only tokens to check whether line breaks are needed. + * This allows: + * var obj = { // eslint-disable-line foo + * a: 1 + * } + */ + first = sourceCode.getTokenAfter(openBrace); + last = sourceCode.getTokenBefore(closeBrace); + + if (needsLineBreaks) { + if (astUtils.isTokenOnSameLine(openBrace, first)) { + context.report({ + messageId: "expectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc.start, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.insertTextAfter(openBrace, "\n"); + } + }); + } + if (astUtils.isTokenOnSameLine(last, closeBrace)) { + context.report({ + messageId: "expectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc.start, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.insertTextBefore(closeBrace, "\n"); + } + }); + } + } else { + const consistent = options.consistent; + const hasLineBreakBetweenOpenBraceAndFirst = !astUtils.isTokenOnSameLine(openBrace, first); + const hasLineBreakBetweenCloseBraceAndLast = !astUtils.isTokenOnSameLine(last, closeBrace); + + if ( + (!consistent && hasLineBreakBetweenOpenBraceAndFirst) || + (consistent && hasLineBreakBetweenOpenBraceAndFirst && !hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakAfterOpeningBrace", + node, + loc: openBrace.loc.start, + fix(fixer) { + if (hasCommentsFirstToken) { + return null; + } + + return fixer.removeRange([ + openBrace.range[1], + first.range[0] + ]); + } + }); + } + if ( + (!consistent && hasLineBreakBetweenCloseBraceAndLast) || + (consistent && !hasLineBreakBetweenOpenBraceAndFirst && hasLineBreakBetweenCloseBraceAndLast) + ) { + context.report({ + messageId: "unexpectedLinebreakBeforeClosingBrace", + node, + loc: closeBrace.loc.start, + fix(fixer) { + if (hasCommentsLastToken) { + return null; + } + + return fixer.removeRange([ + last.range[1], + closeBrace.range[0] + ]); + } + }); + } + } + } + + return { + ObjectExpression: check, + ObjectPattern: check, + ImportDeclaration: check, + ExportNamedDeclaration: check + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/object-curly-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/object-curly-spacing.js new file mode 100644 index 0000000..c0044f5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -0,0 +1,308 @@ +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside braces", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + arraysInObjects: { + type: "boolean" + }, + objectsInObjects: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + requireSpaceBefore: "A space is required before '{{token}}'.", + requireSpaceAfter: "A space is required after '{{token}}'.", + unexpectedSpaceBefore: "There should be no space before '{{token}}'.", + unexpectedSpaceAfter: "There should be no space after '{{token}}'." + } + }, + + create(context) { + const spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + const options = { + spaced, + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + const nextToken = context.getSourceCode().getTokenAfter(token, { includeComments: true }); + + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "unexpectedSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + const previousToken = context.getSourceCode().getTokenBefore(token, { includeComments: true }); + + context.report({ + node, + loc: { start: previousToken.loc.end, end: token.loc.start }, + messageId: "unexpectedSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceAfter", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node The node to report in the event of an error. + * @param {Token} token The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node, + loc: token.loc, + messageId: "requireSpaceBefore", + data: { + token: token.value + }, + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + if (astUtils.isTokenOnSameLine(first, second)) { + const firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); + + if (options.spaced && !firstSpaced) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && firstSpaced && second.type !== "Line") { + reportNoBeginningSpace(node, first); + } + } + + if (astUtils.isTokenOnSameLine(penultimate, last)) { + const shouldCheckPenultimate = ( + options.arraysInObjectsException && astUtils.isClosingBracketToken(penultimate) || + options.objectsInObjectsException && astUtils.isClosingBraceToken(penultimate) + ); + const penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.range[0]).type; + + const closingCurlyBraceMustBeSpaced = ( + options.arraysInObjectsException && penultimateType === "ArrayExpression" || + options.objectsInObjectsException && (penultimateType === "ObjectExpression" || penultimateType === "ObjectPattern") + ) ? !options.spaced : options.spaced; + + const lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); + + if (closingCurlyBraceMustBeSpaced && !lastSpaced) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && lastSpaced) { + reportNoEndingSpace(node, last); + } + } + } + + /** + * Gets '}' token of an object node. + * + * Because the last token of object patterns might be a type annotation, + * this traverses tokens preceded by the last property, then returns the + * first '}' token. + * @param {ASTNode} node The node to get. This node is an + * ObjectExpression or an ObjectPattern. And this node has one or + * more properties. + * @returns {Token} '}' token. + */ + function getClosingBraceOfObject(node) { + const lastProperty = node.properties[node.properties.length - 1]; + + return sourceCode.getTokenAfter(lastProperty, astUtils.isClosingBraceToken); + } + + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } + + const first = sourceCode.getFirstToken(node), + last = getClosingBraceOfObject(node), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } + + let firstSpecifier = node.specifiers[0]; + const lastSpecifier = node.specifiers[node.specifiers.length - 1]; + + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } + + const first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } + + const firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier, astUtils.isNotCommaToken), + second = sourceCode.getTokenAfter(first, { includeComments: true }), + penultimate = sourceCode.getTokenBefore(last, { includeComments: true }); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/object-property-newline.js b/day1/cli-study/node_modules/eslint/lib/rules/object-property-newline.js new file mode 100644 index 0000000..0c7f800 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/object-property-newline.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Rule to enforce placing object properties on separate lines. + * @author Vitor Balocco + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce placing object properties on separate lines", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/object-property-newline" + }, + + schema: [ + { + type: "object", + properties: { + allowAllPropertiesOnSameLine: { + type: "boolean", + default: false + }, + allowMultiplePropertiesPerLine: { // Deprecated + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "whitespace", + + messages: { + propertiesOnNewlineAll: "Object properties must go on a new line if they aren't all on the same line.", + propertiesOnNewline: "Object properties must go on a new line." + } + }, + + create(context) { + const allowSameLine = context.options[0] && ( + (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */) + ); + const messageId = allowSameLine + ? "propertiesOnNewlineAll" + : "propertiesOnNewline"; + + const sourceCode = context.getSourceCode(); + + return { + ObjectExpression(node) { + if (allowSameLine) { + if (node.properties.length > 1) { + const firstTokenOfFirstProperty = sourceCode.getFirstToken(node.properties[0]); + const lastTokenOfLastProperty = sourceCode.getLastToken(node.properties[node.properties.length - 1]); + + if (firstTokenOfFirstProperty.loc.end.line === lastTokenOfLastProperty.loc.start.line) { + + // All keys and values are on the same line + return; + } + } + } + + for (let i = 1; i < node.properties.length; i++) { + const lastTokenOfPreviousProperty = sourceCode.getLastToken(node.properties[i - 1]); + const firstTokenOfCurrentProperty = sourceCode.getFirstToken(node.properties[i]); + + if (lastTokenOfPreviousProperty.loc.end.line === firstTokenOfCurrentProperty.loc.start.line) { + context.report({ + node, + loc: firstTokenOfCurrentProperty.loc, + messageId, + fix(fixer) { + const comma = sourceCode.getTokenBefore(firstTokenOfCurrentProperty); + const rangeAfterComma = [comma.range[1], firstTokenOfCurrentProperty.range[0]]; + + // Don't perform a fix if there are any comments between the comma and the next property. + if (sourceCode.text.slice(rangeAfterComma[0], rangeAfterComma[1]).trim()) { + return null; + } + + return fixer.replaceTextRange(rangeAfterComma, "\n"); + } + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/object-shorthand.js b/day1/cli-study/node_modules/eslint/lib/rules/object-shorthand.js new file mode 100644 index 0000000..3999ff8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/object-shorthand.js @@ -0,0 +1,508 @@ +/** + * @fileoverview Rule to enforce concise object methods and properties. + * @author Jamund Ferguson + */ + +"use strict"; + +const OPTIONS = { + always: "always", + never: "never", + methods: "methods", + properties: "properties", + consistent: "consistent", + consistentAsNeeded: "consistent-as-needed" +}; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow method and property shorthand syntax for object literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/object-shorthand" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties", "never", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods", "properties"] + }, + { + type: "object", + properties: { + avoidQuotes: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always", "methods"] + }, + { + type: "object", + properties: { + ignoreConstructors: { + type: "boolean" + }, + avoidQuotes: { + type: "boolean" + }, + avoidExplicitReturnArrows: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + expectedAllPropertiesShorthanded: "Expected shorthand for all properties.", + expectedLiteralMethodLongform: "Expected longform method syntax for string literal keys.", + expectedPropertyShorthand: "Expected property shorthand.", + expectedPropertyLongform: "Expected longform property syntax.", + expectedMethodShorthand: "Expected method shorthand.", + expectedMethodLongform: "Expected longform method syntax.", + unexpectedMix: "Unexpected mix of shorthand and non-shorthand properties." + } + }, + + create(context) { + const APPLY = context.options[0] || OPTIONS.always; + const APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; + const APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; + const APPLY_NEVER = APPLY === OPTIONS.never; + const APPLY_CONSISTENT = APPLY === OPTIONS.consistent; + const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded; + + const PARAMS = context.options[1] || {}; + const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + const AVOID_QUOTES = PARAMS.avoidQuotes; + const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const CTOR_PREFIX_REGEX = /[^_$0-9]/u; + + /** + * Determines if the first character of the name is a capital letter. + * @param {string} name The name of the node to evaluate. + * @returns {boolean} True if the first character of the property name is a capital letter, false if not. + * @private + */ + function isConstructor(name) { + const match = CTOR_PREFIX_REGEX.exec(name); + + // Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8' + if (!match) { + return false; + } + + const firstChar = name.charAt(match.index); + + return firstChar === firstChar.toUpperCase(); + } + + /** + * Determines if the property can have a shorthand form. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property can have a shorthand form + * @private + * + */ + function canHaveShorthand(property) { + return (property.kind !== "set" && property.kind !== "get" && property.type !== "SpreadElement" && property.type !== "SpreadProperty" && property.type !== "ExperimentalSpreadProperty"); + } + + /** + * Checks whether a node is a string literal. + * @param {ASTNode} node Any AST node. + * @returns {boolean} `true` if it is a string literal. + */ + function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; + } + + /** + * Determines if the property is a shorthand or not. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the property is considered shorthand, false if not. + * @private + * + */ + function isShorthand(property) { + + // property.method is true when `{a(){}}`. + return (property.shorthand || property.method); + } + + /** + * Determines if the property's key and method or value are named equally. + * @param {ASTNode} property Property AST node + * @returns {boolean} True if the key and value are named equally, false if not. + * @private + * + */ + function isRedundant(property) { + const value = property.value; + + if (value.type === "FunctionExpression") { + return !value.id; // Only anonymous should be shorthand method. + } + if (value.type === "Identifier") { + return astUtils.getStaticPropertyName(property) === value.name; + } + + return false; + } + + /** + * Ensures that an object's properties are consistently shorthand, or not shorthand at all. + * @param {ASTNode} node Property AST node + * @param {boolean} checkRedundancy Whether to check longform redundancy + * @returns {void} + * + */ + function checkConsistency(node, checkRedundancy) { + + // We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand. + const properties = node.properties.filter(canHaveShorthand); + + // Do we still have properties left after filtering the getters and setters? + if (properties.length > 0) { + const shorthandProperties = properties.filter(isShorthand); + + /* + * If we do not have an equal number of longform properties as + * shorthand properties, we are using the annotations inconsistently + */ + if (shorthandProperties.length !== properties.length) { + + // We have at least 1 shorthand property + if (shorthandProperties.length > 0) { + context.report({ node, messageId: "unexpectedMix" }); + } else if (checkRedundancy) { + + /* + * If all properties of the object contain a method or value with a name matching it's key, + * all the keys are redundant. + */ + const canAlwaysUseShorthand = properties.every(isRedundant); + + if (canAlwaysUseShorthand) { + context.report({ node, messageId: "expectedAllPropertiesShorthanded" }); + } + } + } + } + } + + /** + * Fixes a FunctionExpression node by making it into a shorthand property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionShorthand(fixer, node) { + const firstKeyToken = node.computed + ? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken) + : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed + ? sourceCode.getFirstTokenBetween(node.key, node.value, astUtils.isClosingBracketToken) + : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let keyPrefix = ""; + + // key: /* */ () => {} + if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) { + return null; + } + + if (node.value.async) { + keyPrefix += "async "; + } + if (node.value.generator) { + keyPrefix += "*"; + } + + const fixRange = [firstKeyToken.range[0], node.range[1]]; + const methodPrefix = keyPrefix + keyText; + + if (node.value.type === "FunctionExpression") { + const functionToken = sourceCode.getTokens(node.value).find(token => token.type === "Keyword" && token.value === "function"); + const tokenBeforeParams = node.value.generator ? sourceCode.getTokenAfter(functionToken) : functionToken; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + sourceCode.text.slice(tokenBeforeParams.range[1], node.value.range[1]) + ); + } + + const arrowToken = sourceCode.getTokenBefore(node.value.body, astUtils.isArrowToken); + const fnBody = sourceCode.text.slice(arrowToken.range[1], node.value.range[1]); + + let shouldAddParensAroundParameters = false; + let tokenBeforeParams; + + if (node.value.params.length === 0) { + tokenBeforeParams = sourceCode.getFirstToken(node.value, astUtils.isOpeningParenToken); + } else { + tokenBeforeParams = sourceCode.getTokenBefore(node.value.params[0]); + } + + if (node.value.params.length === 1) { + const hasParen = astUtils.isOpeningParenToken(tokenBeforeParams); + const isTokenOutsideNode = tokenBeforeParams.range[0] < node.range[0]; + + shouldAddParensAroundParameters = !hasParen || isTokenOutsideNode; + } + + const sliceStart = shouldAddParensAroundParameters + ? node.value.params[0].range[0] + : tokenBeforeParams.range[0]; + const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1]; + + const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd); + const newParamText = shouldAddParensAroundParameters ? `(${oldParamText})` : oldParamText; + + return fixer.replaceTextRange( + fixRange, + methodPrefix + newParamText + fnBody + ); + + } + + /** + * Fixes a FunctionExpression node by making it into a longform property. + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value + * @returns {Object} A fix for this node + */ + function makeFunctionLongform(fixer, node) { + const firstKeyToken = node.computed ? sourceCode.getTokens(node).find(token => token.value === "[") : sourceCode.getFirstToken(node.key); + const lastKeyToken = node.computed ? sourceCode.getTokensBetween(node.key, node.value).find(token => token.value === "]") : sourceCode.getLastToken(node.key); + const keyText = sourceCode.text.slice(firstKeyToken.range[0], lastKeyToken.range[1]); + let functionHeader = "function"; + + if (node.value.async) { + functionHeader = `async ${functionHeader}`; + } + if (node.value.generator) { + functionHeader = `${functionHeader}*`; + } + + return fixer.replaceTextRange([node.range[0], lastKeyToken.range[1]], `${keyText}: ${functionHeader}`); + } + + /* + * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`), + * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is + * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical + * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered, + * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited. + * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them + * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule, + * because converting it into a method would change the value of one of the lexical identifiers. + */ + const lexicalScopeStack = []; + const arrowsWithLexicalIdentifiers = new WeakSet(); + const argumentsIdentifiers = new WeakSet(); + + /** + * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack. + * Also, this marks all `arguments` identifiers so that they can be detected later. + * @returns {void} + */ + function enterFunction() { + lexicalScopeStack.unshift(new Set()); + context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => { + variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier)); + }); + } + + /** + * Exits a function. This pops the current set of arrow functions off the lexical scope stack. + * @returns {void} + */ + function exitFunction() { + lexicalScopeStack.shift(); + } + + /** + * Marks the current function as having a lexical keyword. This implies that all arrow functions + * in the current lexical scope contain a reference to this lexical keyword. + * @returns {void} + */ + function reportLexicalIdentifier() { + lexicalScopeStack[0].forEach(arrowFunction => arrowsWithLexicalIdentifiers.add(arrowFunction)); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: enterFunction, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + "Program:exit": exitFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + + ArrowFunctionExpression(node) { + lexicalScopeStack[0].add(node); + }, + "ArrowFunctionExpression:exit"(node) { + lexicalScopeStack[0].delete(node); + }, + + ThisExpression: reportLexicalIdentifier, + Super: reportLexicalIdentifier, + MetaProperty(node) { + if (node.meta.name === "new" && node.property.name === "target") { + reportLexicalIdentifier(); + } + }, + Identifier(node) { + if (argumentsIdentifiers.has(node)) { + reportLexicalIdentifier(); + } + }, + + ObjectExpression(node) { + if (APPLY_CONSISTENT) { + checkConsistency(node, false); + } else if (APPLY_CONSISTENT_AS_NEEDED) { + checkConsistency(node, true); + } + }, + + "Property:exit"(node) { + const isConciseProperty = node.method || node.shorthand; + + // Ignore destructuring assignment + if (node.parent.type === "ObjectPattern") { + return; + } + + // getters and setters are ignored + if (node.kind === "get" || node.kind === "set") { + return; + } + + // only computed methods can fail the following checks + if (node.computed && node.value.type !== "FunctionExpression" && node.value.type !== "ArrowFunctionExpression") { + return; + } + + //-------------------------------------------------------------- + // Checks for property/method shorthand. + if (isConciseProperty) { + if (node.method && (APPLY_NEVER || AVOID_QUOTES && isStringLiteral(node.key))) { + const messageId = APPLY_NEVER ? "expectedMethodLongform" : "expectedLiteralMethodLongform"; + + // { x() {} } should be written as { x: function() {} } + context.report({ + node, + messageId, + fix: fixer => makeFunctionLongform(fixer, node) + }); + } else if (APPLY_NEVER) { + + // { x } should be written as { x: x } + context.report({ + node, + messageId: "expectedPropertyLongform", + fix: fixer => fixer.insertTextAfter(node.key, `: ${node.key.name}`) + }); + } + } else if (APPLY_TO_METHODS && !node.value.id && (node.value.type === "FunctionExpression" || node.value.type === "ArrowFunctionExpression")) { + if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { + return; + } + if (AVOID_QUOTES && isStringLiteral(node.key)) { + return; + } + + // {[x]: function(){}} should be written as {[x]() {}} + if (node.value.type === "FunctionExpression" || + node.value.type === "ArrowFunctionExpression" && + node.value.body.type === "BlockStatement" && + AVOID_EXPLICIT_RETURN_ARROWS && + !arrowsWithLexicalIdentifiers.has(node.value) + ) { + context.report({ + node, + messageId: "expectedMethodShorthand", + fix: fixer => makeFunctionShorthand(fixer, node) + }); + } + } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) { + + // {x: x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) { + if (AVOID_QUOTES) { + return; + } + + // {"x": x} should be written as {x} + context.report({ + node, + messageId: "expectedPropertyShorthand", + fix(fixer) { + return fixer.replaceText(node, node.value.name); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/day1/cli-study/node_modules/eslint/lib/rules/one-var-declaration-per-line.js new file mode 100644 index 0000000..db46747 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,92 @@ +/** + * @fileoverview Rule to check multiple var declarations per line + * @author Alberto Rodríguez + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow newlines around variable declarations", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var-declaration-per-line" + }, + + schema: [ + { + enum: ["always", "initializations"] + } + ], + + fixable: "whitespace", + + messages: { + expectVarOnNewline: "Expected variable declaration to be on a new line." + } + }, + + create(context) { + + const always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Checks newlines around variable declarations. + * @private + * @param {ASTNode} node `VariableDeclaration` node to test + * @returns {void} + */ + function checkForNewLine(node) { + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + const declarations = node.declarations; + let prev; + + declarations.forEach(current => { + if (prev && prev.loc.end.line === current.loc.start.line) { + if (always || prev.init || current.init) { + context.report({ + node, + messageId: "expectVarOnNewline", + loc: current.loc, + fix: fixer => fixer.insertTextBefore(current, "\n") + }); + } + } + prev = current; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForNewLine + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/one-var.js b/day1/cli-study/node_modules/eslint/lib/rules/one-var.js new file mode 100644 index 0000000..c31a0d2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/one-var.js @@ -0,0 +1,535 @@ +/** + * @fileoverview A rule to control the use of single variable declarations. + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce variables to be declared either together or separately in functions", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/one-var" + }, + + fixable: "code", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never", "consecutive"] + }, + { + type: "object", + properties: { + separateRequires: { + type: "boolean" + }, + var: { + enum: ["always", "never", "consecutive"] + }, + let: { + enum: ["always", "never", "consecutive"] + }, + const: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + initialized: { + enum: ["always", "never", "consecutive"] + }, + uninitialized: { + enum: ["always", "never", "consecutive"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + combineUninitialized: "Combine this with the previous '{{type}}' statement with uninitialized variables.", + combineInitialized: "Combine this with the previous '{{type}}' statement with initialized variables.", + splitUninitialized: "Split uninitialized '{{type}}' declarations into multiple statements.", + splitInitialized: "Split initialized '{{type}}' declarations into multiple statements.", + splitRequires: "Split requires to be separated into a single block.", + combine: "Combine this with the previous '{{type}}' statement.", + split: "Split '{{type}}' declarations into multiple statements." + } + }, + + create(context) { + const MODE_ALWAYS = "always"; + const MODE_NEVER = "never"; + const MODE_CONSECUTIVE = "consecutive"; + const mode = context.options[0] || MODE_ALWAYS; + + const options = {}; + + if (typeof mode === "string") { // simple options configuration with just a string + options.var = { uninitialized: mode, initialized: mode }; + options.let = { uninitialized: mode, initialized: mode }; + options.const = { uninitialized: mode, initialized: mode }; + } else if (typeof mode === "object") { // options configuration is an object + options.separateRequires = !!mode.separateRequires; + options.var = { uninitialized: mode.var, initialized: mode.var }; + options.let = { uninitialized: mode.let, initialized: mode.let }; + options.const = { uninitialized: mode.const, initialized: mode.const }; + if (Object.prototype.hasOwnProperty.call(mode, "uninitialized")) { + options.var.uninitialized = mode.uninitialized; + options.let.uninitialized = mode.uninitialized; + options.const.uninitialized = mode.uninitialized; + } + if (Object.prototype.hasOwnProperty.call(mode, "initialized")) { + options.var.initialized = mode.initialized; + options.let.initialized = mode.initialized; + options.const.initialized = mode.initialized; + } + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + const functionStack = []; + const blockStack = []; + + /** + * Increments the blockStack counter. + * @returns {void} + * @private + */ + function startBlock() { + blockStack.push({ + let: { initialized: false, uninitialized: false }, + const: { initialized: false, uninitialized: false } + }); + } + + /** + * Increments the functionStack counter. + * @returns {void} + * @private + */ + function startFunction() { + functionStack.push({ initialized: false, uninitialized: false }); + startBlock(); + } + + /** + * Decrements the blockStack counter. + * @returns {void} + * @private + */ + function endBlock() { + blockStack.pop(); + } + + /** + * Decrements the functionStack counter. + * @returns {void} + * @private + */ + function endFunction() { + functionStack.pop(); + endBlock(); + } + + /** + * Check if a variable declaration is a require. + * @param {ASTNode} decl variable declaration Node + * @returns {bool} if decl is a require, return true; else return false. + * @private + */ + function isRequire(decl) { + return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require"; + } + + /** + * Records whether initialized/uninitialized/required variables are defined in current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @param {Object} currentScope The scope being investigated + * @returns {void} + * @private + */ + function recordTypes(statementType, declarations, currentScope) { + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) { + currentScope.uninitialized = true; + } + } else { + if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) { + if (options.separateRequires && isRequire(declarations[i])) { + currentScope.required = true; + } else { + currentScope.initialized = true; + } + } + } + } + } + + /** + * Determines the current scope (function or block) + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @returns {Object} The scope associated with statementType + */ + function getCurrentScope(statementType) { + let currentScope; + + if (statementType === "var") { + currentScope = functionStack[functionStack.length - 1]; + } else if (statementType === "let") { + currentScope = blockStack[blockStack.length - 1].let; + } else if (statementType === "const") { + currentScope = blockStack[blockStack.length - 1].const; + } + return currentScope; + } + + /** + * Counts the number of initialized and uninitialized declarations in a list of declarations + * @param {ASTNode[]} declarations List of declarations + * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations + * @private + */ + function countDeclarations(declarations) { + const counts = { uninitialized: 0, initialized: 0 }; + + for (let i = 0; i < declarations.length; i++) { + if (declarations[i].init === null) { + counts.uninitialized++; + } else { + counts.initialized++; + } + } + return counts; + } + + /** + * Determines if there is more than one var statement in the current scope. + * @param {string} statementType node.kind, one of: "var", "let", or "const" + * @param {ASTNode[]} declarations List of declarations + * @returns {boolean} Returns true if it is the first var declaration, false if not. + * @private + */ + function hasOnlyOneStatement(statementType, declarations) { + + const declarationCounts = countDeclarations(declarations); + const currentOptions = options[statementType] || {}; + const currentScope = getCurrentScope(statementType); + const hasRequires = declarations.some(isRequire); + + if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { + if (currentScope.uninitialized || currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + + if (declarationCounts.uninitialized > 0) { + if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { + return false; + } + } + if (declarationCounts.initialized > 0) { + if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { + if (!hasRequires) { + return false; + } + } + } + if (currentScope.required && hasRequires) { + return false; + } + recordTypes(statementType, declarations, currentScope); + return true; + } + + /** + * Fixer to join VariableDeclaration's into a single declaration + * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join + * @returns {Function} The fixer function + */ + function joinDeclarations(declarations) { + const declaration = declarations[0]; + const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : []; + const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]); + const previousNode = body[currentIndex - 1]; + + return fixer => { + const type = sourceCode.getTokenBefore(declaration); + const prevSemi = sourceCode.getTokenBefore(type); + const res = []; + + if (previousNode && previousNode.kind === sourceCode.getText(type)) { + if (prevSemi.value === ";") { + res.push(fixer.replaceText(prevSemi, ",")); + } else { + res.push(fixer.insertTextAfter(prevSemi, ",")); + } + res.push(fixer.replaceText(type, "")); + } + + return res; + }; + } + + /** + * Fixer to split a VariableDeclaration into individual declarations + * @param {VariableDeclaration} declaration The `VariableDeclaration` to split + * @returns {Function} The fixer function + */ + function splitDeclarations(declaration) { + return fixer => declaration.declarations.map(declarator => { + const tokenAfterDeclarator = sourceCode.getTokenAfter(declarator); + + if (tokenAfterDeclarator === null) { + return null; + } + + const afterComma = sourceCode.getTokenAfter(tokenAfterDeclarator, { includeComments: true }); + + if (tokenAfterDeclarator.value !== ",") { + return null; + } + + /* + * `var x,y` + * tokenAfterDeclarator ^^ afterComma + */ + if (afterComma.range[0] === tokenAfterDeclarator.range[1]) { + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind} `); + } + + /* + * `var x, + * tokenAfterDeclarator ^ + * y` + * ^ afterComma + */ + if ( + afterComma.loc.start.line > tokenAfterDeclarator.loc.end.line || + afterComma.type === "Line" || + afterComma.type === "Block" + ) { + let lastComment = afterComma; + + while (lastComment.type === "Line" || lastComment.type === "Block") { + lastComment = sourceCode.getTokenAfter(lastComment, { includeComments: true }); + } + + return fixer.replaceTextRange( + [tokenAfterDeclarator.range[0], lastComment.range[0]], + `;${sourceCode.text.slice(tokenAfterDeclarator.range[1], lastComment.range[0])}${declaration.kind} ` + ); + } + + return fixer.replaceText(tokenAfterDeclarator, `; ${declaration.kind}`); + }).filter(x => x); + } + + /** + * Checks a given VariableDeclaration node for errors. + * @param {ASTNode} node The VariableDeclaration node to check + * @returns {void} + * @private + */ + function checkVariableDeclaration(node) { + const parent = node.parent; + const type = node.kind; + + if (!options[type]) { + return; + } + + const declarations = node.declarations; + const declarationCounts = countDeclarations(declarations); + const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire); + + if (options[type].initialized === MODE_ALWAYS) { + if (options.separateRequires && mixedRequires) { + context.report({ + node, + messageId: "splitRequires" + }); + } + } + + // consecutive + const nodeIndex = (parent.body && parent.body.length > 0 && parent.body.indexOf(node)) || 0; + + if (nodeIndex > 0) { + const previousNode = parent.body[nodeIndex - 1]; + const isPreviousNodeDeclaration = previousNode.type === "VariableDeclaration"; + const declarationsWithPrevious = declarations.concat(previousNode.declarations || []); + + if ( + isPreviousNodeDeclaration && + previousNode.kind === type && + !(declarationsWithPrevious.some(isRequire) && !declarationsWithPrevious.every(isRequire)) + ) { + const previousDeclCounts = countDeclarations(previousNode.declarations); + + if (options[type].initialized === MODE_CONSECUTIVE && options[type].uninitialized === MODE_CONSECUTIVE) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].initialized === MODE_CONSECUTIVE && declarationCounts.initialized > 0 && previousDeclCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else if (options[type].uninitialized === MODE_CONSECUTIVE && + declarationCounts.uninitialized > 0 && + previousDeclCounts.uninitialized > 0) { + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // always + if (!hasOnlyOneStatement(type, declarations)) { + if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { + context.report({ + node, + messageId: "combine", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } else { + if (options[type].initialized === MODE_ALWAYS && declarationCounts.initialized > 0) { + context.report({ + node, + messageId: "combineInitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + if (options[type].uninitialized === MODE_ALWAYS && declarationCounts.uninitialized > 0) { + if (node.parent.left === node && (node.parent.type === "ForInStatement" || node.parent.type === "ForOfStatement")) { + return; + } + context.report({ + node, + messageId: "combineUninitialized", + data: { + type + }, + fix: joinDeclarations(declarations) + }); + } + } + } + + // never + if (parent.type !== "ForStatement" || parent.init !== node) { + const totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; + + if (totalDeclarations > 1) { + if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { + + // both initialized and uninitialized + context.report({ + node, + messageId: "split", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { + + // initialized + context.report({ + node, + messageId: "splitInitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { + + // uninitialized + context.report({ + node, + messageId: "splitUninitialized", + data: { + type + }, + fix: splitDeclarations(node) + }); + } + } + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + Program: startFunction, + FunctionDeclaration: startFunction, + FunctionExpression: startFunction, + ArrowFunctionExpression: startFunction, + BlockStatement: startBlock, + ForStatement: startBlock, + ForInStatement: startBlock, + ForOfStatement: startBlock, + SwitchStatement: startBlock, + VariableDeclaration: checkVariableDeclaration, + "ForStatement:exit": endBlock, + "ForOfStatement:exit": endBlock, + "ForInStatement:exit": endBlock, + "SwitchStatement:exit": endBlock, + "BlockStatement:exit": endBlock, + "Program:exit": endFunction, + "FunctionDeclaration:exit": endFunction, + "FunctionExpression:exit": endFunction, + "ArrowFunctionExpression:exit": endFunction + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/operator-assignment.js b/day1/cli-study/node_modules/eslint/lib/rules/operator-assignment.js new file mode 100644 index 0000000..6820793 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/operator-assignment.js @@ -0,0 +1,243 @@ +/** + * @fileoverview Rule to replace assignment expressions with operator assignment + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether an operator is commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is commutative and has a + * shorthand form. + */ +function isCommutativeOperatorWithShorthand(operator) { + return ["*", "&", "^", "|"].indexOf(operator) >= 0; +} + +/** + * Checks whether an operator is not commutative and has an operator assignment + * shorthand form. + * @param {string} operator Operator to check. + * @returns {boolean} True if the operator is not commutative and has + * a shorthand form. + */ +function isNonCommutativeOperatorWithShorthand(operator) { + return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].indexOf(operator) >= 0; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Checks whether two expressions reference the same value. For example: + * a = a + * a.b = a.b + * a[0] = a[0] + * a['b'] = a['b'] + * @param {ASTNode} a Left side of the comparison. + * @param {ASTNode} b Right side of the comparison. + * @returns {boolean} True if both sides match and reference the same value. + */ +function same(a, b) { + if (a.type !== b.type) { + return false; + } + + switch (a.type) { + case "Identifier": + return a.name === b.name; + + case "Literal": + return a.value === b.value; + + case "MemberExpression": + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ + return same(a.object, b.object) && same(a.property, b.property); + + case "ThisExpression": + return true; + + default: + return false; + } +} + +/** + * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and) + * toString calls regardless of whether assignment shorthand is used) + * @param {ASTNode} node The node on the left side of the expression + * @returns {boolean} `true` if the node can be fixed + */ +function canBeFixed(node) { + return ( + node.type === "Identifier" || + ( + node.type === "MemberExpression" && + (node.object.type === "Identifier" || node.object.type === "ThisExpression") && + (!node.computed || node.property.type === "Literal") + ) + ); +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow assignment operator shorthand where possible", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-assignment" + }, + + schema: [ + { + enum: ["always", "never"] + } + ], + + fixable: "code", + messages: { + replaced: "Assignment can be replaced with operator assignment.", + unexpected: "Unexpected operator assignment shorthand." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + /** + * Returns the operator token of an AssignmentExpression or BinaryExpression + * @param {ASTNode} node An AssignmentExpression or BinaryExpression node + * @returns {Token} The operator token in the node + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + + /** + * Ensures that an assignment uses the shorthand form where possible. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function verify(node) { + if (node.operator !== "=" || node.right.type !== "BinaryExpression") { + return; + } + + const left = node.left; + const expr = node.right; + const operator = expr.operator; + + if (isCommutativeOperatorWithShorthand(operator) || isNonCommutativeOperatorWithShorthand(operator)) { + if (same(left, expr.left)) { + context.report({ + node, + messageId: "replaced", + fix(fixer) { + if (canBeFixed(left)) { + const equalsToken = getOperatorToken(node); + const operatorToken = getOperatorToken(expr); + const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]); + const rightText = sourceCode.getText().slice(operatorToken.range[1], node.right.range[1]); + + // Check for comments that would be removed. + if (sourceCode.commentsExistBetween(equalsToken, operatorToken)) { + return null; + } + + return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); + } + return null; + } + }); + } else if (same(left, expr.right) && isCommutativeOperatorWithShorthand(operator)) { + + /* + * This case can't be fixed safely. + * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would + * change the execution order of the valueOf() functions. + */ + context.report({ + node, + messageId: "replaced" + }); + } + } + } + + /** + * Warns if an assignment expression uses operator assignment shorthand. + * @param {ASTNode} node An AssignmentExpression node. + * @returns {void} + */ + function prohibit(node) { + if (node.operator !== "=") { + context.report({ + node, + messageId: "unexpected", + fix(fixer) { + if (canBeFixed(node.left)) { + const firstToken = sourceCode.getFirstToken(node); + const operatorToken = getOperatorToken(node); + const leftText = sourceCode.getText().slice(node.range[0], operatorToken.range[0]); + const newOperator = node.operator.slice(0, -1); + let rightText; + + // Check for comments that would be duplicated. + if (sourceCode.commentsExistBetween(firstToken, operatorToken)) { + return null; + } + + // If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side. + if ( + astUtils.getPrecedence(node.right) <= astUtils.getPrecedence({ type: "BinaryExpression", operator: newOperator }) && + !astUtils.isParenthesised(sourceCode, node.right) + ) { + rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`; + } else { + const tokenAfterOperator = sourceCode.getTokenAfter(operatorToken, { includeComments: true }); + let rightTextPrefix = ""; + + if ( + operatorToken.range[1] === tokenAfterOperator.range[0] && + !astUtils.canTokensBeAdjacent({ type: "Punctuator", value: newOperator }, tokenAfterOperator) + ) { + rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar + } + + rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`; + } + + return fixer.replaceText(node, `${leftText}= ${leftText}${newOperator}${rightText}`); + } + return null; + } + }); + } + } + + return { + AssignmentExpression: context.options[0] !== "never" ? verify : prohibit + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/operator-linebreak.js b/day1/cli-study/node_modules/eslint/lib/rules/operator-linebreak.js new file mode 100644 index 0000000..18da5c5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/operator-linebreak.js @@ -0,0 +1,247 @@ +/** + * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before + * @author Benoît Zugmeyer + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent linebreak style for operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/operator-linebreak" + }, + + schema: [ + { + enum: ["after", "before", "none", null] + }, + { + type: "object", + properties: { + overrides: { + type: "object", + additionalProperties: { + enum: ["after", "before", "none", "ignore"] + } + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + operatorAtBeginning: "'{{operator}}' should be placed at the beginning of the line.", + operatorAtEnd: "'{{operator}}' should be placed at the end of the line.", + badLinebreak: "Bad line breaking before and after '{{operator}}'.", + noLinebreak: "There should be no line break before or after '{{operator}}'." + } + }, + + create(context) { + + const usedDefaultGlobal = !context.options[0]; + const globalStyle = context.options[0] || "after"; + const options = context.options[1] || {}; + const styleOverrides = options.overrides ? Object.assign({}, options.overrides) : {}; + + if (usedDefaultGlobal && !styleOverrides["?"]) { + styleOverrides["?"] = "before"; + } + + if (usedDefaultGlobal && !styleOverrides[":"]) { + styleOverrides[":"] = "before"; + } + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Gets a fixer function to fix rule issues + * @param {Token} operatorToken The operator token of an expression + * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none' + * @returns {Function} A fixer function + */ + function getFixer(operatorToken, desiredStyle) { + return fixer => { + const tokenBefore = sourceCode.getTokenBefore(operatorToken); + const tokenAfter = sourceCode.getTokenAfter(operatorToken); + const textBefore = sourceCode.text.slice(tokenBefore.range[1], operatorToken.range[0]); + const textAfter = sourceCode.text.slice(operatorToken.range[1], tokenAfter.range[0]); + const hasLinebreakBefore = !astUtils.isTokenOnSameLine(tokenBefore, operatorToken); + const hasLinebreakAfter = !astUtils.isTokenOnSameLine(operatorToken, tokenAfter); + let newTextBefore, newTextAfter; + + if (hasLinebreakBefore !== hasLinebreakAfter && desiredStyle !== "none") { + + // If there is a comment before and after the operator, don't do a fix. + if (sourceCode.getTokenBefore(operatorToken, { includeComments: true }) !== tokenBefore && + sourceCode.getTokenAfter(operatorToken, { includeComments: true }) !== tokenAfter) { + + return null; + } + + /* + * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator. + * foo && + * bar + * would get fixed to + * foo + * && bar + */ + newTextBefore = textAfter; + newTextAfter = textBefore; + } else { + const LINEBREAK_REGEX = astUtils.createGlobalLinebreakMatcher(); + + // Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings. + newTextBefore = desiredStyle === "before" || textBefore.trim() ? textBefore : textBefore.replace(LINEBREAK_REGEX, ""); + newTextAfter = desiredStyle === "after" || textAfter.trim() ? textAfter : textAfter.replace(LINEBREAK_REGEX, ""); + + // If there was no change (due to interfering comments), don't output a fix. + if (newTextBefore === textBefore && newTextAfter === textAfter) { + return null; + } + } + + if (newTextAfter === "" && tokenAfter.type === "Punctuator" && "+-".includes(operatorToken.value) && tokenAfter.value === operatorToken.value) { + + // To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-. + newTextAfter += " "; + } + + return fixer.replaceTextRange([tokenBefore.range[1], tokenAfter.range[0]], newTextBefore + operatorToken.value + newTextAfter); + }; + } + + /** + * Checks the operator placement + * @param {ASTNode} node The node to check + * @param {ASTNode} leftSide The node that comes before the operator in `node` + * @private + * @returns {void} + */ + function validateNode(node, leftSide) { + + /* + * When the left part of a binary expression is a single expression wrapped in + * parentheses (ex: `(a) + b`), leftToken will be the last token of the expression + * and operatorToken will be the closing parenthesis. + * The leftToken should be the last closing parenthesis, and the operatorToken + * should be the token right after that. + */ + const operatorToken = sourceCode.getTokenAfter(leftSide, astUtils.isNotClosingParenToken); + const leftToken = sourceCode.getTokenBefore(operatorToken); + const rightToken = sourceCode.getTokenAfter(operatorToken); + const operator = operatorToken.value; + const operatorStyleOverride = styleOverrides[operator]; + const style = operatorStyleOverride || globalStyle; + const fix = getFixer(operatorToken, style); + + // if single line + if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && + astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // do nothing. + + } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) && + !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + // lone operator + context.report({ + node, + loc: operatorToken.loc, + messageId: "badLinebreak", + data: { + operator + }, + fix + }); + + } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtBeginning", + data: { + operator + }, + fix + }); + + } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "operatorAtEnd", + data: { + operator + }, + fix + }); + + } else if (style === "none") { + + context.report({ + node, + loc: operatorToken.loc, + messageId: "noLinebreak", + data: { + operator + }, + fix + }); + + } + } + + /** + * Validates a binary expression using `validateNode` + * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated + * @returns {void} + */ + function validateBinaryExpression(node) { + validateNode(node, node.left); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression: validateBinaryExpression, + LogicalExpression: validateBinaryExpression, + AssignmentExpression: validateBinaryExpression, + VariableDeclarator(node) { + if (node.init) { + validateNode(node, node.id); + } + }, + ConditionalExpression(node) { + validateNode(node, node.test); + validateNode(node, node.consequent); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/padded-blocks.js b/day1/cli-study/node_modules/eslint/lib/rules/padded-blocks.js new file mode 100644 index 0000000..f8b5bd9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/padded-blocks.js @@ -0,0 +1,298 @@ +/** + * @fileoverview A rule to ensure blank lines within blocks. + * @author Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding within blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padded-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + blocks: { + enum: ["always", "never"] + }, + switches: { + enum: ["always", "never"] + }, + classes: { + enum: ["always", "never"] + } + }, + additionalProperties: false, + minProperties: 1 + } + ] + }, + { + type: "object", + properties: { + allowSingleLineBlocks: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + alwaysPadBlock: "Block must be padded by blank lines.", + neverPadBlock: "Block must not be padded by blank lines." + } + }, + + create(context) { + const options = {}; + const typeOptions = context.options[0] || "always"; + const exceptOptions = context.options[1] || {}; + + if (typeof typeOptions === "string") { + const shouldHavePadding = typeOptions === "always"; + + options.blocks = shouldHavePadding; + options.switches = shouldHavePadding; + options.classes = shouldHavePadding; + } else { + if (Object.prototype.hasOwnProperty.call(typeOptions, "blocks")) { + options.blocks = typeOptions.blocks === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "switches")) { + options.switches = typeOptions.switches === "always"; + } + if (Object.prototype.hasOwnProperty.call(typeOptions, "classes")) { + options.classes = typeOptions.classes === "always"; + } + } + + if (Object.prototype.hasOwnProperty.call(exceptOptions, "allowSingleLineBlocks")) { + options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; + } + + const sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + return sourceCode.getTokenBefore(node.cases[0]); + } + return sourceCode.getFirstToken(node); + } + + /** + * Checks if the given parameter is a comment node + * @param {ASTNode|Token} node An AST node or token + * @returns {boolean} True if node is a comment + */ + function isComment(node) { + return node.type === "Line" || node.type === "Block"; + } + + /** + * Checks if there is padding between two tokens + * @param {Token} first The first token + * @param {Token} second The second token + * @returns {boolean} True if there is at least a line between the tokens + */ + function isPaddingBetweenTokens(first, second) { + return second.loc.start.line - first.loc.end.line >= 2; + } + + + /** + * Checks if the given token has a blank line after it. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is followed by a blank line. + */ + function getFirstBlockToken(token) { + let prev, + first = token; + + do { + prev = first; + first = sourceCode.getTokenAfter(first, { includeComments: true }); + } while (isComment(first) && first.loc.start.line === prev.loc.end.line); + + return first; + } + + /** + * Checks if the given token is preceded by a blank line. + * @param {Token} token The token to check + * @returns {boolean} Whether or not the token is preceded by a blank line + */ + function getLastBlockToken(token) { + let last = token, + next; + + do { + next = last; + last = sourceCode.getTokenBefore(last, { includeComments: true }); + } while (isComment(last) && last.loc.end.line === next.loc.start.line); + + return last; + } + + /** + * Checks if a node should be padded, according to the rule config. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} True if the node should be padded, false otherwise. + */ + function requirePaddingFor(node) { + switch (node.type) { + case "BlockStatement": + return options.blocks; + case "SwitchStatement": + return options.switches; + case "ClassBody": + return options.classes; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + } + + /** + * Checks the given BlockStatement node to be padded if the block is not empty. + * @param {ASTNode} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPadding(node) { + const openBrace = getOpenBrace(node), + firstBlockToken = getFirstBlockToken(openBrace), + tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, { includeComments: true }), + closeBrace = sourceCode.getLastToken(node), + lastBlockToken = getLastBlockToken(closeBrace), + tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, { includeComments: true }), + blockHasTopPadding = isPaddingBetweenTokens(tokenBeforeFirst, firstBlockToken), + blockHasBottomPadding = isPaddingBetweenTokens(lastBlockToken, tokenAfterLast); + + if (options.allowSingleLineBlocks && astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)) { + return; + } + + if (requirePaddingFor(node)) { + + if (!blockHasTopPadding) { + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.insertTextAfter(tokenBeforeFirst, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + if (!blockHasBottomPadding) { + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + fix(fixer) { + return fixer.insertTextBefore(tokenAfterLast, "\n"); + }, + messageId: "alwaysPadBlock" + }); + } + } else { + if (blockHasTopPadding) { + + context.report({ + node, + loc: { + start: tokenBeforeFirst.loc.start, + end: firstBlockToken.loc.start + }, + fix(fixer) { + return fixer.replaceTextRange([tokenBeforeFirst.range[1], firstBlockToken.range[0] - firstBlockToken.loc.start.column], "\n"); + }, + messageId: "neverPadBlock" + }); + } + + if (blockHasBottomPadding) { + + context.report({ + node, + loc: { + end: tokenAfterLast.loc.start, + start: lastBlockToken.loc.end + }, + messageId: "neverPadBlock", + fix(fixer) { + return fixer.replaceTextRange([lastBlockToken.range[1], tokenAfterLast.range[0] - tokenAfterLast.loc.start.column], "\n"); + } + }); + } + } + } + + const rule = {}; + + if (Object.prototype.hasOwnProperty.call(options, "switches")) { + rule.SwitchStatement = function(node) { + if (node.cases.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "blocks")) { + rule.BlockStatement = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (Object.prototype.hasOwnProperty.call(options, "classes")) { + rule.ClassBody = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + return rule; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/padding-line-between-statements.js b/day1/cli-study/node_modules/eslint/lib/rules/padding-line-between-statements.js new file mode 100644 index 0000000..eea19f5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -0,0 +1,632 @@ +/** + * @fileoverview Rule to require or disallow newlines between statements + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`; +const PADDING_LINE_SEQUENCE = new RegExp( + String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`, + "u" +); +const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u; +const CJS_IMPORT = /^require\(/u; + +/** + * Creates tester which check if a node starts with specific keyword. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newKeywordTester(keyword) { + return { + test: (node, sourceCode) => + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node is specific type. + * @param {string} type The node type to test. + * @returns {Object} the created tester. + * @private + */ +function newNodeTypeTester(type) { + return { + test: node => + node.type === type + }; +} + +/** + * Checks the given node is an expression statement of IIFE. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is an expression statement of IIFE. + * @private + */ +function isIIFEStatement(node) { + if (node.type === "ExpressionStatement") { + let call = node.expression; + + if (call.type === "UnaryExpression") { + call = call.argument; + } + return call.type === "CallExpression" && astUtils.isFunction(call.callee); + } + return false; +} + +/** + * Checks whether the given node is a block-like statement. + * This checks the last token of the node is the closing brace of a block. + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a block-like statement. + * @private + */ +function isBlockLikeStatement(sourceCode, node) { + + // do-while with a block is a block-like statement. + if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") { + return true; + } + + /* + * IIFE is a block-like statement specially from + * JSCS#disallowPaddingNewLinesAfterBlocks. + */ + if (isIIFEStatement(node)) { + return true; + } + + // Checks the last token is a closing brace of blocks. + const lastToken = sourceCode.getLastToken(node, astUtils.isNotSemicolonToken); + const belongingNode = lastToken && astUtils.isClosingBraceToken(lastToken) + ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) + : null; + + return Boolean(belongingNode) && ( + belongingNode.type === "BlockStatement" || + belongingNode.type === "SwitchStatement" + ); +} + +/** + * Check whether the given node is a directive or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a directive. + */ +function isDirective(node, sourceCode) { + return ( + node.type === "ExpressionStatement" && + ( + node.parent.type === "Program" || + ( + node.parent.type === "BlockStatement" && + astUtils.isFunction(node.parent.parent) + ) + ) && + node.expression.type === "Literal" && + typeof node.expression.value === "string" && + !astUtils.isParenthesised(sourceCode, node.expression) + ); +} + +/** + * Check whether the given node is a part of directive prologue or not. + * @param {ASTNode} node The node to check. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {boolean} `true` if the node is a part of directive prologue. + */ +function isDirectivePrologue(node, sourceCode) { + if (isDirective(node, sourceCode)) { + for (const sibling of node.parent.body) { + if (sibling === node) { + break; + } + if (!isDirective(sibling, sourceCode)) { + return false; + } + } + return true; + } + return false; +} + +/** + * Gets the actual last token. + * + * If a semicolon is semicolon-less style's semicolon, this ignores it. + * For example: + * + * foo() + * ;[1, 2, 3].forEach(bar) + * @param {SourceCode} sourceCode The source code to get tokens. + * @param {ASTNode} node The node to get. + * @returns {Token} The actual last token. + * @private + */ +function getActualLastToken(sourceCode, node) { + const semiToken = sourceCode.getLastToken(node); + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const isSemicolonLessStyle = Boolean( + prevToken && + nextToken && + prevToken.range[0] >= node.range[0] && + astUtils.isSemicolonToken(semiToken) && + semiToken.loc.start.line !== prevToken.loc.end.line && + semiToken.loc.end.line === nextToken.loc.start.line + ); + + return isSemicolonLessStyle ? prevToken : semiToken; +} + +/** + * This returns the concatenation of the first 2 captured strings. + * @param {string} _ Unused. Whole matched string. + * @param {string} trailingSpaces The trailing spaces of the first line. + * @param {string} indentSpaces The indentation spaces of the last line. + * @returns {string} The concatenation of trailingSpaces and indentSpaces. + * @private + */ +function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) { + return trailingSpaces + indentSpaces; +} + +/** + * Check and report statements for `any` configuration. + * It does nothing. + * @returns {void} + * @private + */ +function verifyForAny() { +} + +/** + * Check and report statements for `never` configuration. + * This autofix removes blank lines between the given 2 statements. + * However, if comments exist between 2 blank lines, it does not remove those + * blank lines automatically. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} _ Unused. The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForNever(context, _, nextNode, paddingLines) { + if (paddingLines.length === 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "unexpectedBlankLine", + fix(fixer) { + if (paddingLines.length >= 2) { + return null; + } + + const prevToken = paddingLines[0][0]; + const nextToken = paddingLines[0][1]; + const start = prevToken.range[1]; + const end = nextToken.range[0]; + const text = context.getSourceCode().text + .slice(start, end) + .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); + + return fixer.replaceTextRange([start, end], text); + } + }); +} + +/** + * Check and report statements for `always` configuration. + * This autofix inserts a blank line between the given 2 statements. + * If the `prevNode` has trailing comments, it inserts a blank line after the + * trailing comments. + * @param {RuleContext} context The rule context to report. + * @param {ASTNode} prevNode The previous node to check. + * @param {ASTNode} nextNode The next node to check. + * @param {Array} paddingLines The array of token pairs that blank + * lines exist between the pair. + * @returns {void} + * @private + */ +function verifyForAlways(context, prevNode, nextNode, paddingLines) { + if (paddingLines.length > 0) { + return; + } + + context.report({ + node: nextNode, + messageId: "expectedBlankLine", + fix(fixer) { + const sourceCode = context.getSourceCode(); + let prevToken = getActualLastToken(sourceCode, prevNode); + const nextToken = sourceCode.getFirstTokenBetween( + prevToken, + nextNode, + { + includeComments: true, + + /** + * Skip the trailing comments of the previous node. + * This inserts a blank line after the last trailing comment. + * + * For example: + * + * foo(); // trailing comment. + * // comment. + * bar(); + * + * Get fixed to: + * + * foo(); // trailing comment. + * + * // comment. + * bar(); + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is not a trailing comment. + * @private + */ + filter(token) { + if (astUtils.isTokenOnSameLine(prevToken, token)) { + prevToken = token; + return false; + } + return true; + } + } + ) || nextNode; + const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken) + ? "\n\n" + : "\n"; + + return fixer.insertTextAfter(prevToken, insertText); + } + }); +} + +/** + * Types of blank lines. + * `any`, `never`, and `always` are defined. + * Those have `verify` method to check and report statements. + * @private + */ +const PaddingTypes = { + any: { verify: verifyForAny }, + never: { verify: verifyForNever }, + always: { verify: verifyForAlways } +}; + +/** + * Types of statements. + * Those have `test` method to check it matches to the given statement. + * @private + */ +const StatementTypes = { + "*": { test: () => true }, + "block-like": { + test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node) + }, + "cjs-export": { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + node.expression.type === "AssignmentExpression" && + CJS_EXPORT.test(sourceCode.getText(node.expression.left)) + }, + "cjs-import": { + test: (node, sourceCode) => + node.type === "VariableDeclaration" && + node.declarations.length > 0 && + Boolean(node.declarations[0].init) && + CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)) + }, + directive: { + test: isDirectivePrologue + }, + expression: { + test: (node, sourceCode) => + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + iife: { + test: isIIFEStatement + }, + "multiline-block-like": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + isBlockLikeStatement(sourceCode, node) + }, + "multiline-expression": { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + node.type === "ExpressionStatement" && + !isDirectivePrologue(node, sourceCode) + }, + + "multiline-const": newMultilineKeywordTester("const"), + "multiline-let": newMultilineKeywordTester("let"), + "multiline-var": newMultilineKeywordTester("var"), + "singleline-const": newSinglelineKeywordTester("const"), + "singleline-let": newSinglelineKeywordTester("let"), + "singleline-var": newSinglelineKeywordTester("var"), + + block: newNodeTypeTester("BlockStatement"), + empty: newNodeTypeTester("EmptyStatement"), + function: newNodeTypeTester("FunctionDeclaration"), + + break: newKeywordTester("break"), + case: newKeywordTester("case"), + class: newKeywordTester("class"), + const: newKeywordTester("const"), + continue: newKeywordTester("continue"), + debugger: newKeywordTester("debugger"), + default: newKeywordTester("default"), + do: newKeywordTester("do"), + export: newKeywordTester("export"), + for: newKeywordTester("for"), + if: newKeywordTester("if"), + import: newKeywordTester("import"), + let: newKeywordTester("let"), + return: newKeywordTester("return"), + switch: newKeywordTester("switch"), + throw: newKeywordTester("throw"), + try: newKeywordTester("try"), + var: newKeywordTester("var"), + while: newKeywordTester("while"), + with: newKeywordTester("with") +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow padding lines between statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/padding-line-between-statements" + }, + + fixable: "whitespace", + + schema: { + definitions: { + paddingType: { + enum: Object.keys(PaddingTypes) + }, + statementType: { + anyOf: [ + { enum: Object.keys(StatementTypes) }, + { + type: "array", + items: { enum: Object.keys(StatementTypes) }, + minItems: 1, + uniqueItems: true, + additionalItems: false + } + ] + } + }, + type: "array", + items: { + type: "object", + properties: { + blankLine: { $ref: "#/definitions/paddingType" }, + prev: { $ref: "#/definitions/statementType" }, + next: { $ref: "#/definitions/statementType" } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + }, + additionalItems: false + }, + + messages: { + unexpectedBlankLine: "Unexpected blank line before this statement.", + expectedBlankLine: "Expected blank line before this statement." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const configureList = context.options || []; + let scopeInfo = null; + + /** + * Processes to enter to new scope. + * This manages the current previous statement. + * @returns {void} + * @private + */ + function enterScope() { + scopeInfo = { + upper: scopeInfo, + prevNode: null + }; + } + + /** + * Processes to exit from the current scope. + * @returns {void} + * @private + */ + function exitScope() { + scopeInfo = scopeInfo.upper; + } + + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The statement node to check. + * @param {string|string[]} type The statement type to check. + * @returns {boolean} `true` if the statement node matched the type. + * @private + */ + function match(node, type) { + let innerStatementNode = node; + + while (innerStatementNode.type === "LabeledStatement") { + innerStatementNode = innerStatementNode.body; + } + if (Array.isArray(type)) { + return type.some(match.bind(null, innerStatementNode)); + } + return StatementTypes[type].test(innerStatementNode, sourceCode); + } + + /** + * Finds the last matched configure from configureList. + * @param {ASTNode} prevNode The previous statement to match. + * @param {ASTNode} nextNode The current statement to match. + * @returns {Object} The tester of the last matched configure. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return PaddingTypes[configure.blankLine]; + } + } + return PaddingTypes.any; + } + + /** + * Gets padding line sequences between the given 2 statements. + * Comments are separators of the padding line sequences. + * @param {ASTNode} prevNode The previous statement to count. + * @param {ASTNode} nextNode The current statement to count. + * @returns {Array} The array of token pairs. + * @private + */ + function getPaddingLineSequences(prevNode, nextNode) { + const pairs = []; + let prevToken = getActualLastToken(sourceCode, prevNode); + + if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) { + do { + const token = sourceCode.getTokenAfter( + prevToken, + { includeComments: true } + ); + + if (token.loc.start.line - prevToken.loc.end.line >= 2) { + pairs.push([prevToken, token]); + } + prevToken = token; + + } while (prevToken.range[0] < nextNode.range[0]); + } + + return pairs; + } + + /** + * Verify padding lines between the given node and the previous node. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verify(node) { + const parentType = node.parent.type; + const validParent = + astUtils.STATEMENT_LIST_PARENTS.has(parentType) || + parentType === "SwitchStatement"; + + if (!validParent) { + return; + } + + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; + + // Verify. + if (prevNode) { + const type = getPaddingType(prevNode, node); + const paddingLines = getPaddingLineSequences(prevNode, node); + + type.verify(context, prevNode, node, paddingLines); + } + + scopeInfo.prevNode = node; + } + + /** + * Verify padding lines between the given node and the previous node. + * Then process to enter to new scope. + * @param {ASTNode} node The node to verify. + * @returns {void} + * @private + */ + function verifyThenEnterScope(node) { + verify(node); + enterScope(); + } + + return { + Program: enterScope, + BlockStatement: enterScope, + SwitchStatement: enterScope, + "Program:exit": exitScope, + "BlockStatement:exit": exitScope, + "SwitchStatement:exit": exitScope, + + ":statement": verify, + + SwitchCase: verifyThenEnterScope, + "SwitchCase:exit": exitScope + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-arrow-callback.js new file mode 100644 index 0000000..d4e0251 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,314 @@ +/** + * @fileoverview A rule to suggest using arrow functions as callbacks. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable is a function name. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given MetaProperty node equals to a given value. + * @param {ASTNode} node A MetaProperty node to check. + * @param {string} metaName The name of `MetaProperty.meta`. + * @param {string} propertyName The name of `MetaProperty.property`. + * @returns {boolean} `true` if the node is the specific value. + */ +function checkMetaProperty(node, metaName, propertyName) { + return node.meta.name === metaName && node.property.name === propertyName; +} + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the + * implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next */ + return null; +} + +/** + * Checks whether or not a given node is a callback. + * @param {ASTNode} node A node to check. + * @returns {Object} + * {boolean} retv.isCallback - `true` if the node is a callback. + * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. + */ +function getCallbackInfo(node) { + const retv = { isCallback: false, isLexicalThis: false }; + let currentNode = node; + let parent = node.parent; + + while (currentNode) { + switch (parent.type) { + + // Checks parents recursively. + + case "LogicalExpression": + case "ConditionalExpression": + break; + + // Checks whether the parent node is `.bind(this)` call. + case "MemberExpression": + if (parent.object === currentNode && + !parent.property.computed && + parent.property.type === "Identifier" && + parent.property.name === "bind" && + parent.parent.type === "CallExpression" && + parent.parent.callee === parent + ) { + retv.isLexicalThis = ( + parent.parent.arguments.length === 1 && + parent.parent.arguments[0].type === "ThisExpression" + ); + parent = parent.parent; + } else { + return retv; + } + break; + + // Checks whether the node is a callback. + case "CallExpression": + case "NewExpression": + if (parent.callee !== currentNode) { + retv.isCallback = true; + } + return retv; + + default: + return retv; + } + + currentNode = parent; + parent = parent.parent; + } + + /* istanbul ignore next */ + throw new Error("unreachable"); +} + +/** + * Checks whether a simple list of parameters contains any duplicates. This does not handle complex + * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate + * parameter names anyway. Instead, it always returns `false` for complex parameter lists. + * @param {ASTNode[]} paramsList The list of parameters for a function + * @returns {boolean} `true` if the list of parameters contains any duplicates + */ +function hasDuplicateParams(paramsList) { + return paramsList.every(param => param.type === "Identifier") && paramsList.length !== new Set(paramsList.map(param => param.name)).size; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using arrow functions for callbacks", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-arrow-callback" + }, + + schema: [ + { + type: "object", + properties: { + allowNamedFunctions: { + type: "boolean", + default: false + }, + allowUnboundThis: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + preferArrowCallback: "Unexpected function expression." + } + }, + + create(context) { + const options = context.options[0] || {}; + + const allowUnboundThis = options.allowUnboundThis !== false; // default to true + const allowNamedFunctions = options.allowNamedFunctions; + const sourceCode = context.getSourceCode(); + + /* + * {Array<{this: boolean, super: boolean, meta: boolean}>} + * - this - A flag which shows there are one or more ThisExpression. + * - super - A flag which shows there are one or more Super. + * - meta - A flag which shows there are one or more MethProperty. + */ + let stack = []; + + /** + * Pushes new function scope with all `false` flags. + * @returns {void} + */ + function enterScope() { + stack.push({ this: false, super: false, meta: false }); + } + + /** + * Pops a function scope from the stack. + * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + */ + function exitScope() { + return stack.pop(); + } + + return { + + // Reset internal state. + Program() { + stack = []; + }, + + // If there are below, it cannot replace with arrow functions merely. + ThisExpression() { + const info = stack[stack.length - 1]; + + if (info) { + info.this = true; + } + }, + + Super() { + const info = stack[stack.length - 1]; + + if (info) { + info.super = true; + } + }, + + MetaProperty(node) { + const info = stack[stack.length - 1]; + + if (info && checkMetaProperty(node, "new", "target")) { + info.meta = true; + } + }, + + // To skip nested scopes. + FunctionDeclaration: enterScope, + "FunctionDeclaration:exit": exitScope, + + // Main. + FunctionExpression: enterScope, + "FunctionExpression:exit"(node) { + const scopeInfo = exitScope(); + + // Skip named function expressions + if (allowNamedFunctions && node.id && node.id.name) { + return; + } + + // Skip generators. + if (node.generator) { + return; + } + + // Skip recursive functions. + const nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + // Skip if it's using arguments. + const variable = getVariableOfArguments(context.getScope()); + + if (variable && variable.references.length > 0) { + return; + } + + // Reports if it's a callback which can replace with arrows. + const callbackInfo = getCallbackInfo(node); + + if (callbackInfo.isCallback && + (!allowUnboundThis || !scopeInfo.this || callbackInfo.isLexicalThis) && + !scopeInfo.super && + !scopeInfo.meta + ) { + context.report({ + node, + messageId: "preferArrowCallback", + fix(fixer) { + if ((!callbackInfo.isLexicalThis && scopeInfo.this) || hasDuplicateParams(node.params)) { + + /* + * If the callback function does not have .bind(this) and contains a reference to `this`, there + * is no way to determine what `this` should be, so don't perform any fixes. + * If the callback function has duplicates in its list of parameters (possible in sloppy mode), + * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. + */ + return null; + } + + const paramsLeftParen = node.params.length ? sourceCode.getTokenBefore(node.params[0]) : sourceCode.getTokenBefore(node.body, 1); + const paramsRightParen = sourceCode.getTokenBefore(node.body); + const asyncKeyword = node.async ? "async " : ""; + const paramsFullText = sourceCode.text.slice(paramsLeftParen.range[0], paramsRightParen.range[1]); + const arrowFunctionText = `${asyncKeyword}${paramsFullText} => ${sourceCode.getText(node.body)}`; + + /* + * If the callback function has `.bind(this)`, replace it with an arrow function and remove the binding. + * Otherwise, just replace the arrow function itself. + */ + const replacedNode = callbackInfo.isLexicalThis ? node.parent.parent : node; + + /* + * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then + * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even + * though `foo || function() {}` is valid. + */ + const needsParens = replacedNode.parent.type !== "CallExpression" && replacedNode.parent.type !== "ConditionalExpression"; + const replacementText = needsParens ? `(${arrowFunctionText})` : arrowFunctionText; + + return fixer.replaceText(replacedNode, replacementText); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-const.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-const.js new file mode 100644 index 0000000..439a4db --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-const.js @@ -0,0 +1,476 @@ +/** + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; +const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/u; +const DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/u; + +/** + * Checks whether a given node is located at `ForStatement.init` or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is located at `ForStatement.init`. + */ +function isInitOfForStatement(node) { + return node.parent.type === "ForStatement" && node.parent.init === node; +} + +/** + * Checks whether a given Identifier node becomes a VariableDeclaration or not. + * @param {ASTNode} identifier An Identifier node to check. + * @returns {boolean} `true` if the node can become a VariableDeclaration. + */ +function canBecomeVariableDeclaration(identifier) { + let node = identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + return ( + node.type === "VariableDeclarator" || + ( + node.type === "AssignmentExpression" && + node.parent.type === "ExpressionStatement" && + DECLARATION_HOST_TYPE.test(node.parent.parent.type) + ) + ); +} + +/** + * Checks if an property or element is from outer scope or function parameters + * in destructing pattern. + * @param {string} name A variable name to be checked. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @returns {boolean} Indicates if the variable is from outer scope or function parameters. + */ +function isOuterVariableInDestructing(name, initScope) { + + if (initScope.through.find(ref => ref.resolved && ref.resolved.name === name)) { + return true; + } + + const variable = astUtils.getVariableByName(initScope, name); + + if (variable !== null) { + return variable.defs.some(def => def.type === "Parameter"); + } + + return false; +} + +/** + * Gets the VariableDeclarator/AssignmentExpression node that a given reference + * belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Reference} reference A reference to get. + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or + * null. + */ +function getDestructuringHost(reference) { + if (!reference.isWrite()) { + return null; + } + let node = reference.identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + if (!DESTRUCTURING_HOST_TYPE.test(node.type)) { + return null; + } + return node; +} + +/** + * Determines if a destructuring assignment node contains + * any MemberExpression nodes. This is used to determine if a + * variable that is only written once using destructuring can be + * safely converted into a const declaration. + * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check. + * @returns {boolean} True if the destructuring pattern contains + * a MemberExpression, false if not. + */ +function hasMemberExpressionAssignment(node) { + switch (node.type) { + case "ObjectPattern": + return node.properties.some(prop => { + if (prop) { + + /* + * Spread elements have an argument property while + * others have a value property. Because different + * parsers use different node types for spread elements, + * we just check if there is an argument property. + */ + return hasMemberExpressionAssignment(prop.argument || prop.value); + } + + return false; + }); + + case "ArrayPattern": + return node.elements.some(element => { + if (element) { + return hasMemberExpressionAssignment(element); + } + + return false; + }); + + case "AssignmentPattern": + return hasMemberExpressionAssignment(node.left); + + case "MemberExpression": + return true; + + // no default + } + + return false; +} + +/** + * Gets an identifier node of a given variable. + * + * If the initialization exists or one or more reading references exist before + * the first assignment, the identifier node is the node of the declaration. + * Otherwise, the identifier node is the node of the first assignment. + * + * If the variable should not change to const, this function returns null. + * - If the variable is reassigned. + * - If the variable is never initialized nor assigned. + * - If the variable is initialized in a different scope from the declaration. + * - If the unique assignment of the variable cannot change to a declaration. + * e.g. `if (a) b = 1` / `return (b = 1)` + * - If the variable is declared in the global scope and `eslintUsed` is `true`. + * `/*exported foo` directive comment makes such variables. This rule does not + * warn such variables because this rule cannot distinguish whether the + * exported variables are reassigned or not. + * @param {eslint-scope.Variable} variable A variable to get. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {ASTNode|null} + * An Identifier node if the variable should change to const. + * Otherwise, null. + */ +function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { + if (variable.eslintUsed && variable.scope.type === "global") { + return null; + } + + // Finds the unique WriteReference. + let writer = null; + let isReadBeforeInit = false; + const references = variable.references; + + for (let i = 0; i < references.length; ++i) { + const reference = references[i]; + + if (reference.isWrite()) { + const isReassigned = ( + writer !== null && + writer.identifier !== reference.identifier + ); + + if (isReassigned) { + return null; + } + + const destructuringHost = getDestructuringHost(reference); + + if (destructuringHost !== null && destructuringHost.left !== void 0) { + const leftNode = destructuringHost.left; + let hasOuterVariables = false, + hasNonIdentifiers = false; + + if (leftNode.type === "ObjectPattern") { + const properties = leftNode.properties; + + hasOuterVariables = properties + .filter(prop => prop.value) + .map(prop => prop.value.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + + } else if (leftNode.type === "ArrayPattern") { + const elements = leftNode.elements; + + hasOuterVariables = elements + .map(element => element && element.name) + .some(name => isOuterVariableInDestructing(name, variable.scope)); + + hasNonIdentifiers = hasMemberExpressionAssignment(leftNode); + } + + if (hasOuterVariables || hasNonIdentifiers) { + return null; + } + + } + + writer = reference; + + } else if (reference.isRead() && writer === null) { + if (ignoreReadBeforeAssign) { + return null; + } + isReadBeforeInit = true; + } + } + + /* + * If the assignment is from a different scope, ignore it. + * If the assignment cannot change to a declaration, ignore it. + */ + const shouldBeConst = ( + writer !== null && + writer.from === variable.scope && + canBecomeVariableDeclaration(writer.identifier) + ); + + if (!shouldBeConst) { + return null; + } + + if (isReadBeforeInit) { + return variable.defs[0].name; + } + + return writer.identifier; +} + +/** + * Groups by the VariableDeclarator/AssignmentExpression node that each + * reference of given variables belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * @param {eslint-scope.Variable[]} variables Variables to group by destructuring. + * @param {boolean} ignoreReadBeforeAssign + * The value of `ignoreReadBeforeAssign` option. + * @returns {Map} Grouped identifier nodes. + */ +function groupByDestructuring(variables, ignoreReadBeforeAssign) { + const identifierMap = new Map(); + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + const references = variable.references; + const identifier = getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign); + let prevId = null; + + for (let j = 0; j < references.length; ++j) { + const reference = references[j]; + const id = reference.identifier; + + /* + * Avoid counting a reference twice or more for default values of + * destructuring. + */ + if (id === prevId) { + continue; + } + prevId = id; + + // Add the identifier node into the destructuring group. + const group = getDestructuringHost(reference); + + if (group) { + if (identifierMap.has(group)) { + identifierMap.get(group).push(identifier); + } else { + identifierMap.set(group, [identifier]); + } + } + } + } + + return identifierMap; +} + +/** + * Finds the nearest parent of node with a given type. + * @param {ASTNode} node The node to search from. + * @param {string} type The type field of the parent node. + * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise. + * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists. + */ +function findUp(node, type, shouldStop) { + if (!node || shouldStop(node)) { + return null; + } + if (node.type === type) { + return node; + } + return findUp(node.parent, type, shouldStop); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `const` declarations for variables that are never reassigned after declared", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-const" + }, + + fixable: "code", + + schema: [ + { + type: "object", + properties: { + destructuring: { enum: ["any", "all"], default: "any" }, + ignoreReadBeforeAssign: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + messages: { + useConst: "'{{name}}' is never reassigned. Use 'const' instead." + } + }, + + create(context) { + const options = context.options[0] || {}; + const sourceCode = context.getSourceCode(); + const shouldMatchAnyDestructuredVariable = options.destructuring !== "all"; + const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true; + const variables = []; + let reportCount = 0; + let checkedId = null; + let checkedName = ""; + + + /** + * Reports given identifier nodes if all of the nodes should be declared + * as const. + * + * The argument 'nodes' is an array of Identifier nodes. + * This node is the result of 'getIdentifierIfShouldBeConst()', so it's + * nullable. In simple declaration or assignment cases, the length of + * the array is 1. In destructuring cases, the length of the array can + * be 2 or more. + * @param {(eslint-scope.Reference|null)[]} nodes + * References which are grouped by destructuring to report. + * @returns {void} + */ + function checkGroup(nodes) { + const nodesToReport = nodes.filter(Boolean); + + if (nodes.length && (shouldMatchAnyDestructuredVariable || nodesToReport.length === nodes.length)) { + const varDeclParent = findUp(nodes[0], "VariableDeclaration", parentNode => parentNode.type.endsWith("Statement")); + const isVarDecParentNull = varDeclParent === null; + + if (!isVarDecParentNull && varDeclParent.declarations.length > 0) { + const firstDeclaration = varDeclParent.declarations[0]; + + if (firstDeclaration.init) { + const firstDecParent = firstDeclaration.init.parent; + + /* + * First we check the declaration type and then depending on + * if the type is a "VariableDeclarator" or its an "ObjectPattern" + * we compare the name and id from the first identifier, if the names are different + * we assign the new name, id and reset the count of reportCount and nodeCount in + * order to check each block for the number of reported errors and base our fix + * based on comparing nodes.length and nodesToReport.length. + */ + + if (firstDecParent.type === "VariableDeclarator") { + + if (firstDecParent.id.name !== checkedName) { + checkedName = firstDecParent.id.name; + reportCount = 0; + } + + if (firstDecParent.id.type === "ObjectPattern") { + if (firstDecParent.init.name !== checkedName) { + checkedName = firstDecParent.init.name; + reportCount = 0; + } + } + + if (firstDecParent.id !== checkedId) { + checkedId = firstDecParent.id; + reportCount = 0; + } + } + } + } + + let shouldFix = varDeclParent && + + // Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop) + (varDeclParent.parent.type === "ForInStatement" || varDeclParent.parent.type === "ForOfStatement" || + varDeclParent.declarations.every(declaration => declaration.init)) && + + /* + * If options.destructuring is "all", then this warning will not occur unless + * every assignment in the destructuring should be const. In that case, it's safe + * to apply the fix. + */ + nodesToReport.length === nodes.length; + + if (!isVarDecParentNull && varDeclParent.declarations && varDeclParent.declarations.length !== 1) { + + if (varDeclParent && varDeclParent.declarations && varDeclParent.declarations.length >= 1) { + + /* + * Add nodesToReport.length to a count, then comparing the count to the length + * of the declarations in the current block. + */ + + reportCount += nodesToReport.length; + + shouldFix = shouldFix && (reportCount === varDeclParent.declarations.length); + } + } + + nodesToReport.forEach(node => { + context.report({ + node, + messageId: "useConst", + data: node, + fix: shouldFix + ? fixer => fixer.replaceText( + sourceCode.getFirstToken(varDeclParent, t => t.value === varDeclParent.kind), + "const" + ) + : null + }); + }); + } + } + + return { + "Program:exit"() { + groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(checkGroup); + }, + + VariableDeclaration(node) { + if (node.kind === "let" && !isInitOfForStatement(node)) { + variables.push(...context.getDeclaredVariables(node)); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-destructuring.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-destructuring.js new file mode 100644 index 0000000..1a51956 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -0,0 +1,272 @@ +/** + * @fileoverview Prefer destructuring from arrays and objects + * @author Alex LaFroscia + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require destructuring from arrays and/or objects", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-destructuring" + }, + + fixable: "code", + + schema: [ + { + + /* + * old support {array: Boolean, object: Boolean} + * new support {VariableDeclarator: {}, AssignmentExpression: {}} + */ + oneOf: [ + { + type: "object", + properties: { + VariableDeclarator: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + }, + AssignmentExpression: { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }, + { + type: "object", + properties: { + array: { + type: "boolean" + }, + object: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + }, + { + type: "object", + properties: { + enforceForRenamedProperties: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + + messages: { + preferDestructuring: "Use {{type}} destructuring." + } + }, + create(context) { + + const enabledTypes = context.options[0]; + const enforceForRenamedProperties = context.options[1] && context.options[1].enforceForRenamedProperties; + let normalizedOptions = { + VariableDeclarator: { array: true, object: true }, + AssignmentExpression: { array: true, object: true } + }; + + if (enabledTypes) { + normalizedOptions = typeof enabledTypes.array !== "undefined" || typeof enabledTypes.object !== "undefined" + ? { VariableDeclarator: enabledTypes, AssignmentExpression: enabledTypes } + : enabledTypes; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator" + * @param {string} destructuringType "array" or "object" + * @returns {boolean} `true` if the destructuring type should be checked for the given node + */ + function shouldCheck(nodeType, destructuringType) { + return normalizedOptions && + normalizedOptions[nodeType] && + normalizedOptions[nodeType][destructuringType]; + } + + /** + * Determines if the given node is accessing an array index + * + * This is used to differentiate array index access from object property + * access. + * @param {ASTNode} node the node to evaluate + * @returns {boolean} whether or not the node is an integer + */ + function isArrayIndexAccess(node) { + return Number.isInteger(node.property.value); + } + + /** + * Report that the given node should use destructuring + * @param {ASTNode} reportNode the node to report + * @param {string} type the type of destructuring that should have been done + * @param {Function|null} fix the fix function or null to pass to context.report + * @returns {void} + */ + function report(reportNode, type, fix) { + context.report({ + node: reportNode, + messageId: "preferDestructuring", + data: { type }, + fix + }); + } + + /** + * Determines if a node should be fixed into object destructuring + * + * The fixer only fixes the simplest case of object destructuring, + * like: `let x = a.x`; + * + * Assignment expression is not fixed. + * Array destructuring is not fixed. + * Renamed property is not fixed. + * @param {ASTNode} node the the node to evaluate + * @returns {boolean} whether or not the node should be fixed + */ + function shouldFix(node) { + return node.type === "VariableDeclarator" && + node.id.type === "Identifier" && + node.init.type === "MemberExpression" && + node.id.name === node.init.property.name; + } + + /** + * Fix a node into object destructuring. + * This function only handles the simplest case of object destructuring, + * see {@link shouldFix}. + * @param {SourceCodeFixer} fixer the fixer object + * @param {ASTNode} node the node to be fixed. + * @returns {Object} a fix for the node + */ + function fixIntoObjectDestructuring(fixer, node) { + const rightNode = node.init; + const sourceCode = context.getSourceCode(); + + return fixer.replaceText( + node, + `{${rightNode.property.name}} = ${sourceCode.getText(rightNode.object)}` + ); + } + + /** + * Check that the `prefer-destructuring` rules are followed based on the + * given left- and right-hand side of the assignment. + * + * Pulled out into a separate method so that VariableDeclarators and + * AssignmentExpressions can share the same verification logic. + * @param {ASTNode} leftNode the left-hand side of the assignment + * @param {ASTNode} rightNode the right-hand side of the assignment + * @param {ASTNode} reportNode the node to report the error on + * @returns {void} + */ + function performCheck(leftNode, rightNode, reportNode) { + if (rightNode.type !== "MemberExpression" || rightNode.object.type === "Super") { + return; + } + + if (isArrayIndexAccess(rightNode)) { + if (shouldCheck(reportNode.type, "array")) { + report(reportNode, "array", null); + } + return; + } + + const fix = shouldFix(reportNode) + ? fixer => fixIntoObjectDestructuring(fixer, reportNode) + : null; + + if (shouldCheck(reportNode.type, "object") && enforceForRenamedProperties) { + report(reportNode, "object", fix); + return; + } + + if (shouldCheck(reportNode.type, "object")) { + const property = rightNode.property; + + if ( + (property.type === "Literal" && leftNode.name === property.value) || + (property.type === "Identifier" && leftNode.name === property.name && !rightNode.computed) + ) { + report(reportNode, "object", fix); + } + } + } + + /** + * Check if a given variable declarator is coming from an property access + * that should be using destructuring instead + * @param {ASTNode} node the variable declarator to check + * @returns {void} + */ + function checkVariableDeclarator(node) { + + // Skip if variable is declared without assignment + if (!node.init) { + return; + } + + // We only care about member expressions past this point + if (node.init.type !== "MemberExpression") { + return; + } + + performCheck(node.id, node.init, node); + } + + /** + * Run the `prefer-destructuring` check on an AssignmentExpression + * @param {ASTNode} node the AssignmentExpression node + * @returns {void} + */ + function checkAssigmentExpression(node) { + if (node.operator === "=") { + performCheck(node.left, node.right, node); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + VariableDeclarator: checkVariableDeclarator, + AssignmentExpression: checkAssigmentExpression + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js new file mode 100644 index 0000000..5e75ef4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js @@ -0,0 +1,189 @@ +/** + * @fileoverview Rule to disallow Math.pow in favor of the ** operator + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, ReferenceTracker } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({ type: "BinaryExpression", operator: "**" }); + +/** + * Determines whether the given node needs parens if used as the base in an exponentiation binary expression. + * @param {ASTNode} base The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesBaseNeedParens(base) { + return ( + + // '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c + astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR || + + // An unary operator cannot be used immediately before an exponentiation expression + base.type === "UnaryExpression" + ); +} + +/** + * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression. + * @param {ASTNode} exponent The node to check. + * @returns {boolean} `true` if the node needs to be parenthesised. + */ +function doesExponentNeedParens(exponent) { + + // '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c + return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR; +} + +/** + * Determines whether an exponentiation binary expression at the place of the given node would need parens. + * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression. + * @param {SourceCode} sourceCode A SourceCode object. + * @returns {boolean} `true` if the expression needs to be parenthesised. + */ +function doesExponentiationExpressionNeedParens(node, sourceCode) { + const parent = node.parent; + + const needsParens = ( + parent.type === "ClassDeclaration" || + ( + parent.type.endsWith("Expression") && + astUtils.getPrecedence(parent) >= PRECEDENCE_OF_EXPONENTIATION_EXPR && + !(parent.type === "BinaryExpression" && parent.operator === "**" && parent.right === node) && + !((parent.type === "CallExpression" || parent.type === "NewExpression") && parent.arguments.includes(node)) && + !(parent.type === "MemberExpression" && parent.computed && parent.property === node) && + !(parent.type === "ArrayExpression") + ) + ); + + return needsParens && !astUtils.isParenthesised(sourceCode, node); +} + +/** + * Optionally parenthesizes given text. + * @param {string} text The text to parenthesize. + * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised. + * @returns {string} parenthesised or unchanged text. + */ +function parenthesizeIfShould(text, shouldParenthesize) { + return shouldParenthesize ? `(${text})` : text; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow the use of `Math.pow` in favor of the `**` operator", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-exponentiation-operator" + }, + + schema: [], + fixable: "code", + + messages: { + useExponentiation: "Use the '**' operator instead of 'Math.pow'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + /** + * Reports the given node. + * @param {ASTNode} node 'Math.pow()' node to report. + * @returns {void} + */ + function report(node) { + context.report({ + node, + messageId: "useExponentiation", + fix(fixer) { + if ( + node.arguments.length !== 2 || + node.arguments.some(arg => arg.type === "SpreadElement") || + sourceCode.getCommentsInside(node).length > 0 + ) { + return null; + } + + const base = node.arguments[0], + exponent = node.arguments[1], + baseText = sourceCode.getText(base), + exponentText = sourceCode.getText(exponent), + shouldParenthesizeBase = doesBaseNeedParens(base), + shouldParenthesizeExponent = doesExponentNeedParens(exponent), + shouldParenthesizeAll = doesExponentiationExpressionNeedParens(node, sourceCode); + + let prefix = "", + suffix = ""; + + if (!shouldParenthesizeAll) { + if (!shouldParenthesizeBase) { + const firstReplacementToken = sourceCode.getFirstToken(base), + tokenBefore = sourceCode.getTokenBefore(node); + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstReplacementToken) + ) { + prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c + } + } + if (!shouldParenthesizeExponent) { + const lastReplacementToken = sourceCode.getLastToken(exponent), + tokenAfter = sourceCode.getTokenAfter(node); + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(lastReplacementToken, tokenAfter) + ) { + suffix = " "; // Math.pow(a, b)in c -> a**b in c + } + } + } + + const baseReplacement = parenthesizeIfShould(baseText, shouldParenthesizeBase), + exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), + replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Math: { + pow: { [CALL]: true } + } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + report(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-named-capture-group.js new file mode 100644 index 0000000..7d0aa3f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-named-capture-group.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule to enforce requiring named capture groups in regular expression. + * @author Pig Fang + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); +const regexpp = require("regexpp"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const parser = new regexpp.RegExpParser(); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce using named capture group in regular expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-named-capture-group" + }, + + schema: [], + + messages: { + required: "Capture group '{{group}}' should be converted to a named or non-capturing group." + } + }, + + create(context) { + + /** + * Function to check regular expression. + * @param {string} pattern The regular expression pattern to be check. + * @param {ASTNode} node AST node which contains regular expression. + * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. + * @returns {void} + */ + function checkRegex(pattern, node, uFlag) { + let ast; + + try { + ast = parser.parsePattern(pattern, 0, pattern.length, uFlag); + } catch { + + // ignore regex syntax errors + return; + } + + regexpp.visitRegExpAST(ast, { + onCapturingGroupEnter(group) { + if (!group.name) { + context.report({ + node, + messageId: "required", + data: { + group: group.raw + } + }); + } + } + }); + } + + return { + Literal(node) { + if (node.regex) { + checkRegex(node.regex.pattern, node, node.regex.flags.includes("u")); + } + }, + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const regex = getStringIfConstant(node.arguments[0]); + const flags = getStringIfConstant(node.arguments[1]); + + if (regex) { + checkRegex(regex, node, flags && flags.includes("u")); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-numeric-literals.js new file mode 100644 index 0000000..2a4fb5d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -0,0 +1,147 @@ +/** + * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals + * @author Annie Zhang, Henry Zhu + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const radixMap = new Map([ + [2, { system: "binary", literalPrefix: "0b" }], + [8, { system: "octal", literalPrefix: "0o" }], + [16, { system: "hexadecimal", literalPrefix: "0x" }] +]); + +/** + * Checks to see if a CallExpression's callee node is `parseInt` or + * `Number.parseInt`. + * @param {ASTNode} calleeNode The callee node to evaluate. + * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`, + * false otherwise. + */ +function isParseInt(calleeNode) { + switch (calleeNode.type) { + case "Identifier": + return calleeNode.name === "parseInt"; + case "MemberExpression": + return calleeNode.object.type === "Identifier" && + calleeNode.object.name === "Number" && + calleeNode.property.type === "Identifier" && + calleeNode.property.name === "parseInt"; + + // no default + } + + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-numeric-literals" + }, + + schema: [], + + messages: { + useLiteral: "Use {{system}} literals instead of {{functionName}}()." + }, + + fixable: "code" + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + "CallExpression[arguments.length=2]"(node) { + const [strNode, radixNode] = node.arguments, + str = astUtils.getStaticStringValue(strNode), + radix = radixNode.value; + + if ( + str !== null && + astUtils.isStringLiteral(strNode) && + radixNode.type === "Literal" && + typeof radix === "number" && + radixMap.has(radix) && + isParseInt(node.callee) + ) { + + const { system, literalPrefix } = radixMap.get(radix); + + context.report({ + node, + messageId: "useLiteral", + data: { + system, + functionName: sourceCode.getText(node.callee) + }, + fix(fixer) { + if (sourceCode.getCommentsInside(node).length) { + return null; + } + + const replacement = `${literalPrefix}${str}`; + + if (+replacement !== parseInt(str, radix)) { + + /* + * If the newly-produced literal would be invalid, (e.g. 0b1234), + * or it would yield an incorrect parseInt result for some other reason, don't make a fix. + */ + return null; + } + + const tokenBefore = sourceCode.getTokenBefore(node), + tokenAfter = sourceCode.getTokenAfter(node); + let prefix = "", + suffix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, replacement) + ) { + prefix = " "; + } + + if ( + tokenAfter && + node.range[1] === tokenAfter.range[0] && + !astUtils.canTokensBeAdjacent(replacement, tokenAfter) + ) { + suffix = " "; + } + + return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-object-spread.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-object-spread.js new file mode 100644 index 0000000..ab252c7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -0,0 +1,299 @@ +/** + * @fileoverview Prefers object spread property over Object.assign + * @author Sharmila Jesupaul + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +const { CALL, ReferenceTracker } = require("eslint-utils"); +const { + isCommaToken, + isOpeningParenToken, + isClosingParenToken, + isParenthesised +} = require("./utils/ast-utils"); + +const ANY_SPACE = /\s/u; + +/** + * Helper that checks if the Object.assign call has array spread + * @param {ASTNode} node The node that the rule warns on + * @returns {boolean} - Returns true if the Object.assign call has array spread + */ +function hasArraySpread(node) { + return node.arguments.some(arg => arg.type === "SpreadElement"); +} + +/** + * Determines whether the given node is an accessor property (getter/setter). + * @param {ASTNode} node Node to check. + * @returns {boolean} `true` if the node is a getter or a setter. + */ +function isAccessorProperty(node) { + return node.type === "Property" && + (node.kind === "get" || node.kind === "set"); +} + +/** + * Determines whether the given object expression node has accessor properties (getters/setters). + * @param {ASTNode} node `ObjectExpression` node to check. + * @returns {boolean} `true` if the node has at least one getter/setter. + */ +function hasAccessors(node) { + return node.properties.some(isAccessorProperty); +} + +/** + * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters). + * @param {ASTNode} node `CallExpression` node to check. + * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter. + */ +function hasArgumentsWithAccessors(node) { + return node.arguments + .filter(arg => arg.type === "ObjectExpression") + .some(hasAccessors); +} + +/** + * Helper that checks if the node needs parentheses to be valid JS. + * The default is to wrap the node in parentheses to avoid parsing errors. + * @param {ASTNode} node The node that the rule warns on + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} - Returns true if the node needs parentheses + */ +function needsParens(node, sourceCode) { + const parent = node.parent; + + switch (parent.type) { + case "VariableDeclarator": + case "ArrayExpression": + case "ReturnStatement": + case "CallExpression": + case "Property": + return false; + case "AssignmentExpression": + return parent.left === node && !isParenthesised(sourceCode, node); + default: + return !isParenthesised(sourceCode, node); + } +} + +/** + * Determines if an argument needs parentheses. The default is to not add parens. + * @param {ASTNode} node The node to be checked. + * @param {Object} sourceCode in context sourcecode object + * @returns {boolean} True if the node needs parentheses + */ +function argNeedsParens(node, sourceCode) { + switch (node.type) { + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "ConditionalExpression": + return !isParenthesised(sourceCode, node); + default: + return false; + } +} + +/** + * Get the parenthesis tokens of a given ObjectExpression node. + * This includes the braces of the object literal and enclosing parentheses. + * @param {ASTNode} node The node to get. + * @param {Token} leftArgumentListParen The opening paren token of the argument list. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location. + */ +function getParenTokens(node, leftArgumentListParen, sourceCode) { + const parens = [sourceCode.getFirstToken(node), sourceCode.getLastToken(node)]; + let leftNext = sourceCode.getTokenBefore(node); + let rightNext = sourceCode.getTokenAfter(node); + + // Note: don't include the parens of the argument list. + while ( + leftNext && + rightNext && + leftNext.range[0] > leftArgumentListParen.range[0] && + isOpeningParenToken(leftNext) && + isClosingParenToken(rightNext) + ) { + parens.push(leftNext, rightNext); + leftNext = sourceCode.getTokenBefore(leftNext); + rightNext = sourceCode.getTokenAfter(rightNext); + } + + return parens.sort((a, b) => a.range[0] - b.range[0]); +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The end of the range of the token and around whitespaces. + */ +function getStartWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let start = token.range[0]; + + // If the previous token is a line comment then skip this step to avoid commenting this token out. + { + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }); + + if (prevToken && prevToken.type === "Line") { + return start; + } + } + + // Detect spaces before the token. + while (ANY_SPACE.test(text[start - 1] || "")) { + start -= 1; + } + + return start; +} + +/** + * Get the range of a given token and around whitespaces. + * @param {Token} token The token to get range. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {number} The start of the range of the token and around whitespaces. + */ +function getEndWithSpaces(token, sourceCode) { + const text = sourceCode.text; + let end = token.range[1]; + + // Detect spaces after the token. + while (ANY_SPACE.test(text[end] || "")) { + end += 1; + } + + return end; +} + +/** + * Autofixes the Object.assign call to use an object spread instead. + * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call + * @param {string} sourceCode sourceCode of the Object.assign call + * @returns {Function} autofixer - replaces the Object.assign with a spread object. + */ +function defineFixer(node, sourceCode) { + return function *(fixer) { + const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken); + const rightParen = sourceCode.getLastToken(node); + + // Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren. + yield fixer.removeRange([node.range[0], leftParen.range[0]]); + + // Replace the parens of argument list to braces. + if (needsParens(node, sourceCode)) { + yield fixer.replaceText(leftParen, "({"); + yield fixer.replaceText(rightParen, "})"); + } else { + yield fixer.replaceText(leftParen, "{"); + yield fixer.replaceText(rightParen, "}"); + } + + // Process arguments. + for (const argNode of node.arguments) { + const innerParens = getParenTokens(argNode, leftParen, sourceCode); + const left = innerParens.shift(); + const right = innerParens.pop(); + + if (argNode.type === "ObjectExpression") { + const maybeTrailingComma = sourceCode.getLastToken(argNode, 1); + const maybeArgumentComma = sourceCode.getTokenAfter(right); + + /* + * Make bare this object literal. + * And remove spaces inside of the braces for better formatting. + */ + for (const innerParen of innerParens) { + yield fixer.remove(innerParen); + } + const leftRange = [left.range[0], getEndWithSpaces(left, sourceCode)]; + const rightRange = [ + Math.max(getStartWithSpaces(right, sourceCode), leftRange[1]), // Ensure ranges don't overlap + right.range[1] + ]; + + yield fixer.removeRange(leftRange); + yield fixer.removeRange(rightRange); + + // Remove the comma of this argument if it's duplication. + if ( + (argNode.properties.length === 0 || isCommaToken(maybeTrailingComma)) && + isCommaToken(maybeArgumentComma) + ) { + yield fixer.remove(maybeArgumentComma); + } + } else { + + // Make spread. + if (argNeedsParens(argNode, sourceCode)) { + yield fixer.insertTextBefore(left, "...("); + yield fixer.insertTextAfter(right, ")"); + } else { + yield fixer.insertTextBefore(left, "..."); + } + } + } + }; +} + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: + "disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-object-spread" + }, + + schema: [], + fixable: "code", + + messages: { + useSpreadMessage: "Use an object spread instead of `Object.assign` eg: `{ ...foo }`.", + useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + Object: { + assign: { [CALL]: true } + } + }; + + // Iterate all calls of `Object.assign` (only of the global variable `Object`). + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + if ( + node.arguments.length >= 1 && + node.arguments[0].type === "ObjectExpression" && + !hasArraySpread(node) && + !( + node.arguments.length > 1 && + hasArgumentsWithAccessors(node) + ) + ) { + const messageId = node.arguments.length === 1 + ? "useLiteralMessage" + : "useSpreadMessage"; + const fix = defineFixer(node, sourceCode); + + context.report({ node, messageId, fix }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js new file mode 100644 index 0000000..56911b6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -0,0 +1,133 @@ +/** + * @fileoverview restrict values that can be used as Promise rejection reasons + * @author Teddy Katz + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require using Error objects as Promise rejection reasons", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-promise-reject-errors" + }, + + fixable: null, + + schema: [ + { + type: "object", + properties: { + allowEmptyReject: { type: "boolean", default: false } + }, + additionalProperties: false + } + ], + + messages: { + rejectAnError: "Expected the Promise rejection reason to be an Error." + } + }, + + create(context) { + + const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; + + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + + /** + * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error + * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise + * @returns {void} + */ + function checkRejectCall(callExpression) { + if (!callExpression.arguments.length && ALLOW_EMPTY_REJECT) { + return; + } + if ( + !callExpression.arguments.length || + !astUtils.couldBeError(callExpression.arguments[0]) || + callExpression.arguments[0].type === "Identifier" && callExpression.arguments[0].name === "undefined" + ) { + context.report({ + node: callExpression, + messageId: "rejectAnError" + }); + } + } + + /** + * Determines whether a function call is a Promise.reject() call + * @param {ASTNode} node A CallExpression node + * @returns {boolean} `true` if the call is a Promise.reject() call + */ + function isPromiseRejectCall(node) { + return node.callee.type === "MemberExpression" && + node.callee.object.type === "Identifier" && node.callee.object.name === "Promise" && + node.callee.property.type === "Identifier" && node.callee.property.name === "reject"; + } + + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + + return { + + // Check `Promise.reject(value)` calls. + CallExpression(node) { + if (isPromiseRejectCall(node)) { + checkRejectCall(node); + } + }, + + /* + * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls. + * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that + * the nodes in the expression already have the `parent` property. + */ + "NewExpression:exit"(node) { + if ( + node.callee.type === "Identifier" && node.callee.name === "Promise" && + node.arguments.length && astUtils.isFunction(node.arguments[0]) && + node.arguments[0].params.length > 1 && node.arguments[0].params[1].type === "Identifier" + ) { + context.getDeclaredVariables(node.arguments[0]) + + /* + * Find the first variable that matches the second parameter's name. + * If the first parameter has the same name as the second parameter, then the variable will actually + * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten + * by the second parameter. It's not possible for an expression with the variable to be evaluated before + * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or + * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for + * this case. + */ + .find(variable => variable.name === node.arguments[0].params[1].name) + + // Get the references to that variable. + .references + + // Only check the references that read the parameter's value. + .filter(ref => ref.isRead()) + + // Only check the references that are used as the callee in a function call, e.g. `reject(foo)`. + .filter(ref => ref.identifier.parent.type === "CallExpression" && ref.identifier === ref.identifier.parent.callee) + + // Check the argument of the function call to determine whether it's an Error. + .forEach(ref => checkRejectCall(ref.identifier.parent)); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-reflect.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 0000000..fb2de92 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods + * @author Keith Cirkel + * @deprecated in ESLint v3.9.0 + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `Reflect` methods where applicable", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-reflect" + }, + + deprecated: true, + + replacedBy: [], + + schema: [ + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: [ + "apply", + "call", + "delete", + "defineProperty", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "setPrototypeOf", + "isExtensible", + "getOwnPropertyNames", + "preventExtensions" + ] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + preferReflect: "Avoid using {{existing}}, instead use {{substitute}}." + } + }, + + create(context) { + const existingNames = { + apply: "Function.prototype.apply", + call: "Function.prototype.call", + defineProperty: "Object.defineProperty", + getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor", + getPrototypeOf: "Object.getPrototypeOf", + setPrototypeOf: "Object.setPrototypeOf", + isExtensible: "Object.isExtensible", + getOwnPropertyNames: "Object.getOwnPropertyNames", + preventExtensions: "Object.preventExtensions" + }; + + const reflectSubstitutes = { + apply: "Reflect.apply", + call: "Reflect.apply", + defineProperty: "Reflect.defineProperty", + getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor", + getPrototypeOf: "Reflect.getPrototypeOf", + setPrototypeOf: "Reflect.setPrototypeOf", + isExtensible: "Reflect.isExtensible", + getOwnPropertyNames: "Reflect.getOwnPropertyNames", + preventExtensions: "Reflect.preventExtensions" + }; + + const exceptions = (context.options[0] || {}).exceptions || []; + + /** + * Reports the Reflect violation based on the `existing` and `substitute` + * @param {Object} node The node that violates the rule. + * @param {string} existing The existing method name that has been used. + * @param {string} substitute The Reflect substitute that should be used. + * @returns {void} + */ + function report(node, existing, substitute) { + context.report({ + node, + messageId: "preferReflect", + data: { + existing, + substitute + } + }); + } + + return { + CallExpression(node) { + const methodName = (node.callee.property || {}).name; + const isReflectCall = (node.callee.object || {}).name === "Reflect"; + const hasReflectSubsitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); + const userConfiguredException = exceptions.indexOf(methodName) !== -1; + + if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + report(node, existingNames[methodName], reflectSubstitutes[methodName]); + } + }, + UnaryExpression(node) { + const isDeleteOperator = node.operator === "delete"; + const targetsIdentifier = node.argument.type === "Identifier"; + const userConfiguredException = exceptions.indexOf("delete") !== -1; + + if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { + report(node, "the delete keyword", "Reflect.deleteProperty"); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-regex-literals.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-regex-literals.js new file mode 100644 index 0000000..47b2b09 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals + * @author Milos Djermanovic + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const { CALL, CONSTRUCT, ReferenceTracker, findVariable } = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines whether the given node is a string literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a string literal. + */ +function isStringLiteral(node) { + return node.type === "Literal" && typeof node.value === "string"; +} + +/** + * Determines whether the given node is a template literal without expressions. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a template literal without expressions. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow use of the `RegExp` constructor in favor of regular expression literals", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-regex-literals" + }, + + schema: [], + + messages: { + unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor." + } + }, + + create(context) { + + /** + * Determines whether the given identifier node is a reference to a global variable. + * @param {ASTNode} node `Identifier` node to check. + * @returns {boolean} True if the identifier is a reference to a global variable. + */ + function isGlobalReference(node) { + const scope = context.getScope(); + const variable = findVariable(scope, node); + + return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; + } + + /** + * Determines whether the given node is a String.raw`` tagged template expression + * with a static template literal. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is String.raw`` with a static template. + */ + function isStringRawTaggedStaticTemplateLiteral(node) { + return node.type === "TaggedTemplateExpression" && + node.tag.type === "MemberExpression" && + node.tag.object.type === "Identifier" && + node.tag.object.name === "String" && + isGlobalReference(node.tag.object) && + astUtils.getStaticPropertyName(node.tag) === "raw" && + isStaticTemplateLiteral(node.quasi); + } + + /** + * Determines whether the given node is considered to be a static string by the logic of this rule. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a static string. + */ + function isStaticString(node) { + return isStringLiteral(node) || + isStaticTemplateLiteral(node) || + isStringRawTaggedStaticTemplateLiteral(node); + } + + return { + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; + + for (const { node } of tracker.iterateGlobalReferences(traceMap)) { + const args = node.arguments; + + if ( + (args.length === 1 || args.length === 2) && + args.every(isStaticString) + ) { + context.report({ node, messageId: "unexpectedRegExp" }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-rest-params.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-rest-params.js new file mode 100644 index 0000000..3ecea73 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-rest-params.js @@ -0,0 +1,115 @@ +/** + * @fileoverview Rule to + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {eslint-scope.Scope} scope A scope to get. + * @returns {eslint-scope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + const variables = scope.variables; + + for (let i = 0; i < variables.length; ++i) { + const variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +/** + * Checks if the given reference is not normal member access. + * + * - arguments .... true // not member access + * - arguments[i] .... true // computed member access + * - arguments[0] .... true // computed member access + * - arguments.length .... false // normal member access + * @param {eslint-scope.Reference} reference The reference to check. + * @returns {boolean} `true` if the reference is not normal member access. + */ +function isNotNormalMemberAccess(reference) { + const id = reference.identifier; + const parent = id.parent; + + return !( + parent.type === "MemberExpression" && + parent.object === id && + !parent.computed + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require rest parameters instead of `arguments`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-rest-params" + }, + + schema: [], + + messages: { + preferRestParams: "Use the rest parameters instead of 'arguments'." + } + }, + + create(context) { + + /** + * Reports a given reference. + * @param {eslint-scope.Reference} reference A reference to report. + * @returns {void} + */ + function report(reference) { + context.report({ + node: reference.identifier, + loc: reference.identifier.loc, + messageId: "preferRestParams" + }); + } + + /** + * Reports references of the implicit `arguments` variable if exist. + * @returns {void} + */ + function checkForArguments() { + const argumentsVar = getVariableOfArguments(context.getScope()); + + if (argumentsVar) { + argumentsVar + .references + .filter(isNotNormalMemberAccess) + .forEach(report); + } + } + + return { + "FunctionDeclaration:exit": checkForArguments, + "FunctionExpression:exit": checkForArguments + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-spread.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-spread.js new file mode 100644 index 0000000..bcb0dc0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-spread.js @@ -0,0 +1,91 @@ +/** + * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`. + * @author Toru Nagashima + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.apply()` for variadic. + * @param {ASTNode} node A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.apply()` for variadic. + */ +function isVariadicApplyCalling(node) { + return ( + node.callee.type === "MemberExpression" && + node.callee.property.type === "Identifier" && + node.callee.property.name === "apply" && + node.callee.computed === false && + node.arguments.length === 2 && + node.arguments[1].type !== "ArrayExpression" && + node.arguments[1].type !== "SpreadElement" + ); +} + + +/** + * Checks whether or not `thisArg` is not changed by `.apply()`. + * @param {ASTNode|null} expectedThis The node that is the owner of the applied function. + * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`. + * @param {RuleContext} context The ESLint rule context object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, context) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return astUtils.equalTokens(expectedThis, thisArg, context); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require spread operators instead of `.apply()`", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-spread" + }, + + schema: [], + fixable: null, + + messages: { + preferSpread: "Use the spread operator instead of '.apply()'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + CallExpression(node) { + if (!isVariadicApplyCalling(node)) { + return; + } + + const applied = node.callee.object; + const expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + const thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, sourceCode)) { + context.report({ + node, + messageId: "preferSpread" + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/prefer-template.js b/day1/cli-study/node_modules/eslint/lib/rules/prefer-template.js new file mode 100644 index 0000000..e8f980e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/prefer-template.js @@ -0,0 +1,283 @@ +/** + * @fileoverview A rule to suggest using template literals instead of string concatenation. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Gets the top binary expression node for concatenation in parents of a given node. + * @param {ASTNode} node A node to get. + * @returns {ASTNode} the top binary expression node in parents of a given node. + */ +function getTopConcatBinaryExpression(node) { + let currentNode = node; + + while (isConcatenation(currentNode.parent)) { + currentNode = currentNode.parent; + } + return currentNode; +} + +/** + * Determines whether a given node is a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node is an octal escape sequence + */ +function isOctalEscapeSequence(node) { + + // No need to check TemplateLiterals – would throw error with octal escape + const isStringLiteral = node.type === "Literal" && typeof node.value === "string"; + + if (!isStringLiteral) { + return false; + } + + return astUtils.hasOctalEscapeSequence(node.raw); +} + +/** + * Checks whether or not a node contains a octal escape sequence + * @param {ASTNode} node A node to check + * @returns {boolean} `true` if the node contains an octal escape sequence + */ +function hasOctalEscapeSequence(node) { + if (isConcatenation(node)) { + return hasOctalEscapeSequence(node.left) || hasOctalEscapeSequence(node.right); + } + + return isOctalEscapeSequence(node); +} + +/** + * Checks whether or not a given binary expression has string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has string literals. + */ +function hasStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasStringLiteral(node.right) || hasStringLiteral(node.left); + } + return astUtils.isStringLiteral(node); +} + +/** + * Checks whether or not a given binary expression has non string literals. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node has non string literals. + */ +function hasNonStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left); + } + return !astUtils.isStringLiteral(node); +} + +/** + * Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will start with a template curly. + */ +function startsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.left); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[0].range[0] === node.quasis[0].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +/** + * Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal. + * @param {ASTNode} node The node that will be fixed to a template literal + * @returns {boolean} `true` if the node will end with a template curly. + */ +function endsWithTemplateCurly(node) { + if (node.type === "BinaryExpression") { + return startsWithTemplateCurly(node.right); + } + if (node.type === "TemplateLiteral") { + return node.expressions.length && node.quasis.length && node.quasis[node.quasis.length - 1].range[0] === node.quasis[node.quasis.length - 1].range[1]; + } + return node.type !== "Literal" || typeof node.value !== "string"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require template literals instead of string concatenation", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/prefer-template" + }, + + schema: [], + fixable: "code", + + messages: { + unexpectedStringConcatenation: "Unexpected string concatenation." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let done = Object.create(null); + + /** + * Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens. + * @param {ASTNode} node1 The first node + * @param {ASTNode} node2 The second node + * @returns {string} The text between the nodes, excluding other tokens + */ + function getTextBetween(node1, node2) { + const allTokens = [node1].concat(sourceCode.getTokensBetween(node1, node2)).concat(node2); + const sourceText = sourceCode.getText(); + + return allTokens.slice(0, -1).reduce((accumulator, token, index) => accumulator + sourceText.slice(token.range[1], allTokens[index + 1].range[0]), ""); + } + + /** + * Returns a template literal form of the given node. + * @param {ASTNode} currentNode A node that should be converted to a template literal + * @param {string} textBeforeNode Text that should appear before the node + * @param {string} textAfterNode Text that should appear after the node + * @returns {string} A string form of this node, represented as a template literal + */ + function getTemplateLiteral(currentNode, textBeforeNode, textAfterNode) { + if (currentNode.type === "Literal" && typeof currentNode.value === "string") { + + /* + * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted + * as a template placeholder. However, if the code already contains a backslash before the ${ or ` + * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause + * an actual backslash character to appear before the dollar sign). + */ + return `\`${currentNode.raw.slice(1, -1).replace(/\\*(\$\{|`)/gu, matched => { + if (matched.lastIndexOf("\\") % 2) { + return `\\${matched}`; + } + return matched; + + // Unescape any quotes that appear in the original Literal that no longer need to be escaped. + }).replace(new RegExp(`\\\\${currentNode.raw[0]}`, "gu"), currentNode.raw[0])}\``; + } + + if (currentNode.type === "TemplateLiteral") { + return sourceCode.getText(currentNode); + } + + if (isConcatenation(currentNode) && hasStringLiteral(currentNode) && hasNonStringLiteral(currentNode)) { + const plusSign = sourceCode.getFirstTokenBetween(currentNode.left, currentNode.right, token => token.value === "+"); + const textBeforePlus = getTextBetween(currentNode.left, plusSign); + const textAfterPlus = getTextBetween(plusSign, currentNode.right); + const leftEndsWithCurly = endsWithTemplateCurly(currentNode.left); + const rightStartsWithCurly = startsWithTemplateCurly(currentNode.right); + + if (leftEndsWithCurly) { + + // If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket. + // `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */ }${baz}` + return getTemplateLiteral(currentNode.left, textBeforeNode, textBeforePlus + textAfterPlus).slice(0, -1) + + getTemplateLiteral(currentNode.right, null, textAfterNode).slice(1); + } + if (rightStartsWithCurly) { + + // Otherwise, if the right side of the expression starts with a template curly, add the text there. + // 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */ bar}baz` + return getTemplateLiteral(currentNode.left, textBeforeNode, null).slice(0, -1) + + getTemplateLiteral(currentNode.right, textBeforePlus + textAfterPlus, textAfterNode).slice(1); + } + + /* + * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put + * the text between them. + */ + return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`; + } + + return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``; + } + + /** + * Returns a fixer object that converts a non-string binary expression to a template literal + * @param {SourceCodeFixer} fixer The fixer object + * @param {ASTNode} node A node that should be converted to a template literal + * @returns {Object} A fix for this binary expression + */ + function fixNonStringBinaryExpression(fixer, node) { + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + if (hasOctalEscapeSequence(topBinaryExpr)) { + return null; + } + + return fixer.replaceText(topBinaryExpr, getTemplateLiteral(topBinaryExpr, null, null)); + } + + /** + * Reports if a given node is string concatenation with non string literals. + * @param {ASTNode} node A node to check. + * @returns {void} + */ + function checkForStringConcat(node) { + if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { + return; + } + + const topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + // Checks whether or not this node had been checked already. + if (done[topBinaryExpr.range[0]]) { + return; + } + done[topBinaryExpr.range[0]] = true; + + if (hasNonStringLiteral(topBinaryExpr)) { + context.report({ + node: topBinaryExpr, + messageId: "unexpectedStringConcatenation", + fix: fixer => fixNonStringBinaryExpression(fixer, node) + }); + } + } + + return { + Program() { + done = Object.create(null); + }, + + Literal: checkForStringConcat, + TemplateLiteral: checkForStringConcat + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/quote-props.js b/day1/cli-study/node_modules/eslint/lib/rules/quote-props.js new file mode 100644 index 0000000..fab7bdc --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/quote-props.js @@ -0,0 +1,307 @@ +/** + * @fileoverview Rule to flag non-quoted property names in object literals. + * @author Mathias Bynens + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const espree = require("espree"); +const astUtils = require("./utils/ast-utils"); +const keywords = require("./utils/keywords"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require quotes around object literal property names", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quote-props" + }, + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always", "as-needed", "consistent", "consistent-as-needed"] + }, + { + type: "object", + properties: { + keywords: { + type: "boolean" + }, + unnecessary: { + type: "boolean" + }, + numbers: { + type: "boolean" + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + fixable: "code", + messages: { + requireQuotesDueToReservedWord: "Properties should be quoted as '{{property}}' is a reserved word.", + inconsistentlyQuotedProperty: "Inconsistently quoted property '{{key}}' found.", + unnecessarilyQuotedProperty: "Unnecessarily quoted property '{{property}}' found.", + unquotedReservedProperty: "Unquoted reserved word '{{property}}' used as key.", + unquotedNumericProperty: "Unquoted number literal '{{property}}' used as key.", + unquotedPropertyFound: "Unquoted property '{{property}}' found.", + redundantQuoting: "Properties shouldn't be quoted as all quotes are redundant." + } + }, + + create(context) { + + const MODE = context.options[0], + KEYWORDS = context.options[1] && context.options[1].keywords, + CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, + NUMBERS = context.options[1] && context.options[1].numbers, + + sourceCode = context.getSourceCode(); + + + /** + * Checks whether a certain string constitutes an ES3 token + * @param {string} tokenStr The string to be checked. + * @returns {boolean} `true` if it is an ES3 token. + */ + function isKeyword(tokenStr) { + return keywords.indexOf(tokenStr) >= 0; + } + + /** + * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @returns {boolean} Whether or not a key has redundant quotes. + * @private + */ + function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { + return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && + (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || + (tokens[0].type === "Numeric" && !skipNumberLiterals && String(+tokens[0].value) === tokens[0].value)); + } + + /** + * Returns a string representation of a property node with quotes removed + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getUnquotedKey(key) { + return key.type === "Identifier" ? key.name : key.value; + } + + /** + * Returns a string representation of a property node with quotes added + * @param {ASTNode} key Key AST Node, which may or may not be quoted + * @returns {string} A replacement string for this property + */ + function getQuotedKey(key) { + if (key.type === "Literal" && typeof key.value === "string") { + + // If the key is already a string literal, don't replace the quotes with double quotes. + return sourceCode.getText(key); + } + + // Otherwise, the key is either an identifier or a number literal. + return `"${key.type === "Identifier" ? key.name : key.value}"`; + } + + /** + * Ensures that a property's key is quoted only when necessary + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkUnnecessaryQuotes(node) { + const key = node.key; + + if (node.method || node.computed || node.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + return; + } + + if (tokens.length !== 1) { + return; + } + + const isKeywordToken = isKeyword(tokens[0].value); + + if (isKeywordToken && KEYWORDS) { + return; + } + + if (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) { + context.report({ + node, + messageId: "unnecessarilyQuotedProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getUnquotedKey(key)) + }); + } + } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { + context.report({ + node, + messageId: "unquotedReservedProperty", + data: { property: key.name }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } else if (NUMBERS && key.type === "Literal" && astUtils.isNumericLiteral(key)) { + context.report({ + node, + messageId: "unquotedNumericProperty", + data: { property: key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that a property's key is quoted + * @param {ASTNode} node Property AST node + * @returns {void} + */ + function checkOmittedQuotes(node) { + const key = node.key; + + if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { + context.report({ + node, + messageId: "unquotedPropertyFound", + data: { property: key.name || key.value }, + fix: fixer => fixer.replaceText(key, getQuotedKey(key)) + }); + } + } + + /** + * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @returns {void} + */ + function checkConsistency(node, checkQuotesRedundancy) { + const quotedProps = [], + unquotedProps = []; + let keywordKeyName = null, + necessaryQuotes = false; + + node.properties.forEach(property => { + const key = property.key; + + if (!key || property.method || property.computed || property.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + + quotedProps.push(property); + + if (checkQuotesRedundancy) { + let tokens; + + try { + tokens = espree.tokenize(key.value); + } catch { + necessaryQuotes = true; + return; + } + + necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value); + } + } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { + unquotedProps.push(property); + necessaryQuotes = true; + keywordKeyName = key.name; + } else { + unquotedProps.push(property); + } + }); + + if (checkQuotesRedundancy && quotedProps.length && !necessaryQuotes) { + quotedProps.forEach(property => { + context.report({ + node: property, + messageId: "redundantQuoting", + fix: fixer => fixer.replaceText(property.key, getUnquotedKey(property.key)) + }); + }); + } else if (unquotedProps.length && keywordKeyName) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "requireQuotesDueToReservedWord", + data: { property: keywordKeyName }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } else if (quotedProps.length && unquotedProps.length) { + unquotedProps.forEach(property => { + context.report({ + node: property, + messageId: "inconsistentlyQuotedProperty", + data: { key: property.key.name || property.key.value }, + fix: fixer => fixer.replaceText(property.key, getQuotedKey(property.key)) + }); + }); + } + } + + return { + Property(node) { + if (MODE === "always" || !MODE) { + checkOmittedQuotes(node); + } + if (MODE === "as-needed") { + checkUnnecessaryQuotes(node); + } + }, + ObjectExpression(node) { + if (MODE === "consistent") { + checkConsistency(node, false); + } + if (MODE === "consistent-as-needed") { + checkConsistency(node, true); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/quotes.js b/day1/cli-study/node_modules/eslint/lib/rules/quotes.js new file mode 100644 index 0000000..d1f4443 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/quotes.js @@ -0,0 +1,332 @@ +/** + * @fileoverview A rule to choose between single and double quote marks + * @author Matt DuVall , Brandon Payton + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +const QUOTE_SETTINGS = { + double: { + quote: "\"", + alternateQuote: "'", + description: "doublequote" + }, + single: { + quote: "'", + alternateQuote: "\"", + description: "singlequote" + }, + backtick: { + quote: "`", + alternateQuote: "\"", + description: "backtick" + } +}; + +// An unescaped newline is a newline preceded by an even number of backslashes. +const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`, "u"); + +/** + * Switches quoting of javascript string between ' " and ` + * escaping and unescaping as necessary. + * Only escaping of the minimal set of characters is changed. + * Note: escaping of newlines when switching from backtick to other quotes is not handled. + * @param {string} str A string to convert. + * @returns {string} The string with changed quotes. + * @private + */ +QUOTE_SETTINGS.double.convert = +QUOTE_SETTINGS.single.convert = +QUOTE_SETTINGS.backtick.convert = function(str) { + const newQuote = this.quote; + const oldQuote = str[0]; + + if (newQuote === oldQuote) { + return str; + } + return newQuote + str.slice(1, -1).replace(/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu, (match, escaped, newline) => { + if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { + return escaped; // unescape + } + if (match === newQuote || newQuote === "`" && match === "${") { + return `\\${match}`; // escape + } + if (newline && oldQuote === "`") { + return "\\n"; // escape newlines + } + return match; + }) + newQuote; +}; + +const AVOID_ESCAPE = "avoid-escape"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce the consistent use of either backticks, double, or single quotes", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/quotes" + }, + + fixable: "code", + + schema: [ + { + enum: ["single", "double", "backtick"] + }, + { + anyOf: [ + { + enum: ["avoid-escape"] + }, + { + type: "object", + properties: { + avoidEscape: { + type: "boolean" + }, + allowTemplateLiterals: { + type: "boolean" + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + wrongQuotes: "Strings must use {{description}}." + } + }, + + create(context) { + + const quoteOption = context.options[0], + settings = QUOTE_SETTINGS[quoteOption || "double"], + options = context.options[1], + allowTemplateLiterals = options && options.allowTemplateLiterals === true, + sourceCode = context.getSourceCode(); + let avoidEscape = options && options.avoidEscape === true; + + // deprecated + if (options === AVOID_ESCAPE) { + avoidEscape = true; + } + + /** + * Determines if a given node is part of JSX syntax. + * + * This function returns `true` in the following cases: + * + * - `
` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`. + * - `
foo
` ... If the literal is a text content, the parent of the literal is `JSXElement`. + * - `<>foo` ... If the literal is a text content, the parent of the literal is `JSXFragment`. + * + * In particular, this function returns `false` in the following cases: + * + * - `
` + * - `
{"foo"}
` + * + * In both cases, inside of the braces is handled as normal JavaScript. + * The braces are `JSXExpressionContainer` nodes. + * @param {ASTNode} node The Literal node to check. + * @returns {boolean} True if the node is a part of JSX, false if not. + * @private + */ + function isJSXLiteral(node) { + return node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment"; + } + + /** + * Checks whether or not a given node is a directive. + * The directive is a `ExpressionStatement` which has only a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a directive. + * @private + */ + function isDirective(node) { + return ( + node.type === "ExpressionStatement" && + node.expression.type === "Literal" && + typeof node.expression.value === "string" + ); + } + + /** + * Checks whether or not a given node is a part of directive prologues. + * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a part of directive prologues. + * @private + */ + function isPartOfDirectivePrologue(node) { + const block = node.parent.parent; + + if (block.type !== "Program" && (block.type !== "BlockStatement" || !astUtils.isFunction(block.parent))) { + return false; + } + + // Check the node is at a prologue. + for (let i = 0; i < block.body.length; ++i) { + const statement = block.body[i]; + + if (statement === node.parent) { + return true; + } + if (!isDirective(statement)) { + break; + } + } + + return false; + } + + /** + * Checks whether or not a given node is allowed as non backtick. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is allowed as non backtick. + * @private + */ + function isAllowedAsNonBacktick(node) { + const parent = node.parent; + + switch (parent.type) { + + // Directive Prologues. + case "ExpressionStatement": + return isPartOfDirectivePrologue(node); + + // LiteralPropertyName. + case "Property": + case "MethodDefinition": + return parent.key === node && !parent.computed; + + // ModuleSpecifier. + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportAllDeclaration": + return parent.source === node; + + // Others don't allow. + default: + return false; + } + } + + /** + * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. + * @param {ASTNode} node A TemplateLiteral node to check. + * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. + * @private + */ + function isUsingFeatureOfTemplateLiteral(node) { + const hasTag = node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi; + + if (hasTag) { + return true; + } + + const hasStringInterpolation = node.expressions.length > 0; + + if (hasStringInterpolation) { + return true; + } + + const isMultilineString = node.quasis.length >= 1 && UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); + + if (isMultilineString) { + return true; + } + + return false; + } + + return { + + Literal(node) { + const val = node.value, + rawVal = node.raw; + + if (settings && typeof val === "string") { + let isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || + isJSXLiteral(node) || + astUtils.isSurroundedBy(rawVal, settings.quote); + + if (!isValid && avoidEscape) { + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; + } + + if (!isValid) { + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (quoteOption === "backtick" && astUtils.hasOctalEscapeSequence(rawVal)) { + + // An octal escape sequence in a template literal would produce syntax error, even in non-strict mode. + return null; + } + + return fixer.replaceText(node, settings.convert(node.raw)); + } + }); + } + } + }, + + TemplateLiteral(node) { + + // Don't throw an error if backticks are expected or a template literal feature is in use. + if ( + allowTemplateLiterals || + quoteOption === "backtick" || + isUsingFeatureOfTemplateLiteral(node) + ) { + return; + } + + context.report({ + node, + messageId: "wrongQuotes", + data: { + description: settings.description + }, + fix(fixer) { + if (isPartOfDirectivePrologue(node)) { + + /* + * TemplateLiterals in a directive prologue aren't actually directives, but if they're + * in the directive prologue, then fixing them might turn them into directives and change + * the behavior of the code. + */ + return null; + } + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/radix.js b/day1/cli-study/node_modules/eslint/lib/rules/radix.js new file mode 100644 index 0000000..3903cb2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/radix.js @@ -0,0 +1,178 @@ +/** + * @fileoverview Rule to flag use of parseInt without a radix argument + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + +const validRadixValues = new Set(Array.from({ length: 37 - 2 }, (_, index) => index + 2)); + +/** + * Checks whether a given variable is shadowed or not. + * @param {eslint-scope.Variable} variable A variable to check. + * @returns {boolean} `true` if the variable is shadowed. + */ +function isShadowed(variable) { + return variable.defs.length >= 1; +} + +/** + * Checks whether a given node is a MemberExpression of `parseInt` method or not. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` + * method. + */ +function isParseIntMethod(node) { + return ( + node.type === "MemberExpression" && + !node.computed && + node.property.type === "Identifier" && + node.property.name === "parseInt" + ); +} + +/** + * Checks whether a given node is a valid value of radix or not. + * + * The following values are invalid. + * + * - A literal except integers between 2 and 36. + * - undefined. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is valid. + */ +function isValidRadix(radix) { + return !( + (radix.type === "Literal" && !validRadixValues.has(radix.value)) || + (radix.type === "Identifier" && radix.name === "undefined") + ); +} + +/** + * Checks whether a given node is a default value of radix or not. + * @param {ASTNode} radix A node of radix to check. + * @returns {boolean} `true` if the node is the literal node of `10`. + */ +function isDefaultRadix(radix) { + return radix.type === "Literal" && radix.value === 10; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the consistent use of the radix argument when using `parseInt()`", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/radix" + }, + + schema: [ + { + enum: ["always", "as-needed"] + } + ], + + messages: { + missingParameters: "Missing parameters.", + redundantRadix: "Redundant radix parameter.", + missingRadix: "Missing radix parameter.", + invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36." + } + }, + + create(context) { + const mode = context.options[0] || MODE_ALWAYS; + + /** + * Checks the arguments of a given CallExpression node and reports it if it + * offends this rule. + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArguments(node) { + const args = node.arguments; + + switch (args.length) { + case 0: + context.report({ + node, + messageId: "missingParameters" + }); + break; + + case 1: + if (mode === MODE_ALWAYS) { + context.report({ + node, + messageId: "missingRadix" + }); + } + break; + + default: + if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { + context.report({ + node, + messageId: "redundantRadix" + }); + } else if (!isValidRadix(args[1])) { + context.report({ + node, + messageId: "invalidRadix" + }); + } + break; + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + let variable; + + // Check `parseInt()` + variable = astUtils.getVariableByName(scope, "parseInt"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArguments(node.parent); + } + }); + } + + // Check `Number.parseInt()` + variable = astUtils.getVariableByName(scope, "Number"); + if (variable && !isShadowed(variable)) { + variable.references.forEach(reference => { + const node = reference.identifier.parent; + + if (isParseIntMethod(node) && astUtils.isCallee(node)) { + checkArguments(node.parent); + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/require-atomic-updates.js b/day1/cli-study/node_modules/eslint/lib/rules/require-atomic-updates.js new file mode 100644 index 0000000..4f6acce --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -0,0 +1,283 @@ +/** + * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield` + * @author Teddy Katz + * @author Toru Nagashima + */ +"use strict"; + +/** + * Make the map from identifiers to each reference. + * @param {escope.Scope} scope The scope to get references. + * @param {Map} [outReferenceMap] The map from identifier nodes to each reference object. + * @returns {Map} `referenceMap`. + */ +function createReferenceMap(scope, outReferenceMap = new Map()) { + for (const reference of scope.references) { + outReferenceMap.set(reference.identifier, reference); + } + for (const childScope of scope.childScopes) { + if (childScope.type !== "function") { + createReferenceMap(childScope, outReferenceMap); + } + } + + return outReferenceMap; +} + +/** + * Get `reference.writeExpr` of a given reference. + * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a` + * @param {escope.Reference} reference The reference to get. + * @returns {Expression|null} The `reference.writeExpr`. + */ +function getWriteExpr(reference) { + if (reference.writeExpr) { + return reference.writeExpr; + } + let node = reference.identifier; + + while (node) { + const t = node.parent.type; + + if (t === "AssignmentExpression" && node.parent.left === node) { + return node.parent.right; + } + if (t === "MemberExpression" && node.parent.object === node) { + node = node.parent; + continue; + } + + break; + } + + return null; +} + +/** + * Checks if an expression is a variable that can only be observed within the given function. + * @param {Variable|null} variable The variable to check + * @param {boolean} isMemberAccess If `true` then this is a member access. + * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure. + */ +function isLocalVariableWithoutEscape(variable, isMemberAccess) { + if (!variable) { + return false; // A global variable which was not defined. + } + + // If the reference is a property access and the variable is a parameter, it handles the variable is not local. + if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) { + return false; + } + + const functionScope = variable.scope.variableScope; + + return variable.references.every(reference => + reference.from.variableScope === functionScope); +} + +class SegmentInfo { + constructor() { + this.info = new WeakMap(); + } + + /** + * Initialize the segment information. + * @param {PathSegment} segment The segment to initialize. + * @returns {void} + */ + initialize(segment) { + const outdatedReadVariableNames = new Set(); + const freshReadVariableNames = new Set(); + + for (const prevSegment of segment.prevSegments) { + const info = this.info.get(prevSegment); + + if (info) { + info.outdatedReadVariableNames.forEach(Set.prototype.add, outdatedReadVariableNames); + info.freshReadVariableNames.forEach(Set.prototype.add, freshReadVariableNames); + } + } + + this.info.set(segment, { outdatedReadVariableNames, freshReadVariableNames }); + } + + /** + * Mark a given variable as read on given segments. + * @param {PathSegment[]} segments The segments that it read the variable on. + * @param {string} variableName The variable name to be read. + * @returns {void} + */ + markAsRead(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.add(variableName); + } + } + } + + /** + * Move `freshReadVariableNames` to `outdatedReadVariableNames`. + * @param {PathSegment[]} segments The segments to process. + * @returns {void} + */ + makeOutdated(segments) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info) { + info.freshReadVariableNames.forEach(Set.prototype.add, info.outdatedReadVariableNames); + info.freshReadVariableNames.clear(); + } + } + } + + /** + * Check if a given variable is outdated on the current segments. + * @param {PathSegment[]} segments The current segments. + * @param {string} variableName The variable name to check. + * @returns {boolean} `true` if the variable is outdated on the segments. + */ + isOutdated(segments, variableName) { + for (const segment of segments) { + const info = this.info.get(segment); + + if (info && info.outdatedReadVariableNames.has(variableName)) { + return true; + } + } + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/require-atomic-updates" + }, + + fixable: null, + schema: [], + + messages: { + nonAtomicUpdate: "Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const assignmentReferences = new Map(); + const segmentInfo = new SegmentInfo(); + let stack = null; + + return { + onCodePathStart(codePath) { + const scope = context.getScope(); + const shouldVerify = + scope.type === "function" && + (scope.block.async || scope.block.generator); + + stack = { + upper: stack, + codePath, + referenceMap: shouldVerify ? createReferenceMap(scope) : null + }; + }, + onCodePathEnd() { + stack = stack.upper; + }, + + // Initialize the segment information. + onCodePathSegmentStart(segment) { + segmentInfo.initialize(segment); + }, + + // Handle references to prepare verification. + Identifier(node) { + const { codePath, referenceMap } = stack; + const reference = referenceMap && referenceMap.get(node); + + // Ignore if this is not a valid variable reference. + if (!reference) { + return; + } + const name = reference.identifier.name; + const variable = reference.resolved; + const writeExpr = getWriteExpr(reference); + const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; + + // Add a fresh read variable. + if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { + segmentInfo.markAsRead(codePath.currentSegments, name); + } + + /* + * Register the variable to verify after ESLint traversed the `writeExpr` node + * if this reference is an assignment to a variable which is referred from other closure. + */ + if (writeExpr && + writeExpr.parent.right === writeExpr && // ← exclude variable declarations. + !isLocalVariableWithoutEscape(variable, isMemberAccess) + ) { + let refs = assignmentReferences.get(writeExpr); + + if (!refs) { + refs = []; + assignmentReferences.set(writeExpr, refs); + } + + refs.push(reference); + } + }, + + /* + * Verify assignments. + * If the reference exists in `outdatedReadVariableNames` list, report it. + */ + ":expression:exit"(node) { + const { codePath, referenceMap } = stack; + + // referenceMap exists if this is in a resumable function scope. + if (!referenceMap) { + return; + } + + // Mark the read variables on this code path as outdated. + if (node.type === "AwaitExpression" || node.type === "YieldExpression") { + segmentInfo.makeOutdated(codePath.currentSegments); + } + + // Verify. + const references = assignmentReferences.get(node); + + if (references) { + assignmentReferences.delete(node); + + for (const reference of references) { + const name = reference.identifier.name; + + if (segmentInfo.isOutdated(codePath.currentSegments, name)) { + context.report({ + node: node.parent, + messageId: "nonAtomicUpdate", + data: { + value: sourceCode.getText(node.parent.left) + } + }); + } + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/require-await.js b/day1/cli-study/node_modules/eslint/lib/rules/require-await.js new file mode 100644 index 0000000..9b5acc7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/require-await.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to disallow async functions which have no `await` expression. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Capitalize the 1st letter of the given text. + * @param {string} text The text to capitalize. + * @returns {string} The text that the 1st letter was capitalized. + */ +function capitalizeFirstLetter(text) { + return text[0].toUpperCase() + text.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "disallow async functions which have no `await` expression", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-await" + }, + + schema: [], + + messages: { + missingAwait: "{{name}} has no 'await' expression." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + let scopeInfo = null; + + /** + * Push the scope info object to the stack. + * @returns {void} + */ + function enterFunction() { + scopeInfo = { + upper: scopeInfo, + hasAwait: false + }; + } + + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + * @param {ASTNode} node The node to report. + * @returns {void} + */ + function exitFunction(node) { + if (!node.generator && node.async && !scopeInfo.hasAwait && !astUtils.isEmptyFunction(node)) { + context.report({ + node, + loc: astUtils.getFunctionHeadLoc(node, sourceCode), + messageId: "missingAwait", + data: { + name: capitalizeFirstLetter( + astUtils.getFunctionNameWithKind(node) + ) + } + }); + } + + scopeInfo = scopeInfo.upper; + } + + return { + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression:exit": exitFunction, + "ArrowFunctionExpression:exit": exitFunction, + + AwaitExpression() { + if (!scopeInfo) { + return; + } + + scopeInfo.hasAwait = true; + }, + ForOfStatement(node) { + if (!scopeInfo) { + return; + } + + if (node.await) { + scopeInfo.hasAwait = true; + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/require-jsdoc.js b/day1/cli-study/node_modules/eslint/lib/rules/require-jsdoc.js new file mode 100644 index 0000000..e581b2b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/require-jsdoc.js @@ -0,0 +1,121 @@ +/** + * @fileoverview Rule to check for jsdoc presence. + * @author Gyandeep Singh + */ +"use strict"; + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require JSDoc comments", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/require-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + require: { + type: "object", + properties: { + ClassDeclaration: { + type: "boolean", + default: false + }, + MethodDefinition: { + type: "boolean", + default: false + }, + FunctionDeclaration: { + type: "boolean", + default: true + }, + ArrowFunctionExpression: { + type: "boolean", + default: false + }, + FunctionExpression: { + type: "boolean", + default: false + } + }, + additionalProperties: false, + default: {} + } + }, + additionalProperties: false + } + ], + + deprecated: true, + replacedBy: [], + + messages: { + missingJSDocComment: "Missing JSDoc comment." + } + }, + + create(context) { + const source = context.getSourceCode(); + const DEFAULT_OPTIONS = { + FunctionDeclaration: true, + MethodDefinition: false, + ClassDeclaration: false, + ArrowFunctionExpression: false, + FunctionExpression: false + }; + const options = Object.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require); + + /** + * Report the error message + * @param {ASTNode} node node to report + * @returns {void} + */ + function report(node) { + context.report({ node, messageId: "missingJSDocComment" }); + } + + /** + * Check if the jsdoc comment is present or not. + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkJsDoc(node) { + const jsdocComment = source.getJSDocComment(node); + + if (!jsdocComment) { + report(node); + } + } + + return { + FunctionDeclaration(node) { + if (options.FunctionDeclaration) { + checkJsDoc(node); + } + }, + FunctionExpression(node) { + if ( + (options.MethodDefinition && node.parent.type === "MethodDefinition") || + (options.FunctionExpression && (node.parent.type === "VariableDeclarator" || (node.parent.type === "Property" && node === node.parent.value))) + ) { + checkJsDoc(node); + } + }, + ClassDeclaration(node) { + if (options.ClassDeclaration) { + checkJsDoc(node); + } + }, + ArrowFunctionExpression(node) { + if (options.ArrowFunctionExpression && node.parent.type === "VariableDeclarator") { + checkJsDoc(node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/require-unicode-regexp.js b/day1/cli-study/node_modules/eslint/lib/rules/require-unicode-regexp.js new file mode 100644 index 0000000..880405e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Rule to enforce the use of `u` flag on RegExp. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + CALL, + CONSTRUCT, + ReferenceTracker, + getStringIfConstant +} = require("eslint-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce the use of `u` flag on RegExp", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/require-unicode-regexp" + }, + + messages: { + requireUFlag: "Use the 'u' flag." + }, + + schema: [] + }, + + create(context) { + return { + "Literal[regex]"(node) { + const flags = node.regex.flags || ""; + + if (!flags.includes("u")) { + context.report({ node, messageId: "requireUFlag" }); + } + }, + + Program() { + const scope = context.getScope(); + const tracker = new ReferenceTracker(scope); + const trackMap = { + RegExp: { [CALL]: true, [CONSTRUCT]: true } + }; + + for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + const flagsNode = node.arguments[1]; + const flags = getStringIfConstant(flagsNode, scope); + + if (!flagsNode || (typeof flags === "string" && !flags.includes("u"))) { + context.report({ node, messageId: "requireUFlag" }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/require-yield.js b/day1/cli-study/node_modules/eslint/lib/rules/require-yield.js new file mode 100644 index 0000000..af2344d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/require-yield.js @@ -0,0 +1,78 @@ +/** + * @fileoverview Rule to flag the generator functions that does not have yield. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require generator functions to contain `yield`", + category: "ECMAScript 6", + recommended: true, + url: "https://eslint.org/docs/rules/require-yield" + }, + + schema: [], + + messages: { + missingYield: "This generator function does not have 'yield'." + } + }, + + create(context) { + const stack = []; + + /** + * If the node is a generator function, start counting `yield` keywords. + * @param {Node} node A function node to check. + * @returns {void} + */ + function beginChecking(node) { + if (node.generator) { + stack.push(0); + } + } + + /** + * If the node is a generator function, end counting `yield` keywords, then + * reports result. + * @param {Node} node A function node to check. + * @returns {void} + */ + function endChecking(node) { + if (!node.generator) { + return; + } + + const countYield = stack.pop(); + + if (countYield === 0 && node.body.body.length > 0) { + context.report({ node, messageId: "missingYield" }); + } + } + + return { + FunctionDeclaration: beginChecking, + "FunctionDeclaration:exit": endChecking, + FunctionExpression: beginChecking, + "FunctionExpression:exit": endChecking, + + // Increases the count of `yield` keyword. + YieldExpression() { + + /* istanbul ignore else */ + if (stack.length > 0) { + stack[stack.length - 1] += 1; + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/rest-spread-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/rest-spread-spacing.js new file mode 100644 index 0000000..8cb9814 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -0,0 +1,120 @@ +/** + * @fileoverview Enforce spacing between rest and spread operators and their expressions. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing between rest and spread operators and their expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/rest-spread-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + + messages: { + unexpectedWhitespace: "Unexpected whitespace after {{type}} operator.", + expectedWhitespace: "Expected whitespace after {{type}} operator." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(), + alwaysSpace = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Checks whitespace between rest/spread operators and their expressions + * @param {ASTNode} node The node to check + * @returns {void} + */ + function checkWhiteSpace(node) { + const operator = sourceCode.getFirstToken(node), + nextToken = sourceCode.getTokenAfter(operator), + hasWhitespace = sourceCode.isSpaceBetweenTokens(operator, nextToken); + let type; + + switch (node.type) { + case "SpreadElement": + type = "spread"; + if (node.parent.type === "ObjectExpression") { + type += " property"; + } + break; + case "RestElement": + type = "rest"; + if (node.parent.type === "ObjectPattern") { + type += " property"; + } + break; + case "ExperimentalSpreadProperty": + type = "spread property"; + break; + case "ExperimentalRestProperty": + type = "rest property"; + break; + default: + return; + } + + if (alwaysSpace && !hasWhitespace) { + context.report({ + node, + loc: operator.loc, + messageId: "expectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.replaceTextRange([operator.range[1], nextToken.range[0]], " "); + } + }); + } else if (!alwaysSpace && hasWhitespace) { + context.report({ + node, + loc: { + start: operator.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedWhitespace", + data: { + type + }, + fix(fixer) { + return fixer.removeRange([operator.range[1], nextToken.range[0]]); + } + }); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + SpreadElement: checkWhiteSpace, + RestElement: checkWhiteSpace, + ExperimentalSpreadProperty: checkWhiteSpace, + ExperimentalRestProperty: checkWhiteSpace + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/semi-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/semi-spacing.js new file mode 100644 index 0000000..5c546f2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/semi-spacing.js @@ -0,0 +1,244 @@ +/** + * @fileoverview Validates spacing before and after semicolon + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before and after semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + before: { + type: "boolean", + default: false + }, + after: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedWhitespaceBefore: "Unexpected whitespace before semicolon.", + unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.", + missingWhitespaceBefore: "Missing whitespace before semicolon.", + missingWhitespaceAfter: "Missing whitespace after semicolon." + } + }, + + create(context) { + + const config = context.options[0], + sourceCode = context.getSourceCode(); + let requireSpaceBefore = false, + requireSpaceAfter = true; + + if (typeof config === "object") { + requireSpaceBefore = config.before; + requireSpaceAfter = config.after; + } + + /** + * Checks if a given token has leading whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has leading space, false if not. + */ + function hasLeadingSpace(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); + } + + /** + * Checks if a given token has trailing whitespace. + * @param {Object} token The token to check. + * @returns {boolean} True if the given token has trailing space, false if not. + */ + function hasTrailingSpace(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); + } + + /** + * Checks if the given token is the last token in its line. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the last in its line. + */ + function isLastTokenInCurrentLine(token) { + const tokenAfter = sourceCode.getTokenAfter(token); + + return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); + } + + /** + * Checks if the given token is the first token in its line + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the first in its line. + */ + function isFirstTokenInCurrentLine(token) { + const tokenBefore = sourceCode.getTokenBefore(token); + + return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); + } + + /** + * Checks if the next token of a given token is a closing parenthesis. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. + */ + function isBeforeClosingParen(token) { + const nextToken = sourceCode.getTokenAfter(token); + + return (nextToken && astUtils.isClosingBraceToken(nextToken) || astUtils.isClosingParenToken(nextToken)); + } + + /** + * Report location example : + * + * for unexpected space `before` + * + * var a = 'b' ; + * ^^^ + * + * for unexpected space `after` + * + * var a = 'b'; c = 10; + * ^^ + * + * Reports if the given token has invalid spacing. + * @param {Token} token The semicolon token to check. + * @param {ASTNode} node The corresponding node of the token. + * @returns {void} + */ + function checkSemicolonSpacing(token, node) { + if (astUtils.isSemicolonToken(token)) { + if (hasLeadingSpace(token)) { + if (!requireSpaceBefore) { + const tokenBefore = sourceCode.getTokenBefore(token); + const loc = { + start: tokenBefore.loc.end, + end: token.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceBefore", + fix(fixer) { + + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); + } + } else { + if (requireSpaceBefore) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceBefore", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { + if (hasTrailingSpace(token)) { + if (!requireSpaceAfter) { + const tokenAfter = sourceCode.getTokenAfter(token); + const loc = { + start: token.loc.end, + end: tokenAfter.loc.start + }; + + context.report({ + node, + loc, + messageId: "unexpectedWhitespaceAfter", + fix(fixer) { + + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); + } + } else { + if (requireSpaceAfter) { + const loc = token.loc; + + context.report({ + node, + loc, + messageId: "missingWhitespaceAfter", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + } + } + } + + /** + * Checks the spacing of the semicolon with the assumption that the last token is the semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkNode(node) { + const token = sourceCode.getLastToken(node); + + checkSemicolonSpacing(token, node); + } + + return { + VariableDeclaration: checkNode, + ExpressionStatement: checkNode, + BreakStatement: checkNode, + ContinueStatement: checkNode, + DebuggerStatement: checkNode, + DoWhileStatement: checkNode, + ReturnStatement: checkNode, + ThrowStatement: checkNode, + ImportDeclaration: checkNode, + ExportNamedDeclaration: checkNode, + ExportAllDeclaration: checkNode, + ExportDefaultDeclaration: checkNode, + ForStatement(node) { + if (node.init) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.init), node); + } + + if (node.test) { + checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/semi-style.js b/day1/cli-study/node_modules/eslint/lib/rules/semi-style.js new file mode 100644 index 0000000..0c9bec4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/semi-style.js @@ -0,0 +1,151 @@ +/** + * @fileoverview Rule to enforce location of semicolons. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const SELECTOR = `:matches(${ + [ + "BreakStatement", "ContinueStatement", "DebuggerStatement", + "DoWhileStatement", "ExportAllDeclaration", + "ExportDefaultDeclaration", "ExportNamedDeclaration", + "ExpressionStatement", "ImportDeclaration", "ReturnStatement", + "ThrowStatement", "VariableDeclaration" + ].join(",") +})`; + +/** + * Get the child node list of a given node. + * This returns `Program#body`, `BlockStatement#body`, or `SwitchCase#consequent`. + * This is used to check whether a node is the first/last child. + * @param {Node} node A node to get child node list. + * @returns {Node[]|null} The child node list. + */ +function getChildren(node) { + const t = node.type; + + if (t === "BlockStatement" || t === "Program") { + return node.body; + } + if (t === "SwitchCase") { + return node.consequent; + } + return null; +} + +/** + * Check whether a given node is the last statement in the parent block. + * @param {Node} node A node to check. + * @returns {boolean} `true` if the node is the last statement in the parent block. + */ +function isLastChild(node) { + const t = node.parent.type; + + if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword. + return true; + } + if (t === "DoWhileStatement") { // before `while` keyword. + return true; + } + const nodeList = getChildren(node.parent); + + return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc. +} + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce location of semicolons", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi-style" + }, + + schema: [{ enum: ["last", "first"] }], + fixable: "whitespace", + + messages: { + expectedSemiColon: "Expected this semicolon to be at {{pos}}." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const option = context.options[0] || "last"; + + /** + * Check the given semicolon token. + * @param {Token} semiToken The semicolon token to check. + * @param {"first"|"last"} expected The expected location to check. + * @returns {void} + */ + function check(semiToken, expected) { + const prevToken = sourceCode.getTokenBefore(semiToken); + const nextToken = sourceCode.getTokenAfter(semiToken); + const prevIsSameLine = !prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken); + const nextIsSameLine = !nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken); + + if ((expected === "last" && !prevIsSameLine) || (expected === "first" && !nextIsSameLine)) { + context.report({ + loc: semiToken.loc, + messageId: "expectedSemiColon", + data: { + pos: (expected === "last") + ? "the end of the previous line" + : "the beginning of the next line" + }, + fix(fixer) { + if (prevToken && nextToken && sourceCode.commentsExistBetween(prevToken, nextToken)) { + return null; + } + + const start = prevToken ? prevToken.range[1] : semiToken.range[0]; + const end = nextToken ? nextToken.range[0] : semiToken.range[1]; + const text = (expected === "last") ? ";\n" : "\n;"; + + return fixer.replaceTextRange([start, end], text); + } + }); + } + } + + return { + [SELECTOR](node) { + if (option === "first" && isLastChild(node)) { + return; + } + + const lastToken = sourceCode.getLastToken(node); + + if (astUtils.isSemicolonToken(lastToken)) { + check(lastToken, option); + } + }, + + ForStatement(node) { + const firstSemi = node.init && sourceCode.getTokenAfter(node.init, astUtils.isSemicolonToken); + const secondSemi = node.test && sourceCode.getTokenAfter(node.test, astUtils.isSemicolonToken); + + if (firstSemi) { + check(firstSemi, "last"); + } + if (secondSemi) { + check(secondSemi, "last"); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/semi.js b/day1/cli-study/node_modules/eslint/lib/rules/semi.js new file mode 100644 index 0000000..d2f0670 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/semi.js @@ -0,0 +1,336 @@ +/** + * @fileoverview Rule to flag missing semicolons. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const FixTracker = require("./utils/fix-tracker"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow semicolons instead of ASI", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/semi" + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + }, + { + type: "object", + properties: { + beforeStatementContinuationChars: { + enum: ["always", "any", "never"] + } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + omitLastInOneLineBlock: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + }, + + messages: { + missingSemi: "Missing semicolon.", + extraSemi: "Extra semicolon." + } + }, + + create(context) { + + const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` + const options = context.options[1]; + const never = context.options[0] === "never"; + const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); + const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a semicolon error with appropriate location and message. + * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. + * @returns {void} + */ + function report(node, missing) { + const lastToken = sourceCode.getLastToken(node); + let messageId, + fix, + loc; + + if (!missing) { + messageId = "missingSemi"; + loc = { + start: lastToken.loc.end, + end: astUtils.getNextLocation(sourceCode, lastToken.loc.end) + }; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + messageId = "extraSemi"; + loc = lastToken.loc; + fix = function(fixer) { + + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with no-extra-semi. + * https://github.com/eslint/eslint/issues/7928 + */ + return new FixTracker(fixer, sourceCode) + .retainSurroundingTokens(lastToken) + .remove(lastToken); + }; + } + + context.report({ + node, + loc, + messageId, + fix + }); + + } + + /** + * Check whether a given semicolon token is redundant. + * @param {Token} semiToken A semicolon token to check. + * @returns {boolean} `true` if the next token is `;` or `}`. + */ + function isRedundantSemi(semiToken) { + const nextToken = sourceCode.getTokenAfter(semiToken); + + return ( + !nextToken || + astUtils.isClosingBraceToken(nextToken) || + astUtils.isSemicolonToken(nextToken) + ); + } + + /** + * Check whether a given token is the closing brace of an arrow function. + * @param {Token} lastToken A token to check. + * @returns {boolean} `true` if the token is the closing brace of an arrow function. + */ + function isEndOfArrowBlock(lastToken) { + if (!astUtils.isClosingBraceToken(lastToken)) { + return false; + } + const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]); + + return ( + node.type === "BlockStatement" && + node.parent.type === "ArrowFunctionExpression" + ); + } + + /** + * Check whether a given node is on the same line with the next token. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node is on the same line with the next token. + */ + function isOnSameLineWithNextToken(node) { + const prevToken = sourceCode.getLastToken(node, 1); + const nextToken = sourceCode.getTokenAfter(node); + + return !!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken); + } + + /** + * Check whether a given node can connect the next line if the next line is unreliable. + * @param {Node} node A statement node to check. + * @returns {boolean} `true` if the node can connect the next line. + */ + function maybeAsiHazardAfter(node) { + const t = node.type; + + if (t === "DoWhileStatement" || + t === "BreakStatement" || + t === "ContinueStatement" || + t === "DebuggerStatement" || + t === "ImportDeclaration" || + t === "ExportAllDeclaration" + ) { + return false; + } + if (t === "ReturnStatement") { + return Boolean(node.argument); + } + if (t === "ExportNamedDeclaration") { + return Boolean(node.declaration); + } + if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) { + return false; + } + + return true; + } + + /** + * Check whether a given token can connect the previous statement. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`. + */ + function maybeAsiHazardBefore(token) { + return ( + Boolean(token) && + OPT_OUT_PATTERN.test(token.value) && + token.value !== "++" && + token.value !== "--" + ); + } + + /** + * Check if the semicolon of a given node is unnecessary, only true if: + * - next token is a valid statement divider (`;` or `}`). + * - next token is on a new line and the node is not connectable to the new line. + * @param {Node} node A statement node to check. + * @returns {boolean} whether the semicolon is unnecessary. + */ + function canRemoveSemicolon(node) { + if (isRedundantSemi(sourceCode.getLastToken(node))) { + return true; // `;;` or `;}` + } + if (isOnSameLineWithNextToken(node)) { + return false; // One liner. + } + if (beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) { + return true; // ASI works. This statement doesn't connect to the next. + } + if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + return true; // ASI works. The next token doesn't connect to this statement. + } + + return false; + } + + /** + * Checks a node to see if it's in a one-liner block statement. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is in a one-liner block statement. + */ + function isOneLinerBlock(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + return ( + !!parent && + parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line + ); + } + + /** + * Checks a node to see if it's followed by a semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolon(node) { + const isSemi = astUtils.isSemicolonToken(sourceCode.getLastToken(node)); + + if (never) { + if (isSemi && canRemoveSemicolon(node)) { + report(node, true); + } else if (!isSemi && beforeStatementContinuationChars === "always" && maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) { + report(node); + } + } else { + const oneLinerBlock = (exceptOneLine && isOneLinerBlock(node)); + + if (isSemi && oneLinerBlock) { + report(node, true); + } else if (!isSemi && !oneLinerBlock) { + report(node); + } + } + } + + /** + * Checks to see if there's a semicolon after a variable declaration. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolonForVariableDeclaration(node) { + const parent = node.parent; + + if ((parent.type !== "ForStatement" || parent.init !== node) && + (!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node) + ) { + checkForSemicolon(node); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForSemicolonForVariableDeclaration, + ExpressionStatement: checkForSemicolon, + ReturnStatement: checkForSemicolon, + ThrowStatement: checkForSemicolon, + DoWhileStatement: checkForSemicolon, + DebuggerStatement: checkForSemicolon, + BreakStatement: checkForSemicolon, + ContinueStatement: checkForSemicolon, + ImportDeclaration: checkForSemicolon, + ExportAllDeclaration: checkForSemicolon, + ExportNamedDeclaration(node) { + if (!node.declaration) { + checkForSemicolon(node); + } + }, + ExportDefaultDeclaration(node) { + if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) { + checkForSemicolon(node); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/sort-imports.js b/day1/cli-study/node_modules/eslint/lib/rules/sort-imports.js new file mode 100644 index 0000000..65ad9a1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/sort-imports.js @@ -0,0 +1,213 @@ +/** + * @fileoverview Rule to require sorting of import declarations + * @author Christian Schuller + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce sorted import declarations within modules", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/sort-imports" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + }, + memberSyntaxSortOrder: { + type: "array", + items: { + enum: ["none", "all", "multiple", "single"] + }, + uniqueItems: true, + minItems: 4, + maxItems: 4 + }, + ignoreDeclarationSort: { + type: "boolean", + default: false + }, + ignoreMemberSort: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortImportsAlphabetically: "Imports should be sorted alphabetically.", + sortMembersAlphabetically: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + unexpectedSyntaxOrder: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + ignoreDeclarationSort = configuration.ignoreDeclarationSort || false, + ignoreMemberSort = configuration.ignoreMemberSort || false, + memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"], + sourceCode = context.getSourceCode(); + let previousDeclaration = null; + + /** + * Gets the used member syntax style. + * + * import "my-module.js" --> none + * import * as myModule from "my-module.js" --> all + * import {myMember} from "my-module.js" --> single + * import {foo, bar} from "my-module.js" --> multiple + * @param {ASTNode} node the ImportDeclaration node. + * @returns {string} used member parameter style, ["all", "multiple", "single"] + */ + function usedMemberSyntax(node) { + if (node.specifiers.length === 0) { + return "none"; + } + if (node.specifiers[0].type === "ImportNamespaceSpecifier") { + return "all"; + } + if (node.specifiers.length === 1) { + return "single"; + } + return "multiple"; + + } + + /** + * Gets the group by member parameter index for given declaration. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {number} the declaration group by member index. + */ + function getMemberParameterGroupIndex(node) { + return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node)); + } + + /** + * Gets the local name of the first imported module. + * @param {ASTNode} node the ImportDeclaration node. + * @returns {?string} the local name of the first imported module. + */ + function getFirstLocalMemberName(node) { + if (node.specifiers[0]) { + return node.specifiers[0].local.name; + } + return null; + + } + + return { + ImportDeclaration(node) { + if (!ignoreDeclarationSort) { + if (previousDeclaration) { + const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + let currentLocalMemberName = getFirstLocalMemberName(node), + previousLocalMemberName = getFirstLocalMemberName(previousDeclaration); + + if (ignoreCase) { + previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase(); + currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase(); + } + + /* + * When the current declaration uses a different member syntax, + * then check if the ordering is correct. + * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name. + */ + if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) { + if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) { + context.report({ + node, + messageId: "unexpectedSyntaxOrder", + data: { + syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex], + syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex] + } + }); + } + } else { + if (previousLocalMemberName && + currentLocalMemberName && + currentLocalMemberName < previousLocalMemberName + ) { + context.report({ + node, + messageId: "sortImportsAlphabetically" + }); + } + } + } + + previousDeclaration = node; + } + + if (!ignoreMemberSort) { + const importSpecifiers = node.specifiers.filter(specifier => specifier.type === "ImportSpecifier"); + const getSortableName = ignoreCase ? specifier => specifier.local.name.toLowerCase() : specifier => specifier.local.name; + const firstUnsortedIndex = importSpecifiers.map(getSortableName).findIndex((name, index, array) => array[index - 1] > name); + + if (firstUnsortedIndex !== -1) { + context.report({ + node: importSpecifiers[firstUnsortedIndex], + messageId: "sortMembersAlphabetically", + data: { memberName: importSpecifiers[firstUnsortedIndex].local.name }, + fix(fixer) { + if (importSpecifiers.some(specifier => + sourceCode.getCommentsBefore(specifier).length || sourceCode.getCommentsAfter(specifier).length)) { + + // If there are comments in the ImportSpecifier list, don't rearrange the specifiers. + return null; + } + + return fixer.replaceTextRange( + [importSpecifiers[0].range[0], importSpecifiers[importSpecifiers.length - 1].range[1]], + importSpecifiers + + // Clone the importSpecifiers array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((specifierA, specifierB) => { + const aName = getSortableName(specifierA); + const bName = getSortableName(specifierB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of import specifiers and the text between the originals + .reduce((sourceText, specifier, index) => { + const textAfterSpecifier = index === importSpecifiers.length - 1 + ? "" + : sourceCode.getText().slice(importSpecifiers[index].range[1], importSpecifiers[index + 1].range[0]); + + return sourceText + sourceCode.getText(specifier) + textAfterSpecifier; + }, "") + ); + } + }); + } + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/sort-keys.js b/day1/cli-study/node_modules/eslint/lib/rules/sort-keys.js new file mode 100644 index 0000000..8a95ee2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/sort-keys.js @@ -0,0 +1,187 @@ +/** + * @fileoverview Rule to require object keys to be sorted + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"), + naturalCompare = require("natural-compare"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the property name of the given `Property` node. + * + * - If the property's key is an `Identifier` node, this returns the key's name + * whether it's a computed property or not. + * - If the property has a static name, this returns the static name. + * - Otherwise, this returns null. + * @param {ASTNode} node The `Property` node to get. + * @returns {string|null} The property name or null. + * @private + */ +function getPropertyName(node) { + const staticName = astUtils.getStaticPropertyName(node); + + if (staticName !== null) { + return staticName; + } + + return node.key.name || null; +} + +/** + * Functions which check that the given 2 names are in specific order. + * + * Postfix `I` is meant insensitive. + * Postfix `N` is meant natural. + * @private + */ +const isValidOrders = { + asc(a, b) { + return a <= b; + }, + ascI(a, b) { + return a.toLowerCase() <= b.toLowerCase(); + }, + ascN(a, b) { + return naturalCompare(a, b) <= 0; + }, + ascIN(a, b) { + return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0; + }, + desc(a, b) { + return isValidOrders.asc(b, a); + }, + descI(a, b) { + return isValidOrders.ascI(b, a); + }, + descN(a, b) { + return isValidOrders.ascN(b, a); + }, + descIN(a, b) { + return isValidOrders.ascIN(b, a); + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require object keys to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-keys" + }, + + schema: [ + { + enum: ["asc", "desc"] + }, + { + type: "object", + properties: { + caseSensitive: { + type: "boolean", + default: true + }, + natural: { + type: "boolean", + default: false + }, + minKeys: { + type: "integer", + minimum: 2, + default: 2 + } + }, + additionalProperties: false + } + ], + + messages: { + sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'." + } + }, + + create(context) { + + // Parse options. + const order = context.options[0] || "asc"; + const options = context.options[1]; + const insensitive = options && options.caseSensitive === false; + const natural = options && options.natural; + const minKeys = options && options.minKeys; + const isValidOrder = isValidOrders[ + order + (insensitive ? "I" : "") + (natural ? "N" : "") + ]; + + // The stack to save the previous property's name for each object literals. + let stack = null; + + return { + ObjectExpression(node) { + stack = { + upper: stack, + prevName: null, + numKeys: node.properties.length + }; + }, + + "ObjectExpression:exit"() { + stack = stack.upper; + }, + + SpreadElement(node) { + if (node.parent.type === "ObjectExpression") { + stack.prevName = null; + } + }, + + Property(node) { + if (node.parent.type === "ObjectPattern") { + return; + } + + const prevName = stack.prevName; + const numKeys = stack.numKeys; + const thisName = getPropertyName(node); + + if (thisName !== null) { + stack.prevName = thisName; + } + + if (prevName === null || thisName === null || numKeys < minKeys) { + return; + } + + if (!isValidOrder(prevName, thisName)) { + context.report({ + node, + loc: node.key.loc, + messageId: "sortKeys", + data: { + thisName, + prevName, + order, + insensitive: insensitive ? "insensitive " : "", + natural: natural ? "natural " : "" + } + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/sort-vars.js b/day1/cli-study/node_modules/eslint/lib/rules/sort-vars.js new file mode 100644 index 0000000..7add2cf --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/sort-vars.js @@ -0,0 +1,104 @@ +/** + * @fileoverview Rule to require sorting of variables within a single Variable Declaration block + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require variables within the same declaration block to be sorted", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/sort-vars" + }, + + schema: [ + { + type: "object", + properties: { + ignoreCase: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + + messages: { + sortVars: "Variables within the same declaration block should be sorted alphabetically." + } + }, + + create(context) { + + const configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + sourceCode = context.getSourceCode(); + + return { + VariableDeclaration(node) { + const idDeclarations = node.declarations.filter(decl => decl.id.type === "Identifier"); + const getSortableName = ignoreCase ? decl => decl.id.name.toLowerCase() : decl => decl.id.name; + const unfixable = idDeclarations.some(decl => decl.init !== null && decl.init.type !== "Literal"); + let fixed = false; + + idDeclarations.slice(1).reduce((memo, decl) => { + const lastVariableName = getSortableName(memo), + currentVariableName = getSortableName(decl); + + if (currentVariableName < lastVariableName) { + context.report({ + node: decl, + messageId: "sortVars", + fix(fixer) { + if (unfixable || fixed) { + return null; + } + return fixer.replaceTextRange( + [idDeclarations[0].range[0], idDeclarations[idDeclarations.length - 1].range[1]], + idDeclarations + + // Clone the idDeclarations array to avoid mutating it + .slice() + + // Sort the array into the desired order + .sort((declA, declB) => { + const aName = getSortableName(declA); + const bName = getSortableName(declB); + + return aName > bName ? 1 : -1; + }) + + // Build a string out of the sorted list of identifier declarations and the text between the originals + .reduce((sourceText, identifier, index) => { + const textAfterIdentifier = index === idDeclarations.length - 1 + ? "" + : sourceCode.getText().slice(idDeclarations[index].range[1], idDeclarations[index + 1].range[0]); + + return sourceText + sourceCode.getText(identifier) + textAfterIdentifier; + }, "") + + ); + } + }); + fixed = true; + return memo; + } + return decl; + + }, idDeclarations[0]); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/space-before-blocks.js b/day1/cli-study/node_modules/eslint/lib/rules/space-before-blocks.js new file mode 100644 index 0000000..9b56481 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/space-before-blocks.js @@ -0,0 +1,164 @@ +/** + * @fileoverview A rule to ensure whitespace before blocks. + * @author Mathias Schreck + */ + +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before blocks", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-blocks" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + keywords: { + enum: ["always", "never", "off"] + }, + functions: { + enum: ["always", "never", "off"] + }, + classes: { + enum: ["always", "never", "off"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before opening brace.", + missingSpace: "Missing space before opening brace." + } + }, + + create(context) { + const config = context.options[0], + sourceCode = context.getSourceCode(); + let alwaysFunctions = true, + alwaysKeywords = true, + alwaysClasses = true, + neverFunctions = false, + neverKeywords = false, + neverClasses = false; + + if (typeof config === "object") { + alwaysFunctions = config.functions === "always"; + alwaysKeywords = config.keywords === "always"; + alwaysClasses = config.classes === "always"; + neverFunctions = config.functions === "never"; + neverKeywords = config.keywords === "never"; + neverClasses = config.classes === "never"; + } else if (config === "never") { + alwaysFunctions = false; + alwaysKeywords = false; + alwaysClasses = false; + neverFunctions = true; + neverKeywords = true; + neverClasses = true; + } + + /** + * Checks whether or not a given token is an arrow operator (=>) or a keyword + * in order to avoid to conflict with `arrow-spacing` and `keyword-spacing`. + * @param {Token} token A token to check. + * @returns {boolean} `true` if the token is an arrow operator. + */ + function isConflicted(token) { + return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword"; + } + + /** + * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line. + * @param {ASTNode|Token} node The AST node of a BlockStatement. + * @returns {void} undefined. + */ + function checkPrecedingSpace(node) { + const precedingToken = sourceCode.getTokenBefore(node); + + if (precedingToken && !isConflicted(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) { + const hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); + const parent = context.getAncestors().pop(); + let requireSpace; + let requireNoSpace; + + if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") { + requireSpace = alwaysFunctions; + requireNoSpace = neverFunctions; + } else if (node.type === "ClassBody") { + requireSpace = alwaysClasses; + requireNoSpace = neverClasses; + } else { + requireSpace = alwaysKeywords; + requireNoSpace = neverKeywords; + } + + if (requireSpace && !hasSpace) { + context.report({ + node, + messageId: "missingSpace", + fix(fixer) { + return fixer.insertTextBefore(node, " "); + } + }); + } else if (requireNoSpace && hasSpace) { + context.report({ + node, + messageId: "unexpectedSpace", + fix(fixer) { + return fixer.removeRange([precedingToken.range[1], node.range[0]]); + } + }); + } + } + } + + /** + * Checks if the CaseBlock of an given SwitchStatement node has a preceding space. + * @param {ASTNode} node The node of a SwitchStatement. + * @returns {void} undefined. + */ + function checkSpaceBeforeCaseBlock(node) { + const cases = node.cases; + let openingBrace; + + if (cases.length > 0) { + openingBrace = sourceCode.getTokenBefore(cases[0]); + } else { + openingBrace = sourceCode.getLastToken(node, 1); + } + + checkPrecedingSpace(openingBrace); + } + + return { + BlockStatement: checkPrecedingSpace, + ClassBody: checkPrecedingSpace, + SwitchStatement: checkSpaceBeforeCaseBlock + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/space-before-function-paren.js b/day1/cli-study/node_modules/eslint/lib/rules/space-before-function-paren.js new file mode 100644 index 0000000..1021a11 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -0,0 +1,164 @@ +/** + * @fileoverview Rule to validate spacing before function paren. + * @author Mathias Schreck + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before `function` definition opening parenthesis", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-before-function-paren" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + anonymous: { + enum: ["always", "never", "ignore"] + }, + named: { + enum: ["always", "never", "ignore"] + }, + asyncArrow: { + enum: ["always", "never", "ignore"] + } + }, + additionalProperties: false + } + ] + } + ], + + messages: { + unexpectedSpace: "Unexpected space before function parentheses.", + missingSpace: "Missing space before function parentheses." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = typeof context.options[0] === "string" ? context.options[0] : "always"; + const overrideConfig = typeof context.options[0] === "object" ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction(node) { + if (node.id) { + return true; + } + + const parent = node.parent; + + return parent.type === "MethodDefinition" || + (parent.type === "Property" && + ( + parent.kind === "get" || + parent.kind === "set" || + parent.method + ) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction(node) { + if (node.type === "ArrowFunctionExpression") { + + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if (node.async && astUtils.isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 }))) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return "ignore"; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction(node) { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === "ignore") { + return; + } + + const rightToken = sourceCode.getFirstToken(node, astUtils.isOpeningParenToken); + const leftToken = sourceCode.getTokenBefore(rightToken); + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === "never") { + context.report({ + node, + loc: { + start: leftToken.loc.end, + end: rightToken.loc.start + }, + messageId: "unexpectedSpace", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(rightToken); + + // Don't fix anything if there's a single line comment between the left and the right token + if (comments.some(comment => comment.type === "Line")) { + return null; + } + return fixer.replaceTextRange( + [leftToken.range[1], rightToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!hasSpacing && functionConfig === "always") { + context.report({ + node, + loc: rightToken.loc, + messageId: "missingSpace", + fix: fixer => fixer.insertTextAfter(leftToken, " ") + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/space-in-parens.js b/day1/cli-study/node_modules/eslint/lib/rules/space-in-parens.js new file mode 100644 index 0000000..b0a604d --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/space-in-parens.js @@ -0,0 +1,282 @@ +/** + * @fileoverview Disallows or enforces spaces inside of parentheses. + * @author Jonathan Rajavuori + */ +"use strict"; + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing inside parentheses", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-in-parens" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + enum: ["{}", "[]", "()", "empty"] + }, + uniqueItems: true + } + }, + additionalProperties: false + } + ], + + messages: { + missingOpeningSpace: "There must be a space after this paren.", + missingClosingSpace: "There must be a space before this paren.", + rejectedOpeningSpace: "There should be no space after this paren.", + rejectedClosingSpace: "There should be no space before this paren." + } + }, + + create(context) { + const ALWAYS = context.options[0] === "always", + exceptionsArrayOptions = (context.options[1] && context.options[1].exceptions) || [], + options = {}; + + let exceptions; + + if (exceptionsArrayOptions.length) { + options.braceException = exceptionsArrayOptions.includes("{}"); + options.bracketException = exceptionsArrayOptions.includes("[]"); + options.parenException = exceptionsArrayOptions.includes("()"); + options.empty = exceptionsArrayOptions.includes("empty"); + } + + /** + * Produces an object with the opener and closer exception values + * @returns {Object} `openers` and `closers` exception values + * @private + */ + function getExceptions() { + const openers = [], + closers = []; + + if (options.braceException) { + openers.push("{"); + closers.push("}"); + } + + if (options.bracketException) { + openers.push("["); + closers.push("]"); + } + + if (options.parenException) { + openers.push("("); + closers.push(")"); + } + + if (options.empty) { + openers.push(")"); + closers.push("("); + } + + return { + openers, + closers + }; + } + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + const sourceCode = context.getSourceCode(); + + /** + * Determines if a token is one of the exceptions for the opener paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the opener paren + */ + function isOpenerException(token) { + return exceptions.openers.includes(token.value); + } + + /** + * Determines if a token is one of the exceptions for the closer paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the closer paren + */ + function isCloserException(token) { + return exceptions.closers.includes(token.value); + } + + /** + * Determines if an opening paren is immediately followed by a required space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren is missing a required space + */ + function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) { + if (sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (!options.empty && astUtils.isClosingParenToken(tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return !isOpenerException(tokenAfterOpeningParen); + } + return isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if an opening paren is immediately followed by a disallowed space + * @param {Object} openingParenToken The paren token + * @param {Object} tokenAfterOpeningParen The token after it + * @returns {boolean} True if the opening paren has a disallowed space + */ + function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) { + if (!astUtils.isTokenOnSameLine(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (tokenAfterOpeningParen.type === "Line") { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(openingParenToken, tokenAfterOpeningParen)) { + return false; + } + + if (ALWAYS) { + return isOpenerException(tokenAfterOpeningParen); + } + return !isOpenerException(tokenAfterOpeningParen); + } + + /** + * Determines if a closing paren is immediately preceded by a required space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren is missing a required space + */ + function closerMissingSpace(tokenBeforeClosingParen, closingParenToken) { + if (sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!options.empty && astUtils.isOpeningParenToken(tokenBeforeClosingParen)) { + return false; + } + + if (ALWAYS) { + return !isCloserException(tokenBeforeClosingParen); + } + return isCloserException(tokenBeforeClosingParen); + } + + /** + * Determines if a closer paren is immediately preceded by a disallowed space + * @param {Object} tokenBeforeClosingParen The token before the paren + * @param {Object} closingParenToken The paren token + * @returns {boolean} True if the closing paren has a disallowed space + */ + function closerRejectsSpace(tokenBeforeClosingParen, closingParenToken) { + if (!astUtils.isTokenOnSameLine(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (!sourceCode.isSpaceBetweenTokens(tokenBeforeClosingParen, closingParenToken)) { + return false; + } + + if (ALWAYS) { + return isCloserException(tokenBeforeClosingParen); + } + return !isCloserException(tokenBeforeClosingParen); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + Program: function checkParenSpaces(node) { + exceptions = getExceptions(); + const tokens = sourceCode.tokensAndComments; + + tokens.forEach((token, i) => { + const prevToken = tokens[i - 1]; + const nextToken = tokens[i + 1]; + + // if token is not an opening or closing paren token, do nothing + if (!astUtils.isOpeningParenToken(token) && !astUtils.isClosingParenToken(token)) { + return; + } + + // if token is an opening paren and is not followed by a required space + if (token.value === "(" && openerMissingSpace(token, nextToken)) { + context.report({ + node, + loc: token.loc, + messageId: "missingOpeningSpace", + fix(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + // if token is an opening paren and is followed by a disallowed space + if (token.value === "(" && openerRejectsSpace(token, nextToken)) { + context.report({ + node, + loc: { start: token.loc.end, end: nextToken.loc.start }, + messageId: "rejectedOpeningSpace", + fix(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + // if token is a closing paren and is not preceded by a required space + if (token.value === ")" && closerMissingSpace(prevToken, token)) { + context.report({ + node, + loc: token.loc, + messageId: "missingClosingSpace", + fix(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + // if token is a closing paren and is preceded by a disallowed space + if (token.value === ")" && closerRejectsSpace(prevToken, token)) { + context.report({ + node, + loc: { start: prevToken.loc.end, end: token.loc.start }, + messageId: "rejectedClosingSpace", + fix(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + }); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/space-infix-ops.js b/day1/cli-study/node_modules/eslint/lib/rules/space-infix-ops.js new file mode 100644 index 0000000..471c222 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/space-infix-ops.js @@ -0,0 +1,169 @@ +/** + * @fileoverview Require spaces around infix operators + * @author Michael Ficarra + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require spacing around infix operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-infix-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + int32Hint: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + missingSpace: "Operator '{{operator}}' must be spaced." + } + }, + + create(context) { + const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; + const sourceCode = context.getSourceCode(); + + /** + * Returns the first token which violates the rule + * @param {ASTNode} left The left node of the main node + * @param {ASTNode} right The right node of the main node + * @param {string} op The operator of the main node + * @returns {Object} The violator token or null + * @private + */ + function getFirstNonSpacedToken(left, right, op) { + const operator = sourceCode.getFirstTokenBetween(left, right, token => token.value === op); + const prev = sourceCode.getTokenBefore(operator); + const next = sourceCode.getTokenAfter(operator); + + if (!sourceCode.isSpaceBetweenTokens(prev, operator) || !sourceCode.isSpaceBetweenTokens(operator, next)) { + return operator; + } + + return null; + } + + /** + * Reports an AST node as a rule violation + * @param {ASTNode} mainNode The node to report + * @param {Object} culpritToken The token which has a problem + * @returns {void} + * @private + */ + function report(mainNode, culpritToken) { + context.report({ + node: mainNode, + loc: culpritToken.loc, + messageId: "missingSpace", + data: { + operator: culpritToken.value + }, + fix(fixer) { + const previousToken = sourceCode.getTokenBefore(culpritToken); + const afterToken = sourceCode.getTokenAfter(culpritToken); + let fixString = ""; + + if (culpritToken.range[0] - previousToken.range[1] === 0) { + fixString = " "; + } + + fixString += culpritToken.value; + + if (afterToken.range[0] - culpritToken.range[1] === 0) { + fixString += " "; + } + + return fixer.replaceText(culpritToken, fixString); + } + }); + } + + /** + * Check if the node is binary then report + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkBinary(node) { + const leftNode = (node.left.typeAnnotation) ? node.left.typeAnnotation : node.left; + const rightNode = node.right; + + // search for = in AssignmentPattern nodes + const operator = node.operator || "="; + + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, operator); + + if (nonSpacedNode) { + if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) { + report(node, nonSpacedNode); + } + } + } + + /** + * Check if the node is conditional + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkConditional(node) { + const nonSpacedConsequentNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); + const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); + + if (nonSpacedConsequentNode) { + report(node, nonSpacedConsequentNode); + } else if (nonSpacedAlternateNode) { + report(node, nonSpacedAlternateNode); + } + } + + /** + * Check if the node is a variable + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkVar(node) { + const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id; + const rightNode = node.init; + + if (rightNode) { + const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "="); + + if (nonSpacedNode) { + report(node, nonSpacedNode); + } + } + } + + return { + AssignmentExpression: checkBinary, + AssignmentPattern: checkBinary, + BinaryExpression: checkBinary, + LogicalExpression: checkBinary, + ConditionalExpression: checkConditional, + VariableDeclarator: checkVar + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/space-unary-ops.js b/day1/cli-study/node_modules/eslint/lib/rules/space-unary-ops.js new file mode 100644 index 0000000..f417eea --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/space-unary-ops.js @@ -0,0 +1,321 @@ +/** + * @fileoverview This rule shoud require or disallow spaces before or after unary operations. + * @author Marcin Kumorek + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce consistent spacing before or after unary operators", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/space-unary-ops" + }, + + fixable: "whitespace", + + schema: [ + { + type: "object", + properties: { + words: { + type: "boolean", + default: true + }, + nonwords: { + type: "boolean", + default: false + }, + overrides: { + type: "object", + additionalProperties: { + type: "boolean" + } + } + }, + additionalProperties: false + } + ], + messages: { + unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.", + unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.", + unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.", + wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.", + operator: "Unary operator '{{operator}}' must be followed by whitespace.", + beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." + } + }, + + create(context) { + const options = context.options[0] || { words: true, nonwords: false }; + + const sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Check if the node is the first "!" in a "!!" convert to Boolean expression + * @param {ASTnode} node AST node + * @returns {boolean} Whether or not the node is first "!" in "!!" + */ + function isFirstBangInBangBangExpression(node) { + return node && node.type === "UnaryExpression" && node.argument.operator === "!" && + node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; + } + + /** + * Checks if an override exists for a given operator. + * @param {string} operator Operator + * @returns {boolean} Whether or not an override has been provided for the operator + */ + function overrideExistsForOperator(operator) { + return options.overrides && Object.prototype.hasOwnProperty.call(options.overrides, operator); + } + + /** + * Gets the value that the override was set to for this operator + * @param {string} operator Operator + * @returns {boolean} Whether or not an override enforces a space with this operator + */ + function overrideEnforcesSpaces(operator) { + return options.overrides[operator]; + } + + /** + * Verify Unary Word Operator has spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordHasSpaces(node, firstToken, secondToken, word) { + if (secondToken.range[0] === firstToken.range[1]) { + context.report({ + node, + messageId: "wordOperator", + data: { + word + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } + + /** + * Verify Unary Word Operator doesn't have spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfterWord", + data: { + word + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Check Unary Word Operators for spaces after the word operator + * @param {ASTnode} node AST node + * @param {Object} firstToken first token from the AST node + * @param {Object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + if (overrideExistsForOperator(word)) { + if (overrideEnforcesSpaces(word)) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } else if (options.words) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } + + /** + * Verifies YieldExpressions satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpacesAfterYield(node) { + const tokens = sourceCode.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } + + /** + * Verifies AwaitExpressions satisfy spacing requirements + * @param {ASTNode} node AwaitExpression AST node + * @returns {void} + */ + function checkForSpacesAfterAwait(node) { + const tokens = sourceCode.getFirstTokens(node, 3); + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await"); + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (isFirstBangInBangBangExpression(node)) { + return; + } + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "operator", + data: { + operator: firstToken.value + }, + fix(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } else { + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node, + messageId: "beforeUnaryExpressions", + data: { + token: secondToken.value + }, + fix(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {Object} firstToken First token in the expression + * @param {Object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedAfter", + data: { + operator: firstToken.value + }, + fix(fixer) { + if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + return null; + } + }); + } + } else { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node, + messageId: "unexpectedBefore", + data: { + operator: secondToken.value + }, + fix(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpaces(node) { + const tokens = node.type === "UpdateExpression" && !node.prefix + ? sourceCode.getLastTokens(node, 2) + : sourceCode.getFirstTokens(node, 2); + const firstToken = tokens[0]; + const secondToken = tokens[1]; + + if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { + checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, firstToken.value); + return; + } + + const operator = node.prefix ? tokens[0].value : tokens[1].value; + + if (overrideExistsForOperator(operator)) { + if (overrideEnforcesSpaces(operator)) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } else if (options.nonwords) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); + } else { + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + UnaryExpression: checkForSpaces, + UpdateExpression: checkForSpaces, + NewExpression: checkForSpaces, + YieldExpression: checkForSpacesAfterYield, + AwaitExpression: checkForSpacesAfterAwait + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/spaced-comment.js b/day1/cli-study/node_modules/eslint/lib/rules/spaced-comment.js new file mode 100644 index 0000000..d3221f0 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/spaced-comment.js @@ -0,0 +1,382 @@ +/** + * @fileoverview Source code for spaced-comments rule + * @author Gyandeep Singh + */ +"use strict"; + +const lodash = require("lodash"); +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Escapes the control characters of a given string. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escape(s) { + return `(?:${lodash.escapeRegExp(s)})`; +} + +/** + * Escapes the control characters of a given string. + * And adds a repeat flag. + * @param {string} s A string to escape. + * @returns {string} An escaped string. + */ +function escapeAndRepeat(s) { + return `${escape(s)}+`; +} + +/** + * Parses `markers` option. + * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. + * @param {string[]} [markers] A marker list. + * @returns {string[]} A marker list. + */ +function parseMarkersOption(markers) { + + // `*` is a marker for JSDoc comments. + if (markers.indexOf("*") === -1) { + return markers.concat("*"); + } + + return markers; +} + +/** + * Creates string pattern for exceptions. + * Generated pattern: + * + * 1. A space or an exception pattern sequence. + * @param {string[]} exceptions An exception pattern list. + * @returns {string} A regular expression string for exceptions. + */ +function createExceptionsPattern(exceptions) { + let pattern = ""; + + /* + * A space or an exception pattern sequence. + * [] ==> "\s" + * ["-"] ==> "(?:\s|\-+$)" + * ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" + * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) + */ + if (exceptions.length === 0) { + + // a space. + pattern += "\\s"; + } else { + + // a space or... + pattern += "(?:\\s|"; + + if (exceptions.length === 1) { + + // a sequence of the exception pattern. + pattern += escapeAndRepeat(exceptions[0]); + } else { + + // a sequence of one of the exception patterns. + pattern += "(?:"; + pattern += exceptions.map(escapeAndRepeat).join("|"); + pattern += ")"; + } + pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`; + } + + return pattern; +} + +/** + * Creates RegExp object for `always` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing. + * 2. Next, a space or an exception pattern sequence. + * @param {string[]} markers A marker list. + * @param {string[]} exceptions An exception pattern list. + * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode. + */ +function createAlwaysStylePattern(markers, exceptions) { + let pattern = "^"; + + /* + * A marker or nothing. + * ["*"] ==> "\*?" + * ["*", "!"] ==> "(?:\*|!)?" + * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F + */ + if (markers.length === 1) { + + // the marker. + pattern += escape(markers[0]); + } else { + + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; + } + + pattern += "?"; // or nothing. + pattern += createExceptionsPattern(exceptions); + + return new RegExp(pattern, "u"); +} + +/** + * Creates RegExp object for `never` mode. + * Generated pattern for beginning of comment: + * + * 1. First, a marker or nothing (captured). + * 2. Next, a space or a tab. + * @param {string[]} markers A marker list. + * @returns {RegExp} A RegExp object for `never` mode. + */ +function createNeverStylePattern(markers) { + const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`; + + return new RegExp(pattern, "u"); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce consistent spacing after the `//` or `/*` in a comment", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/spaced-comment" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + line: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + } + }, + additionalProperties: false + }, + block: { + type: "object", + properties: { + exceptions: { + type: "array", + items: { + type: "string" + } + }, + markers: { + type: "array", + items: { + type: "string" + } + }, + balanced: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + }, + additionalProperties: false + } + ], + + messages: { + unexpectedSpaceAfterMarker: "Unexpected space or tab after marker ({{refChar}}) in comment.", + expectedExceptionAfter: "Expected exception block, space or tab after '{{refChar}}' in comment.", + unexpectedSpaceBefore: "Unexpected space or tab before '*/' in comment.", + unexpectedSpaceAfter: "Unexpected space or tab after '{{refChar}}' in comment.", + expectedSpaceBefore: "Expected space or tab before '*/' in comment.", + expectedSpaceAfter: "Expected space or tab after '{{refChar}}' in comment." + } + }, + + create(context) { + + const sourceCode = context.getSourceCode(); + + // Unless the first option is never, require a space + const requireSpace = context.options[0] !== "never"; + + /* + * Parse the second options. + * If markers don't include `"*"`, it's added automatically for JSDoc + * comments. + */ + const config = context.options[1] || {}; + const balanced = config.block && config.block.balanced; + + const styleRules = ["block", "line"].reduce((rule, type) => { + const markers = parseMarkersOption(config[type] && config[type].markers || config.markers || []); + const exceptions = config[type] && config[type].exceptions || config.exceptions || []; + const endNeverPattern = "[ \t]+$"; + + // Create RegExp object for valid patterns. + rule[type] = { + beginRegex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), + endRegex: balanced && requireSpace ? new RegExp(`${createExceptionsPattern(exceptions)}$`, "u") : new RegExp(endNeverPattern, "u"), + hasExceptions: exceptions.length > 0, + captureMarker: new RegExp(`^(${markers.map(escape).join("|")})`, "u"), + markers: new Set(markers) + }; + + return rule; + }, {}); + + /** + * Reports a beginning spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {Array} match An array of match results for markers. + * @param {string} refChar Character used for reference in the error message. + * @returns {void} + */ + function reportBegin(node, messageId, match, refChar) { + const type = node.type.toLowerCase(), + commentIdentifier = type === "block" ? "/*" : "//"; + + context.report({ + node, + fix(fixer) { + const start = node.range[0]; + let end = start + 2; + + if (requireSpace) { + if (match) { + end += match[0].length; + } + return fixer.insertTextAfterRange([start, end], " "); + } + end += match[0].length; + return fixer.replaceTextRange([start, end], commentIdentifier + (match[1] ? match[1] : "")); + + }, + messageId, + data: { refChar } + }); + } + + /** + * Reports an ending spacing error with an appropriate message. + * @param {ASTNode} node A comment node to check. + * @param {string} messageId An error message to report. + * @param {string} match An array of the matched whitespace characters. + * @returns {void} + */ + function reportEnd(node, messageId, match) { + context.report({ + node, + fix(fixer) { + if (requireSpace) { + return fixer.insertTextAfterRange([node.range[0], node.range[1] - 2], " "); + } + const end = node.range[1] - 2, + start = end - match[0].length; + + return fixer.replaceTextRange([start, end], ""); + + }, + messageId + }); + } + + /** + * Reports a given comment if it's invalid. + * @param {ASTNode} node a comment node to check. + * @returns {void} + */ + function checkCommentForSpace(node) { + const type = node.type.toLowerCase(), + rule = styleRules[type], + commentIdentifier = type === "block" ? "/*" : "//"; + + // Ignores empty comments and comments that consist only of a marker. + if (node.value.length === 0 || rule.markers.has(node.value)) { + return; + } + + const beginMatch = rule.beginRegex.exec(node.value); + const endMatch = rule.endRegex.exec(node.value); + + // Checks. + if (requireSpace) { + if (!beginMatch) { + const hasMarker = rule.captureMarker.exec(node.value); + const marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; + + if (rule.hasExceptions) { + reportBegin(node, "expectedExceptionAfter", hasMarker, marker); + } else { + reportBegin(node, "expectedSpaceAfter", hasMarker, marker); + } + } + + if (balanced && type === "block" && !endMatch) { + reportEnd(node, "expectedSpaceBefore"); + } + } else { + if (beginMatch) { + if (!beginMatch[1]) { + reportBegin(node, "unexpectedSpaceAfter", beginMatch, commentIdentifier); + } else { + reportBegin(node, "unexpectedSpaceAfterMarker", beginMatch, beginMatch[1]); + } + } + + if (balanced && type === "block" && endMatch) { + reportEnd(node, "unexpectedSpaceBefore", endMatch); + } + } + } + + return { + Program() { + const comments = sourceCode.getAllComments(); + + comments.filter(token => token.type !== "Shebang").forEach(checkCommentForSpace); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/strict.js b/day1/cli-study/node_modules/eslint/lib/rules/strict.js new file mode 100644 index 0000000..b0d6cf9 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/strict.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Rule to control usage of strict mode directives. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets all of the Use Strict Directives in the Directive Prologue of a group of + * statements. + * @param {ASTNode[]} statements Statements in the program or function body. + * @returns {ASTNode[]} All of the Use Strict Directives. + */ +function getUseStrictDirectives(statements) { + const directives = []; + + for (let i = 0; i < statements.length; i++) { + const statement = statements[i]; + + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + statement.expression.value === "use strict" + ) { + directives[i] = statement; + } else { + break; + } + } + + return directives; +} + +/** + * Checks whether a given parameter is a simple parameter. + * @param {ASTNode} node A pattern node to check. + * @returns {boolean} `true` if the node is an Identifier node. + */ +function isSimpleParameter(node) { + return node.type === "Identifier"; +} + +/** + * Checks whether a given parameter list is a simple parameter list. + * @param {ASTNode[]} params A parameter list to check. + * @returns {boolean} `true` if the every parameter is an Identifier node. + */ +function isSimpleParameterList(params) { + return params.every(isSimpleParameter); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require or disallow strict mode directives", + category: "Strict Mode", + recommended: false, + url: "https://eslint.org/docs/rules/strict" + }, + + schema: [ + { + enum: ["never", "global", "function", "safe"] + } + ], + + fixable: "code", + messages: { + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", + never: "Strict mode is not permitted.", + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", + nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", + wrap: "Wrap {{name}} in a function with 'use strict' directive." + } + }, + + create(context) { + + const ecmaFeatures = context.parserOptions.ecmaFeatures || {}, + scopes = [], + classScopes = []; + let mode = context.options[0] || "safe"; + + if (ecmaFeatures.impliedStrict) { + mode = "implied"; + } else if (mode === "safe") { + mode = ecmaFeatures.globalReturn ? "global" : "function"; + } + + /** + * Determines whether a reported error should be fixed, depending on the error type. + * @param {string} errorType The type of error + * @returns {boolean} `true` if the reported error should be fixed + */ + function shouldFix(errorType) { + return errorType === "multiple" || errorType === "unnecessary" || errorType === "module" || errorType === "implied" || errorType === "unnecessaryInClasses"; + } + + /** + * Gets a fixer function to remove a given 'use strict' directive. + * @param {ASTNode} node The directive that should be removed + * @returns {Function} A fixer function + */ + function getFixFunction(node) { + return fixer => fixer.remove(node); + } + + /** + * Report a slice of an array of nodes with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} start Index to start from. + * @param {string} end Index to end before. + * @param {string} messageId Message to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportSlice(nodes, start, end, messageId, fix) { + nodes.slice(start, end).forEach(node => { + context.report({ node, messageId, fix: fix ? getFixFunction(node) : null }); + }); + } + + /** + * Report all nodes in an array with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAll(nodes, messageId, fix) { + reportSlice(nodes, 0, nodes.length, messageId, fix); + } + + /** + * Report all nodes in an array, except the first, with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} messageId Message id to display. + * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) + * @returns {void} + */ + function reportAllExceptFirst(nodes, messageId, fix) { + reportSlice(nodes, 1, nodes.length, messageId, fix); + } + + /** + * Entering a function in 'function' mode pushes a new nested scope onto the + * stack. The new scope is true if the nested function is strict mode code. + * @param {ASTNode} node The function declaration or expression. + * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node. + * @returns {void} + */ + function enterFunctionInFunctionMode(node, useStrictDirectives) { + const isInClass = classScopes.length > 0, + isParentGlobal = scopes.length === 0 && classScopes.length === 0, + isParentStrict = scopes.length > 0 && scopes[scopes.length - 1], + isStrict = useStrictDirectives.length > 0; + + if (isStrict) { + if (!isSimpleParameterList(node.params)) { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + } else if (isParentStrict) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessary", fix: getFixFunction(useStrictDirectives[0]) }); + } else if (isInClass) { + context.report({ node: useStrictDirectives[0], messageId: "unnecessaryInClasses", fix: getFixFunction(useStrictDirectives[0]) }); + } + + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else if (isParentGlobal) { + if (isSimpleParameterList(node.params)) { + context.report({ node, messageId: "function" }); + } else { + context.report({ + node, + messageId: "wrap", + data: { name: astUtils.getFunctionNameWithKind(node) } + }); + } + } + + scopes.push(isParentStrict || isStrict); + } + + /** + * Exiting a function in 'function' mode pops its scope off the stack. + * @returns {void} + */ + function exitFunctionInFunctionMode() { + scopes.pop(); + } + + /** + * Enter a function and either: + * - Push a new nested scope onto the stack (in 'function' mode). + * - Report all the Use Strict Directives (in the other modes). + * @param {ASTNode} node The function declaration or expression. + * @returns {void} + */ + function enterFunction(node) { + const isBlock = node.body.type === "BlockStatement", + useStrictDirectives = isBlock + ? getUseStrictDirectives(node.body.body) : []; + + if (mode === "function") { + enterFunctionInFunctionMode(node, useStrictDirectives); + } else if (useStrictDirectives.length > 0) { + if (isSimpleParameterList(node.params)) { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } else { + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } + } + } + + const rule = { + Program(node) { + const useStrictDirectives = getUseStrictDirectives(node.body); + + if (node.sourceType === "module") { + mode = "module"; + } + + if (mode === "global") { + if (node.body.length > 0 && useStrictDirectives.length === 0) { + context.report({ node, messageId: "global" }); + } + reportAllExceptFirst(useStrictDirectives, "multiple", true); + } else { + reportAll(useStrictDirectives, mode, shouldFix(mode)); + } + }, + FunctionDeclaration: enterFunction, + FunctionExpression: enterFunction, + ArrowFunctionExpression: enterFunction + }; + + if (mode === "function") { + Object.assign(rule, { + + // Inside of class bodies are always strict mode. + ClassBody() { + classScopes.push(true); + }, + "ClassBody:exit"() { + classScopes.pop(); + }, + + "FunctionDeclaration:exit": exitFunctionInFunctionMode, + "FunctionExpression:exit": exitFunctionInFunctionMode, + "ArrowFunctionExpression:exit": exitFunctionInFunctionMode + }); + } + + return rule; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/switch-colon-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/switch-colon-spacing.js new file mode 100644 index 0000000..c906415 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around colons of switch statements. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "enforce spacing around colons of switch statements", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/switch-colon-spacing" + }, + + schema: [ + { + type: "object", + properties: { + before: { type: "boolean", default: false }, + after: { type: "boolean", default: true } + }, + additionalProperties: false + } + ], + fixable: "whitespace", + messages: { + expectedBefore: "Expected space(s) before this colon.", + expectedAfter: "Expected space(s) after this colon.", + unexpectedBefore: "Unexpected space(s) before this colon.", + unexpectedAfter: "Unexpected space(s) after this colon." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const options = context.options[0] || {}; + const beforeSpacing = options.before === true; // false by default + const afterSpacing = options.after !== false; // true by default + + /** + * Get the colon token of the given SwitchCase node. + * @param {ASTNode} node The SwitchCase node to get. + * @returns {Token} The colon token of the node. + */ + function getColonToken(node) { + if (node.test) { + return sourceCode.getTokenAfter(node.test, astUtils.isColonToken); + } + return sourceCode.getFirstToken(node, 1); + } + + /** + * Check whether the spacing between the given 2 tokens is valid or not. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @param {boolean} expected The expected spacing to check. `true` if there should be a space. + * @returns {boolean} `true` if the spacing between the tokens is valid. + */ + function isValidSpacing(left, right, expected) { + return ( + astUtils.isClosingBraceToken(right) || + !astUtils.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === expected + ); + } + + /** + * Check whether comments exist between the given 2 tokens. + * @param {Token} left The left token to check. + * @param {Token} right The right token to check. + * @returns {boolean} `true` if comments exist between the given 2 tokens. + */ + function commentsExistBetween(left, right) { + return sourceCode.getFirstTokenBetween( + left, + right, + { + includeComments: true, + filter: astUtils.isCommentToken + } + ) !== null; + } + + /** + * Fix the spacing between the given 2 tokens. + * @param {RuleFixer} fixer The fixer to fix. + * @param {Token} left The left token of fix range. + * @param {Token} right The right token of fix range. + * @param {boolean} spacing The spacing style. `true` if there should be a space. + * @returns {Fix|null} The fix object. + */ + function fix(fixer, left, right, spacing) { + if (commentsExistBetween(left, right)) { + return null; + } + if (spacing) { + return fixer.insertTextAfter(left, " "); + } + return fixer.removeRange([left.range[1], right.range[0]]); + } + + return { + SwitchCase(node) { + const colonToken = getColonToken(node); + const beforeToken = sourceCode.getTokenBefore(colonToken); + const afterToken = sourceCode.getTokenAfter(colonToken); + + if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: beforeSpacing ? "expectedBefore" : "unexpectedBefore", + fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) + }); + } + if (!isValidSpacing(colonToken, afterToken, afterSpacing)) { + context.report({ + node, + loc: colonToken.loc, + messageId: afterSpacing ? "expectedAfter" : "unexpectedAfter", + fix: fixer => fix(fixer, colonToken, afterToken, afterSpacing) + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/symbol-description.js b/day1/cli-study/node_modules/eslint/lib/rules/symbol-description.js new file mode 100644 index 0000000..155cea4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/symbol-description.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Rule to enforce description with the `Symbol` object + * @author Jarek Rencz + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require symbol descriptions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/symbol-description" + }, + fixable: null, + schema: [], + messages: { + expected: "Expected Symbol to have a description." + } + }, + + create(context) { + + /** + * Reports if node does not conform the rule in case rule is set to + * report missing description + * @param {ASTNode} node A CallExpression node to check. + * @returns {void} + */ + function checkArgument(node) { + if (node.arguments.length === 0) { + context.report({ + node, + messageId: "expected" + }); + } + } + + return { + "Program:exit"() { + const scope = context.getScope(); + const variable = astUtils.getVariableByName(scope, "Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(reference => { + const node = reference.identifier; + + if (astUtils.isCallee(node)) { + checkArgument(node.parent); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/template-curly-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/template-curly-spacing.js new file mode 100644 index 0000000..26043bc --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,141 @@ +/** + * @fileoverview Rule to enforce spacing around embedded expressions of template strings + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around embedded expressions of template strings", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/template-curly-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + expectedBefore: "Expected space(s) before '}'.", + expectedAfter: "Expected space(s) after '${'.", + unexpectedBefore: "Unexpected space(s) before '}'.", + unexpectedAfter: "Unexpected space(s) after '${'." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + const always = context.options[0] === "always"; + + /** + * Checks spacing before `}` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingBefore(token) { + if (!token.value.startsWith("}")) { + return; // starts with a backtick, this is the first template element in the template literal + } + + const prevToken = sourceCode.getTokenBefore(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(prevToken, token); + + if (!astUtils.isTokenOnSameLine(prevToken, token)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: token.loc.start, + end: { + line: token.loc.start.line, + column: token.loc.start.column + 1 + } + }, + messageId: "expectedBefore", + fix: fixer => fixer.insertTextBefore(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: prevToken.loc.end, + end: token.loc.start + }, + messageId: "unexpectedBefore", + fix: fixer => fixer.removeRange([prevToken.range[1], token.range[0]]) + }); + } + } + + /** + * Checks spacing after `${` of a given token. + * @param {Token} token A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingAfter(token) { + if (!token.value.endsWith("${")) { + return; // ends with a backtick, this is the last template element in the template literal + } + + const nextToken = sourceCode.getTokenAfter(token, { includeComments: true }), + hasSpace = sourceCode.isSpaceBetween(token, nextToken); + + if (!astUtils.isTokenOnSameLine(token, nextToken)) { + return; + } + + if (always && !hasSpace) { + context.report({ + loc: { + start: { + line: token.loc.end.line, + column: token.loc.end.column - 2 + }, + end: token.loc.end + }, + messageId: "expectedAfter", + fix: fixer => fixer.insertTextAfter(token, " ") + }); + } + + if (!always && hasSpace) { + context.report({ + loc: { + start: token.loc.end, + end: nextToken.loc.start + }, + messageId: "unexpectedAfter", + fix: fixer => fixer.removeRange([token.range[1], nextToken.range[0]]) + }); + } + } + + return { + TemplateElement(node) { + const token = sourceCode.getFirstToken(node); + + checkSpacingBefore(token); + checkSpacingAfter(token); + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/template-tag-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/template-tag-spacing.js new file mode 100644 index 0000000..16f5862 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Rule to check spacing between template tags and their literals + * @author Jonathan Wilsson + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing between template tags and their literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/template-tag-spacing" + }, + + fixable: "whitespace", + + schema: [ + { enum: ["always", "never"] } + ], + messages: { + unexpected: "Unexpected space between template tag and template literal.", + missing: "Missing space between template tag and template literal." + } + }, + + create(context) { + const never = context.options[0] !== "always"; + const sourceCode = context.getSourceCode(); + + /** + * Check if a space is present between a template tag and its literal + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkSpacing(node) { + const tagToken = sourceCode.getTokenBefore(node.quasi); + const literalToken = sourceCode.getFirstToken(node.quasi); + const hasWhitespace = sourceCode.isSpaceBetweenTokens(tagToken, literalToken); + + if (never && hasWhitespace) { + context.report({ + node, + loc: { + start: tagToken.loc.end, + end: literalToken.loc.start + }, + messageId: "unexpected", + fix(fixer) { + const comments = sourceCode.getCommentsBefore(node.quasi); + + // Don't fix anything if there's a single line comment after the template tag + if (comments.some(comment => comment.type === "Line")) { + return null; + } + + return fixer.replaceTextRange( + [tagToken.range[1], literalToken.range[0]], + comments.reduce((text, comment) => text + sourceCode.getText(comment), "") + ); + } + }); + } else if (!never && !hasWhitespace) { + context.report({ + node, + loc: { + start: node.loc.start, + end: literalToken.loc.start + }, + messageId: "missing", + fix(fixer) { + return fixer.insertTextAfter(tagToken, " "); + } + }); + } + } + + return { + TaggedTemplateExpression: checkSpacing + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/unicode-bom.js b/day1/cli-study/node_modules/eslint/lib/rules/unicode-bom.js new file mode 100644 index 0000000..39642f8 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/unicode-bom.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Require or disallow Unicode BOM + * @author Andrew Johnston + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow Unicode byte order mark (BOM)", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/unicode-bom" + }, + + fixable: "whitespace", + + schema: [ + { + enum: ["always", "never"] + } + ], + messages: { + expected: "Expected Unicode BOM (Byte Order Mark).", + unexpected: "Unexpected Unicode BOM (Byte Order Mark)." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + Program: function checkUnicodeBOM(node) { + + const sourceCode = context.getSourceCode(), + location = { column: 0, line: 1 }, + requireBOM = context.options[0] || "never"; + + if (!sourceCode.hasBOM && (requireBOM === "always")) { + context.report({ + node, + loc: location, + messageId: "expected", + fix(fixer) { + return fixer.insertTextBeforeRange([0, 1], "\uFEFF"); + } + }); + } else if (sourceCode.hasBOM && (requireBOM === "never")) { + context.report({ + node, + loc: location, + messageId: "unexpected", + fix(fixer) { + return fixer.removeRange([-1, 0]); + } + }); + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/use-isnan.js b/day1/cli-study/node_modules/eslint/lib/rules/use-isnan.js new file mode 100644 index 0000000..7b466be --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/use-isnan.js @@ -0,0 +1,138 @@ +/** + * @fileoverview Rule to flag comparisons to the value NaN + * @author James Allardice + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determines if the given node is a NaN `Identifier` node. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is 'NaN' identifier. + */ +function isNaNIdentifier(node) { + return Boolean(node) && node.type === "Identifier" && node.name === "NaN"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "require calls to `isNaN()` when checking for `NaN`", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/use-isnan" + }, + + schema: [ + { + type: "object", + properties: { + enforceForSwitchCase: { + type: "boolean", + default: true + }, + enforceForIndexOf: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + messages: { + comparisonWithNaN: "Use the isNaN function to compare with NaN.", + switchNaN: "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", + caseNaN: "'case NaN' can never match. Use Number.isNaN before the switch.", + indexOfNaN: "Array prototype method '{{ methodName }}' cannot find NaN." + } + }, + + create(context) { + + const enforceForSwitchCase = !context.options[0] || context.options[0].enforceForSwitchCase; + const enforceForIndexOf = context.options[0] && context.options[0].enforceForIndexOf; + + /** + * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkBinaryExpression(node) { + if ( + /^(?:[<>]|[!=]=)=?$/u.test(node.operator) && + (isNaNIdentifier(node.left) || isNaNIdentifier(node.right)) + ) { + context.report({ node, messageId: "comparisonWithNaN" }); + } + } + + /** + * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:` + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkSwitchStatement(node) { + if (isNaNIdentifier(node.discriminant)) { + context.report({ node, messageId: "switchNaN" }); + } + + for (const switchCase of node.cases) { + if (isNaNIdentifier(switchCase.test)) { + context.report({ node: switchCase, messageId: "caseNaN" }); + } + } + } + + /** + * Checks the the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkCallExpression(node) { + const callee = node.callee; + + if (callee.type === "MemberExpression") { + const methodName = astUtils.getStaticPropertyName(callee); + + if ( + (methodName === "indexOf" || methodName === "lastIndexOf") && + node.arguments.length === 1 && + isNaNIdentifier(node.arguments[0]) + ) { + context.report({ node, messageId: "indexOfNaN", data: { methodName } }); + } + } + } + + const listeners = { + BinaryExpression: checkBinaryExpression + }; + + if (enforceForSwitchCase) { + listeners.SwitchStatement = checkSwitchStatement; + } + + if (enforceForIndexOf) { + listeners.CallExpression = checkCallExpression; + } + + return listeners; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/ast-utils.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/ast-utils.js new file mode 100644 index 0000000..ecea694 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -0,0 +1,1594 @@ +/** + * @fileoverview Common utils for AST. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const esutils = require("esutils"); +const espree = require("espree"); +const lodash = require("lodash"); +const { + breakableTypePattern, + createGlobalLinebreakMatcher, + lineBreakPattern, + shebangPattern +} = require("../../shared/ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; +const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; +const arrayOrTypedArrayPattern = /Array$/u; +const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/u; +const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u; +const thisTagPattern = /^[\s*]*@this/mu; + + +const COMMENTS_IGNORE_PATTERN = /^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u; +const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); + +// A set of node types that can contain a list of statements +const STATEMENT_LIST_PARENTS = new Set(["Program", "BlockStatement", "SwitchCase"]); + +const DECIMAL_INTEGER_PATTERN = /^(0|[1-9]\d*)$/u; +const OCTAL_ESCAPE_PATTERN = /^(?:[^\\]|\\[^0-7]|\\0(?![0-9]))*\\(?:[1-7]|0[0-9])/u; + +/** + * Checks reference if is non initializer and writable. + * @param {Reference} reference A reference to check. + * @param {int} index The index of the reference in the references. + * @param {Reference[]} references The array that the reference belongs to. + * @returns {boolean} Success/Failure + * @private + */ +function isModifyingReference(reference, index, references) { + const identifier = reference.identifier; + + /* + * Destructuring assignments can have multiple default value, so + * possibly there are multiple writeable references for the same + * identifier. + */ + const modifyingDifferentIdentifier = index === 0 || + references[index - 1].identifier !== identifier; + + return (identifier && + reference.init === false && + reference.isWrite() && + modifyingDifferentIdentifier + ); +} + +/** + * Checks whether the given string starts with uppercase or not. + * @param {string} s The string to check. + * @returns {boolean} `true` if the string starts with uppercase. + */ +function startsWithUpperCase(s) { + return s[0] !== s[0].toLocaleLowerCase(); +} + +/** + * Checks whether or not a node is a constructor. + * @param {ASTNode} node A function node to check. + * @returns {boolean} Wehether or not a node is a constructor. + */ +function isES5Constructor(node) { + return (node.id && startsWithUpperCase(node.id.name)); +} + +/** + * Finds a function node from ancestors of a node. + * @param {ASTNode} node A start node to find. + * @returns {Node|null} A found function node. + */ +function getUpperFunction(node) { + for (let currentNode = node; currentNode; currentNode = currentNode.parent) { + if (anyFunctionPattern.test(currentNode.type)) { + return currentNode; + } + } + return null; +} + +/** + * Checks whether a given node is a function node or not. + * The following types are function nodes: + * + * - ArrowFunctionExpression + * - FunctionDeclaration + * - FunctionExpression + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a function node. + */ +function isFunction(node) { + return Boolean(node && anyFunctionPattern.test(node.type)); +} + +/** + * Checks whether a given node is a loop node or not. + * The following types are loop nodes: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - WhileStatement + * @param {ASTNode|null} node A node to check. + * @returns {boolean} `true` if the node is a loop node. + */ +function isLoop(node) { + return Boolean(node && anyLoopPattern.test(node.type)); +} + +/** + * Checks whether the given node is in a loop or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is in a loop. + */ +function isInLoop(node) { + for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) { + if (isLoop(currentNode)) { + return true; + } + } + + return false; +} + +/** + * Checks whether or not a node is `null` or `undefined`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(node) { + return ( + module.exports.isNullLiteral(node) || + (node.type === "Identifier" && node.name === "undefined") || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Checks whether or not a node is callee. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is callee. + */ +function isCallee(node) { + return node.parent.type === "CallExpression" && node.parent.callee === node; +} + +/** + * Checks whether or not a node is `Reflect.apply`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Reflect.apply`. + */ +function isReflectApply(node) { + return ( + node.type === "MemberExpression" && + node.object.type === "Identifier" && + node.object.name === "Reflect" && + node.property.type === "Identifier" && + node.property.name === "apply" && + node.computed === false + ); +} + +/** + * Checks whether or not a node is `Array.from`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `Array.from`. + */ +function isArrayFromMethod(node) { + return ( + node.type === "MemberExpression" && + node.object.type === "Identifier" && + arrayOrTypedArrayPattern.test(node.object.name) && + node.property.type === "Identifier" && + node.property.name === "from" && + node.computed === false + ); +} + +/** + * Checks whether or not a node is a method which has `thisArg`. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a method which has `thisArg`. + */ +function isMethodWhichHasThisArg(node) { + for ( + let currentNode = node; + currentNode.type === "MemberExpression" && !currentNode.computed; + currentNode = currentNode.property + ) { + if (currentNode.property.type === "Identifier") { + return arrayMethodPattern.test(currentNode.property.name); + } + } + + return false; +} + +/** + * Creates the negate function of the given function. + * @param {Function} f The function to negate. + * @returns {Function} Negated function. + */ +function negate(f) { + return token => !f(token); +} + +/** + * Checks whether or not a node has a `@this` tag in its comments. + * @param {ASTNode} node A node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @returns {boolean} Whether or not the node has a `@this` tag in its comments. + */ +function hasJSDocThisTag(node, sourceCode) { + const jsdocComment = sourceCode.getJSDocComment(node); + + if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { + return true; + } + + // Checks `@this` in its leading comments for callbacks, + // because callbacks don't have its JSDoc comment. + // e.g. + // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); + return sourceCode.getCommentsBefore(node).some(comment => thisTagPattern.test(comment.value)); +} + +/** + * Determines if a node is surrounded by parentheses. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ +function isParenthesised(sourceCode, node) { + const previousToken = sourceCode.getTokenBefore(node), + nextToken = sourceCode.getTokenAfter(node); + + return Boolean(previousToken && nextToken) && + previousToken.value === "(" && previousToken.range[1] <= node.range[0] && + nextToken.value === ")" && nextToken.range[0] >= node.range[1]; +} + +/** + * Checks if the given token is an arrow token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an arrow token. + */ +function isArrowToken(token) { + return token.value === "=>" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comma token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comma token. + */ +function isCommaToken(token) { + return token.value === "," && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a dot token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a dot token. + */ +function isDotToken(token) { + return token.value === "." && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a semicolon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a semicolon token. + */ +function isSemicolonToken(token) { + return token.value === ";" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a colon token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a colon token. + */ +function isColonToken(token) { + return token.value === ":" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening parenthesis token. + */ +function isOpeningParenToken(token) { + return token.value === "(" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing parenthesis token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing parenthesis token. + */ +function isClosingParenToken(token) { + return token.value === ")" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening square bracket token. + */ +function isOpeningBracketToken(token) { + return token.value === "[" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing square bracket token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing square bracket token. + */ +function isClosingBracketToken(token) { + return token.value === "]" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is an opening brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is an opening brace token. + */ +function isOpeningBraceToken(token) { + return token.value === "{" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a closing brace token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a closing brace token. + */ +function isClosingBraceToken(token) { + return token.value === "}" && token.type === "Punctuator"; +} + +/** + * Checks if the given token is a comment token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a comment token. + */ +function isCommentToken(token) { + return token.type === "Line" || token.type === "Block" || token.type === "Shebang"; +} + +/** + * Checks if the given token is a keyword token or not. + * @param {Token} token The token to check. + * @returns {boolean} `true` if the token is a keyword token. + */ +function isKeywordToken(token) { + return token.type === "Keyword"; +} + +/** + * Gets the `(` token of the given function node. + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {Token} `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + return node.id + ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) + : sourceCode.getFirstToken(node, isOpeningParenToken); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left A node 1 to compare. + * @param {ASTNode} right A node 2 to compare. + * @param {SourceCode} sourceCode The ESLint source code object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, sourceCode) { + const tokensL = sourceCode.getTokens(left); + const tokensR = sourceCode.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (let i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Check if the given node is a true logical expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function rejects coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `&&` or `||`. + * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression + */ +function isLogicalExpression(node) { + return ( + node.type === "LogicalExpression" && + (node.operator === "&&" || node.operator === "||") + ); +} + +/** + * Check if the given node is a nullish coalescing expression or not. + * + * The three binary expressions logical-or (`||`), logical-and (`&&`), and + * coalesce (`??`) are known as `ShortCircuitExpression`. + * But ESTree represents those by `LogicalExpression` node. + * + * This function finds only coalesce expressions of `LogicalExpression` node. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is `??`. + */ +function isCoalesceExpression(node) { + return node.type === "LogicalExpression" && node.operator === "??"; +} + +/** + * Check if given two nodes are the pair of a logical expression and a coalesce expression. + * @param {ASTNode} left A node to check. + * @param {ASTNode} right Another node to check. + * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression. + */ +function isMixedLogicalAndCoalesceExpressions(left, right) { + return ( + (isLogicalExpression(left) && isCoalesceExpression(right)) || + (isCoalesceExpression(left) && isLogicalExpression(right)) + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + COMMENTS_IGNORE_PATTERN, + LINEBREAKS, + LINEBREAK_MATCHER: lineBreakPattern, + SHEBANG_MATCHER: shebangPattern, + STATEMENT_LIST_PARENTS, + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left The left token object. + * @param {Object} right The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + * @public + */ + isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + }, + + isNullOrUndefined, + isCallee, + isES5Constructor, + getUpperFunction, + isFunction, + isLoop, + isInLoop, + isArrayFromMethod, + isParenthesised, + createGlobalLinebreakMatcher, + equalTokens, + + isArrowToken, + isClosingBraceToken, + isClosingBracketToken, + isClosingParenToken, + isColonToken, + isCommaToken, + isCommentToken, + isDotToken, + isKeywordToken, + isNotClosingBraceToken: negate(isClosingBraceToken), + isNotClosingBracketToken: negate(isClosingBracketToken), + isNotClosingParenToken: negate(isClosingParenToken), + isNotColonToken: negate(isColonToken), + isNotCommaToken: negate(isCommaToken), + isNotDotToken: negate(isDotToken), + isNotOpeningBraceToken: negate(isOpeningBraceToken), + isNotOpeningBracketToken: negate(isOpeningBracketToken), + isNotOpeningParenToken: negate(isOpeningParenToken), + isNotSemicolonToken: negate(isSemicolonToken), + isOpeningBraceToken, + isOpeningBracketToken, + isOpeningParenToken, + isSemicolonToken, + + /** + * Checks whether or not a given node is a string literal. + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is a string literal. + */ + isStringLiteral(node) { + return ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ); + }, + + /** + * Checks whether a given node is a breakable statement or not. + * The node is breakable if the node is one of the following type: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - SwitchStatement + * - WhileStatement + * @param {ASTNode} node A node to check. + * @returns {boolean} `true` if the node is breakable. + */ + isBreakableStatement(node) { + return breakableTypePattern.test(node.type); + }, + + /** + * Gets references which are non initializer and writable. + * @param {Reference[]} references An array of references. + * @returns {Reference[]} An array of only references which are non initializer and writable. + * @public + */ + getModifyingReferences(references) { + return references.filter(isModifyingReference); + }, + + /** + * Validate that a string passed in is surrounded by the specified character + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. + * @returns {boolean} True if the text is surrounded by the character, false if not. + * @private + */ + isSurroundedBy(val, character) { + return val[0] === character && val[val.length - 1] === character; + }, + + /** + * Returns whether the provided node is an ESLint directive comment or not + * @param {Line|Block} node The comment token to be checked + * @returns {boolean} `true` if the node is an ESLint directive comment + */ + isDirectiveComment(node) { + const comment = node.value.trim(); + + return ( + node.type === "Line" && comment.indexOf("eslint-") === 0 || + node.type === "Block" && ( + comment.indexOf("global ") === 0 || + comment.indexOf("eslint ") === 0 || + comment.indexOf("eslint-") === 0 + ) + ); + }, + + /** + * Gets the trailing statement of a given node. + * + * if (code) + * consequent; + * + * When taking this `IfStatement`, returns `consequent;` statement. + * @param {ASTNode} A node to get. + * @returns {ASTNode|null} The trailing statement's node. + */ + getTrailingStatement: esutils.ast.trailingStatement, + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * @param {eslint-scope.Scope} initScope A scope to start find. + * @param {string} name A variable name to find. + * @returns {eslint-scope.Variable|null} A found variable or `null`. + */ + getVariableByName(initScope, name) { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + }, + + /** + * Checks whether or not a given function node is the default `this` binding. + * + * First, this checks the node: + * + * - The function name does not start with uppercase. It's a convention to capitalize the names + * of constructor functions. This check is not performed if `capIsConstructor` is set to `false`. + * - The function does not have a JSDoc comment that has a @this tag. + * + * Next, this checks the location of the node. + * If the location is below, this judges `this` is valid. + * + * - The location is not on an object literal. + * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous + * functions only, as the name of the variable is considered to be the name of the function in this case. + * This check is not performed if `capIsConstructor` is set to `false`. + * - The location is not on an ES2015 class. + * - Its `bind`/`call`/`apply` method is not called directly. + * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. + * @param {ASTNode} node A function node to check. + * @param {SourceCode} sourceCode A SourceCode instance to get comments. + * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts + * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors. + * @returns {boolean} The function node is the default `this` binding. + */ + isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) { + if ( + (capIsConstructor && isES5Constructor(node)) || + hasJSDocThisTag(node, sourceCode) + ) { + return false; + } + const isAnonymous = node.id === null; + let currentNode = node; + + while (currentNode) { + const parent = currentNode.parent; + + switch (parent.type) { + + /* + * Looks up the destination. + * e.g., obj.foo = nativeFoo || function foo() { ... }; + */ + case "LogicalExpression": + case "ConditionalExpression": + currentNode = parent; + break; + + /* + * If the upper function is IIFE, checks the destination of the return value. + * e.g. + * obj.foo = (function() { + * // setup... + * return function foo() { ... }; + * })(); + * obj.foo = (() => + * function foo() { ... } + * )(); + */ + case "ReturnStatement": { + const func = getUpperFunction(parent); + + if (func === null || !isCallee(func)) { + return true; + } + currentNode = func.parent; + break; + } + case "ArrowFunctionExpression": + if (currentNode !== parent.body || !isCallee(parent)) { + return true; + } + currentNode = parent.parent; + break; + + /* + * e.g. + * var obj = { foo() { ... } }; + * var obj = { foo: function() { ... } }; + * class A { constructor() { ... } } + * class A { foo() { ... } } + * class A { get foo() { ... } } + * class A { set foo() { ... } } + * class A { static foo() { ... } } + */ + case "Property": + case "MethodDefinition": + return parent.value !== currentNode; + + /* + * e.g. + * obj.foo = function foo() { ... }; + * Foo = function() { ... }; + * [obj.foo = function foo() { ... }] = a; + * [Foo = function() { ... }] = a; + */ + case "AssignmentExpression": + case "AssignmentPattern": + if (parent.left.type === "MemberExpression") { + return false; + } + if ( + capIsConstructor && + isAnonymous && + parent.left.type === "Identifier" && + startsWithUpperCase(parent.left.name) + ) { + return false; + } + return true; + + /* + * e.g. + * var Foo = function() { ... }; + */ + case "VariableDeclarator": + return !( + capIsConstructor && + isAnonymous && + parent.init === currentNode && + parent.id.type === "Identifier" && + startsWithUpperCase(parent.id.name) + ); + + /* + * e.g. + * var foo = function foo() { ... }.bind(obj); + * (function foo() { ... }).call(obj); + * (function foo() { ... }).apply(obj, []); + */ + case "MemberExpression": + return ( + parent.object !== currentNode || + parent.property.type !== "Identifier" || + !bindOrCallOrApplyPattern.test(parent.property.name) || + !isCallee(parent) || + parent.parent.arguments.length === 0 || + isNullOrUndefined(parent.parent.arguments[0]) + ); + + /* + * e.g. + * Reflect.apply(function() {}, obj, []); + * Array.from([], function() {}, obj); + * list.forEach(function() {}, obj); + */ + case "CallExpression": + if (isReflectApply(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + if (isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[1] !== currentNode || + isNullOrUndefined(parent.arguments[2]) + ); + } + if (isMethodWhichHasThisArg(parent.callee)) { + return ( + parent.arguments.length !== 2 || + parent.arguments[0] !== currentNode || + isNullOrUndefined(parent.arguments[1]) + ); + } + return true; + + // Otherwise `this` is default. + default: + return true; + } + } + + /* istanbul ignore next */ + return true; + }, + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ + getPrecedence(node) { + switch (node.type) { + case "SequenceExpression": + return 0; + + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "YieldExpression": + return 1; + + case "ConditionalExpression": + return 3; + + case "LogicalExpression": + switch (node.operator) { + case "||": + case "??": + return 4; + case "&&": + return 5; + + // no default + } + + /* falls through */ + + case "BinaryExpression": + + switch (node.operator) { + case "|": + return 6; + case "^": + return 7; + case "&": + return 8; + case "==": + case "!=": + case "===": + case "!==": + return 9; + case "<": + case "<=": + case ">": + case ">=": + case "in": + case "instanceof": + return 10; + case "<<": + case ">>": + case ">>>": + return 11; + case "+": + case "-": + return 12; + case "*": + case "/": + case "%": + return 13; + case "**": + return 15; + + // no default + } + + /* falls through */ + + case "UnaryExpression": + case "AwaitExpression": + return 16; + + case "UpdateExpression": + return 17; + + case "CallExpression": + case "ImportExpression": + return 18; + + case "NewExpression": + return 19; + + default: + return 20; + } + }, + + /** + * Checks whether the given node is an empty block node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty block. + */ + isEmptyBlock(node) { + return Boolean(node && node.type === "BlockStatement" && node.body.length === 0); + }, + + /** + * Checks whether the given node is an empty function node or not. + * @param {ASTNode|null} node The node to check. + * @returns {boolean} `true` if the node is an empty function. + */ + isEmptyFunction(node) { + return isFunction(node) && module.exports.isEmptyBlock(node.body); + }, + + /** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param {ASTNode} node Expression node. + * @returns {string|null} String value if it can be determined. Otherwise, `null`. + */ + getStaticStringValue(node) { + switch (node.type) { + case "Literal": + if (node.value === null) { + if (module.exports.isNullLiteral(node)) { + return String(node.value); // "null" + } + if (node.regex) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if (node.bigint) { + return node.bigint; + } + + // Otherwise, this is an unknown literal. The function will return null. + + } else { + return String(node.value); + } + break; + case "TemplateLiteral": + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + + // no default + } + + return null; + }, + + /** + * Gets the property name of a given node. + * The node can be a MemberExpression, a Property, or a MethodDefinition. + * + * If the name is dynamic, this returns `null`. + * + * For examples: + * + * a.b // => "b" + * a["b"] // => "b" + * a['b'] // => "b" + * a[`b`] // => "b" + * a[100] // => "100" + * a[b] // => null + * a["a" + "b"] // => null + * a[tag`b`] // => null + * a[`${b}`] // => null + * + * let a = {b: 1} // => "b" + * let a = {["b"]: 1} // => "b" + * let a = {['b']: 1} // => "b" + * let a = {[`b`]: 1} // => "b" + * let a = {[100]: 1} // => "100" + * let a = {[b]: 1} // => null + * let a = {["a" + "b"]: 1} // => null + * let a = {[tag`b`]: 1} // => null + * let a = {[`${b}`]: 1} // => null + * @param {ASTNode} node The node to get. + * @returns {string|null} The property name if static. Otherwise, null. + */ + getStaticPropertyName(node) { + let prop; + + switch (node && node.type) { + case "Property": + case "MethodDefinition": + prop = node.key; + break; + + case "MemberExpression": + prop = node.property; + break; + + // no default + } + + if (prop) { + if (prop.type === "Identifier" && !node.computed) { + return prop.name; + } + + return module.exports.getStaticStringValue(prop); + } + + return null; + }, + + /** + * Get directives from directive prologue of a Program or Function node. + * @param {ASTNode} node The node to check. + * @returns {ASTNode[]} The directives found in the directive prologue. + */ + getDirectivePrologue(node) { + const directives = []; + + // Directive prologues only occur at the top of files or functions. + if ( + node.type === "Program" || + node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + + /* + * Do not check arrow functions with implicit return. + * `() => "use strict";` returns the string `"use strict"`. + */ + (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") + ) { + const statements = node.type === "Program" ? node.body : node.body.body; + + for (const statement of statements) { + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" + ) { + directives.push(statement); + } else { + break; + } + } + } + + return directives; + }, + + + /** + * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added + * after the node will be parsed as a decimal point, rather than a property-access dot. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if this node is a decimal integer. + * @example + * + * 5 // true + * 5. // false + * 5.0 // false + * 05 // false + * 0x5 // false + * 0b101 // false + * 0o5 // false + * 5e0 // false + * '5' // false + * 5n // false + */ + isDecimalInteger(node) { + return node.type === "Literal" && typeof node.value === "number" && + DECIMAL_INTEGER_PATTERN.test(node.raw); + }, + + /** + * Determines whether this token is a decimal integer numeric token. + * This is similar to isDecimalInteger(), but for tokens. + * @param {Token} token The token to check. + * @returns {boolean} `true` if this token is a decimal integer. + */ + isDecimalIntegerNumericToken(token) { + return token.type === "Numeric" && DECIMAL_INTEGER_PATTERN.test(token.value); + }, + + /** + * Gets the name and kind of the given function node. + * + * - `function foo() {}` .................... `function 'foo'` + * - `(function foo() {})` .................. `function 'foo'` + * - `(function() {})` ...................... `function` + * - `function* foo() {}` ................... `generator function 'foo'` + * - `(function* foo() {})` ................. `generator function 'foo'` + * - `(function*() {})` ..................... `generator function` + * - `() => {}` ............................. `arrow function` + * - `async () => {}` ....................... `async arrow function` + * - `({ foo: function foo() {} })` ......... `method 'foo'` + * - `({ foo: function() {} })` ............. `method 'foo'` + * - `({ ['foo']: function() {} })` ......... `method 'foo'` + * - `({ [foo]: function() {} })` ........... `method` + * - `({ foo() {} })` ....................... `method 'foo'` + * - `({ foo: function* foo() {} })` ........ `generator method 'foo'` + * - `({ foo: function*() {} })` ............ `generator method 'foo'` + * - `({ ['foo']: function*() {} })` ........ `generator method 'foo'` + * - `({ [foo]: function*() {} })` .......... `generator method` + * - `({ *foo() {} })` ...................... `generator method 'foo'` + * - `({ foo: async function foo() {} })` ... `async method 'foo'` + * - `({ foo: async function() {} })` ....... `async method 'foo'` + * - `({ ['foo']: async function() {} })` ... `async method 'foo'` + * - `({ [foo]: async function() {} })` ..... `async method` + * - `({ async foo() {} })` ................. `async method 'foo'` + * - `({ get foo() {} })` ................... `getter 'foo'` + * - `({ set foo(a) {} })` .................. `setter 'foo'` + * - `class A { constructor() {} }` ......... `constructor` + * - `class A { foo() {} }` ................. `method 'foo'` + * - `class A { *foo() {} }` ................ `generator method 'foo'` + * - `class A { async foo() {} }` ........... `async method 'foo'` + * - `class A { ['foo']() {} }` ............. `method 'foo'` + * - `class A { *['foo']() {} }` ............ `generator method 'foo'` + * - `class A { async ['foo']() {} }` ....... `async method 'foo'` + * - `class A { [foo]() {} }` ............... `method` + * - `class A { *[foo]() {} }` .............. `generator method` + * - `class A { async [foo]() {} }` ......... `async method` + * - `class A { get foo() {} }` ............. `getter 'foo'` + * - `class A { set foo(a) {} }` ............ `setter 'foo'` + * - `class A { static foo() {} }` .......... `static method 'foo'` + * - `class A { static *foo() {} }` ......... `static generator method 'foo'` + * - `class A { static async foo() {} }` .... `static async method 'foo'` + * - `class A { static get foo() {} }` ...... `static getter 'foo'` + * - `class A { static set foo(a) {} }` ..... `static setter 'foo'` + * @param {ASTNode} node The function node to get. + * @returns {string} The name and kind of the function node. + */ + getFunctionNameWithKind(node) { + const parent = node.parent; + const tokens = []; + + if (parent.type === "MethodDefinition" && parent.static) { + tokens.push("static"); + } + if (node.async) { + tokens.push("async"); + } + if (node.generator) { + tokens.push("generator"); + } + + if (node.type === "ArrowFunctionExpression") { + tokens.push("arrow", "function"); + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + if (parent.kind === "constructor") { + return "constructor"; + } + if (parent.kind === "get") { + tokens.push("getter"); + } else if (parent.kind === "set") { + tokens.push("setter"); + } else { + tokens.push("method"); + } + } else { + tokens.push("function"); + } + + if (node.id) { + tokens.push(`'${node.id.name}'`); + } else { + const name = module.exports.getStaticPropertyName(parent); + + if (name !== null) { + tokens.push(`'${name}'`); + } + } + + return tokens.join(" "); + }, + + /** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * @param {ASTNode} node The function node to get. + * @param {SourceCode} sourceCode The source code object to get tokens. + * @returns {string} The location of the function node for reporting. + */ + getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start = null; + let end = null; + + if (node.type === "ArrowFunctionExpression") { + const arrowToken = sourceCode.getTokenBefore(node.body, isArrowToken); + + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } else if (parent.type === "Property" || parent.type === "MethodDefinition") { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + + return { + start: Object.assign({}, start), + end: Object.assign({}, end) + }; + }, + + /** + * Gets next location when the result is not out of bound, otherwise returns null. + * + * Assumptions: + * + * - The given location represents a valid location in the given source code. + * - Columns are 0-based. + * - Lines are 1-based. + * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location. + * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end. + * The start (column 0) of that extra line is considered to be a valid location. + * + * Examples of successive locations (line, column): + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: foo + * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: ab + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null + * + * code: a + * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null + * + * code: + * locations: (1, 0) -> (2, 0) -> null + * + * code: + * locations: (1, 0) -> null + * @param {SourceCode} sourceCode The sourceCode + * @param {{line: number, column: number}} location The location + * @returns {{line: number, column: number} | null} Next location + */ + getNextLocation(sourceCode, { line, column }) { + if (column < sourceCode.lines[line - 1].length) { + return { + line, + column: column + 1 + }; + } + + if (line < sourceCode.lines.length) { + return { + line: line + 1, + column: 0 + }; + } + + return null; + }, + + /** + * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses + * surrounding the node. + * @param {SourceCode} sourceCode The source code object + * @param {ASTNode} node An expression node + * @returns {string} The text representing the node, with all surrounding parentheses included + */ + getParenthesisedText(sourceCode, node) { + let leftToken = sourceCode.getFirstToken(node); + let rightToken = sourceCode.getLastToken(node); + + while ( + sourceCode.getTokenBefore(leftToken) && + sourceCode.getTokenBefore(leftToken).type === "Punctuator" && + sourceCode.getTokenBefore(leftToken).value === "(" && + sourceCode.getTokenAfter(rightToken) && + sourceCode.getTokenAfter(rightToken).type === "Punctuator" && + sourceCode.getTokenAfter(rightToken).value === ")" + ) { + leftToken = sourceCode.getTokenBefore(leftToken); + rightToken = sourceCode.getTokenAfter(rightToken); + } + + return sourceCode.getText().slice(leftToken.range[0], rightToken.range[1]); + }, + + /* + * Determine if a node has a possiblity to be an Error object + * @param {ASTNode} node ASTNode to check + * @returns {boolean} True if there is a chance it contains an Error obj + */ + couldBeError(node) { + switch (node.type) { + case "Identifier": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + case "AwaitExpression": + return true; // possibly an error object. + + case "AssignmentExpression": + return module.exports.couldBeError(node.right); + + case "SequenceExpression": { + const exprs = node.expressions; + + return exprs.length !== 0 && module.exports.couldBeError(exprs[exprs.length - 1]); + } + + case "LogicalExpression": + return module.exports.couldBeError(node.left) || module.exports.couldBeError(node.right); + + case "ConditionalExpression": + return module.exports.couldBeError(node.consequent) || module.exports.couldBeError(node.alternate); + + default: + return false; + } + }, + + /** + * Determines whether the given node is a `null` literal. + * @param {ASTNode} node The node to check + * @returns {boolean} `true` if the node is a `null` literal + */ + isNullLiteral(node) { + + /* + * Checking `node.value === null` does not guarantee that a literal is a null literal. + * When parsing values that cannot be represented in the current environment (e.g. unicode + * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to + * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check + * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020 + */ + return node.type === "Literal" && node.value === null && !node.regex && !node.bigint; + }, + + /** + * Check if a given node is a numeric literal or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a number or bigint literal. + */ + isNumericLiteral(node) { + return ( + node.type === "Literal" && + (typeof node.value === "number" || Boolean(node.bigint)) + ); + }, + + /** + * Determines whether two tokens can safely be placed next to each other without merging into a single token + * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used. + * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used. + * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed + * next to each other, behavior is undefined (although it should return `true` in most cases). + */ + canTokensBeAdjacent(leftValue, rightValue) { + const espreeOptions = { + ecmaVersion: espree.latestEcmaVersion, + comment: true, + range: true + }; + + let leftToken; + + if (typeof leftValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(leftValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + leftToken = tokens[tokens.length - 1]; + if (comments.length) { + const lastComment = comments[comments.length - 1]; + + if (lastComment.range[0] > leftToken.range[0]) { + leftToken = lastComment; + } + } + } else { + leftToken = leftValue; + } + + if (leftToken.type === "Shebang") { + return false; + } + + let rightToken; + + if (typeof rightValue === "string") { + let tokens; + + try { + tokens = espree.tokenize(rightValue, espreeOptions); + } catch { + return false; + } + + const comments = tokens.comments; + + rightToken = tokens[0]; + if (comments.length) { + const firstComment = comments[0]; + + if (firstComment.range[0] < rightToken.range[0]) { + rightToken = firstComment; + } + } + } else { + rightToken = rightValue; + } + + if (leftToken.type === "Punctuator" || rightToken.type === "Punctuator") { + if (leftToken.type === "Punctuator" && rightToken.type === "Punctuator") { + const PLUS_TOKENS = new Set(["+", "++"]); + const MINUS_TOKENS = new Set(["-", "--"]); + + return !( + PLUS_TOKENS.has(leftToken.value) && PLUS_TOKENS.has(rightToken.value) || + MINUS_TOKENS.has(leftToken.value) && MINUS_TOKENS.has(rightToken.value) + ); + } + if (leftToken.type === "Punctuator" && leftToken.value === "/") { + return !["Block", "Line", "RegularExpression"].includes(rightToken.type); + } + return true; + } + + if ( + leftToken.type === "String" || rightToken.type === "String" || + leftToken.type === "Template" || rightToken.type === "Template" + ) { + return true; + } + + if (leftToken.type !== "Numeric" && rightToken.type === "Numeric" && rightToken.value.startsWith(".")) { + return true; + } + + if (leftToken.type === "Block" || rightToken.type === "Block" || rightToken.type === "Line") { + return true; + } + + return false; + }, + + /** + * Get the `loc` object of a given name in a `/*globals` directive comment. + * @param {SourceCode} sourceCode The source code to convert index to loc. + * @param {Comment} comment The `/*globals` directive comment which include the name. + * @param {string} name The name to find. + * @returns {SourceLocation} The `loc` object. + */ + getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${lodash.escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; + + // Search a given variable name. + const match = namePattern.exec(comment.value); + + // Convert the index to loc. + const start = sourceCode.getLocFromIndex( + comment.range[0] + + "/*".length + + (match ? match.index + 1 : 0) + ); + const end = { + line: start.line, + column: start.column + (match ? name.length : 1) + }; + + return { start, end }; + }, + + /** + * Determines whether the given raw string contains an octal escape sequence. + * + * "\1", "\2" ... "\7" + * "\00", "\01" ... "\09" + * + * "\0", when not followed by a digit, is not an octal escape sequence. + * @param {string} rawString A string in its raw representation. + * @returns {boolean} `true` if the string contains at least one octal escape sequence. + */ + hasOctalEscapeSequence(rawString) { + return OCTAL_ESCAPE_PATTERN.test(rawString); + }, + + isLogicalExpression, + isCoalesceExpression, + isMixedLogicalAndCoalesceExpressions +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/fix-tracker.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/fix-tracker.js new file mode 100644 index 0000000..589870b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/fix-tracker.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Helper class to aid in constructing fix commands. + * @author Alan Pierce + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./ast-utils"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * A helper class to combine fix options into a fix command. Currently, it + * exposes some "retain" methods that extend the range of the text being + * replaced so that other fixes won't touch that region in the same pass. + */ +class FixTracker { + + /** + * Create a new FixTracker. + * @param {ruleFixer} fixer A ruleFixer instance. + * @param {SourceCode} sourceCode A SourceCode object for the current code. + */ + constructor(fixer, sourceCode) { + this.fixer = fixer; + this.sourceCode = sourceCode; + this.retainedRange = null; + } + + /** + * Mark the given range as "retained", meaning that other fixes may not + * may not modify this region in the same pass. + * @param {int[]} range The range to retain. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainRange(range) { + this.retainedRange = range; + return this; + } + + /** + * Given a node, find the function containing it (or the entire program) and + * mark it as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that modify control + * flow. + * @param {ASTNode} node The node to use as a starting point. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainEnclosingFunction(node) { + const functionNode = astUtils.getUpperFunction(node); + + return this.retainRange(functionNode ? functionNode.range : this.sourceCode.ast.range); + } + + /** + * Given a node or token, find the token before and afterward, and mark that + * range as retained, meaning that other fixes may not modify it in this + * pass. This is useful for avoiding conflicts in fixes that make a small + * change to the code where the AST should not be changed. + * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting + * point. The token to the left and right are use in the range. + * @returns {FixTracker} The same RuleFixer, for chained calls. + */ + retainSurroundingTokens(nodeOrToken) { + const tokenBefore = this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken; + const tokenAfter = this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken; + + return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]); + } + + /** + * Create a fix command that replaces the given range with the given text, + * accounting for any retained ranges. + * @param {int[]} range The range to remove in the fix. + * @param {string} text The text to insert in place of the range. + * @returns {Object} The fix command. + */ + replaceTextRange(range, text) { + let actualRange; + + if (this.retainedRange) { + actualRange = [ + Math.min(this.retainedRange[0], range[0]), + Math.max(this.retainedRange[1], range[1]) + ]; + } else { + actualRange = range; + } + + return this.fixer.replaceTextRange( + actualRange, + this.sourceCode.text.slice(actualRange[0], range[0]) + + text + + this.sourceCode.text.slice(range[1], actualRange[1]) + ); + } + + /** + * Create a fix command that removes the given node or token, accounting for + * any retained ranges. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove(nodeOrToken) { + return this.replaceTextRange(nodeOrToken.range, ""); + } +} + +module.exports = FixTracker; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/keywords.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/keywords.js new file mode 100644 index 0000000..3fbb777 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/keywords.js @@ -0,0 +1,67 @@ +/** + * @fileoverview A shared list of ES3 keywords. + * @author Josh Perez + */ +"use strict"; + +module.exports = [ + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with" +]; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js new file mode 100644 index 0000000..d426d85 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js @@ -0,0 +1,115 @@ +/** + * @fileoverview `Map` to load rules lazily. + * @author Toru Nagashima + */ +"use strict"; + +const debug = require("debug")("eslint:rules"); + +/** @typedef {import("./types").Rule} Rule */ + +/** + * The `Map` object that loads each rule when it's accessed. + * @example + * const rules = new LazyLoadingRuleMap([ + * ["eqeqeq", () => require("eqeqeq")], + * ["semi", () => require("semi")], + * ["no-unused-vars", () => require("no-unused-vars")], + * ]) + * + * rules.get("semi") // call `() => require("semi")` here. + * + * @extends {Map Rule>} + */ +class LazyLoadingRuleMap extends Map { + + /** + * Initialize this map. + * @param {Array<[string, function(): Rule]>} loaders The rule loaders. + */ + constructor(loaders) { + let remaining = loaders.length; + + super( + debug.enabled + ? loaders.map(([ruleId, load]) => { + let cache = null; + + return [ + ruleId, + () => { + if (!cache) { + debug("Loading rule %o (remaining=%d)", ruleId, --remaining); + cache = load(); + } + return cache; + } + ]; + }) + : loaders + ); + + // `super(...iterable)` uses `this.set()`, so disable it here. + Object.defineProperty(LazyLoadingRuleMap.prototype, "set", { + configurable: true, + value: void 0 + }); + } + + /** + * Get a rule. + * Each rule will be loaded on the first access. + * @param {string} ruleId The rule ID to get. + * @returns {Rule|undefined} The rule. + */ + get(ruleId) { + const load = super.get(ruleId); + + return load && load(); + } + + /** + * Iterate rules. + * @returns {IterableIterator} Rules. + */ + *values() { + for (const load of super.values()) { + yield load(); + } + } + + /** + * Iterate rules. + * @returns {IterableIterator<[string, Rule]>} Rules. + */ + *entries() { + for (const [ruleId, load] of super.entries()) { + yield [ruleId, load()]; + } + } + + /** + * Call a function with each rule. + * @param {Function} callbackFn The callback function. + * @param {any} [thisArg] The object to pass to `this` of the callback function. + * @returns {void} + */ + forEach(callbackFn, thisArg) { + for (const [ruleId, load] of super.entries()) { + callbackFn.call(thisArg, load(), ruleId, this); + } + } +} + +// Forbid mutation. +Object.defineProperties(LazyLoadingRuleMap.prototype, { + clear: { configurable: true, value: void 0 }, + delete: { configurable: true, value: void 0 }, + [Symbol.iterator]: { + configurable: true, + writable: true, + value: LazyLoadingRuleMap.prototype.entries + } +}); + +module.exports = { LazyLoadingRuleMap }; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/patterns/letters.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/patterns/letters.js new file mode 100644 index 0000000..9bb2de3 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/patterns/letters.js @@ -0,0 +1,36 @@ +/** + * @fileoverview Pattern for detecting any letter (even letters outside of ASCII). + * NOTE: This file was generated using this script in JSCS based on the Unicode 7.0.0 standard: https://github.com/jscs-dev/node-jscs/blob/f5ed14427deb7e7aac84f3056a5aab2d9f3e563e/publish/helpers/generate-patterns.js + * Do not edit this file by hand-- please use https://github.com/mathiasbynens/regenerate to regenerate the regular expression exported from this file. + * @author Kevin Partington + * @license MIT License (from JSCS). See below. + */ + +/* + * The MIT License (MIT) + * + * Copyright 2013-2016 Dulin Marat and other contributors + * + * 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. + */ + +"use strict"; + +module.exports = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/u; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/index.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/index.js new file mode 100644 index 0000000..02eea50 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/index.js @@ -0,0 +1,11 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +module.exports = { + isCombiningCharacter: require("./is-combining-character"), + isEmojiModifier: require("./is-emoji-modifier"), + isRegionalIndicatorSymbol: require("./is-regional-indicator-symbol"), + isSurrogatePair: require("./is-surrogate-pair") +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js new file mode 100644 index 0000000..0498b99 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a combining mark or not. + * @param {number} codePoint The character code to check. + * @returns {boolean} `true` if the character belongs to the category, any of `Mc`, `Me`, and `Mn`. + */ +module.exports = function isCombiningCharacter(codePoint) { + return /^[\p{Mc}\p{Me}\p{Mn}]$/u.test(String.fromCodePoint(codePoint)); +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js new file mode 100644 index 0000000..1bd5f55 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is an emoji modifier. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is an emoji modifier. + */ +module.exports = function isEmojiModifier(code) { + return code >= 0x1F3FB && code <= 0x1F3FF; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js new file mode 100644 index 0000000..c48ed46 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js @@ -0,0 +1,13 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether a given character is a regional indicator symbol. + * @param {number} code The character code to check. + * @returns {boolean} `true` if the character is a regional indicator symbol. + */ +module.exports = function isRegionalIndicatorSymbol(code) { + return code >= 0x1F1E6 && code <= 0x1F1FF; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js new file mode 100644 index 0000000..b8e5c1c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js @@ -0,0 +1,14 @@ +/** + * @author Toru Nagashima + */ +"use strict"; + +/** + * Check whether given two characters are a surrogate pair. + * @param {number} lead The code of the lead character. + * @param {number} tail The code of the tail character. + * @returns {boolean} `true` if the character pair is a surrogate pair. + */ +module.exports = function isSurrogatePair(lead, tail) { + return lead >= 0xD800 && lead < 0xDC00 && tail >= 0xDC00 && tail < 0xE000; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/valid-jsdoc.js b/day1/cli-study/node_modules/eslint/lib/rules/valid-jsdoc.js new file mode 100644 index 0000000..9ec6938 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -0,0 +1,515 @@ +/** + * @fileoverview Validates JSDoc comments are syntactically correct + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const doctrine = require("doctrine"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "enforce valid JSDoc comments", + category: "Possible Errors", + recommended: false, + url: "https://eslint.org/docs/rules/valid-jsdoc" + }, + + schema: [ + { + type: "object", + properties: { + prefer: { + type: "object", + additionalProperties: { + type: "string" + } + }, + preferType: { + type: "object", + additionalProperties: { + type: "string" + } + }, + requireReturn: { + type: "boolean", + default: true + }, + requireParamDescription: { + type: "boolean", + default: true + }, + requireReturnDescription: { + type: "boolean", + default: true + }, + matchDescription: { + type: "string" + }, + requireReturnType: { + type: "boolean", + default: true + }, + requireParamType: { + type: "boolean", + default: true + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + unexpectedTag: "Unexpected @{{title}} tag; function has no return statement.", + expected: "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", + use: "Use @{{name}} instead.", + useType: "Use '{{expectedTypeName}}' instead of '{{currentTypeName}}'.", + syntaxError: "JSDoc syntax error.", + missingBrace: "JSDoc type missing brace.", + missingParamDesc: "Missing JSDoc parameter description for '{{name}}'.", + missingParamType: "Missing JSDoc parameter type for '{{name}}'.", + missingReturnType: "Missing JSDoc return type.", + missingReturnDesc: "Missing JSDoc return description.", + missingReturn: "Missing JSDoc @{{returns}} for function.", + missingParam: "Missing JSDoc for parameter '{{name}}'.", + duplicateParam: "Duplicate JSDoc parameter '{{name}}'.", + unsatisfiedDesc: "JSDoc description does not satisfy the regex pattern." + }, + + deprecated: true, + replacedBy: [] + }, + + create(context) { + + const options = context.options[0] || {}, + prefer = options.prefer || {}, + sourceCode = context.getSourceCode(), + + // these both default to true, so you have to explicitly make them false + requireReturn = options.requireReturn !== false, + requireParamDescription = options.requireParamDescription !== false, + requireReturnDescription = options.requireReturnDescription !== false, + requireReturnType = options.requireReturnType !== false, + requireParamType = options.requireParamType !== false, + preferType = options.preferType || {}, + checkPreferType = Object.keys(preferType).length !== 0; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // Using a stack to store if a function returns or not (handling nested functions) + const fns = []; + + /** + * Check if node type is a Class + * @param {ASTNode} node node to check. + * @returns {boolean} True is its a class + * @private + */ + function isTypeClass(node) { + return node.type === "ClassExpression" || node.type === "ClassDeclaration"; + } + + /** + * When parsing a new function, store it in our function stack. + * @param {ASTNode} node A function node to check. + * @returns {void} + * @private + */ + function startFunction(node) { + fns.push({ + returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") || + isTypeClass(node) || node.async + }); + } + + /** + * Indicate that return has been found in the current function. + * @param {ASTNode} node The return node. + * @returns {void} + * @private + */ + function addReturn(node) { + const functionState = fns[fns.length - 1]; + + if (functionState && node.argument !== null) { + functionState.returnPresent = true; + } + } + + /** + * Check if return tag type is void or undefined + * @param {Object} tag JSDoc tag + * @returns {boolean} True if its of type void or undefined + * @private + */ + function isValidReturnType(tag) { + return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral"; + } + + /** + * Check if type should be validated based on some exceptions + * @param {Object} type JSDoc tag + * @returns {boolean} True if it can be validated + * @private + */ + function canTypeBeValidated(type) { + return type !== "UndefinedLiteral" && // {undefined} as there is no name property available. + type !== "NullLiteral" && // {null} + type !== "NullableLiteral" && // {?} + type !== "FunctionType" && // {function(a)} + type !== "AllLiteral"; // {*} + } + + /** + * Extract the current and expected type based on the input type object + * @param {Object} type JSDoc tag + * @returns {{currentType: Doctrine.Type, expectedTypeName: string}} The current type annotation and + * the expected name of the annotation + * @private + */ + function getCurrentExpectedTypes(type) { + let currentType; + + if (type.name) { + currentType = type; + } else if (type.expression) { + currentType = type.expression; + } + + return { + currentType, + expectedTypeName: currentType && preferType[currentType.name] + }; + } + + /** + * Gets the location of a JSDoc node in a file + * @param {Token} jsdocComment The comment that this node is parsed from + * @param {{range: number[]}} parsedJsdocNode A tag or other node which was parsed from this comment + * @returns {{start: SourceLocation, end: SourceLocation}} The 0-based source location for the tag + */ + function getAbsoluteRange(jsdocComment, parsedJsdocNode) { + return { + start: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[0]), + end: sourceCode.getLocFromIndex(jsdocComment.range[0] + 2 + parsedJsdocNode.range[1]) + }; + } + + /** + * Validate type for a given JSDoc node + * @param {Object} jsdocNode JSDoc node + * @param {Object} type JSDoc tag + * @returns {void} + * @private + */ + function validateType(jsdocNode, type) { + if (!type || !canTypeBeValidated(type.type)) { + return; + } + + const typesToCheck = []; + let elements = []; + + switch (type.type) { + case "TypeApplication": // {Array.} + elements = type.applications[0].type === "UnionType" ? type.applications[0].elements : type.applications; + typesToCheck.push(getCurrentExpectedTypes(type)); + break; + case "RecordType": // {{20:String}} + elements = type.fields; + break; + case "UnionType": // {String|number|Test} + case "ArrayType": // {[String, number, Test]} + elements = type.elements; + break; + case "FieldType": // Array.<{count: number, votes: number}> + if (type.value) { + typesToCheck.push(getCurrentExpectedTypes(type.value)); + } + break; + default: + typesToCheck.push(getCurrentExpectedTypes(type)); + } + + elements.forEach(validateType.bind(null, jsdocNode)); + + typesToCheck.forEach(typeToCheck => { + if (typeToCheck.expectedTypeName && + typeToCheck.expectedTypeName !== typeToCheck.currentType.name) { + context.report({ + node: jsdocNode, + messageId: "useType", + loc: getAbsoluteRange(jsdocNode, typeToCheck.currentType), + data: { + currentTypeName: typeToCheck.currentType.name, + expectedTypeName: typeToCheck.expectedTypeName + }, + fix(fixer) { + return fixer.replaceTextRange( + typeToCheck.currentType.range.map(indexInComment => jsdocNode.range[0] + 2 + indexInComment), + typeToCheck.expectedTypeName + ); + } + }); + } + }); + } + + /** + * Validate the JSDoc node and output warnings if anything is wrong. + * @param {ASTNode} node The AST node to check. + * @returns {void} + * @private + */ + function checkJSDoc(node) { + const jsdocNode = sourceCode.getJSDocComment(node), + functionData = fns.pop(), + paramTagsByName = Object.create(null), + paramTags = []; + let hasReturns = false, + returnsTag, + hasConstructor = false, + isInterface = false, + isOverride = false, + isAbstract = false; + + // make sure only to validate JSDoc comments + if (jsdocNode) { + let jsdoc; + + try { + jsdoc = doctrine.parse(jsdocNode.value, { + strict: true, + unwrap: true, + sloppy: true, + range: true + }); + } catch (ex) { + + if (/braces/iu.test(ex.message)) { + context.report({ node: jsdocNode, messageId: "missingBrace" }); + } else { + context.report({ node: jsdocNode, messageId: "syntaxError" }); + } + + return; + } + + jsdoc.tags.forEach(tag => { + + switch (tag.title.toLowerCase()) { + + case "param": + case "arg": + case "argument": + paramTags.push(tag); + break; + + case "return": + case "returns": + hasReturns = true; + returnsTag = tag; + break; + + case "constructor": + case "class": + hasConstructor = true; + break; + + case "override": + case "inheritdoc": + isOverride = true; + break; + + case "abstract": + case "virtual": + isAbstract = true; + break; + + case "interface": + isInterface = true; + break; + + // no default + } + + // check tag preferences + if (Object.prototype.hasOwnProperty.call(prefer, tag.title) && tag.title !== prefer[tag.title]) { + const entireTagRange = getAbsoluteRange(jsdocNode, tag); + + context.report({ + node: jsdocNode, + messageId: "use", + loc: { + start: entireTagRange.start, + end: { + line: entireTagRange.start.line, + column: entireTagRange.start.column + `@${tag.title}`.length + } + }, + data: { name: prefer[tag.title] }, + fix(fixer) { + return fixer.replaceTextRange( + [ + jsdocNode.range[0] + tag.range[0] + 3, + jsdocNode.range[0] + tag.range[0] + tag.title.length + 3 + ], + prefer[tag.title] + ); + } + }); + } + + // validate the types + if (checkPreferType && tag.type) { + validateType(jsdocNode, tag.type); + } + }); + + paramTags.forEach(param => { + if (requireParamType && !param.type) { + context.report({ + node: jsdocNode, + messageId: "missingParamType", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (!param.description && requireParamDescription) { + context.report({ + node: jsdocNode, + messageId: "missingParamDesc", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } + if (paramTagsByName[param.name]) { + context.report({ + node: jsdocNode, + messageId: "duplicateParam", + loc: getAbsoluteRange(jsdocNode, param), + data: { name: param.name } + }); + } else if (param.name.indexOf(".") === -1) { + paramTagsByName[param.name] = param; + } + }); + + if (hasReturns) { + if (!requireReturn && !functionData.returnPresent && (returnsTag.type === null || !isValidReturnType(returnsTag)) && !isAbstract) { + context.report({ + node: jsdocNode, + messageId: "unexpectedTag", + loc: getAbsoluteRange(jsdocNode, returnsTag), + data: { + title: returnsTag.title + } + }); + } else { + if (requireReturnType && !returnsTag.type) { + context.report({ node: jsdocNode, messageId: "missingReturnType" }); + } + + if (!isValidReturnType(returnsTag) && !returnsTag.description && requireReturnDescription) { + context.report({ node: jsdocNode, messageId: "missingReturnDesc" }); + } + } + } + + // check for functions missing @returns + if (!isOverride && !hasReturns && !hasConstructor && !isInterface && + node.parent.kind !== "get" && node.parent.kind !== "constructor" && + node.parent.kind !== "set" && !isTypeClass(node)) { + if (requireReturn || (functionData.returnPresent && !node.async)) { + context.report({ + node: jsdocNode, + messageId: "missingReturn", + data: { + returns: prefer.returns || "returns" + } + }); + } + } + + // check the parameters + const jsdocParamNames = Object.keys(paramTagsByName); + + if (node.params) { + node.params.forEach((param, paramsIndex) => { + const bindingParam = param.type === "AssignmentPattern" + ? param.left + : param; + + // TODO(nzakas): Figure out logical things to do with destructured, default, rest params + if (bindingParam.type === "Identifier") { + const name = bindingParam.name; + + if (jsdocParamNames[paramsIndex] && (name !== jsdocParamNames[paramsIndex])) { + context.report({ + node: jsdocNode, + messageId: "expected", + loc: getAbsoluteRange(jsdocNode, paramTagsByName[jsdocParamNames[paramsIndex]]), + data: { + name, + jsdocName: jsdocParamNames[paramsIndex] + } + }); + } else if (!paramTagsByName[name] && !isOverride) { + context.report({ + node: jsdocNode, + messageId: "missingParam", + data: { + name + } + }); + } + } + }); + } + + if (options.matchDescription) { + const regex = new RegExp(options.matchDescription, "u"); + + if (!regex.test(jsdoc.description)) { + context.report({ node: jsdocNode, messageId: "unsatisfiedDesc" }); + } + } + + } + + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrowFunctionExpression: startFunction, + FunctionExpression: startFunction, + FunctionDeclaration: startFunction, + ClassExpression: startFunction, + ClassDeclaration: startFunction, + "ArrowFunctionExpression:exit": checkJSDoc, + "FunctionExpression:exit": checkJSDoc, + "FunctionDeclaration:exit": checkJSDoc, + "ClassExpression:exit": checkJSDoc, + "ClassDeclaration:exit": checkJSDoc, + ReturnStatement: addReturn + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/valid-typeof.js b/day1/cli-study/node_modules/eslint/lib/rules/valid-typeof.js new file mode 100644 index 0000000..a0f20f7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/valid-typeof.js @@ -0,0 +1,85 @@ +/** + * @fileoverview Ensures that the results of typeof are compared against a valid string + * @author Ian Christian Myers + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "problem", + + docs: { + description: "enforce comparing `typeof` expressions against valid strings", + category: "Possible Errors", + recommended: true, + url: "https://eslint.org/docs/rules/valid-typeof" + }, + + schema: [ + { + type: "object", + properties: { + requireStringLiterals: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + messages: { + invalidValue: "Invalid typeof comparison value.", + notString: "Typeof comparisons should be to string literals." + } + }, + + create(context) { + + const VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"], + OPERATORS = ["==", "===", "!=", "!=="]; + + const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals; + + /** + * Determines whether a node is a typeof expression. + * @param {ASTNode} node The node + * @returns {boolean} `true` if the node is a typeof expression + */ + function isTypeofExpression(node) { + return node.type === "UnaryExpression" && node.operator === "typeof"; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + UnaryExpression(node) { + if (isTypeofExpression(node)) { + const parent = context.getAncestors().pop(); + + if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) { + const sibling = parent.left === node ? parent.right : parent.left; + + if (sibling.type === "Literal" || sibling.type === "TemplateLiteral" && !sibling.expressions.length) { + const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; + + if (VALID_TYPES.indexOf(value) === -1) { + context.report({ node: sibling, messageId: "invalidValue" }); + } + } else if (requireStringLiterals && !isTypeofExpression(sibling)) { + context.report({ node: sibling, messageId: "notString" }); + } + } + } + } + + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/vars-on-top.js b/day1/cli-study/node_modules/eslint/lib/rules/vars-on-top.js new file mode 100644 index 0000000..28ddae4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/vars-on-top.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Rule to enforce var declarations are only at the top of a function. + * @author Danny Fritz + * @author Gyandeep Singh + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: "require `var` declarations be placed at the top of their containing scope", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/vars-on-top" + }, + + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // eslint-disable-next-line jsdoc/require-description + /** + * @param {ASTNode} node any node + * @returns {boolean} whether the given node structurally represents a directive + */ + function looksLikeDirective(node) { + return node.type === "ExpressionStatement" && + node.expression.type === "Literal" && typeof node.expression.value === "string"; + } + + /** + * Check to see if its a ES6 import declaration + * @param {ASTNode} node any node + * @returns {boolean} whether the given node represents a import declaration + */ + function looksLikeImport(node) { + return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" || + node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier"; + } + + /** + * Checks whether a given node is a variable declaration or not. + * @param {ASTNode} node any node + * @returns {boolean} `true` if the node is a variable declaration. + */ + function isVariableDeclaration(node) { + return ( + node.type === "VariableDeclaration" || + ( + node.type === "ExportNamedDeclaration" && + node.declaration && + node.declaration.type === "VariableDeclaration" + ) + ); + } + + /** + * Checks whether this variable is on top of the block body + * @param {ASTNode} node The node to check + * @param {ASTNode[]} statements collection of ASTNodes for the parent node block + * @returns {boolean} True if var is on top otherwise false + */ + function isVarOnTop(node, statements) { + const l = statements.length; + let i = 0; + + // skip over directives + for (; i < l; ++i) { + if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { + break; + } + } + + for (; i < l; ++i) { + if (!isVariableDeclaration(statements[i])) { + return false; + } + if (statements[i] === node) { + return true; + } + } + + return false; + } + + /** + * Checks whether variable is on top at the global level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @returns {void} + */ + function globalVarCheck(node, parent) { + if (!isVarOnTop(node, parent.body)) { + context.report({ node, messageId: "top" }); + } + } + + /** + * Checks whether variable is on top at functional block scope level + * @param {ASTNode} node The node to check + * @param {ASTNode} parent Parent of the node + * @param {ASTNode} grandParent Parent of the node's parent + * @returns {void} + */ + function blockScopeVarCheck(node, parent, grandParent) { + if (!(/Function/u.test(grandParent.type) && + parent.type === "BlockStatement" && + isVarOnTop(node, parent.body))) { + context.report({ node, messageId: "top" }); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration[kind='var']"(node) { + if (node.parent.type === "ExportNamedDeclaration") { + globalVarCheck(node.parent, node.parent.parent); + } else if (node.parent.type === "Program") { + globalVarCheck(node, node.parent); + } else { + blockScopeVarCheck(node, node.parent, node.parent.parent); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/wrap-iife.js b/day1/cli-study/node_modules/eslint/lib/rules/wrap-iife.js new file mode 100644 index 0000000..896aed6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/wrap-iife.js @@ -0,0 +1,197 @@ +/** + * @fileoverview Rule to flag when IIFE is not wrapped in parens + * @author Ilya Volodin + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); +const eslintUtils = require("eslint-utils"); + +//---------------------------------------------------------------------- +// Helpers +//---------------------------------------------------------------------- + +/** + * Check if the given node is callee of a `NewExpression` node + * @param {ASTNode} node node to check + * @returns {boolean} True if the node is callee of a `NewExpression` node + * @private + */ +function isCalleeOfNewExpression(node) { + return node.parent.type === "NewExpression" && node.parent.callee === node; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parentheses around immediate `function` invocations", + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-iife" + }, + + schema: [ + { + enum: ["outside", "inside", "any"] + }, + { + type: "object", + properties: { + functionPrototypeMethods: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + wrapInvocation: "Wrap an immediate function invocation in parentheses.", + wrapExpression: "Wrap only the function expression in parens.", + moveInvocation: "Move the invocation into the parens that contain the function." + } + }, + + create(context) { + + const style = context.options[0] || "outside"; + const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; + + const sourceCode = context.getSourceCode(); + + /** + * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if() + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in any parens + * @private + */ + function isWrappedInAnyParens(node) { + return astUtils.isParenthesised(sourceCode, node); + } + + /** + * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped in grouping parens + * @private + */ + function isWrappedInGroupingParens(node) { + return eslintUtils.isParenthesized(1, node, sourceCode); + } + + /** + * Get the function node from an IIFE + * @param {ASTNode} node node to evaluate + * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist + */ + function getFunctionNodeFromIIFE(node) { + const callee = node.callee; + + if (callee.type === "FunctionExpression") { + return callee; + } + + if (includeFunctionPrototypeMethods && + callee.type === "MemberExpression" && + callee.object.type === "FunctionExpression" && + (astUtils.getStaticPropertyName(callee) === "call" || astUtils.getStaticPropertyName(callee) === "apply") + ) { + return callee.object; + } + + return null; + } + + + return { + CallExpression(node) { + const innerNode = getFunctionNodeFromIIFE(node); + + if (!innerNode) { + return; + } + + const isCallExpressionWrapped = isWrappedInAnyParens(node), + isFunctionExpressionWrapped = isWrappedInAnyParens(innerNode); + + if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapInvocation", + fix(fixer) { + const nodeToSurround = style === "inside" ? innerNode : node; + + return fixer.replaceText(nodeToSurround, `(${sourceCode.getText(nodeToSurround)})`); + } + }); + } else if (style === "inside" && !isFunctionExpressionWrapped) { + context.report({ + node, + messageId: "wrapExpression", + fix(fixer) { + + // The outer call expression will always be wrapped at this point. + + if (isWrappedInGroupingParens(node) && !isCalleeOfNewExpression(node)) { + + /* + * Parenthesize the function expression and remove unnecessary grouping parens around the call expression. + * Replace the range between the end of the function expression and the end of the call expression. + * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`. + */ + + const parenAfter = sourceCode.getTokenAfter(node); + + return fixer.replaceTextRange( + [innerNode.range[1], parenAfter.range[1]], + `)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}` + ); + } + + /* + * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens. + * These parens cannot be removed, so just parenthesize the function expression. + */ + + return fixer.replaceText(innerNode, `(${sourceCode.getText(innerNode)})`); + } + }); + } else if (style === "outside" && !isCallExpressionWrapped) { + context.report({ + node, + messageId: "moveInvocation", + fix(fixer) { + + /* + * The inner function expression will always be wrapped at this point. + * It's only necessary to replace the range between the end of the function expression + * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)` + * should get replaced with `(bar))`. + */ + const parenAfter = sourceCode.getTokenAfter(innerNode); + + return fixer.replaceTextRange( + [parenAfter.range[0], node.range[1]], + `${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})` + ); + } + }); + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/wrap-regex.js b/day1/cli-study/node_modules/eslint/lib/rules/wrap-regex.js new file mode 100644 index 0000000..4ecbcec --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/wrap-regex.js @@ -0,0 +1,59 @@ +/** + * @fileoverview Rule to flag when regex literals are not wrapped in parens + * @author Matt DuVall + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require parenthesis around regex literals", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/wrap-regex" + }, + + schema: [], + fixable: "code", + + messages: { + requireParens: "Wrap the regexp literal in parens to disambiguate the slash." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + return { + + Literal(node) { + const token = sourceCode.getFirstToken(node), + nodeType = token.type; + + if (nodeType === "RegularExpression") { + const beforeToken = sourceCode.getTokenBefore(node); + const afterToken = sourceCode.getTokenAfter(node); + const ancestors = context.getAncestors(); + const grandparent = ancestors[ancestors.length - 1]; + + if (grandparent.type === "MemberExpression" && grandparent.object === node && + !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { + context.report({ + node, + messageId: "requireParens", + fix: fixer => fixer.replaceText(node, `(${sourceCode.getText(node)})`) + }); + } + } + } + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/yield-star-spacing.js b/day1/cli-study/node_modules/eslint/lib/rules/yield-star-spacing.js new file mode 100644 index 0000000..20b8e9e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,127 @@ +/** + * @fileoverview Rule to check the spacing around the * in yield* expressions. + * @author Bryan Smith + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "layout", + + docs: { + description: "require or disallow spacing around the `*` in `yield*` expressions", + category: "ECMAScript 6", + recommended: false, + url: "https://eslint.org/docs/rules/yield-star-spacing" + }, + + fixable: "whitespace", + + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"] + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" } + }, + additionalProperties: false + } + ] + } + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } + }, + + create(context) { + const sourceCode = context.getSourceCode(); + + const mode = (function(option) { + if (!option || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "after"]; + } + return option; + }(context.options[0])); + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !== mode[side]) { + const after = leftToken.value === "*"; + const spaceRequired = mode[side]; + const node = after ? leftToken : rightToken; + let messageId = ""; + + if (spaceRequired) { + messageId = side === "before" ? "missingBefore" : "missingAfter"; + } else { + messageId = side === "before" ? "unexpectedBefore" : "unexpectedAfter"; + } + + context.report({ + node, + messageId, + fix(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a yield* expression. + * @param {ASTNode} node A yield expression node. + * @returns {void} + */ + function checkExpression(node) { + if (!node.delegate) { + return; + } + + const tokens = sourceCode.getFirstTokens(node, 3); + const yieldToken = tokens[0]; + const starToken = tokens[1]; + const nextToken = tokens[2]; + + checkSpacing("before", yieldToken, starToken); + checkSpacing("after", starToken, nextToken); + } + + return { + YieldExpression: checkExpression + }; + + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/rules/yoda.js b/day1/cli-study/node_modules/eslint/lib/rules/yoda.js new file mode 100644 index 0000000..f1159e5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/rules/yoda.js @@ -0,0 +1,405 @@ +/** + * @fileoverview Rule to require or disallow yoda comparisons + * @author Nicholas C. Zakas + */ +"use strict"; + +//-------------------------------------------------------------------------- +// Requirements +//-------------------------------------------------------------------------- + +const astUtils = require("./utils/ast-utils"); + +//-------------------------------------------------------------------------- +// Helpers +//-------------------------------------------------------------------------- + +/** + * Determines whether an operator is a comparison operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is a comparison operator. + */ +function isComparisonOperator(operator) { + return /^(==|===|!=|!==|<|>|<=|>=)$/u.test(operator); +} + +/** + * Determines whether an operator is an equality operator. + * @param {string} operator The operator to check. + * @returns {boolean} Whether or not it is an equality operator. + */ +function isEqualityOperator(operator) { + return /^(==|===)$/u.test(operator); +} + +/** + * Determines whether an operator is one used in a range test. + * Allowed operators are `<` and `<=`. + * @param {string} operator The operator to check. + * @returns {boolean} Whether the operator is used in range tests. + */ +function isRangeTestOperator(operator) { + return ["<", "<="].indexOf(operator) >= 0; +} + +/** + * Determines whether a non-Literal node is a negative number that should be + * treated as if it were a single Literal node. + * @param {ASTNode} node Node to test. + * @returns {boolean} True if the node is a negative number that looks like a + * real literal and should be treated as such. + */ +function isNegativeNumericLiteral(node) { + return ( + node.type === "UnaryExpression" && + node.operator === "-" && + node.prefix && + astUtils.isNumericLiteral(node.argument) + ); +} + +/** + * Determines whether a node is a Template Literal which can be determined statically. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node is a Template Literal without expression. + */ +function isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; +} + +/** + * Determines whether a non-Literal node should be treated as a single Literal node. + * @param {ASTNode} node Node to test + * @returns {boolean} True if the node should be treated as a single Literal node. + */ +function looksLikeLiteral(node) { + return isNegativeNumericLiteral(node) || isStaticTemplateLiteral(node); +} + +/** + * Attempts to derive a Literal node from nodes that are treated like literals. + * @param {ASTNode} node Node to normalize. + * @returns {ASTNode} One of the following options. + * 1. The original node if the node is already a Literal + * 2. A normalized Literal node with the negative number as the value if the + * node represents a negative number literal. + * 3. A normalized Literal node with the string as the value if the node is + * a Template Literal without expression. + * 4. Otherwise `null`. + */ +function getNormalizedLiteral(node) { + if (node.type === "Literal") { + return node; + } + + if (isNegativeNumericLiteral(node)) { + return { + type: "Literal", + value: -node.argument.value, + raw: `-${node.argument.value}` + }; + } + + if (isStaticTemplateLiteral(node)) { + return { + type: "Literal", + value: node.quasis[0].value.cooked, + raw: node.quasis[0].value.raw + }; + } + + return null; +} + +/** + * Checks whether two expressions reference the same value. For example: + * a = a + * a.b = a.b + * a[0] = a[0] + * a['b'] = a['b'] + * @param {ASTNode} a Left side of the comparison. + * @param {ASTNode} b Right side of the comparison. + * @returns {boolean} True if both sides match and reference the same value. + */ +function same(a, b) { + if (a.type !== b.type) { + return false; + } + + switch (a.type) { + case "Identifier": + return a.name === b.name; + + case "Literal": + return a.value === b.value; + + case "MemberExpression": { + const nameA = astUtils.getStaticPropertyName(a); + + // x.y = x["y"] + if (nameA !== null) { + return ( + same(a.object, b.object) && + nameA === astUtils.getStaticPropertyName(b) + ); + } + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ + return ( + a.computed === b.computed && + same(a.object, b.object) && + same(a.property, b.property) + ); + } + + case "ThisExpression": + return true; + + default: + return false; + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + type: "suggestion", + + docs: { + description: 'require or disallow "Yoda" conditions', + category: "Best Practices", + recommended: false, + url: "https://eslint.org/docs/rules/yoda" + }, + + schema: [ + { + enum: ["always", "never"] + }, + { + type: "object", + properties: { + exceptRange: { + type: "boolean", + default: false + }, + onlyEquality: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], + + fixable: "code", + messages: { + expected: + "Expected literal to be on the {{expectedSide}} side of {{operator}}." + } + }, + + create(context) { + + // Default to "never" (!always) if no option + const always = context.options[0] === "always"; + const exceptRange = + context.options[1] && context.options[1].exceptRange; + const onlyEquality = + context.options[1] && context.options[1].onlyEquality; + + const sourceCode = context.getSourceCode(); + + /** + * Determines whether node represents a range test. + * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" + * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and + * both operators must be `<` or `<=`. Finally, the literal on the left side + * must be less than or equal to the literal on the right side so that the + * test makes any sense. + * @param {ASTNode} node LogicalExpression node to test. + * @returns {boolean} Whether node is a range test. + */ + function isRangeTest(node) { + const left = node.left, + right = node.right; + + /** + * Determines whether node is of the form `0 <= x && x < 1`. + * @returns {boolean} Whether node is a "between" range test. + */ + function isBetweenTest() { + if (node.operator === "&&" && same(left.right, right.left)) { + const leftLiteral = getNormalizedLiteral(left.left); + const rightLiteral = getNormalizedLiteral(right.right); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + return false; + } + + /** + * Determines whether node is of the form `x < 0 || 1 <= x`. + * @returns {boolean} Whether node is an "outside" range test. + */ + function isOutsideTest() { + if (node.operator === "||" && same(left.left, right.right)) { + const leftLiteral = getNormalizedLiteral(left.right); + const rightLiteral = getNormalizedLiteral(right.left); + + if (leftLiteral === null && rightLiteral === null) { + return false; + } + + if (rightLiteral === null || leftLiteral === null) { + return true; + } + + if (leftLiteral.value <= rightLiteral.value) { + return true; + } + } + + return false; + } + + /** + * Determines whether node is wrapped in parentheses. + * @returns {boolean} Whether node is preceded immediately by an open + * paren token and followed immediately by a close + * paren token. + */ + function isParenWrapped() { + return astUtils.isParenthesised(sourceCode, node); + } + + return ( + node.type === "LogicalExpression" && + left.type === "BinaryExpression" && + right.type === "BinaryExpression" && + isRangeTestOperator(left.operator) && + isRangeTestOperator(right.operator) && + (isBetweenTest() || isOutsideTest()) && + isParenWrapped() + ); + } + + const OPERATOR_FLIP_MAP = { + "===": "===", + "!==": "!==", + "==": "==", + "!=": "!=", + "<": ">", + ">": "<", + "<=": ">=", + ">=": "<=" + }; + + /** + * Returns a string representation of a BinaryExpression node with its sides/operator flipped around. + * @param {ASTNode} node The BinaryExpression node + * @returns {string} A string representation of the node with the sides and operator flipped + */ + function getFlippedString(node) { + const tokenBefore = sourceCode.getTokenBefore(node); + const operatorToken = sourceCode.getFirstTokenBetween( + node.left, + node.right, + token => token.value === node.operator + ); + const textBeforeOperator = sourceCode + .getText() + .slice( + sourceCode.getTokenBefore(operatorToken).range[1], + operatorToken.range[0] + ); + const textAfterOperator = sourceCode + .getText() + .slice( + operatorToken.range[1], + sourceCode.getTokenAfter(operatorToken).range[0] + ); + const leftText = sourceCode + .getText() + .slice( + node.range[0], + sourceCode.getTokenBefore(operatorToken).range[1] + ); + const firstRightToken = sourceCode.getTokenAfter(operatorToken); + const rightText = sourceCode + .getText() + .slice(firstRightToken.range[0], node.range[1]); + + let prefix = ""; + + if ( + tokenBefore && + tokenBefore.range[1] === node.range[0] && + !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken) + ) { + prefix = " "; + } + + return ( + prefix + + rightText + + textBeforeOperator + + OPERATOR_FLIP_MAP[operatorToken.value] + + textAfterOperator + + leftText + ); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + BinaryExpression(node) { + const expectedLiteral = always ? node.left : node.right; + const expectedNonLiteral = always ? node.right : node.left; + + // If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error. + if ( + (expectedNonLiteral.type === "Literal" || + looksLikeLiteral(expectedNonLiteral)) && + !( + expectedLiteral.type === "Literal" || + looksLikeLiteral(expectedLiteral) + ) && + !(!isEqualityOperator(node.operator) && onlyEquality) && + isComparisonOperator(node.operator) && + !(exceptRange && isRangeTest(context.getAncestors().pop())) + ) { + context.report({ + node, + messageId: "expected", + data: { + operator: node.operator, + expectedSide: always ? "left" : "right" + }, + fix: fixer => + fixer.replaceText(node, getFlippedString(node)) + }); + } + } + }; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/ajv.js b/day1/cli-study/node_modules/eslint/lib/shared/ajv.js new file mode 100644 index 0000000..3fb0fbd --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/ajv.js @@ -0,0 +1,34 @@ +/** + * @fileoverview The instance of Ajv validator. + * @author Evgeny Poberezkin + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Ajv = require("ajv"), + metaSchema = require("ajv/lib/refs/json-schema-draft-04.json"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = (additionalOptions = {}) => { + const ajv = new Ajv({ + meta: false, + useDefaults: true, + validateSchema: false, + missingRefs: "ignore", + verbose: true, + schemaId: "auto", + ...additionalOptions + }); + + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle + ajv._opts.defaultMeta = metaSchema.id; + + return ajv; +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/ast-utils.js b/day1/cli-study/node_modules/eslint/lib/shared/ast-utils.js new file mode 100644 index 0000000..4ebd49c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/ast-utils.js @@ -0,0 +1,29 @@ +/** + * @fileoverview Common utils for AST. + * + * This file contains only shared items for core and rules. + * If you make a utility for rules, please see `../rules/utils/ast-utils.js`. + * + * @author Toru Nagashima + */ +"use strict"; + +const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u; +const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u; +const shebangPattern = /^#!([^\r\n]+)/u; + +/** + * Creates a version of the `lineBreakPattern` regex with the global flag. + * Global regexes are mutable, so this needs to be a function instead of a constant. + * @returns {RegExp} A global regular expression that matches line terminators + */ +function createGlobalLinebreakMatcher() { + return new RegExp(lineBreakPattern.source, "gu"); +} + +module.exports = { + breakableTypePattern, + lineBreakPattern, + createGlobalLinebreakMatcher, + shebangPattern +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/config-ops.js b/day1/cli-study/node_modules/eslint/lib/shared/config-ops.js new file mode 100644 index 0000000..3b4d569 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/config-ops.js @@ -0,0 +1,130 @@ +/** + * @fileoverview Config file operations. This file must be usable in the browser, + * so no Node-specific code can be here. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const RULE_SEVERITY_STRINGS = ["off", "warn", "error"], + RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => { + map[value] = index; + return map; + }, {}), + VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"]; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * Normalizes the severity value of a rule's configuration to a number + * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally + * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0), + * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array + * whose first element is one of the above values. Strings are matched case-insensitively. + * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0. + */ + getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (severityValue === 0 || severityValue === 1 || severityValue === 2) { + return severityValue; + } + + if (typeof severityValue === "string") { + return RULE_SEVERITY[severityValue.toLowerCase()] || 0; + } + + return 0; + }, + + /** + * Converts old-style severity settings (0, 1, 2) into new-style + * severity settings (off, warn, error) for all rules. Assumption is that severity + * values have already been validated as correct. + * @param {Object} config The config object to normalize. + * @returns {void} + */ + normalizeToStrings(config) { + + if (config.rules) { + Object.keys(config.rules).forEach(ruleId => { + const ruleConfig = config.rules[ruleId]; + + if (typeof ruleConfig === "number") { + config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0]; + } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") { + ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0]; + } + }); + } + }, + + /** + * Determines if the severity for the given rule configuration represents an error. + * @param {int|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} True if the rule represents an error, false if not. + */ + isErrorSeverity(ruleConfig) { + return module.exports.getRuleSeverity(ruleConfig) === 2; + }, + + /** + * Checks whether a given config has valid severity or not. + * @param {number|string|Array} ruleConfig The configuration for an individual rule. + * @returns {boolean} `true` if the configuration has valid severity. + */ + isValidSeverity(ruleConfig) { + let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; + + if (typeof severity === "string") { + severity = severity.toLowerCase(); + } + return VALID_SEVERITIES.indexOf(severity) !== -1; + }, + + /** + * Checks whether every rule of a given config has valid severity or not. + * @param {Object} config The configuration for rules. + * @returns {boolean} `true` if the configuration has valid severity. + */ + isEverySeverityValid(config) { + return Object.keys(config).every(ruleId => this.isValidSeverity(config[ruleId])); + }, + + /** + * Normalizes a value for a global in a config + * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in + * a global directive comment + * @returns {("readable"|"writeable"|"off")} The value normalized as a string + * @throws Error if global value is invalid + */ + normalizeConfigGlobal(configuredValue) { + switch (configuredValue) { + case "off": + return "off"; + + case true: + case "true": + case "writeable": + case "writable": + return "writable"; + + case null: + case false: + case "false": + case "readable": + case "readonly": + return "readonly"; + + default: + throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`); + } + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/config-validator.js b/day1/cli-study/node_modules/eslint/lib/shared/config-validator.js new file mode 100644 index 0000000..458bd2a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/config-validator.js @@ -0,0 +1,326 @@ +/** + * @fileoverview Validates configs. + * @author Brandon Mills + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + util = require("util"), + configSchema = require("../../conf/config-schema"), + BuiltInEnvironments = require("../../conf/environments"), + BuiltInRules = require("../rules"), + ConfigOps = require("./config-ops"), + { emitDeprecationWarning } = require("./deprecation-warnings"); + +const ajv = require("./ajv")(); +const ruleValidators = new WeakMap(); +const noop = Function.prototype; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ +let validateSchema; +const severityMap = { + error: 2, + warn: 1, + off: 0 +}; + +/** + * Gets a complete options schema for a rule. + * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object + * @returns {Object} JSON Schema for the rule's options. + */ +function getRuleOptionsSchema(rule) { + if (!rule) { + return null; + } + + const schema = rule.schema || rule.meta && rule.meta.schema; + + // Given a tuple of schemas, insert warning level at the beginning + if (Array.isArray(schema)) { + if (schema.length) { + return { + type: "array", + items: schema, + minItems: 0, + maxItems: schema.length + }; + } + return { + type: "array", + minItems: 0, + maxItems: 0 + }; + + } + + // Given a full schema, leave it alone + return schema || null; +} + +/** + * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid. + * @param {options} options The given options for the rule. + * @returns {number|string} The rule's severity value + */ +function validateRuleSeverity(options) { + const severity = Array.isArray(options) ? options[0] : options; + const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity; + + if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) { + return normSeverity; + } + + throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`); + +} + +/** + * Validates the non-severity options passed to a rule, based on its schema. + * @param {{create: Function}} rule The rule to validate + * @param {Array} localOptions The options for the rule, excluding severity + * @returns {void} + */ +function validateRuleSchema(rule, localOptions) { + if (!ruleValidators.has(rule)) { + const schema = getRuleOptionsSchema(rule); + + if (schema) { + ruleValidators.set(rule, ajv.compile(schema)); + } + } + + const validateRule = ruleValidators.get(rule); + + if (validateRule) { + validateRule(localOptions); + if (validateRule.errors) { + throw new Error(validateRule.errors.map( + error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n` + ).join("")); + } + } +} + +/** + * Validates a rule's options against its schema. + * @param {{create: Function}|null} rule The rule that the config is being validated for + * @param {string} ruleId The rule's unique name. + * @param {Array|number} options The given options for the rule. + * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, + * no source is prepended to the message. + * @returns {void} + */ +function validateRuleOptions(rule, ruleId, options, source = null) { + try { + const severity = validateRuleSeverity(options); + + if (severity !== 0) { + validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []); + } + } catch (err) { + const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`; + + if (typeof source === "string") { + throw new Error(`${source}:\n\t${enhancedMessage}`); + } else { + throw new Error(enhancedMessage); + } + } +} + +/** + * Validates an environment object + * @param {Object} environment The environment config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments. + * @returns {void} + */ +function validateEnvironment( + environment, + source, + getAdditionalEnv = noop +) { + + // not having an environment is ok + if (!environment) { + return; + } + + Object.keys(environment).forEach(id => { + const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null; + + if (!env) { + const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`; + + throw new Error(message); + } + }); +} + +/** + * Validates a rules config object + * @param {Object} rulesConfig The rules config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules + * @returns {void} + */ +function validateRules( + rulesConfig, + source, + getAdditionalRule = noop +) { + if (!rulesConfig) { + return; + } + + Object.keys(rulesConfig).forEach(id => { + const rule = getAdditionalRule(id) || BuiltInRules.get(id) || null; + + validateRuleOptions(rule, id, rulesConfig[id], source); + }); +} + +/** + * Validates a `globals` section of a config file + * @param {Object} globalsConfig The `globals` section + * @param {string|null} source The name of the configuration source to report in the event of an error. + * @returns {void} + */ +function validateGlobals(globalsConfig, source = null) { + if (!globalsConfig) { + return; + } + + Object.entries(globalsConfig) + .forEach(([configuredGlobal, configuredValue]) => { + try { + ConfigOps.normalizeConfigGlobal(configuredValue); + } catch (err) { + throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`); + } + }); +} + +/** + * Validate `processor` configuration. + * @param {string|undefined} processorName The processor name. + * @param {string} source The name of config file. + * @param {function(id:string): Processor} getProcessor The getter of defined processors. + * @returns {void} + */ +function validateProcessor(processorName, source, getProcessor) { + if (processorName && !getProcessor(processorName)) { + throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`); + } +} + +/** + * Formats an array of schema validation errors. + * @param {Array} errors An array of error messages to format. + * @returns {string} Formatted error message + */ +function formatErrors(errors) { + return errors.map(error => { + if (error.keyword === "additionalProperties") { + const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty; + + return `Unexpected top-level property "${formattedPropertyPath}"`; + } + if (error.keyword === "type") { + const formattedField = error.dataPath.slice(1); + const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema; + const formattedValue = JSON.stringify(error.data); + + return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`; + } + + const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath; + + return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`; + }).map(message => `\t- ${message}.\n`).join(""); +} + +/** + * Validates the top level properties of the config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @returns {void} + */ +function validateConfigSchema(config, source = null) { + validateSchema = validateSchema || ajv.compile(configSchema); + + if (!validateSchema(config)) { + throw new Error(`ESLint configuration in ${source} is invalid:\n${formatErrors(validateSchema.errors)}`); + } + + if (Object.hasOwnProperty.call(config, "ecmaFeatures")) { + emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES"); + } +} + +/** + * Validates an entire config object. + * @param {Object} config The config object to validate. + * @param {string} source The name of the configuration source to report in any errors. + * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules. + * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs. + * @returns {void} + */ +function validate(config, source, getAdditionalRule, getAdditionalEnv) { + validateConfigSchema(config, source); + validateRules(config.rules, source, getAdditionalRule); + validateEnvironment(config.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + + for (const override of config.overrides || []) { + validateRules(override.rules, source, getAdditionalRule); + validateEnvironment(override.env, source, getAdditionalEnv); + validateGlobals(config.globals, source); + } +} + +const validated = new WeakSet(); + +/** + * Validate config array object. + * @param {ConfigArray} configArray The config array to validate. + * @returns {void} + */ +function validateConfigArray(configArray) { + const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments); + const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors); + const getPluginRule = Map.prototype.get.bind(configArray.pluginRules); + + // Validate. + for (const element of configArray) { + if (validated.has(element)) { + continue; + } + validated.add(element); + + validateEnvironment(element.env, element.name, getPluginEnv); + validateGlobals(element.globals, element.name); + validateProcessor(element.processor, element.name, getPluginProcessor); + validateRules(element.rules, element.name, getPluginRule); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + getRuleOptionsSchema, + validate, + validateConfigArray, + validateConfigSchema, + validateRuleOptions +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/deprecation-warnings.js b/day1/cli-study/node_modules/eslint/lib/shared/deprecation-warnings.js new file mode 100644 index 0000000..e1481a2 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +const emitDeprecationWarning = lodash.memoize((source, errorCode) => { + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +}, (...args) => JSON.stringify(args)); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + emitDeprecationWarning +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/logging.js b/day1/cli-study/node_modules/eslint/lib/shared/logging.js new file mode 100644 index 0000000..6aa1f5a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/logging.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Handle logging for ESLint + * @author Gyandeep Singh + */ + +"use strict"; + +/* eslint no-console: "off" */ + +/* istanbul ignore next */ +module.exports = { + + /** + * Cover for console.log + * @param {...any} args The elements to log. + * @returns {void} + */ + info(...args) { + console.log(...args); + }, + + /** + * Cover for console.error + * @param {...any} args The elements to log. + * @returns {void} + */ + error(...args) { + console.error(...args); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/naming.js b/day1/cli-study/node_modules/eslint/lib/shared/naming.js new file mode 100644 index 0000000..32cff94 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/naming.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Common helpers for naming of plugins, formatters and configs + */ +"use strict"; + +const NAMESPACE_REGEX = /^@.*\//iu; + +/** + * Brings package name to correct format based on prefix + * @param {string} name The name of the package. + * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter" + * @returns {string} Normalized name of the package + * @private + */ +function normalizePackageName(name, prefix) { + let normalizedName = name; + + /** + * On Windows, name can come in with Windows slashes instead of Unix slashes. + * Normalize to Unix first to avoid errors later on. + * https://github.com/eslint/eslint/issues/5644 + */ + if (normalizedName.includes("\\")) { + normalizedName = normalizedName.replace(/\\/gu, "/"); + } + + if (normalizedName.charAt(0) === "@") { + + /** + * it's a scoped package + * package name is the prefix, or just a username + */ + const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"), + scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u"); + + if (scopedPackageShortcutRegex.test(normalizedName)) { + normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`); + } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) { + + /** + * for scoped packages, insert the prefix after the first / unless + * the path is already @scope/eslint or @scope/eslint-xxx-yyy + */ + normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`); + } + } else if (!normalizedName.startsWith(`${prefix}-`)) { + normalizedName = `${prefix}-${normalizedName}`; + } + + return normalizedName; +} + +/** + * Removes the prefix from a fullname. + * @param {string} fullname The term which may have the prefix. + * @param {string} prefix The prefix to remove. + * @returns {string} The term without prefix. + */ +function getShorthandName(fullname, prefix) { + if (fullname[0] === "@") { + let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname); + + if (matchResult) { + return matchResult[1]; + } + + matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname); + if (matchResult) { + return `${matchResult[1]}/${matchResult[2]}`; + } + } else if (fullname.startsWith(`${prefix}-`)) { + return fullname.slice(prefix.length + 1); + } + + return fullname; +} + +/** + * Gets the scope (namespace) of a term. + * @param {string} term The term which may have the namespace. + * @returns {string} The namespace of the term if it has one. + */ +function getNamespaceFromTerm(term) { + const match = term.match(NAMESPACE_REGEX); + + return match ? match[0] : ""; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + normalizePackageName, + getShorthandName, + getNamespaceFromTerm +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/relative-module-resolver.js b/day1/cli-study/node_modules/eslint/lib/shared/relative-module-resolver.js new file mode 100644 index 0000000..80335c5 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/relative-module-resolver.js @@ -0,0 +1,44 @@ +/** + * Utility for resolving a module relative to another module + * @author Teddy Katz + */ + +"use strict"; + +const Module = require("module"); + +/* + * `Module.createRequire` is added in v12.2.0. It supports URL as well. + * We only support the case where the argument is a filepath, not a URL. + */ +// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api +const createRequire = Module.createRequire || Module.createRequireFromPath; + +module.exports = { + + /** + * Resolves a Node module relative to another module + * @param {string} moduleName The name of a Node module, or a path to a Node module. + * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be + * a file rather than a directory, but the file need not actually exist. + * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath` + */ + resolve(moduleName, relativeToPath) { + try { + return createRequire(relativeToPath).resolve(moduleName); + } catch (error) { + + // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future. + if ( + typeof error === "object" && + error !== null && + error.code === "MODULE_NOT_FOUND" && + !error.requireStack && + error.message.includes(moduleName) + ) { + error.message += `\nRequire stack:\n- ${relativeToPath}`; + } + throw error; + } + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/runtime-info.js b/day1/cli-study/node_modules/eslint/lib/shared/runtime-info.js new file mode 100644 index 0000000..feed005 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/runtime-info.js @@ -0,0 +1,163 @@ +/** + * @fileoverview Utility to get information about the execution environment. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); +const spawn = require("cross-spawn"); +const { isEmpty } = require("lodash"); +const log = require("../shared/logging"); +const packageJson = require("../../package.json"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Generates and returns execution environment information. + * @returns {string} A string that contains execution environment information. + */ +function environment() { + const cache = new Map(); + + /** + * Checks if a path is a child of a directory. + * @param {string} parentPath The parent path to check. + * @param {string} childPath The path to check. + * @returns {boolean} Whether or not the given path is a child of a directory. + */ + function isChildOfDirectory(parentPath, childPath) { + return !path.relative(parentPath, childPath).startsWith(".."); + } + + /** + * Synchronously executes a shell command and formats the result. + * @param {string} cmd The command to execute. + * @param {Array} args The arguments to be executed with the command. + * @returns {string} The version returned by the command. + */ + function execCommand(cmd, args) { + const key = [cmd, ...args].join(" "); + + if (cache.has(key)) { + return cache.get(key); + } + + const process = spawn.sync(cmd, args, { encoding: "utf8" }); + + if (process.error) { + throw process.error; + } + + const result = process.stdout.trim(); + + cache.set(key, result); + return result; + } + + /** + * Normalizes a version number. + * @param {string} versionStr The string to normalize. + * @returns {string} The normalized version number. + */ + function normalizeVersionStr(versionStr) { + return versionStr.startsWith("v") ? versionStr : `v${versionStr}`; + } + + /** + * Gets bin version. + * @param {string} bin The bin to check. + * @returns {string} The normalized version returned by the command. + */ + function getBinVersion(bin) { + const binArgs = ["--version"]; + + try { + return normalizeVersionStr(execCommand(bin, binArgs)); + } catch (e) { + log.error(`Error finding ${bin} version running the command \`${bin} ${binArgs.join(" ")}\``); + throw e; + } + } + + /** + * Gets installed npm package version. + * @param {string} pkg The package to check. + * @param {boolean} global Whether to check globally or not. + * @returns {string} The normalized version returned by the command. + */ + function getNpmPackageVersion(pkg, { global = false } = {}) { + const npmBinArgs = ["bin", "-g"]; + const npmLsArgs = ["ls", "--depth=0", "--json", "eslint"]; + + if (global) { + npmLsArgs.push("-g"); + } + + try { + const parsedStdout = JSON.parse(execCommand("npm", npmLsArgs)); + + /* + * Checking globally returns an empty JSON object, while local checks + * include the name and version of the local project. + */ + if (isEmpty(parsedStdout) || !(parsedStdout.dependencies && parsedStdout.dependencies.eslint)) { + return "Not found"; + } + + const [, processBinPath] = process.argv; + let npmBinPath; + + try { + npmBinPath = execCommand("npm", npmBinArgs); + } catch (e) { + log.error(`Error finding npm binary path when running command \`npm ${npmBinArgs.join(" ")}\``); + throw e; + } + + const isGlobal = isChildOfDirectory(npmBinPath, processBinPath); + let pkgVersion = parsedStdout.dependencies.eslint.version; + + if ((global && isGlobal) || (!global && !isGlobal)) { + pkgVersion += " (Currently used)"; + } + + return normalizeVersionStr(pkgVersion); + } catch (e) { + log.error(`Error finding ${pkg} version running the command \`npm ${npmLsArgs.join(" ")}\``); + throw e; + } + } + + return [ + "Environment Info:", + "", + `Node version: ${getBinVersion("node")}`, + `npm version: ${getBinVersion("npm")}`, + `Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`, + `Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}` + ].join("\n"); +} + +/** + * Returns version of currently executing ESLint. + * @returns {string} The version from the currently executing ESLint's package.json. + */ +function version() { + return `v${packageJson.version}`; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + environment, + version +}; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/traverser.js b/day1/cli-study/node_modules/eslint/lib/shared/traverser.js new file mode 100644 index 0000000..32f7677 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/traverser.js @@ -0,0 +1,195 @@ +/** + * @fileoverview Traverser to traverse AST trees. + * @author Nicholas C. Zakas + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const vk = require("eslint-visitor-keys"); +const debug = require("debug")("eslint:traverser"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Do nothing. + * @returns {void} + */ +function noop() { + + // do nothing. +} + +/** + * Check whether the given value is an ASTNode or not. + * @param {any} x The value to check. + * @returns {boolean} `true` if the value is an ASTNode. + */ +function isNode(x) { + return x !== null && typeof x === "object" && typeof x.type === "string"; +} + +/** + * Get the visitor keys of a given node. + * @param {Object} visitorKeys The map of visitor keys. + * @param {ASTNode} node The node to get their visitor keys. + * @returns {string[]} The visitor keys of the node. + */ +function getVisitorKeys(visitorKeys, node) { + let keys = visitorKeys[node.type]; + + if (!keys) { + keys = vk.getKeys(node); + debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys); + } + + return keys; +} + +/** + * The traverser class to traverse AST trees. + */ +class Traverser { + constructor() { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = null; + this._enter = null; + this._leave = null; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode} The current node. + */ + current() { + return this._current; + } + + // eslint-disable-next-line jsdoc/require-description + /** + * @returns {ASTNode[]} The ancestor nodes. + */ + parents() { + return this._parents.slice(0); + } + + /** + * Break the current traversal. + * @returns {void} + */ + break() { + this._broken = true; + } + + /** + * Skip child nodes for the current traversal. + * @returns {void} + */ + skip() { + this._skipped = true; + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + traverse(node, options) { + this._current = null; + this._parents = []; + this._skipped = false; + this._broken = false; + this._visitorKeys = options.visitorKeys || vk.KEYS; + this._enter = options.enter || noop; + this._leave = options.leave || noop; + this._traverse(node, null); + } + + /** + * Traverse the given AST tree recursively. + * @param {ASTNode} node The current node. + * @param {ASTNode|null} parent The parent node. + * @returns {void} + * @private + */ + _traverse(node, parent) { + if (!isNode(node)) { + return; + } + + this._current = node; + this._skipped = false; + this._enter(node, parent); + + if (!this._skipped && !this._broken) { + const keys = getVisitorKeys(this._visitorKeys, node); + + if (keys.length >= 1) { + this._parents.push(node); + for (let i = 0; i < keys.length && !this._broken; ++i) { + const child = node[keys[i]]; + + if (Array.isArray(child)) { + for (let j = 0; j < child.length && !this._broken; ++j) { + this._traverse(child[j], node); + } + } else { + this._traverse(child, node); + } + } + this._parents.pop(); + } + } + + if (!this._broken) { + this._leave(node, parent); + } + + this._current = parent; + } + + /** + * Calculates the keys to use for traversal. + * @param {ASTNode} node The node to read keys from. + * @returns {string[]} An array of keys to visit on the node. + * @private + */ + static getKeys(node) { + return vk.getKeys(node); + } + + /** + * Traverse the given AST tree. + * @param {ASTNode} node The root node to traverse. + * @param {Object} options The option object. + * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`. + * @param {Function} [options.enter=noop] The callback function which is called on entering each node. + * @param {Function} [options.leave=noop] The callback function which is called on leaving each node. + * @returns {void} + */ + static traverse(node, options) { + new Traverser().traverse(node, options); + } + + /** + * The default visitor keys. + * @type {Object} + */ + static get DEFAULT_VISITOR_KEYS() { + return vk.KEYS; + } +} + +module.exports = Traverser; diff --git a/day1/cli-study/node_modules/eslint/lib/shared/types.js b/day1/cli-study/node_modules/eslint/lib/shared/types.js new file mode 100644 index 0000000..bbd95d1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/shared/types.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Define common types for input completion. + * @author Toru Nagashima + */ +"use strict"; + +/** @type {any} */ +module.exports = {}; + +/** @typedef {boolean | "off" | "readable" | "readonly" | "writable" | "writeable"} GlobalConf */ +/** @typedef {0 | 1 | 2 | "off" | "warn" | "error"} SeverityConf */ +/** @typedef {SeverityConf | [SeverityConf, ...any[]]} RuleConf */ + +/** + * @typedef {Object} EcmaFeatures + * @property {boolean} [globalReturn] Enabling `return` statements at the top-level. + * @property {boolean} [jsx] Enabling JSX syntax. + * @property {boolean} [impliedStrict] Enabling strict mode always. + */ + +/** + * @typedef {Object} ParserOptions + * @property {EcmaFeatures} [ecmaFeatures] The optional features. + * @property {3|5|6|7|8|9|10|11|2015|2016|2017|2018|2019|2020} [ecmaVersion] The ECMAScript version (or revision number). + * @property {"script"|"module"} [sourceType] The source code type. + */ + +/** + * @typedef {Object} ConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {Record} [globals] The global variable settings. + * @property {string | string[]} [ignorePatterns] The glob patterns that ignore to lint. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {boolean} [root] The root flag. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} OverrideConfigData + * @property {Record} [env] The environment settings. + * @property {string | string[]} [excludedFiles] The glob pattarns for excluded files. + * @property {string | string[]} [extends] The path to other config files or the package name of shareable configs. + * @property {string | string[]} files The glob pattarns for target files. + * @property {Record} [globals] The global variable settings. + * @property {boolean} [noInlineConfig] The flag that disables directive comments. + * @property {OverrideConfigData[]} [overrides] The override settings per kind of files. + * @property {string} [parser] The path to a parser or the package name of a parser. + * @property {ParserOptions} [parserOptions] The parser options. + * @property {string[]} [plugins] The plugin specifiers. + * @property {string} [processor] The processor specifier. + * @property {boolean} [reportUnusedDisableDirectives] The flag to report unused `eslint-disable` comments. + * @property {Record} [rules] The rule settings. + * @property {Object} [settings] The shared settings. + */ + +/** + * @typedef {Object} ParseResult + * @property {Object} ast The AST. + * @property {ScopeManager} [scopeManager] The scope manager of the AST. + * @property {Record} [services] The services that the parser provides. + * @property {Record} [visitorKeys] The visitor keys of the AST. + */ + +/** + * @typedef {Object} Parser + * @property {(text:string, options:ParserOptions) => Object} parse The definition of global variables. + * @property {(text:string, options:ParserOptions) => ParseResult} [parseForESLint] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} Environment + * @property {Record} [globals] The definition of global variables. + * @property {ParserOptions} [parserOptions] The parser options that will be enabled under this environment. + */ + +/** + * @typedef {Object} LintMessage + * @property {number} column The 1-based column number. + * @property {number} [endColumn] The 1-based column number of the end location. + * @property {number} [endLine] The 1-based line number of the end location. + * @property {boolean} fatal If `true` then this is a fatal error. + * @property {{range:[number,number], text:string}} [fix] Information for autofix. + * @property {number} line The 1-based line number. + * @property {string} message The error message. + * @property {string|null} ruleId The ID of the rule which makes this message. + * @property {0|1|2} severity The severity of this message. + * @property {Array<{desc?: string, messageId?: string, fix: {range: [number, number], text: string}}>} [suggestions] Information for suggestions. + */ + +/** + * @typedef {Object} SuggestionResult + * @property {string} desc A short description. + * @property {string} [messageId] Id referencing a message for the description. + * @property {{ text: string, range: number[] }} fix fix result info + */ + +/** + * @typedef {Object} Processor + * @property {(text:string, filename:string) => Array} [preprocess] The function to extract code blocks. + * @property {(messagesList:LintMessage[][], filename:string) => LintMessage[]} [postprocess] The function to merge messages. + * @property {boolean} [supportsAutofix] If `true` then it means the processor supports autofix. + */ + +/** + * @typedef {Object} RuleMetaDocs + * @property {string} category The category of the rule. + * @property {string} description The description of the rule. + * @property {boolean} recommended If `true` then the rule is included in `eslint:recommended` preset. + * @property {string} url The URL of the rule documentation. + */ + +/** + * @typedef {Object} RuleMeta + * @property {boolean} [deprecated] If `true` then the rule has been deprecated. + * @property {RuleMetaDocs} docs The document information of the rule. + * @property {"code"|"whitespace"} [fixable] The autofix type. + * @property {Record} [messages] The messages the rule reports. + * @property {string[]} [replacedBy] The IDs of the alternative rules. + * @property {Array|Object} schema The option schema of the rule. + * @property {"problem"|"suggestion"|"layout"} type The rule type. + */ + +/** + * @typedef {Object} Rule + * @property {Function} create The factory of the rule. + * @property {RuleMeta} meta The meta data of the rule. + */ + +/** + * @typedef {Object} Plugin + * @property {Record} [configs] The definition of plugin configs. + * @property {Record} [environments] The definition of plugin environments. + * @property {Record} [processors] The definition of plugin processors. + * @property {Record} [rules] The definition of plugin rules. + */ + +/** + * Information of deprecated rules. + * @typedef {Object} DeprecatedRuleInfo + * @property {string} ruleId The rule ID. + * @property {string[]} replacedBy The rule IDs that replace this deprecated rule. + */ diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/index.js b/day1/cli-study/node_modules/eslint/lib/source-code/index.js new file mode 100644 index 0000000..76e2786 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + SourceCode: require("./source-code") +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/source-code.js b/day1/cli-study/node_modules/eslint/lib/source-code/source-code.js new file mode 100644 index 0000000..6b20495 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/source-code.js @@ -0,0 +1,586 @@ +/** + * @fileoverview Abstraction of JavaScript source code. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const + { isCommentToken } = require("eslint-utils"), + TokenStore = require("./token-store"), + astUtils = require("../shared/ast-utils"), + Traverser = require("../shared/traverser"), + lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Validates that the given AST has the required information. + * @param {ASTNode} ast The Program node of the AST to check. + * @throws {Error} If the AST doesn't contain the correct information. + * @returns {void} + * @private + */ +function validate(ast) { + if (!ast.tokens) { + throw new Error("AST is missing the tokens array."); + } + + if (!ast.comments) { + throw new Error("AST is missing the comments array."); + } + + if (!ast.loc) { + throw new Error("AST is missing location information."); + } + + if (!ast.range) { + throw new Error("AST is missing range information"); + } +} + +/** + * Check to see if its a ES6 export declaration. + * @param {ASTNode} astNode An AST node. + * @returns {boolean} whether the given node represents an export declaration. + * @private + */ +function looksLikeExport(astNode) { + return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || + astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; +} + +/** + * Merges two sorted lists into a larger sorted list in O(n) time. + * @param {Token[]} tokens The list of tokens. + * @param {Token[]} comments The list of comments. + * @returns {Token[]} A sorted list of tokens and comments. + * @private + */ +function sortedMerge(tokens, comments) { + const result = []; + let tokenIndex = 0; + let commentIndex = 0; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) { + result.push(tokens[tokenIndex++]); + } else { + result.push(comments[commentIndex++]); + } + } + + return result; +} + +/** + * Determines if two nodes or tokens overlap. + * @param {ASTNode|Token} first The first node or token to check. + * @param {ASTNode|Token} second The second node or token to check. + * @returns {boolean} True if the two nodes or tokens overlap. + * @private + */ +function nodesOrTokensOverlap(first, second) { + return (first.range[0] <= second.range[0] && first.range[1] >= second.range[0]) || + (second.range[0] <= first.range[0] && second.range[1] >= first.range[0]); +} + +/** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @param {boolean} checkInsideOfJSXText If `true` is present, check inside of JSXText tokens for backward compatibility. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ +function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { + if (nodesOrTokensOverlap(first, second)) { + return false; + } + + const [startingNodeOrToken, endingNodeOrToken] = first.range[1] <= second.range[0] + ? [first, second] + : [second, first]; + const firstToken = sourceCode.getLastToken(startingNodeOrToken) || startingNodeOrToken; + const finalToken = sourceCode.getFirstToken(endingNodeOrToken) || endingNodeOrToken; + let currentToken = firstToken; + + while (currentToken !== finalToken) { + const nextToken = sourceCode.getTokenAfter(currentToken, { includeComments: true }); + + if ( + currentToken.range[1] !== nextToken.range[0] || + + /* + * For backward compatibility, check spaces in JSXText. + * https://github.com/eslint/eslint/issues/12614 + */ + ( + checkInsideOfJSXText && + nextToken !== finalToken && + nextToken.type === "JSXText" && + /\s/u.test(nextToken.value) + ) + ) { + return true; + } + + currentToken = nextToken; + } + + return false; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +class SourceCode extends TokenStore { + + /** + * Represents parsed source code. + * @param {string|Object} textOrConfig The source code text or config object. + * @param {string} textOrConfig.text The source code text. + * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @param {Object|null} textOrConfig.parserServices The parser services. + * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code. + * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST. + * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + */ + constructor(textOrConfig, astIfNoConfig) { + let text, ast, parserServices, scopeManager, visitorKeys; + + // Process overloading. + if (typeof textOrConfig === "string") { + text = textOrConfig; + ast = astIfNoConfig; + } else if (typeof textOrConfig === "object" && textOrConfig !== null) { + text = textOrConfig.text; + ast = textOrConfig.ast; + parserServices = textOrConfig.parserServices; + scopeManager = textOrConfig.scopeManager; + visitorKeys = textOrConfig.visitorKeys; + } + + validate(ast); + super(ast.tokens, ast.comments); + + /** + * The flag to indicate that the source code has Unicode BOM. + * @type boolean + */ + this.hasBOM = (text.charCodeAt(0) === 0xFEFF); + + /** + * The original text source code. + * BOM was stripped from this text. + * @type string + */ + this.text = (this.hasBOM ? text.slice(1) : text); + + /** + * The parsed AST for the source code. + * @type ASTNode + */ + this.ast = ast; + + /** + * The parser services of this source code. + * @type {Object} + */ + this.parserServices = parserServices || {}; + + /** + * The scope of this source code. + * @type {ScopeManager|null} + */ + this.scopeManager = scopeManager || null; + + /** + * The visitor keys to traverse AST. + * @type {Object} + */ + this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS; + + // Check the source text for the presence of a shebang since it is parsed as a standard line comment. + const shebangMatched = this.text.match(astUtils.shebangPattern); + const hasShebang = shebangMatched && ast.comments.length && ast.comments[0].value === shebangMatched[1]; + + if (hasShebang) { + ast.comments[0].type = "Shebang"; + } + + this.tokensAndComments = sortedMerge(ast.tokens, ast.comments); + + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + * @type string[] + */ + this.lines = []; + this.lineStartIndices = [0]; + + const lineEndingPattern = astUtils.createGlobalLinebreakMatcher(); + let match; + + /* + * Previously, this was implemented using a regex that + * matched a sequence of non-linebreak characters followed by a + * linebreak, then adding the lengths of the matches. However, + * this caused a catastrophic backtracking issue when the end + * of a file contained a large number of non-newline characters. + * To avoid this, the current implementation just matches newlines + * and uses match.index to get the correct line start indices. + */ + while ((match = lineEndingPattern.exec(this.text))) { + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1], match.index)); + this.lineStartIndices.push(match.index + match[0].length); + } + this.lines.push(this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1])); + + // Cache for comments found using getComments(). + this._commentCache = new WeakMap(); + + // don't allow modification of this object + Object.freeze(this); + Object.freeze(this.lines); + } + + /** + * Split the source code into multiple lines based on the line delimiters. + * @param {string} text Source code as a string. + * @returns {string[]} Array of source code lines. + * @public + */ + static splitLines(text) { + return text.split(astUtils.createGlobalLinebreakMatcher()); + } + + /** + * Gets the source code for the given node. + * @param {ASTNode} [node] The AST node to get the text for. + * @param {int} [beforeCount] The number of characters before the node to retrieve. + * @param {int} [afterCount] The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + * @public + */ + getText(node, beforeCount, afterCount) { + if (node) { + return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), + node.range[1] + (afterCount || 0)); + } + return this.text; + } + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + * @public + */ + getLines() { + return this.lines; + } + + /** + * Retrieves an array containing all comments in the source code. + * @returns {ASTNode[]} An array of comment nodes. + * @public + */ + getAllComments() { + return this.ast.comments; + } + + /** + * Gets all comments for the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Object} An object containing a leading and trailing array + * of comments indexed by their position. + * @public + * @deprecated replaced by getCommentsBefore(), getCommentsAfter(), and getCommentsInside(). + */ + getComments(node) { + if (this._commentCache.has(node)) { + return this._commentCache.get(node); + } + + const comments = { + leading: [], + trailing: [] + }; + + /* + * Return all comments as leading comments of the Program node when + * there is no executable code. + */ + if (node.type === "Program") { + if (node.body.length === 0) { + comments.leading = node.comments; + } + } else { + + /* + * Return comments as trailing comments of nodes that only contain + * comments (to mimic the comment attachment behavior present in Espree). + */ + if ((node.type === "BlockStatement" || node.type === "ClassBody") && node.body.length === 0 || + node.type === "ObjectExpression" && node.properties.length === 0 || + node.type === "ArrayExpression" && node.elements.length === 0 || + node.type === "SwitchStatement" && node.cases.length === 0 + ) { + comments.trailing = this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } + + /* + * Iterate over tokens before and after node and collect comment tokens. + * Do not include comments that exist outside of the parent node + * to avoid duplication. + */ + let currentToken = this.getTokenBefore(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.start < node.parent.start)) { + break; + } + comments.leading.push(currentToken); + currentToken = this.getTokenBefore(currentToken, { includeComments: true }); + } + + comments.leading.reverse(); + + currentToken = this.getTokenAfter(node, { includeComments: true }); + + while (currentToken && isCommentToken(currentToken)) { + if (node.parent && (currentToken.end > node.parent.end)) { + break; + } + comments.trailing.push(currentToken); + currentToken = this.getTokenAfter(currentToken, { includeComments: true }); + } + } + + this._commentCache.set(node, comments); + return comments; + } + + /** + * Retrieves the JSDoc comment for a given node. + * @param {ASTNode} node The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @public + * @deprecated + */ + getJSDocComment(node) { + + /** + * Checks for the presence of a JSDoc comment for the given node and returns it. + * @param {ASTNode} astNode The AST node to get the comment for. + * @returns {Token|null} The Block comment token containing the JSDoc comment + * for the given node or null if not found. + * @private + */ + const findJSDocComment = astNode => { + const tokenBefore = this.getTokenBefore(astNode, { includeComments: true }); + + if ( + tokenBefore && + isCommentToken(tokenBefore) && + tokenBefore.type === "Block" && + tokenBefore.value.charAt(0) === "*" && + astNode.loc.start.line - tokenBefore.loc.end.line <= 1 + ) { + return tokenBefore; + } + + return null; + }; + let parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + return findJSDocComment(looksLikeExport(parent) ? parent : node); + + case "ClassExpression": + return findJSDocComment(parent.parent); + + case "ArrowFunctionExpression": + case "FunctionExpression": + if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { + while ( + !this.getCommentsBefore(parent).length && + !/Function/u.test(parent.type) && + parent.type !== "MethodDefinition" && + parent.type !== "Property" + ) { + parent = parent.parent; + + if (!parent) { + break; + } + } + + if (parent && parent.type !== "FunctionDeclaration" && parent.type !== "Program") { + return findJSDocComment(parent); + } + } + + return findJSDocComment(node); + + // falls through + default: + return null; + } + } + + /** + * Gets the deepest node containing a range index. + * @param {int} index Range index of the desired node. + * @returns {ASTNode} The node if found or null if not found. + * @public + */ + getNodeByRangeIndex(index) { + let result = null; + + Traverser.traverse(this.ast, { + visitorKeys: this.visitorKeys, + enter(node) { + if (node.range[0] <= index && index < node.range[1]) { + result = node; + } else { + this.skip(); + } + }, + leave(node) { + if (node === result) { + this.break(); + } + } + }); + + return result; + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @public + */ + isSpaceBetween(first, second) { + return isSpaceBetween(this, first, second, false); + } + + /** + * Determines if two nodes or tokens have at least one whitespace character + * between them. Order does not matter. Returns false if the given nodes or + * tokens overlap. + * For backward compatibility, this method returns true if there are + * `JSXText` tokens that contain whitespaces between the two. + * @param {ASTNode|Token} first The first node or token to check between. + * @param {ASTNode|Token} second The second node or token to check between. + * @returns {boolean} True if there is a whitespace character between + * any of the tokens found between the two given nodes or tokens. + * @deprecated in favor of isSpaceBetween(). + * @public + */ + isSpaceBetweenTokens(first, second) { + return isSpaceBetween(this, first, second, true); + } + + /** + * Converts a source text index into a (line, column) pair. + * @param {number} index The index of a character in a file + * @returns {Object} A {line, column} location object with a 0-indexed column + * @public + */ + getLocFromIndex(index) { + if (typeof index !== "number") { + throw new TypeError("Expected `index` to be a number."); + } + + if (index < 0 || index > this.text.length) { + throw new RangeError(`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`); + } + + /* + * For an argument of this.text.length, return the location one "spot" past the last character + * of the file. If the last character is a linebreak, the location will be column 0 of the next + * line; otherwise, the location will be in the next column on the same line. + * + * See getIndexFromLoc for the motivation for this special case. + */ + if (index === this.text.length) { + return { line: this.lines.length, column: this.lines[this.lines.length - 1].length }; + } + + /* + * To figure out which line rangeIndex is on, determine the last index at which rangeIndex could + * be inserted into lineIndices to keep the list sorted. + */ + const lineNumber = lodash.sortedLastIndex(this.lineStartIndices, index); + + return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] }; + } + + /** + * Converts a (line, column) pair into a range index. + * @param {Object} loc A line/column location + * @param {number} loc.line The line number of the location (1-indexed) + * @param {number} loc.column The column number of the location (0-indexed) + * @returns {number} The range index of the location in the file. + * @public + */ + getIndexFromLoc(loc) { + if (typeof loc !== "object" || typeof loc.line !== "number" || typeof loc.column !== "number") { + throw new TypeError("Expected `loc` to be an object with numeric `line` and `column` properties."); + } + + if (loc.line <= 0) { + throw new RangeError(`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`); + } + + if (loc.line > this.lineStartIndices.length) { + throw new RangeError(`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`); + } + + const lineStartIndex = this.lineStartIndices[loc.line - 1]; + const lineEndIndex = loc.line === this.lineStartIndices.length ? this.text.length : this.lineStartIndices[loc.line]; + const positionIndex = lineStartIndex + loc.column; + + /* + * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of + * the given line, provided that the line number is valid element of this.lines. Since the + * last element of this.lines is an empty string for files with trailing newlines, add a + * special case where getting the index for the first location after the end of the file + * will return the length of the file, rather than throwing an error. This allows rules to + * use getIndexFromLoc consistently without worrying about edge cases at the end of a file. + */ + if ( + loc.line === this.lineStartIndices.length && positionIndex > lineEndIndex || + loc.line < this.lineStartIndices.length && positionIndex >= lineEndIndex + ) { + throw new RangeError(`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`); + } + + return positionIndex; + } +} + +module.exports = SourceCode; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js new file mode 100644 index 0000000..7255a62 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments in reverse. + */ +module.exports = class BackwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc); + this.commentIndex = utils.search(comments, endLoc) - 1; + this.border = startLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex >= 0) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex >= 0) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[1] > comment.range[1])) { + this.current = token; + this.tokenIndex -= 1; + } else if (comment) { + this.current = comment; + this.commentIndex -= 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[0] >= this.border); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js new file mode 100644 index 0000000..454a244 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/backward-token-cursor.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Define the cursor which iterates tokens only in reverse. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only in reverse. + */ +module.exports = class BackwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getLastIndex(tokens, indexMap, endLoc); + this.indexEnd = utils.getFirstIndex(tokens, indexMap, startLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index >= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index -= 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index >= this.indexEnd) ? this.tokens[this.index] : null; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursor.js new file mode 100644 index 0000000..4e1595c --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursor.js @@ -0,0 +1,76 @@ +/** + * @fileoverview Define the abstract class about cursors which iterate tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which iterate tokens. + * + * This class has 2 abstract methods. + * + * - `current: Token | Comment | null` ... The current token. + * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`. + * + * This is similar to ES2015 Iterators. + * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable. + * + * There are the following known sub classes. + * + * - ForwardTokenCursor .......... The cursor which iterates tokens only. + * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse. + * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments. + * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse. + * - DecorativeCursor + * - FilterCursor ............ The cursor which ignores the specified tokens. + * - SkipCursor .............. The cursor which ignores the first few tokens. + * - LimitCursor ............. The cursor which limits the count of tokens. + * + */ +module.exports = class Cursor { + + /** + * Initializes this cursor. + */ + constructor() { + this.current = null; + } + + /** + * Gets the first token. + * This consumes this cursor. + * @returns {Token|Comment} The first token or null. + */ + getOneToken() { + return this.moveNext() ? this.current : null; + } + + /** + * Gets the first tokens. + * This consumes this cursor. + * @returns {(Token|Comment)[]} All tokens. + */ + getAllTokens() { + const tokens = []; + + while (this.moveNext()) { + tokens.push(this.current); + } + + return tokens; + } + + /** + * Moves this cursor to the next token. + * @returns {boolean} `true` if the next token exists. + * @abstract + */ + /* istanbul ignore next */ + moveNext() { // eslint-disable-line class-methods-use-this + throw new Error("Not implemented."); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursors.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursors.js new file mode 100644 index 0000000..30c72b6 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/cursors.js @@ -0,0 +1,90 @@ +/** + * @fileoverview Define 2 token factories; forward and backward. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const BackwardTokenCommentCursor = require("./backward-token-comment-cursor"); +const BackwardTokenCursor = require("./backward-token-cursor"); +const FilterCursor = require("./filter-cursor"); +const ForwardTokenCommentCursor = require("./forward-token-comment-cursor"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const LimitCursor = require("./limit-cursor"); +const SkipCursor = require("./skip-cursor"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * The cursor factory. + * @private + */ +class CursorFactory { + + /** + * Initializes this cursor. + * @param {Function} TokenCursor The class of the cursor which iterates tokens only. + * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments. + */ + constructor(TokenCursor, TokenCommentCursor) { + this.TokenCursor = TokenCursor; + this.TokenCommentCursor = TokenCommentCursor; + } + + /** + * Creates a base cursor instance that can be decorated by createCursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @returns {Cursor} The created base cursor. + */ + createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) { + const Cursor = includeComments ? this.TokenCommentCursor : this.TokenCursor; + + return new Cursor(tokens, comments, indexMap, startLoc, endLoc); + } + + /** + * Creates a cursor that iterates tokens with normalized options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {boolean} includeComments The flag to iterate comments as well. + * @param {Function|null} filter The predicate function to choose tokens. + * @param {number} skip The count of tokens the cursor skips. + * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + */ + createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) { + let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments); + + if (filter) { + cursor = new FilterCursor(cursor, filter); + } + if (skip >= 1) { + cursor = new SkipCursor(cursor, skip); + } + if (count >= 0) { + cursor = new LimitCursor(cursor, count); + } + + return cursor; + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +exports.forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor); +exports.backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor); diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js new file mode 100644 index 0000000..3ee7b0b --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/decorative-cursor.js @@ -0,0 +1,39 @@ +/** + * @fileoverview Define the abstract class about cursors which manipulate another cursor. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The abstract class about cursors which manipulate another cursor. + */ +module.exports = class DecorativeCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + */ + constructor(cursor) { + super(); + this.cursor = cursor; + } + + /** @inheritdoc */ + moveNext() { + const retv = this.cursor.moveNext(); + + this.current = this.cursor.current; + + return retv; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/filter-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/filter-cursor.js new file mode 100644 index 0000000..08c4f22 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/filter-cursor.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Define the cursor which ignores specified tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores specified tokens. + */ +module.exports = class FilterCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {Function} predicate The predicate function to decide tokens this cursor iterates. + */ + constructor(cursor, predicate) { + super(cursor); + this.predicate = predicate; + } + + /** @inheritdoc */ + moveNext() { + const predicate = this.predicate; + + while (super.moveNext()) { + if (predicate(this.current)) { + return true; + } + } + return false; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js new file mode 100644 index 0000000..50c7a39 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-comment-cursor.js @@ -0,0 +1,57 @@ +/** + * @fileoverview Define the cursor which iterates tokens and comments. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens and comments. + */ +module.exports = class ForwardTokenCommentCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.comments = comments; + this.tokenIndex = utils.getFirstIndex(tokens, indexMap, startLoc); + this.commentIndex = utils.search(comments, startLoc); + this.border = endLoc; + } + + /** @inheritdoc */ + moveNext() { + const token = (this.tokenIndex < this.tokens.length) ? this.tokens[this.tokenIndex] : null; + const comment = (this.commentIndex < this.comments.length) ? this.comments[this.commentIndex] : null; + + if (token && (!comment || token.range[0] < comment.range[0])) { + this.current = token; + this.tokenIndex += 1; + } else if (comment) { + this.current = comment; + this.commentIndex += 1; + } else { + this.current = null; + } + + return Boolean(this.current) && (this.border === -1 || this.current.range[1] <= this.border); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js new file mode 100644 index 0000000..e8c1860 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/forward-token-cursor.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Define the cursor which iterates tokens only. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Cursor = require("./cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only. + */ +module.exports = class ForwardTokenCursor extends Cursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc) { + super(); + this.tokens = tokens; + this.index = utils.getFirstIndex(tokens, indexMap, startLoc); + this.indexEnd = utils.getLastIndex(tokens, indexMap, endLoc); + } + + /** @inheritdoc */ + moveNext() { + if (this.index <= this.indexEnd) { + this.current = this.tokens[this.index]; + this.index += 1; + return true; + } + return false; + } + + /* + * + * Shorthand for performance. + * + */ + + /** @inheritdoc */ + getOneToken() { + return (this.index <= this.indexEnd) ? this.tokens[this.index] : null; + } + + /** @inheritdoc */ + getAllTokens() { + return this.tokens.slice(this.index, this.indexEnd + 1); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/index.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/index.js new file mode 100644 index 0000000..25db8a4 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/index.js @@ -0,0 +1,627 @@ +/** + * @fileoverview Object to handle access and retrieval of tokens. + * @author Brandon Mills + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const assert = require("assert"); +const { isCommentToken } = require("eslint-utils"); +const cursors = require("./cursors"); +const ForwardTokenCursor = require("./forward-token-cursor"); +const PaddedTokenCursor = require("./padded-token-cursor"); +const utils = require("./utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const TOKENS = Symbol("tokens"); +const COMMENTS = Symbol("comments"); +const INDEX_MAP = Symbol("indexMap"); + +/** + * Creates the map from locations to indices in `tokens`. + * + * The first/last location of tokens is mapped to the index of the token. + * The first/last location of comments is mapped to the index of the next token of each comment. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @returns {Object} The map from locations to indices in `tokens`. + * @private + */ +function createIndexMap(tokens, comments) { + const map = Object.create(null); + let tokenIndex = 0; + let commentIndex = 0; + let nextStart = 0; + let range = null; + + while (tokenIndex < tokens.length || commentIndex < comments.length) { + nextStart = (commentIndex < comments.length) ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + tokenIndex += 1; + } + + nextStart = (tokenIndex < tokens.length) ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER; + while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) { + map[range[0]] = tokenIndex; + map[range[1] - 1] = tokenIndex; + commentIndex += 1; + } + } + + return map; +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.skip=0] The count of tokens the cursor skips. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let skip = 0; + let filter = null; + + if (typeof opts === "number") { + skip = opts | 0; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + skip = opts.skip | 0; + filter = opts.filter || null; + } + assert(skip >= 0, "options.skip should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1); +} + +/** + * Creates the cursor iterates tokens with options. + * @param {CursorFactory} factory The cursor factory to initialize cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) { + let includeComments = false; + let count = 0; + let countExists = false; + let filter = null; + + if (typeof opts === "number") { + count = opts | 0; + countExists = true; + } else if (typeof opts === "function") { + filter = opts; + } else if (opts) { + includeComments = !!opts.includeComments; + count = opts.count | 0; + countExists = typeof opts.count === "number"; + filter = opts.filter || null; + } + assert(count >= 0, "options.count should be zero or a positive integer."); + assert(!filter || typeof filter === "function", "options.filter should be a function."); + + return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1); +} + +/** + * Creates the cursor iterates tokens with options. + * This is overload function of the below. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`. + * @param {boolean} [opts.includeComments] The flag to iterate comments as well. + * @param {Function|null} [opts.filter=null] The predicate function to choose tokens. + * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility. + * @returns {Cursor} The created cursor. + * @private + */ +/** + * Creates the cursor iterates tokens with options. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Cursor} The created cursor. + * @private + */ +function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") { + return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc); + } + if (typeof beforeCount === "number" || typeof beforeCount === "undefined") { + return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount | 0, afterCount | 0); + } + return createCursorWithCount(cursors.forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount); +} + +/** + * Gets comment tokens that are adjacent to the current cursor position. + * @param {Cursor} cursor A cursor instance. + * @returns {Array} An array of comment tokens adjacent to the current cursor position. + * @private + */ +function getAdjacentCommentTokensFromCursor(cursor) { + const tokens = []; + let currentToken = cursor.getOneToken(); + + while (currentToken && isCommentToken(currentToken)) { + tokens.push(currentToken); + currentToken = cursor.getOneToken(); + } + + return tokens; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The token store. + * + * This class provides methods to get tokens by locations as fast as possible. + * The methods are a part of public API, so we should be careful if it changes this class. + * + * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens. + * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments. + * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost. + * This uses binary-searching instead for comments. + */ +module.exports = class TokenStore { + + /** + * Initializes this token store. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + */ + constructor(tokens, comments) { + this[TOKENS] = tokens; + this[COMMENTS] = comments; + this[INDEX_MAP] = createIndexMap(tokens, comments); + } + + //-------------------------------------------------------------------------- + // Gets single token. + //-------------------------------------------------------------------------- + + /** + * Gets the token starting at the specified index. + * @param {number} offset Index of the start of the token's range. + * @param {Object} [options=0] The option object. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @returns {Token|null} The token starting at index, or null if no such token. + */ + getTokenByRangeStart(offset, options) { + const includeComments = options && options.includeComments; + const token = cursors.forward.createBaseCursor( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + offset, + -1, + includeComments + ).getOneToken(); + + if (token && token.range[0] === offset) { + return token; + } + return null; + } + + /** + * Gets the first token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.skip=0] The count of tokens the cursor skips. + * @returns {Token|null} An object representing the token. + */ + getFirstToken(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the last token of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastToken(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenBefore(node, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getTokenAfter(node, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getOneToken(); + } + + /** + * Gets the first token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getFirstTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the last token between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken() + * @returns {Token|null} An object representing the token. + */ + getLastTokenBetween(left, right, options) { + return createCursorWithSkip( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getOneToken(); + } + + /** + * Gets the token that precedes a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentBefore(node, skip) { + return this.getTokenBefore(node, { includeComments: true, skip }); + } + + /** + * Gets the token that follows a given node or token in the token stream. + * This is defined for backward compatibility. Use `includeComments` option instead. + * TODO: We have a plan to remove this in a future major version. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number} [skip=0] A number of tokens to skip. + * @returns {Token|null} An object representing the token. + * @deprecated + */ + getTokenOrCommentAfter(node, skip) { + return this.getTokenAfter(node, { includeComments: true, skip }); + } + + //-------------------------------------------------------------------------- + // Gets multiple tokens. + //-------------------------------------------------------------------------- + + /** + * Gets the first `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens. + */ + getFirstTokens(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens of the given node. + * @param {ASTNode} node The AST node. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getLastTokens(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that precedes a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensBefore(node, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + node.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets the `count` tokens that follows a given node or token. + * @param {ASTNode|Token|Comment} node The AST node or token. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens. + */ + getTokensAfter(node, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[1], + -1, + options + ).getAllTokens(); + } + + /** + * Gets the first `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getFirstTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens(); + } + + /** + * Gets the last `count` tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens() + * @returns {Token[]} Tokens between left and right. + */ + getLastTokensBetween(left, right, options) { + return createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + options + ).getAllTokens().reverse(); + } + + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Array of objects representing tokens. + */ + /** + * Gets all tokens that are related to the given node. + * @param {ASTNode} node The AST node. + * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. + * @param {int} [afterCount=0] The number of tokens after the node to retrieve. + * @returns {Token[]} Array of objects representing tokens. + */ + getTokens(node, beforeCount, afterCount) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + node.range[0], + node.range[1], + beforeCount, + afterCount + ).getAllTokens(); + } + + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {Function|Object} options The option object. If this is a function then it's `options.filter`. + * @param {boolean} [options.includeComments=false] The flag to iterate comments as well. + * @param {Function|null} [options.filter=null] The predicate function to choose tokens. + * @param {number} [options.count=0] The maximum count of tokens the cursor iterates. + * @returns {Token[]} Tokens between left and right. + */ + /** + * Gets all of the tokens between two non-overlapping nodes. + * @param {ASTNode|Token|Comment} left Node before the desired token range. + * @param {ASTNode|Token|Comment} right Node after the desired token range. + * @param {int} [padding=0] Number of extra tokens on either side of center. + * @returns {Token[]} Tokens between left and right. + */ + getTokensBetween(left, right, padding) { + return createCursorWithPadding( + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + left.range[1], + right.range[0], + padding, + padding + ).getAllTokens(); + } + + //-------------------------------------------------------------------------- + // Others. + //-------------------------------------------------------------------------- + + /** + * Checks whether any comments exist or not between the given 2 nodes. + * @param {ASTNode} left The node to check. + * @param {ASTNode} right The node to check. + * @returns {boolean} `true` if one or more comments exist. + */ + commentsExistBetween(left, right) { + const index = utils.search(this[COMMENTS], left.range[1]); + + return ( + index < this[COMMENTS].length && + this[COMMENTS][index].range[1] <= right.range[0] + ); + } + + /** + * Gets all comment tokens directly before the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsBefore(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.backward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + -1, + nodeOrToken.range[0], + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor).reverse(); + } + + /** + * Gets all comment tokens directly after the given node or token. + * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsAfter(nodeOrToken) { + const cursor = createCursorWithCount( + cursors.forward, + this[TOKENS], + this[COMMENTS], + this[INDEX_MAP], + nodeOrToken.range[1], + -1, + { includeComments: true } + ); + + return getAdjacentCommentTokensFromCursor(cursor); + } + + /** + * Gets all comment tokens inside the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Array} An array of comments in occurrence order. + */ + getCommentsInside(node) { + return this.getTokens(node, { + includeComments: true, + filter: isCommentToken + }); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/limit-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/limit-cursor.js new file mode 100644 index 0000000..0fd92a7 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/limit-cursor.js @@ -0,0 +1,40 @@ +/** + * @fileoverview Define the cursor which limits the number of tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which limits the number of tokens. + */ +module.exports = class LimitCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor iterates. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + if (this.count > 0) { + this.count -= 1; + return super.moveNext(); + } + return false; + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js new file mode 100644 index 0000000..89349fa --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/padded-token-cursor.js @@ -0,0 +1,38 @@ +/** + * @fileoverview Define the cursor which iterates tokens only, with inflated range. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ForwardTokenCursor = require("./forward-token-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The cursor which iterates tokens only, with inflated range. + * This is for the backward compatibility of padding options. + */ +module.exports = class PaddedTokenCursor extends ForwardTokenCursor { + + /** + * Initializes this cursor. + * @param {Token[]} tokens The array of tokens. + * @param {Comment[]} comments The array of comments. + * @param {Object} indexMap The map from locations to indices in `tokens`. + * @param {number} startLoc The start location of the iteration range. + * @param {number} endLoc The end location of the iteration range. + * @param {number} beforeCount The number of tokens this cursor iterates before start. + * @param {number} afterCount The number of tokens this cursor iterates after end. + */ + constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) { + super(tokens, comments, indexMap, startLoc, endLoc); + this.index = Math.max(0, this.index - beforeCount); + this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/skip-cursor.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/skip-cursor.js new file mode 100644 index 0000000..f068f53 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/skip-cursor.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Define the cursor which ignores the first few tokens. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const DecorativeCursor = require("./decorative-cursor"); + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The decorative cursor which ignores the first few tokens. + */ +module.exports = class SkipCursor extends DecorativeCursor { + + /** + * Initializes this cursor. + * @param {Cursor} cursor The cursor to be decorated. + * @param {number} count The count of tokens this cursor skips. + */ + constructor(cursor, count) { + super(cursor); + this.count = count; + } + + /** @inheritdoc */ + moveNext() { + while (this.count > 0) { + this.count -= 1; + if (!super.moveNext()) { + return false; + } + } + return super.moveNext(); + } +}; diff --git a/day1/cli-study/node_modules/eslint/lib/source-code/token-store/utils.js b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/utils.js new file mode 100644 index 0000000..21e1d6f --- /dev/null +++ b/day1/cli-study/node_modules/eslint/lib/source-code/token-store/utils.js @@ -0,0 +1,100 @@ +/** + * @fileoverview Define utility functions for token store. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets `token.range[0]` from the given token. + * @param {Node|Token|Comment} token The token to get. + * @returns {number} The start location. + * @private + */ +function getStartLocation(token) { + return token.range[0]; +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * Binary-searches the index of the first token which is after the given location. + * If it was not found, this returns `tokens.length`. + * @param {(Token|Comment)[]} tokens It searches the token in this list. + * @param {number} location The location to search. + * @returns {number} The found index or `tokens.length`. + */ +exports.search = function search(tokens, location) { + return lodash.sortedIndexBy( + tokens, + { range: [location] }, + getStartLocation + ); +}; + +/** + * Gets the index of the `startLoc` in `tokens`. + * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} startLoc The location to get an index. + * @returns {number} The index. + */ +exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { + if (startLoc in indexMap) { + return indexMap[startLoc]; + } + if ((startLoc - 1) in indexMap) { + const index = indexMap[startLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, +1 is unnecessary. + */ + if (token && token.range[0] >= startLoc) { + return index; + } + return index + 1; + } + return 0; +}; + +/** + * Gets the index of the `endLoc` in `tokens`. + * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well. + * @param {(Token|Comment)[]} tokens The tokens to find an index. + * @param {Object} indexMap The map from locations to indices. + * @param {number} endLoc The location to get an index. + * @returns {number} The index. + */ +exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { + if (endLoc in indexMap) { + return indexMap[endLoc] - 1; + } + if ((endLoc - 1) in indexMap) { + const index = indexMap[endLoc - 1]; + const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + + /* + * For the map of "comment's location -> token's index", it points the next token of a comment. + * In that case, -1 is necessary. + */ + if (token && token.range[1] > endLoc) { + return index - 1; + } + return index; + } + return tokens.length - 1; +}; diff --git a/day1/cli-study/node_modules/eslint/messages/all-files-ignored.txt b/day1/cli-study/node_modules/eslint/messages/all-files-ignored.txt new file mode 100644 index 0000000..3f4c8ce --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/all-files-ignored.txt @@ -0,0 +1,8 @@ +You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored. + +If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint. + +If you do want to lint these files, try the following solutions: + +* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. +* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. diff --git a/day1/cli-study/node_modules/eslint/messages/extend-config-missing.txt b/day1/cli-study/node_modules/eslint/messages/extend-config-missing.txt new file mode 100644 index 0000000..f7c5f71 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/extend-config-missing.txt @@ -0,0 +1,5 @@ +ESLint couldn't find the config "<%- configName %>" to extend from. Please check that the name of the config is correct. + +The config "<%- configName %>" was referenced from the config file in "<%- importerName %>". + +If you still have problems, please stop by https://eslint.org/chat to chat with the team. diff --git a/day1/cli-study/node_modules/eslint/messages/failed-to-read-json.txt b/day1/cli-study/node_modules/eslint/messages/failed-to-read-json.txt new file mode 100644 index 0000000..b5e2b86 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/failed-to-read-json.txt @@ -0,0 +1,3 @@ +Failed to read JSON file at <%= path %>: + +<%= message %> diff --git a/day1/cli-study/node_modules/eslint/messages/file-not-found.txt b/day1/cli-study/node_modules/eslint/messages/file-not-found.txt new file mode 100644 index 0000000..639498e --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/file-not-found.txt @@ -0,0 +1,2 @@ +No files matching the pattern "<%= pattern %>"<% if (globDisabled) { %> (with disabling globs)<% } %> were found. +Please check for typing mistakes in the pattern. diff --git a/day1/cli-study/node_modules/eslint/messages/no-config-found.txt b/day1/cli-study/node_modules/eslint/messages/no-config-found.txt new file mode 100644 index 0000000..f1f7beb --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/no-config-found.txt @@ -0,0 +1,7 @@ +ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: + + eslint --init + +ESLint looked for configuration files in <%= directoryPath %> and its ancestors. If it found none, it then looked in your home directory. + +If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat diff --git a/day1/cli-study/node_modules/eslint/messages/plugin-conflict.txt b/day1/cli-study/node_modules/eslint/messages/plugin-conflict.txt new file mode 100644 index 0000000..f8b6063 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/plugin-conflict.txt @@ -0,0 +1,7 @@ +ESLint couldn't determine the plugin "<%- pluginId %>" uniquely. +<% for (const { filePath, importerName } of plugins) { %> +- <%= filePath %> (loaded in "<%= importerName %>")<% } %> + +Please remove the "plugins" setting from either config or remove either plugin installation. + +If you still can't figure out the problem, please stop by https://eslint.org/chat to chat with the team. diff --git a/day1/cli-study/node_modules/eslint/messages/plugin-missing.txt b/day1/cli-study/node_modules/eslint/messages/plugin-missing.txt new file mode 100644 index 0000000..3d37673 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/plugin-missing.txt @@ -0,0 +1,11 @@ +ESLint couldn't find the plugin "<%- pluginName %>". + +(The package "<%- pluginName %>" was not found when loaded as a Node module from the directory "<%- resolvePluginsRelativeTo %>".) + +It's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm install <%- pluginName %>@latest --save-dev + +The plugin "<%- pluginName %>" was referenced from the config file in "<%- importerName %>". + +If you still can't figure out the problem, please stop by https://eslint.org/chat to chat with the team. diff --git a/day1/cli-study/node_modules/eslint/messages/print-config-with-directory-path.txt b/day1/cli-study/node_modules/eslint/messages/print-config-with-directory-path.txt new file mode 100644 index 0000000..1afc9b1 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/print-config-with-directory-path.txt @@ -0,0 +1,2 @@ +The '--print-config' CLI option requires a path to a source code file rather than a directory. +See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config diff --git a/day1/cli-study/node_modules/eslint/messages/whitespace-found.txt b/day1/cli-study/node_modules/eslint/messages/whitespace-found.txt new file mode 100644 index 0000000..7d72149 --- /dev/null +++ b/day1/cli-study/node_modules/eslint/messages/whitespace-found.txt @@ -0,0 +1,3 @@ +ESLint couldn't find the plugin "<%- pluginName %>". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. + +If you still can't figure out the problem, please stop by https://eslint.org/chat to chat with the team. diff --git a/day1/cli-study/node_modules/eslint/package.json b/day1/cli-study/node_modules/eslint/package.json new file mode 100644 index 0000000..9db304a --- /dev/null +++ b/day1/cli-study/node_modules/eslint/package.json @@ -0,0 +1,180 @@ +{ + "_from": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "_id": "eslint@7.3.1", + "_inBundle": false, + "_integrity": "sha512-cQC/xj9bhWUcyi/RuMbRtC3I0eW8MH0jhRELSvpKYkWep3C6YZ2OkvcvJVUeO6gcunABmzptbXBuDoXsjHmfTA==", + "_location": "/eslint", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "name": "eslint", + "escapedName": "eslint", + "rawSpec": "^5.16.0 || ^6.8.0 || ^7.2.0", + "saveSpec": null, + "fetchSpec": "^5.16.0 || ^6.8.0 || ^7.2.0" + }, + "_requiredBy": [ + "#DEV:/", + "#USER" + ], + "_resolved": "https://registry.npmjs.org/eslint/-/eslint-7.3.1.tgz", + "_shasum": "76392bd7e44468d046149ba128d1566c59acbe19", + "_spec": "eslint@^5.16.0 || ^6.8.0 || ^7.2.0", + "_where": "F:\\前端学习\\cli-study", + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "bugs": { + "url": "https://github.com/eslint/eslint/issues/" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "deprecated": false, + "description": "An AST-based pattern checker for JavaScript.", + "devDependencies": { + "@babel/core": "^7.4.3", + "@babel/preset-env": "^7.4.3", + "acorn": "^7.2.0", + "babel-loader": "^8.0.5", + "chai": "^4.0.1", + "cheerio": "^0.22.0", + "common-tags": "^1.8.0", + "core-js": "^3.1.3", + "dateformat": "^3.0.3", + "ejs": "^3.0.2", + "escape-string-regexp": "^3.0.0", + "eslint": "file:.", + "eslint-config-eslint": "file:packages/eslint-config-eslint", + "eslint-plugin-eslint-plugin": "^2.2.1", + "eslint-plugin-internal-rules": "file:tools/internal-rules", + "eslint-plugin-jsdoc": "^22.1.0", + "eslint-plugin-node": "^11.1.0", + "eslint-release": "^2.0.0", + "eslump": "^2.0.0", + "esprima": "^4.0.1", + "glob": "^7.1.6", + "jsdoc": "^3.5.5", + "karma": "^4.0.1", + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^1.3.0", + "karma-mocha-reporter": "^2.2.3", + "karma-webpack": "^4.0.0-rc.6", + "leche": "^2.2.3", + "lint-staged": "^10.1.2", + "load-perf": "^0.2.0", + "markdownlint": "^0.19.0", + "markdownlint-cli": "^0.22.0", + "memfs": "^3.0.1", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.23.0", + "npm-license": "^0.3.3", + "nyc": "^15.0.1", + "proxyquire": "^2.0.1", + "puppeteer": "^2.1.1", + "recast": "^0.19.0", + "regenerator-runtime": "^0.13.2", + "shelljs": "^0.8.2", + "sinon": "^9.0.1", + "temp": "^0.9.0", + "webpack": "^4.35.0", + "webpack-cli": "^3.3.5", + "yorkie": "^2.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "LICENSE", + "README.md", + "bin", + "conf", + "lib", + "messages" + ], + "funding": "https://opencollective.com/eslint", + "gitHooks": { + "pre-commit": "lint-staged" + }, + "homepage": "https://eslint.org", + "keywords": [ + "ast", + "lint", + "javascript", + "ecmascript", + "espree" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ], + "*.md": "markdownlint" + }, + "main": "./lib/api.js", + "name": "eslint", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/eslint.git" + }, + "scripts": { + "docs": "node Makefile.js docs", + "fix": "node Makefile.js lint -- fix", + "fuzz": "node Makefile.js fuzz", + "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", + "generate-betarelease": "node Makefile.js generatePrerelease -- beta", + "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", + "generate-release": "node Makefile.js generateRelease", + "gensite": "node Makefile.js gensite", + "lint": "node Makefile.js lint", + "perf": "node Makefile.js perf", + "publish-release": "node Makefile.js publishRelease", + "test": "node Makefile.js test", + "test:cli": "mocha", + "webpack": "node Makefile.js webpack" + }, + "version": "7.3.1" +} diff --git a/day1/cli-study/node_modules/espree/CHANGELOG.md b/day1/cli-study/node_modules/espree/CHANGELOG.md new file mode 100644 index 0000000..3b3b369 --- /dev/null +++ b/day1/cli-study/node_modules/espree/CHANGELOG.md @@ -0,0 +1,492 @@ +v7.1.0 - June 4, 2020 + +* [`75e80bc`](https://github.com/eslint/espree/commit/75e80bc1b5a100f64b09b2c7bf47c5168417d890) Update: support `??` operator, `import.meta`, and `export * as ns` (#441) (Toru Nagashima) +* [`ad0543c`](https://github.com/eslint/espree/commit/ad0543c8b9f6981857ebebf23a37589a656e61a6) Chore: added fixlint in Makefile.js (#440) (Anix) + +v7.0.0 - May 7, 2020 + +* [`8fe2efc`](https://github.com/eslint/espree/commit/8fe2efc00902e7f1680af00a6279e1aecb3c5b47) Breaking: drop Node v8 support (#429) (Kai Cataldo) +* [`6048bfe`](https://github.com/eslint/espree/commit/6048bfe3939fa7dc162c0b3c4b043bb410736b0b) Docs: documenting public API (fixes #431) (#442) (Anix) +* [`9a4cff3`](https://github.com/eslint/espree/commit/9a4cff3626d50a88428ca1b66610a2bdedd774dd) Chore: added tests for options normalize (#439) (Anix) +* [`99707f3`](https://github.com/eslint/espree/commit/99707f3f9d337ca719dce5720106f98b65bba7b1) Chore: added lockfiles to .gitignore (#438) (Anix) +* [`9b91bcc`](https://github.com/eslint/espree/commit/9b91bccacea15c75025a62bae828f83598aef5fe) Docs: new site for docs (#436) (Anix) + +v6.2.1 - March 10, 2020 + +* [`d6d7480`](https://github.com/eslint/espree/commit/d6d7480e424960159007caea86f209f696138734) Upgrade: acorn 7.1.1, Regex DOS vuln (fixes #435) (#434) (James) + +v6.2.0 - March 2, 2020 + +* [`ced1b68`](https://github.com/eslint/espree/commit/ced1b6810b991531e6d3788ebd5a322fc5c7d463) Update: update acorn-jsx and fix failing test (#432) (Kai Cataldo) +* [`acb8776`](https://github.com/eslint/espree/commit/acb8776d369abf9e02f79142879e9b1a4774f938) Update: add latestEcmaVersion & supportedEcmaVersions (#430) (Kai Cataldo) + +v6.1.2 - October 20, 2019 + +* [`70c4970`](https://github.com/eslint/espree/commit/70c4970e5eba6f060e1e32a22d231647f2d0e0f8) Fix: misuse token types (fixes #393, refs eslint/eslint#11018) (#426) (Toru Nagashima) + +v6.1.1 - August 23, 2019 + +* [`ba81546`](https://github.com/eslint/espree/commit/ba81546e8552ec0f779aae7e03668c334630484e) Upgrade: dev deps to latest (#424) (薛定谔的猫) +* [`bbe0119`](https://github.com/eslint/espree/commit/bbe01195fb57e24634d18825d39b820ed1767e95) Upgrade: acorn-jsx@5.0.2 (#423) (薛定谔的猫) +* [`c0635ba`](https://github.com/eslint/espree/commit/c0635bac4cd891cb612fb81655012e2579f4e2b1) Docs: update readme to mention ES2020 (#422) (Kai Cataldo) + +v6.1.0 - August 18, 2019 + +* [`9870c55`](https://github.com/eslint/espree/commit/9870c553efd3eb1bd22b4b3bb5220896c5cb6933) Update: improve error messaging when validating ecmaVersion (#421) (Kai Cataldo) +* [`3f49224`](https://github.com/eslint/espree/commit/3f49224eb05f6b8cb1b996ce424a99c40978b389) Fix: tokenize the latest right curly brace (fixes #403) (#419) (finico) +* [`f5e58cc`](https://github.com/eslint/espree/commit/f5e58cc5e9030793baca3426366b8d7286ef5b89) Update: support bigint and dynamic import (#415) (Toru Nagashima) + +v6.0.0 - June 21, 2019 + +* [`a988a36`](https://github.com/eslint/espree/commit/a988a36e436a1ab6c84005ba0adb6cf9c262c1ec) Build: add node 12 (#414) (薛定谔的猫) + +v6.0.0-alpha.0 - April 12, 2019 + +* [`493d464`](https://github.com/eslint/espree/commit/493d464e1564aea0ea33000389771d42ddece2cb) Breaking: validate parser options (fixes #384) (#412) (薛定谔的猫) + +v5.0.1 - February 15, 2019 + +* [`c40e2fc`](https://github.com/eslint/espree/commit/c40e2fcedf81ff06151e82bdf655d2d0d29e71b8) Upgrade: acorn@6.0.7 (#407) (Kai Cataldo) + +v5.0.0 - December 5, 2018 + +* [`1bcd563`](https://github.com/eslint/espree/commit/1bcd563d4eb4b4032d2662cc5ccd3bfd841b39d7) Breaking: remove attachComment (#405) (Kai Cataldo) +* [`35623ee`](https://github.com/eslint/espree/commit/35623ee07289c9199eef8b735c97cb3d3d08d5b8) Chore: update linting config (#406) (Kai Cataldo) +* [`4b86a7d`](https://github.com/eslint/espree/commit/4b86a7dc7c447c11bb6530e46dc43428ce2bd372) Build: add node 11 (#400) (薛定谔的猫) +* [`7c278d6`](https://github.com/eslint/espree/commit/7c278d6acc6b5db86b803d0cd21b830deb6f569e) Fix: build failing due to incorrectly super() call (fixes #398) (#399) (薛定谔的猫) +* [`6ebc219`](https://github.com/eslint/espree/commit/6ebc21947166399a0b4918d4a1beb9d610650336) Upgrade: eslint & eslint-config-eslint (#387) (薛定谔的猫) + +v4.1.0 - October 24, 2018 + +* 8eadb88 Upgrade: acorn 6, acorn-jsx 5, and istanbul (#391) (Toru Nagashima) +* 0f2edb8 Upgrade: eslint-release@1.0.0 (#392) (Teddy Katz) +* 560b6f7 Update: VisitorKeys depend on eslint-visitor-keys (#389) (othree) +* 6bf2ebf Docs: Fix some typos in the README (#386) (Hugo Locurcio) + +v4.0.0 - June 21, 2018 + + + +v4.0.0-rc.0 - June 9, 2018 + +* d8224c4 Build: Adding rc release script to package.json (#383) (Kevin Partington) +* 4207773 Build: add node 10 (#381) (薛定谔的猫) +* cd9da7e Update: upgrade acorn to support two ES2019 syntax (#380) (Toru Nagashima) +* 8cb3ceb Chore: remove Object.assign polyfill (#382) (薛定谔的猫) + +v4.0.0-alpha.1 - May 28, 2018 + +* 56c5a9c Fix: remove workarounds for acorn < 4 (#372) (Rouven Weßling) +* fd305e5 Upgrade: eslint-release to v0.11.1 (#376) (Teddy Katz) + +v4.0.0-alpha.0 - March 30, 2018 + +* 95fa890 Build: fix typos in package.json release scripts (#375) (Teddy Katz) +* 6284e09 Breaking: remove experimentalObjectRestSpread option (#374) (Teddy Katz) +* 0df063f Breaking: require Node.js 6+, upgrade acorn-jsx@4.1.1 (fixes #345) (#371) (薛定谔的猫) +* 0252144 Upgrade: acorn 5.5.1 (#370) (Rouven Weßling) + +v3.5.4 - March 4, 2018 + +* 706167b Upgrade: acorn 5.5.0 (#369) (Toru Nagashima) + +v3.5.3 - February 2, 2018 + +* 70f9859 Upgrade: acorn 5.4.0 (#367) (Toru Nagashima) +* cea4823 Chore: Adding .gitattributes file (#366) (Kevin Partington) +* 4160aee Upgrade: acorn v5.3.0 (#365) (Toru Nagashima) + +v3.5.2 - November 10, 2017 + +* 019b70a Fix: Remove blockBindings from docs (fixes #307, fixes #339) (#356) (Jan Pilzer) +* b2016cb Chore: refactoring rest/spread properties (#361) (Toru Nagashima) +* 59c9d06 Chore: upgrade acorn@5.2 (fixes #358) (#360) (Toru Nagashima) +* 06c35c9 Chore: add .npmrc (#359) (Toru Nagashima) + +v3.5.1 - September 15, 2017 + +* 5eb1388 Fix: Fix parsing of async keyword-named object methods (#352) (#353) (Mark Banner) + +v3.5.0 - August 5, 2017 + +* 4d442a1 Update: add initial support for ES2018 (#348) (Teddy Katz) +* d4bdcb6 Fix: Make template token objects adhere to token object structure (#343) (Ian Christian Myers) +* 9ac671a Upgrade: acorn to 5.1.1 (#347) (Teddy Katz) +* 16e1fec Docs: Specify default values of options (fixes #325) (#342) (Jan Pilzer) +* be85b8e Fix: async shorthand properties (fixes #340) (#341) (Toru Nagashima) + +v3.4.3 - May 5, 2017 + +* 343590a Fix: add AwaitExpression to espree.Syntax (fixes #331) (#332) (Teddy Katz) + +v3.4.2 - April 21, 2017 + +* c99e436 Upgrade: eslint to 2.13.1 (#328) (Teddy Katz) +* 628cf3a Fix: don't mutate user-provided configs (fixes #329) (#330) (Teddy Katz) + +v3.4.1 - March 31, 2017 + +* a3ae0bd Upgrade: acorn to 5.0.1 (#327) (Teddy Katz) +* 15ef24f Docs: Add badges (#326) (Jan Pilzer) +* 652990a Fix: raise error for trailing commas after rest properties (fixes #310) (#323) (Teddy Katz) +* 9d86ba5 Upgrade: acorn to ^4.0.11 (#317) (Toru Nagashima) +* a3442b5 Chore: fix tests for Node 6+ (#315) (Teddy Katz) + +v3.4.0 - February 2, 2017 + +* f55fa51 Build: Lock acorn to v4.0.4 (#314) (Kai Cataldo) +* 58f75be Fix:generic error for invalid ecmaVersion(fixes eslint#7405) (#303) (Scott Stern) +* d6b383d Docs: Update license copyright (Nicholas C. Zakas) +* e5df542 Update: To support year in ecmaVersion number (fixes #300) (#301) (Gyandeep Singh) + +v3.3.2 - September 29, 2016 + +* 7d3e2fc Fix: reset `isAsync` flag for each property (fixes #298) (#299) (Toru Nagashima) + +v3.3.1 - September 26, 2016 + +* 80abdce Fix: `}` token followed by template had been lost (fixes #293) (#294) (Toru Nagashima) +* 9810bab Fix: parsing error on `async` as property name. (#295) (Toru Nagashima) + +v3.3.0 - September 20, 2016 + +* 92b04b1 Update: create-test script (fixes #291) (#292) (Jamund Ferguson) + +v3.2.0 - September 16, 2016 + +* 5a37f80 Build: Update release tool (Nicholas C. Zakas) +* 9bbcad8 Update: Upgrade Acorn to support ES2017 (fixes #287) (#290) (Jamund Ferguson) +* 8d9767d Build: Add CI release scripts (Nicholas C. Zakas) + +v3.1.7 - July 29, 2016 + +* 8f6cfbd Build: Add CI release (Nicholas C. Zakas) +* ff15922 Fix: Catch ES2016 invalid syntax (fixes #284) (#285) (Nicholas C. Zakas) + +v3.1.6 - June 15, 2016 + +* a90edc2 Upgrade: acorn 3.2.0 (fixes #279) (#280) (Toru Nagashima) + +v3.1.5 - May 27, 2016 + +* 7df2e4a Fix: Convert ~ and ! prefix tokens to esprima (fixes #274) (#276) (Daniel Tschinder) + +v3.1.4 - April 21, 2016 + +* e044705 Fix: remove extra leading comments at node level (fixes #264) (Kai Cataldo) +* 25c27fb Chore: Remove jQuery copyright from header of each file (Kai Cataldo) +* 10709f0 Chore: Add jQuery Foundation copyright (Nicholas C. Zakas) +* d754b32 Upgrade: Acorn 3.1.0 (fixes #270) (Toru Nagashima) +* 3a90886 Docs: replace a dead link with the correct contributing guide URL (Shinnosuke Watanabe) +* 55184a2 Build: replace optimist with a simple native method (Shinnosuke Watanabe) +* c7e5a13 Fix: Disallow namespaces objects in JSX (fixes #261) (Kai Cataldo) +* 22290b9 Fix: Add test for leading comments (fixes #136) (Kai Cataldo) + +v3.1.3 - March 18, 2016 + +* 98441cb Fix: Fix behavior of ignoring comments within previous nodes (refs #256) (Kai Cataldo) + +v3.1.2 - March 14, 2016 + +* a2b23ca Fix: Ensure 'var let' works (fixes #149) (Nicholas C. Zakas) +* 5783282 Fix: Make obj.await work in modules (fixes #258) (Nicholas C. Zakas) +* d1b4929 Fix: leading comments added from previous node (fixes #256) (Kai Cataldo) + +v3.1.1 - February 26, 2016 + +* 3614e81 Fix: exponentiation operator token (fixes #254) (Nicholas C. Zakas) + +v3.1.0 - February 25, 2016 + +* da35d98 New: Support ecmaVersion 7 (fixes #246) (Nicholas C. Zakas) + +v3.0.2 - February 19, 2016 + +* 0973cda Build: Update release script (Nicholas C. Zakas) +* 106000f Fix: use the plugins feature of acorn (fixes #250) (Toru Nagashima) +* 36d84c7 Build: Add tests (fixes #243) (Nicholas C. Zakas) + +v3.0.1 - February 2, 2016 + +* ecfe4c8 Upgrade: eslint-config-eslint to 3.0.0 (Nicholas C. Zakas) +* ea6261e Fix: Object rest/spread in assign (fixes #247) (Nicholas C. Zakas) +* 7e57ee0 Docs: fix `options.comment` typo (xuezu) +* dd5863e Build: Add prerelease script (Nicholas C. Zakas) +* 0b409ee Upgrade: eslint-release to 0.2.0 (Nicholas C. Zakas) + +v3.0.0 - January 20, 2016 + +* 5ff65f6 Upgrade: Change Esprima version to latest (Nicholas C. Zakas) +* a8badcc Upgrade: eslint-release to 0.1.4 (Nicholas C. Zakas) +* 34d195b Build: Switch to eslint-release (Nicholas C. Zakas) +* a0ddc30 Breaking: Remove binary scripts (Nicholas C. Zakas) +* 02b5284 Build: Fix package.json dependencies (Nicholas C. Zakas) +* b07696f Fix: tests for importing keywords (fixes #225) (Toru Nagashima) +* 2e2808a Build: Add node@5 to CI (fixes #237) (alberto) +* 445c685 Update: Unrecognized license format in package.json (fixes #234) (alberto) +* 61cb5ee Update: Remove duplicated acorn-jsx dep (fixes #232) (alberto) +* df5b71c Upgrade: eslint and eslint-config-eslint (fixes #231) (alberto) +* ef7a06d Fix: lastToken not reset between calls to parse (fixes #229) (alberto) +* cdf8407 New: ecmaFeatures.impliedStrict (fixes: #227) (Nick Evans) + +v3.0.0-alpha-2 - December 9, 2015 + +* 3.0.0-alpha-2 (Nicholas C. Zakas) +* Breaking: move ecmaFeatures into ecmaVersion (fixes #222) (Nicholas C. Zakas) +* New: Export VisitorKeys (fixes #220) (Nicholas C. Zakas) + +v3.0.0-alpha-1 - December 1, 2015 + +* 3.0.0-alpha-1 (Nicholas C. Zakas) +* Fix: parse unicode escapes in identifiers (fixes #181) (Nicholas C. Zakas) +* Fix: Ensur object rest works in destructed arg (fixes #213) (Nicholas C. Zakas) +* Breaking: Switch to Acorn (fixes #200) (Nicholas C. Zakas) +* Update: Add tokens to tests (fixes #203) (Nicholas C. Zakas) +* Docs: Update README (Nicholas C. Zakas) + +v2.2.5 - September 15, 2015 + +* 2.2.5 (Nicholas C. Zakas) +* Fix: Ensure node type is correct for destructured (fixes #195) (Nicholas C. Zakas) + +v2.2.4 - August 13, 2015 + +* 2.2.4 (Nicholas C. Zakas) +* Fix: newlines in arrow functions (fixes #172) (Jamund Ferguson) +* Fix: nested arrow function as default param (fixes #145) (Jamund Ferguson) +* Fix: Rest Params & Arrow Functions (fixes #187) (Jamund Ferguson) +* Fix: trailing commas in import/export (fixes #148) (Jamund Ferguson) +* Build: Added sudo false to Travis to build faster (fixes #177) (KahWee Teng) + +v2.2.3 - July 22, 2015 + +* 2.2.3 (Nicholas C. Zakas) +* Fix: Incorrect error location (fixes #173) (Nicholas C. Zakas) + +v2.2.2 - July 16, 2015 + +* 2.2.2 (Nicholas C. Zakas) +* 2.2.1 (Nicholas C. Zakas) +* Fix: Yield as identifier in arrow func args (fixes #165) (Nicholas C. Zakas) +* Fix: Allow AssignmentExpression in object spread (fixes #167) (Nicholas C. Zakas) + +v2.2.1 - July 16, 2015 + +* 2.2.1 (Nicholas C. Zakas) + +v2.2.0 - July 15, 2015 + +* 2.2.0 (Nicholas C. Zakas) +* New: Add experimental object rest/spread (fixes #163) (Nicholas C. Zakas) +* Fix: npm browserify (fixes #156) (Jason Laster) + +v2.1.0 - July 10, 2015 + +* 2.1.0 (Nicholas C. Zakas) +* Fix: Leading comments for anonymous classes (fixes #155, fixes #158) (Toru Nagashima) +* New: Add newTarget option (fixes #157) (Nicholas C. Zakas) + +v2.0.4 - June 26, 2015 + +* 2.0.4 (Nicholas C. Zakas) +* Docs: added missing `ecmaFeatures.superInFunctions` option from doc (Clément Fiorio) +* Fix: "await" is a future reserved word (fixes #151) (Jose Roberto Vidal) + +v2.0.3 - June 2, 2015 + +* 2.0.3 (Nicholas C. Zakas) +* Fix: Incomplete Switch Statement Hangs (Fixes #146) (Jamund Ferguson) +* Docs: Clarify ecmaFeatures usage (Dan Wolff) + +v2.0.2 - April 28, 2015 + +* 2.0.2 (Nicholas C. Zakas) +* Fix: Allow yield without value as function param (fixes #134) (Nicholas C. Zakas) +* Fix: Allow computed generators in classes (fixes #123) (Nicholas C. Zakas) +* Fix: Don't allow arrow function rest param (fixes #130) (Nicholas C. Zakas) + +v2.0.1 - April 11, 2015 + +* 2.0.1 (Nicholas C. Zakas) +* Fix: Yield should parse without an argument (fixes #121) (Nicholas C. Zakas) + +v2.0.0 - April 4, 2015 + +* 2.0.0 (Nicholas C. Zakas) +* Docs: Update README with latest info (Nicholas C. Zakas) +* Breaking: Use ESTree format for default params (fixes #114) (Nicholas C. Zakas) +* New: Add Super node (fixes #115) (Nicholas C. Zakas) +* Breaking: Switch to RestElement for rest args (fixes #84) (Nicholas C. Zakas) +* Docs: Correct license info on README (fixes #117) (AJ Ortega) +* Breaking: Remove guardedHandlers/handlers from try (fixes #71) (Nicholas C. Zakas) + +v1.12.3 - March 28, 2015 + +* 1.12.3 (Nicholas C. Zakas) +* Fix: Tagged template strings (fixes #110) (Nicholas C. Zakas) + +v1.12.2 - March 21, 2015 + +* 1.12.2 (Nicholas C. Zakas) +* Fix: Destructured arg for catch (fixes #105) (Nicholas C. Zakas) + +v1.12.1 - March 21, 2015 + +* 1.12.1 (Nicholas C. Zakas) +* Fix: Disallow octals in template strings (fixes #96) (Nicholas C. Zakas) +* Fix: Template string parsing (fixes #95) (Nicholas C. Zakas) +* Fix: shorthand properties named get or set (fixes #100) (Brandon Mills) +* Fix: bad error in parsing invalid class setter (fixes #98) (Marsup) + +v1.12.0 - March 14, 2015 + +* 1.12.0 (Nicholas C. Zakas) +* Fix: Update broken tests (Nicholas C. Zakas) +* New: Add sourceType to Program node (fixes #93) (Nicholas C. Zakas) +* Allow spread in more places (fixes #89) (Nicholas C. Zakas) +* Fix: Deeply nested template literals (fixes #86) (Nicholas C. Zakas) +* Fix: Allow super in classes by default (fixes #87) (Nicholas C. Zakas) +* Fix: generator methods in classes (fixes #85) (Jamund Ferguson) +* Remove XJS note from Esprima-FB incompatibilities (Joe Lencioni) + +v1.11.0 - March 7, 2015 + +* 1.11.0 (Nicholas C. Zakas) +* Fix: Don't allow default export class by mistake (fixes #82) (Nicholas C. Zakas) +* Fix: Export default function should be FunctionDeclaration (fixes #81) (Nicholas C. Zakas) +* Fix: Ensure class declarations must have IDs outside of exports (refs #72) (Nicholas C. Zakas) +* Fix: export class expression support (refs #72) (Jamund Ferguson) +* Update: Add tests for sourceType=module (refs #72) (Nicholas C. Zakas) +* Fix: Class name should be id (fixes #78) (Nicholas C. Zakas) +* Fix: disallow import/export in functions (refs #72) (Jamund Ferguson) +* Test: strict mode enforced in modules (refs #72) (Jamund Ferguson) +* New: Add modules feature flag (refs #72) (Nicholas C. Zakas) +* merging upstream and solving conflicts for PR #43 (Caridy Patino) +* New: Add ES6 module support (fixes #35) (Caridy Patino) +* Update: Add TryStatement.handler (fixes #69) (Brandon Mills) +* Fix: Destructured Defaults (fixes #56) (Jamund Ferguson) +* Update: Refactor out comment attachment logic (Nicholas C. Zakas) + +v1.10.0 - March 1, 2015 + +* 1.10.0 (Nicholas C. Zakas) +* New: Support ES6 classes (refs #10) (Nicholas C. Zakas) +* Docs: Update README.md (Jamund Ferguson) + +v1.9.1 - February 21, 2015 + +* 1.9.1 (Nicholas C. Zakas) +* Fix: Allow let/const in switchcase (fixes #54) (Nicholas C. Zakas) + +v1.9.0 - February 21, 2015 + +* 1.9.0 (Nicholas C. Zakas) +* Fix: Extend property method range and loc to include params (fixes #36) (Brandon Mills) +* New: spread operator (refs #10) (Jamund Ferguson) +* Fix: incorrectly parsed arrow fragment (refs #58) (Jamund Ferguson) +* New: Rest Parameter (refs: #10) (Jamund Ferguson) +* New: Destructuring (refs #10) (Jamund Ferguson) + +v1.8.1 - February 7, 2015 + +* 1.8.1 (Nicholas C. Zakas) +* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) +* Fix: Actuall fix tokenization issue with templates (fixes #44) (Nicholas C. Zakas) + +v1.8.0 - February 6, 2015 + +* 1.8.0 (Nicholas C. Zakas) +* New: Support for Arrow Functions (refs #10) (Jamund Ferguson) +* New: Allow super references in functions (refs #10) (Nicholas C. Zakas) +* Update create-test.js (Jamund Ferguson) +* Fix: Tokenization for template strings (fixes #44) (Nicholas C. Zakas) +* New: Allow return in global scope (fixes #46) (Nicholas C. Zakas) + +v1.7.1 - January 23, 2015 + +* 1.7.1 (Nicholas C. Zakas) +* Fix: When ecmaFeatures.forOf is true, check for operater is "undefined" when match keyword is "in" (fixes #39) (Peter Chanthamynavong) + +v1.7.0 - January 23, 2015 + +* 1.7.0 (Nicholas C. Zakas) +* New: Add support for template strings (FredKSchott) +* New: Add support for default parameters (refs #10) (Jamund Ferguson) +* New: Add support for unicode code point escape sequences (FredKSchott) + +v1.6.0 - January 10, 2015 + +* 1.6.0 (Nicholas C. Zakas) +* Update: Make comment attachment tests look at whole AST (Nicholas C. Zakas) +* Docs: Update README to reflect feature flags (Nicholas C. Zakas) +* Docs: Add a couple more FAQs to README (Nicholas C. Zakas) +* New: Add support for duplicate object literal properties (FredKSchott) +* New: Implement generators (refs #10) (Nicholas C. Zakas) + +v1.5.0 - December 29, 2014 + +* 1.5.0 (Nicholas C. Zakas) +* Docs: Update README with compat info (Nicholas C. Zakas) +* Update: Add regex parsing test (Nicholas C. Zakas) +* Update: s/XJS/JSX/g (Nicholas C. Zakas) +* Build: Update release script (Nicholas C. Zakas) +* Update: Move SyntaxTree to ast-node-factory.js (FredKSchott) +* New: Add JSX parsing (fixes #26) (Nicholas C. Zakas) +* Update: Switch location marker logic (fixes #15) (Nicholas C. Zakas) +* 1.4.0 (Nicholas C. Zakas) + +v1.4.0 - December 23, 2014 + +* 1.4.0 (Nicholas C. Zakas) +* Fix: Parsing issues with property methods (fixes #21) (Nicholas C. Zakas) +* New: Add support for shorthand properties (refs #10) (Nicholas C. Zakas) +* New: Add support for object literal method shorthand (refs #10) (Nicholas C. Zakas) +* Fix: Ensure comments are attached for return (fixes #2) (Nicholas C. Zakas) +* Build: Ensure CHANGELOG.md is committed on release (Nicholas C. Zakas) +* 1.3.1 (Nicholas C. Zakas) + +v1.3.1 - December 22, 2014 + +* 1.3.1 (Nicholas C. Zakas) +* Fix: Add all files to npm package (fixes #17) (Nicholas C. Zakas) +* Update: Move Messages to separate file (Nicholas C. Zakas) +* Docs: Removed unnecessary comment (Nicholas C. Zakas) +* 1.3.0 (Nicholas C. Zakas) + +v1.3.0 - December 21, 2014 + +* 1.3.0 (Nicholas C. Zakas) +* Build: Add release scripts (Nicholas C. Zakas) +* New: Add computed object literal properties (refs #10) (Nicholas C. Zakas) +* Build: Fix commands in Makefile.js (Nicholas C. Zakas) +* Docs: Add FAQ to README (Nicholas C. Zakas) +* Fix: Don't allow let/const in for loops (fixes #14) (Nicholas C. Zakas) +* New: Support for-of loops (refs #10) (Nicholas C. Zakas) +* Update: Change .ast.js files to .result.js files (Nicholas C. Zakas) +* New: Support ES6 octal literals (Nicholas C. Zakas) +* New: Ability to parse binary literals (Nicholas C. Zakas) +* Update: More tests for regex u flag (Nicholas C. Zakas) +* Update: Switch to using ecmaFeatures (Nicholas C. Zakas) +* Update: Add comment attachment tests (Nicholas C. Zakas) +* Update README.md (Jamund Ferguson) +* New: Add u and y regex flags (refs #10) (Nicholas C. Zakas) +* Update: Cleanup tests (Nicholas C. Zakas) +* New: Add ecmascript flag (fixes #7) (Nicholas C. Zakas) +* Docs: Update README with build commands (Nicholas C. Zakas) +* Update: Move some things around (Nicholas C. Zakas) +* Update: Read version number from package.json (Nicholas C. Zakas) +* Update: Move AST node types to separate file (Nicholas C. Zakas) +* Update: Remove duplicate file (Nicholas C. Zakas) +* Update: Move token information to a separate file (Nicholas C. Zakas) +* Update: Bring in Makefile.js for linting and browserify (Nicholas C. Zakas) +* Update: Fix ESLint warnings, remove check-version (Nicholas C. Zakas) +* Update: Move Position and SourceLocation to separate file (Nicholas C. Zakas) +* Update: Move syntax checks into separate file (Nicholas C. Zakas) +* Update: Remove UMD format (Nicholas C. Zakas) +* Docs: Update README with more info (Nicholas C. Zakas) +* Update: remove npm-debug.log from tracked files (Brandon Mills) +* Docs: Remove redundant 'features' in readme (Matthias Oßwald) +* Docs: Fix a link to Wikipedia (Ryuichi Okumura) +* Update: Split parsing tests into smaller files (Nicholas C. Zakas) +* Update: Normalize values in tests (Nicholas C. Zakas) +* Update: CommonJSify test file (Nicholas C. Zakas) diff --git a/day1/cli-study/node_modules/espree/LICENSE b/day1/cli-study/node_modules/espree/LICENSE new file mode 100644 index 0000000..321d960 --- /dev/null +++ b/day1/cli-study/node_modules/espree/LICENSE @@ -0,0 +1,22 @@ +Espree +Copyright JS Foundation and other contributors, https://js.foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/day1/cli-study/node_modules/espree/README.md b/day1/cli-study/node_modules/espree/README.md new file mode 100644 index 0000000..988575d --- /dev/null +++ b/day1/cli-study/node_modules/espree/README.md @@ -0,0 +1,251 @@ +[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree) +[![Build Status](https://travis-ci.org/eslint/espree.svg?branch=master)](https://travis-ci.org/eslint/espree) +[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree) +[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE) + +# Espree + +Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. + +## Usage + +Install: + +``` +npm i espree +``` + +And in your Node.js code: + +```javascript +const espree = require("espree"); + +const ast = espree.parse(code); +``` + +## API + +### `parse()` + +`parse` parses the given code and returns a abstract syntax tree (AST). It takes two paramenter. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options) + +```javascript +const espree = require("espree"); + +const ast = espree.parse(code, options); +``` + +**Example :** + +```js +const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 }); +console.log(ast); +``` + +
Output +

+ +``` +Node { + type: 'Program', + start: 0, + end: 15, + body: [ + Node { + type: 'VariableDeclaration', + start: 0, + end: 15, + declarations: [Array], + kind: 'let' + } + ], + sourceType: 'script' +} +``` + +

+
+ +### `tokenize()` + +`tokenize` returns the tokens of a give code. It takes two paramenter. + +- `code` [string]() - the code which needs to be parsed. +- `options (Optional)` [Object]() - read more about this [here](#options) + +Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array + +**Example :** + +```js +const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 }); +console.log(tokens); +``` + +
Output +

+ +``` +Token { type: 'Keyword', value: 'let', start: 0, end: 3 }, +Token { type: 'Identifier', value: 'foo', start: 4, end: 7 }, +Token { type: 'Punctuator', value: '=', start: 8, end: 9 }, +Token { type: 'String', value: '"bar"', start: 10, end: 15 } +``` + +

+
+ +### `version` + +Returns the current `espree` version + +### `VisitorKeys` + +Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) + +### `latestEcmaVersion` + +Returns the latest ECMAScript supported by `espree` + +### `supportedEcmaVersions` + +Returns an array of all supported ECMAScript version + +## Options + +```js +const options = { + // attach range information to each node + range: false, + + // attach line/column location information to each node + loc: false, + + // create a top-level comments array containing all comments + comment: false, + + // create a top-level tokens array containing all tokens + tokens: false, + + // Set to 3, 5 (default), 6, 7, 8, 9, or 10 to specify the version of ECMAScript syntax you want to use. + // You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), or 2020 (same as 11) to use the year-based naming. + ecmaVersion: 5, + + // specify which type of script you're parsing ("script" or "module") + sourceType: "script", + + // specify additional language features + ecmaFeatures: { + + // enable JSX parsing + jsx: false, + + // enable return in global scope + globalReturn: false, + + // enable implied strict mode (if ecmaVersion >= 5) + impliedStrict: false + } +} +``` + +## Esprima Compatibility Going Forward + +The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same. + +Espree may also deviate from Esprima in the interface it exposes. + +## Contributing + +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues). + +Espree is licensed under a permissive BSD 2-clause license. + +## Build Commands + +* `npm test` - run all linting and tests +* `npm run lint` - run all linting +* `npm run browserify` - creates a version of Espree that is usable in a browser + +## Differences from Espree 2.x + +* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics. +* Trailing whitespace no longer is counted as part of a node. +* `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`. +* The `esparse` and `esvalidate` binary scripts have been removed. +* There is no `tolerant` option. We will investigate adding this back in the future. + +## Known Incompatibilities + +In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change. + +### Esprima 1.2.2 + +* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs. +* Espree does not parse `let` and `const` declarations by default. +* Error messages returned for parsing errors are different. +* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn. + +### Esprima 2.x + +* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2. + +## Frequently Asked Questions + +### Why another parser + +[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration. + +We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API. + +With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima. + +### Have you tried working with Esprima? + +Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support. + +### Why don't you just use Acorn? + +Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint. + +We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better. + +### What ECMAScript 6 features do you support? + +All of them. + +### What ECMAScript 7/2016 features do you support? + +There is only one ECMAScript 2016 syntax change: the exponentiation operator. Espree supports this. + +### What ECMAScript 2017 features do you support? + +There are two ECMAScript 2017 syntax changes: `async` functions, and trailing commas in function declarations and calls. Espree supports both of them. + +### What ECMAScript 2018 features do you support? + +There are seven ECMAScript 2018 syntax changes: + +* Invalid escape sequences in tagged template literals +* Rest/spread properties +* Async iteration +* RegExp `s` flag +* RegExp named capture groups +* RegExp lookbehind assertions +* RegExp Unicode property escapes + +Espree supports all of them. + +### What ECMAScript 2019 features do you support? + +Because ECMAScript 2019 is still under development, we are implementing features as they are finalized. Currently, Espree supports: + +* Optional `catch` binding +* JSON superset (`\u2028` and `\u2029` in string literals) + +### How do you determine which experimental features to support? + +In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features. diff --git a/day1/cli-study/node_modules/espree/espree.js b/day1/cli-study/node_modules/espree/espree.js new file mode 100644 index 0000000..d806952 --- /dev/null +++ b/day1/cli-study/node_modules/espree/espree.js @@ -0,0 +1,177 @@ +/** + * @fileoverview Main Espree file that converts Acorn into Esprima output. + * + * This file contains code from the following MIT-licensed projects: + * 1. Acorn + * 2. Babylon + * 3. Babel-ESLint + * + * This file also contains code from Esprima, which is BSD licensed. + * + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS) + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS) + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* eslint no-undefined:0, no-use-before-define: 0 */ + +"use strict"; + +const acorn = require("acorn"); +const jsx = require("acorn-jsx"); +const astNodeTypes = require("./lib/ast-node-types"); +const espree = require("./lib/espree"); +const { getLatestEcmaVersion, getSupportedEcmaVersions } = require("./lib/options"); + +// To initialize lazily. +const parsers = { + _regular: null, + _jsx: null, + + get regular() { + if (this._regular === null) { + this._regular = acorn.Parser.extend(espree()); + } + return this._regular; + }, + + get jsx() { + if (this._jsx === null) { + this._jsx = acorn.Parser.extend(jsx(), espree()); + } + return this._jsx; + }, + + get(options) { + const useJsx = Boolean( + options && + options.ecmaFeatures && + options.ecmaFeatures.jsx + ); + + return useJsx ? this.jsx : this.regular; + } +}; + +//------------------------------------------------------------------------------ +// Tokenizer +//------------------------------------------------------------------------------ + +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ +function tokenize(code, options) { + const Parser = parsers.get(options); + + // Ensure to collect tokens. + if (!options || options.tokens !== true) { + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign + } + + return new Parser(options, code).tokenize(); +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + */ +function parse(code, options) { + const Parser = parsers.get(options); + + return new Parser(options, code).parse(); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +exports.version = require("./package.json").version; + +exports.tokenize = tokenize; + +exports.parse = parse; + +// Deep copy. +/* istanbul ignore next */ +exports.Syntax = (function() { + let name, + types = {}; + + if (typeof Object.create === "function") { + types = Object.create(null); + } + + for (name in astNodeTypes) { + if (Object.hasOwnProperty.call(astNodeTypes, name)) { + types[name] = astNodeTypes[name]; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(types); + } + + return types; +}()); + +/* istanbul ignore next */ +exports.VisitorKeys = (function() { + return require("eslint-visitor-keys").KEYS; +}()); + +exports.latestEcmaVersion = getLatestEcmaVersion(); + +exports.supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/day1/cli-study/node_modules/espree/lib/ast-node-types.js b/day1/cli-study/node_modules/espree/lib/ast-node-types.js new file mode 100644 index 0000000..2844024 --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/ast-node-types.js @@ -0,0 +1,96 @@ +/** + * @fileoverview The AST node types produced by the parser. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + AssignmentExpression: "AssignmentExpression", + AssignmentPattern: "AssignmentPattern", + ArrayExpression: "ArrayExpression", + ArrayPattern: "ArrayPattern", + ArrowFunctionExpression: "ArrowFunctionExpression", + AwaitExpression: "AwaitExpression", + BlockStatement: "BlockStatement", + BinaryExpression: "BinaryExpression", + BreakStatement: "BreakStatement", + CallExpression: "CallExpression", + CatchClause: "CatchClause", + ClassBody: "ClassBody", + ClassDeclaration: "ClassDeclaration", + ClassExpression: "ClassExpression", + ConditionalExpression: "ConditionalExpression", + ContinueStatement: "ContinueStatement", + DoWhileStatement: "DoWhileStatement", + DebuggerStatement: "DebuggerStatement", + EmptyStatement: "EmptyStatement", + ExpressionStatement: "ExpressionStatement", + ForStatement: "ForStatement", + ForInStatement: "ForInStatement", + ForOfStatement: "ForOfStatement", + FunctionDeclaration: "FunctionDeclaration", + FunctionExpression: "FunctionExpression", + Identifier: "Identifier", + IfStatement: "IfStatement", + Literal: "Literal", + LabeledStatement: "LabeledStatement", + LogicalExpression: "LogicalExpression", + MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", + MethodDefinition: "MethodDefinition", + NewExpression: "NewExpression", + ObjectExpression: "ObjectExpression", + ObjectPattern: "ObjectPattern", + Program: "Program", + Property: "Property", + RestElement: "RestElement", + ReturnStatement: "ReturnStatement", + SequenceExpression: "SequenceExpression", + SpreadElement: "SpreadElement", + Super: "Super", + SwitchCase: "SwitchCase", + SwitchStatement: "SwitchStatement", + TaggedTemplateExpression: "TaggedTemplateExpression", + TemplateElement: "TemplateElement", + TemplateLiteral: "TemplateLiteral", + ThisExpression: "ThisExpression", + ThrowStatement: "ThrowStatement", + TryStatement: "TryStatement", + UnaryExpression: "UnaryExpression", + UpdateExpression: "UpdateExpression", + VariableDeclaration: "VariableDeclaration", + VariableDeclarator: "VariableDeclarator", + WhileStatement: "WhileStatement", + WithStatement: "WithStatement", + YieldExpression: "YieldExpression", + JSXIdentifier: "JSXIdentifier", + JSXNamespacedName: "JSXNamespacedName", + JSXMemberExpression: "JSXMemberExpression", + JSXEmptyExpression: "JSXEmptyExpression", + JSXExpressionContainer: "JSXExpressionContainer", + JSXElement: "JSXElement", + JSXClosingElement: "JSXClosingElement", + JSXOpeningElement: "JSXOpeningElement", + JSXAttribute: "JSXAttribute", + JSXSpreadAttribute: "JSXSpreadAttribute", + JSXText: "JSXText", + ExportDefaultDeclaration: "ExportDefaultDeclaration", + ExportNamedDeclaration: "ExportNamedDeclaration", + ExportAllDeclaration: "ExportAllDeclaration", + ExportSpecifier: "ExportSpecifier", + ImportDeclaration: "ImportDeclaration", + ImportSpecifier: "ImportSpecifier", + ImportDefaultSpecifier: "ImportDefaultSpecifier", + ImportNamespaceSpecifier: "ImportNamespaceSpecifier" +}; diff --git a/day1/cli-study/node_modules/espree/lib/espree.js b/day1/cli-study/node_modules/espree/lib/espree.js new file mode 100644 index 0000000..50ca6e4 --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/espree.js @@ -0,0 +1,286 @@ +"use strict"; + +/* eslint-disable no-param-reassign*/ +const TokenTranslator = require("./token-translator"); +const { normalizeOptions } = require("./options"); + +const STATE = Symbol("espree's internal state"); +const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { + const comment = { + type: block ? "Block" : "Line", + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +module.exports = () => Parser => { + const tokTypes = Object.assign({}, Parser.acorn.tokTypes); + + if (Parser.acornJsx) { + Object.assign(tokTypes, Parser.acornJsx.tokTypes); + } + + return class Espree extends Parser { + constructor(opts, code) { + if (typeof opts !== "object" || opts === null) { + opts = {}; + } + if (typeof code !== "string" && !(code instanceof String)) { + code = String(code); + } + + const options = normalizeOptions(opts); + const ecmaFeatures = options.ecmaFeatures || {}; + const tokenTranslator = + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; + + // Initialize acorn parser. + super({ + + // TODO: use {...options} when spread is supported(Node.js >= 8.3.0). + ecmaVersion: options.ecmaVersion, + sourceType: options.sourceType, + ranges: options.ranges, + locations: options.locations, + + // Truthy value is true for backward compatibility. + allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), + + // Collect tokens + onToken: token => { + if (tokenTranslator) { + + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. + tokenTranslator.onToken(token, this[STATE]); + } + if (token.type !== tokTypes.eof) { + this[STATE].lastToken = token; + } + }, + + // Collect comments + onComment: (block, text, start, end, startLoc, endLoc) => { + if (this[STATE].comments) { + const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); + + this[STATE].comments.push(comment); + } + } + }, code); + + // Initialize internal state. + this[STATE] = { + tokens: tokenTranslator ? [] : null, + comments: options.comment === true ? [] : null, + impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, + ecmaVersion: this.options.ecmaVersion, + jsxAttrValueToken: false, + lastToken: null + }; + } + + tokenize() { + do { + this.next(); + } while (this.type !== tokTypes.eof); + + // Consume the final eof token + this.next(); + + const extra = this[STATE]; + const tokens = extra.tokens; + + if (extra.comments) { + tokens.comments = extra.comments; + } + + return tokens; + } + + finishNode(...args) { + const result = super.finishNode(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + finishNodeAt(...args) { + const result = super.finishNodeAt(...args); + + return this[ESPRIMA_FINISH_NODE](result); + } + + parse() { + const extra = this[STATE]; + const program = super.parse(); + + program.sourceType = this.options.sourceType; + + if (extra.comments) { + program.comments = extra.comments; + } + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.range) { + program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; + program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1]; + } + if (program.loc) { + program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; + program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end; + } + + return program; + } + + parseTopLevel(node) { + if (this[STATE].impliedStrict) { + this.strict = true; + } + return super.parseTopLevel(node); + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raise(pos, message) { + const loc = Parser.acorn.getLineInfo(this.input, pos); + const err = new SyntaxError(message); + + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + } + + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + raiseRecoverable(pos, message) { + this.raise(pos, message); + } + + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + unexpected(pos) { + let message = "Unexpected token"; + + if (pos !== null && pos !== void 0) { + this.pos = pos; + + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + + this.nextToken(); + } + + if (this.end > this.start) { + message += ` ${this.input.slice(this.start, this.end)}`; + } + + this.raise(this.start, message); + } + + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + jsx_readString(quote) { // eslint-disable-line camelcase + const result = super.jsx_readString(quote); + + if (this.type === tokTypes.string) { + this[STATE].jsxAttrValueToken = true; + } + return result; + } + + /** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + */ + [ESPRIMA_FINISH_NODE](result) { + + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { + + // additional adjustment needed if ${ is the last token + const terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; + + if (result.range) { + result.range[0]--; + result.range[1] += (terminalDollarBraceL ? 2 : 1); + } + + if (result.loc) { + result.loc.start.column--; + result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + } + } + + if (result.type.indexOf("Function") > -1 && !result.generator) { + result.generator = false; + } + + return result; + } + }; +}; diff --git a/day1/cli-study/node_modules/espree/lib/features.js b/day1/cli-study/node_modules/espree/lib/features.js new file mode 100644 index 0000000..d1ad5f8 --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/features.js @@ -0,0 +1,29 @@ +/** + * @fileoverview The list of feature flags supported by the parser and their default + * settings. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // React JSX parsing + jsx: false, + + // allow return statement in global scope + globalReturn: false, + + // allow implied strict mode + impliedStrict: false +}; diff --git a/day1/cli-study/node_modules/espree/lib/options.js b/day1/cli-study/node_modules/espree/lib/options.js new file mode 100644 index 0000000..ccebbea --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/options.js @@ -0,0 +1,105 @@ +/** + * @fileoverview A collection of methods for processing Espree's options. + * @author Kai Cataldo + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const DEFAULT_ECMA_VERSION = 5; +const SUPPORTED_VERSIONS = [ + 3, + 5, + 6, + 7, + 8, + 9, + 10, + 11 +]; + +/** + * Normalize ECMAScript version from the initial config + * @param {number} ecmaVersion ECMAScript version from the initial config + * @throws {Error} throws an error if the ecmaVersion is invalid. + * @returns {number} normalized ECMAScript version + */ +function normalizeEcmaVersion(ecmaVersion = DEFAULT_ECMA_VERSION) { + if (typeof ecmaVersion !== "number") { + throw new Error(`ecmaVersion must be a number. Received value of type ${typeof ecmaVersion} instead.`); + } + + let version = ecmaVersion; + + // Calculate ECMAScript edition number from official year version starting with + // ES2015, which corresponds with ES6 (or a difference of 2009). + if (version >= 2015) { + version -= 2009; + } + + if (!SUPPORTED_VERSIONS.includes(version)) { + throw new Error("Invalid ecmaVersion."); + } + + return version; +} + +/** + * Normalize sourceType from the initial config + * @param {string} sourceType to normalize + * @throws {Error} throw an error if sourceType is invalid + * @returns {string} normalized sourceType + */ +function normalizeSourceType(sourceType = "script") { + if (sourceType === "script" || sourceType === "module") { + return sourceType; + } + throw new Error("Invalid sourceType."); +} + +/** + * Normalize parserOptions + * @param {Object} options the parser options to normalize + * @throws {Error} throw an error if found invalid option. + * @returns {Object} normalized options + */ +function normalizeOptions(options) { + const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); + const sourceType = normalizeSourceType(options.sourceType); + const ranges = options.range === true; + const locations = options.loc === true; + + if (sourceType === "module" && ecmaVersion < 6) { + throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options."); + } + return Object.assign({}, options, { ecmaVersion, sourceType, ranges, locations }); +} + +/** + * Get the latest ECMAScript version supported by Espree. + * @returns {number} The latest ECMAScript version. + */ +function getLatestEcmaVersion() { + return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1]; +} + +/** + * Get the list of ECMAScript versions supported by Espree. + * @returns {number[]} An array containing the supported ECMAScript versions. + */ +function getSupportedEcmaVersions() { + return [...SUPPORTED_VERSIONS]; +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + normalizeOptions, + getLatestEcmaVersion, + getSupportedEcmaVersions +}; diff --git a/day1/cli-study/node_modules/espree/lib/token-translator.js b/day1/cli-study/node_modules/espree/lib/token-translator.js new file mode 100644 index 0000000..9919e1a --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/token-translator.js @@ -0,0 +1,262 @@ +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + */ +/* eslint no-underscore-dangle: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +const Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + const firstToken = tokens[0], + lastTemplateToken = tokens[tokens.length - 1]; + + const token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.start = firstToken.range[0]; + token.end = lastTemplateToken.range[1]; + token.range = [token.start, token.end]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate(token, extra) { + + const type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || type === tt.prefix || + (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + const value = token.value; + + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = `/${value.pattern}/${value.flags}`; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken(token, extra) { + + const that = this, + tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + function translateTemplateTokens() { + tokens.push(convertTemplatePart(that._tokens, that._code)); + that._tokens = []; + } + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } + if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } + if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = TokenTranslator; diff --git a/day1/cli-study/node_modules/espree/lib/visitor-keys.js b/day1/cli-study/node_modules/espree/lib/visitor-keys.js new file mode 100644 index 0000000..4216864 --- /dev/null +++ b/day1/cli-study/node_modules/espree/lib/visitor-keys.js @@ -0,0 +1,123 @@ +/** + * @fileoverview The visitor keys for the node types Espree supports + * @author Nicholas C. Zakas + * + * This file contains code from estraverse-fb. + * + * The MIT license. Copyright (c) 2014 Ingvar Stepanyan + * + * 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. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // ECMAScript + AssignmentExpression: ["left", "right"], + AssignmentPattern: ["left", "right"], + ArrayExpression: ["elements"], + ArrayPattern: ["elements"], + ArrowFunctionExpression: ["params", "body"], + BlockStatement: ["body"], + BinaryExpression: ["left", "right"], + BreakStatement: ["label"], + CallExpression: ["callee", "arguments"], + CatchClause: ["param", "body"], + ClassBody: ["body"], + ClassDeclaration: ["id", "superClass", "body"], + ClassExpression: ["id", "superClass", "body"], + ConditionalExpression: ["test", "consequent", "alternate"], + ContinueStatement: ["label"], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ["body", "test"], + EmptyStatement: [], + ExportAllDeclaration: ["source"], + ExportDefaultDeclaration: ["declaration"], + ExportNamedDeclaration: ["declaration", "specifiers", "source"], + ExportSpecifier: ["exported", "local"], + ExpressionStatement: ["expression"], + ForStatement: ["init", "test", "update", "body"], + ForInStatement: ["left", "right", "body"], + ForOfStatement: ["left", "right", "body"], + FunctionDeclaration: ["id", "params", "body"], + FunctionExpression: ["id", "params", "body"], + Identifier: [], + IfStatement: ["test", "consequent", "alternate"], + ImportDeclaration: ["specifiers", "source"], + ImportDefaultSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportSpecifier: ["imported", "local"], + Literal: [], + LabeledStatement: ["label", "body"], + LogicalExpression: ["left", "right"], + MemberExpression: ["object", "property"], + MetaProperty: ["meta", "property"], + MethodDefinition: ["key", "value"], + ModuleSpecifier: [], + NewExpression: ["callee", "arguments"], + ObjectExpression: ["properties"], + ObjectPattern: ["properties"], + Program: ["body"], + Property: ["key", "value"], + RestElement: ["argument"], + ReturnStatement: ["argument"], + SequenceExpression: ["expressions"], + SpreadElement: ["argument"], + Super: [], + SwitchStatement: ["discriminant", "cases"], + SwitchCase: ["test", "consequent"], + TaggedTemplateExpression: ["tag", "quasi"], + TemplateElement: [], + TemplateLiteral: ["quasis", "expressions"], + ThisExpression: [], + ThrowStatement: ["argument"], + TryStatement: ["block", "handler", "finalizer"], + UnaryExpression: ["argument"], + UpdateExpression: ["argument"], + VariableDeclaration: ["declarations"], + VariableDeclarator: ["id", "init"], + WhileStatement: ["test", "body"], + WithStatement: ["object", "body"], + YieldExpression: ["argument"], + + // JSX + JSXIdentifier: [], + JSXNamespacedName: ["namespace", "name"], + JSXMemberExpression: ["object", "property"], + JSXEmptyExpression: [], + JSXExpressionContainer: ["expression"], + JSXElement: ["openingElement", "closingElement", "children"], + JSXClosingElement: ["name"], + JSXOpeningElement: ["name", "attributes"], + JSXAttribute: ["name", "value"], + JSXText: null, + JSXSpreadAttribute: ["argument"] +}; diff --git a/day1/cli-study/node_modules/espree/package.json b/day1/cli-study/node_modules/espree/package.json new file mode 100644 index 0000000..a951eef --- /dev/null +++ b/day1/cli-study/node_modules/espree/package.json @@ -0,0 +1,95 @@ +{ + "_from": "espree@^7.1.0", + "_id": "espree@7.1.0", + "_inBundle": false, + "_integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", + "_location": "/espree", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "espree@^7.1.0", + "name": "espree", + "escapedName": "espree", + "rawSpec": "^7.1.0", + "saveSpec": null, + "fetchSpec": "^7.1.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "_shasum": "a9c7f18a752056735bf1ba14cb1b70adc3a5ce1c", + "_spec": "espree@^7.1.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Nicholas C. Zakas", + "email": "nicholas+npm@nczconsulting.com" + }, + "bugs": { + "url": "http://github.com/eslint/espree.git" + }, + "bundleDependencies": false, + "dependencies": { + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + }, + "deprecated": false, + "description": "An Esprima-compatible JavaScript parser built on Acorn", + "devDependencies": { + "browserify": "^16.5.0", + "chai": "^4.2.0", + "eslint": "^6.0.1", + "eslint-config-eslint": "^5.0.1", + "eslint-plugin-node": "^9.1.0", + "eslint-release": "^1.0.0", + "esprima": "latest", + "esprima-fb": "^8001.2001.0-dev-harmony-fb", + "json-diff": "^0.5.4", + "leche": "^2.3.0", + "mocha": "^6.2.0", + "nyc": "^14.1.1", + "regenerate": "^1.4.0", + "shelljs": "^0.3.0", + "shelljs-nodecli": "^0.1.1", + "unicode-6.3.0": "^0.7.5" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "files": [ + "lib", + "espree.js" + ], + "homepage": "https://github.com/eslint/espree", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax", + "acorn" + ], + "license": "BSD-2-Clause", + "main": "espree.js", + "name": "espree", + "repository": { + "type": "git", + "url": "git+https://github.com/eslint/espree.git" + }, + "scripts": { + "browserify": "node Makefile.js browserify", + "fixlint": "node Makefile.js lint --fix", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", + "generate-regex": "node tools/generate-identifier-regex.js", + "generate-release": "eslint-generate-release", + "lint": "node Makefile.js lint", + "publish-release": "eslint-publish-release", + "sync-docs": "node Makefile.js docs", + "test": "npm run-script lint && node Makefile.js test" + }, + "version": "7.1.0" +} diff --git a/day1/cli-study/node_modules/esprima/ChangeLog b/day1/cli-study/node_modules/esprima/ChangeLog new file mode 100644 index 0000000..fafe1c9 --- /dev/null +++ b/day1/cli-study/node_modules/esprima/ChangeLog @@ -0,0 +1,235 @@ +2018-06-17: Version 4.0.1 + + * Fix parsing async get/set in a class (issue 1861, 1875) + * Account for different return statement argument (issue 1829, 1897, 1928) + * Correct the handling of HTML comment when parsing a module (issue 1841) + * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) + * Fix negative column in binary expression (issue 1844) + * Fix incorrect YieldExpression in object methods (issue 1834) + * Various documentation fixes + +2017-06-10: Version 4.0.0 + + * Support ES2017 async function and await expression (issue 1079) + * Support ES2017 trailing commas in function parameters (issue 1550) + * Explicitly distinguish parsing a module vs a script (issue 1576) + * Fix JSX non-empty container (issue 1786) + * Allow JSX element in a yield expression (issue 1765) + * Allow `in` expression in a concise body with a function body (issue 1793) + * Setter function argument must not be a rest parameter (issue 1693) + * Limit strict mode directive to functions with a simple parameter list (issue 1677) + * Prohibit any escape sequence in a reserved word (issue 1612) + * Only permit hex digits in hex escape sequence (issue 1619) + * Prohibit labelled class/generator/function declaration (issue 1484) + * Limit function declaration as if statement clause only in non-strict mode (issue 1657) + * Tolerate missing ) in a with and do-while statement (issue 1481) + +2016-12-22: Version 3.1.3 + + * Support binding patterns as rest element (issue 1681) + * Account for different possible arguments of a yield expression (issue 1469) + +2016-11-24: Version 3.1.2 + + * Ensure that import specifier is more restrictive (issue 1615) + * Fix duplicated JSX tokens (issue 1613) + * Scan template literal in a JSX expression container (issue 1622) + * Improve XHTML entity scanning in JSX (issue 1629) + +2016-10-31: Version 3.1.1 + + * Fix assignment expression problem in an export declaration (issue 1596) + * Fix incorrect tokenization of hex digits (issue 1605) + +2016-10-09: Version 3.1.0 + + * Do not implicitly collect comments when comment attachment is specified (issue 1553) + * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) + * Prohibit initialization in some variants of for statements (issue 1309, 1561) + * Fix incorrect parsing of export specifier (issue 1578) + * Fix ESTree compatibility for assignment pattern (issue 1575) + +2016-09-03: Version 3.0.0 + + * Support ES2016 exponentiation expression (issue 1490) + * Support JSX syntax (issue 1467) + * Use the latest Unicode 8.0 (issue 1475) + * Add the support for syntax node delegate (issue 1435) + * Fix ESTree compatibility on meta property (issue 1338) + * Fix ESTree compatibility on default parameter value (issue 1081) + * Fix ESTree compatibility on try handler (issue 1030) + +2016-08-23: Version 2.7.3 + + * Fix tokenizer confusion with a comment (issue 1493, 1516) + +2016-02-02: Version 2.7.2 + + * Fix out-of-bound error location in an invalid string literal (issue 1457) + * Fix shorthand object destructuring defaults in variable declarations (issue 1459) + +2015-12-10: Version 2.7.1 + + * Do not allow trailing comma in a variable declaration (issue 1360) + * Fix assignment to `let` in non-strict mode (issue 1376) + * Fix missing delegate property in YieldExpression (issue 1407) + +2015-10-22: Version 2.7.0 + + * Fix the handling of semicolon in a break statement (issue 1044) + * Run the test suite with major web browsers (issue 1259, 1317) + * Allow `let` as an identifier in non-strict mode (issue 1289) + * Attach orphaned comments as `innerComments` (issue 1328) + * Add the support for token delegator (issue 1332) + +2015-09-01: Version 2.6.0 + + * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) + * Add sourceType field for Program node (issue 1159) + * Ensure that strict mode reserved word binding throw an error (issue 1171) + * Run the test suite with Node.js and IE 11 on Windows (issue 1294) + * Allow binding pattern with no initializer in a for statement (issue 1301) + +2015-07-31: Version 2.5.0 + + * Run the test suite in a browser environment (issue 1004) + * Ensure a comma between imported default binding and named imports (issue 1046) + * Distinguish `yield` as a keyword vs an identifier (issue 1186) + * Support ES6 meta property `new.target` (issue 1203) + * Fix the syntax node for yield with expression (issue 1223) + * Fix the check of duplicated proto in property names (issue 1225) + * Fix ES6 Unicode escape in identifier name (issue 1229) + * Support ES6 IdentifierStart and IdentifierPart (issue 1232) + * Treat await as a reserved word when parsing as a module (issue 1234) + * Recognize identifier characters from Unicode SMP (issue 1244) + * Ensure that export and import can be followed by a comma (issue 1250) + * Fix yield operator precedence (issue 1262) + +2015-07-01: Version 2.4.1 + + * Fix some cases of comment attachment (issue 1071, 1175) + * Fix the handling of destructuring in function arguments (issue 1193) + * Fix invalid ranges in assignment expression (issue 1201) + +2015-06-26: Version 2.4.0 + + * Support ES6 for-of iteration (issue 1047) + * Support ES6 spread arguments (issue 1169) + * Minimize npm payload (issue 1191) + +2015-06-16: Version 2.3.0 + + * Support ES6 generator (issue 1033) + * Improve parsing of regular expressions with `u` flag (issue 1179) + +2015-04-17: Version 2.2.0 + + * Support ES6 import and export declarations (issue 1000) + * Fix line terminator before arrow not recognized as error (issue 1009) + * Support ES6 destructuring (issue 1045) + * Support ES6 template literal (issue 1074) + * Fix the handling of invalid/incomplete string escape sequences (issue 1106) + * Fix ES3 static member access restriction (issue 1120) + * Support for `super` in ES6 class (issue 1147) + +2015-03-09: Version 2.1.0 + + * Support ES6 class (issue 1001) + * Support ES6 rest parameter (issue 1011) + * Expand the location of property getter, setter, and methods (issue 1029) + * Enable TryStatement transition to a single handler (issue 1031) + * Support ES6 computed property name (issue 1037) + * Tolerate unclosed block comment (issue 1041) + * Support ES6 lexical declaration (issue 1065) + +2015-02-06: Version 2.0.0 + + * Support ES6 arrow function (issue 517) + * Support ES6 Unicode code point escape (issue 521) + * Improve the speed and accuracy of comment attachment (issue 522) + * Support ES6 default parameter (issue 519) + * Support ES6 regular expression flags (issue 557) + * Fix scanning of implicit octal literals (issue 565) + * Fix the handling of automatic semicolon insertion (issue 574) + * Support ES6 method definition (issue 620) + * Support ES6 octal integer literal (issue 621) + * Support ES6 binary integer literal (issue 622) + * Support ES6 object literal property value shorthand (issue 624) + +2015-03-03: Version 1.2.5 + + * Fix scanning of implicit octal literals (issue 565) + +2015-02-05: Version 1.2.4 + + * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) + * Fix the handling of automatic semicolon insertion (issue 574) + +2015-01-18: Version 1.2.3 + + * Fix division by this (issue 616) + +2014-05-18: Version 1.2.2 + + * Fix duplicated tokens when collecting comments (issue 537) + +2014-05-04: Version 1.2.1 + + * Ensure that Program node may still have leading comments (issue 536) + +2014-04-29: Version 1.2.0 + + * Fix semicolon handling for expression statement (issue 462, 533) + * Disallow escaped characters in regular expression flags (issue 503) + * Performance improvement for location tracking (issue 520) + * Improve the speed of comment attachment (issue 522) + +2014-03-26: Version 1.1.1 + + * Fix token handling of forward slash after an array literal (issue 512) + +2014-03-23: Version 1.1.0 + + * Optionally attach comments to the owning syntax nodes (issue 197) + * Simplify binary parsing with stack-based shift reduce (issue 352) + * Always include the raw source of literals (issue 376) + * Add optional input source information (issue 386) + * Tokenizer API for pure lexical scanning (issue 398) + * Improve the web site and its online demos (issue 337, 400, 404) + * Performance improvement for location tracking (issue 417, 424) + * Support HTML comment syntax (issue 451) + * Drop support for legacy browsers (issue 474) + +2013-08-27: Version 1.0.4 + + * Minimize the payload for packages (issue 362) + * Fix missing cases on an empty switch statement (issue 436) + * Support escaped ] in regexp literal character classes (issue 442) + * Tolerate invalid left-hand side expression (issue 130) + +2013-05-17: Version 1.0.3 + + * Variable declaration needs at least one declarator (issue 391) + * Fix benchmark's variance unit conversion (issue 397) + * IE < 9: \v should be treated as vertical tab (issue 405) + * Unary expressions should always have prefix: true (issue 418) + * Catch clause should only accept an identifier (issue 423) + * Tolerate setters without parameter (issue 426) + +2012-11-02: Version 1.0.2 + + Improvement: + + * Fix esvalidate JUnit output upon a syntax error (issue 374) + +2012-10-28: Version 1.0.1 + + Improvements: + + * esvalidate understands shebang in a Unix shell script (issue 361) + * esvalidate treats fatal parsing failure as an error (issue 361) + * Reduce Node.js package via .npmignore (issue 362) + +2012-10-22: Version 1.0.0 + + Initial release. diff --git a/day1/cli-study/node_modules/esprima/LICENSE.BSD b/day1/cli-study/node_modules/esprima/LICENSE.BSD new file mode 100644 index 0000000..7a55160 --- /dev/null +++ b/day1/cli-study/node_modules/esprima/LICENSE.BSD @@ -0,0 +1,21 @@ +Copyright JS Foundation and other contributors, https://js.foundation/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/day1/cli-study/node_modules/esprima/README.md b/day1/cli-study/node_modules/esprima/README.md new file mode 100644 index 0000000..8fb25e6 --- /dev/null +++ b/day1/cli-study/node_modules/esprima/README.md @@ -0,0 +1,46 @@ +[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) +[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) +[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) +[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) + +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/jquery/esprima/contributors). + +### Features + +- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) +- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) +- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) +- Optional tracking of syntax node location (index-based and line-column) +- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) + +### API + +Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. + +A simple example on Node.js REPL: + +```javascript +> var esprima = require('esprima'); +> var program = 'const answer = 42'; + +> esprima.tokenize(program); +[ { type: 'Keyword', value: 'const' }, + { type: 'Identifier', value: 'answer' }, + { type: 'Punctuator', value: '=' }, + { type: 'Numeric', value: '42' } ] + +> esprima.parseScript(program); +{ type: 'Program', + body: + [ { type: 'VariableDeclaration', + declarations: [Object], + kind: 'const' } ], + sourceType: 'script' } +``` + +For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/day1/cli-study/node_modules/esprima/bin/esparse.js b/day1/cli-study/node_modules/esprima/bin/esparse.js new file mode 100644 index 0000000..45d05fb --- /dev/null +++ b/day1/cli-study/node_modules/esprima/bin/esparse.js @@ -0,0 +1,139 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, forceFile, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] [file.js]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +function run(content) { + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); +} + +try { + if (fname && (fname !== '-' || forceFile)) { + run(fs.readFileSync(fname, 'utf-8')); + } else { + var content = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(content); + }); + } +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/day1/cli-study/node_modules/esprima/bin/esvalidate.js b/day1/cli-study/node_modules/esprima/bin/esvalidate.js new file mode 100644 index 0000000..d49a7e4 --- /dev/null +++ b/day1/cli-study/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,236 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ +/*global phantom:true */ + +var fs, system, esprima, options, fnames, forceFile, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } + } +} + +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('phantomjs'); +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { + argv: arguments, + exit: quit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] [file.js...]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + fnames.push(entry); + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +if (fnames.length === 0) { + fnames.push(''); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; + +function run(fname, content) { + var timestamp, syntax, name; + try { + if (typeof content !== 'string') { + throw content; + } + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); + } + } +} + +fnames.forEach(function (fname) { + var content = ''; + try { + if (fname && (fname !== '-' || forceFile)) { + content = fs.readFileSync(fname, 'utf-8'); + } else { + fname = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(fname, content); + }); + return; + } + } catch (e) { + content = e; + } + run(fname, content); +}); + +process.on('exit', function () { + if (options.format === 'junit') { + console.log(''); + } + + if (count > 0) { + process.exit(1); + } + + if (count === 0 && typeof phantom === 'object') { + process.exit(0); + } +}); diff --git a/day1/cli-study/node_modules/esprima/dist/esprima.js b/day1/cli-study/node_modules/esprima/dist/esprima.js new file mode 100644 index 0000000..2af3eee --- /dev/null +++ b/day1/cli-study/node_modules/esprima/dist/esprima.js @@ -0,0 +1,6709 @@ +(function webpackUniversalModuleDefinition(root, factory) { +/* istanbul ignore next */ + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); +/* istanbul ignore next */ + else if(typeof exports === 'object') + exports["esprima"] = factory(); + else + root["esprima"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/* istanbul ignore if */ +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + /* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + var comment_handler_1 = __webpack_require__(1); + var jsx_parser_1 = __webpack_require__(3); + var parser_1 = __webpack_require__(8); + var tokenizer_1 = __webpack_require__(15); + function parse(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function (node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = (typeof options.comment === 'boolean' && options.comment); + var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === 'string') { + isModule = (options.sourceType === 'module'); + } + var parser; + if (options && typeof options.jsx === 'boolean' && options.jsx) { + parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } + else { + parser = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser.parseModule() : parser.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser.config.tokens) { + ast.tokens = parser.tokens; + } + if (parser.config.tolerant) { + ast.errors = parser.errorHandler.errors; + } + return ast; + } + exports.parse = parse; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'module'; + return parse(code, parsingOptions, delegate); + } + exports.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'script'; + return parse(code, parsingOptions, delegate); + } + exports.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } + catch (e) { + tokenizer.errorHandler.tolerate(e); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports.tokenize = tokenize; + var syntax_1 = __webpack_require__(2); + exports.Syntax = syntax_1.Syntax; + // Sync with *.json manifests. + exports.version = '4.0.1'; + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var CommentHandler = (function () { + function CommentHandler() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler.prototype.insertInnerComments = function (node, metadata) { + // innnerComments for properties empty block + // `function a() {/** comments **\/}` + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i, 1); + this.trailing.splice(i, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler.prototype.findTrailingComments = function (metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i = this.trailing.length - 1; i >= 0; --i) { + var entry_1 = this.trailing[i]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler.prototype.findLeadingComments = function (metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } + else { + break; + } + } + if (target) { + var count = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count - 1; i >= 0; --i) { + var comment = target.leadingComments[i]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i, 1); + } + } + return leadingComments; + }; + CommentHandler.prototype.visitNode = function (node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node: node, + start: metadata.start.offset + }); + }; + CommentHandler.prototype.visitComment = function (node, metadata) { + var type = (node.type[0] === 'L') ? 'Line' : 'Block'; + var comment = { + type: type, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler.prototype.visit = function (node, metadata) { + if (node.type === 'LineComment') { + this.visitComment(node, metadata); + } + else if (node.type === 'BlockComment') { + this.visitComment(node, metadata); + } + else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler; + }()); + exports.CommentHandler = CommentHandler; + + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; +/* istanbul ignore next */ + var __extends = (this && this.__extends) || (function () { + var 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 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 character_1 = __webpack_require__(4); + var JSXNode = __webpack_require__(5); + var jsx_syntax_1 = __webpack_require__(6); + var Node = __webpack_require__(7); + var parser_1 = __webpack_require__(8); + var token_1 = __webpack_require__(13); + var xhtml_entities_1 = __webpack_require__(14); + token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; + token_1.TokenName[101 /* Text */] = 'JSXText'; + // Fully qualified element name, e.g. returns "svg:path" + function getQualifiedElementName(elementName) { + var qualifiedName; + switch (elementName.type) { + case jsx_syntax_1.JSXSyntax.JSXIdentifier: + var id = elementName; + qualifiedName = id.name; + break; + case jsx_syntax_1.JSXSyntax.JSXNamespacedName: + var ns = elementName; + qualifiedName = getQualifiedElementName(ns.namespace) + ':' + + getQualifiedElementName(ns.name); + break; + case jsx_syntax_1.JSXSyntax.JSXMemberExpression: + var expr = elementName; + qualifiedName = getQualifiedElementName(expr.object) + '.' + + getQualifiedElementName(expr.property); + break; + /* istanbul ignore next */ + default: + break; + } + return qualifiedName; + } + var JSXParser = (function (_super) { + __extends(JSXParser, _super); + function JSXParser(code, options, delegate) { + return _super.call(this, code, options, delegate) || this; + } + JSXParser.prototype.parsePrimaryExpression = function () { + return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); + }; + JSXParser.prototype.startJSX = function () { + // Unwind the scanner before the lookahead token. + this.scanner.index = this.startMarker.index; + this.scanner.lineNumber = this.startMarker.line; + this.scanner.lineStart = this.startMarker.index - this.startMarker.column; + }; + JSXParser.prototype.finishJSX = function () { + // Prime the next lookahead. + this.nextToken(); + }; + JSXParser.prototype.reenterJSX = function () { + this.startJSX(); + this.expectJSX('}'); + // Pop the closing '}' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + }; + JSXParser.prototype.createJSXNode = function () { + this.collectComments(); + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.createJSXChildNode = function () { + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.scanXHTMLEntity = function (quote) { + var result = '&'; + var valid = true; + var terminated = false; + var numeric = false; + var hex = false; + while (!this.scanner.eof() && valid && !terminated) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === quote) { + break; + } + terminated = (ch === ';'); + result += ch; + ++this.scanner.index; + if (!terminated) { + switch (result.length) { + case 2: + // e.g. '{' + numeric = (ch === '#'); + break; + case 3: + if (numeric) { + // e.g. 'A' + hex = (ch === 'x'); + valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); + numeric = numeric && !hex; + } + break; + default: + valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); + valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); + break; + } + } + } + if (valid && terminated && result.length > 2) { + // e.g. 'A' becomes just '#x41' + var str = result.substr(1, result.length - 2); + if (numeric && str.length > 1) { + result = String.fromCharCode(parseInt(str.substr(1), 10)); + } + else if (hex && str.length > 2) { + result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); + } + else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { + result = xhtml_entities_1.XHTMLEntities[str]; + } + } + return result; + }; + // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. + JSXParser.prototype.lexJSX = function () { + var cp = this.scanner.source.charCodeAt(this.scanner.index); + // < > / : = { } + if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { + var value = this.scanner.source[this.scanner.index++]; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index - 1, + end: this.scanner.index + }; + } + // " ' + if (cp === 34 || cp === 39) { + var start = this.scanner.index; + var quote = this.scanner.source[this.scanner.index++]; + var str = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index++]; + if (ch === quote) { + break; + } + else if (ch === '&') { + str += this.scanXHTMLEntity(quote); + } + else { + str += ch; + } + } + return { + type: 8 /* StringLiteral */, + value: str, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ... or . + if (cp === 46) { + var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); + var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); + var value = (n1 === 46 && n2 === 46) ? '...' : '.'; + var start = this.scanner.index; + this.scanner.index += value.length; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ` + if (cp === 96) { + // Only placeholder, since it will be rescanned as a real assignment expression. + return { + type: 10 /* Template */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index, + end: this.scanner.index + }; + } + // Identifer can not contain backslash (char code 92). + if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { + var start = this.scanner.index; + ++this.scanner.index; + while (!this.scanner.eof()) { + var ch = this.scanner.source.charCodeAt(this.scanner.index); + if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { + ++this.scanner.index; + } + else if (ch === 45) { + // Hyphen (char code 45) can be part of an identifier. + ++this.scanner.index; + } + else { + break; + } + } + var id = this.scanner.source.slice(start, this.scanner.index); + return { + type: 100 /* Identifier */, + value: id, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + return this.scanner.lex(); + }; + JSXParser.prototype.nextJSXToken = function () { + this.collectComments(); + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var token = this.lexJSX(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + if (this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.nextJSXText = function () { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var start = this.scanner.index; + var text = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === '{' || ch === '<') { + break; + } + ++this.scanner.index; + text += ch; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.scanner.lineNumber; + if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { + ++this.scanner.index; + } + this.scanner.lineStart = this.scanner.index; + } + } + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + var token = { + type: 101 /* Text */, + value: text, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + if ((text.length > 0) && this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.peekJSXToken = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.lexJSX(); + this.scanner.restoreState(state); + return next; + }; + // Expect the next JSX token to match the specified punctuator. + // If not, an exception will be thrown. + JSXParser.prototype.expectJSX = function (value) { + var token = this.nextJSXToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next JSX token matches the specified punctuator. + JSXParser.prototype.matchJSX = function (value) { + var next = this.peekJSXToken(); + return next.type === 7 /* Punctuator */ && next.value === value; + }; + JSXParser.prototype.parseJSXIdentifier = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 100 /* Identifier */) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); + }; + JSXParser.prototype.parseJSXElementName = function () { + var node = this.createJSXNode(); + var elementName = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = elementName; + this.expectJSX(':'); + var name_1 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); + } + else if (this.matchJSX('.')) { + while (this.matchJSX('.')) { + var object = elementName; + this.expectJSX('.'); + var property = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); + } + } + return elementName; + }; + JSXParser.prototype.parseJSXAttributeName = function () { + var node = this.createJSXNode(); + var attributeName; + var identifier = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = identifier; + this.expectJSX(':'); + var name_2 = this.parseJSXIdentifier(); + attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); + } + else { + attributeName = identifier; + } + return attributeName; + }; + JSXParser.prototype.parseJSXStringLiteralAttribute = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 8 /* StringLiteral */) { + this.throwUnexpectedToken(token); + } + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + JSXParser.prototype.parseJSXExpressionAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.finishJSX(); + if (this.match('}')) { + this.tolerateError('JSX attributes must only be assigned a non-empty expression'); + } + var expression = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXAttributeValue = function () { + return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : + this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); + }; + JSXParser.prototype.parseJSXNameValueAttribute = function () { + var node = this.createJSXNode(); + var name = this.parseJSXAttributeName(); + var value = null; + if (this.matchJSX('=')) { + this.expectJSX('='); + value = this.parseJSXAttributeValue(); + } + return this.finalize(node, new JSXNode.JSXAttribute(name, value)); + }; + JSXParser.prototype.parseJSXSpreadAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.expectJSX('...'); + this.finishJSX(); + var argument = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); + }; + JSXParser.prototype.parseJSXAttributes = function () { + var attributes = []; + while (!this.matchJSX('/') && !this.matchJSX('>')) { + var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : + this.parseJSXNameValueAttribute(); + attributes.push(attribute); + } + return attributes; + }; + JSXParser.prototype.parseJSXOpeningElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXBoundaryElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + if (this.matchJSX('/')) { + this.expectJSX('/'); + var name_3 = this.parseJSXElementName(); + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); + } + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXEmptyExpression = function () { + var node = this.createJSXChildNode(); + this.collectComments(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + return this.finalize(node, new JSXNode.JSXEmptyExpression()); + }; + JSXParser.prototype.parseJSXExpressionContainer = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + var expression; + if (this.matchJSX('}')) { + expression = this.parseJSXEmptyExpression(); + this.expectJSX('}'); + } + else { + this.finishJSX(); + expression = this.parseAssignmentExpression(); + this.reenterJSX(); + } + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXChildren = function () { + var children = []; + while (!this.scanner.eof()) { + var node = this.createJSXChildNode(); + var token = this.nextJSXText(); + if (token.start < token.end) { + var raw = this.getTokenRaw(token); + var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); + children.push(child); + } + if (this.scanner.source[this.scanner.index] === '{') { + var container = this.parseJSXExpressionContainer(); + children.push(container); + } + else { + break; + } + } + return children; + }; + JSXParser.prototype.parseComplexJSXElement = function (el) { + var stack = []; + while (!this.scanner.eof()) { + el.children = el.children.concat(this.parseJSXChildren()); + var node = this.createJSXChildNode(); + var element = this.parseJSXBoundaryElement(); + if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { + var opening = element; + if (opening.selfClosing) { + var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); + el.children.push(child); + } + else { + stack.push(el); + el = { node: node, opening: opening, closing: null, children: [] }; + } + } + if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { + el.closing = element; + var open_1 = getQualifiedElementName(el.opening.name); + var close_1 = getQualifiedElementName(el.closing.name); + if (open_1 !== close_1) { + this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); + } + if (stack.length > 0) { + var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); + el = stack[stack.length - 1]; + el.children.push(child); + stack.pop(); + } + else { + break; + } + } + } + return el; + }; + JSXParser.prototype.parseJSXElement = function () { + var node = this.createJSXNode(); + var opening = this.parseJSXOpeningElement(); + var children = []; + var closing = null; + if (!opening.selfClosing) { + var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); + children = el.children; + closing = el.closing; + } + return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); + }; + JSXParser.prototype.parseJSXRoot = function () { + // Pop the opening '<' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + this.startJSX(); + var element = this.parseJSXElement(); + this.finishJSX(); + return element; + }; + JSXParser.prototype.isStartOfExpression = function () { + return _super.prototype.isStartOfExpression.call(this) || this.match('<'); + }; + return JSXParser; + }(parser_1.Parser)); + exports.JSXParser = JSXParser; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // See also tools/generate-unicode-regex.js. + var Regex = { + // Unicode v8.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // Unicode v8.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + exports.Character = { + /* tslint:disable:no-bitwise */ + fromCodePoint: function (cp) { + return (cp < 0x10000) ? String.fromCharCode(cp) : + String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); + }, + // https://tc39.github.io/ecma262/#sec-white-space + isWhiteSpace: function (cp) { + return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || + (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); + }, + // https://tc39.github.io/ecma262/#sec-line-terminators + isLineTerminator: function (cp) { + return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); + }, + // https://tc39.github.io/ecma262/#sec-names-and-keywords + isIdentifierStart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); + }, + isIdentifierPart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp >= 0x30 && cp <= 0x39) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); + }, + // https://tc39.github.io/ecma262/#sec-literals-numeric-literals + isDecimalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39); // 0..9 + }, + isHexDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39) || + (cp >= 0x41 && cp <= 0x46) || + (cp >= 0x61 && cp <= 0x66); // a..f + }, + isOctalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x37); // 0..7 + } + }; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var jsx_syntax_1 = __webpack_require__(6); + /* tslint:disable:max-classes-per-file */ + var JSXClosingElement = (function () { + function JSXClosingElement(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; + this.name = name; + } + return JSXClosingElement; + }()); + exports.JSXClosingElement = JSXClosingElement; + var JSXElement = (function () { + function JSXElement(openingElement, children, closingElement) { + this.type = jsx_syntax_1.JSXSyntax.JSXElement; + this.openingElement = openingElement; + this.children = children; + this.closingElement = closingElement; + } + return JSXElement; + }()); + exports.JSXElement = JSXElement; + var JSXEmptyExpression = (function () { + function JSXEmptyExpression() { + this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; + } + return JSXEmptyExpression; + }()); + exports.JSXEmptyExpression = JSXEmptyExpression; + var JSXExpressionContainer = (function () { + function JSXExpressionContainer(expression) { + this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; + this.expression = expression; + } + return JSXExpressionContainer; + }()); + exports.JSXExpressionContainer = JSXExpressionContainer; + var JSXIdentifier = (function () { + function JSXIdentifier(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; + this.name = name; + } + return JSXIdentifier; + }()); + exports.JSXIdentifier = JSXIdentifier; + var JSXMemberExpression = (function () { + function JSXMemberExpression(object, property) { + this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; + this.object = object; + this.property = property; + } + return JSXMemberExpression; + }()); + exports.JSXMemberExpression = JSXMemberExpression; + var JSXAttribute = (function () { + function JSXAttribute(name, value) { + this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; + this.name = name; + this.value = value; + } + return JSXAttribute; + }()); + exports.JSXAttribute = JSXAttribute; + var JSXNamespacedName = (function () { + function JSXNamespacedName(namespace, name) { + this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; + this.namespace = namespace; + this.name = name; + } + return JSXNamespacedName; + }()); + exports.JSXNamespacedName = JSXNamespacedName; + var JSXOpeningElement = (function () { + function JSXOpeningElement(name, selfClosing, attributes) { + this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; + this.name = name; + this.selfClosing = selfClosing; + this.attributes = attributes; + } + return JSXOpeningElement; + }()); + exports.JSXOpeningElement = JSXOpeningElement; + var JSXSpreadAttribute = (function () { + function JSXSpreadAttribute(argument) { + this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; + this.argument = argument; + } + return JSXSpreadAttribute; + }()); + exports.JSXSpreadAttribute = JSXSpreadAttribute; + var JSXText = (function () { + function JSXText(value, raw) { + this.type = jsx_syntax_1.JSXSyntax.JSXText; + this.value = value; + this.raw = raw; + } + return JSXText; + }()); + exports.JSXText = JSXText; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JSXSyntax = { + JSXAttribute: 'JSXAttribute', + JSXClosingElement: 'JSXClosingElement', + JSXElement: 'JSXElement', + JSXEmptyExpression: 'JSXEmptyExpression', + JSXExpressionContainer: 'JSXExpressionContainer', + JSXIdentifier: 'JSXIdentifier', + JSXMemberExpression: 'JSXMemberExpression', + JSXNamespacedName: 'JSXNamespacedName', + JSXOpeningElement: 'JSXOpeningElement', + JSXSpreadAttribute: 'JSXSpreadAttribute', + JSXText: 'JSXText' + }; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + /* tslint:disable:max-classes-per-file */ + var ArrayExpression = (function () { + function ArrayExpression(elements) { + this.type = syntax_1.Syntax.ArrayExpression; + this.elements = elements; + } + return ArrayExpression; + }()); + exports.ArrayExpression = ArrayExpression; + var ArrayPattern = (function () { + function ArrayPattern(elements) { + this.type = syntax_1.Syntax.ArrayPattern; + this.elements = elements; + } + return ArrayPattern; + }()); + exports.ArrayPattern = ArrayPattern; + var ArrowFunctionExpression = (function () { + function ArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = false; + } + return ArrowFunctionExpression; + }()); + exports.ArrowFunctionExpression = ArrowFunctionExpression; + var AssignmentExpression = (function () { + function AssignmentExpression(operator, left, right) { + this.type = syntax_1.Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return AssignmentExpression; + }()); + exports.AssignmentExpression = AssignmentExpression; + var AssignmentPattern = (function () { + function AssignmentPattern(left, right) { + this.type = syntax_1.Syntax.AssignmentPattern; + this.left = left; + this.right = right; + } + return AssignmentPattern; + }()); + exports.AssignmentPattern = AssignmentPattern; + var AsyncArrowFunctionExpression = (function () { + function AsyncArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = true; + } + return AsyncArrowFunctionExpression; + }()); + exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; + var AsyncFunctionDeclaration = (function () { + function AsyncFunctionDeclaration(id, params, body) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionDeclaration; + }()); + exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; + var AsyncFunctionExpression = (function () { + function AsyncFunctionExpression(id, params, body) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionExpression; + }()); + exports.AsyncFunctionExpression = AsyncFunctionExpression; + var AwaitExpression = (function () { + function AwaitExpression(argument) { + this.type = syntax_1.Syntax.AwaitExpression; + this.argument = argument; + } + return AwaitExpression; + }()); + exports.AwaitExpression = AwaitExpression; + var BinaryExpression = (function () { + function BinaryExpression(operator, left, right) { + var logical = (operator === '||' || operator === '&&'); + this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return BinaryExpression; + }()); + exports.BinaryExpression = BinaryExpression; + var BlockStatement = (function () { + function BlockStatement(body) { + this.type = syntax_1.Syntax.BlockStatement; + this.body = body; + } + return BlockStatement; + }()); + exports.BlockStatement = BlockStatement; + var BreakStatement = (function () { + function BreakStatement(label) { + this.type = syntax_1.Syntax.BreakStatement; + this.label = label; + } + return BreakStatement; + }()); + exports.BreakStatement = BreakStatement; + var CallExpression = (function () { + function CallExpression(callee, args) { + this.type = syntax_1.Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + } + return CallExpression; + }()); + exports.CallExpression = CallExpression; + var CatchClause = (function () { + function CatchClause(param, body) { + this.type = syntax_1.Syntax.CatchClause; + this.param = param; + this.body = body; + } + return CatchClause; + }()); + exports.CatchClause = CatchClause; + var ClassBody = (function () { + function ClassBody(body) { + this.type = syntax_1.Syntax.ClassBody; + this.body = body; + } + return ClassBody; + }()); + exports.ClassBody = ClassBody; + var ClassDeclaration = (function () { + function ClassDeclaration(id, superClass, body) { + this.type = syntax_1.Syntax.ClassDeclaration; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassDeclaration; + }()); + exports.ClassDeclaration = ClassDeclaration; + var ClassExpression = (function () { + function ClassExpression(id, superClass, body) { + this.type = syntax_1.Syntax.ClassExpression; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassExpression; + }()); + exports.ClassExpression = ClassExpression; + var ComputedMemberExpression = (function () { + function ComputedMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = true; + this.object = object; + this.property = property; + } + return ComputedMemberExpression; + }()); + exports.ComputedMemberExpression = ComputedMemberExpression; + var ConditionalExpression = (function () { + function ConditionalExpression(test, consequent, alternate) { + this.type = syntax_1.Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return ConditionalExpression; + }()); + exports.ConditionalExpression = ConditionalExpression; + var ContinueStatement = (function () { + function ContinueStatement(label) { + this.type = syntax_1.Syntax.ContinueStatement; + this.label = label; + } + return ContinueStatement; + }()); + exports.ContinueStatement = ContinueStatement; + var DebuggerStatement = (function () { + function DebuggerStatement() { + this.type = syntax_1.Syntax.DebuggerStatement; + } + return DebuggerStatement; + }()); + exports.DebuggerStatement = DebuggerStatement; + var Directive = (function () { + function Directive(expression, directive) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + this.directive = directive; + } + return Directive; + }()); + exports.Directive = Directive; + var DoWhileStatement = (function () { + function DoWhileStatement(body, test) { + this.type = syntax_1.Syntax.DoWhileStatement; + this.body = body; + this.test = test; + } + return DoWhileStatement; + }()); + exports.DoWhileStatement = DoWhileStatement; + var EmptyStatement = (function () { + function EmptyStatement() { + this.type = syntax_1.Syntax.EmptyStatement; + } + return EmptyStatement; + }()); + exports.EmptyStatement = EmptyStatement; + var ExportAllDeclaration = (function () { + function ExportAllDeclaration(source) { + this.type = syntax_1.Syntax.ExportAllDeclaration; + this.source = source; + } + return ExportAllDeclaration; + }()); + exports.ExportAllDeclaration = ExportAllDeclaration; + var ExportDefaultDeclaration = (function () { + function ExportDefaultDeclaration(declaration) { + this.type = syntax_1.Syntax.ExportDefaultDeclaration; + this.declaration = declaration; + } + return ExportDefaultDeclaration; + }()); + exports.ExportDefaultDeclaration = ExportDefaultDeclaration; + var ExportNamedDeclaration = (function () { + function ExportNamedDeclaration(declaration, specifiers, source) { + this.type = syntax_1.Syntax.ExportNamedDeclaration; + this.declaration = declaration; + this.specifiers = specifiers; + this.source = source; + } + return ExportNamedDeclaration; + }()); + exports.ExportNamedDeclaration = ExportNamedDeclaration; + var ExportSpecifier = (function () { + function ExportSpecifier(local, exported) { + this.type = syntax_1.Syntax.ExportSpecifier; + this.exported = exported; + this.local = local; + } + return ExportSpecifier; + }()); + exports.ExportSpecifier = ExportSpecifier; + var ExpressionStatement = (function () { + function ExpressionStatement(expression) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + } + return ExpressionStatement; + }()); + exports.ExpressionStatement = ExpressionStatement; + var ForInStatement = (function () { + function ForInStatement(left, right, body) { + this.type = syntax_1.Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + } + return ForInStatement; + }()); + exports.ForInStatement = ForInStatement; + var ForOfStatement = (function () { + function ForOfStatement(left, right, body) { + this.type = syntax_1.Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + } + return ForOfStatement; + }()); + exports.ForOfStatement = ForOfStatement; + var ForStatement = (function () { + function ForStatement(init, test, update, body) { + this.type = syntax_1.Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + } + return ForStatement; + }()); + exports.ForStatement = ForStatement; + var FunctionDeclaration = (function () { + function FunctionDeclaration(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionDeclaration; + }()); + exports.FunctionDeclaration = FunctionDeclaration; + var FunctionExpression = (function () { + function FunctionExpression(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionExpression; + }()); + exports.FunctionExpression = FunctionExpression; + var Identifier = (function () { + function Identifier(name) { + this.type = syntax_1.Syntax.Identifier; + this.name = name; + } + return Identifier; + }()); + exports.Identifier = Identifier; + var IfStatement = (function () { + function IfStatement(test, consequent, alternate) { + this.type = syntax_1.Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return IfStatement; + }()); + exports.IfStatement = IfStatement; + var ImportDeclaration = (function () { + function ImportDeclaration(specifiers, source) { + this.type = syntax_1.Syntax.ImportDeclaration; + this.specifiers = specifiers; + this.source = source; + } + return ImportDeclaration; + }()); + exports.ImportDeclaration = ImportDeclaration; + var ImportDefaultSpecifier = (function () { + function ImportDefaultSpecifier(local) { + this.type = syntax_1.Syntax.ImportDefaultSpecifier; + this.local = local; + } + return ImportDefaultSpecifier; + }()); + exports.ImportDefaultSpecifier = ImportDefaultSpecifier; + var ImportNamespaceSpecifier = (function () { + function ImportNamespaceSpecifier(local) { + this.type = syntax_1.Syntax.ImportNamespaceSpecifier; + this.local = local; + } + return ImportNamespaceSpecifier; + }()); + exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + var ImportSpecifier = (function () { + function ImportSpecifier(local, imported) { + this.type = syntax_1.Syntax.ImportSpecifier; + this.local = local; + this.imported = imported; + } + return ImportSpecifier; + }()); + exports.ImportSpecifier = ImportSpecifier; + var LabeledStatement = (function () { + function LabeledStatement(label, body) { + this.type = syntax_1.Syntax.LabeledStatement; + this.label = label; + this.body = body; + } + return LabeledStatement; + }()); + exports.LabeledStatement = LabeledStatement; + var Literal = (function () { + function Literal(value, raw) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + } + return Literal; + }()); + exports.Literal = Literal; + var MetaProperty = (function () { + function MetaProperty(meta, property) { + this.type = syntax_1.Syntax.MetaProperty; + this.meta = meta; + this.property = property; + } + return MetaProperty; + }()); + exports.MetaProperty = MetaProperty; + var MethodDefinition = (function () { + function MethodDefinition(key, computed, value, kind, isStatic) { + this.type = syntax_1.Syntax.MethodDefinition; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.static = isStatic; + } + return MethodDefinition; + }()); + exports.MethodDefinition = MethodDefinition; + var Module = (function () { + function Module(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'module'; + } + return Module; + }()); + exports.Module = Module; + var NewExpression = (function () { + function NewExpression(callee, args) { + this.type = syntax_1.Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + } + return NewExpression; + }()); + exports.NewExpression = NewExpression; + var ObjectExpression = (function () { + function ObjectExpression(properties) { + this.type = syntax_1.Syntax.ObjectExpression; + this.properties = properties; + } + return ObjectExpression; + }()); + exports.ObjectExpression = ObjectExpression; + var ObjectPattern = (function () { + function ObjectPattern(properties) { + this.type = syntax_1.Syntax.ObjectPattern; + this.properties = properties; + } + return ObjectPattern; + }()); + exports.ObjectPattern = ObjectPattern; + var Property = (function () { + function Property(kind, key, computed, value, method, shorthand) { + this.type = syntax_1.Syntax.Property; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + } + return Property; + }()); + exports.Property = Property; + var RegexLiteral = (function () { + function RegexLiteral(value, raw, pattern, flags) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + this.regex = { pattern: pattern, flags: flags }; + } + return RegexLiteral; + }()); + exports.RegexLiteral = RegexLiteral; + var RestElement = (function () { + function RestElement(argument) { + this.type = syntax_1.Syntax.RestElement; + this.argument = argument; + } + return RestElement; + }()); + exports.RestElement = RestElement; + var ReturnStatement = (function () { + function ReturnStatement(argument) { + this.type = syntax_1.Syntax.ReturnStatement; + this.argument = argument; + } + return ReturnStatement; + }()); + exports.ReturnStatement = ReturnStatement; + var Script = (function () { + function Script(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'script'; + } + return Script; + }()); + exports.Script = Script; + var SequenceExpression = (function () { + function SequenceExpression(expressions) { + this.type = syntax_1.Syntax.SequenceExpression; + this.expressions = expressions; + } + return SequenceExpression; + }()); + exports.SequenceExpression = SequenceExpression; + var SpreadElement = (function () { + function SpreadElement(argument) { + this.type = syntax_1.Syntax.SpreadElement; + this.argument = argument; + } + return SpreadElement; + }()); + exports.SpreadElement = SpreadElement; + var StaticMemberExpression = (function () { + function StaticMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = false; + this.object = object; + this.property = property; + } + return StaticMemberExpression; + }()); + exports.StaticMemberExpression = StaticMemberExpression; + var Super = (function () { + function Super() { + this.type = syntax_1.Syntax.Super; + } + return Super; + }()); + exports.Super = Super; + var SwitchCase = (function () { + function SwitchCase(test, consequent) { + this.type = syntax_1.Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + } + return SwitchCase; + }()); + exports.SwitchCase = SwitchCase; + var SwitchStatement = (function () { + function SwitchStatement(discriminant, cases) { + this.type = syntax_1.Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + } + return SwitchStatement; + }()); + exports.SwitchStatement = SwitchStatement; + var TaggedTemplateExpression = (function () { + function TaggedTemplateExpression(tag, quasi) { + this.type = syntax_1.Syntax.TaggedTemplateExpression; + this.tag = tag; + this.quasi = quasi; + } + return TaggedTemplateExpression; + }()); + exports.TaggedTemplateExpression = TaggedTemplateExpression; + var TemplateElement = (function () { + function TemplateElement(value, tail) { + this.type = syntax_1.Syntax.TemplateElement; + this.value = value; + this.tail = tail; + } + return TemplateElement; + }()); + exports.TemplateElement = TemplateElement; + var TemplateLiteral = (function () { + function TemplateLiteral(quasis, expressions) { + this.type = syntax_1.Syntax.TemplateLiteral; + this.quasis = quasis; + this.expressions = expressions; + } + return TemplateLiteral; + }()); + exports.TemplateLiteral = TemplateLiteral; + var ThisExpression = (function () { + function ThisExpression() { + this.type = syntax_1.Syntax.ThisExpression; + } + return ThisExpression; + }()); + exports.ThisExpression = ThisExpression; + var ThrowStatement = (function () { + function ThrowStatement(argument) { + this.type = syntax_1.Syntax.ThrowStatement; + this.argument = argument; + } + return ThrowStatement; + }()); + exports.ThrowStatement = ThrowStatement; + var TryStatement = (function () { + function TryStatement(block, handler, finalizer) { + this.type = syntax_1.Syntax.TryStatement; + this.block = block; + this.handler = handler; + this.finalizer = finalizer; + } + return TryStatement; + }()); + exports.TryStatement = TryStatement; + var UnaryExpression = (function () { + function UnaryExpression(operator, argument) { + this.type = syntax_1.Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + } + return UnaryExpression; + }()); + exports.UnaryExpression = UnaryExpression; + var UpdateExpression = (function () { + function UpdateExpression(operator, argument, prefix) { + this.type = syntax_1.Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = prefix; + } + return UpdateExpression; + }()); + exports.UpdateExpression = UpdateExpression; + var VariableDeclaration = (function () { + function VariableDeclaration(declarations, kind) { + this.type = syntax_1.Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + } + return VariableDeclaration; + }()); + exports.VariableDeclaration = VariableDeclaration; + var VariableDeclarator = (function () { + function VariableDeclarator(id, init) { + this.type = syntax_1.Syntax.VariableDeclarator; + this.id = id; + this.init = init; + } + return VariableDeclarator; + }()); + exports.VariableDeclarator = VariableDeclarator; + var WhileStatement = (function () { + function WhileStatement(test, body) { + this.type = syntax_1.Syntax.WhileStatement; + this.test = test; + this.body = body; + } + return WhileStatement; + }()); + exports.WhileStatement = WhileStatement; + var WithStatement = (function () { + function WithStatement(object, body) { + this.type = syntax_1.Syntax.WithStatement; + this.object = object; + this.body = body; + } + return WithStatement; + }()); + exports.WithStatement = WithStatement; + var YieldExpression = (function () { + function YieldExpression(argument, delegate) { + this.type = syntax_1.Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + } + return YieldExpression; + }()); + exports.YieldExpression = YieldExpression; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var error_handler_1 = __webpack_require__(10); + var messages_1 = __webpack_require__(11); + var Node = __webpack_require__(7); + var scanner_1 = __webpack_require__(12); + var syntax_1 = __webpack_require__(2); + var token_1 = __webpack_require__(13); + var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; + var Parser = (function () { + function Parser(code, options, delegate) { + if (options === void 0) { options = {}; } + this.config = { + range: (typeof options.range === 'boolean') && options.range, + loc: (typeof options.loc === 'boolean') && options.loc, + source: null, + tokens: (typeof options.tokens === 'boolean') && options.tokens, + comment: (typeof options.comment === 'boolean') && options.comment, + tolerant: (typeof options.tolerant === 'boolean') && options.tolerant + }; + if (this.config.loc && options.source && options.source !== null) { + this.config.source = String(options.source); + } + this.delegate = delegate; + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = this.config.tolerant; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = this.config.comment; + this.operatorPrecedence = { + ')': 0, + ';': 0, + ',': 0, + '=': 0, + ']': 0, + '||': 1, + '&&': 2, + '|': 3, + '^': 4, + '&': 5, + '==': 6, + '!=': 6, + '===': 6, + '!==': 6, + '<': 7, + '>': 7, + '<=': 7, + '>=': 7, + '<<': 8, + '>>': 8, + '>>>': 8, + '+': 9, + '-': 9, + '*': 11, + '/': 11, + '%': 11 + }; + this.lookahead = { + type: 2 /* EOF */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: 0, + start: 0, + end: 0 + }; + this.hasLineTerminator = false; + this.context = { + isModule: false, + await: false, + allowIn: true, + allowStrictDirective: true, + allowYield: true, + firstCoverInitializedNameError: null, + isAssignmentTarget: false, + isBindingElement: false, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + labelSet: {}, + strict: false + }; + this.tokens = []; + this.startMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.lastMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.nextToken(); + this.lastMarker = { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + } + Parser.prototype.throwError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + throw this.errorHandler.createError(index, line, column, msg); + }; + Parser.prototype.tolerateError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.scanner.lineNumber; + var column = this.lastMarker.column + 1; + this.errorHandler.tolerateError(index, line, column, msg); + }; + // Throw an exception because of the token. + Parser.prototype.unexpectedTokenError = function (token, message) { + var msg = message || messages_1.Messages.UnexpectedToken; + var value; + if (token) { + if (!message) { + msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : + (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : + (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : + (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : + (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : + messages_1.Messages.UnexpectedToken; + if (token.type === 4 /* Keyword */) { + if (this.scanner.isFutureReservedWord(token.value)) { + msg = messages_1.Messages.UnexpectedReserved; + } + else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { + msg = messages_1.Messages.StrictReservedWord; + } + } + } + value = token.value; + } + else { + value = 'ILLEGAL'; + } + msg = msg.replace('%0', value); + if (token && typeof token.lineNumber === 'number') { + var index = token.start; + var line = token.lineNumber; + var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; + var column = token.start - lastMarkerLineStart + 1; + return this.errorHandler.createError(index, line, column, msg); + } + else { + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + return this.errorHandler.createError(index, line, column, msg); + } + }; + Parser.prototype.throwUnexpectedToken = function (token, message) { + throw this.unexpectedTokenError(token, message); + }; + Parser.prototype.tolerateUnexpectedToken = function (token, message) { + this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); + }; + Parser.prototype.collectComments = function () { + if (!this.config.comment) { + this.scanner.scanComments(); + } + else { + var comments = this.scanner.scanComments(); + if (comments.length > 0 && this.delegate) { + for (var i = 0; i < comments.length; ++i) { + var e = comments[i]; + var node = void 0; + node = { + type: e.multiLine ? 'BlockComment' : 'LineComment', + value: this.scanner.source.slice(e.slice[0], e.slice[1]) + }; + if (this.config.range) { + node.range = e.range; + } + if (this.config.loc) { + node.loc = e.loc; + } + var metadata = { + start: { + line: e.loc.start.line, + column: e.loc.start.column, + offset: e.range[0] + }, + end: { + line: e.loc.end.line, + column: e.loc.end.column, + offset: e.range[1] + } + }; + this.delegate(node, metadata); + } + } + } + }; + // From internal representation to an external structure + Parser.prototype.getTokenRaw = function (token) { + return this.scanner.source.slice(token.start, token.end); + }; + Parser.prototype.convertToken = function (token) { + var t = { + type: token_1.TokenName[token.type], + value: this.getTokenRaw(token) + }; + if (this.config.range) { + t.range = [token.start, token.end]; + } + if (this.config.loc) { + t.loc = { + start: { + line: this.startMarker.line, + column: this.startMarker.column + }, + end: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + } + }; + } + if (token.type === 9 /* RegularExpression */) { + var pattern = token.pattern; + var flags = token.flags; + t.regex = { pattern: pattern, flags: flags }; + } + return t; + }; + Parser.prototype.nextToken = function () { + var token = this.lookahead; + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + this.collectComments(); + if (this.scanner.index !== this.startMarker.index) { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + } + var next = this.scanner.lex(); + this.hasLineTerminator = (token.lineNumber !== next.lineNumber); + if (next && this.context.strict && next.type === 3 /* Identifier */) { + if (this.scanner.isStrictModeReservedWord(next.value)) { + next.type = 4 /* Keyword */; + } + } + this.lookahead = next; + if (this.config.tokens && next.type !== 2 /* EOF */) { + this.tokens.push(this.convertToken(next)); + } + return token; + }; + Parser.prototype.nextRegexToken = function () { + this.collectComments(); + var token = this.scanner.scanRegExp(); + if (this.config.tokens) { + // Pop the previous token, '/' or '/=' + // This is added from the lookahead token. + this.tokens.pop(); + this.tokens.push(this.convertToken(token)); + } + // Prime the next lookahead. + this.lookahead = token; + this.nextToken(); + return token; + }; + Parser.prototype.createNode = function () { + return { + index: this.startMarker.index, + line: this.startMarker.line, + column: this.startMarker.column + }; + }; + Parser.prototype.startNode = function (token, lastLineStart) { + if (lastLineStart === void 0) { lastLineStart = 0; } + var column = token.start - token.lineStart; + var line = token.lineNumber; + if (column < 0) { + column += lastLineStart; + line--; + } + return { + index: token.start, + line: line, + column: column + }; + }; + Parser.prototype.finalize = function (marker, node) { + if (this.config.range) { + node.range = [marker.index, this.lastMarker.index]; + } + if (this.config.loc) { + node.loc = { + start: { + line: marker.line, + column: marker.column, + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column + } + }; + if (this.config.source) { + node.loc.source = this.config.source; + } + } + if (this.delegate) { + var metadata = { + start: { + line: marker.line, + column: marker.column, + offset: marker.index + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column, + offset: this.lastMarker.index + } + }; + this.delegate(node, metadata); + } + return node; + }; + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + Parser.prototype.expect = function (value) { + var token = this.nextToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). + Parser.prototype.expectCommaSeparator = function () { + if (this.config.tolerant) { + var token = this.lookahead; + if (token.type === 7 /* Punctuator */ && token.value === ',') { + this.nextToken(); + } + else if (token.type === 7 /* Punctuator */ && token.value === ';') { + this.nextToken(); + this.tolerateUnexpectedToken(token); + } + else { + this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); + } + } + else { + this.expect(','); + } + }; + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + Parser.prototype.expectKeyword = function (keyword) { + var token = this.nextToken(); + if (token.type !== 4 /* Keyword */ || token.value !== keyword) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next token matches the specified punctuator. + Parser.prototype.match = function (value) { + return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; + }; + // Return true if the next token matches the specified keyword + Parser.prototype.matchKeyword = function (keyword) { + return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; + }; + // Return true if the next token matches the specified contextual keyword + // (where an identifier is sometimes a keyword depending on the context) + Parser.prototype.matchContextualKeyword = function (keyword) { + return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; + }; + // Return true if the next token is an assignment operator + Parser.prototype.matchAssign = function () { + if (this.lookahead.type !== 7 /* Punctuator */) { + return false; + } + var op = this.lookahead.value; + return op === '=' || + op === '*=' || + op === '**=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + }; + // Cover grammar support. + // + // When an assignment expression position starts with an left parenthesis, the determination of the type + // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) + // or the first comma. This situation also defers the determination of all the expressions nested in the pair. + // + // There are three productions that can be parsed in a parentheses pair that needs to be determined + // after the outermost pair is closed. They are: + // + // 1. AssignmentExpression + // 2. BindingElements + // 3. AssignmentTargets + // + // In order to avoid exponential backtracking, we use two flags to denote if the production can be + // binding element or assignment target. + // + // The three productions have the relationship: + // + // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression + // + // with a single exception that CoverInitializedName when used directly in an Expression, generates + // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the + // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. + // + // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not + // effect the current flags. This means the production the parser parses is only used as an expression. Therefore + // the CoverInitializedName check is conducted. + // + // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates + // the flags outside of the parser. This means the production the parser parses is used as a part of a potential + // pattern. The CoverInitializedName check is deferred. + Parser.prototype.isolateCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + if (this.context.firstCoverInitializedNameError !== null) { + this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); + } + this.context.isBindingElement = previousIsBindingElement; + this.context.isAssignmentTarget = previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; + return result; + }; + Parser.prototype.inheritCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; + this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; + return result; + }; + Parser.prototype.consumeSemicolon = function () { + if (this.match(';')) { + this.nextToken(); + } + else if (!this.hasLineTerminator) { + if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { + this.throwUnexpectedToken(this.lookahead); + } + this.lastMarker.index = this.startMarker.index; + this.lastMarker.line = this.startMarker.line; + this.lastMarker.column = this.startMarker.column; + } + }; + // https://tc39.github.io/ecma262/#sec-primary-expression + Parser.prototype.parsePrimaryExpression = function () { + var node = this.createNode(); + var expr; + var token, raw; + switch (this.lookahead.type) { + case 3 /* Identifier */: + if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { + this.tolerateUnexpectedToken(this.lookahead); + } + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + break; + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + if (this.context.strict && this.lookahead.octal) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 1 /* BooleanLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); + break; + case 5 /* NullLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(null, raw)); + break; + case 10 /* Template */: + expr = this.parseTemplateLiteral(); + break; + case 7 /* Punctuator */: + switch (this.lookahead.value) { + case '(': + this.context.isBindingElement = false; + expr = this.inheritCoverGrammar(this.parseGroupExpression); + break; + case '[': + expr = this.inheritCoverGrammar(this.parseArrayInitializer); + break; + case '{': + expr = this.inheritCoverGrammar(this.parseObjectInitializer); + break; + case '/': + case '/=': + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.scanner.index = this.startMarker.index; + token = this.nextRegexToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + break; + case 4 /* Keyword */: + if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseIdentifierName(); + } + else if (!this.context.strict && this.matchKeyword('let')) { + expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + } + else { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + if (this.matchKeyword('function')) { + expr = this.parseFunctionExpression(); + } + else if (this.matchKeyword('this')) { + this.nextToken(); + expr = this.finalize(node, new Node.ThisExpression()); + } + else if (this.matchKeyword('class')) { + expr = this.parseClassExpression(); + } + else { + expr = this.throwUnexpectedToken(this.nextToken()); + } + } + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-array-initializer + Parser.prototype.parseSpreadElement = function () { + var node = this.createNode(); + this.expect('...'); + var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); + return this.finalize(node, new Node.SpreadElement(arg)); + }; + Parser.prototype.parseArrayInitializer = function () { + var node = this.createNode(); + var elements = []; + this.expect('['); + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else if (this.match('...')) { + var element = this.parseSpreadElement(); + if (!this.match(']')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.expect(','); + } + elements.push(element); + } + else { + elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayExpression(elements)); + }; + // https://tc39.github.io/ecma262/#sec-object-initializer + Parser.prototype.parsePropertyMethod = function (params) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = params.simple; + var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); + if (this.context.strict && params.firstRestricted) { + this.tolerateUnexpectedToken(params.firstRestricted, params.message); + } + if (this.context.strict && params.stricted) { + this.tolerateUnexpectedToken(params.stricted, params.message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + return body; + }; + Parser.prototype.parsePropertyMethodFunction = function () { + var isGenerator = false; + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + Parser.prototype.parsePropertyMethodAsyncFunction = function () { + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = false; + this.context.await = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + }; + Parser.prototype.parseObjectPropertyKey = function () { + var node = this.createNode(); + var token = this.nextToken(); + var key; + switch (token.type) { + case 8 /* StringLiteral */: + case 6 /* NumericLiteral */: + if (this.context.strict && token.octal) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); + } + var raw = this.getTokenRaw(token); + key = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 3 /* Identifier */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 4 /* Keyword */: + key = this.finalize(node, new Node.Identifier(token.value)); + break; + case 7 /* Punctuator */: + if (token.value === '[') { + key = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.expect(']'); + } + else { + key = this.throwUnexpectedToken(token); + } + break; + default: + key = this.throwUnexpectedToken(token); + } + return key; + }; + Parser.prototype.isPropertyKey = function (key, value) { + return (key.type === syntax_1.Syntax.Identifier && key.name === value) || + (key.type === syntax_1.Syntax.Literal && key.value === value); + }; + Parser.prototype.parseObjectProperty = function (hasProto) { + var node = this.createNode(); + var token = this.lookahead; + var kind; + var key = null; + var value = null; + var computed = false; + var method = false; + var shorthand = false; + var isAsync = false; + if (token.type === 3 /* Identifier */) { + var id = token.value; + this.nextToken(); + computed = this.match('['); + isAsync = !this.hasLineTerminator && (id === 'async') && + !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + } + else if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + else { + if (!key) { + this.throwUnexpectedToken(this.lookahead); + } + kind = 'init'; + if (this.match(':') && !isAsync) { + if (!computed && this.isPropertyKey(key, '__proto__')) { + if (hasProto.value) { + this.tolerateError(messages_1.Messages.DuplicateProtoProperty); + } + hasProto.value = true; + } + this.nextToken(); + value = this.inheritCoverGrammar(this.parseAssignmentExpression); + } + else if (this.match('(')) { + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + else if (token.type === 3 /* Identifier */) { + var id = this.finalize(node, new Node.Identifier(token.value)); + if (this.match('=')) { + this.context.firstCoverInitializedNameError = this.lookahead; + this.nextToken(); + shorthand = true; + var init = this.isolateCoverGrammar(this.parseAssignmentExpression); + value = this.finalize(node, new Node.AssignmentPattern(id, init)); + } + else { + shorthand = true; + value = id; + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectInitializer = function () { + var node = this.createNode(); + this.expect('{'); + var properties = []; + var hasProto = { value: false }; + while (!this.match('}')) { + properties.push(this.parseObjectProperty(hasProto)); + if (!this.match('}')) { + this.expectCommaSeparator(); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectExpression(properties)); + }; + // https://tc39.github.io/ecma262/#sec-template-literals + Parser.prototype.parseTemplateHead = function () { + assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateElement = function () { + if (this.lookahead.type !== 10 /* Template */) { + this.throwUnexpectedToken(); + } + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateLiteral = function () { + var node = this.createNode(); + var expressions = []; + var quasis = []; + var quasi = this.parseTemplateHead(); + quasis.push(quasi); + while (!quasi.tail) { + expressions.push(this.parseExpression()); + quasi = this.parseTemplateElement(); + quasis.push(quasi); + } + return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + }; + // https://tc39.github.io/ecma262/#sec-grouping-operator + Parser.prototype.reinterpretExpressionAsPattern = function (expr) { + switch (expr.type) { + case syntax_1.Syntax.Identifier: + case syntax_1.Syntax.MemberExpression: + case syntax_1.Syntax.RestElement: + case syntax_1.Syntax.AssignmentPattern: + break; + case syntax_1.Syntax.SpreadElement: + expr.type = syntax_1.Syntax.RestElement; + this.reinterpretExpressionAsPattern(expr.argument); + break; + case syntax_1.Syntax.ArrayExpression: + expr.type = syntax_1.Syntax.ArrayPattern; + for (var i = 0; i < expr.elements.length; i++) { + if (expr.elements[i] !== null) { + this.reinterpretExpressionAsPattern(expr.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectExpression: + expr.type = syntax_1.Syntax.ObjectPattern; + for (var i = 0; i < expr.properties.length; i++) { + this.reinterpretExpressionAsPattern(expr.properties[i].value); + } + break; + case syntax_1.Syntax.AssignmentExpression: + expr.type = syntax_1.Syntax.AssignmentPattern; + delete expr.operator; + this.reinterpretExpressionAsPattern(expr.left); + break; + default: + // Allow other node type for tolerant parsing. + break; + } + }; + Parser.prototype.parseGroupExpression = function () { + var expr; + this.expect('('); + if (this.match(')')) { + this.nextToken(); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [], + async: false + }; + } + else { + var startToken = this.lookahead; + var params = []; + if (this.match('...')) { + expr = this.parseRestElement(params); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + else { + var arrow = false; + this.context.isBindingElement = true; + expr = this.inheritCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + this.context.isAssignmentTarget = false; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + if (this.match(')')) { + this.nextToken(); + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else if (this.match('...')) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + expressions.push(this.parseRestElement(params)); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + this.context.isBindingElement = false; + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else { + expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + } + if (arrow) { + break; + } + } + if (!arrow) { + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + } + if (!arrow) { + this.expect(')'); + if (this.match('=>')) { + if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + if (!arrow) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + if (expr.type === syntax_1.Syntax.SequenceExpression) { + for (var i = 0; i < expr.expressions.length; i++) { + this.reinterpretExpressionAsPattern(expr.expressions[i]); + } + } + else { + this.reinterpretExpressionAsPattern(expr); + } + var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); + expr = { + type: ArrowParameterPlaceHolder, + params: parameters, + async: false + }; + } + } + this.context.isBindingElement = false; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions + Parser.prototype.parseArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAssignmentExpression); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.isIdentifierName = function (token) { + return token.type === 3 /* Identifier */ || + token.type === 4 /* Keyword */ || + token.type === 1 /* BooleanLiteral */ || + token.type === 5 /* NullLiteral */; + }; + Parser.prototype.parseIdentifierName = function () { + var node = this.createNode(); + var token = this.nextToken(); + if (!this.isIdentifierName(token)) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseNewExpression = function () { + var node = this.createNode(); + var id = this.parseIdentifierName(); + assert_1.assert(id.name === 'new', 'New expression must start with `new`'); + var expr; + if (this.match('.')) { + this.nextToken(); + if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { + var property = this.parseIdentifierName(); + expr = new Node.MetaProperty(id, property); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); + var args = this.match('(') ? this.parseArguments() : []; + expr = new Node.NewExpression(callee, args); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return this.finalize(node, expr); + }; + Parser.prototype.parseAsyncArgument = function () { + var arg = this.parseAssignmentExpression(); + this.context.firstCoverInitializedNameError = null; + return arg; + }; + Parser.prototype.parseAsyncArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAsyncArgument); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { + var startToken = this.lookahead; + var maybeAsync = this.matchContextualKeyword('async'); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var expr; + if (this.matchKeyword('super') && this.context.inFunctionBody) { + expr = this.createNode(); + this.nextToken(); + expr = this.finalize(expr, new Node.Super()); + if (!this.match('(') && !this.match('.') && !this.match('[')) { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + } + while (true) { + if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + } + else if (this.match('(')) { + var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); + this.context.isBindingElement = false; + this.context.isAssignmentTarget = false; + var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); + expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + if (asyncArrow && this.match('=>')) { + for (var i = 0; i < args.length; ++i) { + this.reinterpretExpressionAsPattern(args[i]); + } + expr = { + type: ArrowParameterPlaceHolder, + params: args, + async: true + }; + } + } + else if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + this.context.allowIn = previousAllowIn; + return expr; + }; + Parser.prototype.parseSuper = function () { + var node = this.createNode(); + this.expectKeyword('super'); + if (!this.match('[') && !this.match('.')) { + this.throwUnexpectedToken(this.lookahead); + } + return this.finalize(node, new Node.Super()); + }; + Parser.prototype.parseLeftHandSideExpression = function () { + assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); + var node = this.startNode(this.lookahead); + var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : + this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + while (true) { + if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + } + else if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-update-expressions + Parser.prototype.parseUpdateExpression = function () { + var expr; + var startToken = this.lookahead; + if (this.match('++') || this.match('--')) { + var node = this.startNode(startToken); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPrefix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + var prefix = true; + expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { + if (this.match('++') || this.match('--')) { + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPostfix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var operator = this.nextToken().value; + var prefix = false; + expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-unary-operators + Parser.prototype.parseAwaitExpression = function () { + var node = this.createNode(); + this.nextToken(); + var argument = this.parseUnaryExpression(); + return this.finalize(node, new Node.AwaitExpression(argument)); + }; + Parser.prototype.parseUnaryExpression = function () { + var expr; + if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || + this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { + var node = this.startNode(this.lookahead); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { + this.tolerateError(messages_1.Messages.StrictDelete); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else if (this.context.await && this.matchContextualKeyword('await')) { + expr = this.parseAwaitExpression(); + } + else { + expr = this.parseUpdateExpression(); + } + return expr; + }; + Parser.prototype.parseExponentiationExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-exp-operator + // https://tc39.github.io/ecma262/#sec-multiplicative-operators + // https://tc39.github.io/ecma262/#sec-additive-operators + // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators + // https://tc39.github.io/ecma262/#sec-relational-operators + // https://tc39.github.io/ecma262/#sec-equality-operators + // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators + // https://tc39.github.io/ecma262/#sec-binary-logical-operators + Parser.prototype.binaryPrecedence = function (token) { + var op = token.value; + var precedence; + if (token.type === 7 /* Punctuator */) { + precedence = this.operatorPrecedence[op] || 0; + } + else if (token.type === 4 /* Keyword */) { + precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; + } + else { + precedence = 0; + } + return precedence; + }; + Parser.prototype.parseBinaryExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); + var token = this.lookahead; + var prec = this.binaryPrecedence(token); + if (prec > 0) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var markers = [startToken, this.lookahead]; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + var stack = [left, token.value, right]; + var precedences = [prec]; + while (true) { + prec = this.binaryPrecedence(this.lookahead); + if (prec <= 0) { + break; + } + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { + right = stack.pop(); + var operator = stack.pop(); + precedences.pop(); + left = stack.pop(); + markers.pop(); + var node = this.startNode(markers[markers.length - 1]); + stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + } + // Shift. + stack.push(this.nextToken().value); + precedences.push(prec); + markers.push(this.lookahead); + stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); + } + // Final reduce to clean-up the stack. + var i = stack.length - 1; + expr = stack[i]; + var lastMarker = markers.pop(); + while (i > 1) { + var marker = markers.pop(); + var lastLineStart = lastMarker && lastMarker.lineStart; + var node = this.startNode(marker, lastLineStart); + var operator = stack[i - 1]; + expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + i -= 2; + lastMarker = marker; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-conditional-operator + Parser.prototype.parseConditionalExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseBinaryExpression); + if (this.match('?')) { + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + this.expect(':'); + var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-assignment-operators + Parser.prototype.checkPatternParam = function (options, param) { + switch (param.type) { + case syntax_1.Syntax.Identifier: + this.validateParam(options, param, param.name); + break; + case syntax_1.Syntax.RestElement: + this.checkPatternParam(options, param.argument); + break; + case syntax_1.Syntax.AssignmentPattern: + this.checkPatternParam(options, param.left); + break; + case syntax_1.Syntax.ArrayPattern: + for (var i = 0; i < param.elements.length; i++) { + if (param.elements[i] !== null) { + this.checkPatternParam(options, param.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectPattern: + for (var i = 0; i < param.properties.length; i++) { + this.checkPatternParam(options, param.properties[i].value); + } + break; + default: + break; + } + options.simple = options.simple && (param instanceof Node.Identifier); + }; + Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { + var params = [expr]; + var options; + var asyncArrow = false; + switch (expr.type) { + case syntax_1.Syntax.Identifier: + break; + case ArrowParameterPlaceHolder: + params = expr.params; + asyncArrow = expr.async; + break; + default: + return null; + } + options = { + simple: true, + paramSet: {} + }; + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.AssignmentPattern) { + if (param.right.type === syntax_1.Syntax.YieldExpression) { + if (param.right.argument) { + this.throwUnexpectedToken(this.lookahead); + } + param.right.type = syntax_1.Syntax.Identifier; + param.right.name = 'yield'; + delete param.right.argument; + delete param.right.delegate; + } + } + else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { + this.throwUnexpectedToken(this.lookahead); + } + this.checkPatternParam(options, param); + params[i] = param; + } + if (this.context.strict || !this.context.allowYield) { + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.YieldExpression) { + this.throwUnexpectedToken(this.lookahead); + } + } + } + if (options.message === messages_1.Messages.StrictParamDupe) { + var token = this.context.strict ? options.stricted : options.firstRestricted; + this.throwUnexpectedToken(token, options.message); + } + return { + simple: options.simple, + params: params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.parseAssignmentExpression = function () { + var expr; + if (!this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseYieldExpression(); + } + else { + var startToken = this.lookahead; + var token = startToken; + expr = this.parseConditionalExpression(); + if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { + if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { + var arg = this.parsePrimaryExpression(); + this.reinterpretExpressionAsPattern(arg); + expr = { + type: ArrowParameterPlaceHolder, + params: [arg], + async: true + }; + } + } + if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { + // https://tc39.github.io/ecma262/#sec-arrow-function-definitions + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var isAsync = expr.async; + var list = this.reinterpretAsCoverFormalsList(expr); + if (list) { + if (this.hasLineTerminator) { + this.tolerateUnexpectedToken(this.lookahead); + } + this.context.firstCoverInitializedNameError = null; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = list.simple; + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = true; + this.context.await = isAsync; + var node = this.startNode(startToken); + this.expect('=>'); + var body = void 0; + if (this.match('{')) { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + body = this.parseFunctionSourceElements(); + this.context.allowIn = previousAllowIn; + } + else { + body = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + var expression = body.type !== syntax_1.Syntax.BlockStatement; + if (this.context.strict && list.firstRestricted) { + this.throwUnexpectedToken(list.firstRestricted, list.message); + } + if (this.context.strict && list.stricted) { + this.tolerateUnexpectedToken(list.stricted, list.message); + } + expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : + this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + } + } + else { + if (this.matchAssign()) { + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { + var id = expr; + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); + } + if (this.scanner.isStrictModeReservedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + } + if (!this.match('=')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + this.reinterpretExpressionAsPattern(expr); + } + token = this.nextToken(); + var operator = token.value; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + this.context.firstCoverInitializedNameError = null; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-comma-operator + Parser.prototype.parseExpression = function () { + var startToken = this.lookahead; + var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-block + Parser.prototype.parseStatementListItem = function () { + var statement; + this.context.isAssignmentTarget = true; + this.context.isBindingElement = true; + if (this.lookahead.type === 4 /* Keyword */) { + switch (this.lookahead.value) { + case 'export': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); + } + statement = this.parseExportDeclaration(); + break; + case 'import': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); + } + statement = this.parseImportDeclaration(); + break; + case 'const': + statement = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'class': + statement = this.parseClassDeclaration(); + break; + case 'let': + statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); + break; + default: + statement = this.parseStatement(); + break; + } + } + else { + statement = this.parseStatement(); + } + return statement; + }; + Parser.prototype.parseBlock = function () { + var node = this.createNode(); + this.expect('{'); + var block = []; + while (true) { + if (this.match('}')) { + break; + } + block.push(this.parseStatementListItem()); + } + this.expect('}'); + return this.finalize(node, new Node.BlockStatement(block)); + }; + // https://tc39.github.io/ecma262/#sec-let-and-const-declarations + Parser.prototype.parseLexicalBinding = function (kind, options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, kind); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (kind === 'const') { + if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else { + this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); + } + } + } + else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { + this.expect('='); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseBindingList = function (kind, options) { + var list = [this.parseLexicalBinding(kind, options)]; + while (this.match(',')) { + this.nextToken(); + list.push(this.parseLexicalBinding(kind, options)); + } + return list; + }; + Parser.prototype.isLexicalDeclaration = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + return (next.type === 3 /* Identifier */) || + (next.type === 7 /* Punctuator */ && next.value === '[') || + (next.type === 7 /* Punctuator */ && next.value === '{') || + (next.type === 4 /* Keyword */ && next.value === 'let') || + (next.type === 4 /* Keyword */ && next.value === 'yield'); + }; + Parser.prototype.parseLexicalDeclaration = function (options) { + var node = this.createNode(); + var kind = this.nextToken().value; + assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); + var declarations = this.parseBindingList(kind, options); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + }; + // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns + Parser.prototype.parseBindingRestElement = function (params, kind) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params, kind); + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseArrayPattern = function (params, kind) { + var node = this.createNode(); + this.expect('['); + var elements = []; + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else { + if (this.match('...')) { + elements.push(this.parseBindingRestElement(params, kind)); + break; + } + else { + elements.push(this.parsePatternWithDefault(params, kind)); + } + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayPattern(elements)); + }; + Parser.prototype.parsePropertyPattern = function (params, kind) { + var node = this.createNode(); + var computed = false; + var shorthand = false; + var method = false; + var key; + var value; + if (this.lookahead.type === 3 /* Identifier */) { + var keyToken = this.lookahead; + key = this.parseVariableIdentifier(); + var init = this.finalize(node, new Node.Identifier(keyToken.value)); + if (this.match('=')) { + params.push(keyToken); + shorthand = true; + this.nextToken(); + var expr = this.parseAssignmentExpression(); + value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + } + else if (!this.match(':')) { + params.push(keyToken); + shorthand = true; + value = init; + } + else { + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectPattern = function (params, kind) { + var node = this.createNode(); + var properties = []; + this.expect('{'); + while (!this.match('}')) { + properties.push(this.parsePropertyPattern(params, kind)); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectPattern(properties)); + }; + Parser.prototype.parsePattern = function (params, kind) { + var pattern; + if (this.match('[')) { + pattern = this.parseArrayPattern(params, kind); + } + else if (this.match('{')) { + pattern = this.parseObjectPattern(params, kind); + } + else { + if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); + } + params.push(this.lookahead); + pattern = this.parseVariableIdentifier(kind); + } + return pattern; + }; + Parser.prototype.parsePatternWithDefault = function (params, kind) { + var startToken = this.lookahead; + var pattern = this.parsePattern(params, kind); + if (this.match('=')) { + this.nextToken(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowYield = previousAllowYield; + pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + } + return pattern; + }; + // https://tc39.github.io/ecma262/#sec-variable-statement + Parser.prototype.parseVariableIdentifier = function (kind) { + var node = this.createNode(); + var token = this.nextToken(); + if (token.type === 4 /* Keyword */ && token.value === 'yield') { + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else if (!this.context.allowYield) { + this.throwUnexpectedToken(token); + } + } + else if (token.type !== 3 /* Identifier */) { + if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else { + if (this.context.strict || token.value !== 'let' || kind !== 'var') { + this.throwUnexpectedToken(token); + } + } + } + else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { + this.tolerateUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseVariableDeclaration = function (options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, 'var'); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { + this.expect('='); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseVariableDeclarationList = function (options) { + var opt = { inFor: options.inFor }; + var list = []; + list.push(this.parseVariableDeclaration(opt)); + while (this.match(',')) { + this.nextToken(); + list.push(this.parseVariableDeclaration(opt)); + } + return list; + }; + Parser.prototype.parseVariableStatement = function () { + var node = this.createNode(); + this.expectKeyword('var'); + var declarations = this.parseVariableDeclarationList({ inFor: false }); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); + }; + // https://tc39.github.io/ecma262/#sec-empty-statement + Parser.prototype.parseEmptyStatement = function () { + var node = this.createNode(); + this.expect(';'); + return this.finalize(node, new Node.EmptyStatement()); + }; + // https://tc39.github.io/ecma262/#sec-expression-statement + Parser.prototype.parseExpressionStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ExpressionStatement(expr)); + }; + // https://tc39.github.io/ecma262/#sec-if-statement + Parser.prototype.parseIfClause = function () { + if (this.context.strict && this.matchKeyword('function')) { + this.tolerateError(messages_1.Messages.StrictFunction); + } + return this.parseStatement(); + }; + Parser.prototype.parseIfStatement = function () { + var node = this.createNode(); + var consequent; + var alternate = null; + this.expectKeyword('if'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + consequent = this.parseIfClause(); + if (this.matchKeyword('else')) { + this.nextToken(); + alternate = this.parseIfClause(); + } + } + return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + }; + // https://tc39.github.io/ecma262/#sec-do-while-statement + Parser.prototype.parseDoWhileStatement = function () { + var node = this.createNode(); + this.expectKeyword('do'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + var body = this.parseStatement(); + this.context.inIteration = previousInIteration; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + } + else { + this.expect(')'); + if (this.match(';')) { + this.nextToken(); + } + } + return this.finalize(node, new Node.DoWhileStatement(body, test)); + }; + // https://tc39.github.io/ecma262/#sec-while-statement + Parser.prototype.parseWhileStatement = function () { + var node = this.createNode(); + var body; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.parseStatement(); + this.context.inIteration = previousInIteration; + } + return this.finalize(node, new Node.WhileStatement(test, body)); + }; + // https://tc39.github.io/ecma262/#sec-for-statement + // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements + Parser.prototype.parseForStatement = function () { + var init = null; + var test = null; + var update = null; + var forIn = true; + var left, right; + var node = this.createNode(); + this.expectKeyword('for'); + this.expect('('); + if (this.match(';')) { + this.nextToken(); + } + else { + if (this.matchKeyword('var')) { + init = this.createNode(); + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseVariableDeclarationList({ inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && this.matchKeyword('in')) { + var decl = declarations[0]; + if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { + this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); + } + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.expect(';'); + } + } + else if (this.matchKeyword('const') || this.matchKeyword('let')) { + init = this.createNode(); + var kind = this.nextToken().value; + if (!this.context.strict && this.lookahead.value === 'in') { + init = this.finalize(init, new Node.Identifier(kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseBindingList(kind, { inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + this.consumeSemicolon(); + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + } + } + } + else { + var initStartToken = this.lookahead; + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + init = this.inheritCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + if (this.matchKeyword('in')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForIn); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseExpression(); + init = null; + } + else if (this.matchContextualKeyword('of')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + if (this.match(',')) { + var initSeq = [init]; + while (this.match(',')) { + this.nextToken(); + initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + } + this.expect(';'); + } + } + } + if (typeof left === 'undefined') { + if (!this.match(';')) { + test = this.parseExpression(); + } + this.expect(';'); + if (!this.match(')')) { + update = this.parseExpression(); + } + } + var body; + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.isolateCoverGrammar(this.parseStatement); + this.context.inIteration = previousInIteration; + } + return (typeof left === 'undefined') ? + this.finalize(node, new Node.ForStatement(init, test, update, body)) : + forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : + this.finalize(node, new Node.ForOfStatement(left, right, body)); + }; + // https://tc39.github.io/ecma262/#sec-continue-statement + Parser.prototype.parseContinueStatement = function () { + var node = this.createNode(); + this.expectKeyword('continue'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + label = id; + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration) { + this.throwError(messages_1.Messages.IllegalContinue); + } + return this.finalize(node, new Node.ContinueStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-break-statement + Parser.prototype.parseBreakStatement = function () { + var node = this.createNode(); + this.expectKeyword('break'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + label = id; + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration && !this.context.inSwitch) { + this.throwError(messages_1.Messages.IllegalBreak); + } + return this.finalize(node, new Node.BreakStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-return-statement + Parser.prototype.parseReturnStatement = function () { + if (!this.context.inFunctionBody) { + this.tolerateError(messages_1.Messages.IllegalReturn); + } + var node = this.createNode(); + this.expectKeyword('return'); + var hasArgument = (!this.match(';') && !this.match('}') && + !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || + this.lookahead.type === 8 /* StringLiteral */ || + this.lookahead.type === 10 /* Template */; + var argument = hasArgument ? this.parseExpression() : null; + this.consumeSemicolon(); + return this.finalize(node, new Node.ReturnStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-with-statement + Parser.prototype.parseWithStatement = function () { + if (this.context.strict) { + this.tolerateError(messages_1.Messages.StrictModeWith); + } + var node = this.createNode(); + var body; + this.expectKeyword('with'); + this.expect('('); + var object = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + body = this.parseStatement(); + } + return this.finalize(node, new Node.WithStatement(object, body)); + }; + // https://tc39.github.io/ecma262/#sec-switch-statement + Parser.prototype.parseSwitchCase = function () { + var node = this.createNode(); + var test; + if (this.matchKeyword('default')) { + this.nextToken(); + test = null; + } + else { + this.expectKeyword('case'); + test = this.parseExpression(); + } + this.expect(':'); + var consequent = []; + while (true) { + if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { + break; + } + consequent.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.SwitchCase(test, consequent)); + }; + Parser.prototype.parseSwitchStatement = function () { + var node = this.createNode(); + this.expectKeyword('switch'); + this.expect('('); + var discriminant = this.parseExpression(); + this.expect(')'); + var previousInSwitch = this.context.inSwitch; + this.context.inSwitch = true; + var cases = []; + var defaultFound = false; + this.expect('{'); + while (true) { + if (this.match('}')) { + break; + } + var clause = this.parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + this.expect('}'); + this.context.inSwitch = previousInSwitch; + return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + }; + // https://tc39.github.io/ecma262/#sec-labelled-statements + Parser.prototype.parseLabelledStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + var statement; + if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { + this.nextToken(); + var id = expr; + var key = '$' + id.name; + if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); + } + this.context.labelSet[key] = true; + var body = void 0; + if (this.matchKeyword('class')) { + this.tolerateUnexpectedToken(this.lookahead); + body = this.parseClassDeclaration(); + } + else if (this.matchKeyword('function')) { + var token = this.lookahead; + var declaration = this.parseFunctionDeclaration(); + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); + } + else if (declaration.generator) { + this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); + } + body = declaration; + } + else { + body = this.parseStatement(); + } + delete this.context.labelSet[key]; + statement = new Node.LabeledStatement(id, body); + } + else { + this.consumeSemicolon(); + statement = new Node.ExpressionStatement(expr); + } + return this.finalize(node, statement); + }; + // https://tc39.github.io/ecma262/#sec-throw-statement + Parser.prototype.parseThrowStatement = function () { + var node = this.createNode(); + this.expectKeyword('throw'); + if (this.hasLineTerminator) { + this.throwError(messages_1.Messages.NewlineAfterThrow); + } + var argument = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ThrowStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-try-statement + Parser.prototype.parseCatchClause = function () { + var node = this.createNode(); + this.expectKeyword('catch'); + this.expect('('); + if (this.match(')')) { + this.throwUnexpectedToken(this.lookahead); + } + var params = []; + var param = this.parsePattern(params); + var paramMap = {}; + for (var i = 0; i < params.length; i++) { + var key = '$' + params[i].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); + } + paramMap[key] = true; + } + if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(param.name)) { + this.tolerateError(messages_1.Messages.StrictCatchVariable); + } + } + this.expect(')'); + var body = this.parseBlock(); + return this.finalize(node, new Node.CatchClause(param, body)); + }; + Parser.prototype.parseFinallyClause = function () { + this.expectKeyword('finally'); + return this.parseBlock(); + }; + Parser.prototype.parseTryStatement = function () { + var node = this.createNode(); + this.expectKeyword('try'); + var block = this.parseBlock(); + var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; + var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; + if (!handler && !finalizer) { + this.throwError(messages_1.Messages.NoCatchOrFinally); + } + return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + }; + // https://tc39.github.io/ecma262/#sec-debugger-statement + Parser.prototype.parseDebuggerStatement = function () { + var node = this.createNode(); + this.expectKeyword('debugger'); + this.consumeSemicolon(); + return this.finalize(node, new Node.DebuggerStatement()); + }; + // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations + Parser.prototype.parseStatement = function () { + var statement; + switch (this.lookahead.type) { + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* Template */: + case 9 /* RegularExpression */: + statement = this.parseExpressionStatement(); + break; + case 7 /* Punctuator */: + var value = this.lookahead.value; + if (value === '{') { + statement = this.parseBlock(); + } + else if (value === '(') { + statement = this.parseExpressionStatement(); + } + else if (value === ';') { + statement = this.parseEmptyStatement(); + } + else { + statement = this.parseExpressionStatement(); + } + break; + case 3 /* Identifier */: + statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); + break; + case 4 /* Keyword */: + switch (this.lookahead.value) { + case 'break': + statement = this.parseBreakStatement(); + break; + case 'continue': + statement = this.parseContinueStatement(); + break; + case 'debugger': + statement = this.parseDebuggerStatement(); + break; + case 'do': + statement = this.parseDoWhileStatement(); + break; + case 'for': + statement = this.parseForStatement(); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'if': + statement = this.parseIfStatement(); + break; + case 'return': + statement = this.parseReturnStatement(); + break; + case 'switch': + statement = this.parseSwitchStatement(); + break; + case 'throw': + statement = this.parseThrowStatement(); + break; + case 'try': + statement = this.parseTryStatement(); + break; + case 'var': + statement = this.parseVariableStatement(); + break; + case 'while': + statement = this.parseWhileStatement(); + break; + case 'with': + statement = this.parseWithStatement(); + break; + default: + statement = this.parseExpressionStatement(); + break; + } + break; + default: + statement = this.throwUnexpectedToken(this.lookahead); + } + return statement; + }; + // https://tc39.github.io/ecma262/#sec-function-definitions + Parser.prototype.parseFunctionSourceElements = function () { + var node = this.createNode(); + this.expect('{'); + var body = this.parseDirectivePrologues(); + var previousLabelSet = this.context.labelSet; + var previousInIteration = this.context.inIteration; + var previousInSwitch = this.context.inSwitch; + var previousInFunctionBody = this.context.inFunctionBody; + this.context.labelSet = {}; + this.context.inIteration = false; + this.context.inSwitch = false; + this.context.inFunctionBody = true; + while (this.lookahead.type !== 2 /* EOF */) { + if (this.match('}')) { + break; + } + body.push(this.parseStatementListItem()); + } + this.expect('}'); + this.context.labelSet = previousLabelSet; + this.context.inIteration = previousInIteration; + this.context.inSwitch = previousInSwitch; + this.context.inFunctionBody = previousInFunctionBody; + return this.finalize(node, new Node.BlockStatement(body)); + }; + Parser.prototype.validateParam = function (options, param, name) { + var key = '$' + name; + if (this.context.strict) { + if (this.scanner.isRestrictedWord(name)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + else if (!options.firstRestricted) { + if (this.scanner.isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictParamName; + } + else if (this.scanner.isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictReservedWord; + } + else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + /* istanbul ignore next */ + if (typeof Object.defineProperty === 'function') { + Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); + } + else { + options.paramSet[key] = true; + } + }; + Parser.prototype.parseRestElement = function (params) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params); + if (this.match('=')) { + this.throwError(messages_1.Messages.DefaultRestParameter); + } + if (!this.match(')')) { + this.throwError(messages_1.Messages.ParameterAfterRestParameter); + } + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseFormalParameter = function (options) { + var params = []; + var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); + for (var i = 0; i < params.length; i++) { + this.validateParam(options, params[i], params[i].value); + } + options.simple = options.simple && (param instanceof Node.Identifier); + options.params.push(param); + }; + Parser.prototype.parseFormalParameters = function (firstRestricted) { + var options; + options = { + simple: true, + params: [], + firstRestricted: firstRestricted + }; + this.expect('('); + if (!this.match(')')) { + options.paramSet = {}; + while (this.lookahead.type !== 2 /* EOF */) { + this.parseFormalParameter(options); + if (this.match(')')) { + break; + } + this.expect(','); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return { + simple: options.simple, + params: options.params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.matchAsyncFunction = function () { + var match = this.matchContextualKeyword('async'); + if (match) { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); + } + return match; + }; + Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted = null; + if (!identifierIsOptional || !this.match('(')) { + var token = this.lookahead; + id = this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : + this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + }; + Parser.prototype.parseFunctionExpression = function () { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted; + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + if (!this.match('(')) { + var token = this.lookahead; + id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : + this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive + Parser.prototype.parseDirective = function () { + var token = this.lookahead; + var node = this.createNode(); + var expr = this.parseExpression(); + var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; + this.consumeSemicolon(); + return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + }; + Parser.prototype.parseDirectivePrologues = function () { + var firstRestricted = null; + var body = []; + while (true) { + var token = this.lookahead; + if (token.type !== 8 /* StringLiteral */) { + break; + } + var statement = this.parseDirective(); + body.push(statement); + var directive = statement.directive; + if (typeof directive !== 'string') { + break; + } + if (directive === 'use strict') { + this.context.strict = true; + if (firstRestricted) { + this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); + } + if (!this.context.allowStrictDirective) { + this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); + } + } + else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + return body; + }; + // https://tc39.github.io/ecma262/#sec-method-definitions + Parser.prototype.qualifiedPropertyName = function (token) { + switch (token.type) { + case 3 /* Identifier */: + case 8 /* StringLiteral */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 4 /* Keyword */: + return true; + case 7 /* Punctuator */: + return token.value === '['; + default: + break; + } + return false; + }; + Parser.prototype.parseGetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length > 0) { + this.tolerateError(messages_1.Messages.BadGetterArity); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseSetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length !== 1) { + this.tolerateError(messages_1.Messages.BadSetterArity); + } + else if (formalParameters.params[0] instanceof Node.RestElement) { + this.tolerateError(messages_1.Messages.BadSetterRestParameter); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseGeneratorMethod = function () { + var node = this.createNode(); + var isGenerator = true; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + this.context.allowYield = false; + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-generator-function-definitions + Parser.prototype.isStartOfExpression = function () { + var start = true; + var value = this.lookahead.value; + switch (this.lookahead.type) { + case 7 /* Punctuator */: + start = (value === '[') || (value === '(') || (value === '{') || + (value === '+') || (value === '-') || + (value === '!') || (value === '~') || + (value === '++') || (value === '--') || + (value === '/') || (value === '/='); // regular expression literal + break; + case 4 /* Keyword */: + start = (value === 'class') || (value === 'delete') || + (value === 'function') || (value === 'let') || (value === 'new') || + (value === 'super') || (value === 'this') || (value === 'typeof') || + (value === 'void') || (value === 'yield'); + break; + default: + break; + } + return start; + }; + Parser.prototype.parseYieldExpression = function () { + var node = this.createNode(); + this.expectKeyword('yield'); + var argument = null; + var delegate = false; + if (!this.hasLineTerminator) { + var previousAllowYield = this.context.allowYield; + this.context.allowYield = false; + delegate = this.match('*'); + if (delegate) { + this.nextToken(); + argument = this.parseAssignmentExpression(); + } + else if (this.isStartOfExpression()) { + argument = this.parseAssignmentExpression(); + } + this.context.allowYield = previousAllowYield; + } + return this.finalize(node, new Node.YieldExpression(argument, delegate)); + }; + // https://tc39.github.io/ecma262/#sec-class-definitions + Parser.prototype.parseClassElement = function (hasConstructor) { + var token = this.lookahead; + var node = this.createNode(); + var kind = ''; + var key = null; + var value = null; + var computed = false; + var method = false; + var isStatic = false; + var isAsync = false; + if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + var id = key; + if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { + token = this.lookahead; + isStatic = true; + computed = this.match('['); + if (this.match('*')) { + this.nextToken(); + } + else { + key = this.parseObjectPropertyKey(); + } + } + if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { + var punctuator = this.lookahead.value; + if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { + isAsync = true; + token = this.lookahead; + key = this.parseObjectPropertyKey(); + if (token.type === 3 /* Identifier */ && token.value === 'constructor') { + this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); + } + } + } + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */) { + if (token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + if (!kind && key && this.match('(')) { + kind = 'init'; + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + if (!kind) { + this.throwUnexpectedToken(this.lookahead); + } + if (kind === 'init') { + kind = 'method'; + } + if (!computed) { + if (isStatic && this.isPropertyKey(key, 'prototype')) { + this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); + } + if (!isStatic && this.isPropertyKey(key, 'constructor')) { + if (kind !== 'method' || !method || (value && value.generator)) { + this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); + } + if (hasConstructor.value) { + this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); + } + else { + hasConstructor.value = true; + } + kind = 'constructor'; + } + } + return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + }; + Parser.prototype.parseClassElementList = function () { + var body = []; + var hasConstructor = { value: false }; + this.expect('{'); + while (!this.match('}')) { + if (this.match(';')) { + this.nextToken(); + } + else { + body.push(this.parseClassElement(hasConstructor)); + } + } + this.expect('}'); + return body; + }; + Parser.prototype.parseClassBody = function () { + var node = this.createNode(); + var elementList = this.parseClassElementList(); + return this.finalize(node, new Node.ClassBody(elementList)); + }; + Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + }; + Parser.prototype.parseClassExpression = function () { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + }; + // https://tc39.github.io/ecma262/#sec-scripts + // https://tc39.github.io/ecma262/#sec-modules + Parser.prototype.parseModule = function () { + this.context.strict = true; + this.context.isModule = true; + this.scanner.isModule = true; + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Module(body)); + }; + Parser.prototype.parseScript = function () { + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Script(body)); + }; + // https://tc39.github.io/ecma262/#sec-imports + Parser.prototype.parseModuleSpecifier = function () { + var node = this.createNode(); + if (this.lookahead.type !== 8 /* StringLiteral */) { + this.throwError(messages_1.Messages.InvalidModuleSpecifier); + } + var token = this.nextToken(); + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + // import {} ...; + Parser.prototype.parseImportSpecifier = function () { + var node = this.createNode(); + var imported; + var local; + if (this.lookahead.type === 3 /* Identifier */) { + imported = this.parseVariableIdentifier(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + } + else { + imported = this.parseIdentifierName(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.ImportSpecifier(local, imported)); + }; + // {foo, bar as bas} + Parser.prototype.parseNamedImports = function () { + this.expect('{'); + var specifiers = []; + while (!this.match('}')) { + specifiers.push(this.parseImportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return specifiers; + }; + // import ...; + Parser.prototype.parseImportDefaultSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + }; + // import <* as foo> ...; + Parser.prototype.parseImportNamespaceSpecifier = function () { + var node = this.createNode(); + this.expect('*'); + if (!this.matchContextualKeyword('as')) { + this.throwError(messages_1.Messages.NoAsAfterImportNamespace); + } + this.nextToken(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + }; + Parser.prototype.parseImportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalImportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('import'); + var src; + var specifiers = []; + if (this.lookahead.type === 8 /* StringLiteral */) { + // import 'foo'; + src = this.parseModuleSpecifier(); + } + else { + if (this.match('{')) { + // import {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else if (this.match('*')) { + // import * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { + // import foo + specifiers.push(this.parseImportDefaultSpecifier()); + if (this.match(',')) { + this.nextToken(); + if (this.match('*')) { + // import foo, * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.match('{')) { + // import foo, {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + src = this.parseModuleSpecifier(); + } + this.consumeSemicolon(); + return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + }; + // https://tc39.github.io/ecma262/#sec-exports + Parser.prototype.parseExportSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + var exported = local; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + exported = this.parseIdentifierName(); + } + return this.finalize(node, new Node.ExportSpecifier(local, exported)); + }; + Parser.prototype.parseExportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalExportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('export'); + var exportDeclaration; + if (this.matchKeyword('default')) { + // export default ... + this.nextToken(); + if (this.matchKeyword('function')) { + // export default function foo () {} + // export default function () {} + var declaration = this.parseFunctionDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchKeyword('class')) { + // export default class foo {} + var declaration = this.parseClassDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchContextualKeyword('async')) { + // export default async function f () {} + // export default async function () {} + // export default async x => x + var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else { + if (this.matchContextualKeyword('from')) { + this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); + } + // export default {}; + // export default []; + // export default (1 + 2); + var declaration = this.match('{') ? this.parseObjectInitializer() : + this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + } + else if (this.match('*')) { + // export * from 'foo'; + this.nextToken(); + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + var src = this.parseModuleSpecifier(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + } + else if (this.lookahead.type === 4 /* Keyword */) { + // export var f = 1; + var declaration = void 0; + switch (this.lookahead.value) { + case 'let': + case 'const': + declaration = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'var': + case 'class': + case 'function': + declaration = this.parseStatementListItem(); + break; + default: + this.throwUnexpectedToken(this.lookahead); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else if (this.matchAsyncFunction()) { + var declaration = this.parseFunctionDeclaration(); + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else { + var specifiers = []; + var source = null; + var isExportFromIdentifier = false; + this.expect('{'); + while (!this.match('}')) { + isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); + specifiers.push(this.parseExportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + if (this.matchContextualKeyword('from')) { + // export {default} from 'foo'; + // export {foo} from 'foo'; + this.nextToken(); + source = this.parseModuleSpecifier(); + this.consumeSemicolon(); + } + else if (isExportFromIdentifier) { + // export {default}; // missing fromClause + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + else { + // export {foo}; + this.consumeSemicolon(); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + } + return exportDeclaration; + }; + return Parser; + }()); + exports.Parser = Parser; + + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + "use strict"; + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + Object.defineProperty(exports, "__esModule", { value: true }); + function assert(condition, message) { + /* istanbul ignore if */ + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + exports.assert = assert; + + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + "use strict"; + /* tslint:disable:max-classes-per-file */ + Object.defineProperty(exports, "__esModule", { value: true }); + var ErrorHandler = (function () { + function ErrorHandler() { + this.errors = []; + this.tolerant = false; + } + ErrorHandler.prototype.recordError = function (error) { + this.errors.push(error); + }; + ErrorHandler.prototype.tolerate = function (error) { + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + ErrorHandler.prototype.constructError = function (msg, column) { + var error = new Error(msg); + try { + throw error; + } + catch (base) { + /* istanbul ignore else */ + if (Object.create && Object.defineProperty) { + error = Object.create(base); + Object.defineProperty(error, 'column', { value: column }); + } + } + /* istanbul ignore next */ + return error; + }; + ErrorHandler.prototype.createError = function (index, line, col, description) { + var msg = 'Line ' + line + ': ' + description; + var error = this.constructError(msg, col); + error.index = index; + error.lineNumber = line; + error.description = description; + return error; + }; + ErrorHandler.prototype.throwError = function (index, line, col, description) { + throw this.createError(index, line, col, description); + }; + ErrorHandler.prototype.tolerateError = function (index, line, col, description) { + var error = this.createError(index, line, col, description); + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + return ErrorHandler; + }()); + exports.ErrorHandler = ErrorHandler; + + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // Error messages should be identical to V8. + exports.Messages = { + BadGetterArity: 'Getter must not have any formal parameters', + BadSetterArity: 'Setter must have exactly one formal parameter', + BadSetterRestParameter: 'Setter function argument must not be a rest parameter', + ConstructorIsAsync: 'Class constructor may not be an async method', + ConstructorSpecialMethod: 'Class constructor may not be an accessor', + DeclarationMissingInitializer: 'Missing initializer in %0 declaration', + DefaultRestParameter: 'Unexpected token =', + DuplicateBinding: 'Duplicate binding %0', + DuplicateConstructor: 'A class may only have one constructor', + DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', + ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', + GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', + IllegalBreak: 'Illegal break statement', + IllegalContinue: 'Illegal continue statement', + IllegalExportDeclaration: 'Unexpected token', + IllegalImportDeclaration: 'Unexpected token', + IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', + IllegalReturn: 'Illegal return statement', + InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', + InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', + InvalidModuleSpecifier: 'Unexpected token', + InvalidRegExp: 'Invalid regular expression', + LetInLexicalBinding: 'let is disallowed as a lexically bound name', + MissingFromClause: 'Unexpected token', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NewlineAfterThrow: 'Illegal newline after throw', + NoAsAfterImportNamespace: 'Unexpected token', + NoCatchOrFinally: 'Missing catch or finally after try', + ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', + Redeclaration: '%0 \'%1\' has already been declared', + StaticPrototype: 'Classes may not have static property named prototype', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', + UnexpectedEOS: 'Unexpected end of input', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedNumber: 'Unexpected number', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedString: 'Unexpected string', + UnexpectedTemplate: 'Unexpected quasi %0', + UnexpectedToken: 'Unexpected token %0', + UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', + UnknownLabel: 'Undefined label \'%0\'', + UnterminatedRegExp: 'Invalid regular expression: missing /' + }; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var character_1 = __webpack_require__(4); + var messages_1 = __webpack_require__(11); + function hexValue(ch) { + return '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + function octalValue(ch) { + return '01234567'.indexOf(ch); + } + var Scanner = (function () { + function Scanner(code, handler) { + this.source = code; + this.errorHandler = handler; + this.trackComment = false; + this.isModule = false; + this.length = code.length; + this.index = 0; + this.lineNumber = (code.length > 0) ? 1 : 0; + this.lineStart = 0; + this.curlyStack = []; + } + Scanner.prototype.saveState = function () { + return { + index: this.index, + lineNumber: this.lineNumber, + lineStart: this.lineStart + }; + }; + Scanner.prototype.restoreState = function (state) { + this.index = state.index; + this.lineNumber = state.lineNumber; + this.lineStart = state.lineStart; + }; + Scanner.prototype.eof = function () { + return this.index >= this.length; + }; + Scanner.prototype.throwUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner.prototype.tolerateUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + // https://tc39.github.io/ecma262/#sec-comments + Scanner.prototype.skipSingleLineComment = function (offset) { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - offset; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - offset + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + ++this.index; + if (character_1.Character.isLineTerminator(ch)) { + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart - 1 + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index - 1], + range: [start, this.index - 1], + loc: loc + }; + comments.push(entry); + } + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + return comments; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + }; + Scanner.prototype.skipMultiLineComment = function () { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - 2; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - 2 + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isLineTerminator(ch)) { + if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + ++this.index; + this.lineStart = this.index; + } + else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (this.source.charCodeAt(this.index + 1) === 0x2F) { + this.index += 2; + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index - 2], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + } + ++this.index; + } + else { + ++this.index; + } + } + // Ran off the end of the file - the whole thing is a comment + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + this.tolerateUnexpectedToken(); + return comments; + }; + Scanner.prototype.scanComments = function () { + var comments; + if (this.trackComment) { + comments = []; + } + var start = (this.index === 0); + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isWhiteSpace(ch)) { + ++this.index; + } + else if (character_1.Character.isLineTerminator(ch)) { + ++this.index; + if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + start = true; + } + else if (ch === 0x2F) { + ch = this.source.charCodeAt(this.index + 1); + if (ch === 0x2F) { + this.index += 2; + var comment = this.skipSingleLineComment(2); + if (this.trackComment) { + comments = comments.concat(comment); + } + start = true; + } + else if (ch === 0x2A) { + this.index += 2; + var comment = this.skipMultiLineComment(); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (start && ch === 0x2D) { + // U+003E is '>' + if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { + // '-->' is a single-line comment + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (ch === 0x3C && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === '!--') { + this.index += 4; // ` +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 + +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 + +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 + +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 + +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 + +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 + +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 + +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 + +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 + +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 + +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 + +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 + +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 + +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 + +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 + +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 + +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 + +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 + +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 + +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 + +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 + +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 + +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 + +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 + +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 + +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 + +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 + +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 + +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 + +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 + +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 + +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 + +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 + +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 + +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 + +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 + +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 + +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 + +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 + +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 + +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 + +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 + +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 + +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 + +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 + +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 + +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 + +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 + +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 + +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 + +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 + +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 + +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 + +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 + +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 + +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 + +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 + +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 + +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 + +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 + +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 + +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 + +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 + +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 + +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 + +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 + +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 + +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 + +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 + +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 + +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 + +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 + +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 + +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 + +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 + +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 + +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 + +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 + +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 + +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 + +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 + +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 + +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 + +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 + +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 + +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 + +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 + +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 + +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 + +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 + +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 + +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 + +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 + +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 + +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 + +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 + +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 + +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 + +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 + +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 + +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 + +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 + +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 + +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 + +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 + +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 + +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 + +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 + +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 + +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 + +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 + +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 + +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 + +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 + +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 + +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 + +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 + +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 + +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 + +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 + +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 + +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 + +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 + +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 + +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 + +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 + +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 + +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 + +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 + +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 + +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 + +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 + +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 + +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 + +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 + +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 + +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 + +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 + +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 + +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 + +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 + +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 + +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 + +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 + +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 + +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 + +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 + +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 + +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 + +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 + +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 + +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 + +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 + +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 + +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 + +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 + +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 + +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 + +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 + +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 + +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 + +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 + +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 + +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 + +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 + +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 + +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 + +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 + +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 + +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 + +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 + +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 + +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 + +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 + +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 + +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 + +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 + +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 + +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 + +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 + +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 + +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 + +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 + +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 + +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 + +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 + +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 + +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 + +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 + +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 + +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 + +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 + +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 + +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 + +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 + +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 + +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 + +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 + +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 + +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 + +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 + +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 + +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 + +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 + +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 + +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 + +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 + +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 + +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 + +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 + +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 + +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 + +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 + +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 diff --git a/day1/cli-study/node_modules/fs-extra/LICENSE b/day1/cli-study/node_modules/fs-extra/LICENSE new file mode 100644 index 0000000..f109d23 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2016 JP Richardson + +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. diff --git a/day1/cli-study/node_modules/fs-extra/README.md b/day1/cli-study/node_modules/fs-extra/README.md new file mode 100644 index 0000000..00579c3 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/README.md @@ -0,0 +1,586 @@ +Node.js: fs-extra +================= + +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + + +`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`. + +**NOTE (2016-01-13):** Node v0.10 will be unsupported AFTER Ubuntu LTS releases their next version AND [Amazon Lambda +upgrades](http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) its Node.js runtime from v0.10. +I anticipate this will happen around late spring / summer 2016. Please prepare accordingly. After this, we'll make a strong push +for a 1.0.0 release. + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `cp -r` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`. + +You don't ever need to include the original `fs` module again: + +```js +var fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +var fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +var fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +var fs = require('fs') +var fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default (they take a callback with an `Error` as first argument). + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +var fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { + if (err) return console.error(err) + console.log("success!") +}); + +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log("success!") +} catch (err) { + console.error(err) +} +``` + + +Methods +------- +- [copy](#copy) +- [copySync](#copy) +- [createOutputStream](#createoutputstreamfile-options) +- [emptyDir](#emptydirdir-callback) +- [emptyDirSync](#emptydirdir-callback) +- [ensureFile](#ensurefilefile-callback) +- [ensureFileSync](#ensurefilefile-callback) +- [ensureDir](#ensuredirdir-callback) +- [ensureDirSync](#ensuredirdir-callback) +- [ensureLink](#ensurelinksrcpath-dstpath-callback) +- [ensureLinkSync](#ensurelinksrcpath-dstpath-callback) +- [ensureSymlink](#ensuresymlinksrcpath-dstpath-type-callback) +- [ensureSymlinkSync](#ensuresymlinksrcpath-dstpath-type-callback) +- [mkdirs](#mkdirsdir-callback) +- [mkdirsSync](#mkdirsdir-callback) +- [move](#movesrc-dest-options-callback) +- [outputFile](#outputfilefile-data-options-callback) +- [outputFileSync](#outputfilefile-data-options-callback) +- [outputJson](#outputjsonfile-data-options-callback) +- [outputJsonSync](#outputjsonfile-data-options-callback) +- [readJson](#readjsonfile-options-callback) +- [readJsonSync](#readjsonfile-options-callback) +- [remove](#removedir-callback) +- [removeSync](#removedir-callback) +- [walk](#walk) +- [writeJson](#writejsonfile-object-options-callback) +- [writeJsonSync](#writejsonfile-object-options-callback) + + +**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. + + +### copy() + +**copy(src, dest, [options], callback)** + + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +Options: +- clobber (boolean): overwrite existing file or directory +- preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`. +- filter: Function or RegExp to filter copied files. If function, return true to include, false to exclude. If RegExp, same as function, where `filter` is `filter.test`. + +Sync: `copySync()` + +Example: + +```js +var fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { + if (err) return console.error(err) + console.log("success!") +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) { + if (err) return console.error(err) + console.log('success!') +}) // copies directory, even if it has subdirectories or files +``` + +### createOutputStream(file, [options]) + +Exactly like `createWriteStream`, but if the directory does not exist, it's created. + +Examples: + +```js +var fs = require('fs-extra') + +// if /tmp/some does not exist, it is created +var ws = fs.createOutputStream('/tmp/some/file.txt') +ws.write('hello\n') +``` + +Note on naming: you'll notice that fs-extra has some methods like `fs.outputJson`, `fs.outputFile`, etc that use the +word `output` to denote that if the containing directory does not exist, it should be created. If you can think of a +better succinct nomenclature for these methods, please open an issue for discussion. Thanks. + + +### emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +Alias: `emptydir()` + +Sync: `emptyDirSync()`, `emptydirSync()` + +Example: + +```js +var fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', function (err) { + if (!err) console.log('success!') +}) +``` + + +### ensureFile(file, callback) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +Alias: `createFile()` + +Sync: `createFileSync()`,`ensureFileSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, function (err) { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) +``` + + +### ensureDir(dir, callback) + +Ensures that the directory exists. If the directory structure does not exist, it is created. + +Sync: `ensureDirSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, function (err) { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) +``` + + +### ensureLink(srcpath, dstpath, callback) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +Sync: `ensureLinkSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var srcpath = '/tmp/file.txt' +var dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, function (err) { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) +``` + + +### ensureSymlink(srcpath, dstpath, [type], callback) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +Sync: `ensureSymlinkSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var srcpath = '/tmp/file.txt' +var dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, function (err) { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) +``` + + +### mkdirs(dir, callback) + +Creates a directory. If the parent hierarchy doesn't exist, it's created. Like `mkdir -p`. + +Alias: `mkdirp()` + +Sync: `mkdirsSync()` / `mkdirpSync()` + + +Examples: + +```js +var fs = require('fs-extra') + +fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function (err) { + if (err) return console.error(err) + console.log("success!") +}) + +fs.mkdirsSync('/tmp/another/path') +``` + + +### move(src, dest, [options], callback) + +Moves a file or directory, even across devices. + +Options: +- clobber (boolean): overwrite existing file or directory +- limit (number): number of concurrent moves, see ncp for more information + +Example: + +```js +var fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', function (err) { + if (err) return console.error(err) + console.log("success!") +}) +``` + + +### outputFile(file, data, [options], callback) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +Sync: `outputFileSync()` + + +Example: + +```js +var fs = require('fs-extra') +var file = '/tmp/this/path/does/not/exist/file.txt' + +fs.outputFile(file, 'hello!', function (err) { + console.log(err) // => null + + fs.readFile(file, 'utf8', function (err, data) { + console.log(data) // => hello! + }) +}) +``` + + + +### outputJson(file, data, [options], callback) + +Almost the same as `writeJson`, except that if the directory does not exist, it's created. +`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +Alias: `outputJSON()` + +Sync: `outputJsonSync()`, `outputJSONSync()` + + +Example: + +```js +var fs = require('fs-extra') +var file = '/tmp/this/path/does/not/exist/file.txt' + +fs.outputJson(file, {name: 'JP'}, function (err) { + console.log(err) // => null + + fs.readJson(file, function(err, data) { + console.log(data.name) // => JP + }) +}) +``` + + + +### readJson(file, [options], callback) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +Alias: `readJSON()` + +Sync: `readJsonSync()`, `readJSONSync()` + + +Example: + +```js +var fs = require('fs-extra') + +fs.readJson('./package.json', function (err, packageObj) { + console.log(packageObj.version) // => 0.1.3 +}) +``` + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +var fs = require('fs-extra') +var file = path.join('/tmp/some-invalid.json') +var data = '{not valid JSON' +fs.writeFileSync(file, data) + +var obj = fs.readJsonSync(file, {throws: false}) +console.log(obj) // => null +``` + + +### remove(dir, callback) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +Sync: `removeSync()` + + +Examples: + +```js +var fs = require('fs-extra') + +fs.remove('/tmp/myfile', function (err) { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory. +``` + +### walk() + +**walk(dir, [streamOptions])** + +The function `walk()` from the module [`klaw`](https://github.com/jprichardson/node-klaw). + +Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates +through every file and directory starting with `dir` as the root. Every `read()` or `data` event +returns an object with two properties: `path` and `stats`. `path` is the full path of the file and +`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats). + +Streams 1 (push) example: + +```js +var items = [] // files, directories, symlinks, etc +fse.walk(TEST_DIR) + .on('data', function (item) { + items.push(item.path) + }) + .on('end', function () { + console.dir(items) // => [ ... array of files] + }) +``` + +Streams 2 & 3 (pull) example: + +```js +var items = [] // files, directories, symlinks, etc +fse.walk(TEST_DIR) + .on('readable', function () { + var item + while ((item = this.read())) { + items.push(item.path) + } + }) + .on('end', function () { + console.dir(items) // => [ ... array of files] + }) +``` + +If you're not sure of the differences on Node.js streams 1, 2, 3 then I'd +recommend this resource as a good starting point: https://strongloop.com/strongblog/whats-new-io-js-beta-streams3/. + +**See [`klaw` documentation](https://github.com/jprichardson/node-klaw) for more detailed usage.** + + +### writeJson(file, object, [options], callback) + +Writes an object to a JSON file. `options` are the same that +you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +Alias: `writeJSON()` + +Sync: `writeJsonSync()`, `writeJSONSync()` + +Example: + +```js +var fs = require('fs-extra') +fs.writeJson('./package.json', {name: 'fs-extra'}, function (err) { + console.log(err) +}) +``` + + +Third Party +----------- + +### Promises + +Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is +explicitly listed as supported. + +```js +var Promise = require('bluebird') +var fs = Promise.promisifyAll(require('fs-extra')) +``` + +Or you can use the package [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) that marries the two together. + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Really really help with the Windows tests. See appveyor outputs for more info. +- Improve test coverage. See coveralls output for more info. +- A directory walker. Probably this one: https://github.com/thlorenz/readdirp imported into `fs-extra`. +- After the directory walker is integrated, any function that needs to traverse directories like +`copy`, `remove`, or `mkdirs` should be built on top of it. + +Note: If you make any big changes, **you should definitely post an issue for discussion first.** + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2016 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 0000000..c6c5711 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,39 @@ +var fs = require('graceful-fs') + +var BUF_LENGTH = 64 * 1024 +var _buff = new Buffer(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + var clobber = options.clobber + var preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (clobber) { + fs.chmodSync(destFile, parseInt('777', 8)) + fs.unlinkSync(destFile) + } else { + throw Error('EEXIST') + } + } + + var fdr = fs.openSync(srcFile, 'r') + var stat = fs.fstatSync(fdr) + var fdw = fs.openSync(destFile, 'w', stat.mode) + var bytesRead = 1 + var pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 0000000..fdd316a --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,47 @@ +var fs = require('graceful-fs') +var path = require('path') +var copyFileSync = require('./copy-file-sync') +var mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + var stats = options.recursive ? fs.lstatSync(src) : fs.statSync(src) + var destFolder = path.dirname(dest) + var destFolderExists = fs.existsSync(destFolder) + var performCopy = false + + if (stats.isFile()) { + if (options.filter instanceof RegExp) performCopy = options.filter.test(src) + else if (typeof options.filter === 'function') performCopy = options.filter(src) + + if (performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, {clobber: options.clobber, preserveTimestamps: options.preserveTimestamps}) + } + } else if (stats.isDirectory()) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + var contents = fs.readdirSync(src) + contents.forEach(function (content) { + var opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink()) { + var srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy-sync/index.js b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 0000000..ebc7e0b --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy/copy.js b/day1/cli-study/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 0000000..d9d2912 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,44 @@ +var fs = require('graceful-fs') +var path = require('path') +var ncp = require('./ncp') +var mkdir = require('../mkdirs') + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // don't allow src and dest to be the same + var basePath = process.cwd() + var currentPath = path.resolve(basePath, src) + var targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, function (err, stats) { + if (err) return callback(err) + + var dir = null + if (stats.isDirectory()) { + var parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + fs.exists(dir, function (dirExists) { + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy/index.js b/day1/cli-study/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 0000000..3e09016 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,3 @@ +module.exports = { + copy: require('./copy') +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/copy/ncp.js b/day1/cli-study/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 0000000..d30cae5 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,243 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var clobber = options.clobber !== false + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var errs = null + + var started = 0 + var finished = 0 + var running = 0 + // this is pretty useless now that we're using graceful-fs + // consider removing + var limit = options.limit || 512 + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + if (running >= limit) { + return setImmediate(function () { + getStats(source) + }) + } + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath) + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (clobber) { + rmFile(target, function () { + copyFile(file, target) + }) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('finish', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath) + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + if (options.stopOnError) { + return callback(err) + } else if (!errs && options.errs) { + errs = fs.createWriteStream(options.errs) + } else if (!errs) { + errs = [] + } + if (typeof errs.write === 'undefined') { + errs.push(err) + } else { + errs.write(err.stack + '\n\n') + } + return doneOne() + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return errs ? callback(errs) : callback(null) + } + } + } +} + +module.exports = ncp diff --git a/day1/cli-study/node_modules/fs-extra/lib/empty/index.js b/day1/cli-study/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 0000000..a17cbae --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,47 @@ +var fs = require('fs') +var path = require('path') +var mkdir = require('../mkdirs') +var remove = require('../remove') + +function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, function (err, items) { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(function (item) { + return path.join(dir, item) + }) + + deleteItem() + + function deleteItem () { + var item = items.pop() + if (!item) return callback() + remove.remove(item, function (err) { + if (err) return callback(err) + deleteItem() + }) + } + }) +} + +function emptyDirSync (dir) { + var items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(function (item) { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync: emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir: emptyDir, + emptydir: emptyDir +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/file.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 0000000..1c9c2de --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,43 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', function (err) { + if (err) return callback(err) + callback() + }) + } + + fs.exists(file, function (fileExists) { + if (fileExists) return callback() + var dir = path.dirname(file) + fs.exists(dir, function (dirExists) { + if (dirExists) return makeFile() + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + if (fs.existsSync(file)) return + + var dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: createFile, + createFileSync: createFileSync, + // alias + ensureFile: createFile, + ensureFileSync: createFileSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/index.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 0000000..26e8705 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,21 @@ +var file = require('./file') +var link = require('./link') +var symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/link.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 0000000..4e4e283 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,58 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, function (err) { + if (err) return callback(err) + callback(null) + }) + } + + fs.exists(dstpath, function (destinationExists) { + if (destinationExists) return callback(null) + fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + var dir = path.dirname(dstpath) + fs.exists(dir, function (dirExists) { + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + var destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + var dir = path.dirname(dstpath) + var dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: createLink, + createLinkSync: createLinkSync, + // alias + ensureLink: createLink, + ensureLinkSync: createLinkSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-paths.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 0000000..cc27d04 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,97 @@ +var path = require('path') +// path.isAbsolute shim for Node.js 0.10 support +path.isAbsolute = (path.isAbsolute) ? path.isAbsolute : require('path-is-absolute') +var fs = require('graceful-fs') + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + var dstdir = path.dirname(dstpath) + var relativeToDst = path.join(dstdir, srcpath) + return fs.exists(relativeToDst, function (exists) { + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + var exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + var dstdir = path.dirname(dstpath) + var relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + 'symlinkPaths': symlinkPaths, + 'symlinkPathsSync': symlinkPathsSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-type.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 0000000..81e3588 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,27 @@ +var fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, function (err, stats) { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + if (type) return type + try { + var stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType: symlinkType, + symlinkTypeSync: symlinkTypeSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink.js b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 0000000..6244790 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,62 @@ +var path = require('path') +var fs = require('graceful-fs') +var _mkdirs = require('../mkdirs') +var mkdirs = _mkdirs.mkdirs +var mkdirsSync = _mkdirs.mkdirsSync + +var _symlinkPaths = require('./symlink-paths') +var symlinkPaths = _symlinkPaths.symlinkPaths +var symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +var _symlinkType = require('./symlink-type') +var symlinkType = _symlinkType.symlinkType +var symlinkTypeSync = _symlinkType.symlinkTypeSync + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + fs.exists(dstpath, function (destinationExists) { + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, function (err, relative) { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, function (err, type) { + if (err) return callback(err) + var dir = path.dirname(dstpath) + fs.exists(dir, function (dirExists) { + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, function (err) { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + var destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + var relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + var dir = path.dirname(dstpath) + var exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: createSymlink, + createSymlinkSync: createSymlinkSync, + // alias + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/index.js b/day1/cli-study/node_modules/fs-extra/lib/index.js new file mode 100644 index 0000000..2914f53 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/index.js @@ -0,0 +1,38 @@ +var assign = require('./util/assign') + +var fse = {} +var gfs = require('graceful-fs') + +// attach fs methods to fse +Object.keys(gfs).forEach(function (key) { + fse[key] = gfs[key] +}) + +var fs = fse + +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./streams')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./walk')) + +module.exports = fs + +// maintain backwards compatibility for awhile +var jsonfile = {} +Object.defineProperty(jsonfile, 'spaces', { + get: function () { + return fs.spaces // found in ./json + }, + set: function (val) { + fs.spaces = val + } +}) + +module.exports.jsonfile = jsonfile // so users of fs-extra can modify jsonFile.spaces diff --git a/day1/cli-study/node_modules/fs-extra/lib/json/index.js b/day1/cli-study/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 0000000..b13cf54 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,9 @@ +var jsonFile = require('./jsonfile') + +jsonFile.outputJsonSync = require('./output-json-sync') +jsonFile.outputJson = require('./output-json') +// aliases +jsonFile.outputJSONSync = require('./output-json-sync') +jsonFile.outputJSON = require('./output-json') + +module.exports = jsonFile diff --git a/day1/cli-study/node_modules/fs-extra/lib/json/jsonfile.js b/day1/cli-study/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 0000000..51d8390 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,14 @@ +var jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJSON: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + readJSONSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJSON: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync, + writeJSONSync: jsonFile.writeFileSync, + spaces: 2 // default in fs-extra +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/json/output-json-sync.js b/day1/cli-study/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 0000000..7684843 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,16 @@ +var fs = require('graceful-fs') +var path = require('path') +var jsonFile = require('./jsonfile') +var mkdir = require('../mkdirs') + +function outputJsonSync (file, data, options) { + var dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/day1/cli-study/node_modules/fs-extra/lib/json/output-json.js b/day1/cli-study/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 0000000..7824597 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,24 @@ +var fs = require('graceful-fs') +var path = require('path') +var jsonFile = require('./jsonfile') +var mkdir = require('../mkdirs') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + var dir = path.dirname(file) + + fs.exists(dir, function (itDoes) { + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/day1/cli-study/node_modules/fs-extra/lib/mkdirs/index.js b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 0000000..2611217 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,9 @@ +module.exports = { + mkdirs: require('./mkdirs'), + mkdirsSync: require('./mkdirs-sync'), + // alias + mkdirp: require('./mkdirs'), + mkdirpSync: require('./mkdirs-sync'), + ensureDir: require('./mkdirs'), + ensureDirSync: require('./mkdirs-sync') +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 0000000..2dc4f23 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,49 @@ +var fs = require('graceful-fs') +var path = require('path') + +var o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + var mode = opts.mode + var xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 0000000..2bdfa04 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,54 @@ +var fs = require('graceful-fs') +var path = require('path') + +var o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + var mode = opts.mode + var xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, function (er, made) { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/day1/cli-study/node_modules/fs-extra/lib/move/index.js b/day1/cli-study/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 0000000..f28152f --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,161 @@ +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +var fs = require('graceful-fs') +var ncp = require('../copy/ncp') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('../mkdirs').mkdirs + +function mv (source, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + var shouldMkdirp = ('mkdirp' in options) ? options.mkdirp : true + var clobber = ('clobber' in options) ? options.clobber : false + + var limit = options.limit || 16 + + if (shouldMkdirp) { + mkdirs() + } else { + doRename() + } + + function mkdirs () { + mkdirp(path.dirname(dest), function (err) { + if (err) return callback(err) + doRename() + }) + } + + function doRename () { + if (clobber) { + fs.rename(source, dest, function (err) { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + rimraf(dest, function (err) { + if (err) return callback(err) + options.clobber = false // just clobbered it, no need to do it again + mv(source, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(function () { + rimraf(dest, function (err) { + if (err) return callback(err) + options.clobber = false + mv(source, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(source, dest, clobber, limit, callback) + }) + } else { + fs.link(source, dest, function (err) { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') { + moveAcrossDevice(source, dest, clobber, limit, callback) + return + } + callback(err) + return + } + fs.unlink(source, callback) + }) + } + } +} + +function moveAcrossDevice (source, dest, clobber, limit, callback) { + fs.stat(source, function (err, stat) { + if (err) { + callback(err) + return + } + + if (stat.isDirectory()) { + moveDirAcrossDevice(source, dest, clobber, limit, callback) + } else { + moveFileAcrossDevice(source, dest, clobber, limit, callback) + } + }) +} + +function moveFileAcrossDevice (source, dest, clobber, limit, callback) { + var outFlags = clobber ? 'w' : 'wx' + var ins = fs.createReadStream(source) + var outs = fs.createWriteStream(dest, {flags: outFlags}) + + ins.on('error', function (err) { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, function () { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(source, dest, clobber, limit, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', function (err) { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(source, callback) + } +} + +function moveDirAcrossDevice (source, dest, clobber, limit, callback) { + var options = { + stopOnErr: true, + clobber: false, + limit: limit + } + + function startNcp () { + ncp(source, dest, options, function (errList) { + if (errList) return callback(errList[0]) + rimraf(source, callback) + }) + } + + if (clobber) { + rimraf(dest, function (err) { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } +} + +module.exports = { + move: mv +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/output/index.js b/day1/cli-study/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 0000000..e8f45f3 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,35 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + var dir = path.dirname(file) + fs.exists(dir, function (itDoes) { + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + var dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: outputFile, + outputFileSync: outputFileSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/remove/index.js b/day1/cli-study/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 0000000..925de67 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,14 @@ +var rimraf = require('rimraf') + +function removeSync (dir) { + return rimraf.sync(dir) +} + +function remove (dir, callback) { + return callback ? rimraf(dir, callback) : rimraf(dir, function () {}) +} + +module.exports = { + remove: remove, + removeSync: removeSync +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/streams/create-output-stream.js b/day1/cli-study/node_modules/fs-extra/lib/streams/create-output-stream.js new file mode 100644 index 0000000..e6db2dd --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/streams/create-output-stream.js @@ -0,0 +1,43 @@ +var path = require('path') +var fs = require('fs') +var mkdir = require('../mkdirs') +var WriteStream = fs.WriteStream + +function createOutputStream (file, options) { + var dirExists = false + var dir = path.dirname(file) + options = options || {} + + // if fd is set with an actual number, file is created, hence directory is too + if (options.fd) { + return fs.createWriteStream(file, options) + } else { + // this hacks the WriteStream constructor from calling open() + options.fd = -1 + } + + var ws = new WriteStream(file, options) + + var oldOpen = ws.open + ws.open = function () { + ws.fd = null // set actual fd + if (dirExists) return oldOpen.call(ws) + + // this only runs once on first write + mkdir.mkdirs(dir, function (err) { + if (err) { + ws.destroy() + ws.emit('error', err) + return + } + dirExists = true + oldOpen.call(ws) + }) + } + + ws.open() + + return ws +} + +module.exports = createOutputStream diff --git a/day1/cli-study/node_modules/fs-extra/lib/streams/index.js b/day1/cli-study/node_modules/fs-extra/lib/streams/index.js new file mode 100644 index 0000000..33be56e --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/streams/index.js @@ -0,0 +1,3 @@ +module.exports = { + createOutputStream: require('./create-output-stream') +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/util/assign.js b/day1/cli-study/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 0000000..8e41f9a --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,14 @@ +// simple mutable assign +function assign () { + var args = [].slice.call(arguments).filter(function (i) { return i }) + var dest = args.shift() + args.forEach(function (src) { + Object.keys(src).forEach(function (key) { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/day1/cli-study/node_modules/fs-extra/lib/util/utimes.js b/day1/cli-study/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 0000000..c99b010 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,69 @@ +var fs = require('graceful-fs') +var path = require('path') +var os = require('os') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + var tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + var d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + var fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + var tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + var d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', function (err) { + if (err) return callback(err) + fs.open(tmpfile, 'r+', function (err, fd) { + if (err) return callback(err) + fs.futimes(fd, d, d, function (err) { + if (err) return callback(err) + fs.close(fd, function (err) { + if (err) return callback(err) + fs.stat(tmpfile, function (err, stats) { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', function (err, fd) { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, function (err) { + if (err) return callback(err) + fs.close(fd, callback) + }) + }) +} + +module.exports = { + hasMillisRes: hasMillisRes, + hasMillisResSync: hasMillisResSync, + timeRemoveMillis: timeRemoveMillis, + utimesMillis: utimesMillis +} diff --git a/day1/cli-study/node_modules/fs-extra/lib/walk/index.js b/day1/cli-study/node_modules/fs-extra/lib/walk/index.js new file mode 100644 index 0000000..8626d47 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/lib/walk/index.js @@ -0,0 +1,5 @@ +var klaw = require('klaw') + +module.exports = { + walk: klaw +} diff --git a/day1/cli-study/node_modules/fs-extra/package.json b/day1/cli-study/node_modules/fs-extra/package.json new file mode 100644 index 0000000..d40f5f4 --- /dev/null +++ b/day1/cli-study/node_modules/fs-extra/package.json @@ -0,0 +1,90 @@ +{ + "_from": "fs-extra@~0.26.5", + "_id": "fs-extra@0.26.7", + "_inBundle": false, + "_integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "_location": "/fs-extra", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-extra@~0.26.5", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "~0.26.5", + "saveSpec": null, + "fetchSpec": "~0.26.5" + }, + "_requiredBy": [ + "/co-fs-extra" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "_shasum": "9ae1fdd94897798edab76d0918cf42d0c3184fa9", + "_spec": "fs-extra@~0.26.5", + "_where": "F:\\前端学习\\cli-study\\node_modules\\co-fs-extra", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "minimist": "^1.1.1", + "mocha": "^2.1.0", + "read-dir-files": "^0.1.1", + "secure-random": "^1.1.1", + "semver": "^4.3.6", + "standard": "^5.3.1" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover test.js", + "coveralls": "npm run coverage && coveralls < coverage/lcov.info", + "test": "standard && node test.js", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha" + }, + "version": "0.26.7" +} diff --git a/day1/cli-study/node_modules/fs.realpath/LICENSE b/day1/cli-study/node_modules/fs.realpath/LICENSE new file mode 100644 index 0000000..5bd884c --- /dev/null +++ b/day1/cli-study/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +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. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + 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. diff --git a/day1/cli-study/node_modules/fs.realpath/README.md b/day1/cli-study/node_modules/fs.realpath/README.md new file mode 100644 index 0000000..a42ceac --- /dev/null +++ b/day1/cli-study/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/day1/cli-study/node_modules/fs.realpath/index.js b/day1/cli-study/node_modules/fs.realpath/index.js new file mode 100644 index 0000000..b09c7c7 --- /dev/null +++ b/day1/cli-study/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/day1/cli-study/node_modules/fs.realpath/old.js b/day1/cli-study/node_modules/fs.realpath/old.js new file mode 100644 index 0000000..b40305e --- /dev/null +++ b/day1/cli-study/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/day1/cli-study/node_modules/fs.realpath/package.json b/day1/cli-study/node_modules/fs.realpath/package.json new file mode 100644 index 0000000..bb671b8 --- /dev/null +++ b/day1/cli-study/node_modules/fs.realpath/package.json @@ -0,0 +1,59 @@ +{ + "_from": "fs.realpath@^1.0.0", + "_id": "fs.realpath@1.0.0", + "_inBundle": false, + "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "_location": "/fs.realpath", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs.realpath@^1.0.0", + "name": "fs.realpath", + "escapedName": "fs.realpath", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_spec": "fs.realpath@^1.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "files": [ + "old.js", + "index.js" + ], + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "name": "fs.realpath", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/day1/cli-study/node_modules/function-bind/.editorconfig b/day1/cli-study/node_modules/function-bind/.editorconfig new file mode 100644 index 0000000..ac29ade --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/day1/cli-study/node_modules/function-bind/.eslintrc b/day1/cli-study/node_modules/function-bind/.eslintrc new file mode 100644 index 0000000..9b33d8e --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/.eslintrc @@ -0,0 +1,15 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "indent": [2, 4], + "max-nested-callbacks": [2, 3], + "max-params": [2, 3], + "max-statements": [2, 20], + "no-new-func": [1], + "strict": [0] + } +} diff --git a/day1/cli-study/node_modules/function-bind/.jscs.json b/day1/cli-study/node_modules/function-bind/.jscs.json new file mode 100644 index 0000000..8c44794 --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/.jscs.json @@ -0,0 +1,176 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 8 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/day1/cli-study/node_modules/function-bind/.npmignore b/day1/cli-study/node_modules/function-bind/.npmignore new file mode 100644 index 0000000..dbb555f --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/.npmignore @@ -0,0 +1,22 @@ +# gitignore +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules + +# Only apps should have lockfiles +npm-shrinkwrap.json +package-lock.json +yarn.lock diff --git a/day1/cli-study/node_modules/function-bind/.travis.yml b/day1/cli-study/node_modules/function-bind/.travis.yml new file mode 100644 index 0000000..85f70d2 --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/.travis.yml @@ -0,0 +1,168 @@ +language: node_js +os: + - linux +node_js: + - "8.4" + - "7.10" + - "6.11" + - "5.12" + - "4.8" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "node" + env: PRETEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/day1/cli-study/node_modules/function-bind/LICENSE b/day1/cli-study/node_modules/function-bind/LICENSE new file mode 100644 index 0000000..62d6d23 --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +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. + diff --git a/day1/cli-study/node_modules/function-bind/README.md b/day1/cli-study/node_modules/function-bind/README.md new file mode 100644 index 0000000..81862a0 --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/README.md @@ -0,0 +1,48 @@ +# function-bind + + + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/day1/cli-study/node_modules/function-bind/implementation.js b/day1/cli-study/node_modules/function-bind/implementation.js new file mode 100644 index 0000000..cc4daec --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/implementation.js @@ -0,0 +1,52 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/day1/cli-study/node_modules/function-bind/index.js b/day1/cli-study/node_modules/function-bind/index.js new file mode 100644 index 0000000..3bb6b96 --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/day1/cli-study/node_modules/function-bind/package.json b/day1/cli-study/node_modules/function-bind/package.json new file mode 100644 index 0000000..46f449d --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/package.json @@ -0,0 +1,97 @@ +{ + "_from": "function-bind@^1.1.1", + "_id": "function-bind@1.1.1", + "_inBundle": false, + "_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "_location": "/function-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "function-bind@^1.1.1", + "name": "function-bind", + "escapedName": "function-bind", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/es-abstract", + "/has", + "/object.assign", + "/object.values" + ], + "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "_shasum": "a56899d3ea3c9bab874bb9773b7c5ede92f4895d", + "_spec": "function-bind@^1.1.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\object.assign", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Implementation of Function.prototype.bind", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.5.0", + "jscs": "^3.0.7", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/Raynos/function-bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "license": "MIT", + "main": "index", + "name": "function-bind", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/function-bind.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage -- --quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.1" +} diff --git a/day1/cli-study/node_modules/function-bind/test/.eslintrc b/day1/cli-study/node_modules/function-bind/test/.eslintrc new file mode 100644 index 0000000..8a56d5b --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/day1/cli-study/node_modules/function-bind/test/index.js b/day1/cli-study/node_modules/function-bind/test/index.js new file mode 100644 index 0000000..2edecce --- /dev/null +++ b/day1/cli-study/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/day1/cli-study/node_modules/functional-red-black-tree/.npmignore b/day1/cli-study/node_modules/functional-red-black-tree/.npmignore new file mode 100644 index 0000000..ddc9ab3 --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules/* +*.DS_Store \ No newline at end of file diff --git a/day1/cli-study/node_modules/functional-red-black-tree/LICENSE b/day1/cli-study/node_modules/functional-red-black-tree/LICENSE new file mode 100644 index 0000000..8ce206a --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2013 Mikola Lysenko + +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. diff --git a/day1/cli-study/node_modules/functional-red-black-tree/README.md b/day1/cli-study/node_modules/functional-red-black-tree/README.md new file mode 100644 index 0000000..edd19cb --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/README.md @@ -0,0 +1,237 @@ +functional-red-black-tree +========================= +A [fully persistent](http://en.wikipedia.org/wiki/Persistent_data_structure) [red-black tree](http://en.wikipedia.org/wiki/Red%E2%80%93black_tree) written 100% in JavaScript. Works both in node.js and in the browser via [browserify](http://browserify.org/). + +Functional (or fully presistent) data structures allow for non-destructive updates. So if you insert an element into the tree, it returns a new tree with the inserted element rather than destructively updating the existing tree in place. Doing this requires using extra memory, and if one were naive it could cost as much as reallocating the entire tree. Instead, this data structure saves some memory by recycling references to previously allocated subtrees. This requires using only O(log(n)) additional memory per update instead of a full O(n) copy. + +Some advantages of this is that it is possible to apply insertions and removals to the tree while still iterating over previous versions of the tree. Functional and persistent data structures can also be useful in many geometric algorithms like point location within triangulations or ray queries, and can be used to analyze the history of executing various algorithms. This added power though comes at a cost, since it is generally a bit slower to use a functional data structure than an imperative version. However, if your application needs this behavior then you may consider using this module. + +# Install + + npm install functional-red-black-tree + +# Example + +Here is an example of some basic usage: + +```javascript +//Load the library +var createTree = require("functional-red-black-tree") + +//Create a tree +var t1 = createTree() + +//Insert some items into the tree +var t2 = t1.insert(1, "foo") +var t3 = t2.insert(2, "bar") + +//Remove something +var t4 = t3.remove(1) +``` + + +# API + +```javascript +var createTree = require("functional-red-black-tree") +``` + +## Overview + +- [Tree methods](#tree-methods) + - [`var tree = createTree([compare])`](#var-tree-=-createtreecompare) + - [`tree.keys`](#treekeys) + - [`tree.values`](#treevalues) + - [`tree.length`](#treelength) + - [`tree.get(key)`](#treegetkey) + - [`tree.insert(key, value)`](#treeinsertkey-value) + - [`tree.remove(key)`](#treeremovekey) + - [`tree.find(key)`](#treefindkey) + - [`tree.ge(key)`](#treegekey) + - [`tree.gt(key)`](#treegtkey) + - [`tree.lt(key)`](#treeltkey) + - [`tree.le(key)`](#treelekey) + - [`tree.at(position)`](#treeatposition) + - [`tree.begin`](#treebegin) + - [`tree.end`](#treeend) + - [`tree.forEach(visitor(key,value)[, lo[, hi]])`](#treeforEachvisitorkeyvalue-lo-hi) + - [`tree.root`](#treeroot) +- [Node properties](#node-properties) + - [`node.key`](#nodekey) + - [`node.value`](#nodevalue) + - [`node.left`](#nodeleft) + - [`node.right`](#noderight) +- [Iterator methods](#iterator-methods) + - [`iter.key`](#iterkey) + - [`iter.value`](#itervalue) + - [`iter.node`](#iternode) + - [`iter.tree`](#itertree) + - [`iter.index`](#iterindex) + - [`iter.valid`](#itervalid) + - [`iter.clone()`](#iterclone) + - [`iter.remove()`](#iterremove) + - [`iter.update(value)`](#iterupdatevalue) + - [`iter.next()`](#iternext) + - [`iter.prev()`](#iterprev) + - [`iter.hasNext`](#iterhasnext) + - [`iter.hasPrev`](#iterhasprev) + +## Tree methods + +### `var tree = createTree([compare])` +Creates an empty functional tree + +* `compare` is an optional comparison function, same semantics as array.sort() + +**Returns** An empty tree ordered by `compare` + +### `tree.keys` +A sorted array of all the keys in the tree + +### `tree.values` +An array array of all the values in the tree + +### `tree.length` +The number of items in the tree + +### `tree.get(key)` +Retrieves the value associated to the given key + +* `key` is the key of the item to look up + +**Returns** The value of the first node associated to `key` + +### `tree.insert(key, value)` +Creates a new tree with the new pair inserted. + +* `key` is the key of the item to insert +* `value` is the value of the item to insert + +**Returns** A new tree with `key` and `value` inserted + +### `tree.remove(key)` +Removes the first item with `key` in the tree + +* `key` is the key of the item to remove + +**Returns** A new tree with the given item removed if it exists + +### `tree.find(key)` +Returns an iterator pointing to the first item in the tree with `key`, otherwise `null`. + +### `tree.ge(key)` +Find the first item in the tree whose key is `>= key` + +* `key` is the key to search for + +**Returns** An iterator at the given element. + +### `tree.gt(key)` +Finds the first item in the tree whose key is `> key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.lt(key)` +Finds the last item in the tree whose key is `< key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.le(key)` +Finds the last item in the tree whose key is `<= key` + +* `key` is the key to search for + +**Returns** An iterator at the given element + +### `tree.at(position)` +Finds an iterator starting at the given element + +* `position` is the index at which the iterator gets created + +**Returns** An iterator starting at position + +### `tree.begin` +An iterator pointing to the first element in the tree + +### `tree.end` +An iterator pointing to the last element in the tree + +### `tree.forEach(visitor(key,value)[, lo[, hi]])` +Walks a visitor function over the nodes of the tree in order. + +* `visitor(key,value)` is a callback that gets executed on each node. If a truthy value is returned from the visitor, then iteration is stopped. +* `lo` is an optional start of the range to visit (inclusive) +* `hi` is an optional end of the range to visit (non-inclusive) + +**Returns** The last value returned by the callback + +### `tree.root` +Returns the root node of the tree + + +## Node properties +Each node of the tree has the following properties: + +### `node.key` +The key associated to the node + +### `node.value` +The value associated to the node + +### `node.left` +The left subtree of the node + +### `node.right` +The right subtree of the node + +## Iterator methods + +### `iter.key` +The key of the item referenced by the iterator + +### `iter.value` +The value of the item referenced by the iterator + +### `iter.node` +The value of the node at the iterator's current position. `null` is iterator is node valid. + +### `iter.tree` +The tree associated to the iterator + +### `iter.index` +Returns the position of this iterator in the sequence. + +### `iter.valid` +Checks if the iterator is valid + +### `iter.clone()` +Makes a copy of the iterator + +### `iter.remove()` +Removes the item at the position of the iterator + +**Returns** A new binary search tree with `iter`'s item removed + +### `iter.update(value)` +Updates the value of the node in the tree at this iterator + +**Returns** A new binary search tree with the corresponding node updated + +### `iter.next()` +Advances the iterator to the next position + +### `iter.prev()` +Moves the iterator backward one element + +### `iter.hasNext` +If true, then the iterator is not at the end of the sequence + +### `iter.hasPrev` +If true, then the iterator is not at the beginning of the sequence + +# Credits +(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/day1/cli-study/node_modules/functional-red-black-tree/bench/test.js b/day1/cli-study/node_modules/functional-red-black-tree/bench/test.js new file mode 100644 index 0000000..41c5a31 --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/bench/test.js @@ -0,0 +1,11 @@ +"use strict" + +var createTree = require("../rbtree.js") + +var t = createTree() + +var s = Date.now() +for(var i=0; i<100000; ++i) { + t = t.insert(Math.random(), Math.random()) +} +console.log(Date.now() - s) \ No newline at end of file diff --git a/day1/cli-study/node_modules/functional-red-black-tree/package.json b/day1/cli-study/node_modules/functional-red-black-tree/package.json new file mode 100644 index 0000000..5d7ce3b --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/package.json @@ -0,0 +1,68 @@ +{ + "_from": "functional-red-black-tree@^1.0.1", + "_id": "functional-red-black-tree@1.0.1", + "_inBundle": false, + "_integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "_location": "/functional-red-black-tree", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "functional-red-black-tree@^1.0.1", + "name": "functional-red-black-tree", + "escapedName": "functional-red-black-tree", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "_shasum": "1b0ab3bd553b2a0d6399d29c0e3ea0b252078327", + "_spec": "functional-red-black-tree@^1.0.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/functional-red-black-tree/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A fully persistent balanced binary search tree", + "devDependencies": { + "iota-array": "^0.0.1", + "tape": "^2.12.0" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/mikolalysenko/functional-red-black-tree#readme", + "keywords": [ + "functional", + "red", + "black", + "tree", + "binary", + "search", + "balance", + "persistent", + "fully", + "dynamic", + "data", + "structure" + ], + "license": "MIT", + "main": "rbtree.js", + "name": "functional-red-black-tree", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/functional-red-black-tree.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.1" +} diff --git a/day1/cli-study/node_modules/functional-red-black-tree/rbtree.js b/day1/cli-study/node_modules/functional-red-black-tree/rbtree.js new file mode 100644 index 0000000..5a69a40 --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/rbtree.js @@ -0,0 +1,996 @@ +"use strict" + +module.exports = createRBTree + +var RED = 0 +var BLACK = 1 + +function RBNode(color, key, value, left, right, count) { + this._color = color + this.key = key + this.value = value + this.left = left + this.right = right + this._count = count +} + +function cloneNode(node) { + return new RBNode(node._color, node.key, node.value, node.left, node.right, node._count) +} + +function repaint(color, node) { + return new RBNode(color, node.key, node.value, node.left, node.right, node._count) +} + +function recount(node) { + node._count = 1 + (node.left ? node.left._count : 0) + (node.right ? node.right._count : 0) +} + +function RedBlackTree(compare, root) { + this._compare = compare + this.root = root +} + +var proto = RedBlackTree.prototype + +Object.defineProperty(proto, "keys", { + get: function() { + var result = [] + this.forEach(function(k,v) { + result.push(k) + }) + return result + } +}) + +Object.defineProperty(proto, "values", { + get: function() { + var result = [] + this.forEach(function(k,v) { + result.push(v) + }) + return result + } +}) + +//Returns the number of nodes in the tree +Object.defineProperty(proto, "length", { + get: function() { + if(this.root) { + return this.root._count + } + return 0 + } +}) + +//Insert a new item into the tree +proto.insert = function(key, value) { + var cmp = this._compare + //Find point to insert new node at + var n = this.root + var n_stack = [] + var d_stack = [] + while(n) { + var d = cmp(key, n.key) + n_stack.push(n) + d_stack.push(d) + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + //Rebuild path to leaf node + n_stack.push(new RBNode(RED, key, value, null, null, 1)) + for(var s=n_stack.length-2; s>=0; --s) { + var n = n_stack[s] + if(d_stack[s] <= 0) { + n_stack[s] = new RBNode(n._color, n.key, n.value, n_stack[s+1], n.right, n._count+1) + } else { + n_stack[s] = new RBNode(n._color, n.key, n.value, n.left, n_stack[s+1], n._count+1) + } + } + //Rebalance tree using rotations + //console.log("start insert", key, d_stack) + for(var s=n_stack.length-1; s>1; --s) { + var p = n_stack[s-1] + var n = n_stack[s] + if(p._color === BLACK || n._color === BLACK) { + break + } + var pp = n_stack[s-2] + if(pp.left === p) { + if(p.left === n) { + var y = pp.right + if(y && y._color === RED) { + //console.log("LLr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LLb") + pp._color = RED + pp.left = p.right + p._color = BLACK + p.right = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = p + } else { + ppp.right = p + } + } + break + } + } else { + var y = pp.right + if(y && y._color === RED) { + //console.log("LRr") + p._color = BLACK + pp.right = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("LRb") + p.right = n.left + pp._color = RED + pp.left = n.right + n._color = BLACK + n.left = p + n.right = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.left === pp) { + ppp.left = n + } else { + ppp.right = n + } + } + break + } + } + } else { + if(p.right === n) { + var y = pp.left + if(y && y._color === RED) { + //console.log("RRr", y.key) + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RRb") + pp._color = RED + pp.right = p.left + p._color = BLACK + p.left = pp + n_stack[s-2] = p + n_stack[s-1] = n + recount(pp) + recount(p) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = p + } else { + ppp.left = p + } + } + break + } + } else { + var y = pp.left + if(y && y._color === RED) { + //console.log("RLr") + p._color = BLACK + pp.left = repaint(BLACK, y) + pp._color = RED + s -= 1 + } else { + //console.log("RLb") + p.left = n.right + pp._color = RED + pp.right = n.left + n._color = BLACK + n.right = p + n.left = pp + n_stack[s-2] = n + n_stack[s-1] = p + recount(pp) + recount(p) + recount(n) + if(s >= 3) { + var ppp = n_stack[s-3] + if(ppp.right === pp) { + ppp.right = n + } else { + ppp.left = n + } + } + break + } + } + } + } + //Return new tree + n_stack[0]._color = BLACK + return new RedBlackTree(cmp, n_stack[0]) +} + + +//Visit all nodes inorder +function doVisitFull(visit, node) { + if(node.left) { + var v = doVisitFull(visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + if(node.right) { + return doVisitFull(visit, node.right) + } +} + +//Visit half nodes in order +function doVisitHalf(lo, compare, visit, node) { + var l = compare(lo, node.key) + if(l <= 0) { + if(node.left) { + var v = doVisitHalf(lo, compare, visit, node.left) + if(v) { return v } + } + var v = visit(node.key, node.value) + if(v) { return v } + } + if(node.right) { + return doVisitHalf(lo, compare, visit, node.right) + } +} + +//Visit all nodes within a range +function doVisit(lo, hi, compare, visit, node) { + var l = compare(lo, node.key) + var h = compare(hi, node.key) + var v + if(l <= 0) { + if(node.left) { + v = doVisit(lo, hi, compare, visit, node.left) + if(v) { return v } + } + if(h > 0) { + v = visit(node.key, node.value) + if(v) { return v } + } + } + if(h > 0 && node.right) { + return doVisit(lo, hi, compare, visit, node.right) + } +} + + +proto.forEach = function rbTreeForEach(visit, lo, hi) { + if(!this.root) { + return + } + switch(arguments.length) { + case 1: + return doVisitFull(visit, this.root) + break + + case 2: + return doVisitHalf(lo, this._compare, visit, this.root) + break + + case 3: + if(this._compare(lo, hi) >= 0) { + return + } + return doVisit(lo, hi, this._compare, visit, this.root) + break + } +} + +//First item in list +Object.defineProperty(proto, "begin", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.left + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Last item in list +Object.defineProperty(proto, "end", { + get: function() { + var stack = [] + var n = this.root + while(n) { + stack.push(n) + n = n.right + } + return new RedBlackTreeIterator(this, stack) + } +}) + +//Find the ith item in the tree +proto.at = function(idx) { + if(idx < 0) { + return new RedBlackTreeIterator(this, []) + } + var n = this.root + var stack = [] + while(true) { + stack.push(n) + if(n.left) { + if(idx < n.left._count) { + n = n.left + continue + } + idx -= n.left._count + } + if(!idx) { + return new RedBlackTreeIterator(this, stack) + } + idx -= 1 + if(n.right) { + if(idx >= n.right._count) { + break + } + n = n.right + } else { + break + } + } + return new RedBlackTreeIterator(this, []) +} + +proto.ge = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d <= 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.gt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d < 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.lt = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d > 0) { + last_ptr = stack.length + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +proto.le = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + var last_ptr = 0 + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d >= 0) { + last_ptr = stack.length + } + if(d < 0) { + n = n.left + } else { + n = n.right + } + } + stack.length = last_ptr + return new RedBlackTreeIterator(this, stack) +} + +//Finds the item with key if it exists +proto.find = function(key) { + var cmp = this._compare + var n = this.root + var stack = [] + while(n) { + var d = cmp(key, n.key) + stack.push(n) + if(d === 0) { + return new RedBlackTreeIterator(this, stack) + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return new RedBlackTreeIterator(this, []) +} + +//Removes item with key from tree +proto.remove = function(key) { + var iter = this.find(key) + if(iter) { + return iter.remove() + } + return this +} + +//Returns the item at `key` +proto.get = function(key) { + var cmp = this._compare + var n = this.root + while(n) { + var d = cmp(key, n.key) + if(d === 0) { + return n.value + } + if(d <= 0) { + n = n.left + } else { + n = n.right + } + } + return +} + +//Iterator for red black tree +function RedBlackTreeIterator(tree, stack) { + this.tree = tree + this._stack = stack +} + +var iproto = RedBlackTreeIterator.prototype + +//Test if iterator is valid +Object.defineProperty(iproto, "valid", { + get: function() { + return this._stack.length > 0 + } +}) + +//Node of the iterator +Object.defineProperty(iproto, "node", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1] + } + return null + }, + enumerable: true +}) + +//Makes a copy of an iterator +iproto.clone = function() { + return new RedBlackTreeIterator(this.tree, this._stack.slice()) +} + +//Swaps two nodes +function swapNode(n, v) { + n.key = v.key + n.value = v.value + n.left = v.left + n.right = v.right + n._color = v._color + n._count = v._count +} + +//Fix up a double black node in a tree +function fixDoubleBlack(stack) { + var n, p, s, z + for(var i=stack.length-1; i>=0; --i) { + n = stack[i] + if(i === 0) { + n._color = BLACK + return + } + //console.log("visit node:", n.key, i, stack[i].key, stack[i-1].key) + p = stack[i-1] + if(p.left === n) { + //console.log("left child") + s = p.right + if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.right = cloneNode(s) + z = s.right = cloneNode(s.right) + p.right = s.left + s.left = p + s.right = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + return + } else if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red") + s = p.right = cloneNode(s) + z = s.left = cloneNode(s.left) + p.right = z.left + s.left = z.right + z.left = p + z.right = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = z + } else { + pp.right = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent", p.right.value) + p._color = BLACK + p.right = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent", p.right.value) + p.right = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.right = s.left + s.left = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.left === p) { + pp.left = s + } else { + pp.right = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } else { + //console.log("right child") + s = p.left + if(s.left && s.left._color === RED) { + //console.log("case 1: left sibling child red", p.value, p._color) + s = p.left = cloneNode(s) + z = s.left = cloneNode(s.left) + p.left = s.right + s.right = p + s.left = z + s._color = p._color + n._color = BLACK + p._color = BLACK + z._color = BLACK + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + return + } else if(s.right && s.right._color === RED) { + //console.log("case 1: right sibling child red") + s = p.left = cloneNode(s) + z = s.right = cloneNode(s.right) + p.left = z.right + s.right = z.left + z.right = p + z.left = s + z._color = p._color + p._color = BLACK + s._color = BLACK + n._color = BLACK + recount(p) + recount(s) + recount(z) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = z + } else { + pp.left = z + } + } + stack[i-1] = z + return + } + if(s._color === BLACK) { + if(p._color === RED) { + //console.log("case 2: black sibling, red parent") + p._color = BLACK + p.left = repaint(RED, s) + return + } else { + //console.log("case 2: black sibling, black parent") + p.left = repaint(RED, s) + continue + } + } else { + //console.log("case 3: red sibling") + s = cloneNode(s) + p.left = s.right + s.right = p + s._color = p._color + p._color = RED + recount(p) + recount(s) + if(i > 1) { + var pp = stack[i-2] + if(pp.right === p) { + pp.right = s + } else { + pp.left = s + } + } + stack[i-1] = s + stack[i] = p + if(i+1 < stack.length) { + stack[i+1] = n + } else { + stack.push(n) + } + i = i+2 + } + } + } +} + +//Removes item at iterator from tree +iproto.remove = function() { + var stack = this._stack + if(stack.length === 0) { + return this.tree + } + //First copy path to node + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, n.value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + var n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + + //Get node + n = cstack[cstack.length-1] + //console.log("start remove: ", n.value) + + //If not leaf, then swap with previous node + if(n.left && n.right) { + //console.log("moving to leaf") + + //First walk to previous leaf + var split = cstack.length + n = n.left + while(n.right) { + cstack.push(n) + n = n.right + } + //Copy path to leaf + var v = cstack[split-1] + cstack.push(new RBNode(n._color, v.key, v.value, n.left, n.right, n._count)) + cstack[split-1].key = n.key + cstack[split-1].value = n.value + + //Fix up stack + for(var i=cstack.length-2; i>=split; --i) { + n = cstack[i] + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + cstack[split-1].left = cstack[split] + } + //console.log("stack=", cstack.map(function(v) { return v.value })) + + //Remove leaf node + n = cstack[cstack.length-1] + if(n._color === RED) { + //Easy case: removing red leaf + //console.log("RED leaf") + var p = cstack[cstack.length-2] + if(p.left === n) { + p.left = null + } else if(p.right === n) { + p.right = null + } + cstack.pop() + for(var i=0; i 0) { + return this._stack[this._stack.length-1].key + } + return + }, + enumerable: true +}) + +//Returns value +Object.defineProperty(iproto, "value", { + get: function() { + if(this._stack.length > 0) { + return this._stack[this._stack.length-1].value + } + return + }, + enumerable: true +}) + + +//Returns the position of this iterator in the sorted list +Object.defineProperty(iproto, "index", { + get: function() { + var idx = 0 + var stack = this._stack + if(stack.length === 0) { + var r = this.tree.root + if(r) { + return r._count + } + return 0 + } else if(stack[stack.length-1].left) { + idx = stack[stack.length-1].left._count + } + for(var s=stack.length-2; s>=0; --s) { + if(stack[s+1] === stack[s].right) { + ++idx + if(stack[s].left) { + idx += stack[s].left._count + } + } + } + return idx + }, + enumerable: true +}) + +//Advances iterator to next element in list +iproto.next = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.right) { + n = n.right + while(n) { + stack.push(n) + n = n.left + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].right === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at end of tree +Object.defineProperty(iproto, "hasNext", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].right) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].left === stack[s]) { + return true + } + } + return false + } +}) + +//Update value +iproto.update = function(value) { + var stack = this._stack + if(stack.length === 0) { + throw new Error("Can't update empty node!") + } + var cstack = new Array(stack.length) + var n = stack[stack.length-1] + cstack[cstack.length-1] = new RBNode(n._color, n.key, value, n.left, n.right, n._count) + for(var i=stack.length-2; i>=0; --i) { + n = stack[i] + if(n.left === stack[i+1]) { + cstack[i] = new RBNode(n._color, n.key, n.value, cstack[i+1], n.right, n._count) + } else { + cstack[i] = new RBNode(n._color, n.key, n.value, n.left, cstack[i+1], n._count) + } + } + return new RedBlackTree(this.tree._compare, cstack[0]) +} + +//Moves iterator backward one element +iproto.prev = function() { + var stack = this._stack + if(stack.length === 0) { + return + } + var n = stack[stack.length-1] + if(n.left) { + n = n.left + while(n) { + stack.push(n) + n = n.right + } + } else { + stack.pop() + while(stack.length > 0 && stack[stack.length-1].left === n) { + n = stack[stack.length-1] + stack.pop() + } + } +} + +//Checks if iterator is at start of tree +Object.defineProperty(iproto, "hasPrev", { + get: function() { + var stack = this._stack + if(stack.length === 0) { + return false + } + if(stack[stack.length-1].left) { + return true + } + for(var s=stack.length-1; s>0; --s) { + if(stack[s-1].right === stack[s]) { + return true + } + } + return false + } +}) + +//Default comparison function +function defaultCompare(a, b) { + if(a < b) { + return -1 + } + if(a > b) { + return 1 + } + return 0 +} + +//Build a tree +function createRBTree(compare) { + return new RedBlackTree(compare || defaultCompare, null) +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/functional-red-black-tree/test/test.js b/day1/cli-study/node_modules/functional-red-black-tree/test/test.js new file mode 100644 index 0000000..fd945d0 --- /dev/null +++ b/day1/cli-study/node_modules/functional-red-black-tree/test/test.js @@ -0,0 +1,479 @@ +"use strict" + +var makeTree = require("../rbtree.js") +var tape = require("tape") +var util = require("util") +var iota = require("iota-array") + +var COLORS = [ "r", "b", "bb" ] + +function printTree(tree) { + if(!tree) { + return [] + } + return [ COLORS[tree._color], tree.key, printTree(tree.left), printTree(tree.right) ] +} + +function print(t) { + console.log(util.inspect(printTree(t.root), {depth:12})) +} + +//Ensures the red black axioms are satisfied by tree +function checkTree(tree, t) { + if(!tree.root) { + return + } + t.equals(tree.root._color, 1, "root is black") + function checkNode(node) { + if(!node) { + return [1, 0] + } + if(node._color === 0) { + t.assert(!node.left || node.left._color === 1, "children of red node must be black") + t.assert(!node.right || node.right._color === 1, "children of red node must be black") + } else { + t.equals(node._color, 1, "node color must be red or black") + } + if(node.left) { + t.assert(tree._compare(node.left.key, node.key) <= 0, "left tree order invariant") + } + if(node.right) { + t.assert(tree._compare(node.right.key, node.key) >= 0, "right tree order invariant") + } + var cl = checkNode(node.left) + var cr = checkNode(node.right) + t.equals(cl[0], cr[0], "number of black nodes along all paths to root must be constant") + t.equals(cl[1] + cr[1] + 1, node._count, "item count consistency") + return [cl[0] + node._color, cl[1] + cr[1] + 1] + } + var r = checkNode(tree.root) + t.equals(r[1], tree.length, "tree length") +} + +tape("insert()", function(t) { + var t1 = makeTree() + + var u = t1 + var arr = [] + for(var i=20; i>=0; --i) { + var x = i + var next = u.insert(x, true) + checkTree(u, t) + checkTree(next, t) + t.equals(u.length, arr.length) + arr.push(x) + u = next + } + for(var i=-20; i<0; ++i) { + var x = i + var next = u.insert(x, true) + checkTree(u, t) + checkTree(next, t) + arr.sort(function(a,b) { return a-b }) + var ptr = 0 + u.forEach(function(k,v) { + t.equals(k, arr[ptr++]) + }) + t.equals(ptr, arr.length) + arr.push(x) + u = next + } + + var start = u.begin + for(var i=-20, j=0; j<=40; ++i, ++j) { + t.equals(u.at(j).key, i, "checking at()") + t.equals(start.key, i, "checking iter") + t.equals(start.index, j, "checking index") + t.assert(start.valid, "checking valid") + if(j < 40) { + t.assert(start.hasNext, "hasNext()") + } else { + t.assert(!start.hasNext, "eof hasNext()") + } + start.next() + } + t.assert(!start.valid, "invalid eof iterator") + t.assert(!start.hasNext, "hasNext() at eof fail") + t.equals(start.index, 41, "eof index") + + t.end() +}) + +tape("foreach", function(t) { + var u = iota(31).reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + //Check basic foreach + var visit_keys = [] + var visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }) + t.same(visit_keys, u.keys) + t.same(visit_vals, u.values) + + //Check foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 5) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }), 1000) + t.same(visit_keys, u.keys.slice(0, 5)) + t.same(visit_vals, u.values.slice(0, 5)) + + //Check half interval foreach + visit_keys = [] + visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }, 3) + t.same(visit_keys, u.keys.slice(3)) + t.same(visit_vals, u.values.slice(3)) + + //Check half interval foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 12) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }, 3), 1000) + t.same(visit_keys, u.keys.slice(3, 12)) + t.same(visit_vals, u.values.slice(3, 12)) + + + //Check interval foreach + visit_keys = [] + visit_vals = [] + u.forEach(function(k,v) { + visit_keys.push(k) + visit_vals.push(v) + }, 3, 15) + t.same(visit_keys, u.keys.slice(3, 15)) + t.same(visit_vals, u.values.slice(3, 15)) + + //Check interval foreach with termination + visit_keys = [] + visit_vals = [] + t.equals(u.forEach(function(k,v) { + if(k === 12) { + return 1000 + } + visit_keys.push(k) + visit_vals.push(v) + }, 3, 15), 1000) + t.same(visit_keys, u.keys.slice(3, 12)) + t.same(visit_vals, u.values.slice(3, 12)) + + t.end() +}) + +function compareIterators(a, b, t) { + t.equals(a.tree, b.tree, "iter trees") + t.equals(a.valid, b.valid, "iter validity") + if(!b.valid) { + return + } + t.equals(a.node, b.node, "iter node") + t.equals(a.key, b.key, "iter key") + t.equals(a.value, b.value, "iter value") + t.equals(a.index, b.index, "iter index") +} + +tape("iterators", function(t) { + var u = iota(20).reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + //Try walking forward + var iter = u.begin + var c = iter.clone() + t.ok(iter.hasNext, "must have next at beginneing") + t.ok(!iter.hasPrev, "must not have predecessor") + for(var i=0; i<20; ++i) { + var v = u.at(i) + compareIterators(iter, v, t) + t.equals(iter.index, i) + iter.next() + } + t.ok(!iter.valid, "must be eof iterator") + + //Check if the clone worked + compareIterators(c, u.begin, t) + + //Try walking backward + var iter = u.end + t.ok(!iter.hasNext, "must not have next") + t.ok(iter.hasPrev, "must have predecessor") + for(var i=19; i>=0; --i) { + var v = u.at(i) + compareIterators(iter, v, t) + t.equals(iter.index, i) + iter.prev() + } + t.ok(!iter.valid, "must be eof iterator") + + t.end() +}) + + +tape("remove()", function(t) { + + var sz = [1, 2, 10, 20, 23, 31, 32, 33] + for(var n=0; n b[0]) { return 1 } + return 0 + }) + + var keys = zipped.map(function(v) { return v[0] }) + var values = zipped.map(function(v) { return v[1] }) + + t.same(u.keys, keys) + t.same(u.values, values) + + t.end() +}) + +tape("searching", function(t) { + + var arr = [0, 1, 1, 1, 1, 2, 3, 4, 5, 6, 6 ] + var u = arr.reduce(function(u, k, v) { + return u.insert(k, v) + }, makeTree()) + + + for(var i=0; i 0, "find repeat") + t.ok(u.find(1).index < 5, "find repeat") + + for(var i=0; i { + return process.env.HTTPS_PROXY || + process.env.https_proxy || + process.env.HTTP_PROXY || + process.env.http_proxy || + npmConf.get('https-proxy') || + npmConf.get('http-proxy') || + npmConf.get('proxy') || + null; +}; diff --git a/day1/cli-study/node_modules/get-proxy/license b/day1/cli-study/node_modules/get-proxy/license new file mode 100644 index 0000000..db6bc32 --- /dev/null +++ b/day1/cli-study/node_modules/get-proxy/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Kevin Mårtensson (github.com/kevva) + +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. diff --git a/day1/cli-study/node_modules/get-proxy/package.json b/day1/cli-study/node_modules/get-proxy/package.json new file mode 100644 index 0000000..8228ed6 --- /dev/null +++ b/day1/cli-study/node_modules/get-proxy/package.json @@ -0,0 +1,65 @@ +{ + "_from": "get-proxy@^2.0.0", + "_id": "get-proxy@2.1.0", + "_inBundle": false, + "_integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==", + "_location": "/get-proxy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-proxy@^2.0.0", + "name": "get-proxy", + "escapedName": "get-proxy", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/caw" + ], + "_resolved": "https://registry.npmjs.org/get-proxy/-/get-proxy-2.1.0.tgz", + "_shasum": "349f2b4d91d44c4d4d4e9cba2ad90143fac5ef93", + "_spec": "get-proxy@^2.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\caw", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "https://github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/get-proxy/issues" + }, + "bundleDependencies": false, + "dependencies": { + "npm-conf": "^1.1.0" + }, + "deprecated": false, + "description": "Get configured proxy", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/get-proxy#readme", + "keywords": [ + "env", + "get", + "proxy" + ], + "license": "MIT", + "name": "get-proxy", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/get-proxy.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/day1/cli-study/node_modules/get-proxy/readme.md b/day1/cli-study/node_modules/get-proxy/readme.md new file mode 100644 index 0000000..927f005 --- /dev/null +++ b/day1/cli-study/node_modules/get-proxy/readme.md @@ -0,0 +1,25 @@ +# get-proxy [![Build Status](https://travis-ci.org/kevva/get-proxy.svg?branch=master)](http://travis-ci.org/kevva/get-proxy) + +> Get configured proxy + + +## Install + +``` +$ npm install get-proxy +``` + + +## Usage + +```js +const getProxy = require('get-proxy'); + +getProxy(); +//=> 'http://192.168.0.1:8080' +``` + + +## License + +MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/day1/cli-study/node_modules/get-stream/buffer-stream.js b/day1/cli-study/node_modules/get-stream/buffer-stream.js new file mode 100644 index 0000000..ae45d3d --- /dev/null +++ b/day1/cli-study/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,51 @@ +'use strict'; +const PassThrough = require('stream').PassThrough; + +module.exports = opts => { + opts = Object.assign({}, opts); + + const array = opts.array; + let encoding = opts.encoding; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; diff --git a/day1/cli-study/node_modules/get-stream/index.js b/day1/cli-study/node_modules/get-stream/index.js new file mode 100644 index 0000000..2dc5ee9 --- /dev/null +++ b/day1/cli-study/node_modules/get-stream/index.js @@ -0,0 +1,51 @@ +'use strict'; +const bufferStream = require('./buffer-stream'); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = Object.assign({maxBuffer: Infinity}, opts); + + const maxBuffer = opts.maxBuffer; + let stream; + let clean; + + const p = new Promise((resolve, reject) => { + const error = err => { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + + reject(err); + }; + + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = () => { + // some streams doesn't implement the `stream.Readable` interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + }); + + p.then(clean, clean); + + return p.then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); +module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/day1/cli-study/node_modules/get-stream/license b/day1/cli-study/node_modules/get-stream/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/day1/cli-study/node_modules/get-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/get-stream/package.json b/day1/cli-study/node_modules/get-stream/package.json new file mode 100644 index 0000000..b09d255 --- /dev/null +++ b/day1/cli-study/node_modules/get-stream/package.json @@ -0,0 +1,82 @@ +{ + "_from": "get-stream@^3.0.0", + "_id": "get-stream@3.0.0", + "_inBundle": false, + "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "_location": "/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^3.0.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/cacheable-request", + "/download", + "/got" + ], + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "_spec": "get-stream@^3.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\download", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "homepage": "https://github.com/sindresorhus/get-stream#readme", + "keywords": [ + "get", + "stream", + "promise", + "concat", + "string", + "str", + "text", + "buffer", + "read", + "data", + "consume", + "readable", + "readablestream", + "array", + "object", + "obj" + ], + "license": "MIT", + "name": "get-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/get-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/day1/cli-study/node_modules/get-stream/readme.md b/day1/cli-study/node_modules/get-stream/readme.md new file mode 100644 index 0000000..73b188f --- /dev/null +++ b/day1/cli-study/node_modules/get-stream/readme.md @@ -0,0 +1,117 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install --save get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); +const stream = fs.createReadStream('unicorn.txt'); + +getStream(stream).then(str => { + console.log(str); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +}); +``` + + +## API + +The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +##### encoding + +Type: `string`
+Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`
+Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +getStream(streamThatErrorsAtTheEnd('unicorn')) + .catch(err => { + console.log(err.bufferedData); + //=> 'unicorn' + }); +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/day1/cli-study/node_modules/git-clone/README.md b/day1/cli-study/node_modules/git-clone/README.md new file mode 100644 index 0000000..48edb46 --- /dev/null +++ b/day1/cli-study/node_modules/git-clone/README.md @@ -0,0 +1,31 @@ +# git-clone + +Clone a git repository via shell command. + +## Installation + +Install: + + $ npm install git-clone + +Require: + + var clone = require('git-clone'); + +## API + +#### `clone(repo, targetPath, [options], cb)` + +Clone `repo` to `targetPath`, calling `cb` on completion. + +Supported `options`: + + * `git`: path to `git` binary; default: `git` (optional). + * `shallow`: when `true`, clone with depth 1 (optional). + * `checkout`: revision/branch/tag to check out (optional). + +## Copyright & License + +© 2014 Jason Frame [ [@jaz303](http://twitter.com/jaz303) / [jason@onehackoranother.com](mailto:jason@onehackoranother.com) ] + +Released under the ISC license. diff --git a/day1/cli-study/node_modules/git-clone/index.js b/day1/cli-study/node_modules/git-clone/index.js new file mode 100644 index 0000000..73c5b04 --- /dev/null +++ b/day1/cli-study/node_modules/git-clone/index.js @@ -0,0 +1,49 @@ +var spawn = require('child_process').spawn; + +module.exports = function(repo, targetPath, opts, cb) { + + if (typeof opts === 'function') { + cb = opts; + opts = null; + } + + opts = opts || {}; + + var git = opts.git || 'git'; + var args = ['clone']; + + if (opts.shallow) { + args.push('--depth'); + args.push('1'); + } + + args.push('--'); + args.push(repo); + args.push(targetPath); + + var process = spawn(git, args); + process.on('close', function(status) { + if (status == 0) { + if (opts.checkout) { + _checkout(); + } else { + cb && cb(); + } + } else { + cb && cb(new Error("'git clone' failed with status " + status)); + } + }); + + function _checkout() { + var args = ['checkout', opts.checkout]; + var process = spawn(git, args, { cwd: targetPath }); + process.on('close', function(status) { + if (status == 0) { + cb && cb(); + } else { + cb && cb(new Error("'git checkout' failed with status " + status)); + } + }); + } + +} diff --git a/day1/cli-study/node_modules/git-clone/package.json b/day1/cli-study/node_modules/git-clone/package.json new file mode 100644 index 0000000..c24cf5e --- /dev/null +++ b/day1/cli-study/node_modules/git-clone/package.json @@ -0,0 +1,53 @@ +{ + "_from": "git-clone@^0.1.0", + "_id": "git-clone@0.1.0", + "_inBundle": false, + "_integrity": "sha1-DXYWN3gJOu9/HDAjjyqe8/B6Lrk=", + "_location": "/git-clone", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "git-clone@^0.1.0", + "name": "git-clone", + "escapedName": "git-clone", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/download-git-repo" + ], + "_resolved": "https://registry.npmjs.org/git-clone/-/git-clone-0.1.0.tgz", + "_shasum": "0d76163778093aef7f1c30238f2a9ef3f07a2eb9", + "_spec": "git-clone@^0.1.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\download-git-repo", + "author": { + "name": "Jason Frame", + "email": "jason@onehackoranother.com", + "url": "http://jasonframe.co.uk" + }, + "bugs": { + "url": "https://github.com/jaz303/git-clone/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Clone a git repository", + "homepage": "https://github.com/jaz303/git-clone", + "keywords": [ + "git", + "clone", + "shell" + ], + "license": "ISC", + "main": "index.js", + "name": "git-clone", + "repository": { + "type": "git", + "url": "git://github.com/jaz303/git-clone.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "0.1.0" +} diff --git a/day1/cli-study/node_modules/git-clone/test/.npmignore b/day1/cli-study/node_modules/git-clone/test/.npmignore new file mode 100644 index 0000000..1ef8330 --- /dev/null +++ b/day1/cli-study/node_modules/git-clone/test/.npmignore @@ -0,0 +1 @@ +test-checkout diff --git a/day1/cli-study/node_modules/git-clone/test/test.js b/day1/cli-study/node_modules/git-clone/test/test.js new file mode 100644 index 0000000..3bdb6cc --- /dev/null +++ b/day1/cli-study/node_modules/git-clone/test/test.js @@ -0,0 +1,8 @@ +var gitClone = require('../index'); + +gitClone('git@github.com:jaz303/tpl-simple-site.git', './test-checkout', { + checkout: 'a76362b0705d4126fa4462916cabb2506ecfe8e2' }, + function(err) { + console.log("complete!"); + console.log(err); + }); diff --git a/day1/cli-study/node_modules/glob-parent/LICENSE b/day1/cli-study/node_modules/glob-parent/LICENSE new file mode 100644 index 0000000..63222d7 --- /dev/null +++ b/day1/cli-study/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015, 2019 Elan Shanker + +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. diff --git a/day1/cli-study/node_modules/glob-parent/README.md b/day1/cli-study/node_modules/glob-parent/README.md new file mode 100644 index 0000000..36a2793 --- /dev/null +++ b/day1/cli-study/node_modules/glob-parent/README.md @@ -0,0 +1,137 @@ +
+ +# glob-parent + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +Extract the non-magic parent path from a glob string. + +## Usage + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## API + +### `globParent(maybeGlobString, [options])` + +Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. + +#### options + +```js +{ + // Disables the automatic conversion of slashes for Windows + flipBackslashes: true +} +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) unless used as a path segment alone +- `*` (asterisk) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + +## License + +ISC + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets + +[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg +[npm-url]: https://www.npmjs.com/package/glob-parent +[npm-image]: https://img.shields.io/npm/v/glob-parent.svg + +[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master +[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master + +[travis-url]: https://travis-ci.org/gulpjs/glob-parent +[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/day1/cli-study/node_modules/glob-parent/index.js b/day1/cli-study/node_modules/glob-parent/index.js new file mode 100644 index 0000000..789dbbf --- /dev/null +++ b/day1/cli-study/node_modules/glob-parent/index.js @@ -0,0 +1,41 @@ +'use strict'; + +var isGlob = require('is-glob'); +var pathPosixDirname = require('path').posix.dirname; +var isWin32 = require('os').platform() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; diff --git a/day1/cli-study/node_modules/glob-parent/package.json b/day1/cli-study/node_modules/glob-parent/package.json new file mode 100644 index 0000000..b602015 --- /dev/null +++ b/day1/cli-study/node_modules/glob-parent/package.json @@ -0,0 +1,90 @@ +{ + "_from": "glob-parent@^5.0.0", + "_id": "glob-parent@5.1.1", + "_inBundle": false, + "_integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "_location": "/glob-parent", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-parent@^5.0.0", + "name": "glob-parent", + "escapedName": "glob-parent", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "_shasum": "b6c1ef417c4e5663ea498f1c45afac6916bbc229", + "_spec": "glob-parent@^5.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "https://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glob-parent/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "is-glob": "^4.0.1" + }, + "deprecated": false, + "description": "Extract the non-magic parent path from a glob string.", + "devDependencies": { + "coveralls": "^3.0.11", + "eslint": "^2.13.1", + "eslint-config-gulp": "^3.0.1", + "expect": "^1.20.2", + "mocha": "^6.0.2", + "nyc": "^13.3.0" + }, + "engines": { + "node": ">= 6" + }, + "files": [ + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/gulpjs/glob-parent#readme", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-parent.git" + }, + "scripts": { + "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint .", + "pretest": "npm run lint", + "test": "nyc mocha --async-only" + }, + "version": "5.1.1" +} diff --git a/day1/cli-study/node_modules/glob/LICENSE b/day1/cli-study/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/day1/cli-study/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +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. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/day1/cli-study/node_modules/glob/README.md b/day1/cli-study/node_modules/glob/README.md new file mode 100644 index 0000000..0916a48 --- /dev/null +++ b/day1/cli-study/node_modules/glob/README.md @@ -0,0 +1,375 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/day1/cli-study/node_modules/glob/changelog.md b/day1/cli-study/node_modules/glob/changelog.md new file mode 100644 index 0000000..4163677 --- /dev/null +++ b/day1/cli-study/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/day1/cli-study/node_modules/glob/common.js b/day1/cli-study/node_modules/glob/common.js new file mode 100644 index 0000000..66651bb --- /dev/null +++ b/day1/cli-study/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/day1/cli-study/node_modules/glob/glob.js b/day1/cli-study/node_modules/glob/glob.js new file mode 100644 index 0000000..58dec0f --- /dev/null +++ b/day1/cli-study/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/day1/cli-study/node_modules/glob/package.json b/day1/cli-study/node_modules/glob/package.json new file mode 100644 index 0000000..1815f25 --- /dev/null +++ b/day1/cli-study/node_modules/glob/package.json @@ -0,0 +1,79 @@ +{ + "_from": "glob@^7.1.3", + "_id": "glob@7.1.6", + "_inBundle": false, + "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "_location": "/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^7.1.3", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^7.1.3", + "saveSpec": null, + "fetchSpec": "^7.1.3" + }, + "_requiredBy": [ + "/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "_shasum": "141f33b81a7c2492e125594307480c46679278a6", + "_spec": "glob@^7.1.3", + "_where": "F:\\前端学习\\cli-study\\node_modules\\rimraf", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.6" +} diff --git a/day1/cli-study/node_modules/glob/sync.js b/day1/cli-study/node_modules/glob/sync.js new file mode 100644 index 0000000..c952134 --- /dev/null +++ b/day1/cli-study/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/day1/cli-study/node_modules/globals/globals.json b/day1/cli-study/node_modules/globals/globals.json new file mode 100644 index 0000000..b85dc3f --- /dev/null +++ b/day1/cli-study/node_modules/globals/globals.json @@ -0,0 +1,1586 @@ +{ + "builtin": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "BigInt": false, + "BigInt64Array": false, + "BigUint64Array": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "globalThis": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es2015": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es2017": { + "Array": false, + "ArrayBuffer": false, + "Atomics": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "SharedArrayBuffer": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "browser": { + "AbortController": false, + "AbortSignal": false, + "addEventListener": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioProcessingEvent": false, + "AudioScheduledSourceNode": false, + "AudioWorkletGlobalScope ": false, + "AudioWorkletNode": false, + "AudioWorkletProcessor": false, + "BarProp": false, + "BaseAudioContext": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "BlobEvent": false, + "blur": false, + "BroadcastChannel": false, + "btoa": false, + "BudgetService": false, + "ByteLengthQueuingStrategy": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "cancelIdleCallback": false, + "CanvasCaptureMediaStreamTrack": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "ClipboardEvent": false, + "close": false, + "closed": false, + "CloseEvent": false, + "Comment": false, + "CompositionEvent": false, + "confirm": false, + "console": false, + "ConstantSourceNode": false, + "ConvolverNode": false, + "CountQueuingStrategy": false, + "createImageBitmap": false, + "Credential": false, + "CredentialsContainer": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSConditionRule": false, + "CSSFontFaceRule": false, + "CSSGroupingRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMediaRule": false, + "CSSNamespaceRule": false, + "CSSPageRule": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CustomElementRegistry": false, + "customElements": false, + "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "defaultstatus": false, + "defaultStatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMMatrix": false, + "DOMMatrixReadOnly": false, + "DOMParser": false, + "DOMPoint": false, + "DOMPointReadOnly": false, + "DOMQuad": false, + "DOMRect": false, + "DOMRectReadOnly": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "Element": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "fetch": false, + "File": false, + "FileList": false, + "FileReader": false, + "find": false, + "focus": false, + "FocusEvent": false, + "FontFace": false, + "FontFaceSetLoadEvent": false, + "FormData": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, + "GamepadEvent": false, + "getComputedStyle": false, + "getSelection": false, + "HashChangeEvent": false, + "Headers": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLLabelElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSlotElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTimeElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "IdleDeadline": false, + "IIRFilterNode": false, + "Image": false, + "ImageBitmap": false, + "ImageBitmapRenderingContext": false, + "ImageCapture": false, + "ImageData": false, + "indexedDB": false, + "innerHeight": false, + "innerWidth": false, + "InputEvent": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "Intl": false, + "isSecureContext": false, + "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, + "length": false, + "localStorage": false, + "location": true, + "Location": false, + "locationbar": false, + "matchMedia": false, + "MediaDeviceInfo": false, + "MediaDevices": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyMessageEvent": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaRecorder": false, + "MediaSettingsRange": false, + "MediaSource": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "MediaStreamTrackEvent": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "NavigationPreloadManager": false, + "navigator": false, + "Navigator": false, + "NetworkInformation": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "OffscreenCanvas": true, + "onabort": true, + "onafterprint": true, + "onanimationend": true, + "onanimationiteration": true, + "onanimationstart": true, + "onappinstalled": true, + "onauxclick": true, + "onbeforeinstallprompt": true, + "onbeforeprint": true, + "onbeforeunload": true, + "onblur": true, + "oncancel": true, + "oncanplay": true, + "oncanplaythrough": true, + "onchange": true, + "onclick": true, + "onclose": true, + "oncontextmenu": true, + "oncuechange": true, + "ondblclick": true, + "ondevicemotion": true, + "ondeviceorientation": true, + "ondeviceorientationabsolute": true, + "ondrag": true, + "ondragend": true, + "ondragenter": true, + "ondragleave": true, + "ondragover": true, + "ondragstart": true, + "ondrop": true, + "ondurationchange": true, + "onemptied": true, + "onended": true, + "onerror": true, + "onfocus": true, + "ongotpointercapture": true, + "onhashchange": true, + "oninput": true, + "oninvalid": true, + "onkeydown": true, + "onkeypress": true, + "onkeyup": true, + "onlanguagechange": true, + "onload": true, + "onloadeddata": true, + "onloadedmetadata": true, + "onloadstart": true, + "onlostpointercapture": true, + "onmessage": true, + "onmessageerror": true, + "onmousedown": true, + "onmouseenter": true, + "onmouseleave": true, + "onmousemove": true, + "onmouseout": true, + "onmouseover": true, + "onmouseup": true, + "onmousewheel": true, + "onoffline": true, + "ononline": true, + "onpagehide": true, + "onpageshow": true, + "onpause": true, + "onplay": true, + "onplaying": true, + "onpointercancel": true, + "onpointerdown": true, + "onpointerenter": true, + "onpointerleave": true, + "onpointermove": true, + "onpointerout": true, + "onpointerover": true, + "onpointerup": true, + "onpopstate": true, + "onprogress": true, + "onratechange": true, + "onrejectionhandled": true, + "onreset": true, + "onresize": true, + "onscroll": true, + "onsearch": true, + "onseeked": true, + "onseeking": true, + "onselect": true, + "onstalled": true, + "onstorage": true, + "onsubmit": true, + "onsuspend": true, + "ontimeupdate": true, + "ontoggle": true, + "ontransitionend": true, + "onunhandledrejection": true, + "onunload": true, + "onvolumechange": true, + "onwaiting": true, + "onwheel": true, + "open": false, + "openDatabase": false, + "opener": false, + "Option": false, + "origin": false, + "OscillatorNode": false, + "outerHeight": false, + "outerWidth": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "PannerNode": false, + "parent": false, + "Path2D": false, + "PaymentAddress": false, + "PaymentRequest": false, + "PaymentRequestUpdateEvent": false, + "PaymentResponse": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceLongTaskTiming": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceNavigationTiming": false, + "PerformanceObserver": false, + "PerformanceObserverEntryList": false, + "PerformancePaintTiming": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "PhotoCapabilities": false, + "Plugin": false, + "PluginArray": false, + "PointerEvent": false, + "PopStateEvent": false, + "postMessage": false, + "Presentation": false, + "PresentationAvailability": false, + "PresentationConnection": false, + "PresentationConnectionAvailableEvent": false, + "PresentationConnectionCloseEvent": false, + "PresentationConnectionList": false, + "PresentationReceiver": false, + "PresentationRequest": false, + "print": false, + "ProcessingInstruction": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "PushManager": false, + "PushSubscription": false, + "PushSubscriptionOptions": false, + "queueMicrotask": false, + "RadioNodeList": false, + "Range": false, + "ReadableStream": false, + "registerProcessor": false, + "RemotePlayback": false, + "removeEventListener": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "ResizeObserver": false, + "ResizeObserverEntry": false, + "resizeTo": false, + "Response": false, + "RTCCertificate": false, + "RTCDataChannel": false, + "RTCDataChannelEvent": false, + "RTCDtlsTransport": false, + "RTCIceCandidate": false, + "RTCIceGatherer": false, + "RTCIceTransport": false, + "RTCPeerConnection": false, + "RTCPeerConnectionIceEvent": false, + "RTCRtpContributingSource": false, + "RTCRtpReceiver": false, + "RTCRtpSender": false, + "RTCSctpTransport": false, + "RTCSessionDescription": false, + "RTCStatsReport": false, + "RTCTrackEvent": false, + "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "SharedWorker": false, + "SourceBuffer": false, + "SourceBufferList": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "StaticRange": false, + "status": false, + "statusbar": false, + "StereoPannerNode": false, + "stop": false, + "Storage": false, + "StorageEvent": false, + "StorageManager": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAngle": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGComponentTransferFunctionElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGDiscardElement": false, + "SVGElement": false, + "SVGEllipseElement": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGImageElement": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPathElement": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformList": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGUseElement": false, + "SVGViewElement": false, + "TaskAttributionTiming": false, + "Text": false, + "TextDecoder": false, + "TextEncoder": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TimeRanges": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransitionEvent": false, + "TreeWalker": false, + "UIEvent": false, + "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "visualViewport": false, + "VisualViewport": false, + "VTTCue": false, + "WaveShaperNode": false, + "WebAssembly": false, + "WebGL2RenderingContext": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLProgram": false, + "WebGLQuery": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLSampler": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLSync": false, + "WebGLTexture": false, + "WebGLTransformFeedback": false, + "WebGLUniformLocation": false, + "WebGLVertexArrayObject": false, + "WebSocket": false, + "WheelEvent": false, + "window": false, + "Window": false, + "Worker": false, + "WritableStream": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathExpression": false, + "XPathResult": false, + "XSLTProcessor": false + }, + "worker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "console": false, + "fetch": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "node": { + "__dirname": false, + "__filename": false, + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "exports": true, + "global": false, + "Intl": false, + "module": false, + "process": false, + "queueMicrotask": false, + "require": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "nodeBuiltin": { + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "global": false, + "Intl": false, + "process": false, + "queueMicrotask": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false + }, + "commonjs": { + "exports": true, + "global": false, + "module": false, + "require": false + }, + "amd": { + "define": false, + "require": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "expectAsync": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "spyOnAllFunctions": false, + "spyOnProperty": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fdescribe": false, + "fit": false, + "it": false, + "jest": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "java": false, + "Java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "wsh": { + "ActiveXObject": true, + "CollectGarbage": true, + "Debug": true, + "Enumerator": true, + "GetObject": true, + "RuntimeObject": true, + "ScriptEngine": true, + "ScriptEngineBuildVersion": true, + "ScriptEngineMajorVersion": true, + "ScriptEngineMinorVersion": true, + "VBArray": true, + "WScript": true, + "WSH": true, + "XDomainRequest": true + }, + "jquery": { + "$": false, + "jQuery": false + }, + "yui": { + "YAHOO": false, + "YAHOO_config": false, + "YUI": false, + "YUI_config": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "ln": false, + "ls": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "target": false, + "tempdir": false, + "test": false, + "touch": false, + "which": false + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "meteor": { + "_": false, + "$": false, + "Accounts": false, + "AccountsClient": false, + "AccountsCommon": false, + "AccountsServer": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPRateLimiter": false, + "DDPServer": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "serviceworker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "clearInterval": false, + "clearTimeout": false, + "Client": false, + "clients": false, + "Clients": false, + "close": true, + "console": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "fetch": false, + "FetchEvent": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": false, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onoffline": true, + "ononline": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, + "registration": false, + "removeEventListener": false, + "Request": false, + "Response": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "skipWaiting": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "WindowClient": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false + }, + "atomtest": { + "advanceClock": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findAll": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false, + "wait": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "by": false, + "By": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "clearInterval": false, + "clearTimeout": false, + "console": false, + "setInterval": false, + "setTimeout": false, + "URL": false, + "URLSearchParams": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "cloneInto": false, + "createObjectIn": false, + "exportFunction": false, + "GM": false, + "GM_addStyle": false, + "GM_deleteValue": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + }, + "devtools": { + "$": false, + "$_": false, + "$$": false, + "$0": false, + "$1": false, + "$2": false, + "$3": false, + "$4": false, + "$x": false, + "chrome": false, + "clear": false, + "copy": false, + "debug": false, + "dir": false, + "dirxml": false, + "getEventListeners": false, + "inspect": false, + "keys": false, + "monitor": false, + "monitorEvents": false, + "profile": false, + "profileEnd": false, + "queryObjects": false, + "table": false, + "undebug": false, + "unmonitor": false, + "unmonitorEvents": false, + "values": false + } +} diff --git a/day1/cli-study/node_modules/globals/index.d.ts b/day1/cli-study/node_modules/globals/index.d.ts new file mode 100644 index 0000000..a842e4c --- /dev/null +++ b/day1/cli-study/node_modules/globals/index.d.ts @@ -0,0 +1,6 @@ +import {ReadonlyDeep} from 'type-fest'; +import globalsJson = require('./globals.json'); + +declare const globals: ReadonlyDeep; + +export = globals; diff --git a/day1/cli-study/node_modules/globals/index.js b/day1/cli-study/node_modules/globals/index.js new file mode 100644 index 0000000..a951582 --- /dev/null +++ b/day1/cli-study/node_modules/globals/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./globals.json'); diff --git a/day1/cli-study/node_modules/globals/license b/day1/cli-study/node_modules/globals/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/day1/cli-study/node_modules/globals/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/day1/cli-study/node_modules/globals/package.json b/day1/cli-study/node_modules/globals/package.json new file mode 100644 index 0000000..a2168b5 --- /dev/null +++ b/day1/cli-study/node_modules/globals/package.json @@ -0,0 +1,84 @@ +{ + "_from": "globals@^12.1.0", + "_id": "globals@12.4.0", + "_inBundle": false, + "_integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "_location": "/globals", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "globals@^12.1.0", + "name": "globals", + "escapedName": "globals", + "rawSpec": "^12.1.0", + "saveSpec": null, + "fetchSpec": "^12.1.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "_shasum": "a18813576a41b00a24a97e7f815918c2e19925f8", + "_spec": "globals@^12.1.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "type-fest": "^0.8.1" + }, + "deprecated": false, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "ava": "^2.2.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts", + "globals.json" + ], + "funding": "https://github.com/sponsors/sindresorhus", + "homepage": "https://github.com/sindresorhus/globals#readme", + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "license": "MIT", + "name": "globals", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globals.git" + }, + "scripts": { + "test": "xo && ava" + }, + "tsd": { + "compilerOptions": { + "resolveJsonModule": true + } + }, + "version": "12.4.0", + "xo": { + "ignores": [ + "get-browser-globals.js" + ] + } +} diff --git a/day1/cli-study/node_modules/globals/readme.md b/day1/cli-study/node_modules/globals/readme.md new file mode 100644 index 0000000..fdcfa08 --- /dev/null +++ b/day1/cli-study/node_modules/globals/readme.md @@ -0,0 +1,56 @@ +# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) + +> Global identifiers from different JavaScript environments + +Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. + +It's just a [JSON file](globals.json), so use it in whatever environment you like. + +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + +## Install + +``` +$ npm install globals +``` + +## Usage + +```js +const globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/day1/cli-study/node_modules/got/errors.js b/day1/cli-study/node_modules/got/errors.js new file mode 100644 index 0000000..ad83388 --- /dev/null +++ b/day1/cli-study/node_modules/got/errors.js @@ -0,0 +1,92 @@ +'use strict'; +const urlLib = require('url'); +const http = require('http'); +const PCancelable = require('p-cancelable'); +const is = require('@sindresorhus/is'); + +class GotError extends Error { + constructor(message, error, opts) { + super(message); + Error.captureStackTrace(this, this.constructor); + this.name = 'GotError'; + + if (!is.undefined(error.code)) { + this.code = error.code; + } + + Object.assign(this, { + host: opts.host, + hostname: opts.hostname, + method: opts.method, + path: opts.path, + protocol: opts.protocol, + url: opts.href + }); + } +} + +module.exports.GotError = GotError; + +module.exports.CacheError = class extends GotError { + constructor(error, opts) { + super(error.message, error, opts); + this.name = 'CacheError'; + } +}; + +module.exports.RequestError = class extends GotError { + constructor(error, opts) { + super(error.message, error, opts); + this.name = 'RequestError'; + } +}; + +module.exports.ReadError = class extends GotError { + constructor(error, opts) { + super(error.message, error, opts); + this.name = 'ReadError'; + } +}; + +module.exports.ParseError = class extends GotError { + constructor(error, statusCode, opts, data) { + super(`${error.message} in "${urlLib.format(opts)}": \n${data.slice(0, 77)}...`, error, opts); + this.name = 'ParseError'; + this.statusCode = statusCode; + this.statusMessage = http.STATUS_CODES[this.statusCode]; + } +}; + +module.exports.HTTPError = class extends GotError { + constructor(statusCode, statusMessage, headers, opts) { + if (statusMessage) { + statusMessage = statusMessage.replace(/\r?\n/g, ' ').trim(); + } else { + statusMessage = http.STATUS_CODES[statusCode]; + } + super(`Response code ${statusCode} (${statusMessage})`, {}, opts); + this.name = 'HTTPError'; + this.statusCode = statusCode; + this.statusMessage = statusMessage; + this.headers = headers; + } +}; + +module.exports.MaxRedirectsError = class extends GotError { + constructor(statusCode, redirectUrls, opts) { + super('Redirected 10 times. Aborting.', {}, opts); + this.name = 'MaxRedirectsError'; + this.statusCode = statusCode; + this.statusMessage = http.STATUS_CODES[this.statusCode]; + this.redirectUrls = redirectUrls; + } +}; + +module.exports.UnsupportedProtocolError = class extends GotError { + constructor(opts) { + super(`Unsupported protocol "${opts.protocol}"`, {}, opts); + this.name = 'UnsupportedProtocolError'; + } +}; + +module.exports.CancelError = PCancelable.CancelError; diff --git a/day1/cli-study/node_modules/got/index.js b/day1/cli-study/node_modules/got/index.js new file mode 100644 index 0000000..9d83b77 --- /dev/null +++ b/day1/cli-study/node_modules/got/index.js @@ -0,0 +1,675 @@ +'use strict'; +const EventEmitter = require('events'); +const http = require('http'); +const https = require('https'); +const PassThrough = require('stream').PassThrough; +const Transform = require('stream').Transform; +const urlLib = require('url'); +const fs = require('fs'); +const querystring = require('querystring'); +const CacheableRequest = require('cacheable-request'); +const duplexer3 = require('duplexer3'); +const intoStream = require('into-stream'); +const is = require('@sindresorhus/is'); +const getStream = require('get-stream'); +const timedOut = require('timed-out'); +const urlParseLax = require('url-parse-lax'); +const urlToOptions = require('url-to-options'); +const lowercaseKeys = require('lowercase-keys'); +const decompressResponse = require('decompress-response'); +const mimicResponse = require('mimic-response'); +const isRetryAllowed = require('is-retry-allowed'); +const isURL = require('isurl'); +const PCancelable = require('p-cancelable'); +const pTimeout = require('p-timeout'); +const pify = require('pify'); +const Buffer = require('safe-buffer').Buffer; +const pkg = require('./package.json'); +const errors = require('./errors'); + +const getMethodRedirectCodes = new Set([300, 301, 302, 303, 304, 305, 307, 308]); +const allMethodRedirectCodes = new Set([300, 303, 307, 308]); + +const isFormData = body => is.nodeStream(body) && is.function(body.getBoundary); + +const getBodySize = opts => { + const body = opts.body; + + if (opts.headers['content-length']) { + return Number(opts.headers['content-length']); + } + + if (!body && !opts.stream) { + return 0; + } + + if (is.string(body)) { + return Buffer.byteLength(body); + } + + if (isFormData(body)) { + return pify(body.getLength.bind(body))(); + } + + if (body instanceof fs.ReadStream) { + return pify(fs.stat)(body.path).then(stat => stat.size); + } + + if (is.nodeStream(body) && is.buffer(body._buffer)) { + return body._buffer.length; + } + + return null; +}; + +function requestAsEventEmitter(opts) { + opts = opts || {}; + + const ee = new EventEmitter(); + const requestUrl = opts.href || urlLib.resolve(urlLib.format(opts), opts.path); + const redirects = []; + const agents = is.object(opts.agent) ? opts.agent : null; + let retryCount = 0; + let redirectUrl; + let uploadBodySize; + let uploaded = 0; + + const get = opts => { + if (opts.protocol !== 'http:' && opts.protocol !== 'https:') { + ee.emit('error', new got.UnsupportedProtocolError(opts)); + return; + } + + let fn = opts.protocol === 'https:' ? https : http; + + if (agents) { + const protocolName = opts.protocol === 'https:' ? 'https' : 'http'; + opts.agent = agents[protocolName] || opts.agent; + } + + if (opts.useElectronNet && process.versions.electron) { + const electron = require('electron'); + fn = electron.net || electron.remote.net; + } + + let progressInterval; + + const cacheableRequest = new CacheableRequest(fn.request, opts.cache); + const cacheReq = cacheableRequest(opts, res => { + clearInterval(progressInterval); + + ee.emit('uploadProgress', { + percent: 1, + transferred: uploaded, + total: uploadBodySize + }); + + const statusCode = res.statusCode; + + res.url = redirectUrl || requestUrl; + res.requestUrl = requestUrl; + + const followRedirect = opts.followRedirect && 'location' in res.headers; + const redirectGet = followRedirect && getMethodRedirectCodes.has(statusCode); + const redirectAll = followRedirect && allMethodRedirectCodes.has(statusCode); + + if (redirectAll || (redirectGet && (opts.method === 'GET' || opts.method === 'HEAD'))) { + res.resume(); + + if (statusCode === 303) { + // Server responded with "see other", indicating that the resource exists at another location, + // and the client should request it from that location via GET or HEAD. + opts.method = 'GET'; + } + + if (redirects.length >= 10) { + ee.emit('error', new got.MaxRedirectsError(statusCode, redirects, opts), null, res); + return; + } + + const bufferString = Buffer.from(res.headers.location, 'binary').toString(); + + redirectUrl = urlLib.resolve(urlLib.format(opts), bufferString); + + redirects.push(redirectUrl); + + const redirectOpts = Object.assign({}, opts, urlLib.parse(redirectUrl)); + + ee.emit('redirect', res, redirectOpts); + + get(redirectOpts); + + return; + } + + setImmediate(() => { + try { + getResponse(res, opts, ee, redirects); + } catch (e) { + ee.emit('error', e); + } + }); + }); + + cacheReq.on('error', err => { + if (err instanceof CacheableRequest.RequestError) { + ee.emit('error', new got.RequestError(err, opts)); + } else { + ee.emit('error', new got.CacheError(err, opts)); + } + }); + + cacheReq.once('request', req => { + let aborted = false; + req.once('abort', _ => { + aborted = true; + }); + + req.once('error', err => { + clearInterval(progressInterval); + + if (aborted) { + return; + } + + const backoff = opts.retries(++retryCount, err); + + if (backoff) { + setTimeout(get, backoff, opts); + return; + } + + ee.emit('error', new got.RequestError(err, opts)); + }); + + ee.once('request', req => { + ee.emit('uploadProgress', { + percent: 0, + transferred: 0, + total: uploadBodySize + }); + + const socket = req.connection; + if (socket) { + // `._connecting` was the old property which was made public in node v6.1.0 + const isConnecting = socket.connecting === undefined ? socket._connecting : socket.connecting; + + const onSocketConnect = () => { + const uploadEventFrequency = 150; + + progressInterval = setInterval(() => { + if (socket.destroyed) { + clearInterval(progressInterval); + return; + } + + const lastUploaded = uploaded; + const headersSize = req._header ? Buffer.byteLength(req._header) : 0; + uploaded = socket.bytesWritten - headersSize; + + // Prevent the known issue of `bytesWritten` being larger than body size + if (uploadBodySize && uploaded > uploadBodySize) { + uploaded = uploadBodySize; + } + + // Don't emit events with unchanged progress and + // prevent last event from being emitted, because + // it's emitted when `response` is emitted + if (uploaded === lastUploaded || uploaded === uploadBodySize) { + return; + } + + ee.emit('uploadProgress', { + percent: uploadBodySize ? uploaded / uploadBodySize : 0, + transferred: uploaded, + total: uploadBodySize + }); + }, uploadEventFrequency); + }; + + // Only subscribe to 'connect' event if we're actually connecting a new + // socket, otherwise if we're already connected (because this is a + // keep-alive connection) do not bother. This is important since we won't + // get a 'connect' event for an already connected socket. + if (isConnecting) { + socket.once('connect', onSocketConnect); + } else { + onSocketConnect(); + } + } + }); + + if (opts.gotTimeout) { + clearInterval(progressInterval); + timedOut(req, opts.gotTimeout); + } + + setImmediate(() => { + ee.emit('request', req); + }); + }); + }; + + setImmediate(() => { + Promise.resolve(getBodySize(opts)) + .then(size => { + uploadBodySize = size; + + if ( + is.undefined(opts.headers['content-length']) && + is.undefined(opts.headers['transfer-encoding']) && + isFormData(opts.body) + ) { + opts.headers['content-length'] = size; + } + + get(opts); + }) + .catch(err => { + ee.emit('error', err); + }); + }); + + return ee; +} + +function getResponse(res, opts, ee, redirects) { + const downloadBodySize = Number(res.headers['content-length']) || null; + let downloaded = 0; + + const progressStream = new Transform({ + transform(chunk, encoding, callback) { + downloaded += chunk.length; + + const percent = downloadBodySize ? downloaded / downloadBodySize : 0; + + // Let flush() be responsible for emitting the last event + if (percent < 1) { + ee.emit('downloadProgress', { + percent, + transferred: downloaded, + total: downloadBodySize + }); + } + + callback(null, chunk); + }, + + flush(callback) { + ee.emit('downloadProgress', { + percent: 1, + transferred: downloaded, + total: downloadBodySize + }); + + callback(); + } + }); + + mimicResponse(res, progressStream); + progressStream.redirectUrls = redirects; + + const response = opts.decompress === true && + is.function(decompressResponse) && + opts.method !== 'HEAD' ? decompressResponse(progressStream) : progressStream; + + if (!opts.decompress && ['gzip', 'deflate'].indexOf(res.headers['content-encoding']) !== -1) { + opts.encoding = null; + } + + ee.emit('response', response); + + ee.emit('downloadProgress', { + percent: 0, + transferred: 0, + total: downloadBodySize + }); + + res.pipe(progressStream); +} + +function asPromise(opts) { + const timeoutFn = requestPromise => opts.gotTimeout && opts.gotTimeout.request ? + pTimeout(requestPromise, opts.gotTimeout.request, new got.RequestError({message: 'Request timed out', code: 'ETIMEDOUT'}, opts)) : + requestPromise; + + const proxy = new EventEmitter(); + + const cancelable = new PCancelable((resolve, reject, onCancel) => { + const ee = requestAsEventEmitter(opts); + let cancelOnRequest = false; + + onCancel(() => { + cancelOnRequest = true; + }); + + ee.on('request', req => { + if (cancelOnRequest) { + req.abort(); + } + + onCancel(() => { + req.abort(); + }); + + if (is.nodeStream(opts.body)) { + opts.body.pipe(req); + opts.body = undefined; + return; + } + + req.end(opts.body); + }); + + ee.on('response', res => { + const stream = is.null(opts.encoding) ? getStream.buffer(res) : getStream(res, opts); + + stream + .catch(err => reject(new got.ReadError(err, opts))) + .then(data => { + const statusCode = res.statusCode; + const limitStatusCode = opts.followRedirect ? 299 : 399; + + res.body = data; + + if (opts.json && res.body) { + try { + res.body = JSON.parse(res.body); + } catch (err) { + if (statusCode >= 200 && statusCode < 300) { + throw new got.ParseError(err, statusCode, opts, data); + } + } + } + + if (opts.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) { + throw new got.HTTPError(statusCode, res.statusMessage, res.headers, opts); + } + + resolve(res); + }) + .catch(err => { + Object.defineProperty(err, 'response', {value: res}); + reject(err); + }); + }); + + ee.once('error', reject); + ee.on('redirect', proxy.emit.bind(proxy, 'redirect')); + ee.on('uploadProgress', proxy.emit.bind(proxy, 'uploadProgress')); + ee.on('downloadProgress', proxy.emit.bind(proxy, 'downloadProgress')); + }); + + // Preserve backwards-compatibility + // TODO: Remove this in the next major version + Object.defineProperty(cancelable, 'canceled', { + get() { + return cancelable.isCanceled; + } + }); + + const promise = timeoutFn(cancelable); + + promise.cancel = cancelable.cancel.bind(cancelable); + + promise.on = (name, fn) => { + proxy.on(name, fn); + return promise; + }; + + return promise; +} + +function asStream(opts) { + opts.stream = true; + + const input = new PassThrough(); + const output = new PassThrough(); + const proxy = duplexer3(input, output); + let timeout; + + if (opts.gotTimeout && opts.gotTimeout.request) { + timeout = setTimeout(() => { + proxy.emit('error', new got.RequestError({message: 'Request timed out', code: 'ETIMEDOUT'}, opts)); + }, opts.gotTimeout.request); + } + + if (opts.json) { + throw new Error('Got can not be used as a stream when the `json` option is used'); + } + + if (opts.body) { + proxy.write = () => { + throw new Error('Got\'s stream is not writable when the `body` option is used'); + }; + } + + const ee = requestAsEventEmitter(opts); + + ee.on('request', req => { + proxy.emit('request', req); + + if (is.nodeStream(opts.body)) { + opts.body.pipe(req); + return; + } + + if (opts.body) { + req.end(opts.body); + return; + } + + if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { + input.pipe(req); + return; + } + + req.end(); + }); + + ee.on('response', res => { + clearTimeout(timeout); + + const statusCode = res.statusCode; + + res.on('error', err => { + proxy.emit('error', new got.ReadError(err, opts)); + }); + + res.pipe(output); + + if (opts.throwHttpErrors && statusCode !== 304 && (statusCode < 200 || statusCode > 299)) { + proxy.emit('error', new got.HTTPError(statusCode, res.statusMessage, res.headers, opts), null, res); + return; + } + + proxy.emit('response', res); + }); + + ee.on('error', proxy.emit.bind(proxy, 'error')); + ee.on('redirect', proxy.emit.bind(proxy, 'redirect')); + ee.on('uploadProgress', proxy.emit.bind(proxy, 'uploadProgress')); + ee.on('downloadProgress', proxy.emit.bind(proxy, 'downloadProgress')); + + return proxy; +} + +function normalizeArguments(url, opts) { + if (!is.string(url) && !is.object(url)) { + throw new TypeError(`Parameter \`url\` must be a string or object, not ${is(url)}`); + } else if (is.string(url)) { + url = url.replace(/^unix:/, 'http://$&'); + + try { + decodeURI(url); + } catch (err) { + throw new Error('Parameter `url` must contain valid UTF-8 character sequences'); + } + + url = urlParseLax(url); + if (url.auth) { + throw new Error('Basic authentication must be done with the `auth` option'); + } + } else if (isURL.lenient(url)) { + url = urlToOptions(url); + } + + opts = Object.assign( + { + path: '', + retries: 2, + cache: false, + decompress: true, + useElectronNet: false, + throwHttpErrors: true + }, + url, + { + protocol: url.protocol || 'http:' // Override both null/undefined with default protocol + }, + opts + ); + + const headers = lowercaseKeys(opts.headers); + for (const key of Object.keys(headers)) { + if (is.nullOrUndefined(headers[key])) { + delete headers[key]; + } + } + + opts.headers = Object.assign({ + 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)` + }, headers); + + if (opts.decompress && is.undefined(opts.headers['accept-encoding'])) { + opts.headers['accept-encoding'] = 'gzip, deflate'; + } + + const query = opts.query; + + if (query) { + if (!is.string(query)) { + opts.query = querystring.stringify(query); + } + + opts.path = `${opts.path.split('?')[0]}?${opts.query}`; + delete opts.query; + } + + if (opts.json && is.undefined(opts.headers.accept)) { + opts.headers.accept = 'application/json'; + } + + const body = opts.body; + if (is.nullOrUndefined(body)) { + opts.method = (opts.method || 'GET').toUpperCase(); + } else { + const headers = opts.headers; + if (!is.nodeStream(body) && !is.string(body) && !is.buffer(body) && !(opts.form || opts.json)) { + throw new TypeError('The `body` option must be a stream.Readable, string, Buffer or plain Object'); + } + + const canBodyBeStringified = is.plainObject(body) || is.array(body); + if ((opts.form || opts.json) && !canBodyBeStringified) { + throw new TypeError('The `body` option must be a plain Object or Array when the `form` or `json` option is used'); + } + + if (isFormData(body)) { + // Special case for https://github.com/form-data/form-data + headers['content-type'] = headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`; + } else if (opts.form && canBodyBeStringified) { + headers['content-type'] = headers['content-type'] || 'application/x-www-form-urlencoded'; + opts.body = querystring.stringify(body); + } else if (opts.json && canBodyBeStringified) { + headers['content-type'] = headers['content-type'] || 'application/json'; + opts.body = JSON.stringify(body); + } + + if (is.undefined(headers['content-length']) && is.undefined(headers['transfer-encoding']) && !is.nodeStream(body)) { + const length = is.string(opts.body) ? Buffer.byteLength(opts.body) : opts.body.length; + headers['content-length'] = length; + } + + // Convert buffer to stream to receive upload progress events + // see https://github.com/sindresorhus/got/pull/322 + if (is.buffer(body)) { + opts.body = intoStream(body); + opts.body._buffer = body; + } + + opts.method = (opts.method || 'POST').toUpperCase(); + } + + if (opts.hostname === 'unix') { + const matches = /(.+?):(.+)/.exec(opts.path); + + if (matches) { + opts.socketPath = matches[1]; + opts.path = matches[2]; + opts.host = null; + } + } + + if (!is.function(opts.retries)) { + const retries = opts.retries; + + opts.retries = (iter, err) => { + if (iter > retries || !isRetryAllowed(err)) { + return 0; + } + + const noise = Math.random() * 100; + + return ((1 << iter) * 1000) + noise; + }; + } + + if (is.undefined(opts.followRedirect)) { + opts.followRedirect = true; + } + + if (opts.timeout) { + if (is.number(opts.timeout)) { + opts.gotTimeout = {request: opts.timeout}; + } else { + opts.gotTimeout = opts.timeout; + } + delete opts.timeout; + } + + return opts; +} + +function got(url, opts) { + try { + const normalizedArgs = normalizeArguments(url, opts); + + if (normalizedArgs.stream) { + return asStream(normalizedArgs); + } + + return asPromise(normalizedArgs); + } catch (err) { + return Promise.reject(err); + } +} + +got.stream = (url, opts) => asStream(normalizeArguments(url, opts)); + +const methods = [ + 'get', + 'post', + 'put', + 'patch', + 'head', + 'delete' +]; + +for (const method of methods) { + got[method] = (url, opts) => got(url, Object.assign({}, opts, {method})); + got.stream[method] = (url, opts) => got.stream(url, Object.assign({}, opts, {method})); +} + +Object.assign(got, errors); + +module.exports = got; diff --git a/day1/cli-study/node_modules/got/license b/day1/cli-study/node_modules/got/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/got/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/got/package.json b/day1/cli-study/node_modules/got/package.json new file mode 100644 index 0000000..5e90eec --- /dev/null +++ b/day1/cli-study/node_modules/got/package.json @@ -0,0 +1,127 @@ +{ + "_from": "got@^8.3.1", + "_id": "got@8.3.2", + "_inBundle": false, + "_integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", + "_location": "/got", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "got@^8.3.1", + "name": "got", + "escapedName": "got", + "rawSpec": "^8.3.1", + "saveSpec": null, + "fetchSpec": "^8.3.1" + }, + "_requiredBy": [ + "/download" + ], + "_resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "_shasum": "1d23f64390e97f776cac52e5b936e5f514d2e937", + "_spec": "got@^8.3.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\download", + "ava": { + "concurrency": 4 + }, + "browser": { + "decompress-response": false, + "electron": false + }, + "bugs": { + "url": "https://github.com/sindresorhus/got/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@sindresorhus/is": "^0.7.0", + "cacheable-request": "^2.1.1", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "into-stream": "^3.1.0", + "is-retry-allowed": "^1.1.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "mimic-response": "^1.0.0", + "p-cancelable": "^0.4.0", + "p-timeout": "^2.0.1", + "pify": "^3.0.0", + "safe-buffer": "^5.1.1", + "timed-out": "^4.0.1", + "url-parse-lax": "^3.0.0", + "url-to-options": "^1.0.1" + }, + "deprecated": false, + "description": "Simplified HTTP requests", + "devDependencies": { + "ava": "^0.25.0", + "coveralls": "^3.0.0", + "form-data": "^2.1.1", + "get-port": "^3.0.0", + "nyc": "^11.0.2", + "p-event": "^1.3.0", + "pem": "^1.4.4", + "proxyquire": "^1.8.0", + "sinon": "^4.0.0", + "slow-stream": "0.0.4", + "tempfile": "^2.0.0", + "tempy": "^0.2.1", + "universal-url": "1.0.0-alpha", + "xo": "^0.20.0" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "errors.js" + ], + "homepage": "https://github.com/sindresorhus/got#readme", + "keywords": [ + "http", + "https", + "get", + "got", + "url", + "uri", + "request", + "util", + "utility", + "simple", + "curl", + "wget", + "fetch", + "net", + "network", + "electron" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + { + "name": "Alexander Tesfamichael", + "email": "alex.tesfamichael@gmail.com", + "url": "alextes.me" + } + ], + "name": "got", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/got.git" + }, + "scripts": { + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc ava" + }, + "version": "8.3.2" +} diff --git a/day1/cli-study/node_modules/got/readme.md b/day1/cli-study/node_modules/got/readme.md new file mode 100644 index 0000000..2347077 --- /dev/null +++ b/day1/cli-study/node_modules/got/readme.md @@ -0,0 +1,650 @@ +
+
+
+ Got +
+
+
+

Huge thanks to for sponsoring me! +

+
+
+
+ +> Simplified HTTP requests + +[![Build Status](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/got?branch=master) [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) + +A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module. + +Created because [`request`](https://github.com/request/request) is bloated *(several megabytes!)*. + + +## Highlights + +- [Promise & stream API](#api) +- [Request cancelation](#aborting-the-request) +- [RFC compliant caching](#cache-adapters) +- [Follows redirects](#followredirect) +- [Retries on network failure](#retries) +- [Progress events](#onuploadprogress-progress) +- [Handles gzip/deflate](#decompress) +- [Timeout handling](#timeout) +- [Errors with metadata](#errors) +- [JSON mode](#json) +- [WHATWG URL support](#url) +- [Electron support](#useelectronnet) + + +## Install + +``` +$ npm install got +``` + + + + + + +## Usage + +```js +const got = require('got'); + +(async () => { + try { + const response = await got('sindresorhus.com'); + console.log(response.body); + //=> ' ...' + } catch (error) { + console.log(error.response.body); + //=> 'Internal server error ...' + } +})(); +``` + +###### Streams + +```js +const fs = require('fs'); +const got = require('got'); + +got.stream('sindresorhus.com').pipe(fs.createWriteStream('index.html')); + +// For POST, PUT, and PATCH methods `got.stream` returns a `stream.Writable` +fs.createReadStream('index.html').pipe(got.stream.post('sindresorhus.com')); +``` + + +### API + +It's a `GET` request by default, but can be changed by using different methods or in the `options`. + +#### got(url, [options]) + +Returns a Promise for a `response` object with a `body` property, a `url` property with the request URL or the final URL after redirects, and a `requestUrl` property with the original request URL. + +The response object will normally be a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage), however if returned from the cache it will be a [responselike object](https://github.com/lukechilds/responselike) which behaves in the same way. + +The response will also have a `fromCache` property set with a boolean value. + +##### url + +Type: `string` `Object` + +The URL to request as simple string, a [`http.request` options](https://nodejs.org/api/http.html#http_http_request_options_callback), or a [WHATWG `URL`](https://nodejs.org/api/url.html#url_class_url). + +Properties from `options` will override properties in the parsed `url`. + +If no protocol is specified, it will default to `https`. + +##### options + +Type: `Object` + +Any of the [`http.request`](http://nodejs.org/api/http.html#http_http_request_options_callback) options. + +###### stream + +Type: `boolean`
+Default: `false` + +Returns a `Stream` instead of a `Promise`. This is equivalent to calling `got.stream(url, [options])`. + +###### body + +Type: `string` `Buffer` `stream.Readable` + +*This is mutually exclusive with stream mode.* + +Body that will be sent with a `POST` request. + +If present in `options` and `options.method` is not set, `options.method` will be set to `POST`. + +If `content-length` or `transfer-encoding` is not set in `options.headers` and `body` is a string or buffer, `content-length` will be set to the body length. + +###### encoding + +Type: `string` `null`
+Default: `'utf8'` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings) to be used on `setEncoding` of the response data. If `null`, the body is returned as a [`Buffer`](https://nodejs.org/api/buffer.html) (binary data). + +###### form + +Type: `boolean`
+Default: `false` + +*This is mutually exclusive with stream mode.* + +If set to `true` and `Content-Type` header is not set, it will be set to `application/x-www-form-urlencoded`. + +`body` must be a plain object or array and will be stringified. + +###### json + +Type: `boolean`
+Default: `false` + +*This is mutually exclusive with stream mode.* + +If set to `true` and `Content-Type` header is not set, it will be set to `application/json`. + +Parse response body with `JSON.parse` and set `accept` header to `application/json`. If used in conjunction with the `form` option, the `body` will the stringified as querystring and the response parsed as JSON. + +`body` must be a plain object or array and will be stringified. + +###### query + +Type: `string` `Object`
+ +Query string object that will be added to the request URL. This will override the query string in `url`. + +###### timeout + +Type: `number` `Object` + +Milliseconds to wait for the server to end the response before aborting request with `ETIMEDOUT` error. + +This also accepts an object with separate `connect`, `socket`, and `request` fields for connection, socket, and entire request timeouts. + +###### retries + +Type: `number` `Function`
+Default: `2` + +Number of request retries when network errors happens. Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0). + +Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry). + +**Note:** if `retries` is `number`, `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module). + +###### followRedirect + +Type: `boolean`
+Default: `true` + +Defines if redirect responses should be followed automatically. + +Note that if a `303` is sent by the server in response to any request type (`POST`, `DELETE`, etc.), got will automatically +request the resource pointed to in the location header via `GET`. This is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4). + +###### decompress + +Type: `boolean`
+Default: `true` + +Decompress the response automatically. This will set the `accept-encoding` header to `gzip, deflate` unless you set it yourself. + +If this is disabled, a compressed response is returned as a `Buffer`. This may be useful if you want to handle decompression yourself or stream the raw compressed data. + +###### cache + +Type: `Object`
+Default: `false` + +[Cache adapter instance](#cache-adapters) for storing cached data. + +###### useElectronNet + +Type: `boolean`
+Default: `false` + +When used in Electron, Got will use [`electron.net`](https://electronjs.org/docs/api/net/) instead of the Node.js `http` module. According to the Electron docs, it should be fully compatible, but it's not entirely. See [#315](https://github.com/sindresorhus/got/issues/315). + +###### throwHttpErrors + +Type: `boolean`
+Default: `true` + +Determines if a `got.HTTPError` is thrown for error responses (non-2xx status codes). + +If this is disabled, requests that encounter an error status code will be resolved with the `response` instead of throwing. This may be useful if you are checking for resource availability and are expecting error responses. + +#### Streams + +#### got.stream(url, [options]) + +`stream` method will return Duplex stream with additional events: + +##### .on('request', request) + +`request` event to get the request object of the request. + +**Tip**: You can use `request` event to abort request: + +```js +got.stream('github.com') + .on('request', req => setTimeout(() => req.abort(), 50)); +``` + +##### .on('response', response) + +`response` event to get the response object of the final request. + +##### .on('redirect', response, nextOptions) + +`redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location. + +##### .on('uploadProgress', progress) +##### .on('downloadProgress', progress) + +Progress events for uploading (sending request) and downloading (receiving response). The `progress` argument is an object like: + +```js +{ + percent: 0.1, + transferred: 1024, + total: 10240 +} +``` + +If it's not possible to retrieve the body size (can happen when streaming), `total` will be `null`. + +**Note**: Progress events can also be used with promises. + +```js +(async () => { + const response = await got('sindresorhus.com') + .on('downloadProgress', progress => { + // Report download progress + }) + .on('uploadProgress', progress => { + // Report upload progress + }); + + console.log(response); +})(); +``` + +##### .on('error', error, body, response) + +`error` event emitted in case of protocol error (like `ENOTFOUND` etc.) or status error (4xx or 5xx). The second argument is the body of the server response in case of status error. The third argument is response object. + +#### got.get(url, [options]) +#### got.post(url, [options]) +#### got.put(url, [options]) +#### got.patch(url, [options]) +#### got.head(url, [options]) +#### got.delete(url, [options]) + +Sets `options.method` to the method name and makes a request. + + +## Errors + +Each error contains (if available) `statusCode`, `statusMessage`, `host`, `hostname`, `method`, `path`, `protocol` and `url` properties to make debugging easier. + +In Promise mode, the `response` is attached to the error. + +#### got.CacheError + +When a cache method fails, for example if the database goes down, or there's a filesystem error. + +#### got.RequestError + +When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. + +#### got.ReadError + +When reading from response stream fails. + +#### got.ParseError + +When `json` option is enabled, server response code is 2xx, and `JSON.parse` fails. + +#### got.HTTPError + +When server response code is not 2xx. Includes `statusCode`, `statusMessage`, and `redirectUrls` properties. + +#### got.MaxRedirectsError + +When server redirects you more than 10 times. Includes a `redirectUrls` property, which is an array of the URLs Got was redirected to before giving up. + +#### got.UnsupportedProtocolError + +When given an unsupported protocol. + +#### got.CancelError + +When the request is aborted with `.cancel()`. + + +## Aborting the request + +The promise returned by Got has a [`.cancel()`](https://github.com/sindresorhus/p-cancelable) method which, when called, aborts the request. + +```js +(async () => { + const request = got(url, options); + + … + + // In another part of the code + if (something) { + request.cancel(); + } + + … + + try { + await request; + } catch (error) { + if (request.isCanceled) { // Or `error instanceof got.CancelError` + // Handle cancelation + } + + // Handle other errors + } +})(); +``` + + +## Cache + +Got implements [RFC 7234](http://httpwg.org/specs/rfc7234.html) compliant HTTP caching which works out of the box in memory or is easily pluggable with a wide range of storage adapters. Fresh cache entries are served directly from cache and stale cache entries are revalidated with `If-None-Match`/`If-Modified-Since` headers. You can read more about the underlying cache behaviour in the `cacheable-request` [documentation](https://github.com/lukechilds/cacheable-request). + +You can use the JavaScript `Map` type as an in memory cache: + +```js +const got = require('got'); +const map = new Map(); + +(async () => { + let response = await got('sindresorhus.com', {cache: map}); + console.log(response.fromCache); + //=> false + + response = await got('sindresorhus.com', {cache: map}); + console.log(response.fromCache); + //=> true +})(); +``` + +Got uses [Keyv](https://github.com/lukechilds/keyv) internally to support a wide range of storage adapters. For something more scalable you could use an [official Keyv storage adapter](https://github.com/lukechilds/keyv#official-storage-adapters): + +``` +$ npm install @keyv/redis +``` + +```js +const got = require('got'); +const KeyvRedis = require('@keyv/redis'); + +const redis = new KeyvRedis('redis://user:pass@localhost:6379'); + +got('sindresorhus.com', {cache: redis}); +``` + +Got supports anything that follows the Map API, so it's easy to write your own storage adapter or use a third-party solution. + +For example, the following are all valid storage adapters: + +```js +const storageAdapter = new Map(); +// or +const storageAdapter = require('./my-storage-adapter'); +// or +const QuickLRU = require('quick-lru'); +const storageAdapter = new QuickLRU({maxSize: 1000}); + +got('sindresorhus.com', {cache: storageAdapter}); +``` + +View the [Keyv docs](https://github.com/lukechilds/keyv) for more information on how to use storage adapters. + + +## Proxies + +You can use the [`tunnel`](https://github.com/koichik/node-tunnel) module with the `agent` option to work with proxies: + +```js +const got = require('got'); +const tunnel = require('tunnel'); + +got('sindresorhus.com', { + agent: tunnel.httpOverHttp({ + proxy: { + host: 'localhost' + } + }) +}); +``` + +If you require different agents for different protocols, you can pass a map of agents to the `agent` option. This is necessary because a request to one protocol might redirect to another. In such a scenario, `got` will switch over to the right protocol agent for you. + +```js +const got = require('got'); +const HttpAgent = require('agentkeepalive'); +const HttpsAgent = HttpAgent.HttpsAgent; + +got('sindresorhus.com', { + agent: { + http: new HttpAgent(), + https: new HttpsAgent() + } +}); +``` + + +## Cookies + +You can use the [`cookie`](https://github.com/jshttp/cookie) module to include cookies in a request: + +```js +const got = require('got'); +const cookie = require('cookie'); + +got('google.com', { + headers: { + cookie: cookie.serialize('foo', 'bar') + } +}); +``` + + +## Form data + +You can use the [`form-data`](https://github.com/form-data/form-data) module to create POST request with form data: + +```js +const fs = require('fs'); +const got = require('got'); +const FormData = require('form-data'); +const form = new FormData(); + +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +got.post('google.com', { + body: form +}); +``` + + +## OAuth + +You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to create a signed OAuth request: + +```js +const got = require('got'); +const crypto = require('crypto'); +const OAuth = require('oauth-1.0a'); + +const oauth = OAuth({ + consumer: { + key: process.env.CONSUMER_KEY, + secret: process.env.CONSUMER_SECRET + }, + signature_method: 'HMAC-SHA1', + hash_function: (baseString, key) => crypto.createHmac('sha1', key).update(baseString).digest('base64') +}); + +const token = { + key: process.env.ACCESS_TOKEN, + secret: process.env.ACCESS_TOKEN_SECRET +}; + +const url = 'https://api.twitter.com/1.1/statuses/home_timeline.json'; + +got(url, { + headers: oauth.toHeader(oauth.authorize({url, method: 'GET'}, token)), + json: true +}); +``` + + +## Unix Domain Sockets + +Requests can also be sent via [unix domain sockets](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket). Use the following URL scheme: `PROTOCOL://unix:SOCKET:PATH`. + +- `PROTOCOL` - `http` or `https` *(optional)* +- `SOCKET` - absolute path to a unix domain socket, e.g. `/var/run/docker.sock` +- `PATH` - request path, e.g. `/v2/keys` + +```js +got('http://unix:/var/run/docker.sock:/containers/json'); + +// or without protocol (http by default) +got('unix:/var/run/docker.sock:/containers/json'); +``` + +## AWS + +Requests to AWS services need to have their headers signed. This can be accomplished by using the [`aws4`](https://www.npmjs.com/package/aws4) package. This is an example for querying an ["Elasticsearch Service"](https://aws.amazon.com/elasticsearch-service/) host with a signed request. + +```js +const url = require('url'); +const AWS = require('aws-sdk'); +const aws4 = require('aws4'); +const got = require('got'); +const config = require('./config'); + +// Reads keys from the environment or `~/.aws/credentials`. Could be a plain object. +const awsConfig = new AWS.Config({ region: config.region }); + +function request(uri, options) { + const awsOpts = { + region: awsConfig.region, + headers: { + accept: 'application/json', + 'content-type': 'application/json' + }, + method: 'GET', + json: true + }; + + // We need to parse the URL before passing it to `got` so `aws4` can sign the request + const opts = Object.assign(url.parse(uri), awsOpts, options); + aws4.sign(opts, awsConfig.credentials); + + return got(opts); +} + +request(`https://${config.host}/production/users/1`); + +request(`https://${config.host}/production/`, { + // All usual `got` options +}); +``` + + +## Testing + +You can test your requests by using the [`nock`](https://github.com/node-nock/nock) module to mock an endpoint: + +```js +const got = require('got'); +const nock = require('nock'); + +nock('https://sindresorhus.com') + .get('/') + .reply(200, 'Hello world!'); + +(async () => { + const response = await got('sindresorhus.com'); + console.log(response.body); + //=> 'Hello world!' +})(); +``` + +If you need real integration tests you can use [`create-test-server`](https://github.com/lukechilds/create-test-server): + +```js +const got = require('got'); +const createTestServer = require('create-test-server'); + +(async () => { + const server = await createTestServer(); + server.get('/', 'Hello world!'); + + const response = await got(server.url); + console.log(response.body); + //=> 'Hello world!' + + await server.close(); +})(); +``` + + +## Tips + +### User Agent + +It's a good idea to set the `'user-agent'` header so the provider can more easily see how their resource is used. By default, it's the URL to this repo. + +```js +const got = require('got'); +const pkg = require('./package.json'); + +got('sindresorhus.com', { + headers: { + 'user-agent': `my-module/${pkg.version} (https://github.com/username/my-module)` + } +}); +``` + +### 304 Responses + +Bear in mind, if you send an `if-modified-since` header and receive a `304 Not Modified` response, the body will be empty. It's your responsibility to cache and retrieve the body contents. + + +## Related + +- [gh-got](https://github.com/sindresorhus/gh-got) - Got convenience wrapper to interact with the GitHub API +- [gl-got](https://github.com/singapore/gl-got) - Got convenience wrapper to interact with the GitLab API +- [travis-got](https://github.com/samverschueren/travis-got) - Got convenience wrapper to interact with the Travis API +- [graphql-got](https://github.com/kevva/graphql-got) - Got convenience wrapper to interact with GraphQL +- [GotQL](https://github.com/khaosdoctor/gotql) - Got convenience wrapper to interact with GraphQL using JSON-parsed queries instead of strings + + +## Created by + +[![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](https://sindresorhus.com) | [![Vsevolod Strukchinsky](https://github.com/floatdrop.png?size=100)](https://github.com/floatdrop) | [![Alexander Tesfamichael](https://github.com/AlexTes.png?size=100)](https://github.com/AlexTes) | [![Luke Childs](https://github.com/lukechilds.png?size=100)](https://github.com/lukechilds) +---|---|---|--- +[Sindre Sorhus](https://sindresorhus.com) | [Vsevolod Strukchinsky](https://github.com/floatdrop) | [Alexander Tesfamichael](https://alextes.me) | [Luke Childs](https://github.com/lukechilds) + + +## License + +MIT diff --git a/day1/cli-study/node_modules/graceful-fs/LICENSE b/day1/cli-study/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..9d2c803 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, 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. diff --git a/day1/cli-study/node_modules/graceful-fs/README.md b/day1/cli-study/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..5273a50 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/day1/cli-study/node_modules/graceful-fs/clone.js b/day1/cli-study/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..028356c --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/clone.js @@ -0,0 +1,19 @@ +'use strict' + +module.exports = clone + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/day1/cli-study/node_modules/graceful-fs/graceful-fs.js b/day1/cli-study/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..de3df47 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,354 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + retry() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + retry() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) +} + +function retry () { + var elem = fs[gracefulQueue].shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/day1/cli-study/node_modules/graceful-fs/legacy-streams.js b/day1/cli-study/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/day1/cli-study/node_modules/graceful-fs/package.json b/day1/cli-study/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..3a830b7 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/package.json @@ -0,0 +1,82 @@ +{ + "_from": "graceful-fs@^4.1.10", + "_id": "graceful-fs@4.2.4", + "_inBundle": false, + "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "_location": "/graceful-fs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "graceful-fs@^4.1.10", + "name": "graceful-fs", + "escapedName": "graceful-fs", + "rawSpec": "^4.1.10", + "saveSpec": null, + "fetchSpec": "^4.1.10" + }, + "_requiredBy": [ + "/decompress", + "/fs-extra", + "/jsonfile", + "/klaw" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", + "_spec": "graceful-fs@^4.1.10", + "_where": "F:\\前端学习\\cli-study\\node_modules\\decompress", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^12.7.0" + }, + "directories": { + "test": "test" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "name": "graceful-fs", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "node test.js | tap -" + }, + "version": "4.2.4" +} diff --git a/day1/cli-study/node_modules/graceful-fs/polyfills.js b/day1/cli-study/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..a5808d2 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,342 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + read.__proto__ = fs$read + return read + })(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/day1/cli-study/node_modules/graceful-readlink/.npmignore b/day1/cli-study/node_modules/graceful-readlink/.npmignore new file mode 100644 index 0000000..3ac7d16 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/.npmignore @@ -0,0 +1,3 @@ +.idea/ +.DS_Store +node_modules/ diff --git a/day1/cli-study/node_modules/graceful-readlink/.travis.yml b/day1/cli-study/node_modules/graceful-readlink/.travis.yml new file mode 100644 index 0000000..baf9be7 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "io.js" diff --git a/day1/cli-study/node_modules/graceful-readlink/LICENSE b/day1/cli-study/node_modules/graceful-readlink/LICENSE new file mode 100644 index 0000000..d1f842f --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Zhiye Li + +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. + diff --git a/day1/cli-study/node_modules/graceful-readlink/README.md b/day1/cli-study/node_modules/graceful-readlink/README.md new file mode 100644 index 0000000..fc63b50 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/README.md @@ -0,0 +1,17 @@ +# graceful-readlink +[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) +[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink) + + +## Usage + +```js +var readlinkSync = require('graceful-readlink').readlinkSync; +console.log(readlinkSync(f)); +// output +// the file pointed to when `f` is a symbolic link +// the `f` itself when `f` is not a symbolic link +``` +## Licence + +MIT License diff --git a/day1/cli-study/node_modules/graceful-readlink/index.js b/day1/cli-study/node_modules/graceful-readlink/index.js new file mode 100644 index 0000000..7e9fc70 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/index.js @@ -0,0 +1,12 @@ +var fs = require('fs') + , lstat = fs.lstatSync; + +exports.readlinkSync = function (p) { + if (lstat(p).isSymbolicLink()) { + return fs.readlinkSync(p); + } else { + return p; + } +}; + + diff --git a/day1/cli-study/node_modules/graceful-readlink/package.json b/day1/cli-study/node_modules/graceful-readlink/package.json new file mode 100644 index 0000000..23f4f07 --- /dev/null +++ b/day1/cli-study/node_modules/graceful-readlink/package.json @@ -0,0 +1,50 @@ +{ + "_from": "graceful-readlink@>= 1.0.0", + "_id": "graceful-readlink@1.0.1", + "_inBundle": false, + "_integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "_location": "/graceful-readlink", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "graceful-readlink@>= 1.0.0", + "name": "graceful-readlink", + "escapedName": "graceful-readlink", + "rawSpec": ">= 1.0.0", + "saveSpec": null, + "fetchSpec": ">= 1.0.0" + }, + "_requiredBy": [ + "/seek-bzip/commander" + ], + "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", + "_spec": "graceful-readlink@>= 1.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\seek-bzip\\node_modules\\commander", + "author": { + "name": "zhiyelee" + }, + "bugs": { + "url": "https://github.com/zhiyelee/graceful-readlink/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "graceful fs.readlink", + "homepage": "https://github.com/zhiyelee/graceful-readlink", + "keywords": [ + "fs.readlink", + "readlink" + ], + "license": "MIT", + "main": "index.js", + "name": "graceful-readlink", + "repository": { + "type": "git", + "url": "git://github.com/zhiyelee/graceful-readlink.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.1" +} diff --git a/day1/cli-study/node_modules/gray-matter/LICENSE b/day1/cli-study/node_modules/gray-matter/LICENSE new file mode 100644 index 0000000..d734237 --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +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. diff --git a/day1/cli-study/node_modules/gray-matter/README.md b/day1/cli-study/node_modules/gray-matter/README.md new file mode 100644 index 0000000..b20e6d6 --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/README.md @@ -0,0 +1,347 @@ +# gray-matter [![NPM version](https://img.shields.io/npm/v/gray-matter.svg?style=flat)](https://www.npmjs.com/package/gray-matter) [![NPM monthly downloads](https://img.shields.io/npm/dm/gray-matter.svg?style=flat)](https://npmjs.org/package/gray-matter) [![NPM total downloads](https://img.shields.io/npm/dt/gray-matter.svg?style=flat)](https://npmjs.org/package/gray-matter) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gray-matter.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/gray-matter) + +> Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and many other projects. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save gray-matter +``` + +See the [benchmarks](#benchmarks). gray-matter is 20-30x faster than [front-matter](https://github.com/jxson/front-matter). + +## Highlights + +* Reliable and battle-tested by [metalsmith](https://github.com/segmentio/metalsmith), [assemble](https://github.com/assemble/assemble), [verb](https://github.com/assemble/verb), and many other projects! +* Extracts and parses: + - [YAML](http://github.com/nodeca/js-yaml) + - [JSON](http://en.wikipedia.org/wiki/Json) + - [TOML](http://github.com/mojombo/toml) + - [CoffeeScript](http://coffeescript.org) when `options.eval` is set to `true` + - [CSON](https://github.com/bevry/cson) when `options.eval` is set to `true` + - JavaScript: when `options.eval` is set to `true` +* Easy to add additional parsers! pull requests welcome! + +## Usage + +```js +var matter = require('gray-matter'); +matter('---\ntitle: Front Matter\n---\nThis is content.'); +``` + +Returns: + +```js +{ + orig: '---\ntitle: Front Matter\n---\nThis is content.', + data: { title: 'Front Matter' }, + content: '\nThis is content.' +} +``` + +That's it! Just pass a string and gray-matter returns an object. + +*** + +## API + +### [matter](index.js#L30) + +Parses a `string` of front-matter with the given `options`, and returns an object. + +**Example** + +```js +matter('---\ntitle: foo\n---\nbar'); +//=> {data: {title: 'foo'}, content: 'bar', orig: '---\ntitle: foo\n---\nbar'} +``` + +**Params** + +* `string` **{String}**: The string to parse. +* `options` **{Object}** + +- `delims` **{Array}**: Custom delimiters formatted as an array. The default is `['---', '---']`. +- `parser` **{Function}**: Parser function to use. [js-yaml] is the default. +* `returns` **{Object}**: Valid JSON + +### [.read](index.js#L136) + +Read a file and parse front matter. Returns the same object as `matter()`. + +**Example** + +```js +matter.read('home.md'); +``` + +**Params** + +* `fp` **{String}**: file path of the file to read. +* `options` **{Object}**: Options to pass to gray-matter. +* `returns` **{Object}** + +### [.stringify](index.js#L167) + +Stringify an object to front-matter-formatted YAML, and concatenate it to the given string. + +Results in: + +**Examples** + +```js +matter.stringify('foo bar baz', {title: 'Home'}); +``` + +```yaml +--- +title: Home +--- +foo bar baz +``` + +**Params** + +* `str` **{String}**: The content string to append to stringified front-matter. +* `data` **{Object}**: Front matter to stringify. +* `options` **{Object}**: Options to pass to js-yaml +* `returns` **{String}** + +## Options + +> All methods exposed on the API accept an options object passed as the last argument + +## options.parser + +Type: `Function` + +Default: `undefined` + +Pass a custom parser on the options. This is useful if you need to, for example, define custom schemas for [js-yaml]. + +**Example** + +```js +matter(str, { + parser: require('js-yaml').safeLoad +}); +``` + +## options.eval + +Type: `Boolean` + +Default: `false` + +Evaluate coffee-script, CSON or JavaScript in front-matter. If you aren't aware of the dangers, google is your friend. + +However, if you are aware and you only use front-matter on, say, blog posts for a static site... this feature can be pretty useful. + +## options.lang + +Type: `String` + +Default: `yaml` + +The parser to use on the extracted front matter. + +YAML is parsed by default, and the languages listed below are parsed automatically if the language is specified after the first delimiter (e.g. `---`). + +Valid languages are: + +* `yaml` +* `json` +* `coffee` +* `cson` +* `toml` +* `js`|`javascript` + +**Example** + +To parse coffee front matter, you would define it as follows: + +```js +---coffee +title: 'coffee functions' +user: 'jonschlinkert' +fn: + reverse = (src) -> + src.split('').reverse().join('') +--- + +<%= description %> +<%= reverse(user) %> +``` + +## options.delims + +Type: `String` + +Default: `---` + +Open and close delimiters can be passed in as an array of strings. + +**Example:** + +```js +// format delims as a string +matter.read('file.md', {delims: '~~~'}); +// or an array (open/close) +matter.read('file.md', {delims: ['~~~', '~~~']}); +``` + +would parse: + +
+
+```
+title: Home
+```
+
+This is the  page.
+
+ +## Example usage + +Given we have a page, `abc.html`, containing: + +```html +--- +title: YAML Front matter +description: This is a page +--- +

+``` + +then running the following in the command line: + +```js +matter('abc.html'); +``` + +returns + +```json +{ + "data": { + "title": "YAML Front matter", + "description": "This is a page" + }, + "content": "

", + "original": "---\ntitle: YAML Front matter\n---\n

" +} +``` + +## Benchmarks + +**Benchmarks for building the [bootstrap-blog](https://github.com/twbs/bootstrap-blog/tree/gh-pages/_posts)** + +gray-matter would process all markdown posts in the [bootstrap-blog](https://github.com/twbs/bootstrap-blog/tree/gh-pages/_posts) **20 times** before the [front-matter](https://github.com/jxson/front-matter) library finished processing it once. + +``` +front-matter.js x 271 ops/sec ±2.68% (80 runs sampled) +gray-matter.js x 4,294 ops/sec ±0.86% (91 runs sampled) +``` + +**Misc** + +gray-matter is 12-20x faster than [front-matter](https://github.com/jxson/front-matter) when content or front matter actually exist. + +```bash +#1: complex + front-matter x 338 ops/sec ±1.60% (85 runs sampled) + gray-matter x 10,608 ops/sec ±1.97% (86 runs sampled) + +#2: empty + front-matter x 5,755,004 ops/sec ±0.88% (94 runs sampled) + gray-matter x 15,157,998 ops/sec ±0.81% (95 runs sampled) + +#3: matter + front-matter x 10,256 ops/sec ±2.18% (92 runs sampled) + gray-matter x 202,026 ops/sec ±0.71% (93 runs sampled) + +#4: no-content + front-matter x 10,136 ops/sec ±2.00% (91 runs sampled) + gray-matter x 206,548 ops/sec ±1.16% (94 runs sampled) + +#5: no-matter + front-matter x 3,540,817 ops/sec ±0.68% (95 runs sampled) + gray-matter x 7,959,809 ops/sec ±0.73% (91 runs sampled) +``` + +## Why? + +> Why another YAML Front Matter library? + +Because other libraries we tried failed to meet our requirements with [Assemble](https://github.com/assemble/assemble). Some most of the libraries met most of the requirements, but _none had all of them_. Here are the most important: + +* Be usable, if not simple +* Allow custom delimiters +* Use a dependable and well-supported library for parsing YAML and other languages +* Don't fail when no content exists +* Don't fail when no front matter exists +* Have no problem reading YAML files directly +* Have no problem with complex content, including **non-front-matter** fenced code blocks that contain examples of YAML front matter. Other parsers fail on this. +* Should return an object with three properties: + - `data`: the parsed YAML front matter, as a JSON object + - `content`: the contents as a string, without the front matter + - `orig`: the "original" content + +## About + +### Related projects + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [metalsmith](https://www.npmjs.com/package/metalsmith): An extremely simple, pluggable static site generator. | [homepage](https://github.com/segmentio/metalsmith#readme "An extremely simple, pluggable static site generator.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
| +| --- | --- | +| 121 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [RobLoach](https://github.com/RobLoach) | +| 2 | [doowb](https://github.com/doowb) | +| 2 | [moozzyk](https://github.com/moozzyk) | +| 1 | [Ajedi32](https://github.com/Ajedi32) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/gray-matter/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 25, 2016._ \ No newline at end of file diff --git a/day1/cli-study/node_modules/gray-matter/gray-matter.d.ts b/day1/cli-study/node_modules/gray-matter/gray-matter.d.ts new file mode 100644 index 0000000..3e155e8 --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/gray-matter.d.ts @@ -0,0 +1,20 @@ +declare module "gray-matter" { + export interface GrayMatterOption{ + parser?:Function; + eval?:boolean; + lang?:string; + delims:string; + } + export interface GrayMatter { + (str:string,options?:GrayMatterOption,delims?:Array, + parser?:Function):any; + read(fp:string,options?:GrayMatterOption):any; + stringify(str:string,data:Object,options?:GrayMatterOption):string; + } + + var matter:GrayMatter; + export default matter; + +} + + diff --git a/day1/cli-study/node_modules/gray-matter/index.js b/day1/cli-study/node_modules/gray-matter/index.js new file mode 100644 index 0000000..ca06a3f --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/index.js @@ -0,0 +1,213 @@ +'use strict'; + +var fs = require('fs'); +var extend = require('extend-shallow'); +var parsers = require('./lib/parsers'); + +/** + * Expose `matter()` + */ + +module.exports = matter; + +/** + * Parses a `string` of front-matter with the given `options`, + * and returns an object. + * + * ```js + * matter('---\ntitle: foo\n---\nbar'); + * //=> {data: {title: 'foo'}, content: 'bar', orig: '---\ntitle: foo\n---\nbar'} + * ``` + * + * @param {String} `string` The string to parse. + * @param {Object} `options` + * @option {Array} [options] `delims` Custom delimiters formatted as an array. The default is `['---', '---']`. + * @option {Function} [options] `parser` Parser function to use. [js-yaml] is the default. + * @return {Object} Valid JSON + * @api public + */ + +function matter(str, options) { + if (typeof str !== 'string') { + throw new Error('gray-matter expects a string'); + } + + // default results to build up + var res = {orig: str, data: {}, content: str}; + if (str === '') { + return res; + } + + // delimiters + var delims = arrayify((options && options.delims) || '---'); + var a = delims[0]; + + // strip byte order marks + str = stripBom(str); + + // if the first delim isn't the first thing, return + if (!isFirst(str, a)) { + return res; + } + + var b = '\n' + (delims[1] || delims[0]); + var alen = a.length; + + // if the next character after the first delim + // is a character in the first delim, then just + // return the default object. it's either a bad + // delim or not a delimiter at all. + if (a.indexOf(str.charAt(alen + 1)) !== -1) { + return res; + } + + var len = str.length; + + // find the index of the next delimiter before + // going any further. If not found, return. + var end = str.indexOf(b, alen + 1); + if (end === -1) { + end = len; + } + + // detect a language, if defined + var lang = str.slice(alen, str.indexOf('\n')); + // measure the lang before trimming whitespace + var start = alen + lang.length; + + var opts = options || {}; + opts.lang = opts.lang || 'yaml'; + lang = (lang && lang.trim()) || opts.lang; + + // get the front matter (data) string + var data = str.slice(start, end).trim(); + if (data) { + // if data exists, see if we have a matching parser + var fn = opts.parser || parsers[lang]; + if (typeof fn === 'function') { + // run the parser on the data string + res.data = fn(data, opts); + } else { + throw new Error('gray-matter cannot find a parser for: ' + str); + } + } + + // grab the content from the string, stripping + // an optional new line after the second delim + var con = str.substr(end + b.length); + if (con.charAt(0) === '\n') { + con = con.substr(1); + } else if (con.charAt(0) === '\r' && con.charAt(1) === '\n') { + con = con.substr(2); + } + + res.content = con; + return res; +} + +/** + * Expose `parsers` + * + * @type {Object} + */ + +matter.parsers = parsers; + +/** + * Requires cache + */ + +var YAML = matter.parsers.requires.yaml || (matter.parsers.requires.yaml = require('js-yaml')); + +/** + * Read a file and parse front matter. Returns the same object + * as `matter()`. + * + * ```js + * matter.read('home.md'); + * ``` + * + * @param {String} `fp` file path of the file to read. + * @param {Object} `options` Options to pass to gray-matter. + * @return {Object} + * @api public + */ + +matter.read = function(fp, options) { + var str = fs.readFileSync(fp, 'utf8'); + var obj = matter(str, options); + return extend(obj, { + path: fp + }); +}; + +/** + * Stringify an object to front-matter-formatted YAML, and + * concatenate it to the given string. + * + * ```js + * matter.stringify('foo bar baz', {title: 'Home'}); + * ``` + * Results in: + * + * ```yaml + * --- + * title: Home + * --- + * foo bar baz + * ``` + * + * @param {String} `str` The content string to append to stringified front-matter. + * @param {Object} `data` Front matter to stringify. + * @param {Object} `options` Options to pass to js-yaml + * @return {String} + * @api public + */ + +matter.stringify = function(str, data, options) { + var delims = arrayify(options && options.delims || '---'); + var res = ''; + res += delims[0] + '\n'; + res += YAML.safeDump(data, options); + res += (delims[1] || delims[0]) + '\n'; + res += str + '\n'; + return res; +}; + +/** + * Return true if the given `string` has front matter. + * + * @param {String} `string` + * @param {Object} `options` + * @return {Boolean} True if front matter exists. + */ + +matter.test = function(str, options) { + var delims = arrayify(options && options.delims || '---'); + return isFirst(str, delims[0]); +}; + +/** + * Return true if the given `ch` the first + * thing in the string. + */ + +function isFirst(str, ch) { + return str.substr(0, ch.length) === ch; +} + +/** + * Utility to strip byte order marks + */ + +function stripBom(str) { + return str.charAt(0) === '\uFEFF' ? str.slice(1) : str; +} + +/** + * Typecast `val` to an array. + */ + +function arrayify(val) { + return !Array.isArray(val) ? [val] : val; +} diff --git a/day1/cli-study/node_modules/gray-matter/lib/parsers.js b/day1/cli-study/node_modules/gray-matter/lib/parsers.js new file mode 100644 index 0000000..61243e3 --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/lib/parsers.js @@ -0,0 +1,208 @@ +/*! + * gray-matter + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + + +/** + * Module dependencies + */ + +var extend = require('extend-shallow'); +var red = require('ansi-red'); + +/** + * Expose `parser` module + */ + +var parser = module.exports; + +/** + * Requires cache. + */ + +parser.requires = {}; + +/** + * Parse YAML front matter + * + * @param {String} `str` The string to parse. + * @param {Object} `options` Options to pass to [js-yaml]. + * @return {Object} Parsed object of data. + * @api public + */ + +parser.yaml = function(str, options) { + var opts = extend({strict: false, safeLoad: false}, options); + try { + var YAML = parser.requires.yaml || (parser.requires.yaml = require('js-yaml')); + return opts.safeLoad ? YAML.safeLoad(str, options) : YAML.load(str, options); + } catch (err) { + if (opts.strict) { + throw new SyntaxError(msg('js-yaml', err)); + } else { + return {}; + } + } +}; + + +/** + * Parse JSON front matter + * + * @param {String} `str` The string to parse. + * @return {Object} Parsed object of data. + * @api public + */ + +parser.json = function(str, options) { + var opts = extend({strict: false}, options); + try { + return JSON.parse(str); + } catch (err) { + if (opts.strict) { + throw new SyntaxError(msg('JSON', err)); + } else { + return {}; + } + } +}; + + +/** + * Parse JavaScript front matter. To use javascript front-matter, you must + * set `options.eval` to `true`. + * + * By default, javascript code is wrapped in a function that is immediately + * executed when the parser is called. Thus, to be returned as a useful object, + * code should be written as object properties. + * + * **Example:** + * + * ```markdown + * ---js + * title: 'autodetect-javascript', + * // this function won't be invoked when the parser is called + * fn: { + * reverse: function(str) { + * return str.split('').reverse().join(''); + * } + * } + * --- + * ``` + * + * @param {String} `str` The string to parse. + * @param {Object} `options` Set `options.wrapped` to `false` to enable writing raw, un-wrapped javascript. + * @return {Object} Parsed object of data. + * @api public + */ + +parser.javascript = function(str, options) { + var opts = extend({wrapped: true, eval: false, strict: false}, options); + if (opts.eval) { + if (opts.wrapped) { + str = 'function data() {return {' + str + '}; } data();'; + } + try { + return eval(str); + } catch (err) { + throw new SyntaxError(msg('javascript', err)); + } + return {}; + } else { + + // if `eval` isn't set + if (opts.strict) { + throw new Error(evalError('javascript')); + } else { + console.error(evalError('javascript', true)); + } + } +}; + + +/** + * Alias for `parse.javascript()`. + * + * @api public + */ + +parser.js = parser.javascript; + + +/** + * Parse Coffee-Script front matter. To use coffee front-matter, you must + * set `options.eval` to `true`. + * + * @param {String} `str` The string to parse. + * @param {Object} `options` Options to pass to [coffee-script]. + * @return {Object} Parsed object of data. + * @api public + */ + +parser.coffee = function(str, options) { + var opts = extend({eval: false, strict: false}, options); + if (opts.eval) { + try { + var coffee = parser.requires.coffee || (parser.requires.coffee = require('coffee-script')); + return coffee['eval'](str, options); + } catch (err) { + throw new SyntaxError(msg('coffee-script', err)); + } + } else { + + // if `eval` isn't set + if (opts.strict) { + throw new Error(evalError('coffee')); + } else { + console.error(evalError('coffee', true)); + } + } +}; + +/** + * Alias for `parse.coffee()`. + * + * @api public + */ + +parser.cson = parser.coffee; + +/** + * Parse TOML front matter. + * + * @param {String} `str` The string to parse. + * @param {Object} `options` Options to pass to [toml-node]. + * @return {Object} Parsed object of data. + * @api public + */ + +parser.toml = function(str, opts) { + try { + var toml = parser.requires.toml || (parser.requires.toml = require('toml')); + return toml.parse(str); + } catch (err) { + if (opts.strict) { + throw new SyntaxError(msg('TOML', err)); + } else { + return {}; + } + } +}; + +/** + * Normalize error messages + */ + +function msg(lang, err) { + return 'gray-matter parser [' + lang + ']: ' + err; +} + +function evalError(lang, color) { + var msg = '[gray-matter]: to parse ' + lang + ' set `options.eval` to `true`'; + return color ? red(msg) : msg; +} diff --git a/day1/cli-study/node_modules/gray-matter/package.json b/day1/cli-study/node_modules/gray-matter/package.json new file mode 100644 index 0000000..c028806 --- /dev/null +++ b/day1/cli-study/node_modules/gray-matter/package.json @@ -0,0 +1,168 @@ +{ + "_from": "gray-matter@^2.0.0", + "_id": "gray-matter@2.1.1", + "_inBundle": false, + "_integrity": "sha1-MELZrewqHe1qdwep7SOA+KF6Qw4=", + "_location": "/gray-matter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "gray-matter@^2.0.0", + "name": "gray-matter", + "escapedName": "gray-matter", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/metalsmith" + ], + "_resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-2.1.1.tgz", + "_shasum": "3042d9adec2a1ded6a7707a9ed2380f8a17a430e", + "_spec": "gray-matter@^2.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\metalsmith", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/gray-matter/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Andrew Meyer", + "url": "https://github.com/Ajedi32" + }, + { + "name": "Brian Woodward", + "email": "brian.woodward@gmail.com", + "url": "https://github.com/doowb" + }, + { + "name": "Ian Storm Taylor", + "url": "http://ianstormtaylor.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Pawel Kadluczka", + "url": "http://blog.3d-logic.com" + }, + { + "name": "Rob Loach", + "email": "robloach@gmail.com", + "url": "http://robloach.net" + } + ], + "dependencies": { + "ansi-red": "^0.1.1", + "coffee-script": "^1.12.4", + "extend-shallow": "^2.0.1", + "js-yaml": "^3.8.1", + "toml": "^2.3.2" + }, + "deprecated": false, + "description": "Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and many other projects.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "ansi-gray": "^0.1.1", + "benchmarked": "^0.2.5", + "delimiter-regex": "^2.0.0", + "for-own": "^0.1.4", + "front-matter": "^2.1.2", + "glob": "^7.1.1", + "gulp": "^3.9.1", + "gulp-eslint": "^3.0.1", + "gulp-format-md": "^0.1.11", + "gulp-istanbul": "^1.1.1", + "gulp-mocha": "^4.0.1", + "lodash": "^4.17.4", + "minimist": "^1.2.0", + "should": "^11.2.0", + "sort-object": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "gray-matter.d.ts", + "index.js", + "lib" + ], + "homepage": "https://github.com/jonschlinkert/gray-matter", + "keywords": [ + "assemble", + "coffee", + "coffee-script", + "data", + "docs", + "documentation", + "extract", + "extracting", + "front", + "front-matter", + "frontmatter", + "generate", + "generator", + "gh-pages", + "gray", + "javascript", + "jekyll", + "js", + "JSON", + "markdown", + "matter", + "parse", + "parser", + "parsing", + "site", + "static", + "template", + "toml", + "yaml", + "yfm" + ], + "license": "MIT", + "main": "index.js", + "name": "gray-matter", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/gray-matter.git" + }, + "scripts": { + "test": "mocha" + }, + "typings": "gray-matter.d.ts", + "verb": { + "related": { + "list": [ + "assemble", + "metalsmith", + "verb" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "assemble", + "front-matter", + "verb", + "verb-generate-readme" + ] + }, + "version": "2.1.1" +} diff --git a/day1/cli-study/node_modules/has-ansi/index.js b/day1/cli-study/node_modules/has-ansi/index.js new file mode 100644 index 0000000..98fae06 --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/day1/cli-study/node_modules/has-ansi/license b/day1/cli-study/node_modules/has-ansi/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/index.js b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..b9574ed --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/license b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/package.json b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..7250d50 --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,108 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/has-ansi/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^2.0.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/has-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\has-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..6a928ed --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/day1/cli-study/node_modules/has-ansi/package.json b/day1/cli-study/node_modules/has-ansi/package.json new file mode 100644 index 0000000..a2221c4 --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/package.json @@ -0,0 +1,95 @@ +{ + "_from": "has-ansi@^2.0.0", + "_id": "has-ansi@2.0.0", + "_inBundle": false, + "_integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "_location": "/has-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-ansi@^2.0.0", + "name": "has-ansi", + "escapedName": "has-ansi", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/metalsmith/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_spec": "has-ansi@^2.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\metalsmith\\node_modules\\chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "deprecated": false, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-ansi#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + } + ], + "name": "has-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" +} diff --git a/day1/cli-study/node_modules/has-ansi/readme.md b/day1/cli-study/node_modules/has-ansi/readme.md new file mode 100644 index 0000000..02bc7c2 --- /dev/null +++ b/day1/cli-study/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/day1/cli-study/node_modules/has-flag/index.js b/day1/cli-study/node_modules/has-flag/index.js new file mode 100644 index 0000000..5139728 --- /dev/null +++ b/day1/cli-study/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf('--'); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/day1/cli-study/node_modules/has-flag/license b/day1/cli-study/node_modules/has-flag/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/has-flag/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/has-flag/package.json b/day1/cli-study/node_modules/has-flag/package.json new file mode 100644 index 0000000..9d84712 --- /dev/null +++ b/day1/cli-study/node_modules/has-flag/package.json @@ -0,0 +1,76 @@ +{ + "_from": "has-flag@^3.0.0", + "_id": "has-flag@3.0.0", + "_inBundle": false, + "_integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "_location": "/has-flag", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-flag@^3.0.0", + "name": "has-flag", + "escapedName": "has-flag", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/supports-color" + ], + "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "_shasum": "b5d454dc2199ae225699f3467e5a07f3b955bafd", + "_spec": "has-flag@^3.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-flag/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if argv has a specific flag", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-flag#readme", + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "license": "MIT", + "name": "has-flag", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-flag.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/day1/cli-study/node_modules/has-flag/readme.md b/day1/cli-study/node_modules/has-flag/readme.md new file mode 100644 index 0000000..677893c --- /dev/null +++ b/day1/cli-study/node_modules/has-flag/readme.md @@ -0,0 +1,70 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + + +## Install + +``` +$ npm install has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean for whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `string[]`
+Default: `process.argv` + +CLI arguments. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/day1/cli-study/node_modules/has-generators/.README.md.un~ b/day1/cli-study/node_modules/has-generators/.README.md.un~ new file mode 100644 index 0000000000000000000000000000000000000000..4cfdc3cd723fd9103b11634c5488eea05b1d3deb GIT binary patch literal 13904 zcmeI(&rcIU6bJC-hl)T<*DlMqvApcrEj1vMldOo-7K;3^F)f+-Z+B3_K~;6LC$ z;N80iFXF|6iHXLTc=2Kk@efcuc+vNr&fC7W>0pX;o0lxReVww?_v!2|vt@R9<=M>Y z)$CT#xbZgCw)W!l`&Z`%n%;bT_~^;&ck^HRPEKuawX2ucp3Ve8aF~_@E7^thOqdKG ztYveBJY~9&rKN$Ele8eP<|UZk?3-xDvrWP64|tZMvAEJd@e~#ve<-M-4`&sa-t7IP zIf7ujyJ9bzA@x`@6~#&oKn561r>pZKI+62YsDjHNv2Ql9E~OU3bYVRg4p+)SX^-d|6uq1%h}+FbuAz8HtQ>2dRdQy; z!D+AP8w}xg0y#h8Pz9GkZd-E1q4XR$IW;P!PjNCI7&=hx`!|o&eXXR6;GLGx_kMImZD;wgMi& zG@=KiN;nMyYqx>XA8`z(ZY-&dFq0WFaxBIDgQAz?YB*n$T+Aj%6DEE;*nT zJ@#Xb%i?NHV%<_KDn0G6bXJpDKC1z$Lv#ymFw3P6oE}b8#>pnZosw{Rg3;`$1Shi$ z2dIOhPe4RFKdCH=;%<}Rl!OBX?%!YmL2Pbr?r!>iIzOLVUMo>;!> zM^yGi3V|Kq)qY^28qR}!PfK5h!=1ZoIN&iHpfn_M6#Pnk^z}#7Vo}`vB)9SiT?Q^dQ^s;_U&p1}>`2|V^A7*%i?I}u;5k2pC}h744F4Q$>Dz=1rB#~v9~a2bT0vW?@( z-5`hgR5Y03s=q5`-VMy*?60*pH~4#Vx6tCZllho!l;5n+oKDzwb};ilgrGb42!MSY5By0S zRd5-^e!<3mt3GypNVmhwv5t3$4*}pO@xa5Q3NC}-$2ELY@$MZ@GV{HJ*rk2O8@`> literal 0 HcmV?d00001 diff --git a/day1/cli-study/node_modules/has-generators/.package.json.un~ b/day1/cli-study/node_modules/has-generators/.package.json.un~ new file mode 100644 index 0000000000000000000000000000000000000000..0f3fdd7c338a5168a29662e2d2c8db1c661b8397 GIT binary patch literal 1025 zcmWH`%$*;a=aT=FfhlYH#|!J*HH}_Y$jv+OZ50y}i+OeN^8IR-&Cj=+@AwtRz`!61 z#K?dV$YFvCfM^(I2-z>Qh6N%Ue*sAWl*s^+VuNx10|8hBCNN4wu?id=3=Cf- zfM&A-F)a8&amJ^hpj4b(lvz+xtYoE74HU6d00O0w)Z!ALfKqC5M!rIfl50^>evy?z zUcLfILZP@IH90daGc_efNkL6bA+;j2M8QzWv=JQRpcqC5AZtKYf@p@(7zc#{Edemb WS3@%(MvQ}^hDAZ4R>!pQ`6>XDw?L!- literal 0 HcmV?d00001 diff --git a/day1/cli-study/node_modules/has-generators/README.md b/day1/cli-study/node_modules/has-generators/README.md new file mode 100644 index 0000000..5315f9c --- /dev/null +++ b/day1/cli-study/node_modules/has-generators/README.md @@ -0,0 +1,20 @@ +# has-generators + + feature-detect generators. + +## Installation + + npm install has-generators + +## API +### require('has-generators') -> Boolean + + * true: Your runtime supports generators! Sweet! + * false: Your runtime doesn't support generators, aww :( + +## Example + +```javascript +// foo.js +module.exports = require('has-generators') ? require('./foo.es6') : require('./foo.es5') +``` diff --git a/day1/cli-study/node_modules/has-generators/index.js b/day1/cli-study/node_modules/has-generators/index.js new file mode 100644 index 0000000..76aba3f --- /dev/null +++ b/day1/cli-study/node_modules/has-generators/index.js @@ -0,0 +1,8 @@ +'use strict'; //jshint evil:true,node:true +try { + new Function('return function*() { yield 3 }') + module.exports = true +} +catch (e) { + module.exports = false +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-generators/package.json b/day1/cli-study/node_modules/has-generators/package.json new file mode 100644 index 0000000..7e6905b --- /dev/null +++ b/day1/cli-study/node_modules/has-generators/package.json @@ -0,0 +1,48 @@ +{ + "_from": "has-generators@^1.0.1", + "_id": "has-generators@1.0.1", + "_inBundle": false, + "_integrity": "sha1-pqLlVIYBGUBILhPiyTeRxEms9Ek=", + "_location": "/has-generators", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-generators@^1.0.1", + "name": "has-generators", + "escapedName": "has-generators", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/metalsmith" + ], + "_resolved": "https://registry.npmjs.org/has-generators/-/has-generators-1.0.1.tgz", + "_shasum": "a6a2e55486011940482e13e2c93791c449acf449", + "_spec": "has-generators@^1.0.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\metalsmith", + "author": { + "name": "Nathan Zadoks" + }, + "bugs": { + "url": "https://gist.github.com/nathan7/53031bbfdf884ba2817a" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "feature-detect generators", + "homepage": "https://gist.github.com/nathan7/53031bbfdf884ba2817a", + "keywords": [ + "generators", + "es6", + "feature-detection" + ], + "license": "ISC", + "main": "index.js", + "name": "has-generators", + "repository": { + "type": "git", + "url": "https://gist.github.com/nathan7/53031bbfdf884ba2817a.git" + }, + "version": "1.0.1" +} diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.editorconfig b/day1/cli-study/node_modules/has-symbol-support-x/.editorconfig new file mode 100644 index 0000000..ec24598 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.editorconfig @@ -0,0 +1,26 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# top-most EditorConfig file +root = true + +# every file +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.eslintignore b/day1/cli-study/node_modules/has-symbol-support-x/.eslintignore new file mode 100644 index 0000000..cdecab1 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.eslintignore @@ -0,0 +1 @@ +lib/* diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.eslintrc.json b/day1/cli-study/node_modules/has-symbol-support-x/.eslintrc.json new file mode 100644 index 0000000..7d4d3dd --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "@xotic750/eslint-config-standard-x" + ] +} diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.nvmrc b/day1/cli-study/node_modules/has-symbol-support-x/.nvmrc new file mode 100644 index 0000000..b009dfb --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.travis.yml b/day1/cli-study/node_modules/has-symbol-support-x/.travis.yml new file mode 100644 index 0000000..a45e260 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.travis.yml @@ -0,0 +1,111 @@ +sudo: false +language: node_js +branches: + only: + - master + - /^greenkeeper/.*$/ +notifications: + email: false +node_js: + - "9.6" + - "9.5" + - "9.4" + - "9.3" + - "9.2" + - "9.1" + - "9.0" + - "8.9" + - "8.8" + - "8.7" + - "8.6" + - "8.5" + - "8.4" + - "8.3" + - "8.2" + - "8.1" + - "8.0" + - "7.10" + - "7.9" + - "7.8" + - "7.7" + - "7.6" + - "7.5" + - "7.4" + - "7.3" + - "7.2" + - "7.1" + - "7.0" + - "6.11" + - "6.10" + - "6.9" + - "6.8" + - "6.7" + - "6.6" + - "6.5" + - "6.4" + - "6.3" + - "6.2" + - "6.1" + - "6.0" + - "5.12" + - "5.11" + - "5.10" + - "5.9" + - "5.8" + - "5.7" + - "5.6" + - "5.5" + - "5.4" + - "5.3" + - "5.2" + - "5.1" + - "5.0" + - "4.8" + - "4.7" + - "4.6" + - "4.5" + - "4.4" + - "4.3" + - "4.2" + - "4.1" + - "4.0" + - "iojs-v3.3" + - "iojs-v3.2" + - "iojs-v3.1" + - "iojs-v3.0" + - "iojs-v2.5" + - "iojs-v2.4" + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5; elif [[ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" =~ ^[4-5]+$ ]]; then npm install -g npm@5.3; else npm install -g npm; fi; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use --delete-prefix "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'npm test' +matrix: + fast_finish: true + allow_failures: + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.6" + - node_js: "0.4" diff --git a/day1/cli-study/node_modules/has-symbol-support-x/.uglifyjsrc.json b/day1/cli-study/node_modules/has-symbol-support-x/.uglifyjsrc.json new file mode 100644 index 0000000..2d26277 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/.uglifyjsrc.json @@ -0,0 +1,17 @@ +{ + "warnings": false, + "parse": {}, + "compress": { + "keep_fnames": true + }, + "mangle": false, + "output": { + "ascii_only": true, + "beautify": false, + "comments": "some" + }, + "sourceMap": {}, + "nameCache": null, + "toplevel": false, + "ie8": true +} diff --git a/day1/cli-study/node_modules/has-symbol-support-x/LICENSE b/day1/cli-study/node_modules/has-symbol-support-x/LICENSE new file mode 100644 index 0000000..0d2b266 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/LICENSE @@ -0,0 +1,21 @@ +https://opensource.org/licenses/MIT + +Copyright (c) 2015-present Graham Fairweather. + +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. diff --git a/day1/cli-study/node_modules/has-symbol-support-x/README.md b/day1/cli-study/node_modules/has-symbol-support-x/README.md new file mode 100644 index 0000000..f9503ae --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/README.md @@ -0,0 +1,36 @@ + +Travis status + + +Dependency status + + +devDependency status + + +npm version + + + +## has-symbol-support-x +Tests if ES6 Symbol is supported. + +**Version**: 1.4.2 +**Author**: Xotic750 +**License**: [MIT](<https://opensource.org/licenses/MIT>) +**Copyright**: Xotic750 + + +### `module.exports` : boolean ⏏ +Indicates if `Symbol`exists and creates the correct type. +`true`, if it exists and creates the correct type, otherwise `false`. + +**Kind**: Exported member diff --git a/day1/cli-study/node_modules/has-symbol-support-x/badges.html b/day1/cli-study/node_modules/has-symbol-support-x/badges.html new file mode 100644 index 0000000..a3b8352 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/badges.html @@ -0,0 +1,20 @@ + +Travis status + + +Dependency status + + +devDependency status + + +npm version + diff --git a/day1/cli-study/node_modules/has-symbol-support-x/index.js b/day1/cli-study/node_modules/has-symbol-support-x/index.js new file mode 100644 index 0000000..20a9581 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/index.js @@ -0,0 +1,18 @@ +/** + * @file Tests if ES6 Symbol is supported. + * @version 1.4.2 + * @author Xotic750 + * @copyright Xotic750 + * @license {@link MIT} + * @module has-symbol-support-x + */ + +'use strict'; + +/** + * Indicates if `Symbol`exists and creates the correct type. + * `true`, if it exists and creates the correct type, otherwise `false`. + * + * @type boolean + */ +module.exports = typeof Symbol === 'function' && typeof Symbol('') === 'symbol'; diff --git a/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.js b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.js new file mode 100644 index 0000000..62a6b14 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.js @@ -0,0 +1,22 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + * @copyright Xotic750 + * @license {@link MIT} + * @module has-symbol-support-x + */ + +'use strict'; + +/** + * Indicates if `Symbol`exists and creates the correct type. + * `true`, if it exists and creates the correct type, otherwise `false`. + * + * @type boolean + */ +module.exports = typeof Symbol === 'function' && typeof Symbol('') === 'symbol'; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js new file mode 100644 index 0000000..035d36f --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js @@ -0,0 +1,10 @@ +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o + * @copyright Xotic750 + * @license {@link MIT} + * @module has-symbol-support-x + */ +"use strict";module.exports="function"==typeof Symbol&&"symbol"==typeof Symbol("")},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js.map b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js.map new file mode 100644 index 0000000..b700755 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/lib/has-symbol-support-x.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/has-symbol-support-x.js"],"names":["f","exports","module","define","amd","window","global","self","this","returnExports","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","_dereq_","Symbol"],"mappings":"CAAA,SAAUA,GAAG,GAAoB,iBAAVC,SAAoC,oBAATC,OAAsBA,OAAOD,QAAQD,SAAS,GAAmB,mBAATG,QAAqBA,OAAOC,IAAKD,UAAUH,OAAO,EAA0B,oBAATK,OAAwBA,OAA+B,oBAATC,OAAwBA,OAA6B,oBAAPC,KAAsBA,KAAYC,MAAOC,cAAgBT,KAAlU,CAAyU,WAAqC,OAAmB,SAASU,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAkB,mBAATC,SAAqBA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAI,IAAIf,EAAE,IAAIoB,MAAM,uBAAuBL,EAAE,KAAK,MAAMf,EAAEqB,KAAK,mBAAmBrB,EAAE,IAAIsB,EAAEV,EAAEG,IAAId,YAAYU,EAAEI,GAAG,GAAGQ,KAAKD,EAAErB,QAAQ,SAASS,GAAG,IAAIE,EAAED,EAAEI,GAAG,GAAGL,GAAG,OAAOI,EAAEF,GAAIF,IAAIY,EAAEA,EAAErB,QAAQS,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGd,QAAkD,IAA1C,IAAIkB,EAAkB,mBAATD,SAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEW,OAAOT,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAAlc,EAAkdW,GAAG,SAASC,QAAQxB,OAAOD;;;;;;;;;AAUl2B,aAQAC,OAAOD,QAA4B,mBAAX0B,QAA+C,iBAAfA,OAAO,cAEpD,GApB0W,CAoBtW"} \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-symbol-support-x/package.json b/day1/cli-study/node_modules/has-symbol-support-x/package.json new file mode 100644 index 0000000..b36007a --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/package.json @@ -0,0 +1,111 @@ +{ + "_from": "has-symbol-support-x@^1.4.1", + "_id": "has-symbol-support-x@1.4.2", + "_inBundle": false, + "_integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "_location": "/has-symbol-support-x", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-symbol-support-x@^1.4.1", + "name": "has-symbol-support-x", + "escapedName": "has-symbol-support-x", + "rawSpec": "^1.4.1", + "saveSpec": null, + "fetchSpec": "^1.4.1" + }, + "_requiredBy": [ + "/has-to-string-tag-x" + ], + "_resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "_shasum": "1409f98bc00247da45da67cee0a36f282ff26455", + "_spec": "has-symbol-support-x@^1.4.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\has-to-string-tag-x", + "author": { + "name": "Graham Fairweather", + "email": "xotic750@gmail.com" + }, + "bugs": { + "url": "https://github.com/Xotic750/has-symbol-support-x/issues" + }, + "bundleDependencies": false, + "copyright": "Copyright (c) 2015-present", + "dependencies": {}, + "deprecated": false, + "description": "Tests if ES6 Symbol is supported.", + "devDependencies": { + "@xotic750/eslint-config-standard-x": "^3.1.1", + "ajv": "^6.1.1", + "browserify": "^16.1.0", + "browserify-derequire": "^0.9.4", + "cross-env": "^5.1.3", + "es5-shim": "^4.5.10", + "es6-shim": "^0.35.3", + "es7-shim": "^6.0.0", + "eslint": "^4.18.1", + "eslint-plugin-compat": "^2.2.0", + "eslint-plugin-css-modules": "^2.7.5", + "eslint-plugin-eslint-comments": "^2.0.2", + "eslint-plugin-jsdoc": "^3.5.0", + "eslint-plugin-json": "^1.2.0", + "eslint-plugin-no-use-extend-native": "^0.3.12", + "husky": "^0.13.4", + "jasmine-node": "^1.14.5", + "jsdoc-to-markdown": "^4.0.1", + "json3": "^3.3.2", + "make-jasmine-spec-runner-html": "^1.3.0", + "ncp": "^2.0.0", + "nodemon": "^1.15.1", + "nsp": "^3.2.1", + "parallelshell": "^3.0.2", + "replace-x": "^1.5.0", + "rimraf": "^2.6.2", + "serve": "^6.4.11", + "uglify-js": "^3.3.12" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/Xotic750/has-symbol-support-x", + "keywords": [ + "ES6", + "hasSymbolSupport", + "module", + "javascript", + "nodejs", + "browser" + ], + "license": "MIT", + "main": "index.js", + "name": "has-symbol-support-x", + "repository": { + "type": "git", + "url": "git+https://github.com/Xotic750/has-symbol-support-x.git" + }, + "scripts": { + "browserify": "browserify -p browserify-derequire -e index.js -o lib/has-symbol-support-x.js -u 'crypto' -s returnExports", + "build": "npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security", + "build:description": "replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js", + "build:jasmine": "npm run clean:jasmine && make-jasmine-spec-runner-html", + "build:name": "replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js", + "build:replace": "npm run build:setver && npm run build:name && npm run build:description", + "build:setver": "replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js", + "clean": "rimraf README.md lib/*", + "clean:all": "npm run clean:jasmine && npm run clean", + "clean:jasmine": "rimraf tests/index.html tests/run.js", + "docs": "npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md", + "docs:badges": "ncp badges.html README.md && npm run docs:name", + "docs:name": "replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md", + "lint": "eslint *.js tests/spec/*.js", + "lint-fix": "npm run lint -- --fix", + "precommit": "npm run production", + "prepush": "npm run production", + "production": "npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build", + "security": "nsp check", + "start": "parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"", + "test": "jasmine-node --matchall tests/spec/", + "uglify": "uglifyjs lib/has-symbol-support-x.js -o lib/has-symbol-support-x.min.js --config-file .uglifyjsrc.json" + }, + "version": "1.4.2" +} diff --git a/day1/cli-study/node_modules/has-symbol-support-x/tests/index.html b/day1/cli-study/node_modules/has-symbol-support-x/tests/index.html new file mode 100644 index 0000000..9c027d4 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/tests/index.html @@ -0,0 +1,34 @@ + + + + + Jasmine Spec Runner: has-symbol-support-x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/day1/cli-study/node_modules/has-symbol-support-x/tests/run.js b/day1/cli-study/node_modules/has-symbol-support-x/tests/run.js new file mode 100644 index 0000000..76efd69 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/tests/run.js @@ -0,0 +1,25 @@ +/* global window, jasmine */ +/* eslint strict: 0 */ +(function () { + var jasmineEnv = jasmine.getEnv(); + jasmineEnv.updateInterval = 1000; + + var trivialReporter = new jasmine.TrivialReporter(); + + jasmineEnv.addReporter(trivialReporter); + + jasmineEnv.specFilter = function (spec) { + return trivialReporter.specFilter(spec); + }; + + var currentWindowOnload = window.onload; + var execJasmine = function () { + jasmineEnv.execute(); + }; + window.onload = function () { + if (currentWindowOnload) { + currentWindowOnload(); + } + execJasmine(); + }; +}()); diff --git a/day1/cli-study/node_modules/has-symbol-support-x/tests/spec/test.js b/day1/cli-study/node_modules/has-symbol-support-x/tests/spec/test.js new file mode 100644 index 0000000..0868973 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbol-support-x/tests/spec/test.js @@ -0,0 +1,29 @@ +'use strict'; + +var hasSymbolSupport; +if (typeof module === 'object' && module.exports) { + require('es5-shim'); + require('es5-shim/es5-sham'); + if (typeof JSON === 'undefined') { + JSON = {}; + } + require('json3').runInContext(null, JSON); + require('es6-shim'); + var es7 = require('es7-shim'); + Object.keys(es7).forEach(function (key) { + var obj = es7[key]; + if (typeof obj.shim === 'function') { + obj.shim(); + } + }); + hasSymbolSupport = require('../../index.js'); +} else { + hasSymbolSupport = returnExports; +} + +describe('Basic tests', function () { + it('results should match', function () { + var expected = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + expect(hasSymbolSupport).toBe(expected); + }); +}); diff --git a/day1/cli-study/node_modules/has-symbols/.eslintrc b/day1/cli-study/node_modules/has-symbols/.eslintrc new file mode 100644 index 0000000..2d9a66a --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "multiline-comment-style": 0, + } +} diff --git a/day1/cli-study/node_modules/has-symbols/.github/FUNDING.yml b/day1/cli-study/node_modules/has-symbols/.github/FUNDING.yml new file mode 100644 index 0000000..04cf87e --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/has-symbols +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/day1/cli-study/node_modules/has-symbols/.github/workflows/rebase.yml b/day1/cli-study/node_modules/has-symbols/.github/workflows/rebase.yml new file mode 100644 index 0000000..436cb79 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/.github/workflows/rebase.yml @@ -0,0 +1,15 @@ +name: Automatic Rebase + +on: [pull_request] + +jobs: + _: + name: "Automatic Rebase" + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ljharb/rebase@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/day1/cli-study/node_modules/has-symbols/.travis.yml b/day1/cli-study/node_modules/has-symbols/.travis.yml new file mode 100644 index 0000000..2d1c1d2 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/.travis.yml @@ -0,0 +1,12 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml + - ljharb/travis-ci:node/coverage.yml +matrix: + allow_failures: + - env: COVERAGE=true diff --git a/day1/cli-study/node_modules/has-symbols/CHANGELOG.md b/day1/cli-study/node_modules/has-symbols/CHANGELOG.md new file mode 100644 index 0000000..4dcac04 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/CHANGELOG.md @@ -0,0 +1,34 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-17 + +### Commits + +- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229) +- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b) +- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c) +- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91) +- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4) +- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193) +- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0) +- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0) + +## v1.0.0 - 2016-09-19 + +### Commits + +- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d) +- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a) +- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c) +- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb) +- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c) diff --git a/day1/cli-study/node_modules/has-symbols/LICENSE b/day1/cli-study/node_modules/has-symbols/LICENSE new file mode 100644 index 0000000..df31cbf --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Jordan Harband + +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. diff --git a/day1/cli-study/node_modules/has-symbols/README.md b/day1/cli-study/node_modules/has-symbols/README.md new file mode 100644 index 0000000..b27b31a --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/README.md @@ -0,0 +1,45 @@ +# has-symbols [![Version Badge][2]][1] + +[![Build Status][3]][4] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Determine if the JS environment has Symbol support. Supports spec, or shams. + +## Example + +```js +var hasSymbols = require('has-symbols'); + +hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. + +var hasSymbolsKinda = require('has-symbols/shams'); +hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. +``` + +## Supported Symbol shams + - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) + - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/has-symbols +[2]: http://versionbadg.es/ljharb/has-symbols.svg +[3]: https://travis-ci.org/ljharb/has-symbols.svg +[4]: https://travis-ci.org/ljharb/has-symbols +[5]: https://david-dm.org/ljharb/has-symbols.svg +[6]: https://david-dm.org/ljharb/has-symbols +[7]: https://david-dm.org/ljharb/has-symbols/dev-status.svg +[8]: https://david-dm.org/ljharb/has-symbols#info=devDependencies +[9]: https://ci.testling.com/ljharb/has-symbols.png +[10]: https://ci.testling.com/ljharb/has-symbols +[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true +[license-image]: http://img.shields.io/npm/l/has-symbols.svg +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/has-symbols.svg +[downloads-url]: http://npm-stat.com/charts.html?package=has-symbols diff --git a/day1/cli-study/node_modules/has-symbols/index.js b/day1/cli-study/node_modules/has-symbols/index.js new file mode 100644 index 0000000..f72159e --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/index.js @@ -0,0 +1,13 @@ +'use strict'; + +var origSymbol = global.Symbol; +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; diff --git a/day1/cli-study/node_modules/has-symbols/package.json b/day1/cli-study/node_modules/has-symbols/package.json new file mode 100644 index 0000000..1135463 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/package.json @@ -0,0 +1,121 @@ +{ + "_from": "has-symbols@^1.0.0", + "_id": "has-symbols@1.0.1", + "_inBundle": false, + "_integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "_location": "/has-symbols", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-symbols@^1.0.0", + "name": "has-symbols", + "escapedName": "has-symbols", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/es-abstract", + "/is-regex", + "/is-symbol", + "/object.assign" + ], + "_resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "_shasum": "9f5214758a44196c406d9bd76cebf81ec2dd31e8", + "_spec": "has-symbols@^1.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\object.assign", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false + }, + "bugs": { + "url": "https://github.com/ljharb/has-symbols/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", + "devDependencies": { + "@ljharb/eslint-config": "^15.0.1", + "auto-changelog": "^1.16.2", + "core-js": "^2.6.10", + "eslint": "^6.6.0", + "get-own-property-symbols": "^0.9.4", + "safe-publish-latest": "^1.1.4", + "tape": "^4.11.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "homepage": "https://github.com/ljharb/has-symbols#readme", + "keywords": [ + "Symbol", + "symbols", + "typeof", + "sham", + "polyfill", + "native", + "core-js", + "ES6" + ], + "license": "MIT", + "main": "index.js", + "name": "has-symbols", + "repository": { + "type": "git", + "url": "git://github.com/ljharb/has-symbols.git" + }, + "scripts": { + "lint": "eslint *.js", + "posttest": "npx aud", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"", + "prepublish": "safe-publish-latest", + "pretest": "npm run --silent lint", + "test": "npm run --silent tests-only", + "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", + "test:shams:corejs": "node test/shams/core-js.js", + "test:shams:getownpropertysymbols": "node test/shams/get-own-property-symbols.js", + "test:staging": "node --harmony --es-staging test", + "test:stock": "node test", + "tests-only": "npm run --silent test:stock && npm run --silent test:staging && npm run --silent test:shams", + "version": "auto-changelog && git add CHANGELOG.md" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "version": "1.0.1" +} diff --git a/day1/cli-study/node_modules/has-symbols/shams.js b/day1/cli-study/node_modules/has-symbols/shams.js new file mode 100644 index 0000000..9f80f79 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/shams.js @@ -0,0 +1,42 @@ +'use strict'; + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; diff --git a/day1/cli-study/node_modules/has-symbols/test/index.js b/day1/cli-study/node_modules/has-symbols/test/index.js new file mode 100644 index 0000000..fc32aff --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/test/index.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var hasSymbols = require('../'); +var runSymbolTests = require('./tests'); + +test('interface', function (t) { + t.equal(typeof hasSymbols, 'function', 'is a function'); + t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); + t.end(); +}); + +test('Symbols are supported', { skip: !hasSymbols() }, function (t) { + runSymbolTests(t); + t.end(); +}); + +test('Symbols are not supported', { skip: hasSymbols() }, function (t) { + t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); + t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); + t.end(); +}); diff --git a/day1/cli-study/node_modules/has-symbols/test/shams/core-js.js b/day1/cli-study/node_modules/has-symbols/test/shams/core-js.js new file mode 100644 index 0000000..df5365c --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/test/shams/core-js.js @@ -0,0 +1,28 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + require('core-js/fn/symbol'); + require('core-js/fn/symbol/to-string-tag'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/day1/cli-study/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/day1/cli-study/node_modules/has-symbols/test/shams/get-own-property-symbols.js new file mode 100644 index 0000000..9191b24 --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/test/shams/get-own-property-symbols.js @@ -0,0 +1,28 @@ +'use strict'; + +var test = require('tape'); + +if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { + test('has native Symbol support', function (t) { + t.equal(typeof Symbol, 'function'); + t.equal(typeof Symbol(), 'symbol'); + t.end(); + }); + return; +} + +var hasSymbols = require('../../shams'); + +test('polyfilled Symbols', function (t) { + /* eslint-disable global-require */ + t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); + + require('get-own-property-symbols'); + + require('../tests')(t); + + var hasSymbolsAfter = hasSymbols(); + t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); + /* eslint-enable global-require */ + t.end(); +}); diff --git a/day1/cli-study/node_modules/has-symbols/test/tests.js b/day1/cli-study/node_modules/has-symbols/test/tests.js new file mode 100644 index 0000000..93ff0ea --- /dev/null +++ b/day1/cli-study/node_modules/has-symbols/test/tests.js @@ -0,0 +1,54 @@ +'use strict'; + +module.exports = function runSymbolTests(t) { + t.equal(typeof Symbol, 'function', 'global Symbol is a function'); + + if (typeof Symbol !== 'function') { return false }; + + t.notEqual(Symbol(), Symbol(), 'two symbols are not equal'); + + /* + t.equal( + Symbol.prototype.toString.call(Symbol('foo')), + Symbol.prototype.toString.call(Symbol('foo')), + 'two symbols with the same description stringify the same' + ); + */ + + var foo = Symbol('foo'); + + /* + t.notEqual( + String(foo), + String(Symbol('bar')), + 'two symbols with different descriptions do not stringify the same' + ); + */ + + t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function'); + // t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol'); + + t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function'); + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + t.notEqual(typeof sym, 'string', 'Symbol is not a string'); + t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly'); + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { t.fail('symbol property key was found in for..in of object'); } + + t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object'); + t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object'); + t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object'); + t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable'); + t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), { + configurable: true, + enumerable: true, + value: 42, + writable: true + }, 'property descriptor is correct'); +}; diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.editorconfig b/day1/cli-study/node_modules/has-to-string-tag-x/.editorconfig new file mode 100644 index 0000000..ec24598 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.editorconfig @@ -0,0 +1,26 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# top-most EditorConfig file +root = true + +# every file +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.eslintignore b/day1/cli-study/node_modules/has-to-string-tag-x/.eslintignore new file mode 100644 index 0000000..cdecab1 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.eslintignore @@ -0,0 +1 @@ +lib/* diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.eslintrc.json b/day1/cli-study/node_modules/has-to-string-tag-x/.eslintrc.json new file mode 100644 index 0000000..7d4d3dd --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "@xotic750/eslint-config-standard-x" + ] +} diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.nvmrc b/day1/cli-study/node_modules/has-to-string-tag-x/.nvmrc new file mode 100644 index 0000000..b009dfb --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.travis.yml b/day1/cli-study/node_modules/has-to-string-tag-x/.travis.yml new file mode 100644 index 0000000..1304ed4 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.travis.yml @@ -0,0 +1,93 @@ +sudo: false +language: node_js +branches: + only: + - master + - /^greenkeeper/.*$/ +notifications: + email: false +node_js: + - "8.4" + - "8.3" + - "8.2" + - "8.1" + - "8.0" + - "7.10" + - "7.9" + - "7.8" + - "7.7" + - "7.6" + - "7.5" + - "7.4" + - "7.3" + - "7.2" + - "7.1" + - "7.0" + - "6.9" + - "6.8" + - "6.7" + - "6.6" + - "6.5" + - "6.4" + - "6.3" + - "6.2" + - "6.1" + - "6.0" + - "5.12" + - "5.11" + - "5.10" + - "5.9" + - "5.8" + - "5.7" + - "5.6" + - "5.5" + - "5.4" + - "5.3" + - "5.2" + - "5.1" + - "5.0" + - "4.4" + - "4.3" + - "4.2" + - "4.1" + - "4.0" + - "iojs-v3.3" + - "iojs-v3.2" + - "iojs-v3.1" + - "iojs-v3.0" + - "iojs-v2.5" + - "iojs-v2.4" + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use --delete-prefix "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'npm test' +matrix: + fast_finish: true + allow_failures: + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.6" + - node_js: "0.4" diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/.uglifyjsrc.json b/day1/cli-study/node_modules/has-to-string-tag-x/.uglifyjsrc.json new file mode 100644 index 0000000..2d26277 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/.uglifyjsrc.json @@ -0,0 +1,17 @@ +{ + "warnings": false, + "parse": {}, + "compress": { + "keep_fnames": true + }, + "mangle": false, + "output": { + "ascii_only": true, + "beautify": false, + "comments": "some" + }, + "sourceMap": {}, + "nameCache": null, + "toplevel": false, + "ie8": true +} diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/LICENSE b/day1/cli-study/node_modules/has-to-string-tag-x/LICENSE new file mode 100644 index 0000000..73c4669 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/LICENSE @@ -0,0 +1,21 @@ +https://opensource.org/licenses/MIT + +Copyright (c) 2015-2017 Graham Fairweather. + +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. diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/README.md b/day1/cli-study/node_modules/has-to-string-tag-x/README.md new file mode 100644 index 0000000..b545e80 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/README.md @@ -0,0 +1,37 @@ + +Travis status + + +Dependency status + + +devDependency status + + +npm version + + + +## has-to-string-tag-x +Tests if ES6 @@toStringTag is supported. + +**See**: [26.3.1 @@toStringTag](http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag) +**Version**: 1.4.1 +**Author**: Xotic750 +**License**: [MIT](<https://opensource.org/licenses/MIT>) +**Copyright**: Xotic750 + + +### `module.exports` : boolean ⏏ +Indicates if `Symbol.toStringTag`exists and is the correct type. +`true`, if it exists and is the correct type, otherwise `false`. + +**Kind**: Exported member diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/badges.html b/day1/cli-study/node_modules/has-to-string-tag-x/badges.html new file mode 100644 index 0000000..a3b8352 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/badges.html @@ -0,0 +1,20 @@ + +Travis status + + +Dependency status + + +devDependency status + + +npm version + diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/index.js b/day1/cli-study/node_modules/has-to-string-tag-x/index.js new file mode 100644 index 0000000..abc608d --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/index.js @@ -0,0 +1,19 @@ +/** + * @file Tests if ES6 @@toStringTag is supported. + * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag} + * @version 1.4.1 + * @author Xotic750 + * @copyright Xotic750 + * @license {@link MIT} + * @module has-to-string-tag-x + */ + +'use strict'; + +/** + * Indicates if `Symbol.toStringTag`exists and is the correct type. + * `true`, if it exists and is the correct type, otherwise `false`. + * + * @type boolean + */ +module.exports = require('has-symbol-support-x') && typeof Symbol.toStringTag === 'symbol'; diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.js b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.js new file mode 100644 index 0000000..52ef849 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.js @@ -0,0 +1,43 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + * @copyright Xotic750 + * @license {@link MIT} + * @module has-to-string-tag-x + */ + +'use strict'; + +/** + * Indicates if `Symbol.toStringTag`exists and is the correct type. + * `true`, if it exists and is the correct type, otherwise `false`. + * + * @type boolean + */ +module.exports = _dereq_('has-symbol-support-x') && typeof Symbol.toStringTag === 'symbol'; + +},{"has-symbol-support-x":2}],2:[function(_dereq_,module,exports){ +/** + * @file Tests if ES6 Symbol is supported. + * @version 1.4.1 + * @author Xotic750 + * @copyright Xotic750 + * @license {@link MIT} + * @module has-symbol-support-x + */ + +'use strict'; + +/** + * Indicates if `Symbol`exists and creates the correct type. + * `true`, if it exists and creates the correct type, otherwise `false`. + * + * @type boolean + */ +module.exports = typeof Symbol === 'function' && typeof Symbol('') === 'symbol'; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js new file mode 100644 index 0000000..307f21a --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js @@ -0,0 +1,18 @@ +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o + * @copyright Xotic750 + * @license {@link MIT} + * @module has-to-string-tag-x + */ +"use strict";module.exports=_dereq_("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag},{"has-symbol-support-x":2}],2:[function(_dereq_,module,exports){/** + * @file Tests if ES6 Symbol is supported. + * @version 1.4.1 + * @author Xotic750 + * @copyright Xotic750 + * @license {@link MIT} + * @module has-symbol-support-x + */ +"use strict";module.exports="function"==typeof Symbol&&"symbol"==typeof Symbol("")},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js.map b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js.map new file mode 100644 index 0000000..772a237 --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/lib/has-to-string-tag-x.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["lib/has-to-string-tag-x.js"],"names":["f","exports","module","define","amd","window","global","self","this","returnExports","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","_dereq_","Symbol","toStringTag","has-symbol-support-x","2"],"mappings":"CAAA,SAAUA,GAAG,GAAoB,iBAAVC,SAAoC,oBAATC,OAAsBA,OAAOD,QAAQD,SAAS,GAAmB,mBAATG,QAAqBA,OAAOC,IAAKD,UAAUH,OAAO,EAA0B,oBAATK,OAAwBA,OAA+B,oBAATC,OAAwBA,OAA6B,oBAAPC,KAAsBA,KAAYC,MAAOC,cAAgBT,KAAlU,CAAyU,WAAqC,OAAO,SAAUU,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAkB,mBAATC,SAAqBA,QAAQ,IAAIF,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGI,EAAE,OAAOA,EAAEJ,GAAE,GAAI,IAAIf,EAAE,IAAIoB,MAAM,uBAAuBL,EAAE,KAAK,MAAMf,EAAEqB,KAAK,mBAAmBrB,EAAE,IAAIsB,EAAEV,EAAEG,IAAId,YAAYU,EAAEI,GAAG,GAAGQ,KAAKD,EAAErB,QAAQ,SAASS,GAAG,IAAIE,EAAED,EAAEI,GAAG,GAAGL,GAAG,OAAOI,EAAEF,GAAIF,IAAIY,EAAEA,EAAErB,QAAQS,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGd,QAAkD,IAAI,IAA1CkB,EAAkB,mBAATD,SAAqBA,QAAgBH,EAAE,EAAEA,EAAEF,EAAEW,OAAOT,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAAvb,EAA4bW,GAAG,SAASC,QAAQxB,OAAOD;;;;;;;;;AAW50B,aAQAC,OAAOD,QAAUyB,QAAQ,yBAAyD,iBAAvBC,OAAOC,cAE/DC,uBAAuB,IAAIC,GAAG,SAASJ,QAAQxB,OAAOD;;;;;;;;AAUzD,aAQAC,OAAOD,QAA4B,mBAAX0B,QAA+C,iBAAfA,OAAO,cAEpD,IAAI"} \ No newline at end of file diff --git a/day1/cli-study/node_modules/has-to-string-tag-x/package.json b/day1/cli-study/node_modules/has-to-string-tag-x/package.json new file mode 100644 index 0000000..1c5ea0f --- /dev/null +++ b/day1/cli-study/node_modules/has-to-string-tag-x/package.json @@ -0,0 +1,112 @@ +{ + "_from": "has-to-string-tag-x@^1.2.0", + "_id": "has-to-string-tag-x@1.4.1", + "_inBundle": false, + "_integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "_location": "/has-to-string-tag-x", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-to-string-tag-x@^1.2.0", + "name": "has-to-string-tag-x", + "escapedName": "has-to-string-tag-x", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/isurl" + ], + "_resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "_shasum": "a045ab383d7b4b2012a00148ab0aa5f290044d4d", + "_spec": "has-to-string-tag-x@^1.2.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\isurl", + "author": { + "name": "Graham Fairweather", + "email": "xotic750@gmail.com" + }, + "bugs": { + "url": "https://github.com/Xotic750/has-to-string-tag-x/issues" + }, + "bundleDependencies": false, + "copyright": "Copyright (c) 2015-2017", + "dependencies": { + "has-symbol-support-x": "^1.4.1" + }, + "deprecated": false, + "description": "Tests if ES6 @@toStringTag is supported.", + "devDependencies": { + "@xotic750/eslint-config-standard-x": "^2.2.1", + "browserify": "^14.4.0", + "browserify-derequire": "^0.9.4", + "cross-env": "^5.0.1", + "es5-shim": "^4.5.9", + "es6-shim": "^0.35.3", + "es7-shim": "^6.0.0", + "eslint": "^4.2.0", + "eslint-plugin-compat": "^1.0.4", + "eslint-plugin-css-modules": "^2.7.2", + "eslint-plugin-eslint-comments": "^1.0.2", + "eslint-plugin-jsdoc": "^3.1.1", + "eslint-plugin-json": "^1.2.0", + "eslint-plugin-no-use-extend-native": "^0.3.12", + "husky": "^0.13.4", + "jasmine-node": "^1.14.5", + "jsdoc-to-markdown": "^3.0.0", + "json3": "^3.3.2", + "make-jasmine-spec-runner-html": "^1.3.0", + "ncp": "^2.0.0", + "nodemon": "^1.11.0", + "nsp": "^2.6.3", + "parallelshell": "^3.0.1", + "replace-x": "^1.5.0", + "rimraf": "^2.6.1", + "serve": "^6.0.2", + "uglify-js": "^3.0.24" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/Xotic750/has-to-string-tag-x", + "keywords": [ + "ES6", + "hasToStringTag", + "module", + "javascript", + "nodejs", + "browser" + ], + "license": "MIT", + "main": "index.js", + "name": "has-to-string-tag-x", + "repository": { + "type": "git", + "url": "git+https://github.com/Xotic750/has-to-string-tag-x.git" + }, + "scripts": { + "browserify": "browserify -p browserify-derequire -e index.js -o lib/has-to-string-tag-x.js -u 'crypto' -s returnExports", + "build": "npm run clean && npm run lint && npm run browserify && npm run uglify && npm run docs && npm test && npm run security", + "build:description": "replace-x \" @file .*\" \" @file $(node -p -e \"require('./package.json').description\")\" index.js", + "build:jasmine": "npm run clean:jasmine && make-jasmine-spec-runner-html", + "build:name": "replace-x \" @module .*\" \" @module $(node -p -e \"require('./package.json').name\")\" index.js", + "build:replace": "npm run build:setver && npm run build:name && npm run build:description", + "build:setver": "replace-x \" @version .*\" \" @version $(node -p -e \"require('./package.json').version\")\" index.js", + "clean": "rimraf README.md lib/*", + "clean:all": "npm run clean:jasmine && npm run clean", + "clean:jasmine": "rimraf tests/index.html tests/run.js", + "docs": "npm run docs:badges && jsdoc2md --name-format --example-lang js index.js >> README.md", + "docs:badges": "ncp badges.html README.md && npm run docs:name", + "docs:name": "replace-x \"@{PACKAGE-NAME}\" \"$(node -p -e \"require('./package.json').name\")\" README.md", + "lint": "eslint *.js tests/spec/*.js", + "lint-fix": "npm run lint -- --fix", + "precommit": "npm run production", + "prepush": "npm run production", + "production": "npm run clean:all && npm run build:jasmine && npm run build:replace && npm run build", + "security": "nsp check", + "start": "parallelshell \"serve\" \"nodemon --watch index.js --exec 'npm run build'\"", + "test": "jasmine-node --matchall tests/spec/", + "uglify": "uglifyjs lib/has-to-string-tag-x.js -o lib/has-to-string-tag-x.min.js --config-file .uglifyjsrc.json" + }, + "version": "1.4.1" +} diff --git a/day1/cli-study/node_modules/has/LICENSE-MIT b/day1/cli-study/node_modules/has/LICENSE-MIT new file mode 100644 index 0000000..ae7014d --- /dev/null +++ b/day1/cli-study/node_modules/has/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Thiago de Arruda + +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. diff --git a/day1/cli-study/node_modules/has/README.md b/day1/cli-study/node_modules/has/README.md new file mode 100644 index 0000000..635e3a4 --- /dev/null +++ b/day1/cli-study/node_modules/has/README.md @@ -0,0 +1,18 @@ +# has + +> Object.prototype.hasOwnProperty.call shortcut + +## Installation + +```sh +npm install --save has +``` + +## Usage + +```js +var has = require('has'); + +has({}, 'hasOwnProperty'); // false +has(Object.prototype, 'hasOwnProperty'); // true +``` diff --git a/day1/cli-study/node_modules/has/package.json b/day1/cli-study/node_modules/has/package.json new file mode 100644 index 0000000..3488946 --- /dev/null +++ b/day1/cli-study/node_modules/has/package.json @@ -0,0 +1,76 @@ +{ + "_from": "has@^1.0.3", + "_id": "has@1.0.3", + "_inBundle": false, + "_integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "_location": "/has", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has@^1.0.3", + "name": "has", + "escapedName": "has", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/es-abstract", + "/eslint-plugin-import", + "/object.entries", + "/object.values" + ], + "_resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "_shasum": "722d7cbfc1f6aa8241f16dd814e011e1f41e8796", + "_spec": "has@^1.0.3", + "_where": "F:\\前端学习\\cli-study\\node_modules\\object.entries", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "function-bind": "^1.1.1" + }, + "deprecated": false, + "description": "Object.prototype.hasOwnProperty.call shortcut", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "eslint": "^4.19.1", + "tape": "^4.9.0" + }, + "engines": { + "node": ">= 0.4.0" + }, + "homepage": "https://github.com/tarruda/has", + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src", + "name": "has", + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "tape test" + }, + "version": "1.0.3" +} diff --git a/day1/cli-study/node_modules/has/src/index.js b/day1/cli-study/node_modules/has/src/index.js new file mode 100644 index 0000000..dd92dd9 --- /dev/null +++ b/day1/cli-study/node_modules/has/src/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/day1/cli-study/node_modules/has/test/index.js b/day1/cli-study/node_modules/has/test/index.js new file mode 100644 index 0000000..43d480b --- /dev/null +++ b/day1/cli-study/node_modules/has/test/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var test = require('tape'); +var has = require('../'); + +test('has', function (t) { + t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); + t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); + t.end(); +}); diff --git a/day1/cli-study/node_modules/hosted-git-info/CHANGELOG.md b/day1/cli-study/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 0000000..4f86601 --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,141 @@ +# 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. + + +## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29) + + +### Bug Fixes + +* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66) + + + + +## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26) + + +### Bug Fixes + +* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62) +* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) + + + + +## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25) + + + + +## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + + +### Bug Fixes + +* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) +* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) + + + + +## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + + + + +## [2.8.3](https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.3) (2019-08-12) + + + + +## [2.8.2](https://github.com/npm/hosted-git-info/compare/v2.8.1...v2.8.2) (2019-08-05) + + +### Bug Fixes + +* http protocol use sshurl by default ([3b1d629](https://github.com/npm/hosted-git-info/commit/3b1d629)), closes [#48](https://github.com/npm/hosted-git-info/issues/48) + + + + +## [2.8.1](https://github.com/npm/hosted-git-info/compare/v2.8.0...v2.8.1) (2019-08-05) + + +### Bug Fixes + +* ignore noCommittish on tarball url generation ([5d4a8d7](https://github.com/npm/hosted-git-info/commit/5d4a8d7)) +* use gist tarball url that works for anonymous gists ([1692435](https://github.com/npm/hosted-git-info/commit/1692435)) + + + + +# [2.8.0](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.0) (2019-08-05) + + +### Bug Fixes + +* Allow slashes in gitlab project section ([bbcf7b2](https://github.com/npm/hosted-git-info/commit/bbcf7b2)), closes [#46](https://github.com/npm/hosted-git-info/issues/46) [#43](https://github.com/npm/hosted-git-info/issues/43) +* **git-host:** disallow URI-encoded slash (%2F) in `path` ([3776fa5](https://github.com/npm/hosted-git-info/commit/3776fa5)), closes [#44](https://github.com/npm/hosted-git-info/issues/44) +* **gitlab:** Do not URL encode slashes in project name for GitLab https URL ([cbf04f9](https://github.com/npm/hosted-git-info/commit/cbf04f9)), closes [#47](https://github.com/npm/hosted-git-info/issues/47) +* do not allow invalid gist urls ([d5cf830](https://github.com/npm/hosted-git-info/commit/d5cf830)) +* **cache:** Switch to lru-cache to save ourselves from unlimited memory consumption ([e518222](https://github.com/npm/hosted-git-info/commit/e518222)), closes [#38](https://github.com/npm/hosted-git-info/issues/38) + + +### Features + +* give these objects a name ([60abaea](https://github.com/npm/hosted-git-info/commit/60abaea)) + + + + +## [2.7.1](https://github.com/npm/hosted-git-info/compare/v2.7.0...v2.7.1) (2018-07-07) + + +### Bug Fixes + +* **index:** Guard against non-string types ([5bc580d](https://github.com/npm/hosted-git-info/commit/5bc580d)) +* **parse:** Crash on strings that parse to having no host ([c931482](https://github.com/npm/hosted-git-info/commit/c931482)), closes [#35](https://github.com/npm/hosted-git-info/issues/35) + + + + +# [2.7.0](https://github.com/npm/hosted-git-info/compare/v2.6.1...v2.7.0) (2018-07-06) + + +### Bug Fixes + +* **github tarball:** update github tarballtemplate ([6efd582](https://github.com/npm/hosted-git-info/commit/6efd582)), closes [#34](https://github.com/npm/hosted-git-info/issues/34) +* **gitlab docs:** switched to lowercase anchors for readmes ([701bcd1](https://github.com/npm/hosted-git-info/commit/701bcd1)) + + +### Features + +* **all:** Support www. prefixes on hostnames ([3349575](https://github.com/npm/hosted-git-info/commit/3349575)), closes [#32](https://github.com/npm/hosted-git-info/issues/32) + + + + +## [2.6.1](https://github.com/npm/hosted-git-info/compare/v2.6.0...v2.6.1) (2018-06-25) + +### Bug Fixes + +* **Revert:** "compat: remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25))" ([cce5a62](https://github.com/npm/hosted-git-info/commit/cce5a62)) +* **Revert:** "git-host: fix forgotten extend()" ([a815ec9](https://github.com/npm/hosted-git-info/commit/a815ec9)) + + + + +# [2.6.0](https://github.com/npm/hosted-git-info/compare/v2.5.0...v2.6.0) (2018-03-07) + + +### Bug Fixes + +* **compat:** remove Object.assign fallback ([#25](https://github.com/npm/hosted-git-info/issues/25)) ([627ab55](https://github.com/npm/hosted-git-info/commit/627ab55)) +* **git-host:** fix forgotten extend() ([eba1f7b](https://github.com/npm/hosted-git-info/commit/eba1f7b)) + + +### Features + +* **browse:** fragment support for browse() ([#28](https://github.com/npm/hosted-git-info/issues/28)) ([cd5e5bb](https://github.com/npm/hosted-git-info/commit/cd5e5bb)) diff --git a/day1/cli-study/node_modules/hosted-git-info/LICENSE b/day1/cli-study/node_modules/hosted-git-info/LICENSE new file mode 100644 index 0000000..4505576 --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +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. diff --git a/day1/cli-study/node_modules/hosted-git-info/README.md b/day1/cli-study/node_modules/hosted-git-info/README.md new file mode 100644 index 0000000..7b723f6 --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/README.md @@ -0,0 +1,133 @@ +# hosted-git-info + +This will let you identify and transform various git hosts URLs between +protocols. It also can tell you what the URL is for the raw path for +particular file for direct access without git. + +## Example + +```javascript +var hostedGitInfo = require("hosted-git-info") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) +/* info looks like: +{ + type: "github", + domain: "github.com", + user: "npm", + project: "hosted-git-info" +} +*/ +``` + +If the URL can't be matched with a git host, `null` will be returned. We +can match git, ssh and https urls. Additionally, we can match ssh connect +strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, +`github:npm/hosted-git-info`). Github specifically, is detected in the case +of a third, unprefixed, form: `npm/hosted-git-info`. + +If it does match, the returned object has properties of: + +* info.type -- The short name of the service +* info.domain -- The domain for git protocol use +* info.user -- The name of the user/org on the git host +* info.project -- The name of the project on the git host + +## Version Contract + +The major version will be bumped any time… + +* The constructor stops accepting URLs that it previously accepted. +* A method is removed. +* A method can no longer accept the number and type of arguments it previously accepted. +* A method can return a different type than it currently returns. + +Implications: + +* I do not consider the specific format of the urls returned from, say + `.https()` to be a part of the contract. The contract is that it will + return a string that can be used to fetch the repo via HTTPS. But what + that string looks like, specifically, can change. +* Dropping support for a hosted git provider would constitute a breaking + change. + +## Usage + +### var info = hostedGitInfo.fromUrl(gitSpecifier[, options]) + +* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one. +* *options* is an optional object. It can have the following properties: + * *noCommittish* — If true then committishes won't be included in generated URLs. + * *noGitPlus* — If true then `git+` won't be prefixed on URLs. + +## Methods + +All of the methods take the same options as the `fromUrl` factory. Options +provided to a method override those provided to the constructor. + +* info.file(path, opts) + +Given the path of a file relative to the repository, returns a URL for +directly fetching it from the githost. If no committish was set then +`master` will be used as the default. + +For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` +would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` + +* info.shortcut(opts) + +eg, `github:npm/hosted-git-info` + +* info.browse(path, fragment, opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/package.json`, +`https://github.com/npm/hosted-git-info/tree/v1.2.0/REAMDE.md#supported-hosts` + +* info.bugs(opts) + +eg, `https://github.com/npm/hosted-git-info/issues` + +* info.docs(opts) + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` + +* info.https(opts) + +eg, `git+https://github.com/npm/hosted-git-info.git` + +* info.sshurl(opts) + +eg, `git+ssh://git@github.com/npm/hosted-git-info.git` + +* info.ssh(opts) + +eg, `git@github.com:npm/hosted-git-info.git` + +* info.path(opts) + +eg, `npm/hosted-git-info` + +* info.tarball(opts) + +eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz` + +* info.getDefaultRepresentation() + +Returns the default output type. The default output type is based on the +string you passed in to be parsed + +* info.toString(opts) + +Uses the getDefaultRepresentation to call one of the other methods to get a URL for +this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give +you a normalized version of the URL that still uses the same protocol. + +Shortcuts will still be returned as shortcuts, but the special case github +form of `org/project` will be normalized to `github:org/project`. + +SSH connect strings will be normalized into `git+ssh` URLs. + +## Supported hosts + +Currently this supports Github, Bitbucket and Gitlab. Pull requests for +additional hosts welcome. diff --git a/day1/cli-study/node_modules/hosted-git-info/git-host-info.js b/day1/cli-study/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 0000000..8147e33 --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,79 @@ +'use strict' + +var gitHosts = module.exports = { + github: { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'github.com', + 'treepath': 'tree', + 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', + 'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}' + }, + bitbucket: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'bitbucket.org', + 'treepath': 'src', + 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' + }, + gitlab: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gitlab.com', + 'treepath': 'tree', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}', + 'pathmatch': /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/, + 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', + 'bugstemplate': 'https://{domain}/{project}', + 'gittemplate': 'git://{domain}/{project}.git{#committish}', + 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{project}{/committish}', + 'browsefiletemplate': 'https://{domain}/{project}{/committish}{#path}', + 'docstemplate': 'https://{domain}/{project}{/committish}', + 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', + 'shortcuttemplate': '{type}:{project}{#committish}', + 'pathtemplate': '{project}{#committish}', + 'tarballtemplate': 'https://codeload.github.com/gist/{project}/tar.gz/{committish}', + 'hashformat': function (fragment) { + return 'file-' + formatHashFragment(fragment) + } + } +} + +var gitHostDefaults = { + 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', + 'browsefiletemplate': 'https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', + 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', + 'shortcuttemplate': '{type}:{user}/{project}{#committish}', + 'pathtemplate': '{user}/{project}{#committish}', + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/, + 'hashformat': formatHashFragment +} + +Object.keys(gitHosts).forEach(function (name) { + Object.keys(gitHostDefaults).forEach(function (key) { + if (gitHosts[name][key]) return + gitHosts[name][key] = gitHostDefaults[key] + }) + gitHosts[name].protocols_re = RegExp('^(' + + gitHosts[name].protocols.map(function (protocol) { + return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') + }).join('|') + '):$') +}) + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} diff --git a/day1/cli-study/node_modules/hosted-git-info/git-host.js b/day1/cli-study/node_modules/hosted-git-info/git-host.js new file mode 100644 index 0000000..9616fba --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,156 @@ +'use strict' +var gitHosts = require('./git-host-info.js') +/* eslint-disable node/no-deprecated-api */ + +// copy-pasta util._extend from node's source, to avoid pulling +// the whole util module into peoples' webpack bundles. +/* istanbul ignore next */ +var extend = Object.assign || function _extend (target, source) { + // Don't do anything if source isn't an object + if (source === null || typeof source !== 'object') return target + + var keys = Object.keys(source) + var i = keys.length + while (i--) { + target[keys[i]] = source[keys[i]] + } + return target +} + +module.exports = GitHost +function GitHost (type, user, auth, project, committish, defaultRepresentation, opts) { + var gitHostInfo = this + gitHostInfo.type = type + Object.keys(gitHosts[type]).forEach(function (key) { + gitHostInfo[key] = gitHosts[type][key] + }) + gitHostInfo.user = user + gitHostInfo.auth = auth + gitHostInfo.project = project + gitHostInfo.committish = committish + gitHostInfo.default = defaultRepresentation + gitHostInfo.opts = opts || {} +} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +GitHost.prototype._fill = function (template, opts) { + if (!template) return + var vars = extend({}, opts) + vars.path = vars.path ? vars.path.replace(/^[/]+/g, '') : '' + opts = extend(extend({}, this.opts), opts) + var self = this + Object.keys(this).forEach(function (key) { + if (self[key] != null && vars[key] == null) vars[key] = self[key] + }) + var rawAuth = vars.auth + var rawcommittish = vars.committish + var rawFragment = vars.fragment + var rawPath = vars.path + var rawProject = vars.project + Object.keys(vars).forEach(function (key) { + var value = vars[key] + if ((key === 'path' || key === 'project') && typeof value === 'string') { + vars[key] = value.split('/').map(function (pathComponent) { + return encodeURIComponent(pathComponent) + }).join('/') + } else { + vars[key] = encodeURIComponent(value) + } + }) + vars['auth@'] = rawAuth ? rawAuth + '@' : '' + vars['#fragment'] = rawFragment ? '#' + this.hashformat(rawFragment) : '' + vars.fragment = vars.fragment ? vars.fragment : '' + vars['#path'] = rawPath ? '#' + this.hashformat(rawPath) : '' + vars['/path'] = vars.path ? '/' + vars.path : '' + vars.projectPath = rawProject.split('/').map(encodeURIComponent).join('/') + if (opts.noCommittish) { + vars['#committish'] = '' + vars['/tree/committish'] = '' + vars['/committish'] = '' + vars.committish = '' + } else { + vars['#committish'] = rawcommittish ? '#' + rawcommittish : '' + vars['/tree/committish'] = vars.committish + ? '/' + vars.treepath + '/' + vars.committish + : '' + vars['/committish'] = vars.committish ? '/' + vars.committish : '' + vars.committish = vars.committish || 'master' + } + var res = template + Object.keys(vars).forEach(function (key) { + res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) + }) + if (opts.noGitPlus) { + return res.replace(/^git[+]/, '') + } else { + return res + } +} + +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) +} + +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) +} + +GitHost.prototype.browse = function (P, F, opts) { + if (typeof P === 'string') { + if (typeof F !== 'string') { + opts = F + F = null + } + return this._fill(this.browsefiletemplate, extend({ + fragment: F, + path: P + }, opts)) + } else { + return this._fill(this.browsetemplate, P) + } +} + +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) +} + +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) +} + +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) +} + +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) +} + +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) +} + +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) +} + +GitHost.prototype.tarball = function (opts_) { + var opts = extend({}, opts_, { noCommittish: false }) + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ path: P }, opts)) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function (opts) { + if (this.default && typeof this[this.default] === 'function') return this[this.default](opts) + return this.sshurl(opts) +} diff --git a/day1/cli-study/node_modules/hosted-git-info/index.js b/day1/cli-study/node_modules/hosted-git-info/index.js new file mode 100644 index 0000000..21e53fe --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/index.js @@ -0,0 +1,148 @@ +'use strict' +var url = require('url') +var gitHosts = require('./git-host-info.js') +var GitHost = module.exports = require('./git-host.js') + +var protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +var cache = {} + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') return + var key = giturl + JSON.stringify(opts || {}) + + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) + } + + return cache[key] +} + +function fromUrl (giturl, opts) { + if (giturl == null || giturl === '') return + var url = fixupUnqualifiedGist( + isGitHubShorthand(giturl) ? 'github:' + giturl : giturl + ) + var parsed = parseGitUrl(url) + var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) + var matches = Object.keys(gitHosts).map(function (gitHostName) { + try { + var gitHostInfo = gitHosts[gitHostName] + var auth = null + if (parsed.auth && authProtocols[parsed.protocol]) { + auth = parsed.auth + } + var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null + var user = null + var project = null + var defaultRepresentation = null + if (shortcutMatch && shortcutMatch[1] === gitHostName) { + user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) + project = decodeURIComponent(shortcutMatch[3]) + defaultRepresentation = 'shortcut' + } else { + if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return + if (!gitHostInfo.protocols_re.test(parsed.protocol)) return + if (!parsed.path) return + var pathmatch = gitHostInfo.pathmatch + var matched = parsed.path.match(pathmatch) + if (!matched) return + /* istanbul ignore else */ + if (matched[1] !== null && matched[1] !== undefined) { + user = decodeURIComponent(matched[1].replace(/^:/, '')) + } + project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + /* istanbul ignore else */ + if (ex instanceof URIError) { + } else throw ex + } + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +function isGitHubShorthand (arg) { + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) +} + +function fixupUnqualifiedGist (giturl) { + // necessary for round-tripping gists + var parsed = url.parse(giturl) + if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { + return parsed.protocol + '/' + parsed.host + } else { + return giturl + } +} + +function parseGitUrl (giturl) { + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) { + var legacy = url.parse(giturl) + // If we don't have url.URL, then sorry, this is just not fixable. + // This affects Node <= 6.12. + if (legacy.auth && typeof url.URL === 'function') { + // git urls can be in the form of scp-style/ssh-connect strings, like + // git+ssh://user@host.com:some/path, which the legacy url parser + // supports, but WhatWG url.URL class does not. However, the legacy + // parser de-urlencodes the username and password, so something like + // https://user%3An%40me:p%40ss%3Aword@x.com/ becomes + // https://user:n@me:p@ss:word@x.com/ which is all kinds of wrong. + // Pull off just the auth and host, so we dont' get the confusing + // scp-style URL, then pass that to the WhatWG parser to get the + // auth properly escaped. + var authmatch = giturl.match(/[^@]+@[^:/]+/) + /* istanbul ignore else - this should be impossible */ + if (authmatch) { + var whatwg = new url.URL(authmatch[0]) + legacy.auth = whatwg.username || '' + if (whatwg.password) legacy.auth += ':' + whatwg.password + } + } + return legacy + } + return { + protocol: 'git+ssh:', + slashes: true, + auth: matched[1], + host: matched[2], + port: null, + hostname: matched[2], + hash: matched[4], + search: null, + query: null, + pathname: '/' + matched[3], + path: '/' + matched[3], + href: 'git+ssh://' + matched[1] + '@' + matched[2] + + '/' + matched[3] + (matched[4] || '') + } +} diff --git a/day1/cli-study/node_modules/hosted-git-info/package.json b/day1/cli-study/node_modules/hosted-git-info/package.json new file mode 100644 index 0000000..aa99251 --- /dev/null +++ b/day1/cli-study/node_modules/hosted-git-info/package.json @@ -0,0 +1,69 @@ +{ + "_from": "hosted-git-info@^2.1.4", + "_id": "hosted-git-info@2.8.8", + "_inBundle": false, + "_integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "_location": "/hosted-git-info", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hosted-git-info@^2.1.4", + "name": "hosted-git-info", + "escapedName": "hosted-git-info", + "rawSpec": "^2.1.4", + "saveSpec": null, + "fetchSpec": "^2.1.4" + }, + "_requiredBy": [ + "/normalize-package-data" + ], + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "_shasum": "7539bd4bc1e0e0a895815a2e0262420b12858488", + "_spec": "hosted-git-info@^2.1.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\normalize-package-data", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.7.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ], + "homepage": "https://github.com/npm/hosted-git-info", + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "license": "ISC", + "main": "index.js", + "name": "hosted-git-info", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "scripts": { + "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", + "posttest": "standard", + "prerelease": "npm t", + "release": "standard-version -s", + "test": "tap -J --coverage=90 --no-esm test/*.js", + "test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js" + }, + "version": "2.8.8" +} diff --git a/day1/cli-study/node_modules/http-cache-semantics/README.md b/day1/cli-study/node_modules/http-cache-semantics/README.md new file mode 100644 index 0000000..99069fc --- /dev/null +++ b/day1/cli-study/node_modules/http-cache-semantics/README.md @@ -0,0 +1,177 @@ +# Can I cache this? [![Build Status](https://travis-ci.org/pornel/http-cache-semantics.svg?branch=master)](https://travis-ci.org/pornel/http-cache-semantics) + +`CachePolicy` tells when responses can be reused from a cache, taking into account [HTTP RFC 7234](http://httpwg.org/specs/rfc7234.html) rules for user agents and shared caches. It's aware of many tricky details such as the `Vary` header, proxy revalidation, and authenticated responses. + +## Usage + +Cacheability of an HTTP response depends on how it was requested, so both `request` and `response` are required to create the policy. + +```js +const policy = new CachePolicy(request, response, options); + +if (!policy.storable()) { + // throw the response away, it's not usable at all + return; +} + +// Cache the data AND the policy object in your cache +// (this is pseudocode, roll your own cache (lru-cache package works)) +letsPretendThisIsSomeCache.set(request.url, {policy, response}, policy.timeToLive()); +``` + +```js +// And later, when you receive a new request: +const {policy, response} = letsPretendThisIsSomeCache.get(newRequest.url); + +// It's not enough that it exists in the cache, it has to match the new request, too: +if (policy && policy.satisfiesWithoutRevalidation(newRequest)) { + // OK, the previous response can be used to respond to the `newRequest`. + // Response headers have to be updated, e.g. to add Age and remove uncacheable headers. + response.headers = policy.responseHeaders(); + return response; +} +``` + +It may be surprising, but it's not enough for an HTTP response to be [fresh](#yo-fresh) to satisfy a request. It may need to match request headers specified in `Vary`. Even a matching fresh response may still not be usable if the new request restricted cacheability, etc. + +The key method is `satisfiesWithoutRevalidation(newRequest)`, which checks whether the `newRequest` is compatible with the original request and whether all caching conditions are met. + +### Constructor options + +Request and response must have a `headers` property with all header names in lower case. `url`, `status` and `method` are optional (defaults are any URL, status `200`, and `GET` method). + +```js +const request = { + url: '/', + method: 'GET', + headers: { + accept: '*/*', + }, +}; + +const response = { + status: 200, + headers: { + 'cache-control': 'public, max-age=7234', + }, +}; + +const options = { + shared: true, + cacheHeuristic: 0.1, + immutableMinTimeToLive: 24*3600*1000, // 24h + ignoreCargoCult: false, +}; +``` + +If `options.shared` is `true` (default), then the response is evaluated from a perspective of a shared cache (i.e. `private` is not cacheable and `s-maxage` is respected). If `options.shared` is `false`, then the response is evaluated from a perspective of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored). + +`options.cacheHeuristic` is a fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%), e.g. if a file hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10 days. + +`options.immutableMinTimeToLive` is a number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`. Note that [per RFC](http://httpwg.org/http-extensions/immutable.html) these can become stale, so `max-age` still overrides the default. + +If `options.ignoreCargoCult` is true, common anti-cache directives will be completely ignored if the non-standard `pre-check` and `post-check` directives are present. These two useless directives are most commonly found in bad StackOverflow answers and PHP's "session limiter" defaults. + +### `storable()` + +Returns `true` if the response can be stored in a cache. If it's `false` then you MUST NOT store either the request or the response. + +### `satisfiesWithoutRevalidation(newRequest)` + +This is the most important method. Use this method to check whether the cached response is still fresh in the context of the new request. + +If it returns `true`, then the given `request` matches the original response this cache policy has been created with, and the response can be reused without contacting the server. Note that the old response can't be returned without being updated, see `responseHeaders()`. + +If it returns `false`, then the response may not be matching at all (e.g. it's for a different URL or method), or may require to be refreshed first (see `revalidationHeaders()`). + +### `responseHeaders()` + +Returns updated, filtered set of response headers to return to clients receiving the cached response. This function is necessary, because proxies MUST always remove hop-by-hop headers (such as `TE` and `Connection`) and update response's `Age` to avoid doubling cache time. + +```js +cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse); +``` + +### `timeToLive()` + +Returns approximate time in *milliseconds* until the response becomes stale (i.e. not fresh). + +After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However, there are exceptions, e.g. a client can explicitly allow stale responses, so always check with `satisfiesWithoutRevalidation()`. + +### `toObject()`/`fromObject(json)` + +Chances are you'll want to store the `CachePolicy` object along with the cached response. `obj = policy.toObject()` gives a plain JSON-serializable object. `policy = CachePolicy.fromObject(obj)` creates an instance from it. + +### Refreshing stale cache (revalidation) + +When a cached response has expired, it can be made fresh again by making a request to the origin server. The server may respond with status 304 (Not Modified) without sending the response body again, saving bandwidth. + +The following methods help perform the update efficiently and correctly. + +#### `revalidationHeaders(newRequest)` + +Returns updated, filtered set of request headers to send to the origin server to check if the cached response can be reused. These headers allow the origin server to return status 304 indicating the response is still fresh. All headers unrelated to caching are passed through as-is. + +Use this method when updating cache from the origin server. + +```js +updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest); +``` + +#### `revalidatedPolicy(revalidationRequest, revalidationResponse)` + +Use this method to update the cache after receiving a new response from the origin server. It returns an object with two keys: + +* `policy` — A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace the old cached `CachePolicy` with the new one. +* `modified` — Boolean indicating whether the response body has changed. + * If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old cached response body. + * If `true`, you should use new response's body (if present), or make another request to the origin server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get the new resource. + +```js +// When serving requests from cache: +const {oldPolicy, oldResponse} = letsPretendThisIsSomeCache.get(newRequest.url); + +if (!oldPolicy.satisfiesWithoutRevalidation(newRequest)) { + // Change the request to ask the origin server if the cached response can be used + newRequest.headers = oldPolicy.revalidationHeaders(newRequest); + + // Send request to the origin server. The server may respond with status 304 + const newResponse = await makeRequest(newResponse); + + // Create updated policy and combined response from the old and new data + const {policy, modified} = oldPolicy.revalidatedPolicy(newRequest, newResponse); + const response = modified ? newResponse : oldResponse; + + // Update the cache with the newer/fresher response + letsPretendThisIsSomeCache.set(newRequest.url, {policy, response}, policy.timeToLive()); + + // And proceed returning cached response as usual + response.headers = policy.responseHeaders(); + return response; +} +``` + +# Yo, FRESH + +![satisfiesWithoutRevalidation](fresh.jpg) + +## Used by + +* [ImageOptim API](https://imageoptim.com/api), [make-fetch-happen](https://github.com/zkat/make-fetch-happen), [cacheable-request](https://www.npmjs.com/package/cacheable-request), [npm/registry-fetch](https://github.com/npm/registry-fetch), [etc.](https://github.com/pornel/http-cache-semantics/network/dependents) + +## Implemented + +* `Cache-Control` response header with all the quirks. +* `Expires` with check for bad clocks. +* `Pragma` response header. +* `Age` response header. +* `Vary` response header. +* Default cacheability of statuses and methods. +* Requests for stale data. +* Filtering of hop-by-hop headers. +* Basic revalidation request + +## Unimplemented + +* Merging of range requests, If-Range (but correctly supports them as non-cacheable) +* Revalidation of multiple representations diff --git a/day1/cli-study/node_modules/http-cache-semantics/node4/index.js b/day1/cli-study/node_modules/http-cache-semantics/node4/index.js new file mode 100644 index 0000000..bcdaebe --- /dev/null +++ b/day1/cli-study/node_modules/http-cache-semantics/node4/index.js @@ -0,0 +1,559 @@ +'use strict'; +// rfc7231 6.1 + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var statusCodeCacheableByDefault = [200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501]; + +// This implementation does not understand partial responses (206) +var understoodStatuses = [200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 405, 410, 414, 501]; + +var hopByHopHeaders = { 'connection': true, 'keep-alive': true, 'proxy-authenticate': true, 'proxy-authorization': true, 'te': true, 'trailer': true, 'transfer-encoding': true, 'upgrade': true }; +var excludedFromRevalidationUpdate = { + // Since the old body is reused, it doesn't make sense to change properties of the body + 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, + 'content-range': true +}; + +function parseCacheControl(header) { + var cc = {}; + if (!header) return cc; + + // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), + // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale + var parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing + for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var part = _ref; + + var _part$split = part.split(/\s*=\s*/, 2), + k = _part$split[0], + v = _part$split[1]; + + cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting + } + + return cc; +} + +function formatCacheControl(cc) { + var parts = []; + for (var k in cc) { + var v = cc[k]; + parts.push(v === true ? k : k + '=' + v); + } + if (!parts.length) { + return undefined; + } + return parts.join(', '); +} + +module.exports = function () { + function CachePolicy(req, res) { + var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + shared = _ref2.shared, + cacheHeuristic = _ref2.cacheHeuristic, + immutableMinTimeToLive = _ref2.immutableMinTimeToLive, + ignoreCargoCult = _ref2.ignoreCargoCult, + _fromObject = _ref2._fromObject; + + _classCallCheck(this, CachePolicy); + + if (_fromObject) { + this._fromObject(_fromObject); + return; + } + + if (!res || !res.headers) { + throw Error("Response headers missing"); + } + this._assertRequestHasHeaders(req); + + this._responseTime = this.now(); + this._isShared = shared !== false; + this._cacheHeuristic = undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE + this._immutableMinTtl = undefined !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1000; + + this._status = 'status' in res ? res.status : 200; + this._resHeaders = res.headers; + this._rescc = parseCacheControl(res.headers['cache-control']); + this._method = 'method' in req ? req.method : 'GET'; + this._url = req.url; + this._host = req.headers.host; + this._noAuthorization = !req.headers.authorization; + this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used + this._reqcc = parseCacheControl(req.headers['cache-control']); + + // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, + // so there's no point stricly adhering to the blindly copy&pasted directives. + if (ignoreCargoCult && "pre-check" in this._rescc && "post-check" in this._rescc) { + delete this._rescc['pre-check']; + delete this._rescc['post-check']; + delete this._rescc['no-cache']; + delete this._rescc['no-store']; + delete this._rescc['must-revalidate']; + this._resHeaders = Object.assign({}, this._resHeaders, { 'cache-control': formatCacheControl(this._rescc) }); + delete this._resHeaders.expires; + delete this._resHeaders.pragma; + } + + // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive + // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). + if (!res.headers['cache-control'] && /no-cache/.test(res.headers.pragma)) { + this._rescc['no-cache'] = true; + } + } + + CachePolicy.prototype.now = function now() { + return Date.now(); + }; + + CachePolicy.prototype.storable = function storable() { + // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. + return !!(!this._reqcc['no-store'] && ( + // A cache MUST NOT store a response to any request, unless: + // The request method is understood by the cache and defined as being cacheable, and + 'GET' === this._method || 'HEAD' === this._method || 'POST' === this._method && this._hasExplicitExpiration()) && + // the response status code is understood by the cache, and + understoodStatuses.indexOf(this._status) !== -1 && + // the "no-store" cache directive does not appear in request or response header fields, and + !this._rescc['no-store'] && ( + // the "private" response directive does not appear in the response, if the cache is shared, and + !this._isShared || !this._rescc.private) && ( + // the Authorization header field does not appear in the request, if the cache is shared, + !this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && ( + // the response either: + + // contains an Expires header field, or + this._resHeaders.expires || + // contains a max-age response directive, or + // contains a s-maxage response directive and the cache is shared, or + // contains a public response directive. + this._rescc.public || this._rescc['max-age'] || this._rescc['s-maxage'] || + // has a status code that is defined as cacheable by default + statusCodeCacheableByDefault.indexOf(this._status) !== -1)); + }; + + CachePolicy.prototype._hasExplicitExpiration = function _hasExplicitExpiration() { + // 4.2.1 Calculating Freshness Lifetime + return this._isShared && this._rescc['s-maxage'] || this._rescc['max-age'] || this._resHeaders.expires; + }; + + CachePolicy.prototype._assertRequestHasHeaders = function _assertRequestHasHeaders(req) { + if (!req || !req.headers) { + throw Error("Request headers missing"); + } + }; + + CachePolicy.prototype.satisfiesWithoutRevalidation = function satisfiesWithoutRevalidation(req) { + this._assertRequestHasHeaders(req); + + // When presented with a request, a cache MUST NOT reuse a stored response, unless: + // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, + // unless the stored response is successfully validated (Section 4.3), and + var requestCC = parseCacheControl(req.headers['cache-control']); + if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { + return false; + } + + if (requestCC['max-age'] && this.age() > requestCC['max-age']) { + return false; + } + + if (requestCC['min-fresh'] && this.timeToLive() < 1000 * requestCC['min-fresh']) { + return false; + } + + // the stored response is either: + // fresh, or allowed to be served stale + if (this.stale()) { + var allowsStale = requestCC['max-stale'] && !this._rescc['must-revalidate'] && (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); + if (!allowsStale) { + return false; + } + } + + return this._requestMatches(req, false); + }; + + CachePolicy.prototype._requestMatches = function _requestMatches(req, allowHeadMethod) { + // The presented effective request URI and that of the stored response match, and + return (!this._url || this._url === req.url) && this._host === req.headers.host && ( + // the request method associated with the stored response allows it to be used for the presented request, and + !req.method || this._method === req.method || allowHeadMethod && 'HEAD' === req.method) && + // selecting header fields nominated by the stored response (if any) match those presented, and + this._varyMatches(req); + }; + + CachePolicy.prototype._allowsStoringAuthenticated = function _allowsStoringAuthenticated() { + // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. + return this._rescc['must-revalidate'] || this._rescc.public || this._rescc['s-maxage']; + }; + + CachePolicy.prototype._varyMatches = function _varyMatches(req) { + if (!this._resHeaders.vary) { + return true; + } + + // A Vary header field-value of "*" always fails to match + if (this._resHeaders.vary === '*') { + return false; + } + + var fields = this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/); + for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var name = _ref3; + + if (req.headers[name] !== this._reqHeaders[name]) return false; + } + return true; + }; + + CachePolicy.prototype._copyWithoutHopByHopHeaders = function _copyWithoutHopByHopHeaders(inHeaders) { + var headers = {}; + for (var name in inHeaders) { + if (hopByHopHeaders[name]) continue; + headers[name] = inHeaders[name]; + } + // 9.1. Connection + if (inHeaders.connection) { + var tokens = inHeaders.connection.trim().split(/\s*,\s*/); + for (var _iterator3 = tokens, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var _name = _ref4; + + delete headers[_name]; + } + } + if (headers.warning) { + var warnings = headers.warning.split(/,/).filter(function (warning) { + return !/^\s*1[0-9][0-9]/.test(warning); + }); + if (!warnings.length) { + delete headers.warning; + } else { + headers.warning = warnings.join(',').trim(); + } + } + return headers; + }; + + CachePolicy.prototype.responseHeaders = function responseHeaders() { + var headers = this._copyWithoutHopByHopHeaders(this._resHeaders); + var age = this.age(); + + // A cache SHOULD generate 113 warning if it heuristically chose a freshness + // lifetime greater than 24 hours and the response's age is greater than 24 hours. + if (age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24) { + headers.warning = (headers.warning ? `${headers.warning}, ` : '') + '113 - "rfc7234 5.5.4"'; + } + headers.age = `${Math.round(age)}`; + return headers; + }; + + /** + * Value of the Date response header or current time if Date was demed invalid + * @return timestamp + */ + + + CachePolicy.prototype.date = function date() { + var dateValue = Date.parse(this._resHeaders.date); + var maxClockDrift = 8 * 3600 * 1000; + if (Number.isNaN(dateValue) || dateValue < this._responseTime - maxClockDrift || dateValue > this._responseTime + maxClockDrift) { + return this._responseTime; + } + return dateValue; + }; + + /** + * Value of the Age header, in seconds, updated for the current time. + * May be fractional. + * + * @return Number + */ + + + CachePolicy.prototype.age = function age() { + var age = Math.max(0, (this._responseTime - this.date()) / 1000); + if (this._resHeaders.age) { + var ageValue = this._ageValue(); + if (ageValue > age) age = ageValue; + } + + var residentTime = (this.now() - this._responseTime) / 1000; + return age + residentTime; + }; + + CachePolicy.prototype._ageValue = function _ageValue() { + var ageValue = parseInt(this._resHeaders.age); + return isFinite(ageValue) ? ageValue : 0; + }; + + /** + * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. + * + * For an up-to-date value, see `timeToLive()`. + * + * @return Number + */ + + + CachePolicy.prototype.maxAge = function maxAge() { + if (!this.storable() || this._rescc['no-cache']) { + return 0; + } + + // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default + // so this implementation requires explicit opt-in via public header + if (this._isShared && this._resHeaders['set-cookie'] && !this._rescc.public && !this._rescc.immutable) { + return 0; + } + + if (this._resHeaders.vary === '*') { + return 0; + } + + if (this._isShared) { + if (this._rescc['proxy-revalidate']) { + return 0; + } + // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. + if (this._rescc['s-maxage']) { + return parseInt(this._rescc['s-maxage'], 10); + } + } + + // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. + if (this._rescc['max-age']) { + return parseInt(this._rescc['max-age'], 10); + } + + var defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; + + var dateValue = this.date(); + if (this._resHeaders.expires) { + var expires = Date.parse(this._resHeaders.expires); + // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). + if (Number.isNaN(expires) || expires < dateValue) { + return 0; + } + return Math.max(defaultMinTtl, (expires - dateValue) / 1000); + } + + if (this._resHeaders['last-modified']) { + var lastModified = Date.parse(this._resHeaders['last-modified']); + if (isFinite(lastModified) && dateValue > lastModified) { + return Math.max(defaultMinTtl, (dateValue - lastModified) / 1000 * this._cacheHeuristic); + } + } + + return defaultMinTtl; + }; + + CachePolicy.prototype.timeToLive = function timeToLive() { + return Math.max(0, this.maxAge() - this.age()) * 1000; + }; + + CachePolicy.prototype.stale = function stale() { + return this.maxAge() <= this.age(); + }; + + CachePolicy.fromObject = function fromObject(obj) { + return new this(undefined, undefined, { _fromObject: obj }); + }; + + CachePolicy.prototype._fromObject = function _fromObject(obj) { + if (this._responseTime) throw Error("Reinitialized"); + if (!obj || obj.v !== 1) throw Error("Invalid serialization"); + + this._responseTime = obj.t; + this._isShared = obj.sh; + this._cacheHeuristic = obj.ch; + this._immutableMinTtl = obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; + this._status = obj.st; + this._resHeaders = obj.resh; + this._rescc = obj.rescc; + this._method = obj.m; + this._url = obj.u; + this._host = obj.h; + this._noAuthorization = obj.a; + this._reqHeaders = obj.reqh; + this._reqcc = obj.reqcc; + }; + + CachePolicy.prototype.toObject = function toObject() { + return { + v: 1, + t: this._responseTime, + sh: this._isShared, + ch: this._cacheHeuristic, + imm: this._immutableMinTtl, + st: this._status, + resh: this._resHeaders, + rescc: this._rescc, + m: this._method, + u: this._url, + h: this._host, + a: this._noAuthorization, + reqh: this._reqHeaders, + reqcc: this._reqcc + }; + }; + + /** + * Headers for sending to the origin server to revalidate stale response. + * Allows server to return 304 to allow reuse of the previous response. + * + * Hop by hop headers are always stripped. + * Revalidation headers may be added or removed, depending on request. + */ + + + CachePolicy.prototype.revalidationHeaders = function revalidationHeaders(incomingReq) { + this._assertRequestHasHeaders(incomingReq); + var headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); + + // This implementation does not understand range requests + delete headers['if-range']; + + if (!this._requestMatches(incomingReq, true) || !this.storable()) { + // revalidation allowed via HEAD + // not for the same resource, or wasn't allowed to be cached anyway + delete headers['if-none-match']; + delete headers['if-modified-since']; + return headers; + } + + /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ + if (this._resHeaders.etag) { + headers['if-none-match'] = headers['if-none-match'] ? `${headers['if-none-match']}, ${this._resHeaders.etag}` : this._resHeaders.etag; + } + + // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. + var forbidsWeakValidators = headers['accept-ranges'] || headers['if-match'] || headers['if-unmodified-since'] || this._method && this._method != 'GET'; + + /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. + Note: This implementation does not understand partial responses (206) */ + if (forbidsWeakValidators) { + delete headers['if-modified-since']; + + if (headers['if-none-match']) { + var etags = headers['if-none-match'].split(/,/).filter(function (etag) { + return !/^\s*W\//.test(etag); + }); + if (!etags.length) { + delete headers['if-none-match']; + } else { + headers['if-none-match'] = etags.join(',').trim(); + } + } + } else if (this._resHeaders['last-modified'] && !headers['if-modified-since']) { + headers['if-modified-since'] = this._resHeaders['last-modified']; + } + + return headers; + }; + + /** + * Creates new CachePolicy with information combined from the previews response, + * and the new revalidation response. + * + * Returns {policy, modified} where modified is a boolean indicating + * whether the response body has been modified, and old cached body can't be used. + * + * @return {Object} {policy: CachePolicy, modified: Boolean} + */ + + + CachePolicy.prototype.revalidatedPolicy = function revalidatedPolicy(request, response) { + this._assertRequestHasHeaders(request); + if (!response || !response.headers) { + throw Error("Response headers missing"); + } + + // These aren't going to be supported exactly, since one CachePolicy object + // doesn't know about all the other cached objects. + var matches = false; + if (response.status !== undefined && response.status != 304) { + matches = false; + } else if (response.headers.etag && !/^\s*W\//.test(response.headers.etag)) { + // "All of the stored responses with the same strong validator are selected. + // If none of the stored responses contain the same strong validator, + // then the cache MUST NOT use the new response to update any stored responses." + matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag; + } else if (this._resHeaders.etag && response.headers.etag) { + // "If the new response contains a weak validator and that validator corresponds + // to one of the cache's stored responses, + // then the most recent of those matching stored responses is selected for update." + matches = this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag.replace(/^\s*W\//, ''); + } else if (this._resHeaders['last-modified']) { + matches = this._resHeaders['last-modified'] === response.headers['last-modified']; + } else { + // If the new response does not include any form of validator (such as in the case where + // a client generates an If-Modified-Since request from a source other than the Last-Modified + // response header field), and there is only one stored response, and that stored response also + // lacks a validator, then that stored response is selected for update. + if (!this._resHeaders.etag && !this._resHeaders['last-modified'] && !response.headers.etag && !response.headers['last-modified']) { + matches = true; + } + } + + if (!matches) { + return { + policy: new this.constructor(request, response), + modified: true + }; + } + + // use other header fields provided in the 304 (Not Modified) response to replace all instances + // of the corresponding header fields in the stored response. + var headers = {}; + for (var k in this._resHeaders) { + headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; + } + + var newResponse = Object.assign({}, response, { + status: this._status, + method: this._method, + headers + }); + return { + policy: new this.constructor(request, newResponse), + modified: false + }; + }; + + return CachePolicy; +}(); \ No newline at end of file diff --git a/day1/cli-study/node_modules/http-cache-semantics/package.json b/day1/cli-study/node_modules/http-cache-semantics/package.json new file mode 100644 index 0000000..d8ab24b --- /dev/null +++ b/day1/cli-study/node_modules/http-cache-semantics/package.json @@ -0,0 +1,58 @@ +{ + "_from": "http-cache-semantics@3.8.1", + "_id": "http-cache-semantics@3.8.1", + "_inBundle": false, + "_integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "_location": "/http-cache-semantics", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "http-cache-semantics@3.8.1", + "name": "http-cache-semantics", + "escapedName": "http-cache-semantics", + "rawSpec": "3.8.1", + "saveSpec": null, + "fetchSpec": "3.8.1" + }, + "_requiredBy": [ + "/cacheable-request" + ], + "_resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "_shasum": "39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2", + "_spec": "http-cache-semantics@3.8.1", + "_where": "F:\\前端学习\\cli-study\\node_modules\\cacheable-request", + "author": { + "name": "Kornel Lesiński", + "email": "kornel@geekhood.net", + "url": "https://kornel.ski/" + }, + "bugs": { + "url": "https://github.com/pornel/http-cache-semantics/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-preset-env": "^1.6.1", + "mocha": "^3.4.2" + }, + "files": [ + "node4/index.js" + ], + "homepage": "https://github.com/pornel/http-cache-semantics#readme", + "license": "BSD-2-Clause", + "main": "node4/index.js", + "name": "http-cache-semantics", + "repository": { + "type": "git", + "url": "git+https://github.com/pornel/http-cache-semantics.git" + }, + "scripts": { + "compile": "babel -d node4/ index.js; babel -d node4/test test", + "prepublish": "npm run compile", + "test": "npm run compile; mocha node4/test" + }, + "version": "3.8.1" +} diff --git a/day1/cli-study/node_modules/iconv-lite/Changelog.md b/day1/cli-study/node_modules/iconv-lite/Changelog.md new file mode 100644 index 0000000..f252313 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/Changelog.md @@ -0,0 +1,162 @@ +# 0.4.24 / 2018-08-22 + + * Added MIK encoding (#196, by @Ivan-Kalatchev) + + +# 0.4.23 / 2018-05-07 + + * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) + * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) + + +# 0.4.22 / 2018-05-05 + + * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) + * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) + + +# 0.4.21 / 2018-04-06 + + * Fix encoding canonicalization (#156) + * Fix the paths in the "browser" field in package.json (#174 by @LMLB) + * Removed "contributors" section in package.json - see Git history instead. + + +# 0.4.20 / 2018-04-06 + + * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) + + +# 0.4.19 / 2017-09-09 + + * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) + * Re-generated windows1255 codec, because it was updated in iconv project + * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 + + +# 0.4.18 / 2017-06-13 + + * Fixed CESU-8 regression in Node v8. + + +# 0.4.17 / 2017-04-22 + + * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) + + +# 0.4.16 / 2017-04-22 + + * Added support for React Native (#150) + * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) + * Fixed typo in Readme (#138 by @jiangzhuo) + * Fixed build for Node v6.10+ by making correct version comparison + * Added a warning if iconv-lite is loaded not as utf-8 (see #142) + + +# 0.4.15 / 2016-11-21 + + * Fixed typescript type definition (#137) + + +# 0.4.14 / 2016-11-20 + + * Preparation for v1.0 + * Added Node v6 and latest Node versions to Travis CI test rig + * Deprecated Node v0.8 support + * Typescript typings (@larssn) + * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) + * Add ms prefix to dbcs windows encodings (@rokoroku) + + +# 0.4.13 / 2015-10-01 + + * Fix silly mistake in deprecation notice. + + +# 0.4.12 / 2015-09-26 + + * Node v4 support: + * Added CESU-8 decoding (#106) + * Added deprecation notice for `extendNodeEncodings` + * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) + + +# 0.4.11 / 2015-07-03 + + * Added CESU-8 encoding. + + +# 0.4.10 / 2015-05-26 + + * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not + just spaces. This should minimize the importance of "default" endianness. + + +# 0.4.9 / 2015-05-24 + + * Streamlined BOM handling: strip BOM by default, add BOM when encoding if + addBOM: true. Added docs to Readme. + * UTF16 now uses UTF16-LE by default. + * Fixed minor issue with big5 encoding. + * Added io.js testing on Travis; updated node-iconv version to test against. + Now we just skip testing SBCS encodings that node-iconv doesn't support. + * (internal refactoring) Updated codec interface to use classes. + * Use strict mode in all files. + + +# 0.4.8 / 2015-04-14 + + * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) + + +# 0.4.7 / 2015-02-05 + + * stop official support of Node.js v0.8. Should still work, but no guarantees. + reason: Packages needed for testing are hard to get on Travis CI. + * work in environment where Object.prototype is monkey patched with enumerable + props (#89). + + +# 0.4.6 / 2015-01-12 + + * fix rare aliases of single-byte encodings (thanks @mscdex) + * double the timeout for dbcs tests to make them less flaky on travis + + +# 0.4.5 / 2014-11-20 + + * fix windows-31j and x-sjis encoding support (@nleush) + * minor fix: undefined variable reference when internal error happens + + +# 0.4.4 / 2014-07-16 + + * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) + * fixed streaming base64 encoding + + +# 0.4.3 / 2014-06-14 + + * added encodings UTF-16BE and UTF-16 with BOM + + +# 0.4.2 / 2014-06-12 + + * don't throw exception if `extendNodeEncodings()` is called more than once + + +# 0.4.1 / 2014-06-11 + + * codepage 808 added + + +# 0.4.0 / 2014-06-10 + + * code is rewritten from scratch + * all widespread encodings are supported + * streaming interface added + * browserify compatibility added + * (optional) extend core primitive encodings to make usage even simpler + * moved from vows to mocha as the testing framework + + diff --git a/day1/cli-study/node_modules/iconv-lite/LICENSE b/day1/cli-study/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000..d518d83 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +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. + diff --git a/day1/cli-study/node_modules/iconv-lite/README.md b/day1/cli-study/node_modules/iconv-lite/README.md new file mode 100644 index 0000000..c981c37 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/README.md @@ -0,0 +1,156 @@ +## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) + + * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. + * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). + * Intuitive encode/decode API + * Streaming support for Node v0.10+ + * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings. + * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included). + * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. + * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`). + * License: MIT. + +[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/) + +## Usage +### Basic API +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API (Node v0.10+) +```javascript + +// Decode stream (from binary stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +### [Deprecated] Extend Node.js own encodings +> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility). + +```javascript +// After this call all Node basic primitives will understand iconv-lite encodings. +iconv.extendNodeEncodings(); + +// Examples: +buf = new Buffer(str, 'win1251'); +buf.write(str, 'gbk'); +str = buf.toString('latin1'); +assert(Buffer.isEncoding('iso-8859-15')); +Buffer.byteLength(str, 'us-ascii'); + +http.createServer(function(req, res) { + req.setEncoding('big5'); + req.collect(function(err, body) { + console.log(body); + }); +}); + +fs.createReadStream("file.txt", "shift_jis"); + +// External modules are also supported (if they use Node primitives, which they probably do). +request = require('request'); +request({ + url: "http://github.com/", + encoding: "cp932" +}); + +// To remove extensions +iconv.undoExtendNodeEncodings(); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). + +## Testing + +```bash +$ git clone git@github.com:ashtuchkin/iconv-lite.git +$ cd iconv-lite +$ npm install +$ npm test + +$ # To view performance: +$ node test/performance.js + +$ # To view test coverage: +$ npm run coverage +$ open coverage/lcov-report/index.html +``` diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-codec.js b/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 0000000..1fe3e16 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,555 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec; + +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; + +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; + + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + + // Load tables. + var mappingTable = codecOptions.table(); + + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); + + this.defaultCharUnicode = iconv.defaultCharUnicode; + + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); + + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 decode tables. + var thirdByteNodeIdx = this.decodeTables.length; + var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + var fourthByteNodeIdx = this.decodeTables.length; + var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; + var secondByteNode = this.decodeTables[secondByteNodeIdx]; + for (var j = 0x30; j <= 0x39; j++) + secondByteNode[j] = NODE_START - thirdByteNodeIdx; + } + for (var i = 0x81; i <= 0xFE; i++) + thirdByteNode[i] = NODE_START - fourthByteNodeIdx; + for (var i = 0x30; i <= 0x39; i++) + fourthByteNode[i] = GB18030_CODE + } +} + +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); + + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; +} + + +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} + +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} + +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} + +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; + + if (uCode >= 0) + this._setEncodeChar(uCode, mbCode); + else if (uCode <= NODE_START) + this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); + else if (uCode <= SEQ_START) + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + } +} + + + +// == Encoder ================================================================== + +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} + +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } + + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; + + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. + + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } + + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} + +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. + + var newBuf = Buffer.alloc(10), j = 0; + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; + + +// == Decoder ================================================================== + +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBuf = Buffer.alloc(0); + + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} + +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, + seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. + uCode; + + if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. + prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; + + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). + uCode = this.defaultCharUnicode.charCodeAt(0); + } + else if (uCode === GB18030_CODE) { + var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode > 0xFFFF) { + uCode -= 0x10000; + var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; + + uCode = 0xDC00 + uCode % 0x400; + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } + + this.nodeIdx = nodeIdx; + this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + return newBuf.slice(0, j).toString('ucs2'); +} + +DBCSDecoder.prototype.end = function() { + var ret = ''; + + // Try to parse all remaining chars. + while (this.prevBuf.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var buf = this.prevBuf.slice(1); + + // Parse remaining as usual. + this.prevBuf = Buffer.alloc(0); + this.nodeIdx = 0; + if (buf.length > 0) + ret += this.write(buf); + } + + this.nodeIdx = 0; + return ret; +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; + + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + Math.floor((r-l+1)/2); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; +} + diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-data.js b/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 0000000..4b61914 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,176 @@ +"use strict"; + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + 'shiftjis': { + type: '_dbcs', + table: function() { return require('./tables/shiftjis.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', + + 'eucjp': { + type: '_dbcs', + table: function() { return require('./tables/eucjp.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', + + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json') }, + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + gb18030: function() { return require('./tables/gb18030-ranges.json') }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, + + 'chinese': 'gb18030', + + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return require('./tables/cp949.json') }, + }, + + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', + + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json') }, + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, + encodeSkipVals: [0xa2cc], + }, + + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/index.js b/day1/cli-study/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 0000000..e304003 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,22 @@ +"use strict"; + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data"), +]; + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/internal.js b/day1/cli-study/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 0000000..05ce38b --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,188 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, +}; + +//------------------------------------------------------------------------------ + +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; + +//------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require('string_decoder').StringDecoder; + +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + StringDecoder.call(this, codec.enc); +} + +InternalDecoder.prototype = StringDecoder.prototype; + + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} + +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} + +InternalEncoder.prototype.end = function() { +} + + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} + +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + + return Buffer.from(str, "base64"); +} + +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} + + +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8(options, codec) { +} + +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} + +InternalEncoderCesu8.prototype.end = function() { +} + +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} + +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} + +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-codec.js b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 0000000..abac5ff --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,72 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } + + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; + + this.encodeBuf = encodeBuf; +} + +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; + + +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; +} + +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} + +SBCSEncoder.prototype.end = function() { +} + + +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} + +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +SBCSDecoder.prototype.end = function() { +} diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 0000000..9b48236 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data.js b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 0000000..fdb81a3 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,174 @@ +"use strict"; + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", + + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", + + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", + + "cp819": "iso88591", + "ibm819": "iso88591", + + "cyrillic": "iso88595", + + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", + + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", + + "hebrew": "iso88598", + "hebrew8": "iso88598", + + "turkish": "iso88599", + "turkish8": "iso88599", + + "thai": "iso885911", + "thai8": "iso885911", + + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", + + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", + + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", + + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", + + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + + "strk10482002": "rk1048", + + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", + + "gb198880": "iso646cn", + "cn": "iso646cn", + + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", + + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", + + "mac": "macintosh", + "csmacintosh": "macintosh", +}; + diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/big5-added.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 0000000..3c3d3c2 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp936.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 0000000..49ddb9a --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp949.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 0000000..2022a00 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp950.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 0000000..d8bc871 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/eucjp.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 0000000..4fa61ca --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 0000000..85c6934 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/gbk-added.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 0000000..8abfa9f --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,55 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc",""], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/tables/shiftjis.json b/day1/cli-study/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 0000000..5a3a43c --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/utf16.js b/day1/cli-study/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 0000000..54765ae --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,177 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf16BEEncoder() { +} + +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; +} + +Utf16BEEncoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf16BEDecoder() { + this.overflowByte = -1; +} + +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; + + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; + + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } + + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } + + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + + return buf2.slice(0, j).toString('ucs2'); +} + +Utf16BEDecoder.prototype.end = function() { +} + + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} + +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; + + +// -- Encoding (pass-through) + +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); +} + +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} + +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} + + +// -- Decoding + +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBytes = []; + this.initialBytesLen = 0; + + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBytes.push(buf); + this.initialBytesLen += buf.length; + + if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + this.initialBytes.length = this.initialBytesLen = 0; + } + + return this.decoder.write(buf); +} + +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var res = this.decoder.write(buf), + trail = this.decoder.end(); + + return trail ? (res + trail) : res; + } + return this.decoder.end(); +} + +function detectEncoding(buf, defaultEncoding) { + var enc = defaultEncoding || 'utf-16le'; + + if (buf.length >= 2) { + // Check BOM. + if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM + enc = 'utf-16be'; + else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM + enc = 'utf-16le'; + else { + // No BOM found. Try to deduce encoding from initial content. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions + _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. + + for (var i = 0; i < _len; i += 2) { + if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; + if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; + } + + if (asciiCharsBE > asciiCharsLE) + enc = 'utf-16be'; + else if (asciiCharsBE < asciiCharsLE) + enc = 'utf-16le'; + } + } + + return enc; +} + + diff --git a/day1/cli-study/node_modules/iconv-lite/encodings/utf7.js b/day1/cli-study/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 0000000..b7631c2 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,290 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; + + +// -- Encoding + +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; + +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} + +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} + +Utf7Encoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); + +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); + +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString(); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString(); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + + +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} + +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } + + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + + return buf.slice(0, bufIdx); +} + +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } + + return buf.slice(0, bufIdx); +} + + +// -- Decoding + +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; + +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + diff --git a/day1/cli-study/node_modules/iconv-lite/lib/bom-handling.js b/day1/cli-study/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 0000000..1050872 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,52 @@ +"use strict"; + +var BOMChar = '\uFEFF'; + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} + +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + + return this.encoder.write(str); +} + +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} + + +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } + + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); +} + diff --git a/day1/cli-study/node_modules/iconv-lite/lib/extend-node.js b/day1/cli-study/node_modules/iconv-lite/lib/extend-node.js new file mode 100644 index 0000000..87f5394 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/lib/extend-node.js @@ -0,0 +1,217 @@ +"use strict"; +var Buffer = require("buffer").Buffer; +// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer + +// == Extend Node primitives to use iconv-lite ================================= + +module.exports = function (iconv) { + var original = undefined; // Place to keep original methods. + + // Node authors rewrote Buffer internals to make it compatible with + // Uint8Array and we cannot patch key functions since then. + // Note: this does use older Buffer API on a purpose + iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array); + + iconv.extendNodeEncodings = function extendNodeEncodings() { + if (original) return; + original = {}; + + if (!iconv.supportsNodeEncodingsExtension) { + console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); + console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); + return; + } + + var nodeNativeEncodings = { + 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, + 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, + }; + + Buffer.isNativeEncoding = function(enc) { + return enc && nodeNativeEncodings[enc.toLowerCase()]; + } + + // -- SlowBuffer ----------------------------------------------------------- + var SlowBuffer = require('buffer').SlowBuffer; + + original.SlowBufferToString = SlowBuffer.prototype.toString; + SlowBuffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.SlowBufferWrite = SlowBuffer.prototype.write; + SlowBuffer.prototype.write = function(string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferWrite.call(this, string, offset, length, encoding); + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + } + + // -- Buffer --------------------------------------------------------------- + + original.BufferIsEncoding = Buffer.isEncoding; + Buffer.isEncoding = function(encoding) { + return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); + } + + original.BufferByteLength = Buffer.byteLength; + Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferByteLength.call(this, str, encoding); + + // Slow, I know, but we don't have a better way yet. + return iconv.encode(str, encoding).length; + } + + original.BufferToString = Buffer.prototype.toString; + Buffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.BufferWrite = Buffer.prototype.write; + Buffer.prototype.write = function(string, offset, length, encoding) { + var _offset = offset, _length = length, _encoding = encoding; + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferWrite.call(this, string, _offset, _length, _encoding); + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + + // TODO: Set _charsWritten. + } + + + // -- Readable ------------------------------------------------------------- + if (iconv.supportsStreams) { + var Readable = require('stream').Readable; + + original.ReadableSetEncoding = Readable.prototype.setEncoding; + Readable.prototype.setEncoding = function setEncoding(enc, options) { + // Use our own decoder, it has the same interface. + // We cannot use original function as it doesn't handle BOM-s. + this._readableState.decoder = iconv.getDecoder(enc, options); + this._readableState.encoding = enc; + } + + Readable.prototype.collect = iconv._collect; + } + } + + // Remove iconv-lite Node primitive extensions. + iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { + if (!iconv.supportsNodeEncodingsExtension) + return; + if (!original) + throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") + + delete Buffer.isNativeEncoding; + + var SlowBuffer = require('buffer').SlowBuffer; + + SlowBuffer.prototype.toString = original.SlowBufferToString; + SlowBuffer.prototype.write = original.SlowBufferWrite; + + Buffer.isEncoding = original.BufferIsEncoding; + Buffer.byteLength = original.BufferByteLength; + Buffer.prototype.toString = original.BufferToString; + Buffer.prototype.write = original.BufferWrite; + + if (iconv.supportsStreams) { + var Readable = require('stream').Readable; + + Readable.prototype.setEncoding = original.ReadableSetEncoding; + delete Readable.prototype.collect; + } + + original = undefined; + } +} diff --git a/day1/cli-study/node_modules/iconv-lite/lib/index.d.ts b/day1/cli-study/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 0000000..0547eb3 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *--------------------------------------------------------------------------------------------*/ + +declare module 'iconv-lite' { + export function decode(buffer: Buffer, encoding: string, options?: Options): string; + + export function encode(content: string, encoding: string, options?: Options): Buffer; + + export function encodingExists(encoding: string): boolean; + + export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; +} + +export interface Options { + stripBOM?: boolean; + addBOM?: boolean; + defaultEncoding?: string; +} diff --git a/day1/cli-study/node_modules/iconv-lite/lib/index.js b/day1/cli-study/node_modules/iconv-lite/lib/index.js new file mode 100644 index 0000000..5391919 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,153 @@ +"use strict"; + +// Some environments don't have global Buffer (e.g. React Native). +// Solution would be installing npm modules "buffer" and "stream" explicitly. +var Buffer = require("safer-buffer").Buffer; + +var bomHandling = require("./bom-handling"), + iconv = module.exports; + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; + +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; + +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} + +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var trail = decoder.end(); + + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } +} + +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var codecDef = iconv.encodings[enc]; + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} + +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); + + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + + return encoder; +} + +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + + +// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. +var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; +if (nodeVer) { + + // Load streaming support in Node v0.10+ + var nodeVerArr = nodeVer.split(".").map(Number); + if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { + require("./streams")(iconv); + } + + // Load Node primitive extensions. + require("./extend-node")(iconv); +} + +if ("Ā" != "\u0100") { + console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} diff --git a/day1/cli-study/node_modules/iconv-lite/lib/streams.js b/day1/cli-study/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 0000000..4409552 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,121 @@ +"use strict"; + +var Buffer = require("buffer").Buffer, + Transform = require("stream").Transform; + + +// == Exports ================================================================== +module.exports = function(iconv) { + + // Additional Public API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } + + iconv.decodeStream = function decodeStream(encoding, options) { + return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; + + + // Not published yet. + iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; + iconv._collect = IconvLiteDecoderStream.prototype.collect; +}; + + +// == Encoder stream ======================================================= +function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); +} + +IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } +}); + +IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; +} + + +// == Decoder stream ======================================================= +function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); +} + +IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } +}); + +IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; +} + diff --git a/day1/cli-study/node_modules/iconv-lite/package.json b/day1/cli-study/node_modules/iconv-lite/package.json new file mode 100644 index 0000000..1ee3677 --- /dev/null +++ b/day1/cli-study/node_modules/iconv-lite/package.json @@ -0,0 +1,76 @@ +{ + "_from": "iconv-lite@^0.4.24", + "_id": "iconv-lite@0.4.24", + "_inBundle": false, + "_integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "_location": "/iconv-lite", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "iconv-lite@^0.4.24", + "name": "iconv-lite", + "escapedName": "iconv-lite", + "rawSpec": "^0.4.24", + "saveSpec": null, + "fetchSpec": "^0.4.24" + }, + "_requiredBy": [ + "/external-editor" + ], + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "_shasum": "2022b4b25fbddc21d2f524974a474aafe733908b", + "_spec": "iconv-lite@^0.4.24", + "_where": "F:\\前端学习\\cli-study\\node_modules\\external-editor", + "author": { + "name": "Alexander Shtuchkin", + "email": "ashtuchkin@gmail.com" + }, + "browser": { + "./lib/extend-node": false, + "./lib/streams": false + }, + "bugs": { + "url": "https://github.com/ashtuchkin/iconv-lite/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "deprecated": false, + "description": "Convert character encodings in pure javascript.", + "devDependencies": { + "async": "*", + "errto": "*", + "iconv": "*", + "istanbul": "*", + "mocha": "^3.1.0", + "request": "~2.87.0", + "semver": "*", + "unorm": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "license": "MIT", + "main": "./lib/index.js", + "name": "iconv-lite", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "scripts": { + "coverage": "istanbul cover _mocha -- --grep .", + "coverage-open": "open coverage/lcov-report/index.html", + "test": "mocha --reporter spec --grep ." + }, + "typings": "./lib/index.d.ts", + "version": "0.4.24" +} diff --git a/day1/cli-study/node_modules/ieee754/LICENSE b/day1/cli-study/node_modules/ieee754/LICENSE new file mode 100644 index 0000000..5aac82c --- /dev/null +++ b/day1/cli-study/node_modules/ieee754/LICENSE @@ -0,0 +1,11 @@ +Copyright 2008 Fair Oaks Labs, Inc. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/day1/cli-study/node_modules/ieee754/README.md b/day1/cli-study/node_modules/ieee754/README.md new file mode 100644 index 0000000..c5291d2 --- /dev/null +++ b/day1/cli-study/node_modules/ieee754/README.md @@ -0,0 +1,53 @@ +# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg +[travis-url]: https://travis-ci.org/feross/ieee754 +[npm-image]: https://img.shields.io/npm/v/ieee754.svg +[npm-url]: https://npmjs.org/package/ieee754 +[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg +[downloads-url]: https://npmjs.org/package/ieee754 +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg +[saucelabs-url]: https://saucelabs.com/u/ieee754 + +### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object. + +## install + +``` +npm install ieee754 +``` + +[Get supported ieee754 with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-ieee754?utm_source=npm-ieee754&utm_medium=referral&utm_campaign=readme) + +## methods + +`var ieee754 = require('ieee754')` + +The `ieee754` object has the following functions: + +``` +ieee754.read = function (buffer, offset, isLE, mLen, nBytes) +ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) +``` + +The arguments mean the following: + +- buffer = the buffer +- offset = offset into the buffer +- value = value to set (only for `write`) +- isLe = is little endian? +- mLen = mantissa length +- nBytes = number of bytes + +## what is ieee754? + +The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point). + +## license + +BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc. diff --git a/day1/cli-study/node_modules/ieee754/index.js b/day1/cli-study/node_modules/ieee754/index.js new file mode 100644 index 0000000..e87e6ff --- /dev/null +++ b/day1/cli-study/node_modules/ieee754/index.js @@ -0,0 +1,84 @@ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} diff --git a/day1/cli-study/node_modules/ieee754/package.json b/day1/cli-study/node_modules/ieee754/package.json new file mode 100644 index 0000000..22efe6d --- /dev/null +++ b/day1/cli-study/node_modules/ieee754/package.json @@ -0,0 +1,69 @@ +{ + "_from": "ieee754@^1.1.4", + "_id": "ieee754@1.1.13", + "_inBundle": false, + "_integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "_location": "/ieee754", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ieee754@^1.1.4", + "name": "ieee754", + "escapedName": "ieee754", + "rawSpec": "^1.1.4", + "saveSpec": null, + "fetchSpec": "^1.1.4" + }, + "_requiredBy": [ + "/buffer" + ], + "_resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "_shasum": "ec168558e95aa181fd87d37f55c32bbcb6708b84", + "_spec": "ieee754@^1.1.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\buffer", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/ieee754/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Romain Beauxis", + "email": "toots@rastageeks.org" + } + ], + "deprecated": false, + "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", + "devDependencies": { + "airtap": "0.1.0", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/ieee754#readme", + "keywords": [ + "IEEE 754", + "buffer", + "convert", + "floating point", + "ieee754" + ], + "license": "BSD-3-Clause", + "main": "index.js", + "name": "ieee754", + "repository": { + "type": "git", + "url": "git://github.com/feross/ieee754.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "version": "1.1.13" +} diff --git a/day1/cli-study/node_modules/ignore/CHANGELOG.md b/day1/cli-study/node_modules/ignore/CHANGELOG.md new file mode 100644 index 0000000..2b25013 --- /dev/null +++ b/day1/cli-study/node_modules/ignore/CHANGELOG.md @@ -0,0 +1,19 @@ +# `node-ignore` 4 ChangeLog + +# 4.x + +## 2018-06-22, Version 4.0.0 + +- **SEMVER-MAJOR**: Drop support for node < 6 by default. +- **FEATURE**: supports the missing character ranges and sets, such as `*.[a-z]` and `*.[jJ][pP][gG]` +- **FEATURE**: new option: `ignorecase` to make `ignore` case sensitive. +- **FEATURE**: supports question mark which matches a single character. +- **PATCH**: fixes typescript declaration. + +## ~ 2018-08-09, Version 4.0.1 - 4.0.5 + +- **PATCH**: updates README.md about frequent asked quesions from github issues. + +## 2018-08-12, Version 4.0.6 + +- **PATCH**: `Object.prototype` methods will not ruin the result any more. diff --git a/day1/cli-study/node_modules/ignore/LICENSE-MIT b/day1/cli-study/node_modules/ignore/LICENSE-MIT new file mode 100644 index 0000000..825533e --- /dev/null +++ b/day1/cli-study/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +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. \ No newline at end of file diff --git a/day1/cli-study/node_modules/ignore/README.md b/day1/cli-study/node_modules/ignore/README.md new file mode 100644 index 0000000..c4d8230 --- /dev/null +++ b/day1/cli-study/node_modules/ignore/README.md @@ -0,0 +1,307 @@ + + + + + + + + + + + + + +
LinuxOS XWindowsCoverageDownloads
+ + Build Status + + + Windows Build Status + + + Coverage Status + + + npm module downloads per month +
+ +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). + +Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. + +##### Tested on + +- Linux + Node: `0.8` - `7.x` +- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +Actually, `ignore` does not rely on any versions of node specially. + +Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md). + +## Table Of Main Contents + +- [Usage](#usage) +- [`Pathname` Conventions](#pathname-conventions) +- [Guide for 2.x -> 3.x](#upgrade-2x---3x) +- [Guide for 3.x -> 4.x](#upgrade-3x---4x) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. + +## Usage + +```js +import ignore from 'ignore' +const ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +const paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +ig.ignores('.abc/a.js') // true +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - Prevent re-including a file if a parent directory of that file is excluded. + - Handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + - All test cases are verified with the result of `git check-ignore`. + +# Methods + +## .add(pattern: string | Ignore): this +## .add(patterns: Array): this + +- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').ignores('#abc') // false +ignore().add('\#abc').ignores('#abc') // true +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore() +.add(fs.readFileSync(filenameOfGitignore).toString()) +.filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +## .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +import fs from 'fs' + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + +## .filter(paths: Array): Array + +```ts +type Pathname = string +``` + +Filters the given array of pathnames, and returns the filtered array. + +- **paths** `Array.` The array of `pathname`s to be filtered. + +### `Pathname` Conventions: + +#### 1. `Pathname` should be a `path.relative()`d pathname + +`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory. + +```js +// WRONG +ig.ignores('./abc') + +// WRONG, for it will never happen. +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// Right +ig.ignores('abc') + +// Right +ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc' +``` + +In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules. + +Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +import glob from 'glob' + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + let filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so for the example below: + +```js +ig.add('config/') + +// `ig` does NOT know if 'config' is a normal file, directory or something +ig.ignores('config') // And it returns `false` + +ig.ignores('config/') // returns `true` +``` + +Specially for people who develop some library based on `node-ignore`, it is important to understand that. + +## .ignores(pathname: Pathname): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## `options.ignorecase` since 4.0.0 + +Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +**** + +# Upgrade Guide + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +## Upgrade 3.x -> 4.x + +Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6: + +```js +var ignore = require('ignore/legacy') +``` + +**** + +# Collaborators + +- [@whitecolor](https://github.com/whitecolor) *Alex* +- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [@azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [@JanMattner](https://github.com/JanMattner) *Jan Mattner* +- [@ntwb](https://github.com/ntwb) *Stephen Edgar* +- [@kasperisager](https://github.com/kasperisager) *Kasper Isager* +- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders* diff --git a/day1/cli-study/node_modules/ignore/index.d.ts b/day1/cli-study/node_modules/ignore/index.d.ts new file mode 100644 index 0000000..be9d5f8 --- /dev/null +++ b/day1/cli-study/node_modules/ignore/index.d.ts @@ -0,0 +1,45 @@ +interface Ignore { + /** + * Adds a rule rules to the current manager. + * @param {string | Ignore} pattern + * @returns IgnoreBase + */ + add(pattern: string | Ignore): Ignore + /** + * Adds several rules to the current manager. + * @param {string[]} patterns + * @returns IgnoreBase + */ + add(patterns: (string | Ignore)[]): Ignore + + /** + * Filters the given array of pathnames, and returns the filtered array. + * NOTICE that each path here should be a relative path to the root of your repository. + * @param paths the array of paths to be filtered. + * @returns The filtered array of paths + */ + filter(paths: string[]): string[] + /** + * Creates a filter function which could filter + * an array of paths with Array.prototype.filter. + */ + createFilter(): (path: string) => boolean + + /** + * Returns Boolean whether pathname should be ignored. + * @param {string} pathname a path to check + * @returns boolean + */ + ignores(pathname: string): boolean +} + +interface Options { + ignorecase?: boolean +} + +/** + * Creates new ignore manager. + */ +declare function ignore(options?: Options): Ignore + +export default ignore diff --git a/day1/cli-study/node_modules/ignore/index.js b/day1/cli-study/node_modules/ignore/index.js new file mode 100644 index 0000000..62c5cf7 --- /dev/null +++ b/day1/cli-study/node_modules/ignore/index.js @@ -0,0 +1,463 @@ +// A simple implementation of make-array +function make_array (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const REGEX_BLANK_LINE = /^\s+$/ +const REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_LEADING_EXCAPED_HASH = /^\\#/ +const SLASH = '/' +const KEY_IGNORE = typeof Symbol !== 'undefined' + ? Symbol.for('node-ignore') + /* istanbul ignore next */ + : 'node-ignore' + +const define = (object, key, value) => + Object.defineProperty(object, key, {value}) + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : '' +) + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const DEFAULT_REPLACER_PREFIX = [ + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a \ ) -> (a ) + /\\?\s+$/, + match => match.indexOf('\\') === 0 + ? ' ' + : '' + ], + + // replace (\ ) with ' ' + [ + /\\\s/g, + () => ' ' + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\^$.|*+(){]/g, + match => `\\${match}` + ], + + [ + // > [abc] matches any character inside the brackets + // > (in this case a, b, or c); + /\[([^\]/]*)($|\])/g, + (match, p1, p2) => p2 === ']' + ? `[${sanitizeRange(p1)}]` + : `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ] +] + +const DEFAULT_REPLACER_SUFFIX = [ + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (match, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule + /(^|[^\\]+)\\\*(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (match, p1) => `${p1}[^\\/]*` + ], + + // trailing wildcard + [ + /(\^|\\\/)?\\\*$/, + (match, p1) => { + const prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } + ], + + [ + // unescape + /\\\\\\/g, + () => '\\' + ] +] + +const POSITIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // 'f' + // matches + // - /f(end) + // - /f/ + // - (start)f(end) + // - (start)f/ + // doesn't match + // - oof + // - foo + // pseudo: + // -> (^|/)f(/|$) + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*/])$/, + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => `${match}(?=$|\\/)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +const NEGATIVE_REPLACERS = [ + ...DEFAULT_REPLACER_PREFIX, + + // #24, #38 + // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) + // A negative pattern without a trailing wildcard should not + // re-include the things inside that directory. + + // eg: + // ['node_modules/*', '!node_modules'] + // should ignore `node_modules/a.js` + [ + /(?:[^*])$/, + match => `${match}(?=$|\\/$)` + ], + + ...DEFAULT_REPLACER_SUFFIX +] + +// A simple cache, because an ignore rule only has only one certain meaning +const cache = Object.create(null) + +// @param {pattern} +const make_regex = (pattern, negative, ignorecase) => { + const r = cache[pattern] + if (r) { + return r + } + + const replacers = negative + ? NEGATIVE_REPLACERS + : POSITIVE_REPLACERS + + const source = replacers.reduce( + (prev, current) => prev.replace(current[0], current[1].bind(pattern)), + pattern + ) + + return cache[pattern] = ignorecase + ? new RegExp(source, 'i') + : new RegExp(source) +} + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && typeof pattern === 'string' + && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const createRule = (pattern, ignorecase) => { + const origin = pattern + let negative = false + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true + pattern = pattern.substr(1) + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#') + + const regex = make_regex(pattern, negative, ignorecase) + + return { + origin, + pattern, + negative, + regex + } +} + +class IgnoreBase { + constructor ({ + ignorecase = true + } = {}) { + this._rules = [] + this._ignorecase = ignorecase + define(this, KEY_IGNORE, true) + this._initCache() + } + + _initCache () { + this._cache = Object.create(null) + } + + // @param {Array.|string|Ignore} pattern + add (pattern) { + this._added = false + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g) + } + + make_array(pattern).forEach(this._addPattern, this) + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignorecase) + this._added = true + this._rules.push(rule) + } + } + + filter (paths) { + return make_array(paths).filter(path => this._filter(path)) + } + + createFilter () { + return path => this._filter(path) + } + + ignores (path) { + return !this._filter(path) + } + + // @returns `Boolean` true if the `path` is NOT ignored + _filter (path, slices) { + if (!path) { + return false + } + + if (path in this._cache) { + return this._cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH) + } + + slices.pop() + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) + && this._test(path) + + // Or only test the path + : this._test(path) + } + + // @returns {Boolean} true if a file is NOT ignored + _test (path) { + // Explicitly define variable type by setting matched to `0` + let matched = 0 + + this._rules.forEach(rule => { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path) + } + }) + + return !matched + } +} + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && ( + process.env && process.env.IGNORE_TEST_WIN32 + || process.platform === 'win32' + ) +) { + const filter = IgnoreBase.prototype._filter + + /* eslint no-control-regex: "off" */ + const make_posix = str => /^\\\\\?\\/.test(str) + || /[^\x00-\x80]+/.test(str) + ? str + : str.replace(/\\/g, '/') + + IgnoreBase.prototype._filter = function filterWin32 (path, slices) { + path = make_posix(path) + return filter.call(this, path, slices) + } +} + +module.exports = options => new IgnoreBase(options) diff --git a/day1/cli-study/node_modules/ignore/legacy.js b/day1/cli-study/node_modules/ignore/legacy.js new file mode 100644 index 0000000..14f377d --- /dev/null +++ b/day1/cli-study/node_modules/ignore/legacy.js @@ -0,0 +1,466 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// A simple implementation of make-array +function make_array(subject) { + return Array.isArray(subject) ? subject : [subject]; +} + +var REGEX_BLANK_LINE = /^\s+$/; +var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var SLASH = '/'; +var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') +/* istanbul ignore next */ +: 'node-ignore'; + +var define = function define(object, key, value) { + return Object.defineProperty(object, key, { value }); +}; + +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : ''; + }); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var DEFAULT_REPLACER_PREFIX = [ + +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a \ ) -> (a ) +/\\?\s+$/, function (match) { + return match.indexOf('\\') === 0 ? ' ' : ''; +}], + +// replace (\ ) with ' ' +[/\\\s/g, function () { + return ' '; +}], + +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\^$.|*+(){]/g, function (match) { + return `\\${match}`; +}], [ +// > [abc] matches any character inside the brackets +// > (in this case a, b, or c); +/\[([^\]/]*)($|\])/g, function (match, p1, p2) { + return p2 === ']' ? `[${sanitizeRange(p1)}]` : `\\${match}`; +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], + +// leading slash +[ + +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], + +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, + +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}]]; + +var DEFAULT_REPLACER_SUFFIX = [ +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], + +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, + +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (match, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], + +// intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule +/(^|[^\\]+)\\\*(?=.+)/g, + +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (match, p1) { + return `${p1}[^\\/]*`; +}], + +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (match, p1) { + var prefix = p1 + // '\^': + // '/*' does not match '' + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + + return `${prefix}(?=$|\\/$)`; +}], [ +// unescape +/\\\\\\/g, function () { + return '\\'; +}]]; + +var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// 'f' +// matches +// - /f(end) +// - /f/ +// - (start)f(end) +// - (start)f/ +// doesn't match +// - oof +// - foo +// pseudo: +// -> (^|/)f(/|$) + +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*/])$/, + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return `${match}(?=$|\\/)`; +}]], DEFAULT_REPLACER_SUFFIX); + +var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ + +// #24, #38 +// The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) +// A negative pattern without a trailing wildcard should not +// re-include the things inside that directory. + +// eg: +// ['node_modules/*', '!node_modules'] +// should ignore `node_modules/a.js` +[/(?:[^*])$/, function (match) { + return `${match}(?=$|\\/$)`; +}]], DEFAULT_REPLACER_SUFFIX); + +// A simple cache, because an ignore rule only has only one certain meaning +var cache = Object.create(null); + +// @param {pattern} +var make_regex = function make_regex(pattern, negative, ignorecase) { + var r = cache[pattern]; + if (r) { + return r; + } + + var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; + + var source = replacers.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + + return cache[pattern] = ignorecase ? new RegExp(source, 'i') : new RegExp(source); +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; + +var createRule = function createRule(pattern, ignorecase) { + var origin = pattern; + var negative = false; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + + var regex = make_regex(pattern, negative, ignorecase); + + return { + origin, + pattern, + negative, + regex + }; +}; + +var IgnoreBase = function () { + function IgnoreBase() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$ignorecase = _ref.ignorecase, + ignorecase = _ref$ignorecase === undefined ? true : _ref$ignorecase; + + _classCallCheck(this, IgnoreBase); + + this._rules = []; + this._ignorecase = ignorecase; + define(this, KEY_IGNORE, true); + this._initCache(); + } + + _createClass(IgnoreBase, [{ + key: '_initCache', + value: function _initCache() { + this._cache = Object.create(null); + } + + // @param {Array.|string|Ignore} pattern + + }, { + key: 'add', + value: function add(pattern) { + this._added = false; + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g); + } + + make_array(pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + + return this; + } + + // legacy + + }, { + key: 'addPattern', + value: function addPattern(pattern) { + return this.add(pattern); + } + }, { + key: '_addPattern', + value: function _addPattern(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + + if (checkPattern(pattern)) { + var rule = createRule(pattern, this._ignorecase); + this._added = true; + this._rules.push(rule); + } + } + }, { + key: 'filter', + value: function filter(paths) { + var _this = this; + + return make_array(paths).filter(function (path) { + return _this._filter(path); + }); + } + }, { + key: 'createFilter', + value: function createFilter() { + var _this2 = this; + + return function (path) { + return _this2._filter(path); + }; + } + }, { + key: 'ignores', + value: function ignores(path) { + return !this._filter(path); + } + + // @returns `Boolean` true if the `path` is NOT ignored + + }, { + key: '_filter', + value: function _filter(path, slices) { + if (!path) { + return false; + } + + if (path in this._cache) { + return this._cache[path]; + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + } + + slices.pop(); + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) + + // Or only test the path + : this._test(path); + } + + // @returns {Boolean} true if a file is NOT ignored + + }, { + key: '_test', + value: function _test(path) { + // Explicitly define variable type by setting matched to `0` + var matched = 0; + + this._rules.forEach(function (rule) { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path); + } + }); + + return !matched; + } + }]); + + return IgnoreBase; +}(); + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore if */ + + +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { + var filter = IgnoreBase.prototype._filter; + + /* eslint no-control-regex: "off" */ + var make_posix = function make_posix(str) { + return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') + ); + }; + + IgnoreBase.prototype._filter = function filterWin32(path, slices) { + path = make_posix(path); + return filter.call(this, path, slices); + }; +} + +module.exports = function (options) { + return new IgnoreBase(options); +}; diff --git a/day1/cli-study/node_modules/ignore/package.json b/day1/cli-study/node_modules/ignore/package.json new file mode 100644 index 0000000..e29499c --- /dev/null +++ b/day1/cli-study/node_modules/ignore/package.json @@ -0,0 +1,92 @@ +{ + "_from": "ignore@^4.0.6", + "_id": "ignore@4.0.6", + "_inBundle": false, + "_integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "_location": "/ignore", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ignore@^4.0.6", + "name": "ignore", + "escapedName": "ignore", + "rawSpec": "^4.0.6", + "saveSpec": null, + "fetchSpec": "^4.0.6" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "_shasum": "750e3db5862087b4737ebac8207ffd1ef27b25fc", + "_spec": "ignore@^4.0.6", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "kael" + }, + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Ignore is a manager and filter for .gitignore rules.", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.7.0", + "codecov": "^3.0.4", + "eslint": "^5.3.0", + "eslint-config-ostai": "^1.3.2", + "eslint-plugin-import": "^2.13.0", + "mkdirp": "^0.5.1", + "pre-suf": "^1.1.0", + "rimraf": "^2.6.2", + "spawn-sync": "^2.0.0", + "tap": "^12.0.1", + "tmp": "0.0.33", + "typescript": "^3.0.1" + }, + "engines": { + "node": ">= 4" + }, + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "license": "MIT", + "name": "ignore", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" + }, + "scripts": { + "build": "babel -o legacy.js index.js", + "posttest": "tap --coverage-report=html && codecov", + "prepublish": "npm run build", + "test": "npm run test-no-cov", + "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", + "test:git": "tap test/git-check-ignore.js", + "test:ignore": "tap test/ignore.js --coverage", + "test:lint": "eslint .", + "test:tsc": "tsc ./test/ts/simple.ts" + }, + "version": "4.0.6" +} diff --git a/day1/cli-study/node_modules/import-fresh/index.d.ts b/day1/cli-study/node_modules/import-fresh/index.d.ts new file mode 100644 index 0000000..708737b --- /dev/null +++ b/day1/cli-study/node_modules/import-fresh/index.d.ts @@ -0,0 +1,28 @@ +/** +Import a module while bypassing the cache. + +@example +``` +// foo.js +let i = 0; +module.exports = () => ++i; + +// index.js +import importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` +*/ +declare function importFresh(moduleId: string): unknown; + +export = importFresh; diff --git a/day1/cli-study/node_modules/import-fresh/index.js b/day1/cli-study/node_modules/import-fresh/index.js new file mode 100644 index 0000000..425ed98 --- /dev/null +++ b/day1/cli-study/node_modules/import-fresh/index.js @@ -0,0 +1,32 @@ +'use strict'; +const path = require('path'); +const resolveFrom = require('resolve-from'); +const parentModule = require('parent-module'); + +module.exports = moduleId => { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + const parentPath = parentModule(__filename); + + const filePath = resolveFrom(path.dirname(parentPath), moduleId); + + const oldModule = require.cache[filePath]; + // Delete itself from module parent + if (oldModule && oldModule.parent) { + let i = oldModule.parent.children.length; + + while (i--) { + if (oldModule.parent.children[i].id === filePath) { + oldModule.parent.children.splice(i, 1); + } + } + } + + delete require.cache[filePath]; // Delete module from cache + + const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step + + return parent === undefined ? require(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require +}; diff --git a/day1/cli-study/node_modules/import-fresh/license b/day1/cli-study/node_modules/import-fresh/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/import-fresh/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/import-fresh/package.json b/day1/cli-study/node_modules/import-fresh/package.json new file mode 100644 index 0000000..857b4da --- /dev/null +++ b/day1/cli-study/node_modules/import-fresh/package.json @@ -0,0 +1,74 @@ +{ + "_from": "import-fresh@^3.0.0", + "_id": "import-fresh@3.2.1", + "_inBundle": false, + "_integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "_location": "/import-fresh", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "import-fresh@^3.0.0", + "name": "import-fresh", + "escapedName": "import-fresh", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "_shasum": "633ff618506e793af5ac91bf48b72677e15cbe66", + "_spec": "import-fresh@^3.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/import-fresh/issues" + }, + "bundleDependencies": false, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "deprecated": false, + "description": "Import a module while bypassing the cache", + "devDependencies": { + "ava": "^1.0.1", + "heapdump": "^0.3.12", + "tsd": "^0.7.3", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/import-fresh#readme", + "keywords": [ + "require", + "cache", + "uncache", + "uncached", + "module", + "fresh", + "bypass" + ], + "license": "MIT", + "name": "import-fresh", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/import-fresh.git" + }, + "scripts": { + "heapdump": "node heapdump.js", + "test": "xo && ava && tsd" + }, + "version": "3.2.1" +} diff --git a/day1/cli-study/node_modules/import-fresh/readme.md b/day1/cli-study/node_modules/import-fresh/readme.md new file mode 100644 index 0000000..0bfa1c9 --- /dev/null +++ b/day1/cli-study/node_modules/import-fresh/readme.md @@ -0,0 +1,52 @@ +# import-fresh [![Build Status](https://travis-ci.org/sindresorhus/import-fresh.svg?branch=master)](https://travis-ci.org/sindresorhus/import-fresh) + +> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly import a module. + + +## Install + +``` +$ npm install import-fresh +``` + + +## Usage + +```js +// foo.js +let i = 0; +module.exports = () => ++i; +``` + +```js +const importFresh = require('import-fresh'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +importFresh('./foo')(); +//=> 1 + +importFresh('./foo')(); +//=> 1 +``` + + +## import-fresh for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-import-fresh?utm_source=npm-import-fresh&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily diff --git a/day1/cli-study/node_modules/imurmurhash/README.md b/day1/cli-study/node_modules/imurmurhash/README.md new file mode 100644 index 0000000..f35b20a --- /dev/null +++ b/day1/cli-study/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +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. diff --git a/day1/cli-study/node_modules/imurmurhash/imurmurhash.js b/day1/cli-study/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 0000000..e63146a --- /dev/null +++ b/day1/cli-study/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/day1/cli-study/node_modules/imurmurhash/imurmurhash.min.js b/day1/cli-study/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 0000000..dc0ee88 --- /dev/null +++ b/day1/cli-study/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/day1/cli-study/node_modules/imurmurhash/package.json b/day1/cli-study/node_modules/imurmurhash/package.json new file mode 100644 index 0000000..6fbc258 --- /dev/null +++ b/day1/cli-study/node_modules/imurmurhash/package.json @@ -0,0 +1,63 @@ +{ + "_from": "imurmurhash@^0.1.4", + "_id": "imurmurhash@0.1.4", + "_inBundle": false, + "_integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "_location": "/imurmurhash", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "imurmurhash@^0.1.4", + "name": "imurmurhash", + "escapedName": "imurmurhash", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_spec": "imurmurhash@^0.1.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\eslint", + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "An incremental implementation of MurmurHash3", + "devDependencies": {}, + "engines": { + "node": ">=0.8.19" + }, + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "homepage": "https://github.com/jensyt/imurmurhash-js", + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "license": "MIT", + "main": "imurmurhash.js", + "name": "imurmurhash", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "version": "0.1.4" +} diff --git a/day1/cli-study/node_modules/inflight/LICENSE b/day1/cli-study/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/day1/cli-study/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +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. diff --git a/day1/cli-study/node_modules/inflight/README.md b/day1/cli-study/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/day1/cli-study/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/day1/cli-study/node_modules/inflight/inflight.js b/day1/cli-study/node_modules/inflight/inflight.js new file mode 100644 index 0000000..48202b3 --- /dev/null +++ b/day1/cli-study/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/day1/cli-study/node_modules/inflight/package.json b/day1/cli-study/node_modules/inflight/package.json new file mode 100644 index 0000000..c8a5cbb --- /dev/null +++ b/day1/cli-study/node_modules/inflight/package.json @@ -0,0 +1,58 @@ +{ + "_from": "inflight@^1.0.4", + "_id": "inflight@1.0.6", + "_inBundle": false, + "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "_location": "/inflight", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inflight@^1.0.4", + "name": "inflight", + "escapedName": "inflight", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_spec": "inflight@^1.0.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "deprecated": false, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "files": [ + "inflight.js" + ], + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "name": "inflight", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/day1/cli-study/node_modules/inherits/LICENSE b/day1/cli-study/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/day1/cli-study/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +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. + diff --git a/day1/cli-study/node_modules/inherits/README.md b/day1/cli-study/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/day1/cli-study/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/day1/cli-study/node_modules/inherits/inherits.js b/day1/cli-study/node_modules/inherits/inherits.js new file mode 100644 index 0000000..f71f2d9 --- /dev/null +++ b/day1/cli-study/node_modules/inherits/inherits.js @@ -0,0 +1,9 @@ +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = require('./inherits_browser.js'); +} diff --git a/day1/cli-study/node_modules/inherits/inherits_browser.js b/day1/cli-study/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..86bbb3d --- /dev/null +++ b/day1/cli-study/node_modules/inherits/inherits_browser.js @@ -0,0 +1,27 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} diff --git a/day1/cli-study/node_modules/inherits/package.json b/day1/cli-study/node_modules/inherits/package.json new file mode 100644 index 0000000..3b157b6 --- /dev/null +++ b/day1/cli-study/node_modules/inherits/package.json @@ -0,0 +1,61 @@ +{ + "_from": "inherits@2", + "_id": "inherits@2.0.4", + "_inBundle": false, + "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "_location": "/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@2", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "2", + "saveSpec": null, + "fetchSpec": "2" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c", + "_spec": "inherits@2", + "_where": "F:\\前端学习\\cli-study\\node_modules\\glob", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "tap" + }, + "version": "2.0.4" +} diff --git a/day1/cli-study/node_modules/ini/LICENSE b/day1/cli-study/node_modules/ini/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/day1/cli-study/node_modules/ini/LICENSE @@ -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. diff --git a/day1/cli-study/node_modules/ini/README.md b/day1/cli-study/node_modules/ini/README.md new file mode 100644 index 0000000..33df258 --- /dev/null +++ b/day1/cli-study/node_modules/ini/README.md @@ -0,0 +1,102 @@ +An ini format parser and serializer for node. + +Sections are treated as nested objects. Items before the first +heading are saved on the object directly. + +## Usage + +Consider an ini-file `config.ini` that looks like this: + + ; this comment is being ignored + scope = global + + [database] + user = dbuser + password = dbpassword + database = use_this_database + + [paths.default] + datadir = /var/lib/data + array[] = first value + array[] = second value + array[] = third value + +You can read, manipulate and write the ini-file like so: + + var fs = require('fs') + , ini = require('ini') + + var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8')) + + config.scope = 'local' + config.database.database = 'use_another_database' + config.paths.default.tmpdir = '/tmp' + delete config.paths.default.datadir + config.paths.default.array.push('fourth value') + + fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' })) + +This will result in a file called `config_modified.ini` being written +to the filesystem with the following content: + + [section] + scope=local + [section.database] + user=dbuser + password=dbpassword + database=use_another_database + [section.paths.default] + tmpdir=/tmp + array[]=first value + array[]=second value + array[]=third value + array[]=fourth value + + +## API + +### decode(inistring) + +Decode the ini-style formatted `inistring` into a nested object. + +### parse(inistring) + +Alias for `decode(inistring)` + +### encode(object, [options]) + +Encode the object `object` into an ini-style formatted string. If the +optional parameter `section` is given, then all top-level properties +of the object are put into this section and the `section`-string is +prepended to all sub-sections, see the usage example above. + +The `options` object may contain the following: + +* `section` A string which will be the first `section` in the encoded + ini data. Defaults to none. +* `whitespace` Boolean to specify whether to put whitespace around the + `=` character. By default, whitespace is omitted, to be friendly to + some persnickety old parsers that don't tolerate it well. But some + find that it's more human-readable and pretty with the whitespace. + +For backwards compatibility reasons, if a `string` options is passed +in, then it is assumed to be the `section` value. + +### stringify(object, [options]) + +Alias for `encode(object, [options])` + +### safe(val) + +Escapes the string `val` such that it is safe to be used as a key or +value in an ini-file. Basically escapes quotes. For example + + ini.safe('"unsafe string"') + +would result in + + "\"unsafe string\"" + +### unsafe(val) + +Unescapes the string `val` diff --git a/day1/cli-study/node_modules/ini/ini.js b/day1/cli-study/node_modules/ini/ini.js new file mode 100644 index 0000000..590195d --- /dev/null +++ b/day1/cli-study/node_modules/ini/ini.js @@ -0,0 +1,194 @@ +exports.parse = exports.decode = decode + +exports.stringify = exports.encode = encode + +exports.safe = safe +exports.unsafe = unsafe + +var eol = typeof process !== 'undefined' && + process.platform === 'win32' ? '\r\n' : '\n' + +function encode (obj, opt) { + var children = [] + var out = '' + + if (typeof opt === 'string') { + opt = { + section: opt, + whitespace: false + } + } else { + opt = opt || {} + opt.whitespace = opt.whitespace === true + } + + var separator = opt.whitespace ? ' = ' : '=' + + Object.keys(obj).forEach(function (k, _, __) { + var val = obj[k] + if (val && Array.isArray(val)) { + val.forEach(function (item) { + out += safe(k + '[]') + separator + safe(item) + '\n' + }) + } else if (val && typeof val === 'object') { + children.push(k) + } else { + out += safe(k) + separator + safe(val) + eol + } + }) + + if (opt.section && out.length) { + out = '[' + safe(opt.section) + ']' + eol + out + } + + children.forEach(function (k, _, __) { + var nk = dotSplit(k).join('\\.') + var section = (opt.section ? opt.section + '.' : '') + nk + var child = encode(obj[k], { + section: section, + whitespace: opt.whitespace + }) + if (out.length && child.length) { + out += eol + } + out += child + }) + + return out +} + +function dotSplit (str) { + return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') + .replace(/\\\./g, '\u0001') + .split(/\./).map(function (part) { + return part.replace(/\1/g, '\\.') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + }) +} + +function decode (str) { + var out = {} + var p = out + var section = null + // section |key = value + var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i + var lines = str.split(/[\r\n]+/g) + + lines.forEach(function (line, _, __) { + if (!line || line.match(/^\s*[;#]/)) return + var match = line.match(re) + if (!match) return + if (match[1] !== undefined) { + section = unsafe(match[1]) + p = out[section] = out[section] || {} + return + } + var key = unsafe(match[2]) + var value = match[3] ? unsafe(match[4]) : true + switch (value) { + case 'true': + case 'false': + case 'null': value = JSON.parse(value) + } + + // Convert keys with '[]' suffix to an array + if (key.length > 2 && key.slice(-2) === '[]') { + key = key.substring(0, key.length - 2) + if (!p[key]) { + p[key] = [] + } else if (!Array.isArray(p[key])) { + p[key] = [p[key]] + } + } + + // safeguard against resetting a previously defined + // array by accidentally forgetting the brackets + if (Array.isArray(p[key])) { + p[key].push(value) + } else { + p[key] = value + } + }) + + // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} + // use a filter to return the keys that have to be deleted. + Object.keys(out).filter(function (k, _, __) { + if (!out[k] || + typeof out[k] !== 'object' || + Array.isArray(out[k])) { + return false + } + // see if the parent section is also an object. + // if so, add it to that, and mark this one for deletion + var parts = dotSplit(k) + var p = out + var l = parts.pop() + var nl = l.replace(/\\\./g, '.') + parts.forEach(function (part, _, __) { + if (!p[part] || typeof p[part] !== 'object') p[part] = {} + p = p[part] + }) + if (p === out && nl === l) { + return false + } + p[nl] = out[k] + return true + }).forEach(function (del, _, __) { + delete out[del] + }) + + return out +} + +function isQuoted (val) { + return (val.charAt(0) === '"' && val.slice(-1) === '"') || + (val.charAt(0) === "'" && val.slice(-1) === "'") +} + +function safe (val) { + return (typeof val !== 'string' || + val.match(/[=\r\n]/) || + val.match(/^\[/) || + (val.length > 1 && + isQuoted(val)) || + val !== val.trim()) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') +} + +function unsafe (val, doUnesc) { + val = (val || '').trim() + if (isQuoted(val)) { + // remove the single quotes before calling JSON.parse + if (val.charAt(0) === "'") { + val = val.substr(1, val.length - 2) + } + try { val = JSON.parse(val) } catch (_) {} + } else { + // walk the val to find the first not-escaped ; character + var esc = false + var unesc = '' + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i) + if (esc) { + if ('\\;#'.indexOf(c) !== -1) { + unesc += c + } else { + unesc += '\\' + c + } + esc = false + } else if (';#'.indexOf(c) !== -1) { + break + } else if (c === '\\') { + esc = true + } else { + unesc += c + } + } + if (esc) { + unesc += '\\' + } + return unesc.trim() + } + return val +} diff --git a/day1/cli-study/node_modules/ini/package.json b/day1/cli-study/node_modules/ini/package.json new file mode 100644 index 0000000..a670cc0 --- /dev/null +++ b/day1/cli-study/node_modules/ini/package.json @@ -0,0 +1,63 @@ +{ + "_from": "ini@^1.3.4", + "_id": "ini@1.3.5", + "_inBundle": false, + "_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "_location": "/ini", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ini@^1.3.4", + "name": "ini", + "escapedName": "ini", + "rawSpec": "^1.3.4", + "saveSpec": null, + "fetchSpec": "^1.3.4" + }, + "_requiredBy": [ + "/config-chain" + ], + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "_shasum": "eee25f56db1c9ec6085e0c22778083f596abf927", + "_spec": "ini@^1.3.4", + "_where": "F:\\前端学习\\cli-study\\node_modules\\config-chain", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/ini/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "An ini encoder/decoder for node", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.7.3 || 11" + }, + "engines": { + "node": "*" + }, + "files": [ + "ini.js" + ], + "homepage": "https://github.com/isaacs/ini#readme", + "license": "ISC", + "main": "ini.js", + "name": "ini", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/ini.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "pretest": "standard ini.js", + "preversion": "npm test", + "test": "tap test/*.js --100 -J" + }, + "version": "1.3.5" +} diff --git a/day1/cli-study/node_modules/inquirer/LICENSE b/day1/cli-study/node_modules/inquirer/LICENSE new file mode 100644 index 0000000..8aae090 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 Simon Boudrias + +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. \ No newline at end of file diff --git a/day1/cli-study/node_modules/inquirer/README.md b/day1/cli-study/node_modules/inquirer/README.md new file mode 100644 index 0000000..4926408 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/README.md @@ -0,0 +1,480 @@ +Inquirer Logo + +# Inquirer.js + +[![npm](https://badge.fury.io/js/inquirer.svg)](http://badge.fury.io/js/inquirer) +[![tests](https://travis-ci.org/SBoudrias/Inquirer.js.svg?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) +[![Coverage Status](https://codecov.io/gh/SBoudrias/Inquirer.js/branch/master/graph/badge.svg)](https://codecov.io/gh/SBoudrias/Inquirer.js) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSBoudrias%2FInquirer.js?ref=badge_shield) + +A collection of common interactive command line user interfaces. + +## Table of Contents + +1. [Documentation](#documentation) + 1. [Installation](#installation) + 2. [Examples](#examples) + 3. [Methods](#methods) + 4. [Objects](#objects) + 5. [Questions](#questions) + 6. [Answers](#answers) + 7. [Separator](#separator) + 8. [Prompt Types](#prompt) +2. [User Interfaces and Layouts](#layouts) + 1. [Reactive Interface](#reactive) +3. [Support](#support) +4. [Known issues](#issues) +4. [News](#news) +5. [Contributing](#contributing) +6. [License](#license) +7. [Plugins](#plugins) + +## Goal and Philosophy + +**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the "CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)"). + +**`Inquirer.js`** should ease the process of + +- providing _error feedback_ +- _asking questions_ +- _parsing_ input +- _validating_ answers +- managing _hierarchical prompts_ + +> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args). + +## [Documentation](#documentation) + + + +### Installation + + + +```shell +npm install inquirer +``` + +```javascript +var inquirer = require('inquirer'); +inquirer + .prompt([ + /* Pass your questions in here */ + ]) + .then(answers => { + // Use user feedback for... whatever!! + }) + .catch(error => { + if(error.isTtyError) { + // Prompt couldn't be rendered in the current environment + } else { + // Something else when wrong + } + }); +``` + + + +### Examples (Run it and see it) + +Check out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/inquirer/examples) folder for code and interface examples. + +```shell +node packages/inquirer/examples/pizza.js +node packages/inquirer/examples/checkbox.js +# etc... +``` + +### Methods + + + +#### `inquirer.prompt(questions) -> promise` + +Launch the prompt interface (inquiry session) + +- **questions** (Array) containing [Question Object](#question) (using the [reactive interface](#reactive-interface), you can also pass a `Rx.Observable` instance) +- returns a **Promise** + +#### `inquirer.registerPrompt(name, prompt)` + +Register prompt plugins under `name`. + +- **name** (string) name of the this new prompt. (used for question `type`) +- **prompt** (object) the prompt object itself (the plugin) + +#### `inquirer.createPromptModule() -> prompt function` + +Create a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types. + +```js +var prompt = inquirer.createPromptModule(); + +prompt(questions).then(/* ... */); +``` + +### Objects + + + +#### Question + + +A question object is a `hash` containing question related values: + +- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, + `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor` +- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash. +- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon). +- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers. +- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. + Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). +- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. +- **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. +- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash. +- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean. +- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`. +- **prefix**: (String) Change the default _prefix_ message. +- **suffix**: (String) Change the default _suffix_ message. +- **askAnswered**: (Boolean) Force to prompt the question if the answer already exists. + +`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value. + +```javascript +{ + /* Preferred way: with promise */ + filter() { + return new Promise(/* etc... */); + }, + + /* Legacy way: with this.async */ + validate: function (input) { + // Declare function as asynchronous, and save the done callback + var done = this.async(); + + // Do async stuff + setTimeout(function() { + if (typeof input !== 'number') { + // Pass the return value in the done callback + done('You need to provide a number'); + return; + } + // Pass the return value in the done callback + done(null, true); + }, 3000); + } +} +``` + +### Answers + + +A key/value hash containing the client answers in each prompt. + +- **Key** The `name` property of the _question_ object +- **Value** (Depends on the prompt) + - `confirm`: (Boolean) + - `input` : User input (filtered if `filter` is defined) (String) + - `number`: User input (filtered if `filter` is defined) (Number) + - `rawlist`, `list` : Selected choice value (or name if no value specified) (String) + +### Separator + + +A separator can be added to any `choices` array: + +``` +// In the question object +choices: [ "Choice A", new inquirer.Separator(), "choice B" ] + +// Which'll be displayed this way +[?] What do you want to do? + > Order a pizza + Make a reservation + -------- + Ask opening hours + Talk to the receptionist +``` + +The constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`. + +Separator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists. + + + +### Prompt types + +--- + +> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._ + +#### List - `{type: 'list'}` + +Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that +default must be the choice `index` in the array or a choice `value`) + +![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +--- + +#### Raw List - `{type: 'rawlist'}` + +Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that +default must be the choice `index` in the array) + +![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +--- + +#### Expand - `{type: 'expand'}` + +Take `type`, `name`, `message`, `choices`[, `default`] properties. (Note that +default must be the choice `index` in the array. If `default` key not provided, then `help` will be used as default choice) + +Note that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user. + +See `examples/expand.js` for a running example. + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +--- + +#### Checkbox - `{type: 'checkbox'}` + +Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`] properties. `default` is expected to be an Array of the checked choices value. + +Choices marked as `{checked: true}` will be checked by default. + +Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string. + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +--- + +#### Confirm - `{type: 'confirm'}` + +Take `type`, `name`, `message`, [`default`] properties. `default` is expected to be a boolean if used. + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +--- + +#### Input - `{type: 'input'}` + +Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties. + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +--- + +#### Input - `{type: 'number'}` + +Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties. + +--- + +#### Password - `{type: 'password'}` + +Take `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties. + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +--- + +Note that `mask` is required to hide the actual user input. + +#### Editor - `{type: 'editor'}` + +Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties + +Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used. + + + +### Use in Non-Interactive Environments +`prompt()` requires that it is run in an interactive environment. (I.e. [One where `process.stdin.isTTY` is `true`](https://nodejs.org/docs/latest-v12.x/api/process.html#process_a_note_on_process_i_o)). If `prompt()` is invoked outside of such an environment, then `prompt()` will return a rejected promise with an error. For convenience, the error will have a `isTtyError` property to programmatically indicate the cause. + + +## User Interfaces and layouts + +Along with the prompts, Inquirer offers some basic text UI. + +#### Bottom Bar - `inquirer.ui.BottomBar` + +This UI present a fixed text at the bottom of a free text zone. This is useful to keep a message to the bottom of the screen while outputting command outputs on the higher section. + +```javascript +var ui = new inquirer.ui.BottomBar(); + +// pipe a Stream to the log zone +outputStream.pipe(ui.log); + +// Or simply write output +ui.log.write('something just happened.'); +ui.log.write('Almost over, standby!'); + +// During processing, update the bottom bar content to display a loader +// or output a progress bar, etc +ui.updateBottomBar('new bottom bar content'); +``` + + + +## Reactive interface + +Internally, Inquirer uses the [JS reactive extension](https://github.com/ReactiveX/rxjs) to handle events and async flows. + +This mean you can take advantage of this feature to provide more advanced flows. For example, you can dynamically add questions to be asked: + +```js +var prompts = new Rx.Subject(); +inquirer.prompt(prompts); + +// At some point in the future, push new questions +prompts.next({ + /* question... */ +}); +prompts.next({ + /* question... */ +}); + +// When you're done +prompts.complete(); +``` + +And using the return value `process` property, you can access more fine grained callbacks: + +```js +inquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete); +``` + +## Support (OS Terminals) + + + +You should expect mostly good support for the CLI below. This does not mean we won't +look at issues found on other command line - feel free to report any! + +- **Mac OS**: + - Terminal.app + - iTerm +- **Windows ([Known issues](#issues))**: + - [ConEmu](https://conemu.github.io/) + - cmd.exe + - Powershell + - Cygwin +- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**: + - gnome-terminal (Terminal GNOME) + - konsole + +## Know issues + + + +Running Inquirer together with network streams in Windows platform inside some terminals can result in process hang. +Workaround: run inside another terminal. +Please refer to the https://github.com/nodejs/node/issues/21771 + +## News on the march (Release notes) + + + +Please refer to the [GitHub releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases) + +## Contributing + + + +**Unit test** +Unit test are written in [Mocha](https://mochajs.org/). Please add a unit test for every new feature or bug fix. `npm test` to run the test suite. + +**Documentation** +Add documentation for every API change. Feel free to send typo fixes and better docs! + +We're looking to offer good support for multiple prompts and environments. If you want to +help, we'd like to keep a list of testers for each terminal/OS so we can contact you and +get feedback before release. Let us know if you want to be added to the list (just tweet +to [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers) + +## License + + + +Copyright (c) 2016 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart)) +Licensed under the MIT license. + +## Plugins + + + +### Prompts + +[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)
+Presents a list of options as the user types, compatible with other packages such as fuzzy (for search)
+
+![autocomplete prompt](https://github.com/mokkabonna/inquirer-autocomplete-prompt/raw/master/inquirer.gif) + +[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)
+Checkbox list with autocomplete and other additions
+
+![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif) + +[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)
+Customizable date/time selector using both number pad and arrow keys
+
+![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png) + +[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)
+Prompt for selecting index in array where add new element
+
+![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif) + +[**command**](https://github.com/sullof/inquirer-command-prompt)
+Simple prompt with command history and dynamic autocomplete
+ +[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)
+Prompt for fuzzy file/directory selection.
+
+![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif) + +[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)
+Prompt for inputting emojis.
+
+![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif) + +[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)
+Prompt for input chalk-pipe style strings
+
+![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/raw/master/screenshot.gif) + +[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)
+Searchable Inquirer checkbox
+ +[**inquirer-search-list**](https://github.com/robin-rpr/inquirer-search-list)
+Searchable Inquirer list
+
+![inquirer-search-list](https://github.com/robin-rpr/inquirer-search-list/blob/master/preview.gif) + +[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)
+Inquirer prompt for your less creative users.
+
+![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif) + +[**inquirer-s3**](https://github.com/HQarroum/inquirer-s3)
+An S3 object selector for Inquirer.
+
+![inquirer-s3](https://github.com/HQarroum/inquirer-s3/raw/master/docs/inquirer-screenshot.png) + +[**inquirer-autosubmit-prompt**](https://github.com/yaodingyd/inquirer-autosubmit-prompt)
+Auto submit based on your current input, saving one extra enter
+ +[**inquirer-file-tree-selection-prompt**](https://github.com/anc95/inquirer-file-tree-selection)
+Inquirer prompt for to select a file or directory in file tree
+
+![inquirer-file-tree-selection-prompt](https://github.com/anc95/inquirer-file-tree-selection/blob/master/example/screenshot.gif) + +[**inquirer-table-prompt**](https://github.com/eduardoboucas/inquirer-table-prompt)
+A table-like prompt for Inquirer.
+
+![inquirer-table-prompt](https://raw.githubusercontent.com/eduardoboucas/inquirer-table-prompt/master/screen-capture.gif) diff --git a/day1/cli-study/node_modules/inquirer/lib/inquirer.js b/day1/cli-study/node_modules/inquirer/lib/inquirer.js new file mode 100644 index 0000000..aa8b2a1 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/inquirer.js @@ -0,0 +1,93 @@ +'use strict'; +/** + * Inquirer.js + * A collection of common interactive command line user interfaces. + */ + +var inquirer = module.exports; + +/** + * Client interfaces + */ + +inquirer.prompts = {}; + +inquirer.Separator = require('./objects/separator'); + +inquirer.ui = { + BottomBar: require('./ui/bottom-bar'), + Prompt: require('./ui/prompt') +}; + +/** + * Create a new self-contained prompt module. + */ +inquirer.createPromptModule = function(opt) { + var promptModule = function(questions, answers) { + var ui; + try { + ui = new inquirer.ui.Prompt(promptModule.prompts, opt); + } catch (error) { + return Promise.reject(error); + } + var promise = ui.run(questions, answers); + + // Monkey patch the UI on the promise object so + // that it remains publicly accessible. + promise.ui = ui; + + return promise; + }; + + promptModule.prompts = {}; + + /** + * Register a prompt type + * @param {String} name Prompt type name + * @param {Function} prompt Prompt constructor + * @return {inquirer} + */ + + promptModule.registerPrompt = function(name, prompt) { + promptModule.prompts[name] = prompt; + return this; + }; + + /** + * Register the defaults provider prompts + */ + + promptModule.restoreDefaultPrompts = function() { + this.registerPrompt('list', require('./prompts/list')); + this.registerPrompt('input', require('./prompts/input')); + this.registerPrompt('number', require('./prompts/number')); + this.registerPrompt('confirm', require('./prompts/confirm')); + this.registerPrompt('rawlist', require('./prompts/rawlist')); + this.registerPrompt('expand', require('./prompts/expand')); + this.registerPrompt('checkbox', require('./prompts/checkbox')); + this.registerPrompt('password', require('./prompts/password')); + this.registerPrompt('editor', require('./prompts/editor')); + }; + + promptModule.restoreDefaultPrompts(); + + return promptModule; +}; + +/** + * Public CLI helper interface + * @param {Array|Object|Rx.Observable} questions - Questions settings array + * @param {Function} cb - Callback being passed the user answers + * @return {inquirer.ui.Prompt} + */ + +inquirer.prompt = inquirer.createPromptModule(); + +// Expose helper functions on the top level for easiest usage by common users +inquirer.registerPrompt = function(name, prompt) { + inquirer.prompt.registerPrompt(name, prompt); +}; + +inquirer.restoreDefaultPrompts = function() { + inquirer.prompt.restoreDefaultPrompts(); +}; diff --git a/day1/cli-study/node_modules/inquirer/lib/objects/choice.js b/day1/cli-study/node_modules/inquirer/lib/objects/choice.js new file mode 100644 index 0000000..79abf87 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/objects/choice.js @@ -0,0 +1,43 @@ +'use strict'; +var _ = { + isString: require('lodash/isString'), + isNumber: require('lodash/isNumber'), + extend: require('lodash/extend'), + isFunction: require('lodash/isFunction') +}; + +/** + * Choice object + * Normalize input as choice object + * @constructor + * @param {Number|String|Object} val Choice value. If an object is passed, it should contains + * at least one of `value` or `name` property + */ + +module.exports = class Choice { + constructor(val, answers) { + // Don't process Choice and Separator object + if (val instanceof Choice || val.type === 'separator') { + // eslint-disable-next-line no-constructor-return + return val; + } + + if (_.isString(val) || _.isNumber(val)) { + this.name = String(val); + this.value = val; + this.short = String(val); + } else { + _.extend(this, val, { + name: val.name || val.value, + value: 'value' in val ? val.value : val.name, + short: val.short || val.name || val.value + }); + } + + if (_.isFunction(val.disabled)) { + this.disabled = val.disabled(answers); + } else { + this.disabled = val.disabled; + } + } +}; diff --git a/day1/cli-study/node_modules/inquirer/lib/objects/choices.js b/day1/cli-study/node_modules/inquirer/lib/objects/choices.js new file mode 100644 index 0000000..ba13648 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/objects/choices.js @@ -0,0 +1,123 @@ +'use strict'; +var assert = require('assert'); +var _ = { + isNumber: require('lodash/isNumber'), + filter: require('lodash/filter'), + map: require('lodash/map'), + find: require('lodash/find') +}; +var Separator = require('./separator'); +var Choice = require('./choice'); + +/** + * Choices collection + * Collection of multiple `choice` object + * @constructor + * @param {Array} choices All `choice` to keep in the collection + */ + +module.exports = class Choices { + constructor(choices, answers) { + this.choices = choices.map(val => { + if (val.type === 'separator') { + if (!(val instanceof Separator)) { + val = new Separator(val.line); + } + + return val; + } + + return new Choice(val, answers); + }); + + this.realChoices = this.choices + .filter(Separator.exclude) + .filter(item => !item.disabled); + + Object.defineProperty(this, 'length', { + get() { + return this.choices.length; + }, + set(val) { + this.choices.length = val; + } + }); + + Object.defineProperty(this, 'realLength', { + get() { + return this.realChoices.length; + }, + set() { + throw new Error('Cannot set `realLength` of a Choices collection'); + } + }); + } + + /** + * Get a valid choice from the collection + * @param {Number} selector The selected choice index + * @return {Choice|Undefined} Return the matched choice or undefined + */ + + getChoice(selector) { + assert(_.isNumber(selector)); + return this.realChoices[selector]; + } + + /** + * Get a raw element from the collection + * @param {Number} selector The selected index value + * @return {Choice|Undefined} Return the matched choice or undefined + */ + + get(selector) { + assert(_.isNumber(selector)); + return this.choices[selector]; + } + + /** + * Match the valid choices against a where clause + * @param {Object} whereClause Lodash `where` clause + * @return {Array} Matching choices or empty array + */ + + where(whereClause) { + return _.filter(this.realChoices, whereClause); + } + + /** + * Pluck a particular key from the choices + * @param {String} propertyName Property name to select + * @return {Array} Selected properties + */ + + pluck(propertyName) { + return _.map(this.realChoices, propertyName); + } + + // Expose usual Array methods + indexOf() { + return this.choices.indexOf.apply(this.choices, arguments); + } + + forEach() { + return this.choices.forEach.apply(this.choices, arguments); + } + + filter() { + return this.choices.filter.apply(this.choices, arguments); + } + + find(func) { + return _.find(this.choices, func); + } + + push() { + var objs = _.map(arguments, val => new Choice(val)); + this.choices.push.apply(this.choices, objs); + this.realChoices = this.choices + .filter(Separator.exclude) + .filter(item => !item.disabled); + return this.choices; + } +}; diff --git a/day1/cli-study/node_modules/inquirer/lib/objects/separator.js b/day1/cli-study/node_modules/inquirer/lib/objects/separator.js new file mode 100644 index 0000000..e4beb7a --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/objects/separator.js @@ -0,0 +1,37 @@ +'use strict'; +var chalk = require('chalk'); +var figures = require('figures'); + +/** + * Separator object + * Used to space/separate choices group + * @constructor + * @param {String} line Separation line content (facultative) + */ + +class Separator { + constructor(line) { + this.type = 'separator'; + this.line = chalk.dim(line || new Array(15).join(figures.line)); + } + + /** + * Stringify separator + * @return {String} the separator display string + */ + toString() { + return this.line; + } +} + +/** + * Helper function returning false if object is a separator + * @param {Object} obj object to test against + * @return {Boolean} `false` if object is a separator + */ + +Separator.exclude = function(obj) { + return obj.type !== 'separator'; +}; + +module.exports = Separator; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/base.js b/day1/cli-study/node_modules/inquirer/lib/prompts/base.js new file mode 100644 index 0000000..34a0c2f --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/base.js @@ -0,0 +1,151 @@ +'use strict'; +/** + * Base prompt implementation + * Should be extended by prompt types. + */ +var _ = { + assign: require('lodash/assign'), + defaults: require('lodash/defaults'), + clone: require('lodash/clone') +}; +var chalk = require('chalk'); +var runAsync = require('run-async'); +var { filter, flatMap, share, take, takeUntil } = require('rxjs/operators'); +var Choices = require('../objects/choices'); +var ScreenManager = require('../utils/screen-manager'); + +class Prompt { + constructor(question, rl, answers) { + // Setup instance defaults property + _.assign(this, { + answers: answers, + status: 'pending' + }); + + // Set defaults prompt options + this.opt = _.defaults(_.clone(question), { + validate: () => true, + filter: val => val, + when: () => true, + suffix: '', + prefix: chalk.green('?') + }); + + // Make sure name is present + if (!this.opt.name) { + this.throwParamError('name'); + } + + // Set default message if no message defined + if (!this.opt.message) { + this.opt.message = this.opt.name + ':'; + } + + // Normalize choices + if (Array.isArray(this.opt.choices)) { + this.opt.choices = new Choices(this.opt.choices, answers); + } + + this.rl = rl; + this.screen = new ScreenManager(this.rl); + } + + /** + * Start the Inquiry session and manage output value filtering + * @return {Promise} + */ + + run() { + return new Promise(resolve => { + this._run(value => resolve(value)); + }); + } + + // Default noop (this one should be overwritten in prompts) + _run(cb) { + cb(); + } + + /** + * Throw an error telling a required parameter is missing + * @param {String} name Name of the missing param + * @return {Throw Error} + */ + + throwParamError(name) { + throw new Error('You must provide a `' + name + '` parameter'); + } + + /** + * Called when the UI closes. Override to do any specific cleanup necessary + */ + close() { + this.screen.releaseCursor(); + } + + /** + * Run the provided validation method each time a submit event occur. + * @param {Rx.Observable} submit - submit event flow + * @return {Object} Object containing two observables: `success` and `error` + */ + handleSubmitEvents(submit) { + var self = this; + var validate = runAsync(this.opt.validate); + var asyncFilter = runAsync(this.opt.filter); + var validation = submit.pipe( + flatMap(value => + asyncFilter(value, self.answers).then( + filteredValue => + validate(filteredValue, self.answers).then( + isValid => ({ isValid: isValid, value: filteredValue }), + err => ({ isValid: err, value: filteredValue }) + ), + err => ({ isValid: err }) + ) + ), + share() + ); + + var success = validation.pipe( + filter(state => state.isValid === true), + take(1) + ); + var error = validation.pipe( + filter(state => state.isValid !== true), + takeUntil(success) + ); + + return { + success: success, + error: error + }; + } + + /** + * Generate the prompt question string + * @return {String} prompt question string + */ + + getQuestion() { + var message = + this.opt.prefix + + ' ' + + chalk.bold(this.opt.message) + + this.opt.suffix + + chalk.reset(' '); + + // Append the default if available, and if question isn't answered + if (this.opt.default != null && this.status !== 'answered') { + // If default password is supplied, hide it + if (this.opt.type === 'password') { + message += chalk.italic.dim('[hidden] '); + } else { + message += chalk.dim('(' + this.opt.default + ') '); + } + } + + return message; + } +} + +module.exports = Prompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/checkbox.js b/day1/cli-study/node_modules/inquirer/lib/prompts/checkbox.js new file mode 100644 index 0000000..f4edf2f --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/checkbox.js @@ -0,0 +1,258 @@ +'use strict'; +/** + * `list` type prompt + */ + +var _ = { + isArray: require('lodash/isArray'), + map: require('lodash/map'), + isString: require('lodash/isString') +}; +var chalk = require('chalk'); +var cliCursor = require('cli-cursor'); +var figures = require('figures'); +var { map, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var observe = require('../utils/events'); +var Paginator = require('../utils/paginator'); + +class CheckboxPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); + + if (!this.opt.choices) { + this.throwParamError('choices'); + } + + if (_.isArray(this.opt.default)) { + this.opt.choices.forEach(function(choice) { + if (this.opt.default.indexOf(choice.value) >= 0) { + choice.checked = true; + } + }, this); + } + + this.pointer = 0; + + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(this.screen); + } + + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + var events = observe(this.rl); + + var validation = this.handleSubmitEvents( + events.line.pipe(map(this.getCurrentValue.bind(this))) + ); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.normalizedUpKey + .pipe(takeUntil(validation.success)) + .forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(validation.success)) + .forEach(this.onDownKey.bind(this)); + events.numberKey + .pipe(takeUntil(validation.success)) + .forEach(this.onNumberKey.bind(this)); + events.spaceKey + .pipe(takeUntil(validation.success)) + .forEach(this.onSpaceKey.bind(this)); + events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this)); + events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this)); + + // Init the prompt + cliCursor.hide(); + this.render(); + this.firstRender = false; + + return this; + } + + /** + * Render the prompt to screen + * @return {CheckboxPrompt} self + */ + + render(error) { + // Render question + var message = this.getQuestion(); + var bottomContent = ''; + + if (!this.spaceKeyPressed) { + message += + '(Press ' + + chalk.cyan.bold('') + + ' to select, ' + + chalk.cyan.bold('') + + ' to toggle all, ' + + chalk.cyan.bold('') + + ' to invert selection)'; + } + + // Render choices or answer depending on the state + if (this.status === 'answered') { + message += chalk.cyan(this.selection.join(', ')); + } else { + var choicesStr = renderChoices(this.opt.choices, this.pointer); + var indexPosition = this.opt.choices.indexOf( + this.opt.choices.getChoice(this.pointer) + ); + message += + '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); + } + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + onEnd(state) { + this.status = 'answered'; + this.spaceKeyPressed = true; + // Rerender prompt (and clean subline error) + this.render(); + + this.screen.done(); + cliCursor.show(); + this.done(state.value); + } + + onError(state) { + this.render(state.isValid); + } + + getCurrentValue() { + var choices = this.opt.choices.filter(function(choice) { + return Boolean(choice.checked) && !choice.disabled; + }); + + this.selection = _.map(choices, 'short'); + return _.map(choices, 'value'); + } + + onUpKey() { + var len = this.opt.choices.realLength; + this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1; + this.render(); + } + + onDownKey() { + var len = this.opt.choices.realLength; + this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0; + this.render(); + } + + onNumberKey(input) { + if (input <= this.opt.choices.realLength) { + this.pointer = input - 1; + this.toggleChoice(this.pointer); + } + + this.render(); + } + + onSpaceKey() { + this.spaceKeyPressed = true; + this.toggleChoice(this.pointer); + this.render(); + } + + onAllKey() { + var shouldBeChecked = Boolean( + this.opt.choices.find(function(choice) { + return choice.type !== 'separator' && !choice.checked; + }) + ); + + this.opt.choices.forEach(function(choice) { + if (choice.type !== 'separator') { + choice.checked = shouldBeChecked; + } + }); + + this.render(); + } + + onInverseKey() { + this.opt.choices.forEach(function(choice) { + if (choice.type !== 'separator') { + choice.checked = !choice.checked; + } + }); + + this.render(); + } + + toggleChoice(index) { + var item = this.opt.choices.getChoice(index); + if (item !== undefined) { + this.opt.choices.getChoice(index).checked = !item.checked; + } + } +} + +/** + * Function for rendering checkbox choices + * @param {Number} pointer Position of the pointer + * @return {String} Rendered content + */ + +function renderChoices(choices, pointer) { + var output = ''; + var separatorOffset = 0; + + choices.forEach(function(choice, i) { + if (choice.type === 'separator') { + separatorOffset++; + output += ' ' + choice + '\n'; + return; + } + + if (choice.disabled) { + separatorOffset++; + output += ' - ' + choice.name; + output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; + } else { + var line = getCheckbox(choice.checked) + ' ' + choice.name; + if (i - separatorOffset === pointer) { + output += chalk.cyan(figures.pointer + line); + } else { + output += ' ' + line; + } + } + + output += '\n'; + }); + + return output.replace(/\n$/, ''); +} + +/** + * Get the checkbox + * @param {Boolean} checked - add a X or not to the checkbox + * @return {String} Composited checkbox string + */ + +function getCheckbox(checked) { + return checked ? chalk.green(figures.radioOn) : figures.radioOff; +} + +module.exports = CheckboxPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/confirm.js b/day1/cli-study/node_modules/inquirer/lib/prompts/confirm.js new file mode 100644 index 0000000..31eb78f --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/confirm.js @@ -0,0 +1,102 @@ +'use strict'; +/** + * `confirm` type prompt + */ + +var _ = { + extend: require('lodash/extend'), + isBoolean: require('lodash/isBoolean') +}; +var chalk = require('chalk'); +var { take, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var observe = require('../utils/events'); + +class ConfirmPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); + + var rawDefault = true; + + _.extend(this.opt, { + filter: function(input) { + var value = rawDefault; + if (input != null && input !== '') { + value = /^y(es)?/i.test(input); + } + + return value; + } + }); + + if (_.isBoolean(this.opt.default)) { + rawDefault = this.opt.default; + } + + this.opt.default = rawDefault ? 'Y/n' : 'y/N'; + } + + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + // Once user confirm (enter key) + var events = observe(this.rl); + events.keypress.pipe(takeUntil(events.line)).forEach(this.onKeypress.bind(this)); + + events.line.pipe(take(1)).forEach(this.onEnd.bind(this)); + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {ConfirmPrompt} self + */ + + render(answer) { + var message = this.getQuestion(); + + if (typeof answer === 'boolean') { + message += chalk.cyan(answer ? 'Yes' : 'No'); + } else { + message += this.rl.line; + } + + this.screen.render(message); + + return this; + } + + /** + * When user press `enter` key + */ + + onEnd(input) { + this.status = 'answered'; + + var output = this.opt.filter(input); + this.render(output); + + this.screen.done(); + this.done(output); + } + + /** + * When user press a key + */ + + onKeypress() { + this.render(); + } +} + +module.exports = ConfirmPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/editor.js b/day1/cli-study/node_modules/inquirer/lib/prompts/editor.js new file mode 100644 index 0000000..121cda8 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/editor.js @@ -0,0 +1,100 @@ +'use strict'; +/** + * `editor` type prompt + */ + +var chalk = require('chalk'); +var editAsync = require('external-editor').editAsync; +var Base = require('./base'); +var observe = require('../utils/events'); +var { Subject } = require('rxjs'); + +class EditorPrompt extends Base { + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + this.editorResult = new Subject(); + + // Open Editor on "line" (Enter Key) + var events = observe(this.rl); + this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this)); + + // Trigger Validation when editor closes + var validation = this.handleSubmitEvents(this.editorResult); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + // Prevents default from being printed on screen (can look weird with multiple lines) + this.currentText = this.opt.default; + this.opt.default = null; + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {EditorPrompt} self + */ + + render(error) { + var bottomContent = ''; + var message = this.getQuestion(); + + if (this.status === 'answered') { + message += chalk.dim('Received'); + } else { + message += chalk.dim('Press to launch your preferred editor.'); + } + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * Launch $EDITOR on user press enter + */ + + startExternalEditor() { + // Pause Readline to prevent stdin and stdout from being modified while the editor is showing + this.rl.pause(); + editAsync(this.currentText, this.endExternalEditor.bind(this)); + } + + endExternalEditor(error, result) { + this.rl.resume(); + if (error) { + this.editorResult.error(error); + } else { + this.editorResult.next(result); + } + } + + onEnd(state) { + this.editorResult.unsubscribe(); + this.lineSubscription.unsubscribe(); + this.answer = state.value; + this.status = 'answered'; + // Re-render prompt + this.render(); + this.screen.done(); + this.done(this.answer); + } + + onError(state) { + this.render(state.isValid); + } +} + +module.exports = EditorPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/expand.js b/day1/cli-study/node_modules/inquirer/lib/prompts/expand.js new file mode 100644 index 0000000..b8940d8 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/expand.js @@ -0,0 +1,281 @@ +'use strict'; +/** + * `rawlist` type prompt + */ + +var _ = { + uniq: require('lodash/uniq'), + isString: require('lodash/isString'), + isNumber: require('lodash/isNumber'), + findIndex: require('lodash/findIndex') +}; +var chalk = require('chalk'); +var { map, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var Separator = require('../objects/separator'); +var observe = require('../utils/events'); +var Paginator = require('../utils/paginator'); + +class ExpandPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); + + if (!this.opt.choices) { + this.throwParamError('choices'); + } + + this.validateChoices(this.opt.choices); + + // Add the default `help` (/expand) option + this.opt.choices.push({ + key: 'h', + name: 'Help, list all options', + value: 'help' + }); + + this.opt.validate = choice => { + if (choice == null) { + return 'Please enter a valid command'; + } + + return choice !== 'help'; + }; + + // Setup the default string (capitalize the default key) + this.opt.default = this.generateChoicesString(this.opt.choices, this.opt.default); + + this.paginator = new Paginator(this.screen); + } + + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + // Save user answer and update prompt to show selected option. + var events = observe(this.rl); + var validation = this.handleSubmitEvents( + events.line.pipe(map(this.getCurrentValue.bind(this))) + ); + validation.success.forEach(this.onSubmit.bind(this)); + validation.error.forEach(this.onError.bind(this)); + this.keypressObs = events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + + // Init the prompt + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {ExpandPrompt} self + */ + + render(error, hint) { + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += chalk.cyan(this.answer); + } else if (this.status === 'expanded') { + var choicesStr = renderChoices(this.opt.choices, this.selectedKey); + message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize); + message += '\n Answer: '; + } + + message += this.rl.line; + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + if (hint) { + bottomContent = chalk.cyan('>> ') + hint; + } + + this.screen.render(message, bottomContent); + } + + getCurrentValue(input) { + if (!input) { + input = this.rawDefault; + } + + var selected = this.opt.choices.where({ key: input.toLowerCase().trim() })[0]; + if (!selected) { + return null; + } + + return selected.value; + } + + /** + * Generate the prompt choices string + * @return {String} Choices string + */ + + getChoices() { + var output = ''; + + this.opt.choices.forEach(choice => { + output += '\n '; + + if (choice.type === 'separator') { + output += ' ' + choice; + return; + } + + var choiceStr = choice.key + ') ' + choice.name; + if (this.selectedKey === choice.key) { + choiceStr = chalk.cyan(choiceStr); + } + + output += choiceStr; + }); + + return output; + } + + onError(state) { + if (state.value === 'help') { + this.selectedKey = ''; + this.status = 'expanded'; + this.render(); + return; + } + + this.render(state.isValid); + } + + /** + * When user press `enter` key + */ + + onSubmit(state) { + this.status = 'answered'; + var choice = this.opt.choices.where({ value: state.value })[0]; + this.answer = choice.short || choice.name; + + // Re-render prompt + this.render(); + this.screen.done(); + this.done(state.value); + } + + /** + * When user press a key + */ + + onKeypress() { + this.selectedKey = this.rl.line.toLowerCase(); + var selected = this.opt.choices.where({ key: this.selectedKey })[0]; + if (this.status === 'expanded') { + this.render(); + } else { + this.render(null, selected ? selected.name : null); + } + } + + /** + * Validate the choices + * @param {Array} choices + */ + + validateChoices(choices) { + var formatError; + var errors = []; + var keymap = {}; + choices.filter(Separator.exclude).forEach(choice => { + if (!choice.key || choice.key.length !== 1) { + formatError = true; + } + + if (keymap[choice.key]) { + errors.push(choice.key); + } + + keymap[choice.key] = true; + choice.key = String(choice.key).toLowerCase(); + }); + + if (formatError) { + throw new Error( + 'Format error: `key` param must be a single letter and is required.' + ); + } + + if (keymap.h) { + throw new Error( + 'Reserved key error: `key` param cannot be `h` - this value is reserved.' + ); + } + + if (errors.length) { + throw new Error( + 'Duplicate key error: `key` param must be unique. Duplicates: ' + + _.uniq(errors).join(', ') + ); + } + } + + /** + * Generate a string out of the choices keys + * @param {Array} choices + * @param {Number|String} default - the choice index or name to capitalize + * @return {String} The rendered choices key string + */ + generateChoicesString(choices, defaultChoice) { + var defIndex = choices.realLength - 1; + if (_.isNumber(defaultChoice) && this.opt.choices.getChoice(defaultChoice)) { + defIndex = defaultChoice; + } else if (_.isString(defaultChoice)) { + let index = _.findIndex( + choices.realChoices, + ({ value }) => value === defaultChoice + ); + defIndex = index === -1 ? defIndex : index; + } + + var defStr = this.opt.choices.pluck('key'); + this.rawDefault = defStr[defIndex]; + defStr[defIndex] = String(defStr[defIndex]).toUpperCase(); + return defStr.join(''); + } +} + +/** + * Function for rendering checkbox choices + * @param {String} pointer Selected key + * @return {String} Rendered content + */ + +function renderChoices(choices, pointer) { + var output = ''; + + choices.forEach(choice => { + output += '\n '; + + if (choice.type === 'separator') { + output += ' ' + choice; + return; + } + + var choiceStr = choice.key + ') ' + choice.name; + if (pointer === choice.key) { + choiceStr = chalk.cyan(choiceStr); + } + + output += choiceStr; + }); + + return output; +} + +module.exports = ExpandPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/input.js b/day1/cli-study/node_modules/inquirer/lib/prompts/input.js new file mode 100644 index 0000000..2b886ef --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/input.js @@ -0,0 +1,113 @@ +'use strict'; +/** + * `input` type prompt + */ + +var chalk = require('chalk'); +var { map, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var observe = require('../utils/events'); + +class InputPrompt extends Base { + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + // Once user confirm (enter key) + var events = observe(this.rl); + var submit = events.line.pipe(map(this.filterInput.bind(this))); + + var validation = this.handleSubmitEvents(submit); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {InputPrompt} self + */ + + render(error) { + var bottomContent = ''; + var appendContent = ''; + var message = this.getQuestion(); + var transformer = this.opt.transformer; + var isFinal = this.status === 'answered'; + + if (isFinal) { + appendContent = this.answer; + } else { + appendContent = this.rl.line; + } + + if (transformer) { + message += transformer(appendContent, this.answers, { isFinal }); + } else { + message += isFinal ? chalk.cyan(appendContent) : appendContent; + } + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + filterInput(input) { + if (!input) { + return this.opt.default == null ? '' : this.opt.default; + } + + return input; + } + + onEnd(state) { + this.answer = state.value; + this.status = 'answered'; + + // Re-render prompt + this.render(); + + this.screen.done(); + this.done(state.value); + } + + onError({ value = '', isValid }) { + this.rl.line += value; + this.rl.cursor += value.length; + this.render(isValid); + } + + /** + * When user press a key + */ + + onKeypress() { + // If user press a key, just clear the default value + if (this.opt.default) { + this.opt.default = undefined; + } + + this.render(); + } +} + +module.exports = InputPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/list.js b/day1/cli-study/node_modules/inquirer/lib/prompts/list.js new file mode 100644 index 0000000..4f391ae --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/list.js @@ -0,0 +1,188 @@ +'use strict'; +/** + * `list` type prompt + */ + +var _ = { + isNumber: require('lodash/isNumber'), + findIndex: require('lodash/findIndex'), + isString: require('lodash/isString') +}; +var chalk = require('chalk'); +var figures = require('figures'); +var cliCursor = require('cli-cursor'); +var runAsync = require('run-async'); +var { flatMap, map, take, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var observe = require('../utils/events'); +var Paginator = require('../utils/paginator'); + +class ListPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); + + if (!this.opt.choices) { + this.throwParamError('choices'); + } + + this.firstRender = true; + this.selected = 0; + + var def = this.opt.default; + + // If def is a Number, then use as index. Otherwise, check for value. + if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { + this.selected = def; + } else if (!_.isNumber(def) && def != null) { + let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def); + this.selected = Math.max(index, 0); + } + + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(this.screen); + } + + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + var self = this; + + var events = observe(this.rl); + events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(events.line)) + .forEach(this.onDownKey.bind(this)); + events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this)); + events.line + .pipe( + take(1), + map(this.getCurrentValue.bind(this)), + flatMap(value => runAsync(self.opt.filter)(value).catch(err => err)) + ) + .forEach(this.onSubmit.bind(this)); + + // Init the prompt + cliCursor.hide(); + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {ListPrompt} self + */ + + render() { + // Render question + var message = this.getQuestion(); + + if (this.firstRender) { + message += chalk.dim('(Use arrow keys)'); + } + + // Render choices or answer depending on the state + if (this.status === 'answered') { + message += chalk.cyan(this.opt.choices.getChoice(this.selected).short); + } else { + var choicesStr = listRender(this.opt.choices, this.selected); + var indexPosition = this.opt.choices.indexOf( + this.opt.choices.getChoice(this.selected) + ); + message += + '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); + } + + this.firstRender = false; + + this.screen.render(message); + } + + /** + * When user press `enter` key + */ + + onSubmit(value) { + this.status = 'answered'; + + // Rerender prompt + this.render(); + + this.screen.done(); + cliCursor.show(); + this.done(value); + } + + getCurrentValue() { + return this.opt.choices.getChoice(this.selected).value; + } + + /** + * When user press a key + */ + onUpKey() { + var len = this.opt.choices.realLength; + this.selected = this.selected > 0 ? this.selected - 1 : len - 1; + this.render(); + } + + onDownKey() { + var len = this.opt.choices.realLength; + this.selected = this.selected < len - 1 ? this.selected + 1 : 0; + this.render(); + } + + onNumberKey(input) { + if (input <= this.opt.choices.realLength) { + this.selected = input - 1; + } + + this.render(); + } +} + +/** + * Function for rendering list choices + * @param {Number} pointer Position of the pointer + * @return {String} Rendered content + */ +function listRender(choices, pointer) { + var output = ''; + var separatorOffset = 0; + + choices.forEach((choice, i) => { + if (choice.type === 'separator') { + separatorOffset++; + output += ' ' + choice + '\n'; + return; + } + + if (choice.disabled) { + separatorOffset++; + output += ' - ' + choice.name; + output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; + output += '\n'; + return; + } + + var isSelected = i - separatorOffset === pointer; + var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name; + if (isSelected) { + line = chalk.cyan(line); + } + + output += line + ' \n'; + }); + + return output.replace(/\n$/, ''); +} + +module.exports = ListPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/number.js b/day1/cli-study/node_modules/inquirer/lib/prompts/number.js new file mode 100644 index 0000000..6640751 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/number.js @@ -0,0 +1,29 @@ +'use strict'; +/** + * `input` type prompt + */ + +var Input = require('./input'); + +/** + * Extention of the Input prompt specifically for use with number inputs. + */ + +class NumberPrompt extends Input { + filterInput(input) { + if (input && typeof input === 'string') { + input = input.trim(); + // Match a number in the input + let numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/); + // If a number is found, return that input. + if (numberMatch) { + return Number(numberMatch[0]); + } + } + + // If the input was invalid return the default value. + return this.opt.default == null ? NaN : this.opt.default; + } +} + +module.exports = NumberPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/password.js b/day1/cli-study/node_modules/inquirer/lib/prompts/password.js new file mode 100644 index 0000000..d5343b3 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/password.js @@ -0,0 +1,113 @@ +'use strict'; +/** + * `password` type prompt + */ + +var chalk = require('chalk'); +var { map, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var observe = require('../utils/events'); + +function mask(input, maskChar) { + input = String(input); + maskChar = typeof maskChar === 'string' ? maskChar : '*'; + if (input.length === 0) { + return ''; + } + + return new Array(input.length + 1).join(maskChar); +} + +class PasswordPrompt extends Base { + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + var events = observe(this.rl); + + // Once user confirm (enter key) + var submit = events.line.pipe(map(this.filterInput.bind(this))); + + var validation = this.handleSubmitEvents(submit); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {PasswordPrompt} self + */ + + render(error) { + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += this.opt.mask + ? chalk.cyan(mask(this.answer, this.opt.mask)) + : chalk.italic.dim('[hidden]'); + } else if (this.opt.mask) { + message += mask(this.rl.line || '', this.opt.mask); + } else { + message += chalk.italic.dim('[input is hidden] '); + } + + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + filterInput(input) { + if (!input) { + return this.opt.default == null ? '' : this.opt.default; + } + + return input; + } + + onEnd(state) { + this.status = 'answered'; + this.answer = state.value; + + // Re-render prompt + this.render(); + + this.screen.done(); + this.done(state.value); + } + + onError(state) { + this.render(state.isValid); + } + + onKeypress() { + // If user press a key, just clear the default value + if (this.opt.default) { + this.opt.default = undefined; + } + + this.render(); + } +} + +module.exports = PasswordPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/prompts/rawlist.js b/day1/cli-study/node_modules/inquirer/lib/prompts/rawlist.js new file mode 100644 index 0000000..22a7dd5 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/prompts/rawlist.js @@ -0,0 +1,220 @@ +'use strict'; +/** + * `rawlist` type prompt + */ + +var _ = { + extend: require('lodash/extend'), + isNumber: require('lodash/isNumber'), + findIndex: require('lodash/findIndex') +}; +var chalk = require('chalk'); +var { map, takeUntil } = require('rxjs/operators'); +var Base = require('./base'); +var Separator = require('../objects/separator'); +var observe = require('../utils/events'); +var Paginator = require('../utils/paginator'); + +class RawListPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); + + if (!this.opt.choices) { + this.throwParamError('choices'); + } + + this.opt.validChoices = this.opt.choices.filter(Separator.exclude); + + this.selected = 0; + this.rawDefault = 0; + + _.extend(this.opt, { + validate: function(val) { + return val != null; + } + }); + + var def = this.opt.default; + if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { + this.selected = def; + this.rawDefault = def; + } else if (!_.isNumber(def) && def != null) { + let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def); + let safeIndex = Math.max(index, 0); + this.selected = safeIndex; + this.rawDefault = safeIndex; + } + + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(); + } + + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + // Once user confirm (enter key) + var events = observe(this.rl); + var submit = events.line.pipe(map(this.getCurrentValue.bind(this))); + + var validation = this.handleSubmitEvents(submit); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(events.line)) + .forEach(this.onDownKey.bind(this)); + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + // Init the prompt + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {RawListPrompt} self + */ + + render(error) { + // Render question + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += chalk.cyan(this.answer); + } else { + var choicesStr = renderChoices(this.opt.choices, this.selected); + message += + '\n' + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); + message += '\n Answer: '; + } + message += this.rl.line; + + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + getCurrentValue(index) { + if (index == null) { + index = this.rawDefault; + } else if (index === '') { + index = this.selected; + } else { + index -= 1; + } + + var choice = this.opt.choices.getChoice(index); + return choice ? choice.value : null; + } + + onEnd(state) { + this.status = 'answered'; + this.answer = state.value; + + // Re-render prompt + this.render(); + + this.screen.done(); + this.done(state.value); + } + + onError() { + this.render('Please enter a valid index'); + } + + /** + * When user press a key + */ + + onKeypress() { + var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; + + if (this.opt.choices.getChoice(index)) { + this.selected = index; + } else { + this.selected = undefined; + } + this.render(); + } + + /** + * When user press up key + */ + + onUpKey() { + this.onArrowKey('up'); + } + + /** + * When user press down key + */ + + onDownKey() { + this.onArrowKey('down'); + } + + /** + * When user press up or down key + * @param {String} type Arrow type: up or down + */ + + onArrowKey(type) { + var len = this.opt.choices.realLength; + + if (type === 'up') this.selected = this.selected > 0 ? this.selected - 1 : len - 1; + else this.selected = this.selected < len - 1 ? this.selected + 1 : 0; + + this.rl.line = String(this.selected + 1); + } +} + +/** + * Function for rendering list choices + * @param {Number} pointer Position of the pointer + * @return {String} Rendered content + */ + +function renderChoices(choices, pointer) { + var output = ''; + var separatorOffset = 0; + + choices.forEach(function(choice, i) { + output += '\n '; + + if (choice.type === 'separator') { + separatorOffset++; + output += ' ' + choice; + return; + } + + var index = i - separatorOffset; + var display = index + 1 + ') ' + choice.name; + if (index === pointer) { + display = chalk.cyan(display); + } + + output += display; + }); + + return output; +} + +module.exports = RawListPrompt; diff --git a/day1/cli-study/node_modules/inquirer/lib/ui/baseUI.js b/day1/cli-study/node_modules/inquirer/lib/ui/baseUI.js new file mode 100644 index 0000000..3447f64 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/ui/baseUI.js @@ -0,0 +1,99 @@ +'use strict'; +var _ = { + extend: require('lodash/extend'), + omit: require('lodash/omit') +}; +var MuteStream = require('mute-stream'); +var readline = require('readline'); + +/** + * Base interface class other can inherits from + */ + +class UI { + constructor(opt) { + // Instantiate the Readline interface + // @Note: Don't reassign if already present (allow test to override the Stream) + if (!this.rl) { + this.rl = readline.createInterface(setupReadlineOptions(opt)); + } + + this.rl.resume(); + + this.onForceClose = this.onForceClose.bind(this); + + // Make sure new prompt start on a newline when closing + process.on('exit', this.onForceClose); + + // Terminate process on SIGINT (which will call process.on('exit') in return) + this.rl.on('SIGINT', this.onForceClose); + } + + /** + * Handle the ^C exit + * @return {null} + */ + + onForceClose() { + this.close(); + process.kill(process.pid, 'SIGINT'); + console.log(''); + } + + /** + * Close the interface and cleanup listeners + */ + + close() { + // Remove events listeners + this.rl.removeListener('SIGINT', this.onForceClose); + process.removeListener('exit', this.onForceClose); + + this.rl.output.unmute(); + + if (this.activePrompt && typeof this.activePrompt.close === 'function') { + this.activePrompt.close(); + } + + // Close the readline + this.rl.output.end(); + this.rl.pause(); + this.rl.close(); + } +} + +function setupReadlineOptions(opt) { + opt = opt || {}; + // Inquirer 8.x: + // opt.skipTTYChecks = opt.skipTTYChecks === undefined ? opt.input !== undefined : opt.skipTTYChecks; + opt.skipTTYChecks = opt.skipTTYChecks === undefined ? true : opt.skipTTYChecks; + + // Default `input` to stdin + var input = opt.input || process.stdin; + + // Check if prompt is being called in TTY environment + // If it isn't return a failed promise + if (!opt.skipTTYChecks && !input.isTTY) { + const nonTtyError = new Error( + 'Prompts can not be meaningfully rendered in non-TTY environments' + ); + nonTtyError.isTtyError = true; + throw nonTtyError; + } + + // Add mute capabilities to the output + var ms = new MuteStream(); + ms.pipe(opt.output || process.stdout); + var output = ms; + + return _.extend( + { + terminal: true, + input: input, + output: output + }, + _.omit(opt, ['input', 'output']) + ); +} + +module.exports = UI; diff --git a/day1/cli-study/node_modules/inquirer/lib/ui/bottom-bar.js b/day1/cli-study/node_modules/inquirer/lib/ui/bottom-bar.js new file mode 100644 index 0000000..bed30c6 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/ui/bottom-bar.js @@ -0,0 +1,102 @@ +'use strict'; +/** + * Sticky bottom bar user interface + */ + +var through = require('through'); +var Base = require('./baseUI'); +var rlUtils = require('../utils/readline'); +var _ = { + last: require('lodash/last') +}; + +class BottomBar extends Base { + constructor(opt) { + opt = opt || {}; + + super(opt); + + this.log = through(this.writeLog.bind(this)); + this.bottomBar = opt.bottomBar || ''; + this.render(); + } + + /** + * Render the prompt to screen + * @return {BottomBar} self + */ + + render() { + this.write(this.bottomBar); + return this; + } + + clean() { + rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length); + return this; + } + + /** + * Update the bottom bar content and rerender + * @param {String} bottomBar Bottom bar content + * @return {BottomBar} self + */ + + updateBottomBar(bottomBar) { + rlUtils.clearLine(this.rl, 1); + this.rl.output.unmute(); + this.clean(); + this.bottomBar = bottomBar; + this.render(); + this.rl.output.mute(); + return this; + } + + /** + * Write out log data + * @param {String} data - The log data to be output + * @return {BottomBar} self + */ + + writeLog(data) { + this.rl.output.unmute(); + this.clean(); + this.rl.output.write(this.enforceLF(data.toString())); + this.render(); + this.rl.output.mute(); + return this; + } + + /** + * Make sure line end on a line feed + * @param {String} str Input string + * @return {String} The input string with a final line feed + */ + + enforceLF(str) { + return str.match(/[\r\n]$/) ? str : str + '\n'; + } + + /** + * Helper for writing message in Prompt + * @param {BottomBar} prompt - The Prompt object that extends tty + * @param {String} message - The message to be output + */ + write(message) { + var msgLines = message.split(/\n/); + this.height = msgLines.length; + + // Write message to screen and setPrompt to control backspace + this.rl.setPrompt(_.last(msgLines)); + + if (this.rl.output.rows === 0 && this.rl.output.columns === 0) { + /* When it's a tty through serial port there's no terminal info and the render will malfunction, + so we need enforce the cursor to locate to the leftmost position for rendering. */ + rlUtils.left(this.rl, message.length + this.rl.line.length); + } + + this.rl.output.write(message); + } +} + +module.exports = BottomBar; diff --git a/day1/cli-study/node_modules/inquirer/lib/ui/prompt.js b/day1/cli-study/node_modules/inquirer/lib/ui/prompt.js new file mode 100644 index 0000000..af641ac --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/ui/prompt.js @@ -0,0 +1,138 @@ +'use strict'; +var _ = { + isPlainObject: require('lodash/isPlainObject'), + clone: require('lodash/clone'), + isArray: require('lodash/isArray'), + set: require('lodash/set'), + isFunction: require('lodash/isFunction') +}; +var { defer, empty, from, of } = require('rxjs'); +var { concatMap, filter, publish, reduce } = require('rxjs/operators'); +var runAsync = require('run-async'); +var utils = require('../utils/utils'); +var Base = require('./baseUI'); + +/** + * Base interface class other can inherits from + */ + +class PromptUI extends Base { + constructor(prompts, opt) { + super(opt); + this.prompts = prompts; + } + + run(questions, answers) { + // Keep global reference to the answers + if (_.isPlainObject(answers)) { + this.answers = _.clone(answers); + } else { + this.answers = {}; + } + + // Make sure questions is an array. + if (_.isPlainObject(questions)) { + questions = [questions]; + } + + // Create an observable, unless we received one as parameter. + // Note: As this is a public interface, we cannot do an instanceof check as we won't + // be using the exact same object in memory. + var obs = _.isArray(questions) ? from(questions) : questions; + + this.process = obs.pipe( + concatMap(this.processQuestion.bind(this)), + publish() // Creates a hot Observable. It prevents duplicating prompts. + ); + + this.process.connect(); + + return this.process + .pipe( + reduce((answers, answer) => { + _.set(answers, answer.name, answer.answer); + return answers; + }, this.answers) + ) + .toPromise(Promise) + .then(this.onCompletion.bind(this)); + } + + /** + * Once all prompt are over + */ + + onCompletion() { + this.close(); + + return this.answers; + } + + processQuestion(question) { + question = _.clone(question); + return defer(() => { + var obs = of(question); + + return obs.pipe( + concatMap(this.setDefaultType.bind(this)), + concatMap(this.filterIfRunnable.bind(this)), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'message', this.answers) + ), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'default', this.answers) + ), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'choices', this.answers) + ), + concatMap(this.fetchAnswer.bind(this)) + ); + }); + } + + fetchAnswer(question) { + var Prompt = this.prompts[question.type]; + this.activePrompt = new Prompt(question, this.rl, this.answers); + return defer(() => + from( + this.activePrompt.run().then(answer => ({ name: question.name, answer: answer })) + ) + ); + } + + setDefaultType(question) { + // Default type to input + if (!this.prompts[question.type]) { + question.type = 'input'; + } + + return defer(() => of(question)); + } + + filterIfRunnable(question) { + if (question.askAnswered !== true && this.answers[question.name] !== undefined) { + return empty(); + } + + if (question.when === false) { + return empty(); + } + + if (!_.isFunction(question.when)) { + return of(question); + } + + var answers = this.answers; + return defer(() => + from( + runAsync(question.when)(answers).then(shouldRun => { + if (shouldRun) { + return question; + } + }) + ).pipe(filter(val => val != null)) + ); + } +} + +module.exports = PromptUI; diff --git a/day1/cli-study/node_modules/inquirer/lib/utils/events.js b/day1/cli-study/node_modules/inquirer/lib/utils/events.js new file mode 100644 index 0000000..966d146 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/utils/events.js @@ -0,0 +1,54 @@ +'use strict'; +var { fromEvent } = require('rxjs'); +var { filter, map, share, takeUntil } = require('rxjs/operators'); + +function normalizeKeypressEvents(value, key) { + return { value: value, key: key || {} }; +} + +module.exports = function(rl) { + var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents) + .pipe(takeUntil(fromEvent(rl, 'close'))) + // Ignore `enter` key. On the readline, we only care about the `line` event. + .pipe(filter(({ key }) => key.name !== 'enter' && key.name !== 'return')); + + return { + line: fromEvent(rl, 'line'), + keypress: keypress, + + normalizedUpKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'up' || key.name === 'k' || (key.name === 'p' && key.ctrl) + ), + share() + ), + + normalizedDownKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'down' || key.name === 'j' || (key.name === 'n' && key.ctrl) + ), + share() + ), + + numberKey: keypress.pipe( + filter(e => e.value && '123456789'.indexOf(e.value) >= 0), + map(e => Number(e.value)), + share() + ), + + spaceKey: keypress.pipe( + filter(({ key }) => key && key.name === 'space'), + share() + ), + aKey: keypress.pipe( + filter(({ key }) => key && key.name === 'a'), + share() + ), + iKey: keypress.pipe( + filter(({ key }) => key && key.name === 'i'), + share() + ) + }; +}; diff --git a/day1/cli-study/node_modules/inquirer/lib/utils/paginator.js b/day1/cli-study/node_modules/inquirer/lib/utils/paginator.js new file mode 100644 index 0000000..ac86b41 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/utils/paginator.js @@ -0,0 +1,57 @@ +'use strict'; + +var _ = { + sum: require('lodash/sum'), + flatten: require('lodash/flatten') +}; +var chalk = require('chalk'); + +/** + * The paginator keeps track of a pointer index in a list and returns + * a subset of the choices if the list is too long. + */ + +class Paginator { + constructor(screen) { + this.pointer = 0; + this.lastIndex = 0; + this.screen = screen; + } + + paginate(output, active, pageSize) { + pageSize = pageSize || 7; + var middleOfList = Math.floor(pageSize / 2); + var lines = output.split('\n'); + + if (this.screen) { + lines = this.screen.breakLines(lines); + active = _.sum(lines.map(lineParts => lineParts.length).splice(0, active)); + lines = _.flatten(lines); + } + + // Make sure there's enough lines to paginate + if (lines.length <= pageSize) { + return output; + } + + // Move the pointer only when the user go down and limit it to the middle of the list + if ( + this.pointer < middleOfList && + this.lastIndex < active && + active - this.lastIndex < pageSize + ) { + this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex); + } + + this.lastIndex = active; + + // Duplicate the lines so it give an infinite list look + var infinite = _.flatten([lines, lines, lines]); + var topIndex = Math.max(0, active + lines.length - this.pointer); + + var section = infinite.splice(topIndex, pageSize).join('\n'); + return section + '\n' + chalk.dim('(Move up and down to reveal more choices)'); + } +} + +module.exports = Paginator; diff --git a/day1/cli-study/node_modules/inquirer/lib/utils/readline.js b/day1/cli-study/node_modules/inquirer/lib/utils/readline.js new file mode 100644 index 0000000..929b672 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/utils/readline.js @@ -0,0 +1,51 @@ +'use strict'; +var ansiEscapes = require('ansi-escapes'); + +/** + * Move cursor left by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ + +exports.left = function(rl, x) { + rl.output.write(ansiEscapes.cursorBackward(x)); +}; + +/** + * Move cursor right by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ + +exports.right = function(rl, x) { + rl.output.write(ansiEscapes.cursorForward(x)); +}; + +/** + * Move cursor up by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go up (default to 1) + */ + +exports.up = function(rl, x) { + rl.output.write(ansiEscapes.cursorUp(x)); +}; + +/** + * Move cursor down by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go down (default to 1) + */ + +exports.down = function(rl, x) { + rl.output.write(ansiEscapes.cursorDown(x)); +}; + +/** + * Clear current line + * @param {Readline} rl - Readline instance + * @param {Number} len - number of line to delete + */ +exports.clearLine = function(rl, len) { + rl.output.write(ansiEscapes.eraseLines(len)); +}; diff --git a/day1/cli-study/node_modules/inquirer/lib/utils/screen-manager.js b/day1/cli-study/node_modules/inquirer/lib/utils/screen-manager.js new file mode 100644 index 0000000..e839ce8 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/utils/screen-manager.js @@ -0,0 +1,145 @@ +'use strict'; +var _ = { + last: require('lodash/last'), + flatten: require('lodash/flatten') +}; +var util = require('./readline'); +var cliWidth = require('cli-width'); +var stripAnsi = require('strip-ansi'); +var stringWidth = require('string-width'); + +function height(content) { + return content.split('\n').length; +} + +function lastLine(content) { + return _.last(content.split('\n')); +} + +class ScreenManager { + constructor(rl) { + // These variables are keeping information to allow correct prompt re-rendering + this.height = 0; + this.extraLinesUnderPrompt = 0; + + this.rl = rl; + } + + render(content, bottomContent) { + this.rl.output.unmute(); + this.clean(this.extraLinesUnderPrompt); + + /** + * Write message to screen and setPrompt to control backspace + */ + + var promptLine = lastLine(content); + var rawPromptLine = stripAnsi(promptLine); + + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + var prompt = rawPromptLine; + if (this.rl.line.length) { + prompt = prompt.slice(0, -this.rl.line.length); + } + + this.rl.setPrompt(prompt); + + // SetPrompt will change cursor position, now we can get correct value + var cursorPos = this.rl._getCursorPos(); + var width = this.normalizedCliWidth(); + + content = this.forceLineReturn(content, width); + if (bottomContent) { + bottomContent = this.forceLineReturn(bottomContent, width); + } + + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content += '\n'; + } + + var fullContent = content + (bottomContent ? '\n' + bottomContent : ''); + this.rl.output.write(fullContent); + + /** + * Re-adjust the cursor at the correct position. + */ + + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows; + var bottomContentHeight = + promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + if (bottomContentHeight > 0) { + util.up(this.rl, bottomContentHeight); + } + + // Reset cursor at the beginning of the line + util.left(this.rl, stringWidth(lastLine(fullContent))); + + // Adjust cursor on the right + if (cursorPos.cols > 0) { + util.right(this.rl, cursorPos.cols); + } + + /** + * Set up state for next re-rendering + */ + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(fullContent); + + this.rl.output.mute(); + } + + clean(extraLines) { + if (extraLines > 0) { + util.down(this.rl, extraLines); + } + + util.clearLine(this.rl, this.height); + } + + done() { + this.rl.setPrompt(''); + this.rl.output.unmute(); + this.rl.output.write('\n'); + } + + releaseCursor() { + if (this.extraLinesUnderPrompt > 0) { + util.down(this.rl, this.extraLinesUnderPrompt); + } + } + + normalizedCliWidth() { + var width = cliWidth({ + defaultWidth: 80, + output: this.rl.output + }); + return width; + } + + breakLines(lines, width) { + // Break lines who're longer than the cli width so we can normalize the natural line + // returns behavior across terminals. + width = width || this.normalizedCliWidth(); + var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g'); + return lines.map(line => { + var chunk = line.match(regex); + // Last match is always empty + chunk.pop(); + return chunk || ''; + }); + } + + forceLineReturn(content, width) { + width = width || this.normalizedCliWidth(); + return _.flatten(this.breakLines(content.split('\n'), width)).join('\n'); + } +} + +module.exports = ScreenManager; diff --git a/day1/cli-study/node_modules/inquirer/lib/utils/utils.js b/day1/cli-study/node_modules/inquirer/lib/utils/utils.js new file mode 100644 index 0000000..9ca776f --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/lib/utils/utils.js @@ -0,0 +1,28 @@ +'use strict'; +var _ = { + isFunction: require('lodash/isFunction') +}; +var { from, of } = require('rxjs'); +var runAsync = require('run-async'); + +/** + * Resolve a question property value if it is passed as a function. + * This method will overwrite the property on the question object with the received value. + * @param {Object} question - Question object + * @param {String} prop - Property to fetch name + * @param {Object} answers - Answers object + * @return {Rx.Observable} - Observable emitting once value is known + */ + +exports.fetchAsyncQuestionProperty = function(question, prop, answers) { + if (!_.isFunction(question[prop])) { + return of(question); + } + + return from( + runAsync(question[prop])(answers).then(value => { + question[prop] = value; + return question; + }) + ); +}; diff --git a/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.d.ts b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.d.ts new file mode 100644 index 0000000..7e9b2b7 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,197 @@ +import * as cssColors from 'color-name'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: keyof typeof cssColors): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.js b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..5d82581 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/license b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/package.json b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..d4ace4d --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/package.json @@ -0,0 +1,89 @@ +{ + "_from": "ansi-styles@^4.1.0", + "_id": "ansi-styles@4.2.1", + "_inBundle": false, + "_integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "_location": "/inquirer/ansi-styles", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-styles@^4.1.0", + "name": "ansi-styles", + "escapedName": "ansi-styles", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/inquirer/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "_shasum": "90ae75c424d008d2624c5bf29ead3177ebfcf359", + "_spec": "ansi-styles@^4.1.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\inquirer\\node_modules\\chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava && tsd" + }, + "version": "4.2.1" +} diff --git a/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/readme.md b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..2a1ef65 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/ansi-styles/readme.md @@ -0,0 +1,158 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + + diff --git a/day1/cli-study/node_modules/inquirer/node_modules/chalk/index.d.ts b/day1/cli-study/node_modules/inquirer/node_modules/chalk/index.d.ts new file mode 100644 index 0000000..7e22c45 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/chalk/index.d.ts @@ -0,0 +1,411 @@ +declare const enum LevelEnum { + /** + All colors disabled. + */ + None = 0, + + /** + Basic 16 colors support. + */ + Basic = 1, + + /** + ANSI 256 colors support. + */ + Ansi256 = 2, + + /** + Truecolor 16 million colors support. + */ + TrueColor = 3 +} + +/** +Basic foreground colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type ForegroundColor = + | 'black' + | 'red' + | 'green' + | 'yellow' + | 'blue' + | 'magenta' + | 'cyan' + | 'white' + | 'gray' + | 'grey' + | 'blackBright' + | 'redBright' + | 'greenBright' + | 'yellowBright' + | 'blueBright' + | 'magentaBright' + | 'cyanBright' + | 'whiteBright'; + +/** +Basic background colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type BackgroundColor = + | 'bgBlack' + | 'bgRed' + | 'bgGreen' + | 'bgYellow' + | 'bgBlue' + | 'bgMagenta' + | 'bgCyan' + | 'bgWhite' + | 'bgGray' + | 'bgGrey' + | 'bgBlackBright' + | 'bgRedBright' + | 'bgGreenBright' + | 'bgYellowBright' + | 'bgBlueBright' + | 'bgMagentaBright' + | 'bgCyanBright' + | 'bgWhiteBright'; + +/** +Basic colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type Color = ForegroundColor | BackgroundColor; + +declare type Modifiers = + | 'reset' + | 'bold' + | 'dim' + | 'italic' + | 'underline' + | 'inverse' + | 'hidden' + | 'strikethrough' + | 'visible'; + +declare namespace chalk { + type Level = LevelEnum; + + interface Options { + /** + Specify the color support for Chalk. + By default, color support is automatically detected based on the environment. + */ + level?: Level; + } + + interface Instance { + /** + Return a new Chalk instance. + */ + new (options?: Options): Chalk; + } + + /** + Detect whether the terminal supports color. + */ + interface ColorSupport { + /** + The color level used by Chalk. + */ + level: Level; + + /** + Return whether Chalk supports basic 16 colors. + */ + hasBasic: boolean; + + /** + Return whether Chalk supports ANSI 256 colors. + */ + has256: boolean; + + /** + Return whether Chalk supports Truecolor 16 million colors. + */ + has16m: boolean; + } + + interface ChalkFunction { + /** + Use a template string. + + @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) + + @example + ``` + import chalk = require('chalk'); + + log(chalk` + CPU: {red ${cpu.totalPercent}%} + RAM: {green ${ram.used / ram.total * 100}%} + DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} + `); + ``` + */ + (text: TemplateStringsArray, ...placeholders: unknown[]): string; + + (...text: unknown[]): string; + } + + interface Chalk extends ChalkFunction { + /** + Return a new Chalk instance. + */ + Instance: Instance; + + /** + The color support for Chalk. + By default, color support is automatically detected based on the environment. + */ + level: Level; + + /** + Use HEX value to set text color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.hex('#DEADED'); + ``` + */ + hex(color: string): Chalk; + + /** + Use keyword color value to set text color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.keyword('orange'); + ``` + */ + keyword(color: string): Chalk; + + /** + Use RGB values to set text color. + */ + rgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set text color. + */ + hsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set text color. + */ + hsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set text color. + */ + hwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + */ + ansi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(index: number): Chalk; + + /** + Use HEX value to set background color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgHex('#DEADED'); + ``` + */ + bgHex(color: string): Chalk; + + /** + Use keyword color value to set background color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgKeyword('orange'); + ``` + */ + bgKeyword(color: string): Chalk; + + /** + Use RGB values to set background color. + */ + bgRgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set background color. + */ + bgHsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set background color. + */ + bgHsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set background color. + */ + bgHwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + Use the foreground code, not the background code (for example, not 41, nor 101). + */ + bgAnsi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. + */ + bgAnsi256(index: number): Chalk; + + /** + Modifier: Resets the current color chain. + */ + readonly reset: Chalk; + + /** + Modifier: Make text bold. + */ + readonly bold: Chalk; + + /** + Modifier: Emitting only a small amount of light. + */ + readonly dim: Chalk; + + /** + Modifier: Make text italic. (Not widely supported) + */ + readonly italic: Chalk; + + /** + Modifier: Make text underline. (Not widely supported) + */ + readonly underline: Chalk; + + /** + Modifier: Inverse background and foreground colors. + */ + readonly inverse: Chalk; + + /** + Modifier: Prints the text, but makes it invisible. + */ + readonly hidden: Chalk; + + /** + Modifier: Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: Chalk; + + /** + Modifier: Prints the text only when Chalk has a color support level > 0. + Can be useful for things that are purely cosmetic. + */ + readonly visible: Chalk; + + readonly black: Chalk; + readonly red: Chalk; + readonly green: Chalk; + readonly yellow: Chalk; + readonly blue: Chalk; + readonly magenta: Chalk; + readonly cyan: Chalk; + readonly white: Chalk; + + /* + Alias for `blackBright`. + */ + readonly gray: Chalk; + + /* + Alias for `blackBright`. + */ + readonly grey: Chalk; + + readonly blackBright: Chalk; + readonly redBright: Chalk; + readonly greenBright: Chalk; + readonly yellowBright: Chalk; + readonly blueBright: Chalk; + readonly magentaBright: Chalk; + readonly cyanBright: Chalk; + readonly whiteBright: Chalk; + + readonly bgBlack: Chalk; + readonly bgRed: Chalk; + readonly bgGreen: Chalk; + readonly bgYellow: Chalk; + readonly bgBlue: Chalk; + readonly bgMagenta: Chalk; + readonly bgCyan: Chalk; + readonly bgWhite: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGray: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGrey: Chalk; + + readonly bgBlackBright: Chalk; + readonly bgRedBright: Chalk; + readonly bgGreenBright: Chalk; + readonly bgYellowBright: Chalk; + readonly bgBlueBright: Chalk; + readonly bgMagentaBright: Chalk; + readonly bgCyanBright: Chalk; + readonly bgWhiteBright: Chalk; + } +} + +/** +Main Chalk object that allows to chain styles together. +Call the last one as a method with a string argument. +Order doesn't matter, and later styles take precedent in case of a conflict. +This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. +*/ +declare const chalk: chalk.Chalk & chalk.ChalkFunction & { + supportsColor: chalk.ColorSupport | false; + Level: typeof LevelEnum; + Color: Color; + ForegroundColor: ForegroundColor; + BackgroundColor: BackgroundColor; + Modifiers: Modifiers; + stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; +}; + +export = chalk; diff --git a/day1/cli-study/node_modules/inquirer/node_modules/chalk/license b/day1/cli-study/node_modules/inquirer/node_modules/chalk/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/day1/cli-study/node_modules/inquirer/node_modules/chalk/package.json b/day1/cli-study/node_modules/inquirer/node_modules/chalk/package.json new file mode 100644 index 0000000..b69a34e --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/chalk/package.json @@ -0,0 +1,95 @@ +{ + "_from": "chalk@^3.0.0", + "_id": "chalk@3.0.0", + "_inBundle": false, + "_integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "_location": "/inquirer/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chalk@^3.0.0", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "_shasum": "3f73c2bf526591f574cc492c51e2456349f844e4", + "_spec": "chalk@^3.0.0", + "_where": "F:\\前端学习\\cli-study\\node_modules\\inquirer", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^3.2.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^14.1.1", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.25.3" + }, + "engines": { + "node": ">=8" + }, + "files": [ + "source", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "main": "source", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "test": "xo && nyc ava && tsd" + }, + "version": "3.0.0", + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off" + } + } +} diff --git a/day1/cli-study/node_modules/inquirer/node_modules/chalk/readme.md b/day1/cli-study/node_modules/inquirer/node_modules/chalk/readme.md new file mode 100644 index 0000000..877cb93 --- /dev/null +++ b/day1/cli-study/node_modules/inquirer/node_modules/chalk/readme.md @@ -0,0 +1,304 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019 + + +## Install + +```console +$ npm install chalk +``` + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.`
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+

+ + + +