koa-classic-server 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -0
- package/package.json +5 -6
- package/Readme.md +0 -102
- package/test/node_modules/.package-lock.json +0 -1254
- package/test/node_modules/abbrev/LICENSE +0 -46
- package/test/node_modules/abbrev/README.md +0 -23
- package/test/node_modules/abbrev/abbrev.js +0 -61
- package/test/node_modules/abbrev/package.json +0 -21
- package/test/node_modules/accepts/HISTORY.md +0 -243
- package/test/node_modules/accepts/LICENSE +0 -23
- package/test/node_modules/accepts/README.md +0 -140
- package/test/node_modules/accepts/index.js +0 -238
- package/test/node_modules/accepts/package.json +0 -47
- package/test/node_modules/ansi-styles/index.d.ts +0 -345
- package/test/node_modules/ansi-styles/index.js +0 -163
- package/test/node_modules/ansi-styles/license +0 -9
- package/test/node_modules/ansi-styles/package.json +0 -56
- package/test/node_modules/ansi-styles/readme.md +0 -152
- package/test/node_modules/any-promise/.jshintrc +0 -4
- package/test/node_modules/any-promise/LICENSE +0 -19
- package/test/node_modules/any-promise/README.md +0 -161
- package/test/node_modules/any-promise/implementation.d.ts +0 -3
- package/test/node_modules/any-promise/implementation.js +0 -1
- package/test/node_modules/any-promise/index.d.ts +0 -73
- package/test/node_modules/any-promise/index.js +0 -1
- package/test/node_modules/any-promise/loader.js +0 -78
- package/test/node_modules/any-promise/optional.js +0 -6
- package/test/node_modules/any-promise/package.json +0 -45
- package/test/node_modules/any-promise/register/bluebird.d.ts +0 -1
- package/test/node_modules/any-promise/register/bluebird.js +0 -2
- package/test/node_modules/any-promise/register/es6-promise.d.ts +0 -1
- package/test/node_modules/any-promise/register/es6-promise.js +0 -2
- package/test/node_modules/any-promise/register/lie.d.ts +0 -1
- package/test/node_modules/any-promise/register/lie.js +0 -2
- package/test/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
- package/test/node_modules/any-promise/register/native-promise-only.js +0 -2
- package/test/node_modules/any-promise/register/pinkie.d.ts +0 -1
- package/test/node_modules/any-promise/register/pinkie.js +0 -2
- package/test/node_modules/any-promise/register/promise.d.ts +0 -1
- package/test/node_modules/any-promise/register/promise.js +0 -2
- package/test/node_modules/any-promise/register/q.d.ts +0 -1
- package/test/node_modules/any-promise/register/q.js +0 -2
- package/test/node_modules/any-promise/register/rsvp.d.ts +0 -1
- package/test/node_modules/any-promise/register/rsvp.js +0 -2
- package/test/node_modules/any-promise/register/vow.d.ts +0 -1
- package/test/node_modules/any-promise/register/vow.js +0 -2
- package/test/node_modules/any-promise/register/when.d.ts +0 -1
- package/test/node_modules/any-promise/register/when.js +0 -2
- package/test/node_modules/any-promise/register-shim.js +0 -18
- package/test/node_modules/any-promise/register.d.ts +0 -17
- package/test/node_modules/any-promise/register.js +0 -94
- package/test/node_modules/anymatch/LICENSE +0 -15
- package/test/node_modules/anymatch/README.md +0 -87
- package/test/node_modules/anymatch/index.d.ts +0 -20
- package/test/node_modules/anymatch/index.js +0 -104
- package/test/node_modules/anymatch/package.json +0 -48
- package/test/node_modules/async/CHANGELOG.md +0 -348
- package/test/node_modules/async/LICENSE +0 -19
- package/test/node_modules/async/README.md +0 -59
- package/test/node_modules/async/all.js +0 -119
- package/test/node_modules/async/allLimit.js +0 -46
- package/test/node_modules/async/allSeries.js +0 -45
- package/test/node_modules/async/any.js +0 -122
- package/test/node_modules/async/anyLimit.js +0 -47
- package/test/node_modules/async/anySeries.js +0 -46
- package/test/node_modules/async/apply.js +0 -55
- package/test/node_modules/async/applyEach.js +0 -57
- package/test/node_modules/async/applyEachSeries.js +0 -37
- package/test/node_modules/async/asyncify.js +0 -118
- package/test/node_modules/async/auto.js +0 -333
- package/test/node_modules/async/autoInject.js +0 -182
- package/test/node_modules/async/bower.json +0 -17
- package/test/node_modules/async/cargo.js +0 -63
- package/test/node_modules/async/cargoQueue.js +0 -71
- package/test/node_modules/async/compose.js +0 -55
- package/test/node_modules/async/concat.js +0 -115
- package/test/node_modules/async/concatLimit.js +0 -60
- package/test/node_modules/async/concatSeries.js +0 -41
- package/test/node_modules/async/constant.js +0 -55
- package/test/node_modules/async/detect.js +0 -96
- package/test/node_modules/async/detectLimit.js +0 -48
- package/test/node_modules/async/detectSeries.js +0 -47
- package/test/node_modules/async/dir.js +0 -43
- package/test/node_modules/async/dist/async.js +0 -6059
- package/test/node_modules/async/dist/async.min.js +0 -1
- package/test/node_modules/async/dist/async.mjs +0 -5947
- package/test/node_modules/async/doDuring.js +0 -68
- package/test/node_modules/async/doUntil.js +0 -46
- package/test/node_modules/async/doWhilst.js +0 -68
- package/test/node_modules/async/during.js +0 -78
- package/test/node_modules/async/each.js +0 -129
- package/test/node_modules/async/eachLimit.js +0 -50
- package/test/node_modules/async/eachOf.js +0 -185
- package/test/node_modules/async/eachOfLimit.js +0 -47
- package/test/node_modules/async/eachOfSeries.js +0 -39
- package/test/node_modules/async/eachSeries.js +0 -44
- package/test/node_modules/async/ensureAsync.js +0 -67
- package/test/node_modules/async/every.js +0 -119
- package/test/node_modules/async/everyLimit.js +0 -46
- package/test/node_modules/async/everySeries.js +0 -45
- package/test/node_modules/async/filter.js +0 -93
- package/test/node_modules/async/filterLimit.js +0 -45
- package/test/node_modules/async/filterSeries.js +0 -43
- package/test/node_modules/async/find.js +0 -96
- package/test/node_modules/async/findLimit.js +0 -48
- package/test/node_modules/async/findSeries.js +0 -47
- package/test/node_modules/async/flatMap.js +0 -115
- package/test/node_modules/async/flatMapLimit.js +0 -60
- package/test/node_modules/async/flatMapSeries.js +0 -41
- package/test/node_modules/async/foldl.js +0 -153
- package/test/node_modules/async/foldr.js +0 -41
- package/test/node_modules/async/forEach.js +0 -129
- package/test/node_modules/async/forEachLimit.js +0 -50
- package/test/node_modules/async/forEachOf.js +0 -185
- package/test/node_modules/async/forEachOfLimit.js +0 -47
- package/test/node_modules/async/forEachOfSeries.js +0 -39
- package/test/node_modules/async/forEachSeries.js +0 -44
- package/test/node_modules/async/forever.js +0 -68
- package/test/node_modules/async/groupBy.js +0 -108
- package/test/node_modules/async/groupByLimit.js +0 -71
- package/test/node_modules/async/groupBySeries.js +0 -36
- package/test/node_modules/async/index.js +0 -588
- package/test/node_modules/async/inject.js +0 -153
- package/test/node_modules/async/internal/DoublyLinkedList.js +0 -92
- package/test/node_modules/async/internal/Heap.js +0 -120
- package/test/node_modules/async/internal/applyEach.js +0 -29
- package/test/node_modules/async/internal/asyncEachOfLimit.js +0 -75
- package/test/node_modules/async/internal/awaitify.js +0 -27
- package/test/node_modules/async/internal/breakLoop.js +0 -10
- package/test/node_modules/async/internal/consoleFunc.js +0 -31
- package/test/node_modules/async/internal/createTester.js +0 -40
- package/test/node_modules/async/internal/eachOfLimit.js +0 -90
- package/test/node_modules/async/internal/filter.js +0 -55
- package/test/node_modules/async/internal/getIterator.js +0 -11
- package/test/node_modules/async/internal/initialParams.js +0 -14
- package/test/node_modules/async/internal/isArrayLike.js +0 -10
- package/test/node_modules/async/internal/iterator.js +0 -57
- package/test/node_modules/async/internal/map.js +0 -30
- package/test/node_modules/async/internal/once.js +0 -17
- package/test/node_modules/async/internal/onlyOnce.js +0 -15
- package/test/node_modules/async/internal/parallel.js +0 -34
- package/test/node_modules/async/internal/promiseCallback.js +0 -23
- package/test/node_modules/async/internal/queue.js +0 -294
- package/test/node_modules/async/internal/range.js +0 -14
- package/test/node_modules/async/internal/reject.js +0 -26
- package/test/node_modules/async/internal/setImmediate.js +0 -34
- package/test/node_modules/async/internal/withoutIndex.js +0 -10
- package/test/node_modules/async/internal/wrapAsync.js +0 -34
- package/test/node_modules/async/log.js +0 -41
- package/test/node_modules/async/map.js +0 -142
- package/test/node_modules/async/mapLimit.js +0 -45
- package/test/node_modules/async/mapSeries.js +0 -44
- package/test/node_modules/async/mapValues.js +0 -152
- package/test/node_modules/async/mapValuesLimit.js +0 -61
- package/test/node_modules/async/mapValuesSeries.js +0 -37
- package/test/node_modules/async/memoize.js +0 -91
- package/test/node_modules/async/nextTick.js +0 -52
- package/test/node_modules/async/package.json +0 -75
- package/test/node_modules/async/parallel.js +0 -180
- package/test/node_modules/async/parallelLimit.js +0 -41
- package/test/node_modules/async/priorityQueue.js +0 -86
- package/test/node_modules/async/queue.js +0 -167
- package/test/node_modules/async/race.js +0 -67
- package/test/node_modules/async/reduce.js +0 -153
- package/test/node_modules/async/reduceRight.js +0 -41
- package/test/node_modules/async/reflect.js +0 -78
- package/test/node_modules/async/reflectAll.js +0 -93
- package/test/node_modules/async/reject.js +0 -87
- package/test/node_modules/async/rejectLimit.js +0 -45
- package/test/node_modules/async/rejectSeries.js +0 -43
- package/test/node_modules/async/retry.js +0 -159
- package/test/node_modules/async/retryable.js +0 -77
- package/test/node_modules/async/select.js +0 -93
- package/test/node_modules/async/selectLimit.js +0 -45
- package/test/node_modules/async/selectSeries.js +0 -43
- package/test/node_modules/async/seq.js +0 -79
- package/test/node_modules/async/series.js +0 -186
- package/test/node_modules/async/setImmediate.js +0 -45
- package/test/node_modules/async/some.js +0 -122
- package/test/node_modules/async/someLimit.js +0 -47
- package/test/node_modules/async/someSeries.js +0 -46
- package/test/node_modules/async/sortBy.js +0 -190
- package/test/node_modules/async/timeout.js +0 -89
- package/test/node_modules/async/times.js +0 -50
- package/test/node_modules/async/timesLimit.js +0 -43
- package/test/node_modules/async/timesSeries.js +0 -32
- package/test/node_modules/async/transform.js +0 -173
- package/test/node_modules/async/tryEach.js +0 -78
- package/test/node_modules/async/unmemoize.js +0 -25
- package/test/node_modules/async/until.js +0 -61
- package/test/node_modules/async/waterfall.js +0 -105
- package/test/node_modules/async/whilst.js +0 -78
- package/test/node_modules/async/wrapSync.js +0 -118
- package/test/node_modules/balanced-match/.github/FUNDING.yml +0 -2
- package/test/node_modules/balanced-match/LICENSE.md +0 -21
- package/test/node_modules/balanced-match/README.md +0 -97
- package/test/node_modules/balanced-match/index.js +0 -62
- package/test/node_modules/balanced-match/package.json +0 -48
- package/test/node_modules/binary-extensions/binary-extensions.json +0 -260
- package/test/node_modules/binary-extensions/binary-extensions.json.d.ts +0 -3
- package/test/node_modules/binary-extensions/index.d.ts +0 -14
- package/test/node_modules/binary-extensions/index.js +0 -1
- package/test/node_modules/binary-extensions/license +0 -9
- package/test/node_modules/binary-extensions/package.json +0 -38
- package/test/node_modules/binary-extensions/readme.md +0 -41
- package/test/node_modules/bluebird/LICENSE +0 -21
- package/test/node_modules/bluebird/README.md +0 -57
- package/test/node_modules/bluebird/changelog.md +0 -1
- package/test/node_modules/bluebird/js/browser/bluebird.core.js +0 -3914
- package/test/node_modules/bluebird/js/browser/bluebird.core.min.js +0 -31
- package/test/node_modules/bluebird/js/browser/bluebird.js +0 -5778
- package/test/node_modules/bluebird/js/browser/bluebird.min.js +0 -31
- package/test/node_modules/bluebird/js/release/any.js +0 -21
- package/test/node_modules/bluebird/js/release/assert.js +0 -55
- package/test/node_modules/bluebird/js/release/async.js +0 -120
- package/test/node_modules/bluebird/js/release/bind.js +0 -67
- package/test/node_modules/bluebird/js/release/bluebird.js +0 -11
- package/test/node_modules/bluebird/js/release/call_get.js +0 -123
- package/test/node_modules/bluebird/js/release/cancel.js +0 -129
- package/test/node_modules/bluebird/js/release/catch_filter.js +0 -42
- package/test/node_modules/bluebird/js/release/context.js +0 -69
- package/test/node_modules/bluebird/js/release/debuggability.js +0 -1009
- package/test/node_modules/bluebird/js/release/direct_resolve.js +0 -46
- package/test/node_modules/bluebird/js/release/each.js +0 -30
- package/test/node_modules/bluebird/js/release/errors.js +0 -116
- package/test/node_modules/bluebird/js/release/es5.js +0 -80
- package/test/node_modules/bluebird/js/release/filter.js +0 -12
- package/test/node_modules/bluebird/js/release/finally.js +0 -146
- package/test/node_modules/bluebird/js/release/generators.js +0 -223
- package/test/node_modules/bluebird/js/release/join.js +0 -165
- package/test/node_modules/bluebird/js/release/map.js +0 -175
- package/test/node_modules/bluebird/js/release/method.js +0 -55
- package/test/node_modules/bluebird/js/release/nodeback.js +0 -51
- package/test/node_modules/bluebird/js/release/nodeify.js +0 -58
- package/test/node_modules/bluebird/js/release/promise.js +0 -819
- package/test/node_modules/bluebird/js/release/promise_array.js +0 -186
- package/test/node_modules/bluebird/js/release/promisify.js +0 -314
- package/test/node_modules/bluebird/js/release/props.js +0 -118
- package/test/node_modules/bluebird/js/release/queue.js +0 -73
- package/test/node_modules/bluebird/js/release/race.js +0 -49
- package/test/node_modules/bluebird/js/release/reduce.js +0 -183
- package/test/node_modules/bluebird/js/release/schedule.js +0 -62
- package/test/node_modules/bluebird/js/release/settle.js +0 -47
- package/test/node_modules/bluebird/js/release/some.js +0 -148
- package/test/node_modules/bluebird/js/release/synchronous_inspection.js +0 -103
- package/test/node_modules/bluebird/js/release/thenables.js +0 -86
- package/test/node_modules/bluebird/js/release/timers.js +0 -93
- package/test/node_modules/bluebird/js/release/using.js +0 -226
- package/test/node_modules/bluebird/js/release/util.js +0 -421
- package/test/node_modules/bluebird/package.json +0 -78
- package/test/node_modules/brace-expansion/LICENSE +0 -21
- package/test/node_modules/brace-expansion/README.md +0 -129
- package/test/node_modules/brace-expansion/index.js +0 -201
- package/test/node_modules/brace-expansion/package.json +0 -47
- package/test/node_modules/braces/CHANGELOG.md +0 -184
- package/test/node_modules/braces/LICENSE +0 -21
- package/test/node_modules/braces/README.md +0 -593
- package/test/node_modules/braces/index.js +0 -170
- package/test/node_modules/braces/lib/compile.js +0 -57
- package/test/node_modules/braces/lib/constants.js +0 -57
- package/test/node_modules/braces/lib/expand.js +0 -113
- package/test/node_modules/braces/lib/parse.js +0 -333
- package/test/node_modules/braces/lib/stringify.js +0 -32
- package/test/node_modules/braces/lib/utils.js +0 -112
- package/test/node_modules/braces/package.json +0 -77
- package/test/node_modules/cache-content-type/History.md +0 -15
- package/test/node_modules/cache-content-type/README.md +0 -17
- package/test/node_modules/cache-content-type/index.js +0 -15
- package/test/node_modules/cache-content-type/package.json +0 -42
- package/test/node_modules/chalk/index.d.ts +0 -415
- package/test/node_modules/chalk/license +0 -9
- package/test/node_modules/chalk/package.json +0 -68
- package/test/node_modules/chalk/readme.md +0 -341
- package/test/node_modules/chalk/source/index.js +0 -229
- package/test/node_modules/chalk/source/templates.js +0 -134
- package/test/node_modules/chalk/source/util.js +0 -39
- package/test/node_modules/chokidar/LICENSE +0 -21
- package/test/node_modules/chokidar/README.md +0 -308
- package/test/node_modules/chokidar/index.js +0 -973
- package/test/node_modules/chokidar/lib/constants.js +0 -65
- package/test/node_modules/chokidar/lib/fsevents-handler.js +0 -524
- package/test/node_modules/chokidar/lib/nodefs-handler.js +0 -654
- package/test/node_modules/chokidar/package.json +0 -85
- package/test/node_modules/chokidar/types/index.d.ts +0 -188
- package/test/node_modules/co/History.md +0 -172
- package/test/node_modules/co/LICENSE +0 -22
- package/test/node_modules/co/Readme.md +0 -212
- package/test/node_modules/co/index.js +0 -237
- package/test/node_modules/co/package.json +0 -34
- package/test/node_modules/color-convert/CHANGELOG.md +0 -54
- package/test/node_modules/color-convert/LICENSE +0 -21
- package/test/node_modules/color-convert/README.md +0 -68
- package/test/node_modules/color-convert/conversions.js +0 -839
- package/test/node_modules/color-convert/index.js +0 -81
- package/test/node_modules/color-convert/package.json +0 -48
- package/test/node_modules/color-convert/route.js +0 -97
- package/test/node_modules/color-name/LICENSE +0 -8
- package/test/node_modules/color-name/README.md +0 -11
- package/test/node_modules/color-name/index.js +0 -152
- package/test/node_modules/color-name/package.json +0 -28
- package/test/node_modules/commander/CHANGELOG.md +0 -419
- package/test/node_modules/commander/LICENSE +0 -22
- package/test/node_modules/commander/Readme.md +0 -428
- package/test/node_modules/commander/index.js +0 -1224
- package/test/node_modules/commander/package.json +0 -38
- package/test/node_modules/commander/typings/index.d.ts +0 -310
- package/test/node_modules/concat-map/.travis.yml +0 -4
- package/test/node_modules/concat-map/LICENSE +0 -18
- package/test/node_modules/concat-map/README.markdown +0 -62
- package/test/node_modules/concat-map/example/map.js +0 -6
- package/test/node_modules/concat-map/index.js +0 -13
- package/test/node_modules/concat-map/package.json +0 -43
- package/test/node_modules/concat-map/test/map.js +0 -39
- package/test/node_modules/condense-newlines/LICENSE +0 -21
- package/test/node_modules/condense-newlines/README.md +0 -105
- package/test/node_modules/condense-newlines/index.js +0 -60
- package/test/node_modules/condense-newlines/package.json +0 -64
- package/test/node_modules/config-chain/LICENCE +0 -22
- package/test/node_modules/config-chain/index.js +0 -282
- package/test/node_modules/config-chain/package.json +0 -28
- package/test/node_modules/config-chain/readme.markdown +0 -257
- package/test/node_modules/consolidate/History.md +0 -132
- package/test/node_modules/consolidate/Readme.md +0 -223
- package/test/node_modules/consolidate/index.js +0 -1
- package/test/node_modules/consolidate/lib/consolidate.js +0 -1792
- package/test/node_modules/consolidate/package.json +0 -94
- package/test/node_modules/content-disposition/HISTORY.md +0 -60
- package/test/node_modules/content-disposition/LICENSE +0 -22
- package/test/node_modules/content-disposition/README.md +0 -142
- package/test/node_modules/content-disposition/index.js +0 -458
- package/test/node_modules/content-disposition/package.json +0 -44
- package/test/node_modules/content-type/HISTORY.md +0 -24
- package/test/node_modules/content-type/LICENSE +0 -22
- package/test/node_modules/content-type/README.md +0 -92
- package/test/node_modules/content-type/index.js +0 -222
- package/test/node_modules/content-type/package.json +0 -40
- package/test/node_modules/cookies/HISTORY.md +0 -121
- package/test/node_modules/cookies/LICENSE +0 -23
- package/test/node_modules/cookies/README.md +0 -145
- package/test/node_modules/cookies/index.js +0 -224
- package/test/node_modules/cookies/package.json +0 -38
- package/test/node_modules/debug/LICENSE +0 -20
- package/test/node_modules/debug/README.md +0 -481
- package/test/node_modules/debug/package.json +0 -59
- package/test/node_modules/debug/src/browser.js +0 -269
- package/test/node_modules/debug/src/common.js +0 -274
- package/test/node_modules/debug/src/index.js +0 -10
- package/test/node_modules/debug/src/node.js +0 -263
- package/test/node_modules/deep-equal/.travis.yml +0 -8
- package/test/node_modules/deep-equal/LICENSE +0 -18
- package/test/node_modules/deep-equal/example/cmp.js +0 -11
- package/test/node_modules/deep-equal/index.js +0 -94
- package/test/node_modules/deep-equal/lib/is_arguments.js +0 -20
- package/test/node_modules/deep-equal/lib/keys.js +0 -9
- package/test/node_modules/deep-equal/package.json +0 -58
- package/test/node_modules/deep-equal/readme.markdown +0 -61
- package/test/node_modules/deep-equal/test/cmp.js +0 -95
- package/test/node_modules/delegates/History.md +0 -22
- package/test/node_modules/delegates/License +0 -20
- package/test/node_modules/delegates/Makefile +0 -8
- package/test/node_modules/delegates/Readme.md +0 -94
- package/test/node_modules/delegates/index.js +0 -121
- package/test/node_modules/delegates/package.json +0 -13
- package/test/node_modules/delegates/test/index.js +0 -94
- package/test/node_modules/depd/History.md +0 -103
- package/test/node_modules/depd/LICENSE +0 -22
- package/test/node_modules/depd/Readme.md +0 -280
- package/test/node_modules/depd/index.js +0 -538
- package/test/node_modules/depd/lib/browser/index.js +0 -77
- package/test/node_modules/depd/package.json +0 -45
- package/test/node_modules/destroy/LICENSE +0 -23
- package/test/node_modules/destroy/README.md +0 -63
- package/test/node_modules/destroy/index.js +0 -209
- package/test/node_modules/destroy/package.json +0 -48
- package/test/node_modules/editorconfig/CHANGELOG.md +0 -14
- package/test/node_modules/editorconfig/LICENSE +0 -19
- package/test/node_modules/editorconfig/README.md +0 -206
- package/test/node_modules/editorconfig/bin/editorconfig +0 -3
- package/test/node_modules/editorconfig/package.json +0 -59
- package/test/node_modules/editorconfig/src/cli.d.ts +0 -1
- package/test/node_modules/editorconfig/src/cli.js +0 -53
- package/test/node_modules/editorconfig/src/index.d.ts +0 -29
- package/test/node_modules/editorconfig/src/index.js +0 -261
- package/test/node_modules/editorconfig/src/lib/fnmatch.d.ts +0 -214
- package/test/node_modules/editorconfig/src/lib/fnmatch.js +0 -1047
- package/test/node_modules/editorconfig/src/lib/ini.d.ts +0 -14
- package/test/node_modules/editorconfig/src/lib/ini.js +0 -106
- package/test/node_modules/ee-first/LICENSE +0 -22
- package/test/node_modules/ee-first/README.md +0 -80
- package/test/node_modules/ee-first/index.js +0 -95
- package/test/node_modules/ee-first/package.json +0 -29
- package/test/node_modules/ejs/LICENSE +0 -202
- package/test/node_modules/ejs/README.md +0 -344
- package/test/node_modules/ejs/bin/cli.js +0 -212
- package/test/node_modules/ejs/ejs.js +0 -1720
- package/test/node_modules/ejs/ejs.min.js +0 -1
- package/test/node_modules/ejs/jakefile.js +0 -88
- package/test/node_modules/ejs/lib/ejs.js +0 -951
- package/test/node_modules/ejs/lib/utils.js +0 -225
- package/test/node_modules/ejs/package.json +0 -42
- package/test/node_modules/ejs/usage.txt +0 -24
- package/test/node_modules/encodeurl/HISTORY.md +0 -14
- package/test/node_modules/encodeurl/LICENSE +0 -22
- package/test/node_modules/encodeurl/README.md +0 -128
- package/test/node_modules/encodeurl/index.js +0 -60
- package/test/node_modules/encodeurl/package.json +0 -40
- package/test/node_modules/escape-html/LICENSE +0 -24
- package/test/node_modules/escape-html/Readme.md +0 -43
- package/test/node_modules/escape-html/index.js +0 -78
- package/test/node_modules/escape-html/package.json +0 -24
- package/test/node_modules/extend-shallow/LICENSE +0 -21
- package/test/node_modules/extend-shallow/README.md +0 -61
- package/test/node_modules/extend-shallow/index.js +0 -33
- package/test/node_modules/extend-shallow/package.json +0 -56
- package/test/node_modules/filelist/README.md +0 -84
- package/test/node_modules/filelist/index.d.ts +0 -110
- package/test/node_modules/filelist/index.js +0 -495
- package/test/node_modules/filelist/jakefile.js +0 -15
- package/test/node_modules/filelist/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
- package/test/node_modules/filelist/node_modules/brace-expansion/LICENSE +0 -21
- package/test/node_modules/filelist/node_modules/brace-expansion/README.md +0 -135
- package/test/node_modules/filelist/node_modules/brace-expansion/index.js +0 -203
- package/test/node_modules/filelist/node_modules/brace-expansion/package.json +0 -46
- package/test/node_modules/filelist/node_modules/minimatch/LICENSE +0 -15
- package/test/node_modules/filelist/node_modules/minimatch/README.md +0 -259
- package/test/node_modules/filelist/node_modules/minimatch/lib/path.js +0 -4
- package/test/node_modules/filelist/node_modules/minimatch/minimatch.js +0 -906
- package/test/node_modules/filelist/node_modules/minimatch/package.json +0 -32
- package/test/node_modules/filelist/package.json +0 -28
- package/test/node_modules/fill-range/LICENSE +0 -21
- package/test/node_modules/fill-range/README.md +0 -237
- package/test/node_modules/fill-range/index.js +0 -249
- package/test/node_modules/fill-range/package.json +0 -69
- package/test/node_modules/fresh/HISTORY.md +0 -70
- package/test/node_modules/fresh/LICENSE +0 -23
- package/test/node_modules/fresh/README.md +0 -119
- package/test/node_modules/fresh/index.js +0 -137
- package/test/node_modules/fresh/package.json +0 -46
- package/test/node_modules/fs.realpath/LICENSE +0 -43
- package/test/node_modules/fs.realpath/README.md +0 -33
- package/test/node_modules/fs.realpath/index.js +0 -66
- package/test/node_modules/fs.realpath/old.js +0 -303
- package/test/node_modules/fs.realpath/package.json +0 -26
- package/test/node_modules/get-paths/.editorconfig +0 -9
- package/test/node_modules/get-paths/.gitattributes +0 -1
- package/test/node_modules/get-paths/.lib.eslintrc +0 -3
- package/test/node_modules/get-paths/.remarkignore +0 -1
- package/test/node_modules/get-paths/.travis.yml +0 -6
- package/test/node_modules/get-paths/LICENSE +0 -21
- package/test/node_modules/get-paths/README.md +0 -61
- package/test/node_modules/get-paths/index.js +0 -31
- package/test/node_modules/get-paths/package.json +0 -100
- package/test/node_modules/get-paths/test/test.js +0 -7
- package/test/node_modules/glob/LICENSE +0 -15
- package/test/node_modules/glob/README.md +0 -378
- package/test/node_modules/glob/common.js +0 -240
- package/test/node_modules/glob/glob.js +0 -790
- package/test/node_modules/glob/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
- package/test/node_modules/glob/node_modules/brace-expansion/LICENSE +0 -21
- package/test/node_modules/glob/node_modules/brace-expansion/README.md +0 -135
- package/test/node_modules/glob/node_modules/brace-expansion/index.js +0 -203
- package/test/node_modules/glob/node_modules/brace-expansion/package.json +0 -46
- package/test/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
- package/test/node_modules/glob/node_modules/minimatch/README.md +0 -259
- package/test/node_modules/glob/node_modules/minimatch/lib/path.js +0 -4
- package/test/node_modules/glob/node_modules/minimatch/minimatch.js +0 -906
- package/test/node_modules/glob/node_modules/minimatch/package.json +0 -32
- package/test/node_modules/glob/package.json +0 -55
- package/test/node_modules/glob/sync.js +0 -486
- package/test/node_modules/glob-parent/CHANGELOG.md +0 -110
- package/test/node_modules/glob-parent/LICENSE +0 -15
- package/test/node_modules/glob-parent/README.md +0 -137
- package/test/node_modules/glob-parent/index.js +0 -42
- package/test/node_modules/glob-parent/package.json +0 -48
- package/test/node_modules/has-flag/index.d.ts +0 -39
- package/test/node_modules/has-flag/index.js +0 -8
- package/test/node_modules/has-flag/license +0 -9
- package/test/node_modules/has-flag/package.json +0 -46
- package/test/node_modules/has-flag/readme.md +0 -89
- package/test/node_modules/has-symbols/.eslintrc +0 -11
- package/test/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/test/node_modules/has-symbols/.nycrc +0 -9
- package/test/node_modules/has-symbols/CHANGELOG.md +0 -75
- package/test/node_modules/has-symbols/LICENSE +0 -21
- package/test/node_modules/has-symbols/README.md +0 -46
- package/test/node_modules/has-symbols/index.js +0 -13
- package/test/node_modules/has-symbols/package.json +0 -101
- package/test/node_modules/has-symbols/shams.js +0 -42
- package/test/node_modules/has-symbols/test/index.js +0 -22
- package/test/node_modules/has-symbols/test/shams/core-js.js +0 -28
- package/test/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -28
- package/test/node_modules/has-symbols/test/tests.js +0 -56
- package/test/node_modules/has-tostringtag/.eslintrc +0 -11
- package/test/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
- package/test/node_modules/has-tostringtag/CHANGELOG.md +0 -20
- package/test/node_modules/has-tostringtag/LICENSE +0 -21
- package/test/node_modules/has-tostringtag/README.md +0 -46
- package/test/node_modules/has-tostringtag/index.js +0 -7
- package/test/node_modules/has-tostringtag/package.json +0 -84
- package/test/node_modules/has-tostringtag/shams.js +0 -7
- package/test/node_modules/has-tostringtag/test/index.js +0 -21
- package/test/node_modules/has-tostringtag/test/shams/core-js.js +0 -28
- package/test/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -28
- package/test/node_modules/has-tostringtag/test/tests.js +0 -14
- package/test/node_modules/http-assert/HISTORY.md +0 -79
- package/test/node_modules/http-assert/LICENSE +0 -22
- package/test/node_modules/http-assert/README.md +0 -116
- package/test/node_modules/http-assert/index.js +0 -41
- package/test/node_modules/http-assert/package.json +0 -41
- package/test/node_modules/http-errors/HISTORY.md +0 -165
- package/test/node_modules/http-errors/LICENSE +0 -23
- package/test/node_modules/http-errors/README.md +0 -169
- package/test/node_modules/http-errors/index.js +0 -299
- package/test/node_modules/http-errors/node_modules/depd/History.md +0 -96
- package/test/node_modules/http-errors/node_modules/depd/LICENSE +0 -22
- package/test/node_modules/http-errors/node_modules/depd/Readme.md +0 -280
- package/test/node_modules/http-errors/node_modules/depd/index.js +0 -522
- package/test/node_modules/http-errors/node_modules/depd/lib/browser/index.js +0 -77
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/event-listener-count.js +0 -22
- package/test/node_modules/http-errors/node_modules/depd/lib/compat/index.js +0 -79
- package/test/node_modules/http-errors/node_modules/depd/package.json +0 -41
- package/test/node_modules/http-errors/package.json +0 -49
- package/test/node_modules/ignore-by-default/LICENSE +0 -14
- package/test/node_modules/ignore-by-default/README.md +0 -26
- package/test/node_modules/ignore-by-default/index.js +0 -12
- package/test/node_modules/ignore-by-default/package.json +0 -34
- package/test/node_modules/inflight/LICENSE +0 -15
- package/test/node_modules/inflight/README.md +0 -37
- package/test/node_modules/inflight/inflight.js +0 -54
- package/test/node_modules/inflight/package.json +0 -29
- package/test/node_modules/inherits/LICENSE +0 -16
- package/test/node_modules/inherits/README.md +0 -42
- package/test/node_modules/inherits/inherits.js +0 -9
- package/test/node_modules/inherits/inherits_browser.js +0 -27
- package/test/node_modules/inherits/package.json +0 -29
- package/test/node_modules/ini/LICENSE +0 -15
- package/test/node_modules/ini/README.md +0 -102
- package/test/node_modules/ini/ini.js +0 -206
- package/test/node_modules/ini/package.json +0 -33
- package/test/node_modules/is-binary-path/index.d.ts +0 -17
- package/test/node_modules/is-binary-path/index.js +0 -7
- package/test/node_modules/is-binary-path/license +0 -9
- package/test/node_modules/is-binary-path/package.json +0 -40
- package/test/node_modules/is-binary-path/readme.md +0 -34
- package/test/node_modules/is-buffer/LICENSE +0 -21
- package/test/node_modules/is-buffer/README.md +0 -53
- package/test/node_modules/is-buffer/index.js +0 -21
- package/test/node_modules/is-buffer/package.json +0 -51
- package/test/node_modules/is-buffer/test/basic.js +0 -24
- package/test/node_modules/is-extendable/LICENSE +0 -21
- package/test/node_modules/is-extendable/README.md +0 -72
- package/test/node_modules/is-extendable/index.js +0 -13
- package/test/node_modules/is-extendable/package.json +0 -51
- package/test/node_modules/is-extglob/LICENSE +0 -21
- package/test/node_modules/is-extglob/README.md +0 -107
- package/test/node_modules/is-extglob/index.js +0 -20
- package/test/node_modules/is-extglob/package.json +0 -69
- package/test/node_modules/is-generator-function/.eslintignore +0 -1
- package/test/node_modules/is-generator-function/.eslintrc +0 -9
- package/test/node_modules/is-generator-function/.nvmrc +0 -1
- package/test/node_modules/is-generator-function/.nycrc +0 -9
- package/test/node_modules/is-generator-function/CHANGELOG.md +0 -216
- package/test/node_modules/is-generator-function/LICENSE +0 -20
- package/test/node_modules/is-generator-function/README.md +0 -40
- package/test/node_modules/is-generator-function/index.js +0 -38
- package/test/node_modules/is-generator-function/package.json +0 -87
- package/test/node_modules/is-generator-function/test/corejs.js +0 -5
- package/test/node_modules/is-generator-function/test/index.js +0 -83
- package/test/node_modules/is-generator-function/test/uglified.js +0 -8
- package/test/node_modules/is-glob/LICENSE +0 -21
- package/test/node_modules/is-glob/README.md +0 -206
- package/test/node_modules/is-glob/index.js +0 -150
- package/test/node_modules/is-glob/package.json +0 -81
- package/test/node_modules/is-number/LICENSE +0 -21
- package/test/node_modules/is-number/README.md +0 -187
- package/test/node_modules/is-number/index.js +0 -18
- package/test/node_modules/is-number/package.json +0 -82
- package/test/node_modules/is-whitespace/LICENSE +0 -21
- package/test/node_modules/is-whitespace/README.md +0 -47
- package/test/node_modules/is-whitespace/index.js +0 -19
- package/test/node_modules/is-whitespace/package.json +0 -47
- package/test/node_modules/jake/Makefile +0 -44
- package/test/node_modules/jake/README.md +0 -17
- package/test/node_modules/jake/bin/bash_completion.sh +0 -41
- package/test/node_modules/jake/bin/cli.js +0 -31
- package/test/node_modules/jake/jakefile.js +0 -94
- package/test/node_modules/jake/lib/api.js +0 -409
- package/test/node_modules/jake/lib/jake.js +0 -330
- package/test/node_modules/jake/lib/loader.js +0 -173
- package/test/node_modules/jake/lib/namespace.js +0 -115
- package/test/node_modules/jake/lib/package_task.js +0 -406
- package/test/node_modules/jake/lib/parseargs.js +0 -134
- package/test/node_modules/jake/lib/program.js +0 -282
- package/test/node_modules/jake/lib/publish_task.js +0 -290
- package/test/node_modules/jake/lib/rule.js +0 -311
- package/test/node_modules/jake/lib/task/directory_task.js +0 -30
- package/test/node_modules/jake/lib/task/file_task.js +0 -124
- package/test/node_modules/jake/lib/task/index.js +0 -9
- package/test/node_modules/jake/lib/task/task.js +0 -449
- package/test/node_modules/jake/lib/test_task.js +0 -270
- package/test/node_modules/jake/lib/utils/file.js +0 -286
- package/test/node_modules/jake/lib/utils/index.js +0 -297
- package/test/node_modules/jake/lib/utils/logger.js +0 -24
- package/test/node_modules/jake/package.json +0 -42
- package/test/node_modules/jake/test/integration/concurrent.js +0 -45
- package/test/node_modules/jake/test/integration/file.js +0 -228
- package/test/node_modules/jake/test/integration/file_task.js +0 -126
- package/test/node_modules/jake/test/integration/helpers.js +0 -80
- package/test/node_modules/jake/test/integration/jakefile.js +0 -337
- package/test/node_modules/jake/test/integration/jakelib/concurrent.jake.js +0 -113
- package/test/node_modules/jake/test/integration/jakelib/publish.jake.js +0 -49
- package/test/node_modules/jake/test/integration/jakelib/required_module.jake.js +0 -10
- package/test/node_modules/jake/test/integration/jakelib/rule.jake.js +0 -222
- package/test/node_modules/jake/test/integration/publish_task.js +0 -27
- package/test/node_modules/jake/test/integration/rule.js +0 -217
- package/test/node_modules/jake/test/integration/selfdep.js +0 -42
- package/test/node_modules/jake/test/integration/task_base.js +0 -167
- package/test/node_modules/jake/test/unit/jakefile.js +0 -36
- package/test/node_modules/jake/test/unit/namespace.js +0 -77
- package/test/node_modules/jake/test/unit/parseargs.js +0 -169
- package/test/node_modules/jake/usage.txt +0 -16
- package/test/node_modules/js-beautify/LICENSE +0 -9
- package/test/node_modules/js-beautify/README.md +0 -435
- package/test/node_modules/js-beautify/js/bin/css-beautify.js +0 -4
- package/test/node_modules/js-beautify/js/bin/html-beautify.js +0 -4
- package/test/node_modules/js-beautify/js/bin/js-beautify.js +0 -4
- package/test/node_modules/js-beautify/js/index.js +0 -86
- package/test/node_modules/js-beautify/js/lib/beautifier.js +0 -5982
- package/test/node_modules/js-beautify/js/lib/beautifier.min.js +0 -2
- package/test/node_modules/js-beautify/js/lib/beautify-css.js +0 -1675
- package/test/node_modules/js-beautify/js/lib/beautify-html.js +0 -3136
- package/test/node_modules/js-beautify/js/lib/beautify.js +0 -4020
- package/test/node_modules/js-beautify/js/lib/cli.js +0 -705
- package/test/node_modules/js-beautify/js/lib/unpackers/javascriptobfuscator_unpacker.js +0 -132
- package/test/node_modules/js-beautify/js/lib/unpackers/myobfuscate_unpacker.js +0 -119
- package/test/node_modules/js-beautify/js/lib/unpackers/p_a_c_k_e_r_unpacker.js +0 -119
- package/test/node_modules/js-beautify/js/lib/unpackers/urlencode_unpacker.js +0 -104
- package/test/node_modules/js-beautify/js/src/cli.js +0 -705
- package/test/node_modules/js-beautify/js/src/core/directives.js +0 -62
- package/test/node_modules/js-beautify/js/src/core/inputscanner.js +0 -192
- package/test/node_modules/js-beautify/js/src/core/options.js +0 -193
- package/test/node_modules/js-beautify/js/src/core/output.js +0 -419
- package/test/node_modules/js-beautify/js/src/core/pattern.js +0 -94
- package/test/node_modules/js-beautify/js/src/core/templatablepattern.js +0 -211
- package/test/node_modules/js-beautify/js/src/core/token.js +0 -54
- package/test/node_modules/js-beautify/js/src/core/tokenizer.js +0 -140
- package/test/node_modules/js-beautify/js/src/core/tokenstream.js +0 -78
- package/test/node_modules/js-beautify/js/src/core/whitespacepattern.js +0 -105
- package/test/node_modules/js-beautify/js/src/css/beautifier.js +0 -529
- package/test/node_modules/js-beautify/js/src/css/index.js +0 -42
- package/test/node_modules/js-beautify/js/src/css/options.js +0 -56
- package/test/node_modules/js-beautify/js/src/css/tokenizer.js +0 -29
- package/test/node_modules/js-beautify/js/src/html/beautifier.js +0 -878
- package/test/node_modules/js-beautify/js/src/html/index.js +0 -42
- package/test/node_modules/js-beautify/js/src/html/options.js +0 -91
- package/test/node_modules/js-beautify/js/src/html/tokenizer.js +0 -332
- package/test/node_modules/js-beautify/js/src/index.js +0 -44
- package/test/node_modules/js-beautify/js/src/javascript/acorn.js +0 -57
- package/test/node_modules/js-beautify/js/src/javascript/beautifier.js +0 -1472
- package/test/node_modules/js-beautify/js/src/javascript/index.js +0 -42
- package/test/node_modules/js-beautify/js/src/javascript/options.js +0 -93
- package/test/node_modules/js-beautify/js/src/javascript/tokenizer.js +0 -567
- package/test/node_modules/js-beautify/js/src/unpackers/javascriptobfuscator_unpacker.js +0 -132
- package/test/node_modules/js-beautify/js/src/unpackers/myobfuscate_unpacker.js +0 -119
- package/test/node_modules/js-beautify/js/src/unpackers/p_a_c_k_e_r_unpacker.js +0 -119
- package/test/node_modules/js-beautify/js/src/unpackers/urlencode_unpacker.js +0 -104
- package/test/node_modules/js-beautify/package.json +0 -72
- package/test/node_modules/keygrip/HISTORY.md +0 -25
- package/test/node_modules/keygrip/LICENSE +0 -21
- package/test/node_modules/keygrip/README.md +0 -103
- package/test/node_modules/keygrip/index.js +0 -51
- package/test/node_modules/keygrip/package.json +0 -28
- package/test/node_modules/kind-of/LICENSE +0 -21
- package/test/node_modules/kind-of/README.md +0 -261
- package/test/node_modules/kind-of/index.js +0 -116
- package/test/node_modules/kind-of/package.json +0 -90
- package/test/node_modules/koa/History.md +0 -696
- package/test/node_modules/koa/LICENSE +0 -22
- package/test/node_modules/koa/Readme.md +0 -289
- package/test/node_modules/koa/dist/koa.mjs +0 -4
- package/test/node_modules/koa/lib/application.js +0 -314
- package/test/node_modules/koa/lib/context.js +0 -251
- package/test/node_modules/koa/lib/request.js +0 -726
- package/test/node_modules/koa/lib/response.js +0 -588
- package/test/node_modules/koa/package.json +0 -89
- package/test/node_modules/koa-compose/History.md +0 -60
- package/test/node_modules/koa-compose/Readme.md +0 -40
- package/test/node_modules/koa-compose/index.js +0 -48
- package/test/node_modules/koa-compose/package.json +0 -30
- package/test/node_modules/koa-convert/LICENSE +0 -22
- package/test/node_modules/koa-convert/README.md +0 -166
- package/test/node_modules/koa-convert/index.js +0 -105
- package/test/node_modules/koa-convert/package.json +0 -64
- package/test/node_modules/koa-send/History.md +0 -133
- package/test/node_modules/koa-send/LICENSE +0 -22
- package/test/node_modules/koa-send/README.md +0 -109
- package/test/node_modules/koa-send/index.js +0 -188
- package/test/node_modules/koa-send/package.json +0 -58
- package/test/node_modules/koa-views/.eslintrc +0 -14
- package/test/node_modules/koa-views/.gitattributes +0 -1
- package/test/node_modules/koa-views/.github/workflows/test.yml +0 -20
- package/test/node_modules/koa-views/README.md +0 -201
- package/test/node_modules/koa-views/history.md +0 -110
- package/test/node_modules/koa-views/index.d.ts +0 -62
- package/test/node_modules/koa-views/license +0 -22
- package/test/node_modules/koa-views/package.json +0 -68
- package/test/node_modules/koa-views/src/index.js +0 -98
- package/test/node_modules/koa-views/test/.eslintrc +0 -5
- package/test/node_modules/koa-views/test/fixtures/basic.ejs +0 -10
- package/test/node_modules/koa-views/test/fixtures/basic.foo +0 -1
- package/test/node_modules/koa-views/test/fixtures/basic.html +0 -11
- package/test/node_modules/koa-views/test/fixtures/basic.pug +0 -9
- package/test/node_modules/koa-views/test/fixtures/basic.test.html +0 -11
- package/test/node_modules/koa-views/test/fixtures/global-state.pug +0 -9
- package/test/node_modules/koa-views/test/fixtures/index.html +0 -10
- package/test/node_modules/koa-views/test/fixtures/nunjucks-filter.html +0 -11
- package/test/node_modules/koa-views/test/fixtures/state.pug +0 -9
- package/test/node_modules/koa-views/test/fixtures/underscore.html +0 -11
- package/test/node_modules/koa-views/test/fixtures/view-options-partial.hbs +0 -1
- package/test/node_modules/koa-views/test/fixtures/view-options.hbs +0 -4
- package/test/node_modules/koa-views/test/index.js +0 -431
- package/test/node_modules/koa-views/test-outside/fixtures/basic.ejs +0 -10
- package/test/node_modules/lru-cache/LICENSE +0 -15
- package/test/node_modules/lru-cache/README.md +0 -158
- package/test/node_modules/lru-cache/index.js +0 -468
- package/test/node_modules/lru-cache/package.json +0 -36
- package/test/node_modules/media-typer/HISTORY.md +0 -22
- package/test/node_modules/media-typer/LICENSE +0 -22
- package/test/node_modules/media-typer/README.md +0 -81
- package/test/node_modules/media-typer/index.js +0 -270
- package/test/node_modules/media-typer/package.json +0 -26
- package/test/node_modules/mime-db/HISTORY.md +0 -507
- package/test/node_modules/mime-db/LICENSE +0 -23
- package/test/node_modules/mime-db/README.md +0 -100
- package/test/node_modules/mime-db/db.json +0 -8519
- package/test/node_modules/mime-db/index.js +0 -12
- package/test/node_modules/mime-db/package.json +0 -60
- package/test/node_modules/mime-types/HISTORY.md +0 -397
- package/test/node_modules/mime-types/LICENSE +0 -23
- package/test/node_modules/mime-types/README.md +0 -113
- package/test/node_modules/mime-types/index.js +0 -188
- package/test/node_modules/mime-types/package.json +0 -44
- package/test/node_modules/minimatch/LICENSE +0 -15
- package/test/node_modules/minimatch/README.md +0 -230
- package/test/node_modules/minimatch/minimatch.js +0 -947
- package/test/node_modules/minimatch/package.json +0 -33
- package/test/node_modules/ms/index.js +0 -162
- package/test/node_modules/ms/license.md +0 -21
- package/test/node_modules/ms/package.json +0 -37
- package/test/node_modules/ms/readme.md +0 -60
- package/test/node_modules/mz/HISTORY.md +0 -66
- package/test/node_modules/mz/LICENSE +0 -22
- package/test/node_modules/mz/README.md +0 -106
- package/test/node_modules/mz/child_process.js +0 -8
- package/test/node_modules/mz/crypto.js +0 -9
- package/test/node_modules/mz/dns.js +0 -16
- package/test/node_modules/mz/fs.js +0 -62
- package/test/node_modules/mz/index.js +0 -8
- package/test/node_modules/mz/package.json +0 -44
- package/test/node_modules/mz/readline.js +0 -64
- package/test/node_modules/mz/zlib.js +0 -13
- package/test/node_modules/negotiator/HISTORY.md +0 -108
- package/test/node_modules/negotiator/LICENSE +0 -24
- package/test/node_modules/negotiator/README.md +0 -203
- package/test/node_modules/negotiator/index.js +0 -82
- package/test/node_modules/negotiator/lib/charset.js +0 -169
- package/test/node_modules/negotiator/lib/encoding.js +0 -184
- package/test/node_modules/negotiator/lib/language.js +0 -179
- package/test/node_modules/negotiator/lib/mediaType.js +0 -294
- package/test/node_modules/negotiator/package.json +0 -42
- package/test/node_modules/nodemon/LICENSE +0 -21
- package/test/node_modules/nodemon/README.md +0 -423
- package/test/node_modules/nodemon/bin/nodemon.js +0 -16
- package/test/node_modules/nodemon/bin/windows-kill.exe +0 -0
- package/test/node_modules/nodemon/doc/cli/authors.txt +0 -8
- package/test/node_modules/nodemon/doc/cli/config.txt +0 -44
- package/test/node_modules/nodemon/doc/cli/help.txt +0 -29
- package/test/node_modules/nodemon/doc/cli/logo.txt +0 -20
- package/test/node_modules/nodemon/doc/cli/options.txt +0 -36
- package/test/node_modules/nodemon/doc/cli/topics.txt +0 -8
- package/test/node_modules/nodemon/doc/cli/usage.txt +0 -3
- package/test/node_modules/nodemon/doc/cli/whoami.txt +0 -9
- package/test/node_modules/nodemon/lib/cli/index.js +0 -49
- package/test/node_modules/nodemon/lib/cli/parse.js +0 -230
- package/test/node_modules/nodemon/lib/config/command.js +0 -43
- package/test/node_modules/nodemon/lib/config/defaults.js +0 -28
- package/test/node_modules/nodemon/lib/config/exec.js +0 -225
- package/test/node_modules/nodemon/lib/config/index.js +0 -93
- package/test/node_modules/nodemon/lib/config/load.js +0 -256
- package/test/node_modules/nodemon/lib/help/index.js +0 -27
- package/test/node_modules/nodemon/lib/index.js +0 -1
- package/test/node_modules/nodemon/lib/monitor/index.js +0 -4
- package/test/node_modules/nodemon/lib/monitor/match.js +0 -276
- package/test/node_modules/nodemon/lib/monitor/run.js +0 -541
- package/test/node_modules/nodemon/lib/monitor/signals.js +0 -34
- package/test/node_modules/nodemon/lib/monitor/watch.js +0 -239
- package/test/node_modules/nodemon/lib/nodemon.js +0 -311
- package/test/node_modules/nodemon/lib/rules/add.js +0 -89
- package/test/node_modules/nodemon/lib/rules/index.js +0 -53
- package/test/node_modules/nodemon/lib/rules/parse.js +0 -43
- package/test/node_modules/nodemon/lib/spawn.js +0 -73
- package/test/node_modules/nodemon/lib/utils/bus.js +0 -44
- package/test/node_modules/nodemon/lib/utils/clone.js +0 -40
- package/test/node_modules/nodemon/lib/utils/colour.js +0 -26
- package/test/node_modules/nodemon/lib/utils/index.js +0 -102
- package/test/node_modules/nodemon/lib/utils/log.js +0 -82
- package/test/node_modules/nodemon/lib/utils/merge.js +0 -47
- package/test/node_modules/nodemon/lib/version.js +0 -100
- package/test/node_modules/nodemon/node_modules/debug/CHANGELOG.md +0 -395
- package/test/node_modules/nodemon/node_modules/debug/LICENSE +0 -19
- package/test/node_modules/nodemon/node_modules/debug/README.md +0 -437
- package/test/node_modules/nodemon/node_modules/debug/node.js +0 -1
- package/test/node_modules/nodemon/node_modules/debug/package.json +0 -51
- package/test/node_modules/nodemon/node_modules/debug/src/browser.js +0 -180
- package/test/node_modules/nodemon/node_modules/debug/src/common.js +0 -249
- package/test/node_modules/nodemon/node_modules/debug/src/index.js +0 -12
- package/test/node_modules/nodemon/node_modules/debug/src/node.js +0 -177
- package/test/node_modules/nodemon/node_modules/has-flag/index.js +0 -8
- package/test/node_modules/nodemon/node_modules/has-flag/license +0 -9
- package/test/node_modules/nodemon/node_modules/has-flag/package.json +0 -44
- package/test/node_modules/nodemon/node_modules/has-flag/readme.md +0 -70
- package/test/node_modules/nodemon/node_modules/supports-color/browser.js +0 -5
- package/test/node_modules/nodemon/node_modules/supports-color/index.js +0 -131
- package/test/node_modules/nodemon/node_modules/supports-color/license +0 -9
- package/test/node_modules/nodemon/node_modules/supports-color/package.json +0 -53
- package/test/node_modules/nodemon/node_modules/supports-color/readme.md +0 -66
- package/test/node_modules/nodemon/package.json +0 -74
- package/test/node_modules/nopt/LICENSE +0 -15
- package/test/node_modules/nopt/README.md +0 -213
- package/test/node_modules/nopt/bin/nopt.js +0 -56
- package/test/node_modules/nopt/lib/nopt.js +0 -515
- package/test/node_modules/nopt/package.json +0 -53
- package/test/node_modules/normalize-path/LICENSE +0 -21
- package/test/node_modules/normalize-path/README.md +0 -127
- package/test/node_modules/normalize-path/index.js +0 -35
- package/test/node_modules/normalize-path/package.json +0 -77
- package/test/node_modules/object-assign/index.js +0 -90
- package/test/node_modules/object-assign/license +0 -21
- package/test/node_modules/object-assign/package.json +0 -42
- package/test/node_modules/object-assign/readme.md +0 -61
- package/test/node_modules/on-finished/HISTORY.md +0 -98
- package/test/node_modules/on-finished/LICENSE +0 -23
- package/test/node_modules/on-finished/README.md +0 -162
- package/test/node_modules/on-finished/index.js +0 -234
- package/test/node_modules/on-finished/package.json +0 -39
- package/test/node_modules/once/LICENSE +0 -15
- package/test/node_modules/once/README.md +0 -79
- package/test/node_modules/once/once.js +0 -42
- package/test/node_modules/once/package.json +0 -33
- package/test/node_modules/only/History.md +0 -5
- package/test/node_modules/only/Makefile +0 -7
- package/test/node_modules/only/Readme.md +0 -58
- package/test/node_modules/only/index.js +0 -10
- package/test/node_modules/only/package.json +0 -14
- package/test/node_modules/parseurl/HISTORY.md +0 -58
- package/test/node_modules/parseurl/LICENSE +0 -24
- package/test/node_modules/parseurl/README.md +0 -133
- package/test/node_modules/parseurl/index.js +0 -158
- package/test/node_modules/parseurl/package.json +0 -40
- package/test/node_modules/path-is-absolute/index.js +0 -20
- package/test/node_modules/path-is-absolute/license +0 -21
- package/test/node_modules/path-is-absolute/package.json +0 -43
- package/test/node_modules/path-is-absolute/readme.md +0 -59
- package/test/node_modules/picomatch/CHANGELOG.md +0 -136
- package/test/node_modules/picomatch/LICENSE +0 -21
- package/test/node_modules/picomatch/README.md +0 -708
- package/test/node_modules/picomatch/index.js +0 -3
- package/test/node_modules/picomatch/lib/constants.js +0 -179
- package/test/node_modules/picomatch/lib/parse.js +0 -1091
- package/test/node_modules/picomatch/lib/picomatch.js +0 -342
- package/test/node_modules/picomatch/lib/scan.js +0 -391
- package/test/node_modules/picomatch/lib/utils.js +0 -64
- package/test/node_modules/picomatch/package.json +0 -81
- package/test/node_modules/pify/index.js +0 -68
- package/test/node_modules/pify/license +0 -9
- package/test/node_modules/pify/package.json +0 -51
- package/test/node_modules/pify/readme.md +0 -145
- package/test/node_modules/pretty/LICENSE +0 -21
- package/test/node_modules/pretty/README.md +0 -105
- package/test/node_modules/pretty/index.js +0 -45
- package/test/node_modules/pretty/package.json +0 -54
- package/test/node_modules/proto-list/LICENSE +0 -15
- package/test/node_modules/proto-list/README.md +0 -3
- package/test/node_modules/proto-list/package.json +0 -18
- package/test/node_modules/proto-list/proto-list.js +0 -88
- package/test/node_modules/proto-list/test/basic.js +0 -61
- package/test/node_modules/pseudomap/LICENSE +0 -15
- package/test/node_modules/pseudomap/README.md +0 -60
- package/test/node_modules/pseudomap/map.js +0 -9
- package/test/node_modules/pseudomap/package.json +0 -25
- package/test/node_modules/pseudomap/pseudomap.js +0 -113
- package/test/node_modules/pseudomap/test/basic.js +0 -86
- package/test/node_modules/pstree.remy/.travis.yml +0 -8
- package/test/node_modules/pstree.remy/LICENSE +0 -7
- package/test/node_modules/pstree.remy/README.md +0 -26
- package/test/node_modules/pstree.remy/lib/index.js +0 -37
- package/test/node_modules/pstree.remy/lib/tree.js +0 -37
- package/test/node_modules/pstree.remy/lib/utils.js +0 -53
- package/test/node_modules/pstree.remy/package.json +0 -33
- package/test/node_modules/pstree.remy/tests/fixtures/index.js +0 -13
- package/test/node_modules/pstree.remy/tests/fixtures/out1 +0 -10
- package/test/node_modules/pstree.remy/tests/fixtures/out2 +0 -29
- package/test/node_modules/pstree.remy/tests/index.test.js +0 -51
- package/test/node_modules/readdirp/LICENSE +0 -21
- package/test/node_modules/readdirp/README.md +0 -122
- package/test/node_modules/readdirp/index.d.ts +0 -43
- package/test/node_modules/readdirp/index.js +0 -287
- package/test/node_modules/readdirp/package.json +0 -122
- package/test/node_modules/resolve-path/HISTORY.md +0 -66
- package/test/node_modules/resolve-path/LICENSE +0 -23
- package/test/node_modules/resolve-path/README.md +0 -111
- package/test/node_modules/resolve-path/index.js +0 -88
- package/test/node_modules/resolve-path/node_modules/depd/History.md +0 -96
- package/test/node_modules/resolve-path/node_modules/depd/LICENSE +0 -22
- package/test/node_modules/resolve-path/node_modules/depd/Readme.md +0 -280
- package/test/node_modules/resolve-path/node_modules/depd/index.js +0 -522
- package/test/node_modules/resolve-path/node_modules/depd/lib/browser/index.js +0 -77
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/event-listener-count.js +0 -22
- package/test/node_modules/resolve-path/node_modules/depd/lib/compat/index.js +0 -79
- package/test/node_modules/resolve-path/node_modules/depd/package.json +0 -41
- package/test/node_modules/resolve-path/node_modules/http-errors/HISTORY.md +0 -132
- package/test/node_modules/resolve-path/node_modules/http-errors/LICENSE +0 -23
- package/test/node_modules/resolve-path/node_modules/http-errors/README.md +0 -135
- package/test/node_modules/resolve-path/node_modules/http-errors/index.js +0 -260
- package/test/node_modules/resolve-path/node_modules/http-errors/package.json +0 -48
- package/test/node_modules/resolve-path/node_modules/inherits/LICENSE +0 -16
- package/test/node_modules/resolve-path/node_modules/inherits/README.md +0 -42
- package/test/node_modules/resolve-path/node_modules/inherits/inherits.js +0 -7
- package/test/node_modules/resolve-path/node_modules/inherits/inherits_browser.js +0 -23
- package/test/node_modules/resolve-path/node_modules/inherits/package.json +0 -29
- package/test/node_modules/resolve-path/node_modules/setprototypeof/LICENSE +0 -13
- package/test/node_modules/resolve-path/node_modules/setprototypeof/README.md +0 -26
- package/test/node_modules/resolve-path/node_modules/setprototypeof/index.d.ts +0 -2
- package/test/node_modules/resolve-path/node_modules/setprototypeof/index.js +0 -15
- package/test/node_modules/resolve-path/node_modules/setprototypeof/package.json +0 -25
- package/test/node_modules/resolve-path/package.json +0 -46
- package/test/node_modules/safe-buffer/LICENSE +0 -21
- package/test/node_modules/safe-buffer/README.md +0 -584
- package/test/node_modules/safe-buffer/index.d.ts +0 -187
- package/test/node_modules/safe-buffer/index.js +0 -65
- package/test/node_modules/safe-buffer/package.json +0 -51
- package/test/node_modules/semver/CHANGELOG.md +0 -39
- package/test/node_modules/semver/LICENSE +0 -15
- package/test/node_modules/semver/README.md +0 -412
- package/test/node_modules/semver/bin/semver +0 -160
- package/test/node_modules/semver/package.json +0 -28
- package/test/node_modules/semver/range.bnf +0 -16
- package/test/node_modules/semver/semver.js +0 -1483
- package/test/node_modules/setprototypeof/LICENSE +0 -13
- package/test/node_modules/setprototypeof/README.md +0 -31
- package/test/node_modules/setprototypeof/index.d.ts +0 -2
- package/test/node_modules/setprototypeof/index.js +0 -17
- package/test/node_modules/setprototypeof/package.json +0 -38
- package/test/node_modules/setprototypeof/test/index.js +0 -24
- package/test/node_modules/sigmund/LICENSE +0 -15
- package/test/node_modules/sigmund/README.md +0 -53
- package/test/node_modules/sigmund/bench.js +0 -283
- package/test/node_modules/sigmund/package.json +0 -30
- package/test/node_modules/sigmund/sigmund.js +0 -39
- package/test/node_modules/sigmund/test/basic.js +0 -24
- package/test/node_modules/simple-update-notifier/LICENSE +0 -21
- package/test/node_modules/simple-update-notifier/README.md +0 -82
- package/test/node_modules/simple-update-notifier/build/index.d.ts +0 -13
- package/test/node_modules/simple-update-notifier/build/index.js +0 -217
- package/test/node_modules/simple-update-notifier/node_modules/semver/CHANGELOG.md +0 -74
- package/test/node_modules/simple-update-notifier/node_modules/semver/LICENSE +0 -15
- package/test/node_modules/simple-update-notifier/node_modules/semver/README.md +0 -499
- package/test/node_modules/simple-update-notifier/node_modules/semver/bin/semver.js +0 -173
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/comparator.js +0 -139
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/index.js +0 -5
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/range.js +0 -448
- package/test/node_modules/simple-update-notifier/node_modules/semver/classes/semver.js +0 -290
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/clean.js +0 -6
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/cmp.js +0 -48
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/coerce.js +0 -51
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-build.js +0 -7
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-loose.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare.js +0 -5
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/diff.js +0 -25
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/eq.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gt.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gte.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/inc.js +0 -15
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lt.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lte.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/major.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/minor.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/neq.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/parse.js +0 -37
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/patch.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/prerelease.js +0 -6
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rcompare.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rsort.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/satisfies.js +0 -10
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/sort.js +0 -3
- package/test/node_modules/simple-update-notifier/node_modules/semver/functions/valid.js +0 -6
- package/test/node_modules/simple-update-notifier/node_modules/semver/index.js +0 -64
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/constants.js +0 -17
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/debug.js +0 -9
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/identifiers.js +0 -23
- package/test/node_modules/simple-update-notifier/node_modules/semver/internal/re.js +0 -179
- package/test/node_modules/simple-update-notifier/node_modules/semver/package.json +0 -34
- package/test/node_modules/simple-update-notifier/node_modules/semver/range.bnf +0 -16
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/gtr.js +0 -4
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/intersects.js +0 -7
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/ltr.js +0 -4
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/max-satisfying.js +0 -25
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-satisfying.js +0 -24
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-version.js +0 -57
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/outside.js +0 -80
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/to-comparators.js +0 -8
- package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/valid.js +0 -11
- package/test/node_modules/simple-update-notifier/package.json +0 -97
- package/test/node_modules/simple-update-notifier/src/borderedText.ts +0 -12
- package/test/node_modules/simple-update-notifier/src/cache.spec.ts +0 -17
- package/test/node_modules/simple-update-notifier/src/cache.ts +0 -44
- package/test/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +0 -35
- package/test/node_modules/simple-update-notifier/src/getDistVersion.ts +0 -29
- package/test/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +0 -82
- package/test/node_modules/simple-update-notifier/src/hasNewVersion.ts +0 -40
- package/test/node_modules/simple-update-notifier/src/index.spec.ts +0 -27
- package/test/node_modules/simple-update-notifier/src/index.ts +0 -34
- package/test/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +0 -12
- package/test/node_modules/simple-update-notifier/src/types.ts +0 -8
- package/test/node_modules/statuses/HISTORY.md +0 -65
- package/test/node_modules/statuses/LICENSE +0 -23
- package/test/node_modules/statuses/README.md +0 -127
- package/test/node_modules/statuses/codes.json +0 -66
- package/test/node_modules/statuses/index.js +0 -113
- package/test/node_modules/statuses/package.json +0 -48
- package/test/node_modules/supports-color/browser.js +0 -5
- package/test/node_modules/supports-color/index.js +0 -135
- package/test/node_modules/supports-color/license +0 -9
- package/test/node_modules/supports-color/package.json +0 -53
- package/test/node_modules/supports-color/readme.md +0 -76
- package/test/node_modules/thenify/History.md +0 -11
- package/test/node_modules/thenify/LICENSE +0 -22
- package/test/node_modules/thenify/README.md +0 -120
- package/test/node_modules/thenify/index.js +0 -77
- package/test/node_modules/thenify/package.json +0 -31
- package/test/node_modules/thenify-all/History.md +0 -11
- package/test/node_modules/thenify-all/LICENSE +0 -22
- package/test/node_modules/thenify-all/README.md +0 -66
- package/test/node_modules/thenify-all/index.js +0 -73
- package/test/node_modules/thenify-all/package.json +0 -34
- package/test/node_modules/to-regex-range/LICENSE +0 -21
- package/test/node_modules/to-regex-range/README.md +0 -305
- package/test/node_modules/to-regex-range/index.js +0 -288
- package/test/node_modules/to-regex-range/package.json +0 -88
- package/test/node_modules/toidentifier/HISTORY.md +0 -9
- package/test/node_modules/toidentifier/LICENSE +0 -21
- package/test/node_modules/toidentifier/README.md +0 -61
- package/test/node_modules/toidentifier/index.js +0 -32
- package/test/node_modules/toidentifier/package.json +0 -38
- package/test/node_modules/touch/LICENSE +0 -15
- package/test/node_modules/touch/README.md +0 -52
- package/test/node_modules/touch/bin/nodetouch.js +0 -112
- package/test/node_modules/touch/index.js +0 -224
- package/test/node_modules/touch/node_modules/nopt/LICENSE +0 -23
- package/test/node_modules/touch/node_modules/nopt/README.md +0 -208
- package/test/node_modules/touch/node_modules/nopt/bin/nopt.js +0 -44
- package/test/node_modules/touch/node_modules/nopt/examples/my-program.js +0 -30
- package/test/node_modules/touch/node_modules/nopt/lib/nopt.js +0 -552
- package/test/node_modules/touch/node_modules/nopt/package.json +0 -12
- package/test/node_modules/touch/package.json +0 -28
- package/test/node_modules/tsscmp/.travis.yml +0 -18
- package/test/node_modules/tsscmp/LICENSE +0 -21
- package/test/node_modules/tsscmp/README.md +0 -48
- package/test/node_modules/tsscmp/appveyor.yml +0 -29
- package/test/node_modules/tsscmp/lib/index.js +0 -38
- package/test/node_modules/tsscmp/package.json +0 -29
- package/test/node_modules/tsscmp/test/benchmark/index.js +0 -30
- package/test/node_modules/tsscmp/test/unit/index.js +0 -69
- package/test/node_modules/type-is/HISTORY.md +0 -259
- package/test/node_modules/type-is/LICENSE +0 -23
- package/test/node_modules/type-is/README.md +0 -170
- package/test/node_modules/type-is/index.js +0 -266
- package/test/node_modules/type-is/package.json +0 -45
- package/test/node_modules/undefsafe/.github/workflows/release.yml +0 -25
- package/test/node_modules/undefsafe/.jscsrc +0 -13
- package/test/node_modules/undefsafe/.jshintrc +0 -16
- package/test/node_modules/undefsafe/.travis.yml +0 -18
- package/test/node_modules/undefsafe/LICENSE +0 -22
- package/test/node_modules/undefsafe/README.md +0 -63
- package/test/node_modules/undefsafe/example.js +0 -14
- package/test/node_modules/undefsafe/lib/undefsafe.js +0 -125
- package/test/node_modules/undefsafe/package.json +0 -34
- package/test/node_modules/vary/HISTORY.md +0 -39
- package/test/node_modules/vary/LICENSE +0 -22
- package/test/node_modules/vary/README.md +0 -101
- package/test/node_modules/vary/index.js +0 -149
- package/test/node_modules/vary/package.json +0 -43
- package/test/node_modules/wrappy/LICENSE +0 -15
- package/test/node_modules/wrappy/README.md +0 -36
- package/test/node_modules/wrappy/package.json +0 -29
- package/test/node_modules/wrappy/wrappy.js +0 -33
- package/test/node_modules/yallist/LICENSE +0 -15
- package/test/node_modules/yallist/README.md +0 -204
- package/test/node_modules/yallist/iterator.js +0 -7
- package/test/node_modules/yallist/package.json +0 -29
- package/test/node_modules/yallist/yallist.js +0 -370
- package/test/node_modules/ylru/History.md +0 -42
- package/test/node_modules/ylru/LICENSE +0 -23
- package/test/node_modules/ylru/README.md +0 -99
- package/test/node_modules/ylru/index.d.ts +0 -18
- package/test/node_modules/ylru/index.js +0 -106
- package/test/node_modules/ylru/package.json +0 -52
- package/test/package-lock.json +0 -2212
- package/test/package.json +0 -17
- package/test/public/api +0 -1
- package/test/public/cartella nuova/ewewew.html +0 -12
- package/test/public/cartella nuova/prova.ejs +0 -12
- package/test/public/index.ejs +0 -12
- package/test/public/index.html +0 -12
- package/test/public/proma_template.ejs +0 -16
- package/test/public/un altro file.html +0 -12
- package/test/public/un_file.html +0 -12
- package/test/test.js +0 -63
|
@@ -1,1472 +0,0 @@
|
|
|
1
|
-
/*jshint node:true */
|
|
2
|
-
/*
|
|
3
|
-
|
|
4
|
-
The MIT License (MIT)
|
|
5
|
-
|
|
6
|
-
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
|
|
7
|
-
|
|
8
|
-
Permission is hereby granted, free of charge, to any person
|
|
9
|
-
obtaining a copy of this software and associated documentation files
|
|
10
|
-
(the "Software"), to deal in the Software without restriction,
|
|
11
|
-
including without limitation the rights to use, copy, modify, merge,
|
|
12
|
-
publish, distribute, sublicense, and/or sell copies of the Software,
|
|
13
|
-
and to permit persons to whom the Software is furnished to do so,
|
|
14
|
-
subject to the following conditions:
|
|
15
|
-
|
|
16
|
-
The above copyright notice and this permission notice shall be
|
|
17
|
-
included in all copies or substantial portions of the Software.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
20
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
21
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
22
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
23
|
-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
24
|
-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
'use strict';
|
|
30
|
-
|
|
31
|
-
var Output = require('../core/output').Output;
|
|
32
|
-
var Token = require('../core/token').Token;
|
|
33
|
-
var acorn = require('./acorn');
|
|
34
|
-
var Options = require('./options').Options;
|
|
35
|
-
var Tokenizer = require('./tokenizer').Tokenizer;
|
|
36
|
-
var line_starters = require('./tokenizer').line_starters;
|
|
37
|
-
var positionable_operators = require('./tokenizer').positionable_operators;
|
|
38
|
-
var TOKEN = require('./tokenizer').TOKEN;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
function in_array(what, arr) {
|
|
42
|
-
return arr.indexOf(what) !== -1;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function ltrim(s) {
|
|
46
|
-
return s.replace(/^\s+/g, '');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function generateMapFromStrings(list) {
|
|
50
|
-
var result = {};
|
|
51
|
-
for (var x = 0; x < list.length; x++) {
|
|
52
|
-
// make the mapped names underscored instead of dash
|
|
53
|
-
result[list[x].replace(/-/g, '_')] = list[x];
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function reserved_word(token, word) {
|
|
59
|
-
return token && token.type === TOKEN.RESERVED && token.text === word;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function reserved_array(token, words) {
|
|
63
|
-
return token && token.type === TOKEN.RESERVED && in_array(token.text, words);
|
|
64
|
-
}
|
|
65
|
-
// Unsure of what they mean, but they work. Worth cleaning up in future.
|
|
66
|
-
var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];
|
|
67
|
-
|
|
68
|
-
var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
|
|
69
|
-
|
|
70
|
-
// Generate map from array
|
|
71
|
-
var OPERATOR_POSITION = generateMapFromStrings(validPositionValues);
|
|
72
|
-
|
|
73
|
-
var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];
|
|
74
|
-
|
|
75
|
-
var MODE = {
|
|
76
|
-
BlockStatement: 'BlockStatement', // 'BLOCK'
|
|
77
|
-
Statement: 'Statement', // 'STATEMENT'
|
|
78
|
-
ObjectLiteral: 'ObjectLiteral', // 'OBJECT',
|
|
79
|
-
ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',
|
|
80
|
-
ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',
|
|
81
|
-
Conditional: 'Conditional', //'(COND-EXPRESSION)',
|
|
82
|
-
Expression: 'Expression' //'(EXPRESSION)'
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
function remove_redundant_indentation(output, frame) {
|
|
86
|
-
// This implementation is effective but has some issues:
|
|
87
|
-
// - can cause line wrap to happen too soon due to indent removal
|
|
88
|
-
// after wrap points are calculated
|
|
89
|
-
// These issues are minor compared to ugly indentation.
|
|
90
|
-
|
|
91
|
-
if (frame.multiline_frame ||
|
|
92
|
-
frame.mode === MODE.ForInitializer ||
|
|
93
|
-
frame.mode === MODE.Conditional) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// remove one indent from each line inside this section
|
|
98
|
-
output.remove_indent(frame.start_line_index);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// we could use just string.split, but
|
|
102
|
-
// IE doesn't like returning empty strings
|
|
103
|
-
function split_linebreaks(s) {
|
|
104
|
-
//return s.split(/\x0d\x0a|\x0a/);
|
|
105
|
-
|
|
106
|
-
s = s.replace(acorn.allLineBreaks, '\n');
|
|
107
|
-
var out = [],
|
|
108
|
-
idx = s.indexOf("\n");
|
|
109
|
-
while (idx !== -1) {
|
|
110
|
-
out.push(s.substring(0, idx));
|
|
111
|
-
s = s.substring(idx + 1);
|
|
112
|
-
idx = s.indexOf("\n");
|
|
113
|
-
}
|
|
114
|
-
if (s.length) {
|
|
115
|
-
out.push(s);
|
|
116
|
-
}
|
|
117
|
-
return out;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function is_array(mode) {
|
|
121
|
-
return mode === MODE.ArrayLiteral;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function is_expression(mode) {
|
|
125
|
-
return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function all_lines_start_with(lines, c) {
|
|
129
|
-
for (var i = 0; i < lines.length; i++) {
|
|
130
|
-
var line = lines[i].trim();
|
|
131
|
-
if (line.charAt(0) !== c) {
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function each_line_matches_indent(lines, indent) {
|
|
139
|
-
var i = 0,
|
|
140
|
-
len = lines.length,
|
|
141
|
-
line;
|
|
142
|
-
for (; i < len; i++) {
|
|
143
|
-
line = lines[i];
|
|
144
|
-
// allow empty lines to pass through
|
|
145
|
-
if (line && line.indexOf(indent) !== 0) {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
function Beautifier(source_text, options) {
|
|
154
|
-
options = options || {};
|
|
155
|
-
this._source_text = source_text || '';
|
|
156
|
-
|
|
157
|
-
this._output = null;
|
|
158
|
-
this._tokens = null;
|
|
159
|
-
this._last_last_text = null;
|
|
160
|
-
this._flags = null;
|
|
161
|
-
this._previous_flags = null;
|
|
162
|
-
|
|
163
|
-
this._flag_store = null;
|
|
164
|
-
this._options = new Options(options);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
Beautifier.prototype.create_flags = function(flags_base, mode) {
|
|
168
|
-
var next_indent_level = 0;
|
|
169
|
-
if (flags_base) {
|
|
170
|
-
next_indent_level = flags_base.indentation_level;
|
|
171
|
-
if (!this._output.just_added_newline() &&
|
|
172
|
-
flags_base.line_indent_level > next_indent_level) {
|
|
173
|
-
next_indent_level = flags_base.line_indent_level;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
var next_flags = {
|
|
178
|
-
mode: mode,
|
|
179
|
-
parent: flags_base,
|
|
180
|
-
last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text
|
|
181
|
-
last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed
|
|
182
|
-
declaration_statement: false,
|
|
183
|
-
declaration_assignment: false,
|
|
184
|
-
multiline_frame: false,
|
|
185
|
-
inline_frame: false,
|
|
186
|
-
if_block: false,
|
|
187
|
-
else_block: false,
|
|
188
|
-
class_start_block: false, // class A { INSIDE HERE } or class B extends C { INSIDE HERE }
|
|
189
|
-
do_block: false,
|
|
190
|
-
do_while: false,
|
|
191
|
-
import_block: false,
|
|
192
|
-
in_case_statement: false, // switch(..){ INSIDE HERE }
|
|
193
|
-
in_case: false, // we're on the exact line with "case 0:"
|
|
194
|
-
case_body: false, // the indented case-action block
|
|
195
|
-
case_block: false, // the indented case-action block is wrapped with {}
|
|
196
|
-
indentation_level: next_indent_level,
|
|
197
|
-
alignment: 0,
|
|
198
|
-
line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,
|
|
199
|
-
start_line_index: this._output.get_line_number(),
|
|
200
|
-
ternary_depth: 0
|
|
201
|
-
};
|
|
202
|
-
return next_flags;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
Beautifier.prototype._reset = function(source_text) {
|
|
206
|
-
var baseIndentString = source_text.match(/^[\t ]*/)[0];
|
|
207
|
-
|
|
208
|
-
this._last_last_text = ''; // pre-last token text
|
|
209
|
-
this._output = new Output(this._options, baseIndentString);
|
|
210
|
-
|
|
211
|
-
// If testing the ignore directive, start with output disable set to true
|
|
212
|
-
this._output.raw = this._options.test_output_raw;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// Stack of parsing/formatting states, including MODE.
|
|
216
|
-
// We tokenize, parse, and output in an almost purely a forward-only stream of token input
|
|
217
|
-
// and formatted output. This makes the beautifier less accurate than full parsers
|
|
218
|
-
// but also far more tolerant of syntax errors.
|
|
219
|
-
//
|
|
220
|
-
// For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type
|
|
221
|
-
// MODE.BlockStatement on the the stack, even though it could be object literal. If we later
|
|
222
|
-
// encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";",
|
|
223
|
-
// most full parsers would die, but the beautifier gracefully falls back to
|
|
224
|
-
// MODE.BlockStatement and continues on.
|
|
225
|
-
this._flag_store = [];
|
|
226
|
-
this.set_mode(MODE.BlockStatement);
|
|
227
|
-
var tokenizer = new Tokenizer(source_text, this._options);
|
|
228
|
-
this._tokens = tokenizer.tokenize();
|
|
229
|
-
return source_text;
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
Beautifier.prototype.beautify = function() {
|
|
233
|
-
// if disabled, return the input unchanged.
|
|
234
|
-
if (this._options.disabled) {
|
|
235
|
-
return this._source_text;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
var sweet_code;
|
|
239
|
-
var source_text = this._reset(this._source_text);
|
|
240
|
-
|
|
241
|
-
var eol = this._options.eol;
|
|
242
|
-
if (this._options.eol === 'auto') {
|
|
243
|
-
eol = '\n';
|
|
244
|
-
if (source_text && acorn.lineBreak.test(source_text || '')) {
|
|
245
|
-
eol = source_text.match(acorn.lineBreak)[0];
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var current_token = this._tokens.next();
|
|
250
|
-
while (current_token) {
|
|
251
|
-
this.handle_token(current_token);
|
|
252
|
-
|
|
253
|
-
this._last_last_text = this._flags.last_token.text;
|
|
254
|
-
this._flags.last_token = current_token;
|
|
255
|
-
|
|
256
|
-
current_token = this._tokens.next();
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
sweet_code = this._output.get_code(eol);
|
|
260
|
-
|
|
261
|
-
return sweet_code;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
Beautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {
|
|
265
|
-
if (current_token.type === TOKEN.START_EXPR) {
|
|
266
|
-
this.handle_start_expr(current_token);
|
|
267
|
-
} else if (current_token.type === TOKEN.END_EXPR) {
|
|
268
|
-
this.handle_end_expr(current_token);
|
|
269
|
-
} else if (current_token.type === TOKEN.START_BLOCK) {
|
|
270
|
-
this.handle_start_block(current_token);
|
|
271
|
-
} else if (current_token.type === TOKEN.END_BLOCK) {
|
|
272
|
-
this.handle_end_block(current_token);
|
|
273
|
-
} else if (current_token.type === TOKEN.WORD) {
|
|
274
|
-
this.handle_word(current_token);
|
|
275
|
-
} else if (current_token.type === TOKEN.RESERVED) {
|
|
276
|
-
this.handle_word(current_token);
|
|
277
|
-
} else if (current_token.type === TOKEN.SEMICOLON) {
|
|
278
|
-
this.handle_semicolon(current_token);
|
|
279
|
-
} else if (current_token.type === TOKEN.STRING) {
|
|
280
|
-
this.handle_string(current_token);
|
|
281
|
-
} else if (current_token.type === TOKEN.EQUALS) {
|
|
282
|
-
this.handle_equals(current_token);
|
|
283
|
-
} else if (current_token.type === TOKEN.OPERATOR) {
|
|
284
|
-
this.handle_operator(current_token);
|
|
285
|
-
} else if (current_token.type === TOKEN.COMMA) {
|
|
286
|
-
this.handle_comma(current_token);
|
|
287
|
-
} else if (current_token.type === TOKEN.BLOCK_COMMENT) {
|
|
288
|
-
this.handle_block_comment(current_token, preserve_statement_flags);
|
|
289
|
-
} else if (current_token.type === TOKEN.COMMENT) {
|
|
290
|
-
this.handle_comment(current_token, preserve_statement_flags);
|
|
291
|
-
} else if (current_token.type === TOKEN.DOT) {
|
|
292
|
-
this.handle_dot(current_token);
|
|
293
|
-
} else if (current_token.type === TOKEN.EOF) {
|
|
294
|
-
this.handle_eof(current_token);
|
|
295
|
-
} else if (current_token.type === TOKEN.UNKNOWN) {
|
|
296
|
-
this.handle_unknown(current_token, preserve_statement_flags);
|
|
297
|
-
} else {
|
|
298
|
-
this.handle_unknown(current_token, preserve_statement_flags);
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
Beautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {
|
|
303
|
-
var newlines = current_token.newlines;
|
|
304
|
-
var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);
|
|
305
|
-
|
|
306
|
-
if (current_token.comments_before) {
|
|
307
|
-
var comment_token = current_token.comments_before.next();
|
|
308
|
-
while (comment_token) {
|
|
309
|
-
// The cleanest handling of inline comments is to treat them as though they aren't there.
|
|
310
|
-
// Just continue formatting and the behavior should be logical.
|
|
311
|
-
// Also ignore unknown tokens. Again, this should result in better behavior.
|
|
312
|
-
this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);
|
|
313
|
-
this.handle_token(comment_token, preserve_statement_flags);
|
|
314
|
-
comment_token = current_token.comments_before.next();
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
if (keep_whitespace) {
|
|
319
|
-
for (var i = 0; i < newlines; i += 1) {
|
|
320
|
-
this.print_newline(i > 0, preserve_statement_flags);
|
|
321
|
-
}
|
|
322
|
-
} else {
|
|
323
|
-
if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {
|
|
324
|
-
newlines = this._options.max_preserve_newlines;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
if (this._options.preserve_newlines) {
|
|
328
|
-
if (newlines > 1) {
|
|
329
|
-
this.print_newline(false, preserve_statement_flags);
|
|
330
|
-
for (var j = 1; j < newlines; j += 1) {
|
|
331
|
-
this.print_newline(true, preserve_statement_flags);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
var newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];
|
|
340
|
-
|
|
341
|
-
Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {
|
|
342
|
-
force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;
|
|
343
|
-
|
|
344
|
-
// Never wrap the first token on a line
|
|
345
|
-
if (this._output.just_added_newline()) {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;
|
|
350
|
-
var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||
|
|
351
|
-
in_array(current_token.text, positionable_operators);
|
|
352
|
-
|
|
353
|
-
if (operatorLogicApplies) {
|
|
354
|
-
var shouldPrintOperatorNewline = (
|
|
355
|
-
in_array(this._flags.last_token.text, positionable_operators) &&
|
|
356
|
-
in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)
|
|
357
|
-
) ||
|
|
358
|
-
in_array(current_token.text, positionable_operators);
|
|
359
|
-
shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (shouldPreserveOrForce) {
|
|
363
|
-
this.print_newline(false, true);
|
|
364
|
-
} else if (this._options.wrap_line_length) {
|
|
365
|
-
if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {
|
|
366
|
-
// These tokens should never have a newline inserted
|
|
367
|
-
// between them and the following expression.
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
this._output.set_wrap_point();
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {
|
|
375
|
-
if (!preserve_statement_flags) {
|
|
376
|
-
if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) {
|
|
377
|
-
var next_token = this._tokens.peek();
|
|
378
|
-
while (this._flags.mode === MODE.Statement &&
|
|
379
|
-
!(this._flags.if_block && reserved_word(next_token, 'else')) &&
|
|
380
|
-
!this._flags.do_block) {
|
|
381
|
-
this.restore_mode();
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (this._output.add_new_line(force_newline)) {
|
|
387
|
-
this._flags.multiline_frame = true;
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
Beautifier.prototype.print_token_line_indentation = function(current_token) {
|
|
392
|
-
if (this._output.just_added_newline()) {
|
|
393
|
-
if (this._options.keep_array_indentation &&
|
|
394
|
-
current_token.newlines &&
|
|
395
|
-
(current_token.text === '[' || is_array(this._flags.mode))) {
|
|
396
|
-
this._output.current_line.set_indent(-1);
|
|
397
|
-
this._output.current_line.push(current_token.whitespace_before);
|
|
398
|
-
this._output.space_before_token = false;
|
|
399
|
-
} else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) {
|
|
400
|
-
this._flags.line_indent_level = this._flags.indentation_level;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
Beautifier.prototype.print_token = function(current_token) {
|
|
406
|
-
if (this._output.raw) {
|
|
407
|
-
this._output.add_raw_token(current_token);
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&
|
|
412
|
-
this._output.just_added_newline()) {
|
|
413
|
-
if (this._output.previous_line.last() === ',') {
|
|
414
|
-
var popped = this._output.previous_line.pop();
|
|
415
|
-
// if the comma was already at the start of the line,
|
|
416
|
-
// pull back onto that line and reprint the indentation
|
|
417
|
-
if (this._output.previous_line.is_empty()) {
|
|
418
|
-
this._output.previous_line.push(popped);
|
|
419
|
-
this._output.trim(true);
|
|
420
|
-
this._output.current_line.pop();
|
|
421
|
-
this._output.trim();
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// add the comma in front of the next token
|
|
425
|
-
this.print_token_line_indentation(current_token);
|
|
426
|
-
this._output.add_token(',');
|
|
427
|
-
this._output.space_before_token = true;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
this.print_token_line_indentation(current_token);
|
|
432
|
-
this._output.non_breaking_space = true;
|
|
433
|
-
this._output.add_token(current_token.text);
|
|
434
|
-
if (this._output.previous_token_wrapped) {
|
|
435
|
-
this._flags.multiline_frame = true;
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
Beautifier.prototype.indent = function() {
|
|
440
|
-
this._flags.indentation_level += 1;
|
|
441
|
-
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
Beautifier.prototype.deindent = function() {
|
|
445
|
-
if (this._flags.indentation_level > 0 &&
|
|
446
|
-
((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {
|
|
447
|
-
this._flags.indentation_level -= 1;
|
|
448
|
-
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
Beautifier.prototype.set_mode = function(mode) {
|
|
453
|
-
if (this._flags) {
|
|
454
|
-
this._flag_store.push(this._flags);
|
|
455
|
-
this._previous_flags = this._flags;
|
|
456
|
-
} else {
|
|
457
|
-
this._previous_flags = this.create_flags(null, mode);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
this._flags = this.create_flags(this._previous_flags, mode);
|
|
461
|
-
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
Beautifier.prototype.restore_mode = function() {
|
|
466
|
-
if (this._flag_store.length > 0) {
|
|
467
|
-
this._previous_flags = this._flags;
|
|
468
|
-
this._flags = this._flag_store.pop();
|
|
469
|
-
if (this._previous_flags.mode === MODE.Statement) {
|
|
470
|
-
remove_redundant_indentation(this._output, this._previous_flags);
|
|
471
|
-
}
|
|
472
|
-
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
Beautifier.prototype.start_of_object_property = function() {
|
|
477
|
-
return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (
|
|
478
|
-
(this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
Beautifier.prototype.start_of_statement = function(current_token) {
|
|
482
|
-
var start = false;
|
|
483
|
-
start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;
|
|
484
|
-
start = start || reserved_word(this._flags.last_token, 'do');
|
|
485
|
-
start = start || (!(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement)) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines;
|
|
486
|
-
start = start || reserved_word(this._flags.last_token, 'else') &&
|
|
487
|
-
!(reserved_word(current_token, 'if') && !current_token.comments_before);
|
|
488
|
-
start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));
|
|
489
|
-
start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&
|
|
490
|
-
!this._flags.in_case &&
|
|
491
|
-
!(current_token.text === '--' || current_token.text === '++') &&
|
|
492
|
-
this._last_last_text !== 'function' &&
|
|
493
|
-
current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);
|
|
494
|
-
start = start || (this._flags.mode === MODE.ObjectLiteral && (
|
|
495
|
-
(this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));
|
|
496
|
-
|
|
497
|
-
if (start) {
|
|
498
|
-
this.set_mode(MODE.Statement);
|
|
499
|
-
this.indent();
|
|
500
|
-
|
|
501
|
-
this.handle_whitespace_and_comments(current_token, true);
|
|
502
|
-
|
|
503
|
-
// Issue #276:
|
|
504
|
-
// If starting a new statement with [if, for, while, do], push to a new line.
|
|
505
|
-
// if (a) if (b) if(c) d(); else e(); else f();
|
|
506
|
-
if (!this.start_of_object_property()) {
|
|
507
|
-
this.allow_wrap_or_preserved_newline(current_token,
|
|
508
|
-
reserved_array(current_token, ['do', 'for', 'if', 'while']));
|
|
509
|
-
}
|
|
510
|
-
return true;
|
|
511
|
-
}
|
|
512
|
-
return false;
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
Beautifier.prototype.handle_start_expr = function(current_token) {
|
|
516
|
-
// The conditional starts the statement if appropriate.
|
|
517
|
-
if (!this.start_of_statement(current_token)) {
|
|
518
|
-
this.handle_whitespace_and_comments(current_token);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
var next_mode = MODE.Expression;
|
|
522
|
-
if (current_token.text === '[') {
|
|
523
|
-
|
|
524
|
-
if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {
|
|
525
|
-
// this is array index specifier, break immediately
|
|
526
|
-
// a[x], fn()[x]
|
|
527
|
-
if (reserved_array(this._flags.last_token, line_starters)) {
|
|
528
|
-
this._output.space_before_token = true;
|
|
529
|
-
}
|
|
530
|
-
this.print_token(current_token);
|
|
531
|
-
this.set_mode(next_mode);
|
|
532
|
-
this.indent();
|
|
533
|
-
if (this._options.space_in_paren) {
|
|
534
|
-
this._output.space_before_token = true;
|
|
535
|
-
}
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
next_mode = MODE.ArrayLiteral;
|
|
540
|
-
if (is_array(this._flags.mode)) {
|
|
541
|
-
if (this._flags.last_token.text === '[' ||
|
|
542
|
-
(this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {
|
|
543
|
-
// ], [ goes to new line
|
|
544
|
-
// }, [ goes to new line
|
|
545
|
-
if (!this._options.keep_array_indentation) {
|
|
546
|
-
this.print_newline();
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
|
|
552
|
-
this._output.space_before_token = true;
|
|
553
|
-
}
|
|
554
|
-
} else {
|
|
555
|
-
if (this._flags.last_token.type === TOKEN.RESERVED) {
|
|
556
|
-
if (this._flags.last_token.text === 'for') {
|
|
557
|
-
this._output.space_before_token = this._options.space_before_conditional;
|
|
558
|
-
next_mode = MODE.ForInitializer;
|
|
559
|
-
} else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
|
|
560
|
-
this._output.space_before_token = this._options.space_before_conditional;
|
|
561
|
-
next_mode = MODE.Conditional;
|
|
562
|
-
} else if (in_array(this._flags.last_word, ['await', 'async'])) {
|
|
563
|
-
// Should be a space between await and an IIFE, or async and an arrow function
|
|
564
|
-
this._output.space_before_token = true;
|
|
565
|
-
} else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {
|
|
566
|
-
this._output.space_before_token = false;
|
|
567
|
-
} else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {
|
|
568
|
-
this._output.space_before_token = true;
|
|
569
|
-
}
|
|
570
|
-
} else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
|
|
571
|
-
// Support of this kind of newline preservation.
|
|
572
|
-
// a = (b &&
|
|
573
|
-
// (c || d));
|
|
574
|
-
if (!this.start_of_object_property()) {
|
|
575
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
576
|
-
}
|
|
577
|
-
} else if (this._flags.last_token.type === TOKEN.WORD) {
|
|
578
|
-
this._output.space_before_token = false;
|
|
579
|
-
|
|
580
|
-
// function name() vs function name ()
|
|
581
|
-
// function* name() vs function* name ()
|
|
582
|
-
// async name() vs async name ()
|
|
583
|
-
// In ES6, you can also define the method properties of an object
|
|
584
|
-
// var obj = {a: function() {}}
|
|
585
|
-
// It can be abbreviated
|
|
586
|
-
// var obj = {a() {}}
|
|
587
|
-
// var obj = { a() {}} vs var obj = { a () {}}
|
|
588
|
-
// var obj = { * a() {}} vs var obj = { * a () {}}
|
|
589
|
-
var peek_back_two = this._tokens.peek(-3);
|
|
590
|
-
if (this._options.space_after_named_function && peek_back_two) {
|
|
591
|
-
// peek starts at next character so -1 is current token
|
|
592
|
-
var peek_back_three = this._tokens.peek(-4);
|
|
593
|
-
if (reserved_array(peek_back_two, ['async', 'function']) ||
|
|
594
|
-
(peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) {
|
|
595
|
-
this._output.space_before_token = true;
|
|
596
|
-
} else if (this._flags.mode === MODE.ObjectLiteral) {
|
|
597
|
-
if ((peek_back_two.text === '{' || peek_back_two.text === ',') ||
|
|
598
|
-
(peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) {
|
|
599
|
-
this._output.space_before_token = true;
|
|
600
|
-
}
|
|
601
|
-
} else if (this._flags.parent && this._flags.parent.class_start_block) {
|
|
602
|
-
this._output.space_before_token = true;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
} else {
|
|
606
|
-
// Support preserving wrapped arrow function expressions
|
|
607
|
-
// a.b('c',
|
|
608
|
-
// () => d.e
|
|
609
|
-
// )
|
|
610
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// function() vs function ()
|
|
614
|
-
// yield*() vs yield* ()
|
|
615
|
-
// function*() vs function* ()
|
|
616
|
-
if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||
|
|
617
|
-
(this._flags.last_token.text === '*' &&
|
|
618
|
-
(in_array(this._last_last_text, ['function', 'yield']) ||
|
|
619
|
-
(this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
|
|
620
|
-
this._output.space_before_token = this._options.space_after_anon_function;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {
|
|
625
|
-
this.print_newline();
|
|
626
|
-
} else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) {
|
|
627
|
-
// do nothing on (( and )( and ][ and ]( and .(
|
|
628
|
-
// TODO: Consider whether forcing this is required. Review failing tests when removed.
|
|
629
|
-
this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
this.print_token(current_token);
|
|
633
|
-
this.set_mode(next_mode);
|
|
634
|
-
if (this._options.space_in_paren) {
|
|
635
|
-
this._output.space_before_token = true;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
// In all cases, if we newline while inside an expression it should be indented.
|
|
639
|
-
this.indent();
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
Beautifier.prototype.handle_end_expr = function(current_token) {
|
|
643
|
-
// statements inside expressions are not valid syntax, but...
|
|
644
|
-
// statements must all be closed when their container closes
|
|
645
|
-
while (this._flags.mode === MODE.Statement) {
|
|
646
|
-
this.restore_mode();
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
this.handle_whitespace_and_comments(current_token);
|
|
650
|
-
|
|
651
|
-
if (this._flags.multiline_frame) {
|
|
652
|
-
this.allow_wrap_or_preserved_newline(current_token,
|
|
653
|
-
current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
if (this._options.space_in_paren) {
|
|
657
|
-
if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {
|
|
658
|
-
// () [] no inner space in empty parens like these, ever, ref #320
|
|
659
|
-
this._output.trim();
|
|
660
|
-
this._output.space_before_token = false;
|
|
661
|
-
} else {
|
|
662
|
-
this._output.space_before_token = true;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
this.deindent();
|
|
666
|
-
this.print_token(current_token);
|
|
667
|
-
this.restore_mode();
|
|
668
|
-
|
|
669
|
-
remove_redundant_indentation(this._output, this._previous_flags);
|
|
670
|
-
|
|
671
|
-
// do {} while () // no statement required after
|
|
672
|
-
if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {
|
|
673
|
-
this._previous_flags.mode = MODE.Expression;
|
|
674
|
-
this._flags.do_block = false;
|
|
675
|
-
this._flags.do_while = false;
|
|
676
|
-
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
Beautifier.prototype.handle_start_block = function(current_token) {
|
|
681
|
-
this.handle_whitespace_and_comments(current_token);
|
|
682
|
-
|
|
683
|
-
// Check if this is should be treated as a ObjectLiteral
|
|
684
|
-
var next_token = this._tokens.peek();
|
|
685
|
-
var second_token = this._tokens.peek(1);
|
|
686
|
-
if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {
|
|
687
|
-
this.set_mode(MODE.BlockStatement);
|
|
688
|
-
this._flags.in_case_statement = true;
|
|
689
|
-
} else if (this._flags.case_body) {
|
|
690
|
-
this.set_mode(MODE.BlockStatement);
|
|
691
|
-
} else if (second_token && (
|
|
692
|
-
(in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||
|
|
693
|
-
(in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))
|
|
694
|
-
)) {
|
|
695
|
-
// We don't support TypeScript,but we didn't break it for a very long time.
|
|
696
|
-
// We'll try to keep not breaking it.
|
|
697
|
-
if (in_array(this._last_last_text, ['class', 'interface']) && !in_array(second_token.text, [':', ','])) {
|
|
698
|
-
this.set_mode(MODE.BlockStatement);
|
|
699
|
-
} else {
|
|
700
|
-
this.set_mode(MODE.ObjectLiteral);
|
|
701
|
-
}
|
|
702
|
-
} else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {
|
|
703
|
-
// arrow function: (param1, paramN) => { statements }
|
|
704
|
-
this.set_mode(MODE.BlockStatement);
|
|
705
|
-
} else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||
|
|
706
|
-
reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])
|
|
707
|
-
) {
|
|
708
|
-
// Detecting shorthand function syntax is difficult by scanning forward,
|
|
709
|
-
// so check the surrounding context.
|
|
710
|
-
// If the block is being returned, imported, export default, passed as arg,
|
|
711
|
-
// assigned with = or assigned in a nested object, treat as an ObjectLiteral.
|
|
712
|
-
this.set_mode(MODE.ObjectLiteral);
|
|
713
|
-
} else {
|
|
714
|
-
this.set_mode(MODE.BlockStatement);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if (this._flags.last_token) {
|
|
718
|
-
if (reserved_array(this._flags.last_token.previous, ['class', 'extends'])) {
|
|
719
|
-
this._flags.class_start_block = true;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
var empty_braces = !next_token.comments_before && next_token.text === '}';
|
|
724
|
-
var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&
|
|
725
|
-
this._flags.last_token.type === TOKEN.END_EXPR;
|
|
726
|
-
|
|
727
|
-
if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so
|
|
728
|
-
{
|
|
729
|
-
// search forward for a newline wanted inside this block
|
|
730
|
-
var index = 0;
|
|
731
|
-
var check_token = null;
|
|
732
|
-
this._flags.inline_frame = true;
|
|
733
|
-
do {
|
|
734
|
-
index += 1;
|
|
735
|
-
check_token = this._tokens.peek(index - 1);
|
|
736
|
-
if (check_token.newlines) {
|
|
737
|
-
this._flags.inline_frame = false;
|
|
738
|
-
break;
|
|
739
|
-
}
|
|
740
|
-
} while (check_token.type !== TOKEN.EOF &&
|
|
741
|
-
!(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
if ((this._options.brace_style === "expand" ||
|
|
745
|
-
(this._options.brace_style === "none" && current_token.newlines)) &&
|
|
746
|
-
!this._flags.inline_frame) {
|
|
747
|
-
if (this._flags.last_token.type !== TOKEN.OPERATOR &&
|
|
748
|
-
(empty_anonymous_function ||
|
|
749
|
-
this._flags.last_token.type === TOKEN.EQUALS ||
|
|
750
|
-
(reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {
|
|
751
|
-
this._output.space_before_token = true;
|
|
752
|
-
} else {
|
|
753
|
-
this.print_newline(false, true);
|
|
754
|
-
}
|
|
755
|
-
} else { // collapse || inline_frame
|
|
756
|
-
if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {
|
|
757
|
-
if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {
|
|
758
|
-
this._output.space_before_token = true;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {
|
|
762
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
763
|
-
this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;
|
|
764
|
-
this._flags.multiline_frame = false;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {
|
|
768
|
-
if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) {
|
|
769
|
-
this.print_newline();
|
|
770
|
-
} else {
|
|
771
|
-
this._output.space_before_token = true;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
this.print_token(current_token);
|
|
776
|
-
this.indent();
|
|
777
|
-
|
|
778
|
-
// Except for specific cases, open braces are followed by a new line.
|
|
779
|
-
if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) {
|
|
780
|
-
this.print_newline();
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
|
|
784
|
-
Beautifier.prototype.handle_end_block = function(current_token) {
|
|
785
|
-
// statements must all be closed when their container closes
|
|
786
|
-
this.handle_whitespace_and_comments(current_token);
|
|
787
|
-
|
|
788
|
-
while (this._flags.mode === MODE.Statement) {
|
|
789
|
-
this.restore_mode();
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;
|
|
793
|
-
|
|
794
|
-
if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first
|
|
795
|
-
this._output.space_before_token = true;
|
|
796
|
-
} else if (this._options.brace_style === "expand") {
|
|
797
|
-
if (!empty_braces) {
|
|
798
|
-
this.print_newline();
|
|
799
|
-
}
|
|
800
|
-
} else {
|
|
801
|
-
// skip {}
|
|
802
|
-
if (!empty_braces) {
|
|
803
|
-
if (is_array(this._flags.mode) && this._options.keep_array_indentation) {
|
|
804
|
-
// we REALLY need a newline here, but newliner would skip that
|
|
805
|
-
this._options.keep_array_indentation = false;
|
|
806
|
-
this.print_newline();
|
|
807
|
-
this._options.keep_array_indentation = true;
|
|
808
|
-
|
|
809
|
-
} else {
|
|
810
|
-
this.print_newline();
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
this.restore_mode();
|
|
815
|
-
this.print_token(current_token);
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
Beautifier.prototype.handle_word = function(current_token) {
|
|
819
|
-
if (current_token.type === TOKEN.RESERVED) {
|
|
820
|
-
if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {
|
|
821
|
-
current_token.type = TOKEN.WORD;
|
|
822
|
-
} else if (current_token.text === 'import' && in_array(this._tokens.peek().text, ['(', '.'])) {
|
|
823
|
-
current_token.type = TOKEN.WORD;
|
|
824
|
-
} else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {
|
|
825
|
-
current_token.type = TOKEN.WORD;
|
|
826
|
-
} else if (this._flags.mode === MODE.ObjectLiteral) {
|
|
827
|
-
var next_token = this._tokens.peek();
|
|
828
|
-
if (next_token.text === ':') {
|
|
829
|
-
current_token.type = TOKEN.WORD;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
if (this.start_of_statement(current_token)) {
|
|
835
|
-
// The conditional starts the statement if appropriate.
|
|
836
|
-
if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {
|
|
837
|
-
this._flags.declaration_statement = true;
|
|
838
|
-
}
|
|
839
|
-
} else if (current_token.newlines && !is_expression(this._flags.mode) &&
|
|
840
|
-
(this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&
|
|
841
|
-
this._flags.last_token.type !== TOKEN.EQUALS &&
|
|
842
|
-
(this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {
|
|
843
|
-
this.handle_whitespace_and_comments(current_token);
|
|
844
|
-
this.print_newline();
|
|
845
|
-
} else {
|
|
846
|
-
this.handle_whitespace_and_comments(current_token);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
if (this._flags.do_block && !this._flags.do_while) {
|
|
850
|
-
if (reserved_word(current_token, 'while')) {
|
|
851
|
-
// do {} ## while ()
|
|
852
|
-
this._output.space_before_token = true;
|
|
853
|
-
this.print_token(current_token);
|
|
854
|
-
this._output.space_before_token = true;
|
|
855
|
-
this._flags.do_while = true;
|
|
856
|
-
return;
|
|
857
|
-
} else {
|
|
858
|
-
// do {} should always have while as the next word.
|
|
859
|
-
// if we don't see the expected while, recover
|
|
860
|
-
this.print_newline();
|
|
861
|
-
this._flags.do_block = false;
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
// if may be followed by else, or not
|
|
866
|
-
// Bare/inline ifs are tricky
|
|
867
|
-
// Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();
|
|
868
|
-
if (this._flags.if_block) {
|
|
869
|
-
if (!this._flags.else_block && reserved_word(current_token, 'else')) {
|
|
870
|
-
this._flags.else_block = true;
|
|
871
|
-
} else {
|
|
872
|
-
while (this._flags.mode === MODE.Statement) {
|
|
873
|
-
this.restore_mode();
|
|
874
|
-
}
|
|
875
|
-
this._flags.if_block = false;
|
|
876
|
-
this._flags.else_block = false;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {
|
|
881
|
-
this.print_newline();
|
|
882
|
-
if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) {
|
|
883
|
-
// switch cases following one another
|
|
884
|
-
this.deindent();
|
|
885
|
-
}
|
|
886
|
-
this._flags.case_body = false;
|
|
887
|
-
|
|
888
|
-
this.print_token(current_token);
|
|
889
|
-
this._flags.in_case = true;
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
|
|
894
|
-
if (!this.start_of_object_property()) {
|
|
895
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
if (reserved_word(current_token, 'function')) {
|
|
900
|
-
if (in_array(this._flags.last_token.text, ['}', ';']) ||
|
|
901
|
-
(this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {
|
|
902
|
-
// make sure there is a nice clean space of at least one blank line
|
|
903
|
-
// before a new function definition
|
|
904
|
-
if (!this._output.just_added_blankline() && !current_token.comments_before) {
|
|
905
|
-
this.print_newline();
|
|
906
|
-
this.print_newline(true);
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {
|
|
910
|
-
if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||
|
|
911
|
-
reserved_array(this._flags.last_token, newline_restricted_tokens)) {
|
|
912
|
-
this._output.space_before_token = true;
|
|
913
|
-
} else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {
|
|
914
|
-
this._output.space_before_token = true;
|
|
915
|
-
} else if (this._flags.last_token.text === 'declare') {
|
|
916
|
-
// accomodates Typescript declare function formatting
|
|
917
|
-
this._output.space_before_token = true;
|
|
918
|
-
} else {
|
|
919
|
-
this.print_newline();
|
|
920
|
-
}
|
|
921
|
-
} else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {
|
|
922
|
-
// foo = function
|
|
923
|
-
this._output.space_before_token = true;
|
|
924
|
-
} else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {
|
|
925
|
-
// (function
|
|
926
|
-
} else {
|
|
927
|
-
this.print_newline();
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
this.print_token(current_token);
|
|
931
|
-
this._flags.last_word = current_token.text;
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
var prefix = 'NONE';
|
|
936
|
-
|
|
937
|
-
if (this._flags.last_token.type === TOKEN.END_BLOCK) {
|
|
938
|
-
|
|
939
|
-
if (this._previous_flags.inline_frame) {
|
|
940
|
-
prefix = 'SPACE';
|
|
941
|
-
} else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {
|
|
942
|
-
prefix = 'NEWLINE';
|
|
943
|
-
} else {
|
|
944
|
-
if (this._options.brace_style === "expand" ||
|
|
945
|
-
this._options.brace_style === "end-expand" ||
|
|
946
|
-
(this._options.brace_style === "none" && current_token.newlines)) {
|
|
947
|
-
prefix = 'NEWLINE';
|
|
948
|
-
} else {
|
|
949
|
-
prefix = 'SPACE';
|
|
950
|
-
this._output.space_before_token = true;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
} else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {
|
|
954
|
-
// TODO: Should this be for STATEMENT as well?
|
|
955
|
-
prefix = 'NEWLINE';
|
|
956
|
-
} else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {
|
|
957
|
-
prefix = 'SPACE';
|
|
958
|
-
} else if (this._flags.last_token.type === TOKEN.STRING) {
|
|
959
|
-
prefix = 'NEWLINE';
|
|
960
|
-
} else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||
|
|
961
|
-
(this._flags.last_token.text === '*' &&
|
|
962
|
-
(in_array(this._last_last_text, ['function', 'yield']) ||
|
|
963
|
-
(this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
|
|
964
|
-
prefix = 'SPACE';
|
|
965
|
-
} else if (this._flags.last_token.type === TOKEN.START_BLOCK) {
|
|
966
|
-
if (this._flags.inline_frame) {
|
|
967
|
-
prefix = 'SPACE';
|
|
968
|
-
} else {
|
|
969
|
-
prefix = 'NEWLINE';
|
|
970
|
-
}
|
|
971
|
-
} else if (this._flags.last_token.type === TOKEN.END_EXPR) {
|
|
972
|
-
this._output.space_before_token = true;
|
|
973
|
-
prefix = 'NEWLINE';
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
|
|
977
|
-
if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {
|
|
978
|
-
prefix = 'SPACE';
|
|
979
|
-
} else {
|
|
980
|
-
prefix = 'NEWLINE';
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
if (reserved_array(current_token, ['else', 'catch', 'finally'])) {
|
|
986
|
-
if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||
|
|
987
|
-
this._options.brace_style === "expand" ||
|
|
988
|
-
this._options.brace_style === "end-expand" ||
|
|
989
|
-
(this._options.brace_style === "none" && current_token.newlines)) &&
|
|
990
|
-
!this._flags.inline_frame) {
|
|
991
|
-
this.print_newline();
|
|
992
|
-
} else {
|
|
993
|
-
this._output.trim(true);
|
|
994
|
-
var line = this._output.current_line;
|
|
995
|
-
// If we trimmed and there's something other than a close block before us
|
|
996
|
-
// put a newline back in. Handles '} // comment' scenario.
|
|
997
|
-
if (line.last() !== '}') {
|
|
998
|
-
this.print_newline();
|
|
999
|
-
}
|
|
1000
|
-
this._output.space_before_token = true;
|
|
1001
|
-
}
|
|
1002
|
-
} else if (prefix === 'NEWLINE') {
|
|
1003
|
-
if (reserved_array(this._flags.last_token, special_words)) {
|
|
1004
|
-
// no newline between 'return nnn'
|
|
1005
|
-
this._output.space_before_token = true;
|
|
1006
|
-
} else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) {
|
|
1007
|
-
// accomodates Typescript declare formatting
|
|
1008
|
-
this._output.space_before_token = true;
|
|
1009
|
-
} else if (this._flags.last_token.type !== TOKEN.END_EXPR) {
|
|
1010
|
-
if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {
|
|
1011
|
-
// no need to force newline on 'var': for (var x = 0...)
|
|
1012
|
-
if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {
|
|
1013
|
-
// no newline for } else if {
|
|
1014
|
-
this._output.space_before_token = true;
|
|
1015
|
-
} else {
|
|
1016
|
-
this.print_newline();
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
} else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
|
|
1020
|
-
this.print_newline();
|
|
1021
|
-
}
|
|
1022
|
-
} else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {
|
|
1023
|
-
this.print_newline(); // }, in lists get a newline treatment
|
|
1024
|
-
} else if (prefix === 'SPACE') {
|
|
1025
|
-
this._output.space_before_token = true;
|
|
1026
|
-
}
|
|
1027
|
-
if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {
|
|
1028
|
-
this._output.space_before_token = true;
|
|
1029
|
-
}
|
|
1030
|
-
this.print_token(current_token);
|
|
1031
|
-
this._flags.last_word = current_token.text;
|
|
1032
|
-
|
|
1033
|
-
if (current_token.type === TOKEN.RESERVED) {
|
|
1034
|
-
if (current_token.text === 'do') {
|
|
1035
|
-
this._flags.do_block = true;
|
|
1036
|
-
} else if (current_token.text === 'if') {
|
|
1037
|
-
this._flags.if_block = true;
|
|
1038
|
-
} else if (current_token.text === 'import') {
|
|
1039
|
-
this._flags.import_block = true;
|
|
1040
|
-
} else if (this._flags.import_block && reserved_word(current_token, 'from')) {
|
|
1041
|
-
this._flags.import_block = false;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
};
|
|
1045
|
-
|
|
1046
|
-
Beautifier.prototype.handle_semicolon = function(current_token) {
|
|
1047
|
-
if (this.start_of_statement(current_token)) {
|
|
1048
|
-
// The conditional starts the statement if appropriate.
|
|
1049
|
-
// Semicolon can be the start (and end) of a statement
|
|
1050
|
-
this._output.space_before_token = false;
|
|
1051
|
-
} else {
|
|
1052
|
-
this.handle_whitespace_and_comments(current_token);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
var next_token = this._tokens.peek();
|
|
1056
|
-
while (this._flags.mode === MODE.Statement &&
|
|
1057
|
-
!(this._flags.if_block && reserved_word(next_token, 'else')) &&
|
|
1058
|
-
!this._flags.do_block) {
|
|
1059
|
-
this.restore_mode();
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
// hacky but effective for the moment
|
|
1063
|
-
if (this._flags.import_block) {
|
|
1064
|
-
this._flags.import_block = false;
|
|
1065
|
-
}
|
|
1066
|
-
this.print_token(current_token);
|
|
1067
|
-
};
|
|
1068
|
-
|
|
1069
|
-
Beautifier.prototype.handle_string = function(current_token) {
|
|
1070
|
-
if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
|
|
1071
|
-
//Conditional for detectign backtick strings
|
|
1072
|
-
} else if (this.start_of_statement(current_token)) {
|
|
1073
|
-
// The conditional starts the statement if appropriate.
|
|
1074
|
-
// One difference - strings want at least a space before
|
|
1075
|
-
this._output.space_before_token = true;
|
|
1076
|
-
} else {
|
|
1077
|
-
this.handle_whitespace_and_comments(current_token);
|
|
1078
|
-
if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {
|
|
1079
|
-
this._output.space_before_token = true;
|
|
1080
|
-
} else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
|
|
1081
|
-
if (!this.start_of_object_property()) {
|
|
1082
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1083
|
-
}
|
|
1084
|
-
} else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {
|
|
1085
|
-
this._output.space_before_token = true;
|
|
1086
|
-
} else {
|
|
1087
|
-
this.print_newline();
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
this.print_token(current_token);
|
|
1091
|
-
};
|
|
1092
|
-
|
|
1093
|
-
Beautifier.prototype.handle_equals = function(current_token) {
|
|
1094
|
-
if (this.start_of_statement(current_token)) {
|
|
1095
|
-
// The conditional starts the statement if appropriate.
|
|
1096
|
-
} else {
|
|
1097
|
-
this.handle_whitespace_and_comments(current_token);
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
if (this._flags.declaration_statement) {
|
|
1101
|
-
// just got an '=' in a var-line, different formatting/line-breaking, etc will now be done
|
|
1102
|
-
this._flags.declaration_assignment = true;
|
|
1103
|
-
}
|
|
1104
|
-
this._output.space_before_token = true;
|
|
1105
|
-
this.print_token(current_token);
|
|
1106
|
-
this._output.space_before_token = true;
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
Beautifier.prototype.handle_comma = function(current_token) {
|
|
1110
|
-
this.handle_whitespace_and_comments(current_token, true);
|
|
1111
|
-
|
|
1112
|
-
this.print_token(current_token);
|
|
1113
|
-
this._output.space_before_token = true;
|
|
1114
|
-
if (this._flags.declaration_statement) {
|
|
1115
|
-
if (is_expression(this._flags.parent.mode)) {
|
|
1116
|
-
// do not break on comma, for(var a = 1, b = 2)
|
|
1117
|
-
this._flags.declaration_assignment = false;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
if (this._flags.declaration_assignment) {
|
|
1121
|
-
this._flags.declaration_assignment = false;
|
|
1122
|
-
this.print_newline(false, true);
|
|
1123
|
-
} else if (this._options.comma_first) {
|
|
1124
|
-
// for comma-first, we want to allow a newline before the comma
|
|
1125
|
-
// to turn into a newline after the comma, which we will fixup later
|
|
1126
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1127
|
-
}
|
|
1128
|
-
} else if (this._flags.mode === MODE.ObjectLiteral ||
|
|
1129
|
-
(this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {
|
|
1130
|
-
if (this._flags.mode === MODE.Statement) {
|
|
1131
|
-
this.restore_mode();
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
if (!this._flags.inline_frame) {
|
|
1135
|
-
this.print_newline();
|
|
1136
|
-
}
|
|
1137
|
-
} else if (this._options.comma_first) {
|
|
1138
|
-
// EXPR or DO_BLOCK
|
|
1139
|
-
// for comma-first, we want to allow a newline before the comma
|
|
1140
|
-
// to turn into a newline after the comma, which we will fixup later
|
|
1141
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
Beautifier.prototype.handle_operator = function(current_token) {
|
|
1146
|
-
var isGeneratorAsterisk = current_token.text === '*' &&
|
|
1147
|
-
(reserved_array(this._flags.last_token, ['function', 'yield']) ||
|
|
1148
|
-
(in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))
|
|
1149
|
-
);
|
|
1150
|
-
var isUnary = in_array(current_token.text, ['-', '+']) && (
|
|
1151
|
-
in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||
|
|
1152
|
-
in_array(this._flags.last_token.text, line_starters) ||
|
|
1153
|
-
this._flags.last_token.text === ','
|
|
1154
|
-
);
|
|
1155
|
-
|
|
1156
|
-
if (this.start_of_statement(current_token)) {
|
|
1157
|
-
// The conditional starts the statement if appropriate.
|
|
1158
|
-
} else {
|
|
1159
|
-
var preserve_statement_flags = !isGeneratorAsterisk;
|
|
1160
|
-
this.handle_whitespace_and_comments(current_token, preserve_statement_flags);
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
// hack for actionscript's import .*;
|
|
1164
|
-
if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {
|
|
1165
|
-
this.print_token(current_token);
|
|
1166
|
-
return;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
if (current_token.text === '::') {
|
|
1170
|
-
// no spaces around exotic namespacing syntax operator
|
|
1171
|
-
this.print_token(current_token);
|
|
1172
|
-
return;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
// Allow line wrapping between operators when operator_position is
|
|
1176
|
-
// set to before or preserve
|
|
1177
|
-
if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {
|
|
1178
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
if (current_token.text === ':' && this._flags.in_case) {
|
|
1182
|
-
this.print_token(current_token);
|
|
1183
|
-
|
|
1184
|
-
this._flags.in_case = false;
|
|
1185
|
-
this._flags.case_body = true;
|
|
1186
|
-
if (this._tokens.peek().type !== TOKEN.START_BLOCK) {
|
|
1187
|
-
this.indent();
|
|
1188
|
-
this.print_newline();
|
|
1189
|
-
this._flags.case_block = false;
|
|
1190
|
-
} else {
|
|
1191
|
-
this._flags.case_block = true;
|
|
1192
|
-
this._output.space_before_token = true;
|
|
1193
|
-
}
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
var space_before = true;
|
|
1198
|
-
var space_after = true;
|
|
1199
|
-
var in_ternary = false;
|
|
1200
|
-
if (current_token.text === ':') {
|
|
1201
|
-
if (this._flags.ternary_depth === 0) {
|
|
1202
|
-
// Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.
|
|
1203
|
-
space_before = false;
|
|
1204
|
-
} else {
|
|
1205
|
-
this._flags.ternary_depth -= 1;
|
|
1206
|
-
in_ternary = true;
|
|
1207
|
-
}
|
|
1208
|
-
} else if (current_token.text === '?') {
|
|
1209
|
-
this._flags.ternary_depth += 1;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
// let's handle the operator_position option prior to any conflicting logic
|
|
1213
|
-
if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {
|
|
1214
|
-
var isColon = current_token.text === ':';
|
|
1215
|
-
var isTernaryColon = (isColon && in_ternary);
|
|
1216
|
-
var isOtherColon = (isColon && !in_ternary);
|
|
1217
|
-
|
|
1218
|
-
switch (this._options.operator_position) {
|
|
1219
|
-
case OPERATOR_POSITION.before_newline:
|
|
1220
|
-
// if the current token is : and it's not a ternary statement then we set space_before to false
|
|
1221
|
-
this._output.space_before_token = !isOtherColon;
|
|
1222
|
-
|
|
1223
|
-
this.print_token(current_token);
|
|
1224
|
-
|
|
1225
|
-
if (!isColon || isTernaryColon) {
|
|
1226
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
this._output.space_before_token = true;
|
|
1230
|
-
return;
|
|
1231
|
-
|
|
1232
|
-
case OPERATOR_POSITION.after_newline:
|
|
1233
|
-
// if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,
|
|
1234
|
-
// then print a newline.
|
|
1235
|
-
|
|
1236
|
-
this._output.space_before_token = true;
|
|
1237
|
-
|
|
1238
|
-
if (!isColon || isTernaryColon) {
|
|
1239
|
-
if (this._tokens.peek().newlines) {
|
|
1240
|
-
this.print_newline(false, true);
|
|
1241
|
-
} else {
|
|
1242
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1243
|
-
}
|
|
1244
|
-
} else {
|
|
1245
|
-
this._output.space_before_token = false;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
this.print_token(current_token);
|
|
1249
|
-
|
|
1250
|
-
this._output.space_before_token = true;
|
|
1251
|
-
return;
|
|
1252
|
-
|
|
1253
|
-
case OPERATOR_POSITION.preserve_newline:
|
|
1254
|
-
if (!isOtherColon) {
|
|
1255
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
// if we just added a newline, or the current token is : and it's not a ternary statement,
|
|
1259
|
-
// then we set space_before to false
|
|
1260
|
-
space_before = !(this._output.just_added_newline() || isOtherColon);
|
|
1261
|
-
|
|
1262
|
-
this._output.space_before_token = space_before;
|
|
1263
|
-
this.print_token(current_token);
|
|
1264
|
-
this._output.space_before_token = true;
|
|
1265
|
-
return;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
if (isGeneratorAsterisk) {
|
|
1270
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1271
|
-
space_before = false;
|
|
1272
|
-
var next_token = this._tokens.peek();
|
|
1273
|
-
space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);
|
|
1274
|
-
} else if (current_token.text === '...') {
|
|
1275
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1276
|
-
space_before = this._flags.last_token.type === TOKEN.START_BLOCK;
|
|
1277
|
-
space_after = false;
|
|
1278
|
-
} else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {
|
|
1279
|
-
// unary operators (and binary +/- pretending to be unary) special cases
|
|
1280
|
-
if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {
|
|
1281
|
-
this.allow_wrap_or_preserved_newline(current_token);
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
space_before = false;
|
|
1285
|
-
space_after = false;
|
|
1286
|
-
|
|
1287
|
-
// http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1
|
|
1288
|
-
// if there is a newline between -- or ++ and anything else we should preserve it.
|
|
1289
|
-
if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) {
|
|
1290
|
-
var new_line_needed = reserved_array(this._flags.last_token, special_words) && current_token.newlines;
|
|
1291
|
-
if (new_line_needed && (this._previous_flags.if_block || this._previous_flags.else_block)) {
|
|
1292
|
-
this.restore_mode();
|
|
1293
|
-
}
|
|
1294
|
-
this.print_newline(new_line_needed, true);
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {
|
|
1298
|
-
// for (;; ++i)
|
|
1299
|
-
// ^^^
|
|
1300
|
-
space_before = true;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
if (this._flags.last_token.type === TOKEN.RESERVED) {
|
|
1304
|
-
space_before = true;
|
|
1305
|
-
} else if (this._flags.last_token.type === TOKEN.END_EXPR) {
|
|
1306
|
-
space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));
|
|
1307
|
-
} else if (this._flags.last_token.type === TOKEN.OPERATOR) {
|
|
1308
|
-
// a++ + ++b;
|
|
1309
|
-
// a - -b
|
|
1310
|
-
space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);
|
|
1311
|
-
// + and - are not unary when preceeded by -- or ++ operator
|
|
1312
|
-
// a-- + b
|
|
1313
|
-
// a * +b
|
|
1314
|
-
// a - -b
|
|
1315
|
-
if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {
|
|
1316
|
-
space_after = true;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&
|
|
1322
|
-
(this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {
|
|
1323
|
-
// { foo; --i }
|
|
1324
|
-
// foo(); --bar;
|
|
1325
|
-
this.print_newline();
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
this._output.space_before_token = this._output.space_before_token || space_before;
|
|
1330
|
-
this.print_token(current_token);
|
|
1331
|
-
this._output.space_before_token = space_after;
|
|
1332
|
-
};
|
|
1333
|
-
|
|
1334
|
-
Beautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {
|
|
1335
|
-
if (this._output.raw) {
|
|
1336
|
-
this._output.add_raw_token(current_token);
|
|
1337
|
-
if (current_token.directives && current_token.directives.preserve === 'end') {
|
|
1338
|
-
// If we're testing the raw output behavior, do not allow a directive to turn it off.
|
|
1339
|
-
this._output.raw = this._options.test_output_raw;
|
|
1340
|
-
}
|
|
1341
|
-
return;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (current_token.directives) {
|
|
1345
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1346
|
-
this.print_token(current_token);
|
|
1347
|
-
if (current_token.directives.preserve === 'start') {
|
|
1348
|
-
this._output.raw = true;
|
|
1349
|
-
}
|
|
1350
|
-
this.print_newline(false, true);
|
|
1351
|
-
return;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
// inline block
|
|
1355
|
-
if (!acorn.newline.test(current_token.text) && !current_token.newlines) {
|
|
1356
|
-
this._output.space_before_token = true;
|
|
1357
|
-
this.print_token(current_token);
|
|
1358
|
-
this._output.space_before_token = true;
|
|
1359
|
-
return;
|
|
1360
|
-
} else {
|
|
1361
|
-
this.print_block_commment(current_token, preserve_statement_flags);
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
Beautifier.prototype.print_block_commment = function(current_token, preserve_statement_flags) {
|
|
1366
|
-
var lines = split_linebreaks(current_token.text);
|
|
1367
|
-
var j; // iterator for this case
|
|
1368
|
-
var javadoc = false;
|
|
1369
|
-
var starless = false;
|
|
1370
|
-
var lastIndent = current_token.whitespace_before;
|
|
1371
|
-
var lastIndentLength = lastIndent.length;
|
|
1372
|
-
|
|
1373
|
-
// block comment starts with a new line
|
|
1374
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1375
|
-
|
|
1376
|
-
// first line always indented
|
|
1377
|
-
this.print_token_line_indentation(current_token);
|
|
1378
|
-
this._output.add_token(lines[0]);
|
|
1379
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
if (lines.length > 1) {
|
|
1383
|
-
lines = lines.slice(1);
|
|
1384
|
-
javadoc = all_lines_start_with(lines, '*');
|
|
1385
|
-
starless = each_line_matches_indent(lines, lastIndent);
|
|
1386
|
-
|
|
1387
|
-
if (javadoc) {
|
|
1388
|
-
this._flags.alignment = 1;
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
for (j = 0; j < lines.length; j++) {
|
|
1392
|
-
if (javadoc) {
|
|
1393
|
-
// javadoc: reformat and re-indent
|
|
1394
|
-
this.print_token_line_indentation(current_token);
|
|
1395
|
-
this._output.add_token(ltrim(lines[j]));
|
|
1396
|
-
} else if (starless && lines[j]) {
|
|
1397
|
-
// starless: re-indent non-empty content, avoiding trim
|
|
1398
|
-
this.print_token_line_indentation(current_token);
|
|
1399
|
-
this._output.add_token(lines[j].substring(lastIndentLength));
|
|
1400
|
-
} else {
|
|
1401
|
-
// normal comments output raw
|
|
1402
|
-
this._output.current_line.set_indent(-1);
|
|
1403
|
-
this._output.add_token(lines[j]);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
// for comments on their own line or more than one line, make sure there's a new line after
|
|
1407
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
this._flags.alignment = 0;
|
|
1411
|
-
}
|
|
1412
|
-
};
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
Beautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {
|
|
1416
|
-
if (current_token.newlines) {
|
|
1417
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1418
|
-
} else {
|
|
1419
|
-
this._output.trim(true);
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
this._output.space_before_token = true;
|
|
1423
|
-
this.print_token(current_token);
|
|
1424
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1425
|
-
};
|
|
1426
|
-
|
|
1427
|
-
Beautifier.prototype.handle_dot = function(current_token) {
|
|
1428
|
-
if (this.start_of_statement(current_token)) {
|
|
1429
|
-
// The conditional starts the statement if appropriate.
|
|
1430
|
-
} else {
|
|
1431
|
-
this.handle_whitespace_and_comments(current_token, true);
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
if (this._flags.last_token.text.match('^[0-9]+$')) {
|
|
1435
|
-
this._output.space_before_token = true;
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
if (reserved_array(this._flags.last_token, special_words)) {
|
|
1439
|
-
this._output.space_before_token = false;
|
|
1440
|
-
} else {
|
|
1441
|
-
// allow preserved newlines before dots in general
|
|
1442
|
-
// force newlines on dots after close paren when break_chained - for bar().baz()
|
|
1443
|
-
this.allow_wrap_or_preserved_newline(current_token,
|
|
1444
|
-
this._flags.last_token.text === ')' && this._options.break_chained_methods);
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
// Only unindent chained method dot if this dot starts a new line.
|
|
1448
|
-
// Otherwise the automatic extra indentation removal will handle the over indent
|
|
1449
|
-
if (this._options.unindent_chained_methods && this._output.just_added_newline()) {
|
|
1450
|
-
this.deindent();
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
this.print_token(current_token);
|
|
1454
|
-
};
|
|
1455
|
-
|
|
1456
|
-
Beautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {
|
|
1457
|
-
this.print_token(current_token);
|
|
1458
|
-
|
|
1459
|
-
if (current_token.text[current_token.text.length - 1] === '\n') {
|
|
1460
|
-
this.print_newline(false, preserve_statement_flags);
|
|
1461
|
-
}
|
|
1462
|
-
};
|
|
1463
|
-
|
|
1464
|
-
Beautifier.prototype.handle_eof = function(current_token) {
|
|
1465
|
-
// Unwind any open statements
|
|
1466
|
-
while (this._flags.mode === MODE.Statement) {
|
|
1467
|
-
this.restore_mode();
|
|
1468
|
-
}
|
|
1469
|
-
this.handle_whitespace_and_comments(current_token);
|
|
1470
|
-
};
|
|
1471
|
-
|
|
1472
|
-
module.exports.Beautifier = Beautifier;
|