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.
Files changed (1120) hide show
  1. package/README.md +117 -0
  2. package/package.json +5 -6
  3. package/Readme.md +0 -102
  4. package/test/node_modules/.package-lock.json +0 -1254
  5. package/test/node_modules/abbrev/LICENSE +0 -46
  6. package/test/node_modules/abbrev/README.md +0 -23
  7. package/test/node_modules/abbrev/abbrev.js +0 -61
  8. package/test/node_modules/abbrev/package.json +0 -21
  9. package/test/node_modules/accepts/HISTORY.md +0 -243
  10. package/test/node_modules/accepts/LICENSE +0 -23
  11. package/test/node_modules/accepts/README.md +0 -140
  12. package/test/node_modules/accepts/index.js +0 -238
  13. package/test/node_modules/accepts/package.json +0 -47
  14. package/test/node_modules/ansi-styles/index.d.ts +0 -345
  15. package/test/node_modules/ansi-styles/index.js +0 -163
  16. package/test/node_modules/ansi-styles/license +0 -9
  17. package/test/node_modules/ansi-styles/package.json +0 -56
  18. package/test/node_modules/ansi-styles/readme.md +0 -152
  19. package/test/node_modules/any-promise/.jshintrc +0 -4
  20. package/test/node_modules/any-promise/LICENSE +0 -19
  21. package/test/node_modules/any-promise/README.md +0 -161
  22. package/test/node_modules/any-promise/implementation.d.ts +0 -3
  23. package/test/node_modules/any-promise/implementation.js +0 -1
  24. package/test/node_modules/any-promise/index.d.ts +0 -73
  25. package/test/node_modules/any-promise/index.js +0 -1
  26. package/test/node_modules/any-promise/loader.js +0 -78
  27. package/test/node_modules/any-promise/optional.js +0 -6
  28. package/test/node_modules/any-promise/package.json +0 -45
  29. package/test/node_modules/any-promise/register/bluebird.d.ts +0 -1
  30. package/test/node_modules/any-promise/register/bluebird.js +0 -2
  31. package/test/node_modules/any-promise/register/es6-promise.d.ts +0 -1
  32. package/test/node_modules/any-promise/register/es6-promise.js +0 -2
  33. package/test/node_modules/any-promise/register/lie.d.ts +0 -1
  34. package/test/node_modules/any-promise/register/lie.js +0 -2
  35. package/test/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
  36. package/test/node_modules/any-promise/register/native-promise-only.js +0 -2
  37. package/test/node_modules/any-promise/register/pinkie.d.ts +0 -1
  38. package/test/node_modules/any-promise/register/pinkie.js +0 -2
  39. package/test/node_modules/any-promise/register/promise.d.ts +0 -1
  40. package/test/node_modules/any-promise/register/promise.js +0 -2
  41. package/test/node_modules/any-promise/register/q.d.ts +0 -1
  42. package/test/node_modules/any-promise/register/q.js +0 -2
  43. package/test/node_modules/any-promise/register/rsvp.d.ts +0 -1
  44. package/test/node_modules/any-promise/register/rsvp.js +0 -2
  45. package/test/node_modules/any-promise/register/vow.d.ts +0 -1
  46. package/test/node_modules/any-promise/register/vow.js +0 -2
  47. package/test/node_modules/any-promise/register/when.d.ts +0 -1
  48. package/test/node_modules/any-promise/register/when.js +0 -2
  49. package/test/node_modules/any-promise/register-shim.js +0 -18
  50. package/test/node_modules/any-promise/register.d.ts +0 -17
  51. package/test/node_modules/any-promise/register.js +0 -94
  52. package/test/node_modules/anymatch/LICENSE +0 -15
  53. package/test/node_modules/anymatch/README.md +0 -87
  54. package/test/node_modules/anymatch/index.d.ts +0 -20
  55. package/test/node_modules/anymatch/index.js +0 -104
  56. package/test/node_modules/anymatch/package.json +0 -48
  57. package/test/node_modules/async/CHANGELOG.md +0 -348
  58. package/test/node_modules/async/LICENSE +0 -19
  59. package/test/node_modules/async/README.md +0 -59
  60. package/test/node_modules/async/all.js +0 -119
  61. package/test/node_modules/async/allLimit.js +0 -46
  62. package/test/node_modules/async/allSeries.js +0 -45
  63. package/test/node_modules/async/any.js +0 -122
  64. package/test/node_modules/async/anyLimit.js +0 -47
  65. package/test/node_modules/async/anySeries.js +0 -46
  66. package/test/node_modules/async/apply.js +0 -55
  67. package/test/node_modules/async/applyEach.js +0 -57
  68. package/test/node_modules/async/applyEachSeries.js +0 -37
  69. package/test/node_modules/async/asyncify.js +0 -118
  70. package/test/node_modules/async/auto.js +0 -333
  71. package/test/node_modules/async/autoInject.js +0 -182
  72. package/test/node_modules/async/bower.json +0 -17
  73. package/test/node_modules/async/cargo.js +0 -63
  74. package/test/node_modules/async/cargoQueue.js +0 -71
  75. package/test/node_modules/async/compose.js +0 -55
  76. package/test/node_modules/async/concat.js +0 -115
  77. package/test/node_modules/async/concatLimit.js +0 -60
  78. package/test/node_modules/async/concatSeries.js +0 -41
  79. package/test/node_modules/async/constant.js +0 -55
  80. package/test/node_modules/async/detect.js +0 -96
  81. package/test/node_modules/async/detectLimit.js +0 -48
  82. package/test/node_modules/async/detectSeries.js +0 -47
  83. package/test/node_modules/async/dir.js +0 -43
  84. package/test/node_modules/async/dist/async.js +0 -6059
  85. package/test/node_modules/async/dist/async.min.js +0 -1
  86. package/test/node_modules/async/dist/async.mjs +0 -5947
  87. package/test/node_modules/async/doDuring.js +0 -68
  88. package/test/node_modules/async/doUntil.js +0 -46
  89. package/test/node_modules/async/doWhilst.js +0 -68
  90. package/test/node_modules/async/during.js +0 -78
  91. package/test/node_modules/async/each.js +0 -129
  92. package/test/node_modules/async/eachLimit.js +0 -50
  93. package/test/node_modules/async/eachOf.js +0 -185
  94. package/test/node_modules/async/eachOfLimit.js +0 -47
  95. package/test/node_modules/async/eachOfSeries.js +0 -39
  96. package/test/node_modules/async/eachSeries.js +0 -44
  97. package/test/node_modules/async/ensureAsync.js +0 -67
  98. package/test/node_modules/async/every.js +0 -119
  99. package/test/node_modules/async/everyLimit.js +0 -46
  100. package/test/node_modules/async/everySeries.js +0 -45
  101. package/test/node_modules/async/filter.js +0 -93
  102. package/test/node_modules/async/filterLimit.js +0 -45
  103. package/test/node_modules/async/filterSeries.js +0 -43
  104. package/test/node_modules/async/find.js +0 -96
  105. package/test/node_modules/async/findLimit.js +0 -48
  106. package/test/node_modules/async/findSeries.js +0 -47
  107. package/test/node_modules/async/flatMap.js +0 -115
  108. package/test/node_modules/async/flatMapLimit.js +0 -60
  109. package/test/node_modules/async/flatMapSeries.js +0 -41
  110. package/test/node_modules/async/foldl.js +0 -153
  111. package/test/node_modules/async/foldr.js +0 -41
  112. package/test/node_modules/async/forEach.js +0 -129
  113. package/test/node_modules/async/forEachLimit.js +0 -50
  114. package/test/node_modules/async/forEachOf.js +0 -185
  115. package/test/node_modules/async/forEachOfLimit.js +0 -47
  116. package/test/node_modules/async/forEachOfSeries.js +0 -39
  117. package/test/node_modules/async/forEachSeries.js +0 -44
  118. package/test/node_modules/async/forever.js +0 -68
  119. package/test/node_modules/async/groupBy.js +0 -108
  120. package/test/node_modules/async/groupByLimit.js +0 -71
  121. package/test/node_modules/async/groupBySeries.js +0 -36
  122. package/test/node_modules/async/index.js +0 -588
  123. package/test/node_modules/async/inject.js +0 -153
  124. package/test/node_modules/async/internal/DoublyLinkedList.js +0 -92
  125. package/test/node_modules/async/internal/Heap.js +0 -120
  126. package/test/node_modules/async/internal/applyEach.js +0 -29
  127. package/test/node_modules/async/internal/asyncEachOfLimit.js +0 -75
  128. package/test/node_modules/async/internal/awaitify.js +0 -27
  129. package/test/node_modules/async/internal/breakLoop.js +0 -10
  130. package/test/node_modules/async/internal/consoleFunc.js +0 -31
  131. package/test/node_modules/async/internal/createTester.js +0 -40
  132. package/test/node_modules/async/internal/eachOfLimit.js +0 -90
  133. package/test/node_modules/async/internal/filter.js +0 -55
  134. package/test/node_modules/async/internal/getIterator.js +0 -11
  135. package/test/node_modules/async/internal/initialParams.js +0 -14
  136. package/test/node_modules/async/internal/isArrayLike.js +0 -10
  137. package/test/node_modules/async/internal/iterator.js +0 -57
  138. package/test/node_modules/async/internal/map.js +0 -30
  139. package/test/node_modules/async/internal/once.js +0 -17
  140. package/test/node_modules/async/internal/onlyOnce.js +0 -15
  141. package/test/node_modules/async/internal/parallel.js +0 -34
  142. package/test/node_modules/async/internal/promiseCallback.js +0 -23
  143. package/test/node_modules/async/internal/queue.js +0 -294
  144. package/test/node_modules/async/internal/range.js +0 -14
  145. package/test/node_modules/async/internal/reject.js +0 -26
  146. package/test/node_modules/async/internal/setImmediate.js +0 -34
  147. package/test/node_modules/async/internal/withoutIndex.js +0 -10
  148. package/test/node_modules/async/internal/wrapAsync.js +0 -34
  149. package/test/node_modules/async/log.js +0 -41
  150. package/test/node_modules/async/map.js +0 -142
  151. package/test/node_modules/async/mapLimit.js +0 -45
  152. package/test/node_modules/async/mapSeries.js +0 -44
  153. package/test/node_modules/async/mapValues.js +0 -152
  154. package/test/node_modules/async/mapValuesLimit.js +0 -61
  155. package/test/node_modules/async/mapValuesSeries.js +0 -37
  156. package/test/node_modules/async/memoize.js +0 -91
  157. package/test/node_modules/async/nextTick.js +0 -52
  158. package/test/node_modules/async/package.json +0 -75
  159. package/test/node_modules/async/parallel.js +0 -180
  160. package/test/node_modules/async/parallelLimit.js +0 -41
  161. package/test/node_modules/async/priorityQueue.js +0 -86
  162. package/test/node_modules/async/queue.js +0 -167
  163. package/test/node_modules/async/race.js +0 -67
  164. package/test/node_modules/async/reduce.js +0 -153
  165. package/test/node_modules/async/reduceRight.js +0 -41
  166. package/test/node_modules/async/reflect.js +0 -78
  167. package/test/node_modules/async/reflectAll.js +0 -93
  168. package/test/node_modules/async/reject.js +0 -87
  169. package/test/node_modules/async/rejectLimit.js +0 -45
  170. package/test/node_modules/async/rejectSeries.js +0 -43
  171. package/test/node_modules/async/retry.js +0 -159
  172. package/test/node_modules/async/retryable.js +0 -77
  173. package/test/node_modules/async/select.js +0 -93
  174. package/test/node_modules/async/selectLimit.js +0 -45
  175. package/test/node_modules/async/selectSeries.js +0 -43
  176. package/test/node_modules/async/seq.js +0 -79
  177. package/test/node_modules/async/series.js +0 -186
  178. package/test/node_modules/async/setImmediate.js +0 -45
  179. package/test/node_modules/async/some.js +0 -122
  180. package/test/node_modules/async/someLimit.js +0 -47
  181. package/test/node_modules/async/someSeries.js +0 -46
  182. package/test/node_modules/async/sortBy.js +0 -190
  183. package/test/node_modules/async/timeout.js +0 -89
  184. package/test/node_modules/async/times.js +0 -50
  185. package/test/node_modules/async/timesLimit.js +0 -43
  186. package/test/node_modules/async/timesSeries.js +0 -32
  187. package/test/node_modules/async/transform.js +0 -173
  188. package/test/node_modules/async/tryEach.js +0 -78
  189. package/test/node_modules/async/unmemoize.js +0 -25
  190. package/test/node_modules/async/until.js +0 -61
  191. package/test/node_modules/async/waterfall.js +0 -105
  192. package/test/node_modules/async/whilst.js +0 -78
  193. package/test/node_modules/async/wrapSync.js +0 -118
  194. package/test/node_modules/balanced-match/.github/FUNDING.yml +0 -2
  195. package/test/node_modules/balanced-match/LICENSE.md +0 -21
  196. package/test/node_modules/balanced-match/README.md +0 -97
  197. package/test/node_modules/balanced-match/index.js +0 -62
  198. package/test/node_modules/balanced-match/package.json +0 -48
  199. package/test/node_modules/binary-extensions/binary-extensions.json +0 -260
  200. package/test/node_modules/binary-extensions/binary-extensions.json.d.ts +0 -3
  201. package/test/node_modules/binary-extensions/index.d.ts +0 -14
  202. package/test/node_modules/binary-extensions/index.js +0 -1
  203. package/test/node_modules/binary-extensions/license +0 -9
  204. package/test/node_modules/binary-extensions/package.json +0 -38
  205. package/test/node_modules/binary-extensions/readme.md +0 -41
  206. package/test/node_modules/bluebird/LICENSE +0 -21
  207. package/test/node_modules/bluebird/README.md +0 -57
  208. package/test/node_modules/bluebird/changelog.md +0 -1
  209. package/test/node_modules/bluebird/js/browser/bluebird.core.js +0 -3914
  210. package/test/node_modules/bluebird/js/browser/bluebird.core.min.js +0 -31
  211. package/test/node_modules/bluebird/js/browser/bluebird.js +0 -5778
  212. package/test/node_modules/bluebird/js/browser/bluebird.min.js +0 -31
  213. package/test/node_modules/bluebird/js/release/any.js +0 -21
  214. package/test/node_modules/bluebird/js/release/assert.js +0 -55
  215. package/test/node_modules/bluebird/js/release/async.js +0 -120
  216. package/test/node_modules/bluebird/js/release/bind.js +0 -67
  217. package/test/node_modules/bluebird/js/release/bluebird.js +0 -11
  218. package/test/node_modules/bluebird/js/release/call_get.js +0 -123
  219. package/test/node_modules/bluebird/js/release/cancel.js +0 -129
  220. package/test/node_modules/bluebird/js/release/catch_filter.js +0 -42
  221. package/test/node_modules/bluebird/js/release/context.js +0 -69
  222. package/test/node_modules/bluebird/js/release/debuggability.js +0 -1009
  223. package/test/node_modules/bluebird/js/release/direct_resolve.js +0 -46
  224. package/test/node_modules/bluebird/js/release/each.js +0 -30
  225. package/test/node_modules/bluebird/js/release/errors.js +0 -116
  226. package/test/node_modules/bluebird/js/release/es5.js +0 -80
  227. package/test/node_modules/bluebird/js/release/filter.js +0 -12
  228. package/test/node_modules/bluebird/js/release/finally.js +0 -146
  229. package/test/node_modules/bluebird/js/release/generators.js +0 -223
  230. package/test/node_modules/bluebird/js/release/join.js +0 -165
  231. package/test/node_modules/bluebird/js/release/map.js +0 -175
  232. package/test/node_modules/bluebird/js/release/method.js +0 -55
  233. package/test/node_modules/bluebird/js/release/nodeback.js +0 -51
  234. package/test/node_modules/bluebird/js/release/nodeify.js +0 -58
  235. package/test/node_modules/bluebird/js/release/promise.js +0 -819
  236. package/test/node_modules/bluebird/js/release/promise_array.js +0 -186
  237. package/test/node_modules/bluebird/js/release/promisify.js +0 -314
  238. package/test/node_modules/bluebird/js/release/props.js +0 -118
  239. package/test/node_modules/bluebird/js/release/queue.js +0 -73
  240. package/test/node_modules/bluebird/js/release/race.js +0 -49
  241. package/test/node_modules/bluebird/js/release/reduce.js +0 -183
  242. package/test/node_modules/bluebird/js/release/schedule.js +0 -62
  243. package/test/node_modules/bluebird/js/release/settle.js +0 -47
  244. package/test/node_modules/bluebird/js/release/some.js +0 -148
  245. package/test/node_modules/bluebird/js/release/synchronous_inspection.js +0 -103
  246. package/test/node_modules/bluebird/js/release/thenables.js +0 -86
  247. package/test/node_modules/bluebird/js/release/timers.js +0 -93
  248. package/test/node_modules/bluebird/js/release/using.js +0 -226
  249. package/test/node_modules/bluebird/js/release/util.js +0 -421
  250. package/test/node_modules/bluebird/package.json +0 -78
  251. package/test/node_modules/brace-expansion/LICENSE +0 -21
  252. package/test/node_modules/brace-expansion/README.md +0 -129
  253. package/test/node_modules/brace-expansion/index.js +0 -201
  254. package/test/node_modules/brace-expansion/package.json +0 -47
  255. package/test/node_modules/braces/CHANGELOG.md +0 -184
  256. package/test/node_modules/braces/LICENSE +0 -21
  257. package/test/node_modules/braces/README.md +0 -593
  258. package/test/node_modules/braces/index.js +0 -170
  259. package/test/node_modules/braces/lib/compile.js +0 -57
  260. package/test/node_modules/braces/lib/constants.js +0 -57
  261. package/test/node_modules/braces/lib/expand.js +0 -113
  262. package/test/node_modules/braces/lib/parse.js +0 -333
  263. package/test/node_modules/braces/lib/stringify.js +0 -32
  264. package/test/node_modules/braces/lib/utils.js +0 -112
  265. package/test/node_modules/braces/package.json +0 -77
  266. package/test/node_modules/cache-content-type/History.md +0 -15
  267. package/test/node_modules/cache-content-type/README.md +0 -17
  268. package/test/node_modules/cache-content-type/index.js +0 -15
  269. package/test/node_modules/cache-content-type/package.json +0 -42
  270. package/test/node_modules/chalk/index.d.ts +0 -415
  271. package/test/node_modules/chalk/license +0 -9
  272. package/test/node_modules/chalk/package.json +0 -68
  273. package/test/node_modules/chalk/readme.md +0 -341
  274. package/test/node_modules/chalk/source/index.js +0 -229
  275. package/test/node_modules/chalk/source/templates.js +0 -134
  276. package/test/node_modules/chalk/source/util.js +0 -39
  277. package/test/node_modules/chokidar/LICENSE +0 -21
  278. package/test/node_modules/chokidar/README.md +0 -308
  279. package/test/node_modules/chokidar/index.js +0 -973
  280. package/test/node_modules/chokidar/lib/constants.js +0 -65
  281. package/test/node_modules/chokidar/lib/fsevents-handler.js +0 -524
  282. package/test/node_modules/chokidar/lib/nodefs-handler.js +0 -654
  283. package/test/node_modules/chokidar/package.json +0 -85
  284. package/test/node_modules/chokidar/types/index.d.ts +0 -188
  285. package/test/node_modules/co/History.md +0 -172
  286. package/test/node_modules/co/LICENSE +0 -22
  287. package/test/node_modules/co/Readme.md +0 -212
  288. package/test/node_modules/co/index.js +0 -237
  289. package/test/node_modules/co/package.json +0 -34
  290. package/test/node_modules/color-convert/CHANGELOG.md +0 -54
  291. package/test/node_modules/color-convert/LICENSE +0 -21
  292. package/test/node_modules/color-convert/README.md +0 -68
  293. package/test/node_modules/color-convert/conversions.js +0 -839
  294. package/test/node_modules/color-convert/index.js +0 -81
  295. package/test/node_modules/color-convert/package.json +0 -48
  296. package/test/node_modules/color-convert/route.js +0 -97
  297. package/test/node_modules/color-name/LICENSE +0 -8
  298. package/test/node_modules/color-name/README.md +0 -11
  299. package/test/node_modules/color-name/index.js +0 -152
  300. package/test/node_modules/color-name/package.json +0 -28
  301. package/test/node_modules/commander/CHANGELOG.md +0 -419
  302. package/test/node_modules/commander/LICENSE +0 -22
  303. package/test/node_modules/commander/Readme.md +0 -428
  304. package/test/node_modules/commander/index.js +0 -1224
  305. package/test/node_modules/commander/package.json +0 -38
  306. package/test/node_modules/commander/typings/index.d.ts +0 -310
  307. package/test/node_modules/concat-map/.travis.yml +0 -4
  308. package/test/node_modules/concat-map/LICENSE +0 -18
  309. package/test/node_modules/concat-map/README.markdown +0 -62
  310. package/test/node_modules/concat-map/example/map.js +0 -6
  311. package/test/node_modules/concat-map/index.js +0 -13
  312. package/test/node_modules/concat-map/package.json +0 -43
  313. package/test/node_modules/concat-map/test/map.js +0 -39
  314. package/test/node_modules/condense-newlines/LICENSE +0 -21
  315. package/test/node_modules/condense-newlines/README.md +0 -105
  316. package/test/node_modules/condense-newlines/index.js +0 -60
  317. package/test/node_modules/condense-newlines/package.json +0 -64
  318. package/test/node_modules/config-chain/LICENCE +0 -22
  319. package/test/node_modules/config-chain/index.js +0 -282
  320. package/test/node_modules/config-chain/package.json +0 -28
  321. package/test/node_modules/config-chain/readme.markdown +0 -257
  322. package/test/node_modules/consolidate/History.md +0 -132
  323. package/test/node_modules/consolidate/Readme.md +0 -223
  324. package/test/node_modules/consolidate/index.js +0 -1
  325. package/test/node_modules/consolidate/lib/consolidate.js +0 -1792
  326. package/test/node_modules/consolidate/package.json +0 -94
  327. package/test/node_modules/content-disposition/HISTORY.md +0 -60
  328. package/test/node_modules/content-disposition/LICENSE +0 -22
  329. package/test/node_modules/content-disposition/README.md +0 -142
  330. package/test/node_modules/content-disposition/index.js +0 -458
  331. package/test/node_modules/content-disposition/package.json +0 -44
  332. package/test/node_modules/content-type/HISTORY.md +0 -24
  333. package/test/node_modules/content-type/LICENSE +0 -22
  334. package/test/node_modules/content-type/README.md +0 -92
  335. package/test/node_modules/content-type/index.js +0 -222
  336. package/test/node_modules/content-type/package.json +0 -40
  337. package/test/node_modules/cookies/HISTORY.md +0 -121
  338. package/test/node_modules/cookies/LICENSE +0 -23
  339. package/test/node_modules/cookies/README.md +0 -145
  340. package/test/node_modules/cookies/index.js +0 -224
  341. package/test/node_modules/cookies/package.json +0 -38
  342. package/test/node_modules/debug/LICENSE +0 -20
  343. package/test/node_modules/debug/README.md +0 -481
  344. package/test/node_modules/debug/package.json +0 -59
  345. package/test/node_modules/debug/src/browser.js +0 -269
  346. package/test/node_modules/debug/src/common.js +0 -274
  347. package/test/node_modules/debug/src/index.js +0 -10
  348. package/test/node_modules/debug/src/node.js +0 -263
  349. package/test/node_modules/deep-equal/.travis.yml +0 -8
  350. package/test/node_modules/deep-equal/LICENSE +0 -18
  351. package/test/node_modules/deep-equal/example/cmp.js +0 -11
  352. package/test/node_modules/deep-equal/index.js +0 -94
  353. package/test/node_modules/deep-equal/lib/is_arguments.js +0 -20
  354. package/test/node_modules/deep-equal/lib/keys.js +0 -9
  355. package/test/node_modules/deep-equal/package.json +0 -58
  356. package/test/node_modules/deep-equal/readme.markdown +0 -61
  357. package/test/node_modules/deep-equal/test/cmp.js +0 -95
  358. package/test/node_modules/delegates/History.md +0 -22
  359. package/test/node_modules/delegates/License +0 -20
  360. package/test/node_modules/delegates/Makefile +0 -8
  361. package/test/node_modules/delegates/Readme.md +0 -94
  362. package/test/node_modules/delegates/index.js +0 -121
  363. package/test/node_modules/delegates/package.json +0 -13
  364. package/test/node_modules/delegates/test/index.js +0 -94
  365. package/test/node_modules/depd/History.md +0 -103
  366. package/test/node_modules/depd/LICENSE +0 -22
  367. package/test/node_modules/depd/Readme.md +0 -280
  368. package/test/node_modules/depd/index.js +0 -538
  369. package/test/node_modules/depd/lib/browser/index.js +0 -77
  370. package/test/node_modules/depd/package.json +0 -45
  371. package/test/node_modules/destroy/LICENSE +0 -23
  372. package/test/node_modules/destroy/README.md +0 -63
  373. package/test/node_modules/destroy/index.js +0 -209
  374. package/test/node_modules/destroy/package.json +0 -48
  375. package/test/node_modules/editorconfig/CHANGELOG.md +0 -14
  376. package/test/node_modules/editorconfig/LICENSE +0 -19
  377. package/test/node_modules/editorconfig/README.md +0 -206
  378. package/test/node_modules/editorconfig/bin/editorconfig +0 -3
  379. package/test/node_modules/editorconfig/package.json +0 -59
  380. package/test/node_modules/editorconfig/src/cli.d.ts +0 -1
  381. package/test/node_modules/editorconfig/src/cli.js +0 -53
  382. package/test/node_modules/editorconfig/src/index.d.ts +0 -29
  383. package/test/node_modules/editorconfig/src/index.js +0 -261
  384. package/test/node_modules/editorconfig/src/lib/fnmatch.d.ts +0 -214
  385. package/test/node_modules/editorconfig/src/lib/fnmatch.js +0 -1047
  386. package/test/node_modules/editorconfig/src/lib/ini.d.ts +0 -14
  387. package/test/node_modules/editorconfig/src/lib/ini.js +0 -106
  388. package/test/node_modules/ee-first/LICENSE +0 -22
  389. package/test/node_modules/ee-first/README.md +0 -80
  390. package/test/node_modules/ee-first/index.js +0 -95
  391. package/test/node_modules/ee-first/package.json +0 -29
  392. package/test/node_modules/ejs/LICENSE +0 -202
  393. package/test/node_modules/ejs/README.md +0 -344
  394. package/test/node_modules/ejs/bin/cli.js +0 -212
  395. package/test/node_modules/ejs/ejs.js +0 -1720
  396. package/test/node_modules/ejs/ejs.min.js +0 -1
  397. package/test/node_modules/ejs/jakefile.js +0 -88
  398. package/test/node_modules/ejs/lib/ejs.js +0 -951
  399. package/test/node_modules/ejs/lib/utils.js +0 -225
  400. package/test/node_modules/ejs/package.json +0 -42
  401. package/test/node_modules/ejs/usage.txt +0 -24
  402. package/test/node_modules/encodeurl/HISTORY.md +0 -14
  403. package/test/node_modules/encodeurl/LICENSE +0 -22
  404. package/test/node_modules/encodeurl/README.md +0 -128
  405. package/test/node_modules/encodeurl/index.js +0 -60
  406. package/test/node_modules/encodeurl/package.json +0 -40
  407. package/test/node_modules/escape-html/LICENSE +0 -24
  408. package/test/node_modules/escape-html/Readme.md +0 -43
  409. package/test/node_modules/escape-html/index.js +0 -78
  410. package/test/node_modules/escape-html/package.json +0 -24
  411. package/test/node_modules/extend-shallow/LICENSE +0 -21
  412. package/test/node_modules/extend-shallow/README.md +0 -61
  413. package/test/node_modules/extend-shallow/index.js +0 -33
  414. package/test/node_modules/extend-shallow/package.json +0 -56
  415. package/test/node_modules/filelist/README.md +0 -84
  416. package/test/node_modules/filelist/index.d.ts +0 -110
  417. package/test/node_modules/filelist/index.js +0 -495
  418. package/test/node_modules/filelist/jakefile.js +0 -15
  419. package/test/node_modules/filelist/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  420. package/test/node_modules/filelist/node_modules/brace-expansion/LICENSE +0 -21
  421. package/test/node_modules/filelist/node_modules/brace-expansion/README.md +0 -135
  422. package/test/node_modules/filelist/node_modules/brace-expansion/index.js +0 -203
  423. package/test/node_modules/filelist/node_modules/brace-expansion/package.json +0 -46
  424. package/test/node_modules/filelist/node_modules/minimatch/LICENSE +0 -15
  425. package/test/node_modules/filelist/node_modules/minimatch/README.md +0 -259
  426. package/test/node_modules/filelist/node_modules/minimatch/lib/path.js +0 -4
  427. package/test/node_modules/filelist/node_modules/minimatch/minimatch.js +0 -906
  428. package/test/node_modules/filelist/node_modules/minimatch/package.json +0 -32
  429. package/test/node_modules/filelist/package.json +0 -28
  430. package/test/node_modules/fill-range/LICENSE +0 -21
  431. package/test/node_modules/fill-range/README.md +0 -237
  432. package/test/node_modules/fill-range/index.js +0 -249
  433. package/test/node_modules/fill-range/package.json +0 -69
  434. package/test/node_modules/fresh/HISTORY.md +0 -70
  435. package/test/node_modules/fresh/LICENSE +0 -23
  436. package/test/node_modules/fresh/README.md +0 -119
  437. package/test/node_modules/fresh/index.js +0 -137
  438. package/test/node_modules/fresh/package.json +0 -46
  439. package/test/node_modules/fs.realpath/LICENSE +0 -43
  440. package/test/node_modules/fs.realpath/README.md +0 -33
  441. package/test/node_modules/fs.realpath/index.js +0 -66
  442. package/test/node_modules/fs.realpath/old.js +0 -303
  443. package/test/node_modules/fs.realpath/package.json +0 -26
  444. package/test/node_modules/get-paths/.editorconfig +0 -9
  445. package/test/node_modules/get-paths/.gitattributes +0 -1
  446. package/test/node_modules/get-paths/.lib.eslintrc +0 -3
  447. package/test/node_modules/get-paths/.remarkignore +0 -1
  448. package/test/node_modules/get-paths/.travis.yml +0 -6
  449. package/test/node_modules/get-paths/LICENSE +0 -21
  450. package/test/node_modules/get-paths/README.md +0 -61
  451. package/test/node_modules/get-paths/index.js +0 -31
  452. package/test/node_modules/get-paths/package.json +0 -100
  453. package/test/node_modules/get-paths/test/test.js +0 -7
  454. package/test/node_modules/glob/LICENSE +0 -15
  455. package/test/node_modules/glob/README.md +0 -378
  456. package/test/node_modules/glob/common.js +0 -240
  457. package/test/node_modules/glob/glob.js +0 -790
  458. package/test/node_modules/glob/node_modules/brace-expansion/.github/FUNDING.yml +0 -2
  459. package/test/node_modules/glob/node_modules/brace-expansion/LICENSE +0 -21
  460. package/test/node_modules/glob/node_modules/brace-expansion/README.md +0 -135
  461. package/test/node_modules/glob/node_modules/brace-expansion/index.js +0 -203
  462. package/test/node_modules/glob/node_modules/brace-expansion/package.json +0 -46
  463. package/test/node_modules/glob/node_modules/minimatch/LICENSE +0 -15
  464. package/test/node_modules/glob/node_modules/minimatch/README.md +0 -259
  465. package/test/node_modules/glob/node_modules/minimatch/lib/path.js +0 -4
  466. package/test/node_modules/glob/node_modules/minimatch/minimatch.js +0 -906
  467. package/test/node_modules/glob/node_modules/minimatch/package.json +0 -32
  468. package/test/node_modules/glob/package.json +0 -55
  469. package/test/node_modules/glob/sync.js +0 -486
  470. package/test/node_modules/glob-parent/CHANGELOG.md +0 -110
  471. package/test/node_modules/glob-parent/LICENSE +0 -15
  472. package/test/node_modules/glob-parent/README.md +0 -137
  473. package/test/node_modules/glob-parent/index.js +0 -42
  474. package/test/node_modules/glob-parent/package.json +0 -48
  475. package/test/node_modules/has-flag/index.d.ts +0 -39
  476. package/test/node_modules/has-flag/index.js +0 -8
  477. package/test/node_modules/has-flag/license +0 -9
  478. package/test/node_modules/has-flag/package.json +0 -46
  479. package/test/node_modules/has-flag/readme.md +0 -89
  480. package/test/node_modules/has-symbols/.eslintrc +0 -11
  481. package/test/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  482. package/test/node_modules/has-symbols/.nycrc +0 -9
  483. package/test/node_modules/has-symbols/CHANGELOG.md +0 -75
  484. package/test/node_modules/has-symbols/LICENSE +0 -21
  485. package/test/node_modules/has-symbols/README.md +0 -46
  486. package/test/node_modules/has-symbols/index.js +0 -13
  487. package/test/node_modules/has-symbols/package.json +0 -101
  488. package/test/node_modules/has-symbols/shams.js +0 -42
  489. package/test/node_modules/has-symbols/test/index.js +0 -22
  490. package/test/node_modules/has-symbols/test/shams/core-js.js +0 -28
  491. package/test/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -28
  492. package/test/node_modules/has-symbols/test/tests.js +0 -56
  493. package/test/node_modules/has-tostringtag/.eslintrc +0 -11
  494. package/test/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
  495. package/test/node_modules/has-tostringtag/CHANGELOG.md +0 -20
  496. package/test/node_modules/has-tostringtag/LICENSE +0 -21
  497. package/test/node_modules/has-tostringtag/README.md +0 -46
  498. package/test/node_modules/has-tostringtag/index.js +0 -7
  499. package/test/node_modules/has-tostringtag/package.json +0 -84
  500. package/test/node_modules/has-tostringtag/shams.js +0 -7
  501. package/test/node_modules/has-tostringtag/test/index.js +0 -21
  502. package/test/node_modules/has-tostringtag/test/shams/core-js.js +0 -28
  503. package/test/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -28
  504. package/test/node_modules/has-tostringtag/test/tests.js +0 -14
  505. package/test/node_modules/http-assert/HISTORY.md +0 -79
  506. package/test/node_modules/http-assert/LICENSE +0 -22
  507. package/test/node_modules/http-assert/README.md +0 -116
  508. package/test/node_modules/http-assert/index.js +0 -41
  509. package/test/node_modules/http-assert/package.json +0 -41
  510. package/test/node_modules/http-errors/HISTORY.md +0 -165
  511. package/test/node_modules/http-errors/LICENSE +0 -23
  512. package/test/node_modules/http-errors/README.md +0 -169
  513. package/test/node_modules/http-errors/index.js +0 -299
  514. package/test/node_modules/http-errors/node_modules/depd/History.md +0 -96
  515. package/test/node_modules/http-errors/node_modules/depd/LICENSE +0 -22
  516. package/test/node_modules/http-errors/node_modules/depd/Readme.md +0 -280
  517. package/test/node_modules/http-errors/node_modules/depd/index.js +0 -522
  518. package/test/node_modules/http-errors/node_modules/depd/lib/browser/index.js +0 -77
  519. package/test/node_modules/http-errors/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
  520. package/test/node_modules/http-errors/node_modules/depd/lib/compat/event-listener-count.js +0 -22
  521. package/test/node_modules/http-errors/node_modules/depd/lib/compat/index.js +0 -79
  522. package/test/node_modules/http-errors/node_modules/depd/package.json +0 -41
  523. package/test/node_modules/http-errors/package.json +0 -49
  524. package/test/node_modules/ignore-by-default/LICENSE +0 -14
  525. package/test/node_modules/ignore-by-default/README.md +0 -26
  526. package/test/node_modules/ignore-by-default/index.js +0 -12
  527. package/test/node_modules/ignore-by-default/package.json +0 -34
  528. package/test/node_modules/inflight/LICENSE +0 -15
  529. package/test/node_modules/inflight/README.md +0 -37
  530. package/test/node_modules/inflight/inflight.js +0 -54
  531. package/test/node_modules/inflight/package.json +0 -29
  532. package/test/node_modules/inherits/LICENSE +0 -16
  533. package/test/node_modules/inherits/README.md +0 -42
  534. package/test/node_modules/inherits/inherits.js +0 -9
  535. package/test/node_modules/inherits/inherits_browser.js +0 -27
  536. package/test/node_modules/inherits/package.json +0 -29
  537. package/test/node_modules/ini/LICENSE +0 -15
  538. package/test/node_modules/ini/README.md +0 -102
  539. package/test/node_modules/ini/ini.js +0 -206
  540. package/test/node_modules/ini/package.json +0 -33
  541. package/test/node_modules/is-binary-path/index.d.ts +0 -17
  542. package/test/node_modules/is-binary-path/index.js +0 -7
  543. package/test/node_modules/is-binary-path/license +0 -9
  544. package/test/node_modules/is-binary-path/package.json +0 -40
  545. package/test/node_modules/is-binary-path/readme.md +0 -34
  546. package/test/node_modules/is-buffer/LICENSE +0 -21
  547. package/test/node_modules/is-buffer/README.md +0 -53
  548. package/test/node_modules/is-buffer/index.js +0 -21
  549. package/test/node_modules/is-buffer/package.json +0 -51
  550. package/test/node_modules/is-buffer/test/basic.js +0 -24
  551. package/test/node_modules/is-extendable/LICENSE +0 -21
  552. package/test/node_modules/is-extendable/README.md +0 -72
  553. package/test/node_modules/is-extendable/index.js +0 -13
  554. package/test/node_modules/is-extendable/package.json +0 -51
  555. package/test/node_modules/is-extglob/LICENSE +0 -21
  556. package/test/node_modules/is-extglob/README.md +0 -107
  557. package/test/node_modules/is-extglob/index.js +0 -20
  558. package/test/node_modules/is-extglob/package.json +0 -69
  559. package/test/node_modules/is-generator-function/.eslintignore +0 -1
  560. package/test/node_modules/is-generator-function/.eslintrc +0 -9
  561. package/test/node_modules/is-generator-function/.nvmrc +0 -1
  562. package/test/node_modules/is-generator-function/.nycrc +0 -9
  563. package/test/node_modules/is-generator-function/CHANGELOG.md +0 -216
  564. package/test/node_modules/is-generator-function/LICENSE +0 -20
  565. package/test/node_modules/is-generator-function/README.md +0 -40
  566. package/test/node_modules/is-generator-function/index.js +0 -38
  567. package/test/node_modules/is-generator-function/package.json +0 -87
  568. package/test/node_modules/is-generator-function/test/corejs.js +0 -5
  569. package/test/node_modules/is-generator-function/test/index.js +0 -83
  570. package/test/node_modules/is-generator-function/test/uglified.js +0 -8
  571. package/test/node_modules/is-glob/LICENSE +0 -21
  572. package/test/node_modules/is-glob/README.md +0 -206
  573. package/test/node_modules/is-glob/index.js +0 -150
  574. package/test/node_modules/is-glob/package.json +0 -81
  575. package/test/node_modules/is-number/LICENSE +0 -21
  576. package/test/node_modules/is-number/README.md +0 -187
  577. package/test/node_modules/is-number/index.js +0 -18
  578. package/test/node_modules/is-number/package.json +0 -82
  579. package/test/node_modules/is-whitespace/LICENSE +0 -21
  580. package/test/node_modules/is-whitespace/README.md +0 -47
  581. package/test/node_modules/is-whitespace/index.js +0 -19
  582. package/test/node_modules/is-whitespace/package.json +0 -47
  583. package/test/node_modules/jake/Makefile +0 -44
  584. package/test/node_modules/jake/README.md +0 -17
  585. package/test/node_modules/jake/bin/bash_completion.sh +0 -41
  586. package/test/node_modules/jake/bin/cli.js +0 -31
  587. package/test/node_modules/jake/jakefile.js +0 -94
  588. package/test/node_modules/jake/lib/api.js +0 -409
  589. package/test/node_modules/jake/lib/jake.js +0 -330
  590. package/test/node_modules/jake/lib/loader.js +0 -173
  591. package/test/node_modules/jake/lib/namespace.js +0 -115
  592. package/test/node_modules/jake/lib/package_task.js +0 -406
  593. package/test/node_modules/jake/lib/parseargs.js +0 -134
  594. package/test/node_modules/jake/lib/program.js +0 -282
  595. package/test/node_modules/jake/lib/publish_task.js +0 -290
  596. package/test/node_modules/jake/lib/rule.js +0 -311
  597. package/test/node_modules/jake/lib/task/directory_task.js +0 -30
  598. package/test/node_modules/jake/lib/task/file_task.js +0 -124
  599. package/test/node_modules/jake/lib/task/index.js +0 -9
  600. package/test/node_modules/jake/lib/task/task.js +0 -449
  601. package/test/node_modules/jake/lib/test_task.js +0 -270
  602. package/test/node_modules/jake/lib/utils/file.js +0 -286
  603. package/test/node_modules/jake/lib/utils/index.js +0 -297
  604. package/test/node_modules/jake/lib/utils/logger.js +0 -24
  605. package/test/node_modules/jake/package.json +0 -42
  606. package/test/node_modules/jake/test/integration/concurrent.js +0 -45
  607. package/test/node_modules/jake/test/integration/file.js +0 -228
  608. package/test/node_modules/jake/test/integration/file_task.js +0 -126
  609. package/test/node_modules/jake/test/integration/helpers.js +0 -80
  610. package/test/node_modules/jake/test/integration/jakefile.js +0 -337
  611. package/test/node_modules/jake/test/integration/jakelib/concurrent.jake.js +0 -113
  612. package/test/node_modules/jake/test/integration/jakelib/publish.jake.js +0 -49
  613. package/test/node_modules/jake/test/integration/jakelib/required_module.jake.js +0 -10
  614. package/test/node_modules/jake/test/integration/jakelib/rule.jake.js +0 -222
  615. package/test/node_modules/jake/test/integration/publish_task.js +0 -27
  616. package/test/node_modules/jake/test/integration/rule.js +0 -217
  617. package/test/node_modules/jake/test/integration/selfdep.js +0 -42
  618. package/test/node_modules/jake/test/integration/task_base.js +0 -167
  619. package/test/node_modules/jake/test/unit/jakefile.js +0 -36
  620. package/test/node_modules/jake/test/unit/namespace.js +0 -77
  621. package/test/node_modules/jake/test/unit/parseargs.js +0 -169
  622. package/test/node_modules/jake/usage.txt +0 -16
  623. package/test/node_modules/js-beautify/LICENSE +0 -9
  624. package/test/node_modules/js-beautify/README.md +0 -435
  625. package/test/node_modules/js-beautify/js/bin/css-beautify.js +0 -4
  626. package/test/node_modules/js-beautify/js/bin/html-beautify.js +0 -4
  627. package/test/node_modules/js-beautify/js/bin/js-beautify.js +0 -4
  628. package/test/node_modules/js-beautify/js/index.js +0 -86
  629. package/test/node_modules/js-beautify/js/lib/beautifier.js +0 -5982
  630. package/test/node_modules/js-beautify/js/lib/beautifier.min.js +0 -2
  631. package/test/node_modules/js-beautify/js/lib/beautify-css.js +0 -1675
  632. package/test/node_modules/js-beautify/js/lib/beautify-html.js +0 -3136
  633. package/test/node_modules/js-beautify/js/lib/beautify.js +0 -4020
  634. package/test/node_modules/js-beautify/js/lib/cli.js +0 -705
  635. package/test/node_modules/js-beautify/js/lib/unpackers/javascriptobfuscator_unpacker.js +0 -132
  636. package/test/node_modules/js-beautify/js/lib/unpackers/myobfuscate_unpacker.js +0 -119
  637. package/test/node_modules/js-beautify/js/lib/unpackers/p_a_c_k_e_r_unpacker.js +0 -119
  638. package/test/node_modules/js-beautify/js/lib/unpackers/urlencode_unpacker.js +0 -104
  639. package/test/node_modules/js-beautify/js/src/cli.js +0 -705
  640. package/test/node_modules/js-beautify/js/src/core/directives.js +0 -62
  641. package/test/node_modules/js-beautify/js/src/core/inputscanner.js +0 -192
  642. package/test/node_modules/js-beautify/js/src/core/options.js +0 -193
  643. package/test/node_modules/js-beautify/js/src/core/output.js +0 -419
  644. package/test/node_modules/js-beautify/js/src/core/pattern.js +0 -94
  645. package/test/node_modules/js-beautify/js/src/core/templatablepattern.js +0 -211
  646. package/test/node_modules/js-beautify/js/src/core/token.js +0 -54
  647. package/test/node_modules/js-beautify/js/src/core/tokenizer.js +0 -140
  648. package/test/node_modules/js-beautify/js/src/core/tokenstream.js +0 -78
  649. package/test/node_modules/js-beautify/js/src/core/whitespacepattern.js +0 -105
  650. package/test/node_modules/js-beautify/js/src/css/beautifier.js +0 -529
  651. package/test/node_modules/js-beautify/js/src/css/index.js +0 -42
  652. package/test/node_modules/js-beautify/js/src/css/options.js +0 -56
  653. package/test/node_modules/js-beautify/js/src/css/tokenizer.js +0 -29
  654. package/test/node_modules/js-beautify/js/src/html/beautifier.js +0 -878
  655. package/test/node_modules/js-beautify/js/src/html/index.js +0 -42
  656. package/test/node_modules/js-beautify/js/src/html/options.js +0 -91
  657. package/test/node_modules/js-beautify/js/src/html/tokenizer.js +0 -332
  658. package/test/node_modules/js-beautify/js/src/index.js +0 -44
  659. package/test/node_modules/js-beautify/js/src/javascript/acorn.js +0 -57
  660. package/test/node_modules/js-beautify/js/src/javascript/beautifier.js +0 -1472
  661. package/test/node_modules/js-beautify/js/src/javascript/index.js +0 -42
  662. package/test/node_modules/js-beautify/js/src/javascript/options.js +0 -93
  663. package/test/node_modules/js-beautify/js/src/javascript/tokenizer.js +0 -567
  664. package/test/node_modules/js-beautify/js/src/unpackers/javascriptobfuscator_unpacker.js +0 -132
  665. package/test/node_modules/js-beautify/js/src/unpackers/myobfuscate_unpacker.js +0 -119
  666. package/test/node_modules/js-beautify/js/src/unpackers/p_a_c_k_e_r_unpacker.js +0 -119
  667. package/test/node_modules/js-beautify/js/src/unpackers/urlencode_unpacker.js +0 -104
  668. package/test/node_modules/js-beautify/package.json +0 -72
  669. package/test/node_modules/keygrip/HISTORY.md +0 -25
  670. package/test/node_modules/keygrip/LICENSE +0 -21
  671. package/test/node_modules/keygrip/README.md +0 -103
  672. package/test/node_modules/keygrip/index.js +0 -51
  673. package/test/node_modules/keygrip/package.json +0 -28
  674. package/test/node_modules/kind-of/LICENSE +0 -21
  675. package/test/node_modules/kind-of/README.md +0 -261
  676. package/test/node_modules/kind-of/index.js +0 -116
  677. package/test/node_modules/kind-of/package.json +0 -90
  678. package/test/node_modules/koa/History.md +0 -696
  679. package/test/node_modules/koa/LICENSE +0 -22
  680. package/test/node_modules/koa/Readme.md +0 -289
  681. package/test/node_modules/koa/dist/koa.mjs +0 -4
  682. package/test/node_modules/koa/lib/application.js +0 -314
  683. package/test/node_modules/koa/lib/context.js +0 -251
  684. package/test/node_modules/koa/lib/request.js +0 -726
  685. package/test/node_modules/koa/lib/response.js +0 -588
  686. package/test/node_modules/koa/package.json +0 -89
  687. package/test/node_modules/koa-compose/History.md +0 -60
  688. package/test/node_modules/koa-compose/Readme.md +0 -40
  689. package/test/node_modules/koa-compose/index.js +0 -48
  690. package/test/node_modules/koa-compose/package.json +0 -30
  691. package/test/node_modules/koa-convert/LICENSE +0 -22
  692. package/test/node_modules/koa-convert/README.md +0 -166
  693. package/test/node_modules/koa-convert/index.js +0 -105
  694. package/test/node_modules/koa-convert/package.json +0 -64
  695. package/test/node_modules/koa-send/History.md +0 -133
  696. package/test/node_modules/koa-send/LICENSE +0 -22
  697. package/test/node_modules/koa-send/README.md +0 -109
  698. package/test/node_modules/koa-send/index.js +0 -188
  699. package/test/node_modules/koa-send/package.json +0 -58
  700. package/test/node_modules/koa-views/.eslintrc +0 -14
  701. package/test/node_modules/koa-views/.gitattributes +0 -1
  702. package/test/node_modules/koa-views/.github/workflows/test.yml +0 -20
  703. package/test/node_modules/koa-views/README.md +0 -201
  704. package/test/node_modules/koa-views/history.md +0 -110
  705. package/test/node_modules/koa-views/index.d.ts +0 -62
  706. package/test/node_modules/koa-views/license +0 -22
  707. package/test/node_modules/koa-views/package.json +0 -68
  708. package/test/node_modules/koa-views/src/index.js +0 -98
  709. package/test/node_modules/koa-views/test/.eslintrc +0 -5
  710. package/test/node_modules/koa-views/test/fixtures/basic.ejs +0 -10
  711. package/test/node_modules/koa-views/test/fixtures/basic.foo +0 -1
  712. package/test/node_modules/koa-views/test/fixtures/basic.html +0 -11
  713. package/test/node_modules/koa-views/test/fixtures/basic.pug +0 -9
  714. package/test/node_modules/koa-views/test/fixtures/basic.test.html +0 -11
  715. package/test/node_modules/koa-views/test/fixtures/global-state.pug +0 -9
  716. package/test/node_modules/koa-views/test/fixtures/index.html +0 -10
  717. package/test/node_modules/koa-views/test/fixtures/nunjucks-filter.html +0 -11
  718. package/test/node_modules/koa-views/test/fixtures/state.pug +0 -9
  719. package/test/node_modules/koa-views/test/fixtures/underscore.html +0 -11
  720. package/test/node_modules/koa-views/test/fixtures/view-options-partial.hbs +0 -1
  721. package/test/node_modules/koa-views/test/fixtures/view-options.hbs +0 -4
  722. package/test/node_modules/koa-views/test/index.js +0 -431
  723. package/test/node_modules/koa-views/test-outside/fixtures/basic.ejs +0 -10
  724. package/test/node_modules/lru-cache/LICENSE +0 -15
  725. package/test/node_modules/lru-cache/README.md +0 -158
  726. package/test/node_modules/lru-cache/index.js +0 -468
  727. package/test/node_modules/lru-cache/package.json +0 -36
  728. package/test/node_modules/media-typer/HISTORY.md +0 -22
  729. package/test/node_modules/media-typer/LICENSE +0 -22
  730. package/test/node_modules/media-typer/README.md +0 -81
  731. package/test/node_modules/media-typer/index.js +0 -270
  732. package/test/node_modules/media-typer/package.json +0 -26
  733. package/test/node_modules/mime-db/HISTORY.md +0 -507
  734. package/test/node_modules/mime-db/LICENSE +0 -23
  735. package/test/node_modules/mime-db/README.md +0 -100
  736. package/test/node_modules/mime-db/db.json +0 -8519
  737. package/test/node_modules/mime-db/index.js +0 -12
  738. package/test/node_modules/mime-db/package.json +0 -60
  739. package/test/node_modules/mime-types/HISTORY.md +0 -397
  740. package/test/node_modules/mime-types/LICENSE +0 -23
  741. package/test/node_modules/mime-types/README.md +0 -113
  742. package/test/node_modules/mime-types/index.js +0 -188
  743. package/test/node_modules/mime-types/package.json +0 -44
  744. package/test/node_modules/minimatch/LICENSE +0 -15
  745. package/test/node_modules/minimatch/README.md +0 -230
  746. package/test/node_modules/minimatch/minimatch.js +0 -947
  747. package/test/node_modules/minimatch/package.json +0 -33
  748. package/test/node_modules/ms/index.js +0 -162
  749. package/test/node_modules/ms/license.md +0 -21
  750. package/test/node_modules/ms/package.json +0 -37
  751. package/test/node_modules/ms/readme.md +0 -60
  752. package/test/node_modules/mz/HISTORY.md +0 -66
  753. package/test/node_modules/mz/LICENSE +0 -22
  754. package/test/node_modules/mz/README.md +0 -106
  755. package/test/node_modules/mz/child_process.js +0 -8
  756. package/test/node_modules/mz/crypto.js +0 -9
  757. package/test/node_modules/mz/dns.js +0 -16
  758. package/test/node_modules/mz/fs.js +0 -62
  759. package/test/node_modules/mz/index.js +0 -8
  760. package/test/node_modules/mz/package.json +0 -44
  761. package/test/node_modules/mz/readline.js +0 -64
  762. package/test/node_modules/mz/zlib.js +0 -13
  763. package/test/node_modules/negotiator/HISTORY.md +0 -108
  764. package/test/node_modules/negotiator/LICENSE +0 -24
  765. package/test/node_modules/negotiator/README.md +0 -203
  766. package/test/node_modules/negotiator/index.js +0 -82
  767. package/test/node_modules/negotiator/lib/charset.js +0 -169
  768. package/test/node_modules/negotiator/lib/encoding.js +0 -184
  769. package/test/node_modules/negotiator/lib/language.js +0 -179
  770. package/test/node_modules/negotiator/lib/mediaType.js +0 -294
  771. package/test/node_modules/negotiator/package.json +0 -42
  772. package/test/node_modules/nodemon/LICENSE +0 -21
  773. package/test/node_modules/nodemon/README.md +0 -423
  774. package/test/node_modules/nodemon/bin/nodemon.js +0 -16
  775. package/test/node_modules/nodemon/bin/windows-kill.exe +0 -0
  776. package/test/node_modules/nodemon/doc/cli/authors.txt +0 -8
  777. package/test/node_modules/nodemon/doc/cli/config.txt +0 -44
  778. package/test/node_modules/nodemon/doc/cli/help.txt +0 -29
  779. package/test/node_modules/nodemon/doc/cli/logo.txt +0 -20
  780. package/test/node_modules/nodemon/doc/cli/options.txt +0 -36
  781. package/test/node_modules/nodemon/doc/cli/topics.txt +0 -8
  782. package/test/node_modules/nodemon/doc/cli/usage.txt +0 -3
  783. package/test/node_modules/nodemon/doc/cli/whoami.txt +0 -9
  784. package/test/node_modules/nodemon/lib/cli/index.js +0 -49
  785. package/test/node_modules/nodemon/lib/cli/parse.js +0 -230
  786. package/test/node_modules/nodemon/lib/config/command.js +0 -43
  787. package/test/node_modules/nodemon/lib/config/defaults.js +0 -28
  788. package/test/node_modules/nodemon/lib/config/exec.js +0 -225
  789. package/test/node_modules/nodemon/lib/config/index.js +0 -93
  790. package/test/node_modules/nodemon/lib/config/load.js +0 -256
  791. package/test/node_modules/nodemon/lib/help/index.js +0 -27
  792. package/test/node_modules/nodemon/lib/index.js +0 -1
  793. package/test/node_modules/nodemon/lib/monitor/index.js +0 -4
  794. package/test/node_modules/nodemon/lib/monitor/match.js +0 -276
  795. package/test/node_modules/nodemon/lib/monitor/run.js +0 -541
  796. package/test/node_modules/nodemon/lib/monitor/signals.js +0 -34
  797. package/test/node_modules/nodemon/lib/monitor/watch.js +0 -239
  798. package/test/node_modules/nodemon/lib/nodemon.js +0 -311
  799. package/test/node_modules/nodemon/lib/rules/add.js +0 -89
  800. package/test/node_modules/nodemon/lib/rules/index.js +0 -53
  801. package/test/node_modules/nodemon/lib/rules/parse.js +0 -43
  802. package/test/node_modules/nodemon/lib/spawn.js +0 -73
  803. package/test/node_modules/nodemon/lib/utils/bus.js +0 -44
  804. package/test/node_modules/nodemon/lib/utils/clone.js +0 -40
  805. package/test/node_modules/nodemon/lib/utils/colour.js +0 -26
  806. package/test/node_modules/nodemon/lib/utils/index.js +0 -102
  807. package/test/node_modules/nodemon/lib/utils/log.js +0 -82
  808. package/test/node_modules/nodemon/lib/utils/merge.js +0 -47
  809. package/test/node_modules/nodemon/lib/version.js +0 -100
  810. package/test/node_modules/nodemon/node_modules/debug/CHANGELOG.md +0 -395
  811. package/test/node_modules/nodemon/node_modules/debug/LICENSE +0 -19
  812. package/test/node_modules/nodemon/node_modules/debug/README.md +0 -437
  813. package/test/node_modules/nodemon/node_modules/debug/node.js +0 -1
  814. package/test/node_modules/nodemon/node_modules/debug/package.json +0 -51
  815. package/test/node_modules/nodemon/node_modules/debug/src/browser.js +0 -180
  816. package/test/node_modules/nodemon/node_modules/debug/src/common.js +0 -249
  817. package/test/node_modules/nodemon/node_modules/debug/src/index.js +0 -12
  818. package/test/node_modules/nodemon/node_modules/debug/src/node.js +0 -177
  819. package/test/node_modules/nodemon/node_modules/has-flag/index.js +0 -8
  820. package/test/node_modules/nodemon/node_modules/has-flag/license +0 -9
  821. package/test/node_modules/nodemon/node_modules/has-flag/package.json +0 -44
  822. package/test/node_modules/nodemon/node_modules/has-flag/readme.md +0 -70
  823. package/test/node_modules/nodemon/node_modules/supports-color/browser.js +0 -5
  824. package/test/node_modules/nodemon/node_modules/supports-color/index.js +0 -131
  825. package/test/node_modules/nodemon/node_modules/supports-color/license +0 -9
  826. package/test/node_modules/nodemon/node_modules/supports-color/package.json +0 -53
  827. package/test/node_modules/nodemon/node_modules/supports-color/readme.md +0 -66
  828. package/test/node_modules/nodemon/package.json +0 -74
  829. package/test/node_modules/nopt/LICENSE +0 -15
  830. package/test/node_modules/nopt/README.md +0 -213
  831. package/test/node_modules/nopt/bin/nopt.js +0 -56
  832. package/test/node_modules/nopt/lib/nopt.js +0 -515
  833. package/test/node_modules/nopt/package.json +0 -53
  834. package/test/node_modules/normalize-path/LICENSE +0 -21
  835. package/test/node_modules/normalize-path/README.md +0 -127
  836. package/test/node_modules/normalize-path/index.js +0 -35
  837. package/test/node_modules/normalize-path/package.json +0 -77
  838. package/test/node_modules/object-assign/index.js +0 -90
  839. package/test/node_modules/object-assign/license +0 -21
  840. package/test/node_modules/object-assign/package.json +0 -42
  841. package/test/node_modules/object-assign/readme.md +0 -61
  842. package/test/node_modules/on-finished/HISTORY.md +0 -98
  843. package/test/node_modules/on-finished/LICENSE +0 -23
  844. package/test/node_modules/on-finished/README.md +0 -162
  845. package/test/node_modules/on-finished/index.js +0 -234
  846. package/test/node_modules/on-finished/package.json +0 -39
  847. package/test/node_modules/once/LICENSE +0 -15
  848. package/test/node_modules/once/README.md +0 -79
  849. package/test/node_modules/once/once.js +0 -42
  850. package/test/node_modules/once/package.json +0 -33
  851. package/test/node_modules/only/History.md +0 -5
  852. package/test/node_modules/only/Makefile +0 -7
  853. package/test/node_modules/only/Readme.md +0 -58
  854. package/test/node_modules/only/index.js +0 -10
  855. package/test/node_modules/only/package.json +0 -14
  856. package/test/node_modules/parseurl/HISTORY.md +0 -58
  857. package/test/node_modules/parseurl/LICENSE +0 -24
  858. package/test/node_modules/parseurl/README.md +0 -133
  859. package/test/node_modules/parseurl/index.js +0 -158
  860. package/test/node_modules/parseurl/package.json +0 -40
  861. package/test/node_modules/path-is-absolute/index.js +0 -20
  862. package/test/node_modules/path-is-absolute/license +0 -21
  863. package/test/node_modules/path-is-absolute/package.json +0 -43
  864. package/test/node_modules/path-is-absolute/readme.md +0 -59
  865. package/test/node_modules/picomatch/CHANGELOG.md +0 -136
  866. package/test/node_modules/picomatch/LICENSE +0 -21
  867. package/test/node_modules/picomatch/README.md +0 -708
  868. package/test/node_modules/picomatch/index.js +0 -3
  869. package/test/node_modules/picomatch/lib/constants.js +0 -179
  870. package/test/node_modules/picomatch/lib/parse.js +0 -1091
  871. package/test/node_modules/picomatch/lib/picomatch.js +0 -342
  872. package/test/node_modules/picomatch/lib/scan.js +0 -391
  873. package/test/node_modules/picomatch/lib/utils.js +0 -64
  874. package/test/node_modules/picomatch/package.json +0 -81
  875. package/test/node_modules/pify/index.js +0 -68
  876. package/test/node_modules/pify/license +0 -9
  877. package/test/node_modules/pify/package.json +0 -51
  878. package/test/node_modules/pify/readme.md +0 -145
  879. package/test/node_modules/pretty/LICENSE +0 -21
  880. package/test/node_modules/pretty/README.md +0 -105
  881. package/test/node_modules/pretty/index.js +0 -45
  882. package/test/node_modules/pretty/package.json +0 -54
  883. package/test/node_modules/proto-list/LICENSE +0 -15
  884. package/test/node_modules/proto-list/README.md +0 -3
  885. package/test/node_modules/proto-list/package.json +0 -18
  886. package/test/node_modules/proto-list/proto-list.js +0 -88
  887. package/test/node_modules/proto-list/test/basic.js +0 -61
  888. package/test/node_modules/pseudomap/LICENSE +0 -15
  889. package/test/node_modules/pseudomap/README.md +0 -60
  890. package/test/node_modules/pseudomap/map.js +0 -9
  891. package/test/node_modules/pseudomap/package.json +0 -25
  892. package/test/node_modules/pseudomap/pseudomap.js +0 -113
  893. package/test/node_modules/pseudomap/test/basic.js +0 -86
  894. package/test/node_modules/pstree.remy/.travis.yml +0 -8
  895. package/test/node_modules/pstree.remy/LICENSE +0 -7
  896. package/test/node_modules/pstree.remy/README.md +0 -26
  897. package/test/node_modules/pstree.remy/lib/index.js +0 -37
  898. package/test/node_modules/pstree.remy/lib/tree.js +0 -37
  899. package/test/node_modules/pstree.remy/lib/utils.js +0 -53
  900. package/test/node_modules/pstree.remy/package.json +0 -33
  901. package/test/node_modules/pstree.remy/tests/fixtures/index.js +0 -13
  902. package/test/node_modules/pstree.remy/tests/fixtures/out1 +0 -10
  903. package/test/node_modules/pstree.remy/tests/fixtures/out2 +0 -29
  904. package/test/node_modules/pstree.remy/tests/index.test.js +0 -51
  905. package/test/node_modules/readdirp/LICENSE +0 -21
  906. package/test/node_modules/readdirp/README.md +0 -122
  907. package/test/node_modules/readdirp/index.d.ts +0 -43
  908. package/test/node_modules/readdirp/index.js +0 -287
  909. package/test/node_modules/readdirp/package.json +0 -122
  910. package/test/node_modules/resolve-path/HISTORY.md +0 -66
  911. package/test/node_modules/resolve-path/LICENSE +0 -23
  912. package/test/node_modules/resolve-path/README.md +0 -111
  913. package/test/node_modules/resolve-path/index.js +0 -88
  914. package/test/node_modules/resolve-path/node_modules/depd/History.md +0 -96
  915. package/test/node_modules/resolve-path/node_modules/depd/LICENSE +0 -22
  916. package/test/node_modules/resolve-path/node_modules/depd/Readme.md +0 -280
  917. package/test/node_modules/resolve-path/node_modules/depd/index.js +0 -522
  918. package/test/node_modules/resolve-path/node_modules/depd/lib/browser/index.js +0 -77
  919. package/test/node_modules/resolve-path/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
  920. package/test/node_modules/resolve-path/node_modules/depd/lib/compat/event-listener-count.js +0 -22
  921. package/test/node_modules/resolve-path/node_modules/depd/lib/compat/index.js +0 -79
  922. package/test/node_modules/resolve-path/node_modules/depd/package.json +0 -41
  923. package/test/node_modules/resolve-path/node_modules/http-errors/HISTORY.md +0 -132
  924. package/test/node_modules/resolve-path/node_modules/http-errors/LICENSE +0 -23
  925. package/test/node_modules/resolve-path/node_modules/http-errors/README.md +0 -135
  926. package/test/node_modules/resolve-path/node_modules/http-errors/index.js +0 -260
  927. package/test/node_modules/resolve-path/node_modules/http-errors/package.json +0 -48
  928. package/test/node_modules/resolve-path/node_modules/inherits/LICENSE +0 -16
  929. package/test/node_modules/resolve-path/node_modules/inherits/README.md +0 -42
  930. package/test/node_modules/resolve-path/node_modules/inherits/inherits.js +0 -7
  931. package/test/node_modules/resolve-path/node_modules/inherits/inherits_browser.js +0 -23
  932. package/test/node_modules/resolve-path/node_modules/inherits/package.json +0 -29
  933. package/test/node_modules/resolve-path/node_modules/setprototypeof/LICENSE +0 -13
  934. package/test/node_modules/resolve-path/node_modules/setprototypeof/README.md +0 -26
  935. package/test/node_modules/resolve-path/node_modules/setprototypeof/index.d.ts +0 -2
  936. package/test/node_modules/resolve-path/node_modules/setprototypeof/index.js +0 -15
  937. package/test/node_modules/resolve-path/node_modules/setprototypeof/package.json +0 -25
  938. package/test/node_modules/resolve-path/package.json +0 -46
  939. package/test/node_modules/safe-buffer/LICENSE +0 -21
  940. package/test/node_modules/safe-buffer/README.md +0 -584
  941. package/test/node_modules/safe-buffer/index.d.ts +0 -187
  942. package/test/node_modules/safe-buffer/index.js +0 -65
  943. package/test/node_modules/safe-buffer/package.json +0 -51
  944. package/test/node_modules/semver/CHANGELOG.md +0 -39
  945. package/test/node_modules/semver/LICENSE +0 -15
  946. package/test/node_modules/semver/README.md +0 -412
  947. package/test/node_modules/semver/bin/semver +0 -160
  948. package/test/node_modules/semver/package.json +0 -28
  949. package/test/node_modules/semver/range.bnf +0 -16
  950. package/test/node_modules/semver/semver.js +0 -1483
  951. package/test/node_modules/setprototypeof/LICENSE +0 -13
  952. package/test/node_modules/setprototypeof/README.md +0 -31
  953. package/test/node_modules/setprototypeof/index.d.ts +0 -2
  954. package/test/node_modules/setprototypeof/index.js +0 -17
  955. package/test/node_modules/setprototypeof/package.json +0 -38
  956. package/test/node_modules/setprototypeof/test/index.js +0 -24
  957. package/test/node_modules/sigmund/LICENSE +0 -15
  958. package/test/node_modules/sigmund/README.md +0 -53
  959. package/test/node_modules/sigmund/bench.js +0 -283
  960. package/test/node_modules/sigmund/package.json +0 -30
  961. package/test/node_modules/sigmund/sigmund.js +0 -39
  962. package/test/node_modules/sigmund/test/basic.js +0 -24
  963. package/test/node_modules/simple-update-notifier/LICENSE +0 -21
  964. package/test/node_modules/simple-update-notifier/README.md +0 -82
  965. package/test/node_modules/simple-update-notifier/build/index.d.ts +0 -13
  966. package/test/node_modules/simple-update-notifier/build/index.js +0 -217
  967. package/test/node_modules/simple-update-notifier/node_modules/semver/CHANGELOG.md +0 -74
  968. package/test/node_modules/simple-update-notifier/node_modules/semver/LICENSE +0 -15
  969. package/test/node_modules/simple-update-notifier/node_modules/semver/README.md +0 -499
  970. package/test/node_modules/simple-update-notifier/node_modules/semver/bin/semver.js +0 -173
  971. package/test/node_modules/simple-update-notifier/node_modules/semver/classes/comparator.js +0 -139
  972. package/test/node_modules/simple-update-notifier/node_modules/semver/classes/index.js +0 -5
  973. package/test/node_modules/simple-update-notifier/node_modules/semver/classes/range.js +0 -448
  974. package/test/node_modules/simple-update-notifier/node_modules/semver/classes/semver.js +0 -290
  975. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/clean.js +0 -6
  976. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/cmp.js +0 -48
  977. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/coerce.js +0 -51
  978. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-build.js +0 -7
  979. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare-loose.js +0 -3
  980. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/compare.js +0 -5
  981. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/diff.js +0 -25
  982. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/eq.js +0 -3
  983. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gt.js +0 -3
  984. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/gte.js +0 -3
  985. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/inc.js +0 -15
  986. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lt.js +0 -3
  987. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/lte.js +0 -3
  988. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/major.js +0 -3
  989. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/minor.js +0 -3
  990. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/neq.js +0 -3
  991. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/parse.js +0 -37
  992. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/patch.js +0 -3
  993. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/prerelease.js +0 -6
  994. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rcompare.js +0 -3
  995. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/rsort.js +0 -3
  996. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/satisfies.js +0 -10
  997. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/sort.js +0 -3
  998. package/test/node_modules/simple-update-notifier/node_modules/semver/functions/valid.js +0 -6
  999. package/test/node_modules/simple-update-notifier/node_modules/semver/index.js +0 -64
  1000. package/test/node_modules/simple-update-notifier/node_modules/semver/internal/constants.js +0 -17
  1001. package/test/node_modules/simple-update-notifier/node_modules/semver/internal/debug.js +0 -9
  1002. package/test/node_modules/simple-update-notifier/node_modules/semver/internal/identifiers.js +0 -23
  1003. package/test/node_modules/simple-update-notifier/node_modules/semver/internal/re.js +0 -179
  1004. package/test/node_modules/simple-update-notifier/node_modules/semver/package.json +0 -34
  1005. package/test/node_modules/simple-update-notifier/node_modules/semver/range.bnf +0 -16
  1006. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/gtr.js +0 -4
  1007. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/intersects.js +0 -7
  1008. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/ltr.js +0 -4
  1009. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/max-satisfying.js +0 -25
  1010. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-satisfying.js +0 -24
  1011. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/min-version.js +0 -57
  1012. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/outside.js +0 -80
  1013. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/to-comparators.js +0 -8
  1014. package/test/node_modules/simple-update-notifier/node_modules/semver/ranges/valid.js +0 -11
  1015. package/test/node_modules/simple-update-notifier/package.json +0 -97
  1016. package/test/node_modules/simple-update-notifier/src/borderedText.ts +0 -12
  1017. package/test/node_modules/simple-update-notifier/src/cache.spec.ts +0 -17
  1018. package/test/node_modules/simple-update-notifier/src/cache.ts +0 -44
  1019. package/test/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +0 -35
  1020. package/test/node_modules/simple-update-notifier/src/getDistVersion.ts +0 -29
  1021. package/test/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +0 -82
  1022. package/test/node_modules/simple-update-notifier/src/hasNewVersion.ts +0 -40
  1023. package/test/node_modules/simple-update-notifier/src/index.spec.ts +0 -27
  1024. package/test/node_modules/simple-update-notifier/src/index.ts +0 -34
  1025. package/test/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +0 -12
  1026. package/test/node_modules/simple-update-notifier/src/types.ts +0 -8
  1027. package/test/node_modules/statuses/HISTORY.md +0 -65
  1028. package/test/node_modules/statuses/LICENSE +0 -23
  1029. package/test/node_modules/statuses/README.md +0 -127
  1030. package/test/node_modules/statuses/codes.json +0 -66
  1031. package/test/node_modules/statuses/index.js +0 -113
  1032. package/test/node_modules/statuses/package.json +0 -48
  1033. package/test/node_modules/supports-color/browser.js +0 -5
  1034. package/test/node_modules/supports-color/index.js +0 -135
  1035. package/test/node_modules/supports-color/license +0 -9
  1036. package/test/node_modules/supports-color/package.json +0 -53
  1037. package/test/node_modules/supports-color/readme.md +0 -76
  1038. package/test/node_modules/thenify/History.md +0 -11
  1039. package/test/node_modules/thenify/LICENSE +0 -22
  1040. package/test/node_modules/thenify/README.md +0 -120
  1041. package/test/node_modules/thenify/index.js +0 -77
  1042. package/test/node_modules/thenify/package.json +0 -31
  1043. package/test/node_modules/thenify-all/History.md +0 -11
  1044. package/test/node_modules/thenify-all/LICENSE +0 -22
  1045. package/test/node_modules/thenify-all/README.md +0 -66
  1046. package/test/node_modules/thenify-all/index.js +0 -73
  1047. package/test/node_modules/thenify-all/package.json +0 -34
  1048. package/test/node_modules/to-regex-range/LICENSE +0 -21
  1049. package/test/node_modules/to-regex-range/README.md +0 -305
  1050. package/test/node_modules/to-regex-range/index.js +0 -288
  1051. package/test/node_modules/to-regex-range/package.json +0 -88
  1052. package/test/node_modules/toidentifier/HISTORY.md +0 -9
  1053. package/test/node_modules/toidentifier/LICENSE +0 -21
  1054. package/test/node_modules/toidentifier/README.md +0 -61
  1055. package/test/node_modules/toidentifier/index.js +0 -32
  1056. package/test/node_modules/toidentifier/package.json +0 -38
  1057. package/test/node_modules/touch/LICENSE +0 -15
  1058. package/test/node_modules/touch/README.md +0 -52
  1059. package/test/node_modules/touch/bin/nodetouch.js +0 -112
  1060. package/test/node_modules/touch/index.js +0 -224
  1061. package/test/node_modules/touch/node_modules/nopt/LICENSE +0 -23
  1062. package/test/node_modules/touch/node_modules/nopt/README.md +0 -208
  1063. package/test/node_modules/touch/node_modules/nopt/bin/nopt.js +0 -44
  1064. package/test/node_modules/touch/node_modules/nopt/examples/my-program.js +0 -30
  1065. package/test/node_modules/touch/node_modules/nopt/lib/nopt.js +0 -552
  1066. package/test/node_modules/touch/node_modules/nopt/package.json +0 -12
  1067. package/test/node_modules/touch/package.json +0 -28
  1068. package/test/node_modules/tsscmp/.travis.yml +0 -18
  1069. package/test/node_modules/tsscmp/LICENSE +0 -21
  1070. package/test/node_modules/tsscmp/README.md +0 -48
  1071. package/test/node_modules/tsscmp/appveyor.yml +0 -29
  1072. package/test/node_modules/tsscmp/lib/index.js +0 -38
  1073. package/test/node_modules/tsscmp/package.json +0 -29
  1074. package/test/node_modules/tsscmp/test/benchmark/index.js +0 -30
  1075. package/test/node_modules/tsscmp/test/unit/index.js +0 -69
  1076. package/test/node_modules/type-is/HISTORY.md +0 -259
  1077. package/test/node_modules/type-is/LICENSE +0 -23
  1078. package/test/node_modules/type-is/README.md +0 -170
  1079. package/test/node_modules/type-is/index.js +0 -266
  1080. package/test/node_modules/type-is/package.json +0 -45
  1081. package/test/node_modules/undefsafe/.github/workflows/release.yml +0 -25
  1082. package/test/node_modules/undefsafe/.jscsrc +0 -13
  1083. package/test/node_modules/undefsafe/.jshintrc +0 -16
  1084. package/test/node_modules/undefsafe/.travis.yml +0 -18
  1085. package/test/node_modules/undefsafe/LICENSE +0 -22
  1086. package/test/node_modules/undefsafe/README.md +0 -63
  1087. package/test/node_modules/undefsafe/example.js +0 -14
  1088. package/test/node_modules/undefsafe/lib/undefsafe.js +0 -125
  1089. package/test/node_modules/undefsafe/package.json +0 -34
  1090. package/test/node_modules/vary/HISTORY.md +0 -39
  1091. package/test/node_modules/vary/LICENSE +0 -22
  1092. package/test/node_modules/vary/README.md +0 -101
  1093. package/test/node_modules/vary/index.js +0 -149
  1094. package/test/node_modules/vary/package.json +0 -43
  1095. package/test/node_modules/wrappy/LICENSE +0 -15
  1096. package/test/node_modules/wrappy/README.md +0 -36
  1097. package/test/node_modules/wrappy/package.json +0 -29
  1098. package/test/node_modules/wrappy/wrappy.js +0 -33
  1099. package/test/node_modules/yallist/LICENSE +0 -15
  1100. package/test/node_modules/yallist/README.md +0 -204
  1101. package/test/node_modules/yallist/iterator.js +0 -7
  1102. package/test/node_modules/yallist/package.json +0 -29
  1103. package/test/node_modules/yallist/yallist.js +0 -370
  1104. package/test/node_modules/ylru/History.md +0 -42
  1105. package/test/node_modules/ylru/LICENSE +0 -23
  1106. package/test/node_modules/ylru/README.md +0 -99
  1107. package/test/node_modules/ylru/index.d.ts +0 -18
  1108. package/test/node_modules/ylru/index.js +0 -106
  1109. package/test/node_modules/ylru/package.json +0 -52
  1110. package/test/package-lock.json +0 -2212
  1111. package/test/package.json +0 -17
  1112. package/test/public/api +0 -1
  1113. package/test/public/cartella nuova/ewewew.html +0 -12
  1114. package/test/public/cartella nuova/prova.ejs +0 -12
  1115. package/test/public/index.ejs +0 -12
  1116. package/test/public/index.html +0 -12
  1117. package/test/public/proma_template.ejs +0 -16
  1118. package/test/public/un altro file.html +0 -12
  1119. package/test/public/un_file.html +0 -12
  1120. package/test/test.js +0 -63
@@ -1,4020 +0,0 @@
1
- /* AUTO-GENERATED. DO NOT MODIFY. */
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
- JS Beautifier
29
- ---------------
30
-
31
-
32
- Written by Einar Lielmanis, <einar@beautifier.io>
33
- https://beautifier.io/
34
-
35
- Originally converted to javascript by Vital, <vital76@gmail.com>
36
- "End braces on own line" added by Chris J. Shull, <chrisjshull@gmail.com>
37
- Parsing improvements for brace-less statements by Liam Newman <bitwiseman@beautifier.io>
38
-
39
-
40
- Usage:
41
- js_beautify(js_source_text);
42
- js_beautify(js_source_text, options);
43
-
44
- The options are:
45
- indent_size (default 4) - indentation size,
46
- indent_char (default space) - character to indent with,
47
- preserve_newlines (default true) - whether existing line breaks should be preserved,
48
- max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,
49
-
50
- jslint_happy (default false) - if true, then jslint-stricter mode is enforced.
51
-
52
- jslint_happy !jslint_happy
53
- ---------------------------------
54
- function () function()
55
-
56
- switch () { switch() {
57
- case 1: case 1:
58
- break; break;
59
- } }
60
-
61
- space_after_anon_function (default false) - should the space before an anonymous function's parens be added, "function()" vs "function ()",
62
- NOTE: This option is overriden by jslint_happy (i.e. if jslint_happy is true, space_after_anon_function is true by design)
63
-
64
- brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" | any of the former + ",preserve-inline"
65
- put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
66
- preserve-inline will try to preserve inline blocks of curly braces
67
-
68
- space_before_conditional (default true) - should the space before conditional statement be added, "if(true)" vs "if (true)",
69
-
70
- unescape_strings (default false) - should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
71
-
72
- wrap_line_length (default unlimited) - lines should wrap at next opportunity after this number of characters.
73
- NOTE: This is not a hard limit. Lines will continue until a point where a newline would
74
- be preserved if it were present.
75
-
76
- end_with_newline (default false) - end output with a newline
77
-
78
-
79
- e.g
80
-
81
- js_beautify(js_source_text, {
82
- 'indent_size': 1,
83
- 'indent_char': '\t'
84
- });
85
-
86
- */
87
-
88
- (function() {
89
-
90
- /* GENERATED_BUILD_OUTPUT */
91
- var legacy_beautify_js;
92
- /******/ (function() { // webpackBootstrap
93
- /******/ "use strict";
94
- /******/ var __webpack_modules__ = ([
95
- /* 0 */
96
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
97
-
98
- /*jshint node:true */
99
- /*
100
-
101
- The MIT License (MIT)
102
-
103
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
104
-
105
- Permission is hereby granted, free of charge, to any person
106
- obtaining a copy of this software and associated documentation files
107
- (the "Software"), to deal in the Software without restriction,
108
- including without limitation the rights to use, copy, modify, merge,
109
- publish, distribute, sublicense, and/or sell copies of the Software,
110
- and to permit persons to whom the Software is furnished to do so,
111
- subject to the following conditions:
112
-
113
- The above copyright notice and this permission notice shall be
114
- included in all copies or substantial portions of the Software.
115
-
116
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
117
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
118
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
119
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
120
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
121
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
122
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
123
- SOFTWARE.
124
- */
125
-
126
-
127
-
128
- var Beautifier = (__webpack_require__(1).Beautifier),
129
- Options = (__webpack_require__(5).Options);
130
-
131
- function js_beautify(js_source_text, options) {
132
- var beautifier = new Beautifier(js_source_text, options);
133
- return beautifier.beautify();
134
- }
135
-
136
- module.exports = js_beautify;
137
- module.exports.defaultOptions = function() {
138
- return new Options();
139
- };
140
-
141
-
142
- /***/ }),
143
- /* 1 */
144
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
145
-
146
- /*jshint node:true */
147
- /*
148
-
149
- The MIT License (MIT)
150
-
151
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
152
-
153
- Permission is hereby granted, free of charge, to any person
154
- obtaining a copy of this software and associated documentation files
155
- (the "Software"), to deal in the Software without restriction,
156
- including without limitation the rights to use, copy, modify, merge,
157
- publish, distribute, sublicense, and/or sell copies of the Software,
158
- and to permit persons to whom the Software is furnished to do so,
159
- subject to the following conditions:
160
-
161
- The above copyright notice and this permission notice shall be
162
- included in all copies or substantial portions of the Software.
163
-
164
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
165
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
166
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
167
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
168
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
169
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
170
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
171
- SOFTWARE.
172
- */
173
-
174
-
175
-
176
- var Output = (__webpack_require__(2).Output);
177
- var Token = (__webpack_require__(3).Token);
178
- var acorn = __webpack_require__(4);
179
- var Options = (__webpack_require__(5).Options);
180
- var Tokenizer = (__webpack_require__(7).Tokenizer);
181
- var line_starters = (__webpack_require__(7).line_starters);
182
- var positionable_operators = (__webpack_require__(7).positionable_operators);
183
- var TOKEN = (__webpack_require__(7).TOKEN);
184
-
185
-
186
- function in_array(what, arr) {
187
- return arr.indexOf(what) !== -1;
188
- }
189
-
190
- function ltrim(s) {
191
- return s.replace(/^\s+/g, '');
192
- }
193
-
194
- function generateMapFromStrings(list) {
195
- var result = {};
196
- for (var x = 0; x < list.length; x++) {
197
- // make the mapped names underscored instead of dash
198
- result[list[x].replace(/-/g, '_')] = list[x];
199
- }
200
- return result;
201
- }
202
-
203
- function reserved_word(token, word) {
204
- return token && token.type === TOKEN.RESERVED && token.text === word;
205
- }
206
-
207
- function reserved_array(token, words) {
208
- return token && token.type === TOKEN.RESERVED && in_array(token.text, words);
209
- }
210
- // Unsure of what they mean, but they work. Worth cleaning up in future.
211
- var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];
212
-
213
- var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
214
-
215
- // Generate map from array
216
- var OPERATOR_POSITION = generateMapFromStrings(validPositionValues);
217
-
218
- var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];
219
-
220
- var MODE = {
221
- BlockStatement: 'BlockStatement', // 'BLOCK'
222
- Statement: 'Statement', // 'STATEMENT'
223
- ObjectLiteral: 'ObjectLiteral', // 'OBJECT',
224
- ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',
225
- ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',
226
- Conditional: 'Conditional', //'(COND-EXPRESSION)',
227
- Expression: 'Expression' //'(EXPRESSION)'
228
- };
229
-
230
- function remove_redundant_indentation(output, frame) {
231
- // This implementation is effective but has some issues:
232
- // - can cause line wrap to happen too soon due to indent removal
233
- // after wrap points are calculated
234
- // These issues are minor compared to ugly indentation.
235
-
236
- if (frame.multiline_frame ||
237
- frame.mode === MODE.ForInitializer ||
238
- frame.mode === MODE.Conditional) {
239
- return;
240
- }
241
-
242
- // remove one indent from each line inside this section
243
- output.remove_indent(frame.start_line_index);
244
- }
245
-
246
- // we could use just string.split, but
247
- // IE doesn't like returning empty strings
248
- function split_linebreaks(s) {
249
- //return s.split(/\x0d\x0a|\x0a/);
250
-
251
- s = s.replace(acorn.allLineBreaks, '\n');
252
- var out = [],
253
- idx = s.indexOf("\n");
254
- while (idx !== -1) {
255
- out.push(s.substring(0, idx));
256
- s = s.substring(idx + 1);
257
- idx = s.indexOf("\n");
258
- }
259
- if (s.length) {
260
- out.push(s);
261
- }
262
- return out;
263
- }
264
-
265
- function is_array(mode) {
266
- return mode === MODE.ArrayLiteral;
267
- }
268
-
269
- function is_expression(mode) {
270
- return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);
271
- }
272
-
273
- function all_lines_start_with(lines, c) {
274
- for (var i = 0; i < lines.length; i++) {
275
- var line = lines[i].trim();
276
- if (line.charAt(0) !== c) {
277
- return false;
278
- }
279
- }
280
- return true;
281
- }
282
-
283
- function each_line_matches_indent(lines, indent) {
284
- var i = 0,
285
- len = lines.length,
286
- line;
287
- for (; i < len; i++) {
288
- line = lines[i];
289
- // allow empty lines to pass through
290
- if (line && line.indexOf(indent) !== 0) {
291
- return false;
292
- }
293
- }
294
- return true;
295
- }
296
-
297
-
298
- function Beautifier(source_text, options) {
299
- options = options || {};
300
- this._source_text = source_text || '';
301
-
302
- this._output = null;
303
- this._tokens = null;
304
- this._last_last_text = null;
305
- this._flags = null;
306
- this._previous_flags = null;
307
-
308
- this._flag_store = null;
309
- this._options = new Options(options);
310
- }
311
-
312
- Beautifier.prototype.create_flags = function(flags_base, mode) {
313
- var next_indent_level = 0;
314
- if (flags_base) {
315
- next_indent_level = flags_base.indentation_level;
316
- if (!this._output.just_added_newline() &&
317
- flags_base.line_indent_level > next_indent_level) {
318
- next_indent_level = flags_base.line_indent_level;
319
- }
320
- }
321
-
322
- var next_flags = {
323
- mode: mode,
324
- parent: flags_base,
325
- last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text
326
- last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed
327
- declaration_statement: false,
328
- declaration_assignment: false,
329
- multiline_frame: false,
330
- inline_frame: false,
331
- if_block: false,
332
- else_block: false,
333
- class_start_block: false, // class A { INSIDE HERE } or class B extends C { INSIDE HERE }
334
- do_block: false,
335
- do_while: false,
336
- import_block: false,
337
- in_case_statement: false, // switch(..){ INSIDE HERE }
338
- in_case: false, // we're on the exact line with "case 0:"
339
- case_body: false, // the indented case-action block
340
- case_block: false, // the indented case-action block is wrapped with {}
341
- indentation_level: next_indent_level,
342
- alignment: 0,
343
- line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,
344
- start_line_index: this._output.get_line_number(),
345
- ternary_depth: 0
346
- };
347
- return next_flags;
348
- };
349
-
350
- Beautifier.prototype._reset = function(source_text) {
351
- var baseIndentString = source_text.match(/^[\t ]*/)[0];
352
-
353
- this._last_last_text = ''; // pre-last token text
354
- this._output = new Output(this._options, baseIndentString);
355
-
356
- // If testing the ignore directive, start with output disable set to true
357
- this._output.raw = this._options.test_output_raw;
358
-
359
-
360
- // Stack of parsing/formatting states, including MODE.
361
- // We tokenize, parse, and output in an almost purely a forward-only stream of token input
362
- // and formatted output. This makes the beautifier less accurate than full parsers
363
- // but also far more tolerant of syntax errors.
364
- //
365
- // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type
366
- // MODE.BlockStatement on the the stack, even though it could be object literal. If we later
367
- // encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";",
368
- // most full parsers would die, but the beautifier gracefully falls back to
369
- // MODE.BlockStatement and continues on.
370
- this._flag_store = [];
371
- this.set_mode(MODE.BlockStatement);
372
- var tokenizer = new Tokenizer(source_text, this._options);
373
- this._tokens = tokenizer.tokenize();
374
- return source_text;
375
- };
376
-
377
- Beautifier.prototype.beautify = function() {
378
- // if disabled, return the input unchanged.
379
- if (this._options.disabled) {
380
- return this._source_text;
381
- }
382
-
383
- var sweet_code;
384
- var source_text = this._reset(this._source_text);
385
-
386
- var eol = this._options.eol;
387
- if (this._options.eol === 'auto') {
388
- eol = '\n';
389
- if (source_text && acorn.lineBreak.test(source_text || '')) {
390
- eol = source_text.match(acorn.lineBreak)[0];
391
- }
392
- }
393
-
394
- var current_token = this._tokens.next();
395
- while (current_token) {
396
- this.handle_token(current_token);
397
-
398
- this._last_last_text = this._flags.last_token.text;
399
- this._flags.last_token = current_token;
400
-
401
- current_token = this._tokens.next();
402
- }
403
-
404
- sweet_code = this._output.get_code(eol);
405
-
406
- return sweet_code;
407
- };
408
-
409
- Beautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {
410
- if (current_token.type === TOKEN.START_EXPR) {
411
- this.handle_start_expr(current_token);
412
- } else if (current_token.type === TOKEN.END_EXPR) {
413
- this.handle_end_expr(current_token);
414
- } else if (current_token.type === TOKEN.START_BLOCK) {
415
- this.handle_start_block(current_token);
416
- } else if (current_token.type === TOKEN.END_BLOCK) {
417
- this.handle_end_block(current_token);
418
- } else if (current_token.type === TOKEN.WORD) {
419
- this.handle_word(current_token);
420
- } else if (current_token.type === TOKEN.RESERVED) {
421
- this.handle_word(current_token);
422
- } else if (current_token.type === TOKEN.SEMICOLON) {
423
- this.handle_semicolon(current_token);
424
- } else if (current_token.type === TOKEN.STRING) {
425
- this.handle_string(current_token);
426
- } else if (current_token.type === TOKEN.EQUALS) {
427
- this.handle_equals(current_token);
428
- } else if (current_token.type === TOKEN.OPERATOR) {
429
- this.handle_operator(current_token);
430
- } else if (current_token.type === TOKEN.COMMA) {
431
- this.handle_comma(current_token);
432
- } else if (current_token.type === TOKEN.BLOCK_COMMENT) {
433
- this.handle_block_comment(current_token, preserve_statement_flags);
434
- } else if (current_token.type === TOKEN.COMMENT) {
435
- this.handle_comment(current_token, preserve_statement_flags);
436
- } else if (current_token.type === TOKEN.DOT) {
437
- this.handle_dot(current_token);
438
- } else if (current_token.type === TOKEN.EOF) {
439
- this.handle_eof(current_token);
440
- } else if (current_token.type === TOKEN.UNKNOWN) {
441
- this.handle_unknown(current_token, preserve_statement_flags);
442
- } else {
443
- this.handle_unknown(current_token, preserve_statement_flags);
444
- }
445
- };
446
-
447
- Beautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {
448
- var newlines = current_token.newlines;
449
- var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);
450
-
451
- if (current_token.comments_before) {
452
- var comment_token = current_token.comments_before.next();
453
- while (comment_token) {
454
- // The cleanest handling of inline comments is to treat them as though they aren't there.
455
- // Just continue formatting and the behavior should be logical.
456
- // Also ignore unknown tokens. Again, this should result in better behavior.
457
- this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);
458
- this.handle_token(comment_token, preserve_statement_flags);
459
- comment_token = current_token.comments_before.next();
460
- }
461
- }
462
-
463
- if (keep_whitespace) {
464
- for (var i = 0; i < newlines; i += 1) {
465
- this.print_newline(i > 0, preserve_statement_flags);
466
- }
467
- } else {
468
- if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {
469
- newlines = this._options.max_preserve_newlines;
470
- }
471
-
472
- if (this._options.preserve_newlines) {
473
- if (newlines > 1) {
474
- this.print_newline(false, preserve_statement_flags);
475
- for (var j = 1; j < newlines; j += 1) {
476
- this.print_newline(true, preserve_statement_flags);
477
- }
478
- }
479
- }
480
- }
481
-
482
- };
483
-
484
- var newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];
485
-
486
- Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {
487
- force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;
488
-
489
- // Never wrap the first token on a line
490
- if (this._output.just_added_newline()) {
491
- return;
492
- }
493
-
494
- var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;
495
- var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||
496
- in_array(current_token.text, positionable_operators);
497
-
498
- if (operatorLogicApplies) {
499
- var shouldPrintOperatorNewline = (
500
- in_array(this._flags.last_token.text, positionable_operators) &&
501
- in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)
502
- ) ||
503
- in_array(current_token.text, positionable_operators);
504
- shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;
505
- }
506
-
507
- if (shouldPreserveOrForce) {
508
- this.print_newline(false, true);
509
- } else if (this._options.wrap_line_length) {
510
- if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {
511
- // These tokens should never have a newline inserted
512
- // between them and the following expression.
513
- return;
514
- }
515
- this._output.set_wrap_point();
516
- }
517
- };
518
-
519
- Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {
520
- if (!preserve_statement_flags) {
521
- 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 === '++')) {
522
- var next_token = this._tokens.peek();
523
- while (this._flags.mode === MODE.Statement &&
524
- !(this._flags.if_block && reserved_word(next_token, 'else')) &&
525
- !this._flags.do_block) {
526
- this.restore_mode();
527
- }
528
- }
529
- }
530
-
531
- if (this._output.add_new_line(force_newline)) {
532
- this._flags.multiline_frame = true;
533
- }
534
- };
535
-
536
- Beautifier.prototype.print_token_line_indentation = function(current_token) {
537
- if (this._output.just_added_newline()) {
538
- if (this._options.keep_array_indentation &&
539
- current_token.newlines &&
540
- (current_token.text === '[' || is_array(this._flags.mode))) {
541
- this._output.current_line.set_indent(-1);
542
- this._output.current_line.push(current_token.whitespace_before);
543
- this._output.space_before_token = false;
544
- } else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) {
545
- this._flags.line_indent_level = this._flags.indentation_level;
546
- }
547
- }
548
- };
549
-
550
- Beautifier.prototype.print_token = function(current_token) {
551
- if (this._output.raw) {
552
- this._output.add_raw_token(current_token);
553
- return;
554
- }
555
-
556
- if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&
557
- this._output.just_added_newline()) {
558
- if (this._output.previous_line.last() === ',') {
559
- var popped = this._output.previous_line.pop();
560
- // if the comma was already at the start of the line,
561
- // pull back onto that line and reprint the indentation
562
- if (this._output.previous_line.is_empty()) {
563
- this._output.previous_line.push(popped);
564
- this._output.trim(true);
565
- this._output.current_line.pop();
566
- this._output.trim();
567
- }
568
-
569
- // add the comma in front of the next token
570
- this.print_token_line_indentation(current_token);
571
- this._output.add_token(',');
572
- this._output.space_before_token = true;
573
- }
574
- }
575
-
576
- this.print_token_line_indentation(current_token);
577
- this._output.non_breaking_space = true;
578
- this._output.add_token(current_token.text);
579
- if (this._output.previous_token_wrapped) {
580
- this._flags.multiline_frame = true;
581
- }
582
- };
583
-
584
- Beautifier.prototype.indent = function() {
585
- this._flags.indentation_level += 1;
586
- this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
587
- };
588
-
589
- Beautifier.prototype.deindent = function() {
590
- if (this._flags.indentation_level > 0 &&
591
- ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {
592
- this._flags.indentation_level -= 1;
593
- this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
594
- }
595
- };
596
-
597
- Beautifier.prototype.set_mode = function(mode) {
598
- if (this._flags) {
599
- this._flag_store.push(this._flags);
600
- this._previous_flags = this._flags;
601
- } else {
602
- this._previous_flags = this.create_flags(null, mode);
603
- }
604
-
605
- this._flags = this.create_flags(this._previous_flags, mode);
606
- this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
607
- };
608
-
609
-
610
- Beautifier.prototype.restore_mode = function() {
611
- if (this._flag_store.length > 0) {
612
- this._previous_flags = this._flags;
613
- this._flags = this._flag_store.pop();
614
- if (this._previous_flags.mode === MODE.Statement) {
615
- remove_redundant_indentation(this._output, this._previous_flags);
616
- }
617
- this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
618
- }
619
- };
620
-
621
- Beautifier.prototype.start_of_object_property = function() {
622
- return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (
623
- (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));
624
- };
625
-
626
- Beautifier.prototype.start_of_statement = function(current_token) {
627
- var start = false;
628
- start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;
629
- start = start || reserved_word(this._flags.last_token, 'do');
630
- 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;
631
- start = start || reserved_word(this._flags.last_token, 'else') &&
632
- !(reserved_word(current_token, 'if') && !current_token.comments_before);
633
- start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));
634
- start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&
635
- !this._flags.in_case &&
636
- !(current_token.text === '--' || current_token.text === '++') &&
637
- this._last_last_text !== 'function' &&
638
- current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);
639
- start = start || (this._flags.mode === MODE.ObjectLiteral && (
640
- (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));
641
-
642
- if (start) {
643
- this.set_mode(MODE.Statement);
644
- this.indent();
645
-
646
- this.handle_whitespace_and_comments(current_token, true);
647
-
648
- // Issue #276:
649
- // If starting a new statement with [if, for, while, do], push to a new line.
650
- // if (a) if (b) if(c) d(); else e(); else f();
651
- if (!this.start_of_object_property()) {
652
- this.allow_wrap_or_preserved_newline(current_token,
653
- reserved_array(current_token, ['do', 'for', 'if', 'while']));
654
- }
655
- return true;
656
- }
657
- return false;
658
- };
659
-
660
- Beautifier.prototype.handle_start_expr = function(current_token) {
661
- // The conditional starts the statement if appropriate.
662
- if (!this.start_of_statement(current_token)) {
663
- this.handle_whitespace_and_comments(current_token);
664
- }
665
-
666
- var next_mode = MODE.Expression;
667
- if (current_token.text === '[') {
668
-
669
- if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {
670
- // this is array index specifier, break immediately
671
- // a[x], fn()[x]
672
- if (reserved_array(this._flags.last_token, line_starters)) {
673
- this._output.space_before_token = true;
674
- }
675
- this.print_token(current_token);
676
- this.set_mode(next_mode);
677
- this.indent();
678
- if (this._options.space_in_paren) {
679
- this._output.space_before_token = true;
680
- }
681
- return;
682
- }
683
-
684
- next_mode = MODE.ArrayLiteral;
685
- if (is_array(this._flags.mode)) {
686
- if (this._flags.last_token.text === '[' ||
687
- (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {
688
- // ], [ goes to new line
689
- // }, [ goes to new line
690
- if (!this._options.keep_array_indentation) {
691
- this.print_newline();
692
- }
693
- }
694
- }
695
-
696
- if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
697
- this._output.space_before_token = true;
698
- }
699
- } else {
700
- if (this._flags.last_token.type === TOKEN.RESERVED) {
701
- if (this._flags.last_token.text === 'for') {
702
- this._output.space_before_token = this._options.space_before_conditional;
703
- next_mode = MODE.ForInitializer;
704
- } else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
705
- this._output.space_before_token = this._options.space_before_conditional;
706
- next_mode = MODE.Conditional;
707
- } else if (in_array(this._flags.last_word, ['await', 'async'])) {
708
- // Should be a space between await and an IIFE, or async and an arrow function
709
- this._output.space_before_token = true;
710
- } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {
711
- this._output.space_before_token = false;
712
- } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {
713
- this._output.space_before_token = true;
714
- }
715
- } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
716
- // Support of this kind of newline preservation.
717
- // a = (b &&
718
- // (c || d));
719
- if (!this.start_of_object_property()) {
720
- this.allow_wrap_or_preserved_newline(current_token);
721
- }
722
- } else if (this._flags.last_token.type === TOKEN.WORD) {
723
- this._output.space_before_token = false;
724
-
725
- // function name() vs function name ()
726
- // function* name() vs function* name ()
727
- // async name() vs async name ()
728
- // In ES6, you can also define the method properties of an object
729
- // var obj = {a: function() {}}
730
- // It can be abbreviated
731
- // var obj = {a() {}}
732
- // var obj = { a() {}} vs var obj = { a () {}}
733
- // var obj = { * a() {}} vs var obj = { * a () {}}
734
- var peek_back_two = this._tokens.peek(-3);
735
- if (this._options.space_after_named_function && peek_back_two) {
736
- // peek starts at next character so -1 is current token
737
- var peek_back_three = this._tokens.peek(-4);
738
- if (reserved_array(peek_back_two, ['async', 'function']) ||
739
- (peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) {
740
- this._output.space_before_token = true;
741
- } else if (this._flags.mode === MODE.ObjectLiteral) {
742
- if ((peek_back_two.text === '{' || peek_back_two.text === ',') ||
743
- (peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) {
744
- this._output.space_before_token = true;
745
- }
746
- } else if (this._flags.parent && this._flags.parent.class_start_block) {
747
- this._output.space_before_token = true;
748
- }
749
- }
750
- } else {
751
- // Support preserving wrapped arrow function expressions
752
- // a.b('c',
753
- // () => d.e
754
- // )
755
- this.allow_wrap_or_preserved_newline(current_token);
756
- }
757
-
758
- // function() vs function ()
759
- // yield*() vs yield* ()
760
- // function*() vs function* ()
761
- if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||
762
- (this._flags.last_token.text === '*' &&
763
- (in_array(this._last_last_text, ['function', 'yield']) ||
764
- (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
765
- this._output.space_before_token = this._options.space_after_anon_function;
766
- }
767
- }
768
-
769
- if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {
770
- this.print_newline();
771
- } 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) {
772
- // do nothing on (( and )( and ][ and ]( and .(
773
- // TODO: Consider whether forcing this is required. Review failing tests when removed.
774
- this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);
775
- }
776
-
777
- this.print_token(current_token);
778
- this.set_mode(next_mode);
779
- if (this._options.space_in_paren) {
780
- this._output.space_before_token = true;
781
- }
782
-
783
- // In all cases, if we newline while inside an expression it should be indented.
784
- this.indent();
785
- };
786
-
787
- Beautifier.prototype.handle_end_expr = function(current_token) {
788
- // statements inside expressions are not valid syntax, but...
789
- // statements must all be closed when their container closes
790
- while (this._flags.mode === MODE.Statement) {
791
- this.restore_mode();
792
- }
793
-
794
- this.handle_whitespace_and_comments(current_token);
795
-
796
- if (this._flags.multiline_frame) {
797
- this.allow_wrap_or_preserved_newline(current_token,
798
- current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);
799
- }
800
-
801
- if (this._options.space_in_paren) {
802
- if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {
803
- // () [] no inner space in empty parens like these, ever, ref #320
804
- this._output.trim();
805
- this._output.space_before_token = false;
806
- } else {
807
- this._output.space_before_token = true;
808
- }
809
- }
810
- this.deindent();
811
- this.print_token(current_token);
812
- this.restore_mode();
813
-
814
- remove_redundant_indentation(this._output, this._previous_flags);
815
-
816
- // do {} while () // no statement required after
817
- if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {
818
- this._previous_flags.mode = MODE.Expression;
819
- this._flags.do_block = false;
820
- this._flags.do_while = false;
821
-
822
- }
823
- };
824
-
825
- Beautifier.prototype.handle_start_block = function(current_token) {
826
- this.handle_whitespace_and_comments(current_token);
827
-
828
- // Check if this is should be treated as a ObjectLiteral
829
- var next_token = this._tokens.peek();
830
- var second_token = this._tokens.peek(1);
831
- if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {
832
- this.set_mode(MODE.BlockStatement);
833
- this._flags.in_case_statement = true;
834
- } else if (this._flags.case_body) {
835
- this.set_mode(MODE.BlockStatement);
836
- } else if (second_token && (
837
- (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||
838
- (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))
839
- )) {
840
- // We don't support TypeScript,but we didn't break it for a very long time.
841
- // We'll try to keep not breaking it.
842
- if (in_array(this._last_last_text, ['class', 'interface']) && !in_array(second_token.text, [':', ','])) {
843
- this.set_mode(MODE.BlockStatement);
844
- } else {
845
- this.set_mode(MODE.ObjectLiteral);
846
- }
847
- } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {
848
- // arrow function: (param1, paramN) => { statements }
849
- this.set_mode(MODE.BlockStatement);
850
- } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||
851
- reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])
852
- ) {
853
- // Detecting shorthand function syntax is difficult by scanning forward,
854
- // so check the surrounding context.
855
- // If the block is being returned, imported, export default, passed as arg,
856
- // assigned with = or assigned in a nested object, treat as an ObjectLiteral.
857
- this.set_mode(MODE.ObjectLiteral);
858
- } else {
859
- this.set_mode(MODE.BlockStatement);
860
- }
861
-
862
- if (this._flags.last_token) {
863
- if (reserved_array(this._flags.last_token.previous, ['class', 'extends'])) {
864
- this._flags.class_start_block = true;
865
- }
866
- }
867
-
868
- var empty_braces = !next_token.comments_before && next_token.text === '}';
869
- var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&
870
- this._flags.last_token.type === TOKEN.END_EXPR;
871
-
872
- if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so
873
- {
874
- // search forward for a newline wanted inside this block
875
- var index = 0;
876
- var check_token = null;
877
- this._flags.inline_frame = true;
878
- do {
879
- index += 1;
880
- check_token = this._tokens.peek(index - 1);
881
- if (check_token.newlines) {
882
- this._flags.inline_frame = false;
883
- break;
884
- }
885
- } while (check_token.type !== TOKEN.EOF &&
886
- !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));
887
- }
888
-
889
- if ((this._options.brace_style === "expand" ||
890
- (this._options.brace_style === "none" && current_token.newlines)) &&
891
- !this._flags.inline_frame) {
892
- if (this._flags.last_token.type !== TOKEN.OPERATOR &&
893
- (empty_anonymous_function ||
894
- this._flags.last_token.type === TOKEN.EQUALS ||
895
- (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {
896
- this._output.space_before_token = true;
897
- } else {
898
- this.print_newline(false, true);
899
- }
900
- } else { // collapse || inline_frame
901
- if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {
902
- if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {
903
- this._output.space_before_token = true;
904
- }
905
-
906
- if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {
907
- this.allow_wrap_or_preserved_newline(current_token);
908
- this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;
909
- this._flags.multiline_frame = false;
910
- }
911
- }
912
- if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {
913
- if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) {
914
- this.print_newline();
915
- } else {
916
- this._output.space_before_token = true;
917
- }
918
- }
919
- }
920
- this.print_token(current_token);
921
- this.indent();
922
-
923
- // Except for specific cases, open braces are followed by a new line.
924
- if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) {
925
- this.print_newline();
926
- }
927
- };
928
-
929
- Beautifier.prototype.handle_end_block = function(current_token) {
930
- // statements must all be closed when their container closes
931
- this.handle_whitespace_and_comments(current_token);
932
-
933
- while (this._flags.mode === MODE.Statement) {
934
- this.restore_mode();
935
- }
936
-
937
- var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;
938
-
939
- if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first
940
- this._output.space_before_token = true;
941
- } else if (this._options.brace_style === "expand") {
942
- if (!empty_braces) {
943
- this.print_newline();
944
- }
945
- } else {
946
- // skip {}
947
- if (!empty_braces) {
948
- if (is_array(this._flags.mode) && this._options.keep_array_indentation) {
949
- // we REALLY need a newline here, but newliner would skip that
950
- this._options.keep_array_indentation = false;
951
- this.print_newline();
952
- this._options.keep_array_indentation = true;
953
-
954
- } else {
955
- this.print_newline();
956
- }
957
- }
958
- }
959
- this.restore_mode();
960
- this.print_token(current_token);
961
- };
962
-
963
- Beautifier.prototype.handle_word = function(current_token) {
964
- if (current_token.type === TOKEN.RESERVED) {
965
- if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {
966
- current_token.type = TOKEN.WORD;
967
- } else if (current_token.text === 'import' && in_array(this._tokens.peek().text, ['(', '.'])) {
968
- current_token.type = TOKEN.WORD;
969
- } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {
970
- current_token.type = TOKEN.WORD;
971
- } else if (this._flags.mode === MODE.ObjectLiteral) {
972
- var next_token = this._tokens.peek();
973
- if (next_token.text === ':') {
974
- current_token.type = TOKEN.WORD;
975
- }
976
- }
977
- }
978
-
979
- if (this.start_of_statement(current_token)) {
980
- // The conditional starts the statement if appropriate.
981
- if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {
982
- this._flags.declaration_statement = true;
983
- }
984
- } else if (current_token.newlines && !is_expression(this._flags.mode) &&
985
- (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&
986
- this._flags.last_token.type !== TOKEN.EQUALS &&
987
- (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {
988
- this.handle_whitespace_and_comments(current_token);
989
- this.print_newline();
990
- } else {
991
- this.handle_whitespace_and_comments(current_token);
992
- }
993
-
994
- if (this._flags.do_block && !this._flags.do_while) {
995
- if (reserved_word(current_token, 'while')) {
996
- // do {} ## while ()
997
- this._output.space_before_token = true;
998
- this.print_token(current_token);
999
- this._output.space_before_token = true;
1000
- this._flags.do_while = true;
1001
- return;
1002
- } else {
1003
- // do {} should always have while as the next word.
1004
- // if we don't see the expected while, recover
1005
- this.print_newline();
1006
- this._flags.do_block = false;
1007
- }
1008
- }
1009
-
1010
- // if may be followed by else, or not
1011
- // Bare/inline ifs are tricky
1012
- // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();
1013
- if (this._flags.if_block) {
1014
- if (!this._flags.else_block && reserved_word(current_token, 'else')) {
1015
- this._flags.else_block = true;
1016
- } else {
1017
- while (this._flags.mode === MODE.Statement) {
1018
- this.restore_mode();
1019
- }
1020
- this._flags.if_block = false;
1021
- this._flags.else_block = false;
1022
- }
1023
- }
1024
-
1025
- if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {
1026
- this.print_newline();
1027
- if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) {
1028
- // switch cases following one another
1029
- this.deindent();
1030
- }
1031
- this._flags.case_body = false;
1032
-
1033
- this.print_token(current_token);
1034
- this._flags.in_case = true;
1035
- return;
1036
- }
1037
-
1038
- 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) {
1039
- if (!this.start_of_object_property()) {
1040
- this.allow_wrap_or_preserved_newline(current_token);
1041
- }
1042
- }
1043
-
1044
- if (reserved_word(current_token, 'function')) {
1045
- if (in_array(this._flags.last_token.text, ['}', ';']) ||
1046
- (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {
1047
- // make sure there is a nice clean space of at least one blank line
1048
- // before a new function definition
1049
- if (!this._output.just_added_blankline() && !current_token.comments_before) {
1050
- this.print_newline();
1051
- this.print_newline(true);
1052
- }
1053
- }
1054
- if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {
1055
- if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||
1056
- reserved_array(this._flags.last_token, newline_restricted_tokens)) {
1057
- this._output.space_before_token = true;
1058
- } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {
1059
- this._output.space_before_token = true;
1060
- } else if (this._flags.last_token.text === 'declare') {
1061
- // accomodates Typescript declare function formatting
1062
- this._output.space_before_token = true;
1063
- } else {
1064
- this.print_newline();
1065
- }
1066
- } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {
1067
- // foo = function
1068
- this._output.space_before_token = true;
1069
- } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {
1070
- // (function
1071
- } else {
1072
- this.print_newline();
1073
- }
1074
-
1075
- this.print_token(current_token);
1076
- this._flags.last_word = current_token.text;
1077
- return;
1078
- }
1079
-
1080
- var prefix = 'NONE';
1081
-
1082
- if (this._flags.last_token.type === TOKEN.END_BLOCK) {
1083
-
1084
- if (this._previous_flags.inline_frame) {
1085
- prefix = 'SPACE';
1086
- } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {
1087
- prefix = 'NEWLINE';
1088
- } else {
1089
- if (this._options.brace_style === "expand" ||
1090
- this._options.brace_style === "end-expand" ||
1091
- (this._options.brace_style === "none" && current_token.newlines)) {
1092
- prefix = 'NEWLINE';
1093
- } else {
1094
- prefix = 'SPACE';
1095
- this._output.space_before_token = true;
1096
- }
1097
- }
1098
- } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {
1099
- // TODO: Should this be for STATEMENT as well?
1100
- prefix = 'NEWLINE';
1101
- } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {
1102
- prefix = 'SPACE';
1103
- } else if (this._flags.last_token.type === TOKEN.STRING) {
1104
- prefix = 'NEWLINE';
1105
- } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||
1106
- (this._flags.last_token.text === '*' &&
1107
- (in_array(this._last_last_text, ['function', 'yield']) ||
1108
- (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
1109
- prefix = 'SPACE';
1110
- } else if (this._flags.last_token.type === TOKEN.START_BLOCK) {
1111
- if (this._flags.inline_frame) {
1112
- prefix = 'SPACE';
1113
- } else {
1114
- prefix = 'NEWLINE';
1115
- }
1116
- } else if (this._flags.last_token.type === TOKEN.END_EXPR) {
1117
- this._output.space_before_token = true;
1118
- prefix = 'NEWLINE';
1119
- }
1120
-
1121
- if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
1122
- if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {
1123
- prefix = 'SPACE';
1124
- } else {
1125
- prefix = 'NEWLINE';
1126
- }
1127
-
1128
- }
1129
-
1130
- if (reserved_array(current_token, ['else', 'catch', 'finally'])) {
1131
- if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||
1132
- this._options.brace_style === "expand" ||
1133
- this._options.brace_style === "end-expand" ||
1134
- (this._options.brace_style === "none" && current_token.newlines)) &&
1135
- !this._flags.inline_frame) {
1136
- this.print_newline();
1137
- } else {
1138
- this._output.trim(true);
1139
- var line = this._output.current_line;
1140
- // If we trimmed and there's something other than a close block before us
1141
- // put a newline back in. Handles '} // comment' scenario.
1142
- if (line.last() !== '}') {
1143
- this.print_newline();
1144
- }
1145
- this._output.space_before_token = true;
1146
- }
1147
- } else if (prefix === 'NEWLINE') {
1148
- if (reserved_array(this._flags.last_token, special_words)) {
1149
- // no newline between 'return nnn'
1150
- this._output.space_before_token = true;
1151
- } else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) {
1152
- // accomodates Typescript declare formatting
1153
- this._output.space_before_token = true;
1154
- } else if (this._flags.last_token.type !== TOKEN.END_EXPR) {
1155
- if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {
1156
- // no need to force newline on 'var': for (var x = 0...)
1157
- if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {
1158
- // no newline for } else if {
1159
- this._output.space_before_token = true;
1160
- } else {
1161
- this.print_newline();
1162
- }
1163
- }
1164
- } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
1165
- this.print_newline();
1166
- }
1167
- } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {
1168
- this.print_newline(); // }, in lists get a newline treatment
1169
- } else if (prefix === 'SPACE') {
1170
- this._output.space_before_token = true;
1171
- }
1172
- if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {
1173
- this._output.space_before_token = true;
1174
- }
1175
- this.print_token(current_token);
1176
- this._flags.last_word = current_token.text;
1177
-
1178
- if (current_token.type === TOKEN.RESERVED) {
1179
- if (current_token.text === 'do') {
1180
- this._flags.do_block = true;
1181
- } else if (current_token.text === 'if') {
1182
- this._flags.if_block = true;
1183
- } else if (current_token.text === 'import') {
1184
- this._flags.import_block = true;
1185
- } else if (this._flags.import_block && reserved_word(current_token, 'from')) {
1186
- this._flags.import_block = false;
1187
- }
1188
- }
1189
- };
1190
-
1191
- Beautifier.prototype.handle_semicolon = function(current_token) {
1192
- if (this.start_of_statement(current_token)) {
1193
- // The conditional starts the statement if appropriate.
1194
- // Semicolon can be the start (and end) of a statement
1195
- this._output.space_before_token = false;
1196
- } else {
1197
- this.handle_whitespace_and_comments(current_token);
1198
- }
1199
-
1200
- var next_token = this._tokens.peek();
1201
- while (this._flags.mode === MODE.Statement &&
1202
- !(this._flags.if_block && reserved_word(next_token, 'else')) &&
1203
- !this._flags.do_block) {
1204
- this.restore_mode();
1205
- }
1206
-
1207
- // hacky but effective for the moment
1208
- if (this._flags.import_block) {
1209
- this._flags.import_block = false;
1210
- }
1211
- this.print_token(current_token);
1212
- };
1213
-
1214
- Beautifier.prototype.handle_string = function(current_token) {
1215
- if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
1216
- //Conditional for detectign backtick strings
1217
- } else if (this.start_of_statement(current_token)) {
1218
- // The conditional starts the statement if appropriate.
1219
- // One difference - strings want at least a space before
1220
- this._output.space_before_token = true;
1221
- } else {
1222
- this.handle_whitespace_and_comments(current_token);
1223
- if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {
1224
- this._output.space_before_token = true;
1225
- } 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) {
1226
- if (!this.start_of_object_property()) {
1227
- this.allow_wrap_or_preserved_newline(current_token);
1228
- }
1229
- } 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)) {
1230
- this._output.space_before_token = true;
1231
- } else {
1232
- this.print_newline();
1233
- }
1234
- }
1235
- this.print_token(current_token);
1236
- };
1237
-
1238
- Beautifier.prototype.handle_equals = function(current_token) {
1239
- if (this.start_of_statement(current_token)) {
1240
- // The conditional starts the statement if appropriate.
1241
- } else {
1242
- this.handle_whitespace_and_comments(current_token);
1243
- }
1244
-
1245
- if (this._flags.declaration_statement) {
1246
- // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done
1247
- this._flags.declaration_assignment = true;
1248
- }
1249
- this._output.space_before_token = true;
1250
- this.print_token(current_token);
1251
- this._output.space_before_token = true;
1252
- };
1253
-
1254
- Beautifier.prototype.handle_comma = function(current_token) {
1255
- this.handle_whitespace_and_comments(current_token, true);
1256
-
1257
- this.print_token(current_token);
1258
- this._output.space_before_token = true;
1259
- if (this._flags.declaration_statement) {
1260
- if (is_expression(this._flags.parent.mode)) {
1261
- // do not break on comma, for(var a = 1, b = 2)
1262
- this._flags.declaration_assignment = false;
1263
- }
1264
-
1265
- if (this._flags.declaration_assignment) {
1266
- this._flags.declaration_assignment = false;
1267
- this.print_newline(false, true);
1268
- } else if (this._options.comma_first) {
1269
- // for comma-first, we want to allow a newline before the comma
1270
- // to turn into a newline after the comma, which we will fixup later
1271
- this.allow_wrap_or_preserved_newline(current_token);
1272
- }
1273
- } else if (this._flags.mode === MODE.ObjectLiteral ||
1274
- (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {
1275
- if (this._flags.mode === MODE.Statement) {
1276
- this.restore_mode();
1277
- }
1278
-
1279
- if (!this._flags.inline_frame) {
1280
- this.print_newline();
1281
- }
1282
- } else if (this._options.comma_first) {
1283
- // EXPR or DO_BLOCK
1284
- // for comma-first, we want to allow a newline before the comma
1285
- // to turn into a newline after the comma, which we will fixup later
1286
- this.allow_wrap_or_preserved_newline(current_token);
1287
- }
1288
- };
1289
-
1290
- Beautifier.prototype.handle_operator = function(current_token) {
1291
- var isGeneratorAsterisk = current_token.text === '*' &&
1292
- (reserved_array(this._flags.last_token, ['function', 'yield']) ||
1293
- (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))
1294
- );
1295
- var isUnary = in_array(current_token.text, ['-', '+']) && (
1296
- in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||
1297
- in_array(this._flags.last_token.text, line_starters) ||
1298
- this._flags.last_token.text === ','
1299
- );
1300
-
1301
- if (this.start_of_statement(current_token)) {
1302
- // The conditional starts the statement if appropriate.
1303
- } else {
1304
- var preserve_statement_flags = !isGeneratorAsterisk;
1305
- this.handle_whitespace_and_comments(current_token, preserve_statement_flags);
1306
- }
1307
-
1308
- // hack for actionscript's import .*;
1309
- if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {
1310
- this.print_token(current_token);
1311
- return;
1312
- }
1313
-
1314
- if (current_token.text === '::') {
1315
- // no spaces around exotic namespacing syntax operator
1316
- this.print_token(current_token);
1317
- return;
1318
- }
1319
-
1320
- // Allow line wrapping between operators when operator_position is
1321
- // set to before or preserve
1322
- if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {
1323
- this.allow_wrap_or_preserved_newline(current_token);
1324
- }
1325
-
1326
- if (current_token.text === ':' && this._flags.in_case) {
1327
- this.print_token(current_token);
1328
-
1329
- this._flags.in_case = false;
1330
- this._flags.case_body = true;
1331
- if (this._tokens.peek().type !== TOKEN.START_BLOCK) {
1332
- this.indent();
1333
- this.print_newline();
1334
- this._flags.case_block = false;
1335
- } else {
1336
- this._flags.case_block = true;
1337
- this._output.space_before_token = true;
1338
- }
1339
- return;
1340
- }
1341
-
1342
- var space_before = true;
1343
- var space_after = true;
1344
- var in_ternary = false;
1345
- if (current_token.text === ':') {
1346
- if (this._flags.ternary_depth === 0) {
1347
- // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.
1348
- space_before = false;
1349
- } else {
1350
- this._flags.ternary_depth -= 1;
1351
- in_ternary = true;
1352
- }
1353
- } else if (current_token.text === '?') {
1354
- this._flags.ternary_depth += 1;
1355
- }
1356
-
1357
- // let's handle the operator_position option prior to any conflicting logic
1358
- if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {
1359
- var isColon = current_token.text === ':';
1360
- var isTernaryColon = (isColon && in_ternary);
1361
- var isOtherColon = (isColon && !in_ternary);
1362
-
1363
- switch (this._options.operator_position) {
1364
- case OPERATOR_POSITION.before_newline:
1365
- // if the current token is : and it's not a ternary statement then we set space_before to false
1366
- this._output.space_before_token = !isOtherColon;
1367
-
1368
- this.print_token(current_token);
1369
-
1370
- if (!isColon || isTernaryColon) {
1371
- this.allow_wrap_or_preserved_newline(current_token);
1372
- }
1373
-
1374
- this._output.space_before_token = true;
1375
- return;
1376
-
1377
- case OPERATOR_POSITION.after_newline:
1378
- // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,
1379
- // then print a newline.
1380
-
1381
- this._output.space_before_token = true;
1382
-
1383
- if (!isColon || isTernaryColon) {
1384
- if (this._tokens.peek().newlines) {
1385
- this.print_newline(false, true);
1386
- } else {
1387
- this.allow_wrap_or_preserved_newline(current_token);
1388
- }
1389
- } else {
1390
- this._output.space_before_token = false;
1391
- }
1392
-
1393
- this.print_token(current_token);
1394
-
1395
- this._output.space_before_token = true;
1396
- return;
1397
-
1398
- case OPERATOR_POSITION.preserve_newline:
1399
- if (!isOtherColon) {
1400
- this.allow_wrap_or_preserved_newline(current_token);
1401
- }
1402
-
1403
- // if we just added a newline, or the current token is : and it's not a ternary statement,
1404
- // then we set space_before to false
1405
- space_before = !(this._output.just_added_newline() || isOtherColon);
1406
-
1407
- this._output.space_before_token = space_before;
1408
- this.print_token(current_token);
1409
- this._output.space_before_token = true;
1410
- return;
1411
- }
1412
- }
1413
-
1414
- if (isGeneratorAsterisk) {
1415
- this.allow_wrap_or_preserved_newline(current_token);
1416
- space_before = false;
1417
- var next_token = this._tokens.peek();
1418
- space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);
1419
- } else if (current_token.text === '...') {
1420
- this.allow_wrap_or_preserved_newline(current_token);
1421
- space_before = this._flags.last_token.type === TOKEN.START_BLOCK;
1422
- space_after = false;
1423
- } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {
1424
- // unary operators (and binary +/- pretending to be unary) special cases
1425
- if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {
1426
- this.allow_wrap_or_preserved_newline(current_token);
1427
- }
1428
-
1429
- space_before = false;
1430
- space_after = false;
1431
-
1432
- // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1
1433
- // if there is a newline between -- or ++ and anything else we should preserve it.
1434
- if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) {
1435
- var new_line_needed = reserved_array(this._flags.last_token, special_words) && current_token.newlines;
1436
- if (new_line_needed && (this._previous_flags.if_block || this._previous_flags.else_block)) {
1437
- this.restore_mode();
1438
- }
1439
- this.print_newline(new_line_needed, true);
1440
- }
1441
-
1442
- if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {
1443
- // for (;; ++i)
1444
- // ^^^
1445
- space_before = true;
1446
- }
1447
-
1448
- if (this._flags.last_token.type === TOKEN.RESERVED) {
1449
- space_before = true;
1450
- } else if (this._flags.last_token.type === TOKEN.END_EXPR) {
1451
- space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));
1452
- } else if (this._flags.last_token.type === TOKEN.OPERATOR) {
1453
- // a++ + ++b;
1454
- // a - -b
1455
- space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);
1456
- // + and - are not unary when preceeded by -- or ++ operator
1457
- // a-- + b
1458
- // a * +b
1459
- // a - -b
1460
- if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {
1461
- space_after = true;
1462
- }
1463
- }
1464
-
1465
-
1466
- if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&
1467
- (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {
1468
- // { foo; --i }
1469
- // foo(); --bar;
1470
- this.print_newline();
1471
- }
1472
- }
1473
-
1474
- this._output.space_before_token = this._output.space_before_token || space_before;
1475
- this.print_token(current_token);
1476
- this._output.space_before_token = space_after;
1477
- };
1478
-
1479
- Beautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {
1480
- if (this._output.raw) {
1481
- this._output.add_raw_token(current_token);
1482
- if (current_token.directives && current_token.directives.preserve === 'end') {
1483
- // If we're testing the raw output behavior, do not allow a directive to turn it off.
1484
- this._output.raw = this._options.test_output_raw;
1485
- }
1486
- return;
1487
- }
1488
-
1489
- if (current_token.directives) {
1490
- this.print_newline(false, preserve_statement_flags);
1491
- this.print_token(current_token);
1492
- if (current_token.directives.preserve === 'start') {
1493
- this._output.raw = true;
1494
- }
1495
- this.print_newline(false, true);
1496
- return;
1497
- }
1498
-
1499
- // inline block
1500
- if (!acorn.newline.test(current_token.text) && !current_token.newlines) {
1501
- this._output.space_before_token = true;
1502
- this.print_token(current_token);
1503
- this._output.space_before_token = true;
1504
- return;
1505
- } else {
1506
- this.print_block_commment(current_token, preserve_statement_flags);
1507
- }
1508
- };
1509
-
1510
- Beautifier.prototype.print_block_commment = function(current_token, preserve_statement_flags) {
1511
- var lines = split_linebreaks(current_token.text);
1512
- var j; // iterator for this case
1513
- var javadoc = false;
1514
- var starless = false;
1515
- var lastIndent = current_token.whitespace_before;
1516
- var lastIndentLength = lastIndent.length;
1517
-
1518
- // block comment starts with a new line
1519
- this.print_newline(false, preserve_statement_flags);
1520
-
1521
- // first line always indented
1522
- this.print_token_line_indentation(current_token);
1523
- this._output.add_token(lines[0]);
1524
- this.print_newline(false, preserve_statement_flags);
1525
-
1526
-
1527
- if (lines.length > 1) {
1528
- lines = lines.slice(1);
1529
- javadoc = all_lines_start_with(lines, '*');
1530
- starless = each_line_matches_indent(lines, lastIndent);
1531
-
1532
- if (javadoc) {
1533
- this._flags.alignment = 1;
1534
- }
1535
-
1536
- for (j = 0; j < lines.length; j++) {
1537
- if (javadoc) {
1538
- // javadoc: reformat and re-indent
1539
- this.print_token_line_indentation(current_token);
1540
- this._output.add_token(ltrim(lines[j]));
1541
- } else if (starless && lines[j]) {
1542
- // starless: re-indent non-empty content, avoiding trim
1543
- this.print_token_line_indentation(current_token);
1544
- this._output.add_token(lines[j].substring(lastIndentLength));
1545
- } else {
1546
- // normal comments output raw
1547
- this._output.current_line.set_indent(-1);
1548
- this._output.add_token(lines[j]);
1549
- }
1550
-
1551
- // for comments on their own line or more than one line, make sure there's a new line after
1552
- this.print_newline(false, preserve_statement_flags);
1553
- }
1554
-
1555
- this._flags.alignment = 0;
1556
- }
1557
- };
1558
-
1559
-
1560
- Beautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {
1561
- if (current_token.newlines) {
1562
- this.print_newline(false, preserve_statement_flags);
1563
- } else {
1564
- this._output.trim(true);
1565
- }
1566
-
1567
- this._output.space_before_token = true;
1568
- this.print_token(current_token);
1569
- this.print_newline(false, preserve_statement_flags);
1570
- };
1571
-
1572
- Beautifier.prototype.handle_dot = function(current_token) {
1573
- if (this.start_of_statement(current_token)) {
1574
- // The conditional starts the statement if appropriate.
1575
- } else {
1576
- this.handle_whitespace_and_comments(current_token, true);
1577
- }
1578
-
1579
- if (this._flags.last_token.text.match('^[0-9]+$')) {
1580
- this._output.space_before_token = true;
1581
- }
1582
-
1583
- if (reserved_array(this._flags.last_token, special_words)) {
1584
- this._output.space_before_token = false;
1585
- } else {
1586
- // allow preserved newlines before dots in general
1587
- // force newlines on dots after close paren when break_chained - for bar().baz()
1588
- this.allow_wrap_or_preserved_newline(current_token,
1589
- this._flags.last_token.text === ')' && this._options.break_chained_methods);
1590
- }
1591
-
1592
- // Only unindent chained method dot if this dot starts a new line.
1593
- // Otherwise the automatic extra indentation removal will handle the over indent
1594
- if (this._options.unindent_chained_methods && this._output.just_added_newline()) {
1595
- this.deindent();
1596
- }
1597
-
1598
- this.print_token(current_token);
1599
- };
1600
-
1601
- Beautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {
1602
- this.print_token(current_token);
1603
-
1604
- if (current_token.text[current_token.text.length - 1] === '\n') {
1605
- this.print_newline(false, preserve_statement_flags);
1606
- }
1607
- };
1608
-
1609
- Beautifier.prototype.handle_eof = function(current_token) {
1610
- // Unwind any open statements
1611
- while (this._flags.mode === MODE.Statement) {
1612
- this.restore_mode();
1613
- }
1614
- this.handle_whitespace_and_comments(current_token);
1615
- };
1616
-
1617
- module.exports.Beautifier = Beautifier;
1618
-
1619
-
1620
- /***/ }),
1621
- /* 2 */
1622
- /***/ (function(module) {
1623
-
1624
- /*jshint node:true */
1625
- /*
1626
- The MIT License (MIT)
1627
-
1628
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
1629
-
1630
- Permission is hereby granted, free of charge, to any person
1631
- obtaining a copy of this software and associated documentation files
1632
- (the "Software"), to deal in the Software without restriction,
1633
- including without limitation the rights to use, copy, modify, merge,
1634
- publish, distribute, sublicense, and/or sell copies of the Software,
1635
- and to permit persons to whom the Software is furnished to do so,
1636
- subject to the following conditions:
1637
-
1638
- The above copyright notice and this permission notice shall be
1639
- included in all copies or substantial portions of the Software.
1640
-
1641
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1642
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1643
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1644
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1645
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1646
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1647
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1648
- SOFTWARE.
1649
- */
1650
-
1651
-
1652
-
1653
- function OutputLine(parent) {
1654
- this.__parent = parent;
1655
- this.__character_count = 0;
1656
- // use indent_count as a marker for this.__lines that have preserved indentation
1657
- this.__indent_count = -1;
1658
- this.__alignment_count = 0;
1659
- this.__wrap_point_index = 0;
1660
- this.__wrap_point_character_count = 0;
1661
- this.__wrap_point_indent_count = -1;
1662
- this.__wrap_point_alignment_count = 0;
1663
-
1664
- this.__items = [];
1665
- }
1666
-
1667
- OutputLine.prototype.clone_empty = function() {
1668
- var line = new OutputLine(this.__parent);
1669
- line.set_indent(this.__indent_count, this.__alignment_count);
1670
- return line;
1671
- };
1672
-
1673
- OutputLine.prototype.item = function(index) {
1674
- if (index < 0) {
1675
- return this.__items[this.__items.length + index];
1676
- } else {
1677
- return this.__items[index];
1678
- }
1679
- };
1680
-
1681
- OutputLine.prototype.has_match = function(pattern) {
1682
- for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
1683
- if (this.__items[lastCheckedOutput].match(pattern)) {
1684
- return true;
1685
- }
1686
- }
1687
- return false;
1688
- };
1689
-
1690
- OutputLine.prototype.set_indent = function(indent, alignment) {
1691
- if (this.is_empty()) {
1692
- this.__indent_count = indent || 0;
1693
- this.__alignment_count = alignment || 0;
1694
- this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
1695
- }
1696
- };
1697
-
1698
- OutputLine.prototype._set_wrap_point = function() {
1699
- if (this.__parent.wrap_line_length) {
1700
- this.__wrap_point_index = this.__items.length;
1701
- this.__wrap_point_character_count = this.__character_count;
1702
- this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
1703
- this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
1704
- }
1705
- };
1706
-
1707
- OutputLine.prototype._should_wrap = function() {
1708
- return this.__wrap_point_index &&
1709
- this.__character_count > this.__parent.wrap_line_length &&
1710
- this.__wrap_point_character_count > this.__parent.next_line.__character_count;
1711
- };
1712
-
1713
- OutputLine.prototype._allow_wrap = function() {
1714
- if (this._should_wrap()) {
1715
- this.__parent.add_new_line();
1716
- var next = this.__parent.current_line;
1717
- next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
1718
- next.__items = this.__items.slice(this.__wrap_point_index);
1719
- this.__items = this.__items.slice(0, this.__wrap_point_index);
1720
-
1721
- next.__character_count += this.__character_count - this.__wrap_point_character_count;
1722
- this.__character_count = this.__wrap_point_character_count;
1723
-
1724
- if (next.__items[0] === " ") {
1725
- next.__items.splice(0, 1);
1726
- next.__character_count -= 1;
1727
- }
1728
- return true;
1729
- }
1730
- return false;
1731
- };
1732
-
1733
- OutputLine.prototype.is_empty = function() {
1734
- return this.__items.length === 0;
1735
- };
1736
-
1737
- OutputLine.prototype.last = function() {
1738
- if (!this.is_empty()) {
1739
- return this.__items[this.__items.length - 1];
1740
- } else {
1741
- return null;
1742
- }
1743
- };
1744
-
1745
- OutputLine.prototype.push = function(item) {
1746
- this.__items.push(item);
1747
- var last_newline_index = item.lastIndexOf('\n');
1748
- if (last_newline_index !== -1) {
1749
- this.__character_count = item.length - last_newline_index;
1750
- } else {
1751
- this.__character_count += item.length;
1752
- }
1753
- };
1754
-
1755
- OutputLine.prototype.pop = function() {
1756
- var item = null;
1757
- if (!this.is_empty()) {
1758
- item = this.__items.pop();
1759
- this.__character_count -= item.length;
1760
- }
1761
- return item;
1762
- };
1763
-
1764
-
1765
- OutputLine.prototype._remove_indent = function() {
1766
- if (this.__indent_count > 0) {
1767
- this.__indent_count -= 1;
1768
- this.__character_count -= this.__parent.indent_size;
1769
- }
1770
- };
1771
-
1772
- OutputLine.prototype._remove_wrap_indent = function() {
1773
- if (this.__wrap_point_indent_count > 0) {
1774
- this.__wrap_point_indent_count -= 1;
1775
- }
1776
- };
1777
- OutputLine.prototype.trim = function() {
1778
- while (this.last() === ' ') {
1779
- this.__items.pop();
1780
- this.__character_count -= 1;
1781
- }
1782
- };
1783
-
1784
- OutputLine.prototype.toString = function() {
1785
- var result = '';
1786
- if (this.is_empty()) {
1787
- if (this.__parent.indent_empty_lines) {
1788
- result = this.__parent.get_indent_string(this.__indent_count);
1789
- }
1790
- } else {
1791
- result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
1792
- result += this.__items.join('');
1793
- }
1794
- return result;
1795
- };
1796
-
1797
- function IndentStringCache(options, baseIndentString) {
1798
- this.__cache = [''];
1799
- this.__indent_size = options.indent_size;
1800
- this.__indent_string = options.indent_char;
1801
- if (!options.indent_with_tabs) {
1802
- this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
1803
- }
1804
-
1805
- // Set to null to continue support for auto detection of base indent
1806
- baseIndentString = baseIndentString || '';
1807
- if (options.indent_level > 0) {
1808
- baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
1809
- }
1810
-
1811
- this.__base_string = baseIndentString;
1812
- this.__base_string_length = baseIndentString.length;
1813
- }
1814
-
1815
- IndentStringCache.prototype.get_indent_size = function(indent, column) {
1816
- var result = this.__base_string_length;
1817
- column = column || 0;
1818
- if (indent < 0) {
1819
- result = 0;
1820
- }
1821
- result += indent * this.__indent_size;
1822
- result += column;
1823
- return result;
1824
- };
1825
-
1826
- IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
1827
- var result = this.__base_string;
1828
- column = column || 0;
1829
- if (indent_level < 0) {
1830
- indent_level = 0;
1831
- result = '';
1832
- }
1833
- column += indent_level * this.__indent_size;
1834
- this.__ensure_cache(column);
1835
- result += this.__cache[column];
1836
- return result;
1837
- };
1838
-
1839
- IndentStringCache.prototype.__ensure_cache = function(column) {
1840
- while (column >= this.__cache.length) {
1841
- this.__add_column();
1842
- }
1843
- };
1844
-
1845
- IndentStringCache.prototype.__add_column = function() {
1846
- var column = this.__cache.length;
1847
- var indent = 0;
1848
- var result = '';
1849
- if (this.__indent_size && column >= this.__indent_size) {
1850
- indent = Math.floor(column / this.__indent_size);
1851
- column -= indent * this.__indent_size;
1852
- result = new Array(indent + 1).join(this.__indent_string);
1853
- }
1854
- if (column) {
1855
- result += new Array(column + 1).join(' ');
1856
- }
1857
-
1858
- this.__cache.push(result);
1859
- };
1860
-
1861
- function Output(options, baseIndentString) {
1862
- this.__indent_cache = new IndentStringCache(options, baseIndentString);
1863
- this.raw = false;
1864
- this._end_with_newline = options.end_with_newline;
1865
- this.indent_size = options.indent_size;
1866
- this.wrap_line_length = options.wrap_line_length;
1867
- this.indent_empty_lines = options.indent_empty_lines;
1868
- this.__lines = [];
1869
- this.previous_line = null;
1870
- this.current_line = null;
1871
- this.next_line = new OutputLine(this);
1872
- this.space_before_token = false;
1873
- this.non_breaking_space = false;
1874
- this.previous_token_wrapped = false;
1875
- // initialize
1876
- this.__add_outputline();
1877
- }
1878
-
1879
- Output.prototype.__add_outputline = function() {
1880
- this.previous_line = this.current_line;
1881
- this.current_line = this.next_line.clone_empty();
1882
- this.__lines.push(this.current_line);
1883
- };
1884
-
1885
- Output.prototype.get_line_number = function() {
1886
- return this.__lines.length;
1887
- };
1888
-
1889
- Output.prototype.get_indent_string = function(indent, column) {
1890
- return this.__indent_cache.get_indent_string(indent, column);
1891
- };
1892
-
1893
- Output.prototype.get_indent_size = function(indent, column) {
1894
- return this.__indent_cache.get_indent_size(indent, column);
1895
- };
1896
-
1897
- Output.prototype.is_empty = function() {
1898
- return !this.previous_line && this.current_line.is_empty();
1899
- };
1900
-
1901
- Output.prototype.add_new_line = function(force_newline) {
1902
- // never newline at the start of file
1903
- // otherwise, newline only if we didn't just add one or we're forced
1904
- if (this.is_empty() ||
1905
- (!force_newline && this.just_added_newline())) {
1906
- return false;
1907
- }
1908
-
1909
- // if raw output is enabled, don't print additional newlines,
1910
- // but still return True as though you had
1911
- if (!this.raw) {
1912
- this.__add_outputline();
1913
- }
1914
- return true;
1915
- };
1916
-
1917
- Output.prototype.get_code = function(eol) {
1918
- this.trim(true);
1919
-
1920
- // handle some edge cases where the last tokens
1921
- // has text that ends with newline(s)
1922
- var last_item = this.current_line.pop();
1923
- if (last_item) {
1924
- if (last_item[last_item.length - 1] === '\n') {
1925
- last_item = last_item.replace(/\n+$/g, '');
1926
- }
1927
- this.current_line.push(last_item);
1928
- }
1929
-
1930
- if (this._end_with_newline) {
1931
- this.__add_outputline();
1932
- }
1933
-
1934
- var sweet_code = this.__lines.join('\n');
1935
-
1936
- if (eol !== '\n') {
1937
- sweet_code = sweet_code.replace(/[\n]/g, eol);
1938
- }
1939
- return sweet_code;
1940
- };
1941
-
1942
- Output.prototype.set_wrap_point = function() {
1943
- this.current_line._set_wrap_point();
1944
- };
1945
-
1946
- Output.prototype.set_indent = function(indent, alignment) {
1947
- indent = indent || 0;
1948
- alignment = alignment || 0;
1949
-
1950
- // Next line stores alignment values
1951
- this.next_line.set_indent(indent, alignment);
1952
-
1953
- // Never indent your first output indent at the start of the file
1954
- if (this.__lines.length > 1) {
1955
- this.current_line.set_indent(indent, alignment);
1956
- return true;
1957
- }
1958
-
1959
- this.current_line.set_indent();
1960
- return false;
1961
- };
1962
-
1963
- Output.prototype.add_raw_token = function(token) {
1964
- for (var x = 0; x < token.newlines; x++) {
1965
- this.__add_outputline();
1966
- }
1967
- this.current_line.set_indent(-1);
1968
- this.current_line.push(token.whitespace_before);
1969
- this.current_line.push(token.text);
1970
- this.space_before_token = false;
1971
- this.non_breaking_space = false;
1972
- this.previous_token_wrapped = false;
1973
- };
1974
-
1975
- Output.prototype.add_token = function(printable_token) {
1976
- this.__add_space_before_token();
1977
- this.current_line.push(printable_token);
1978
- this.space_before_token = false;
1979
- this.non_breaking_space = false;
1980
- this.previous_token_wrapped = this.current_line._allow_wrap();
1981
- };
1982
-
1983
- Output.prototype.__add_space_before_token = function() {
1984
- if (this.space_before_token && !this.just_added_newline()) {
1985
- if (!this.non_breaking_space) {
1986
- this.set_wrap_point();
1987
- }
1988
- this.current_line.push(' ');
1989
- }
1990
- };
1991
-
1992
- Output.prototype.remove_indent = function(index) {
1993
- var output_length = this.__lines.length;
1994
- while (index < output_length) {
1995
- this.__lines[index]._remove_indent();
1996
- index++;
1997
- }
1998
- this.current_line._remove_wrap_indent();
1999
- };
2000
-
2001
- Output.prototype.trim = function(eat_newlines) {
2002
- eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
2003
-
2004
- this.current_line.trim();
2005
-
2006
- while (eat_newlines && this.__lines.length > 1 &&
2007
- this.current_line.is_empty()) {
2008
- this.__lines.pop();
2009
- this.current_line = this.__lines[this.__lines.length - 1];
2010
- this.current_line.trim();
2011
- }
2012
-
2013
- this.previous_line = this.__lines.length > 1 ?
2014
- this.__lines[this.__lines.length - 2] : null;
2015
- };
2016
-
2017
- Output.prototype.just_added_newline = function() {
2018
- return this.current_line.is_empty();
2019
- };
2020
-
2021
- Output.prototype.just_added_blankline = function() {
2022
- return this.is_empty() ||
2023
- (this.current_line.is_empty() && this.previous_line.is_empty());
2024
- };
2025
-
2026
- Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
2027
- var index = this.__lines.length - 2;
2028
- while (index >= 0) {
2029
- var potentialEmptyLine = this.__lines[index];
2030
- if (potentialEmptyLine.is_empty()) {
2031
- break;
2032
- } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
2033
- potentialEmptyLine.item(-1) !== ends_with) {
2034
- this.__lines.splice(index + 1, 0, new OutputLine(this));
2035
- this.previous_line = this.__lines[this.__lines.length - 2];
2036
- break;
2037
- }
2038
- index--;
2039
- }
2040
- };
2041
-
2042
- module.exports.Output = Output;
2043
-
2044
-
2045
- /***/ }),
2046
- /* 3 */
2047
- /***/ (function(module) {
2048
-
2049
- /*jshint node:true */
2050
- /*
2051
-
2052
- The MIT License (MIT)
2053
-
2054
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
2055
-
2056
- Permission is hereby granted, free of charge, to any person
2057
- obtaining a copy of this software and associated documentation files
2058
- (the "Software"), to deal in the Software without restriction,
2059
- including without limitation the rights to use, copy, modify, merge,
2060
- publish, distribute, sublicense, and/or sell copies of the Software,
2061
- and to permit persons to whom the Software is furnished to do so,
2062
- subject to the following conditions:
2063
-
2064
- The above copyright notice and this permission notice shall be
2065
- included in all copies or substantial portions of the Software.
2066
-
2067
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2068
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2069
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2070
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2071
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2072
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2073
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2074
- SOFTWARE.
2075
- */
2076
-
2077
-
2078
-
2079
- function Token(type, text, newlines, whitespace_before) {
2080
- this.type = type;
2081
- this.text = text;
2082
-
2083
- // comments_before are
2084
- // comments that have a new line before them
2085
- // and may or may not have a newline after
2086
- // this is a set of comments before
2087
- this.comments_before = null; /* inline comment*/
2088
-
2089
-
2090
- // this.comments_after = new TokenStream(); // no new line before and newline after
2091
- this.newlines = newlines || 0;
2092
- this.whitespace_before = whitespace_before || '';
2093
- this.parent = null;
2094
- this.next = null;
2095
- this.previous = null;
2096
- this.opened = null;
2097
- this.closed = null;
2098
- this.directives = null;
2099
- }
2100
-
2101
-
2102
- module.exports.Token = Token;
2103
-
2104
-
2105
- /***/ }),
2106
- /* 4 */
2107
- /***/ (function(__unused_webpack_module, exports) {
2108
-
2109
- /* jshint node: true, curly: false */
2110
- // Parts of this section of code is taken from acorn.
2111
- //
2112
- // Acorn was written by Marijn Haverbeke and released under an MIT
2113
- // license. The Unicode regexps (for identifiers and whitespace) were
2114
- // taken from [Esprima](http://esprima.org) by Ariya Hidayat.
2115
- //
2116
- // Git repositories for Acorn are available at
2117
- //
2118
- // http://marijnhaverbeke.nl/git/acorn
2119
- // https://github.com/marijnh/acorn.git
2120
-
2121
- // ## Character categories
2122
-
2123
-
2124
-
2125
-
2126
- // acorn used char codes to squeeze the last bit of performance out
2127
- // Beautifier is okay without that, so we're using regex
2128
- // permit # (23), $ (36), and @ (64). @ is used in ES7 decorators.
2129
- // 65 through 91 are uppercase letters.
2130
- // permit _ (95).
2131
- // 97 through 123 are lowercase letters.
2132
- var baseASCIIidentifierStartChars = "\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a";
2133
-
2134
- // inside an identifier @ is not allowed but 0-9 are.
2135
- var baseASCIIidentifierChars = "\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a";
2136
-
2137
- // Big ugly regular expressions that match characters in the
2138
- // whitespace, identifier, and identifier-start categories. These
2139
- // are only applied when a character is found to actually have a
2140
- // code point above 128.
2141
- var nonASCIIidentifierStartChars = "\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc";
2142
- var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f";
2143
- //var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
2144
- //var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
2145
-
2146
- var identifierStart = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])";
2147
- var identifierChars = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*";
2148
-
2149
- exports.identifier = new RegExp(identifierStart + identifierChars, 'g');
2150
- exports.identifierStart = new RegExp(identifierStart);
2151
- exports.identifierMatch = new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+");
2152
-
2153
- var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // jshint ignore:line
2154
-
2155
- // Whether a single character denotes a newline.
2156
-
2157
- exports.newline = /[\n\r\u2028\u2029]/;
2158
-
2159
- // Matches a whole line break (where CRLF is considered a single
2160
- // line break). Used to count lines.
2161
-
2162
- // in javascript, these two differ
2163
- // in python they are the same, different methods are called on them
2164
- exports.lineBreak = new RegExp('\r\n|' + exports.newline.source);
2165
- exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
2166
-
2167
-
2168
- /***/ }),
2169
- /* 5 */
2170
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2171
-
2172
- /*jshint node:true */
2173
- /*
2174
-
2175
- The MIT License (MIT)
2176
-
2177
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
2178
-
2179
- Permission is hereby granted, free of charge, to any person
2180
- obtaining a copy of this software and associated documentation files
2181
- (the "Software"), to deal in the Software without restriction,
2182
- including without limitation the rights to use, copy, modify, merge,
2183
- publish, distribute, sublicense, and/or sell copies of the Software,
2184
- and to permit persons to whom the Software is furnished to do so,
2185
- subject to the following conditions:
2186
-
2187
- The above copyright notice and this permission notice shall be
2188
- included in all copies or substantial portions of the Software.
2189
-
2190
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2191
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2192
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2193
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2194
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2195
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2196
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2197
- SOFTWARE.
2198
- */
2199
-
2200
-
2201
-
2202
- var BaseOptions = (__webpack_require__(6).Options);
2203
-
2204
- var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
2205
-
2206
- function Options(options) {
2207
- BaseOptions.call(this, options, 'js');
2208
-
2209
- // compatibility, re
2210
- var raw_brace_style = this.raw_options.brace_style || null;
2211
- if (raw_brace_style === "expand-strict") { //graceful handling of deprecated option
2212
- this.raw_options.brace_style = "expand";
2213
- } else if (raw_brace_style === "collapse-preserve-inline") { //graceful handling of deprecated option
2214
- this.raw_options.brace_style = "collapse,preserve-inline";
2215
- } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option
2216
- this.raw_options.brace_style = this.raw_options.braces_on_own_line ? "expand" : "collapse";
2217
- // } else if (!raw_brace_style) { //Nothing exists to set it
2218
- // raw_brace_style = "collapse";
2219
- }
2220
-
2221
- //preserve-inline in delimited string will trigger brace_preserve_inline, everything
2222
- //else is considered a brace_style and the last one only will have an effect
2223
-
2224
- var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);
2225
-
2226
- this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option
2227
- this.brace_style = "collapse";
2228
-
2229
- for (var bs = 0; bs < brace_style_split.length; bs++) {
2230
- if (brace_style_split[bs] === "preserve-inline") {
2231
- this.brace_preserve_inline = true;
2232
- } else {
2233
- this.brace_style = brace_style_split[bs];
2234
- }
2235
- }
2236
-
2237
- this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');
2238
- this.break_chained_methods = this._get_boolean('break_chained_methods');
2239
- this.space_in_paren = this._get_boolean('space_in_paren');
2240
- this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');
2241
- this.jslint_happy = this._get_boolean('jslint_happy');
2242
- this.space_after_anon_function = this._get_boolean('space_after_anon_function');
2243
- this.space_after_named_function = this._get_boolean('space_after_named_function');
2244
- this.keep_array_indentation = this._get_boolean('keep_array_indentation');
2245
- this.space_before_conditional = this._get_boolean('space_before_conditional', true);
2246
- this.unescape_strings = this._get_boolean('unescape_strings');
2247
- this.e4x = this._get_boolean('e4x');
2248
- this.comma_first = this._get_boolean('comma_first');
2249
- this.operator_position = this._get_selection('operator_position', validPositionValues);
2250
-
2251
- // For testing of beautify preserve:start directive
2252
- this.test_output_raw = this._get_boolean('test_output_raw');
2253
-
2254
- // force this._options.space_after_anon_function to true if this._options.jslint_happy
2255
- if (this.jslint_happy) {
2256
- this.space_after_anon_function = true;
2257
- }
2258
-
2259
- }
2260
- Options.prototype = new BaseOptions();
2261
-
2262
-
2263
-
2264
- module.exports.Options = Options;
2265
-
2266
-
2267
- /***/ }),
2268
- /* 6 */
2269
- /***/ (function(module) {
2270
-
2271
- /*jshint node:true */
2272
- /*
2273
-
2274
- The MIT License (MIT)
2275
-
2276
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
2277
-
2278
- Permission is hereby granted, free of charge, to any person
2279
- obtaining a copy of this software and associated documentation files
2280
- (the "Software"), to deal in the Software without restriction,
2281
- including without limitation the rights to use, copy, modify, merge,
2282
- publish, distribute, sublicense, and/or sell copies of the Software,
2283
- and to permit persons to whom the Software is furnished to do so,
2284
- subject to the following conditions:
2285
-
2286
- The above copyright notice and this permission notice shall be
2287
- included in all copies or substantial portions of the Software.
2288
-
2289
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2290
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2291
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2292
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2293
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2294
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2295
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2296
- SOFTWARE.
2297
- */
2298
-
2299
-
2300
-
2301
- function Options(options, merge_child_field) {
2302
- this.raw_options = _mergeOpts(options, merge_child_field);
2303
-
2304
- // Support passing the source text back with no change
2305
- this.disabled = this._get_boolean('disabled');
2306
-
2307
- this.eol = this._get_characters('eol', 'auto');
2308
- this.end_with_newline = this._get_boolean('end_with_newline');
2309
- this.indent_size = this._get_number('indent_size', 4);
2310
- this.indent_char = this._get_characters('indent_char', ' ');
2311
- this.indent_level = this._get_number('indent_level');
2312
-
2313
- this.preserve_newlines = this._get_boolean('preserve_newlines', true);
2314
- this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
2315
- if (!this.preserve_newlines) {
2316
- this.max_preserve_newlines = 0;
2317
- }
2318
-
2319
- this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
2320
- if (this.indent_with_tabs) {
2321
- this.indent_char = '\t';
2322
-
2323
- // indent_size behavior changed after 1.8.6
2324
- // It used to be that indent_size would be
2325
- // set to 1 for indent_with_tabs. That is no longer needed and
2326
- // actually doesn't make sense - why not use spaces? Further,
2327
- // that might produce unexpected behavior - tabs being used
2328
- // for single-column alignment. So, when indent_with_tabs is true
2329
- // and indent_size is 1, reset indent_size to 4.
2330
- if (this.indent_size === 1) {
2331
- this.indent_size = 4;
2332
- }
2333
- }
2334
-
2335
- // Backwards compat with 1.3.x
2336
- this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
2337
-
2338
- this.indent_empty_lines = this._get_boolean('indent_empty_lines');
2339
-
2340
- // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']
2341
- // For now, 'auto' = all off for javascript, all on for html (and inline javascript).
2342
- // other values ignored
2343
- this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
2344
- }
2345
-
2346
- Options.prototype._get_array = function(name, default_value) {
2347
- var option_value = this.raw_options[name];
2348
- var result = default_value || [];
2349
- if (typeof option_value === 'object') {
2350
- if (option_value !== null && typeof option_value.concat === 'function') {
2351
- result = option_value.concat();
2352
- }
2353
- } else if (typeof option_value === 'string') {
2354
- result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
2355
- }
2356
- return result;
2357
- };
2358
-
2359
- Options.prototype._get_boolean = function(name, default_value) {
2360
- var option_value = this.raw_options[name];
2361
- var result = option_value === undefined ? !!default_value : !!option_value;
2362
- return result;
2363
- };
2364
-
2365
- Options.prototype._get_characters = function(name, default_value) {
2366
- var option_value = this.raw_options[name];
2367
- var result = default_value || '';
2368
- if (typeof option_value === 'string') {
2369
- result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
2370
- }
2371
- return result;
2372
- };
2373
-
2374
- Options.prototype._get_number = function(name, default_value) {
2375
- var option_value = this.raw_options[name];
2376
- default_value = parseInt(default_value, 10);
2377
- if (isNaN(default_value)) {
2378
- default_value = 0;
2379
- }
2380
- var result = parseInt(option_value, 10);
2381
- if (isNaN(result)) {
2382
- result = default_value;
2383
- }
2384
- return result;
2385
- };
2386
-
2387
- Options.prototype._get_selection = function(name, selection_list, default_value) {
2388
- var result = this._get_selection_list(name, selection_list, default_value);
2389
- if (result.length !== 1) {
2390
- throw new Error(
2391
- "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
2392
- selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
2393
- }
2394
-
2395
- return result[0];
2396
- };
2397
-
2398
-
2399
- Options.prototype._get_selection_list = function(name, selection_list, default_value) {
2400
- if (!selection_list || selection_list.length === 0) {
2401
- throw new Error("Selection list cannot be empty.");
2402
- }
2403
-
2404
- default_value = default_value || [selection_list[0]];
2405
- if (!this._is_valid_selection(default_value, selection_list)) {
2406
- throw new Error("Invalid Default Value!");
2407
- }
2408
-
2409
- var result = this._get_array(name, default_value);
2410
- if (!this._is_valid_selection(result, selection_list)) {
2411
- throw new Error(
2412
- "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
2413
- selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
2414
- }
2415
-
2416
- return result;
2417
- };
2418
-
2419
- Options.prototype._is_valid_selection = function(result, selection_list) {
2420
- return result.length && selection_list.length &&
2421
- !result.some(function(item) { return selection_list.indexOf(item) === -1; });
2422
- };
2423
-
2424
-
2425
- // merges child options up with the parent options object
2426
- // Example: obj = {a: 1, b: {a: 2}}
2427
- // mergeOpts(obj, 'b')
2428
- //
2429
- // Returns: {a: 2}
2430
- function _mergeOpts(allOptions, childFieldName) {
2431
- var finalOpts = {};
2432
- allOptions = _normalizeOpts(allOptions);
2433
- var name;
2434
-
2435
- for (name in allOptions) {
2436
- if (name !== childFieldName) {
2437
- finalOpts[name] = allOptions[name];
2438
- }
2439
- }
2440
-
2441
- //merge in the per type settings for the childFieldName
2442
- if (childFieldName && allOptions[childFieldName]) {
2443
- for (name in allOptions[childFieldName]) {
2444
- finalOpts[name] = allOptions[childFieldName][name];
2445
- }
2446
- }
2447
- return finalOpts;
2448
- }
2449
-
2450
- function _normalizeOpts(options) {
2451
- var convertedOpts = {};
2452
- var key;
2453
-
2454
- for (key in options) {
2455
- var newKey = key.replace(/-/g, "_");
2456
- convertedOpts[newKey] = options[key];
2457
- }
2458
- return convertedOpts;
2459
- }
2460
-
2461
- module.exports.Options = Options;
2462
- module.exports.normalizeOpts = _normalizeOpts;
2463
- module.exports.mergeOpts = _mergeOpts;
2464
-
2465
-
2466
- /***/ }),
2467
- /* 7 */
2468
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2469
-
2470
- /*jshint node:true */
2471
- /*
2472
-
2473
- The MIT License (MIT)
2474
-
2475
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
2476
-
2477
- Permission is hereby granted, free of charge, to any person
2478
- obtaining a copy of this software and associated documentation files
2479
- (the "Software"), to deal in the Software without restriction,
2480
- including without limitation the rights to use, copy, modify, merge,
2481
- publish, distribute, sublicense, and/or sell copies of the Software,
2482
- and to permit persons to whom the Software is furnished to do so,
2483
- subject to the following conditions:
2484
-
2485
- The above copyright notice and this permission notice shall be
2486
- included in all copies or substantial portions of the Software.
2487
-
2488
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2489
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2490
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2491
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2492
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2493
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2494
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2495
- SOFTWARE.
2496
- */
2497
-
2498
-
2499
-
2500
- var InputScanner = (__webpack_require__(8).InputScanner);
2501
- var BaseTokenizer = (__webpack_require__(9).Tokenizer);
2502
- var BASETOKEN = (__webpack_require__(9).TOKEN);
2503
- var Directives = (__webpack_require__(13).Directives);
2504
- var acorn = __webpack_require__(4);
2505
- var Pattern = (__webpack_require__(12).Pattern);
2506
- var TemplatablePattern = (__webpack_require__(14).TemplatablePattern);
2507
-
2508
-
2509
- function in_array(what, arr) {
2510
- return arr.indexOf(what) !== -1;
2511
- }
2512
-
2513
-
2514
- var TOKEN = {
2515
- START_EXPR: 'TK_START_EXPR',
2516
- END_EXPR: 'TK_END_EXPR',
2517
- START_BLOCK: 'TK_START_BLOCK',
2518
- END_BLOCK: 'TK_END_BLOCK',
2519
- WORD: 'TK_WORD',
2520
- RESERVED: 'TK_RESERVED',
2521
- SEMICOLON: 'TK_SEMICOLON',
2522
- STRING: 'TK_STRING',
2523
- EQUALS: 'TK_EQUALS',
2524
- OPERATOR: 'TK_OPERATOR',
2525
- COMMA: 'TK_COMMA',
2526
- BLOCK_COMMENT: 'TK_BLOCK_COMMENT',
2527
- COMMENT: 'TK_COMMENT',
2528
- DOT: 'TK_DOT',
2529
- UNKNOWN: 'TK_UNKNOWN',
2530
- START: BASETOKEN.START,
2531
- RAW: BASETOKEN.RAW,
2532
- EOF: BASETOKEN.EOF
2533
- };
2534
-
2535
-
2536
- var directives_core = new Directives(/\/\*/, /\*\//);
2537
-
2538
- var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
2539
-
2540
- var digit = /[0-9]/;
2541
-
2542
- // Dot "." must be distinguished from "..." and decimal
2543
- var dot_pattern = /[^\d\.]/;
2544
-
2545
- var positionable_operators = (
2546
- ">>> === !== &&= ??= ||= " +
2547
- "<< && >= ** != == <= >> || ?? |> " +
2548
- "< / - + > : & % ? ^ | *").split(' ');
2549
-
2550
- // IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.
2551
- // Also, you must update possitionable operators separately from punct
2552
- var punct =
2553
- ">>>= " +
2554
- "... >>= <<= === >>> !== **= &&= ??= ||= " +
2555
- "=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> " +
2556
- "= ! ? > < : / ^ - + * & % ~ |";
2557
-
2558
- punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
2559
- // ?. but not if followed by a number
2560
- punct = '\\?\\.(?!\\d) ' + punct;
2561
- punct = punct.replace(/ /g, '|');
2562
-
2563
- var punct_pattern = new RegExp(punct);
2564
-
2565
- // words which should always start on new line.
2566
- var line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');
2567
- var reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as', 'class', 'extends']);
2568
- var reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');
2569
-
2570
- // var template_pattern = /(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g;
2571
-
2572
- var in_html_comment;
2573
-
2574
- var Tokenizer = function(input_string, options) {
2575
- BaseTokenizer.call(this, input_string, options);
2576
-
2577
- this._patterns.whitespace = this._patterns.whitespace.matching(
2578
- /\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,
2579
- /\u2028\u2029/.source);
2580
-
2581
- var pattern_reader = new Pattern(this._input);
2582
- var templatable = new TemplatablePattern(this._input)
2583
- .read_options(this._options);
2584
-
2585
- this.__patterns = {
2586
- template: templatable,
2587
- identifier: templatable.starting_with(acorn.identifier).matching(acorn.identifierMatch),
2588
- number: pattern_reader.matching(number_pattern),
2589
- punct: pattern_reader.matching(punct_pattern),
2590
- // comment ends just before nearest linefeed or end of file
2591
- comment: pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),
2592
- // /* ... */ comment ends with nearest */ or end of file
2593
- block_comment: pattern_reader.starting_with(/\/\*/).until_after(/\*\//),
2594
- html_comment_start: pattern_reader.matching(/<!--/),
2595
- html_comment_end: pattern_reader.matching(/-->/),
2596
- include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
2597
- shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
2598
- xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),
2599
- single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
2600
- double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
2601
- template_text: templatable.until(/[`\\$]/),
2602
- template_expression: templatable.until(/[`}\\]/)
2603
- };
2604
-
2605
- };
2606
- Tokenizer.prototype = new BaseTokenizer();
2607
-
2608
- Tokenizer.prototype._is_comment = function(current_token) {
2609
- return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;
2610
- };
2611
-
2612
- Tokenizer.prototype._is_opening = function(current_token) {
2613
- return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;
2614
- };
2615
-
2616
- Tokenizer.prototype._is_closing = function(current_token, open_token) {
2617
- return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&
2618
- (open_token && (
2619
- (current_token.text === ']' && open_token.text === '[') ||
2620
- (current_token.text === ')' && open_token.text === '(') ||
2621
- (current_token.text === '}' && open_token.text === '{')));
2622
- };
2623
-
2624
- Tokenizer.prototype._reset = function() {
2625
- in_html_comment = false;
2626
- };
2627
-
2628
- Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
2629
- var token = null;
2630
- this._readWhitespace();
2631
- var c = this._input.peek();
2632
-
2633
- if (c === null) {
2634
- return this._create_token(TOKEN.EOF, '');
2635
- }
2636
-
2637
- token = token || this._read_non_javascript(c);
2638
- token = token || this._read_string(c);
2639
- token = token || this._read_word(previous_token);
2640
- token = token || this._read_singles(c);
2641
- token = token || this._read_comment(c);
2642
- token = token || this._read_regexp(c, previous_token);
2643
- token = token || this._read_xml(c, previous_token);
2644
- token = token || this._read_punctuation();
2645
- token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());
2646
-
2647
- return token;
2648
- };
2649
-
2650
- Tokenizer.prototype._read_word = function(previous_token) {
2651
- var resulting_string;
2652
- resulting_string = this.__patterns.identifier.read();
2653
- if (resulting_string !== '') {
2654
- resulting_string = resulting_string.replace(acorn.allLineBreaks, '\n');
2655
- if (!(previous_token.type === TOKEN.DOT ||
2656
- (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&
2657
- reserved_word_pattern.test(resulting_string)) {
2658
- if ((resulting_string === 'in' || resulting_string === 'of') &&
2659
- (previous_token.type === TOKEN.WORD || previous_token.type === TOKEN.STRING)) { // hack for 'in' and 'of' operators
2660
- return this._create_token(TOKEN.OPERATOR, resulting_string);
2661
- }
2662
- return this._create_token(TOKEN.RESERVED, resulting_string);
2663
- }
2664
- return this._create_token(TOKEN.WORD, resulting_string);
2665
- }
2666
-
2667
- resulting_string = this.__patterns.number.read();
2668
- if (resulting_string !== '') {
2669
- return this._create_token(TOKEN.WORD, resulting_string);
2670
- }
2671
- };
2672
-
2673
- Tokenizer.prototype._read_singles = function(c) {
2674
- var token = null;
2675
- if (c === '(' || c === '[') {
2676
- token = this._create_token(TOKEN.START_EXPR, c);
2677
- } else if (c === ')' || c === ']') {
2678
- token = this._create_token(TOKEN.END_EXPR, c);
2679
- } else if (c === '{') {
2680
- token = this._create_token(TOKEN.START_BLOCK, c);
2681
- } else if (c === '}') {
2682
- token = this._create_token(TOKEN.END_BLOCK, c);
2683
- } else if (c === ';') {
2684
- token = this._create_token(TOKEN.SEMICOLON, c);
2685
- } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {
2686
- token = this._create_token(TOKEN.DOT, c);
2687
- } else if (c === ',') {
2688
- token = this._create_token(TOKEN.COMMA, c);
2689
- }
2690
-
2691
- if (token) {
2692
- this._input.next();
2693
- }
2694
- return token;
2695
- };
2696
-
2697
- Tokenizer.prototype._read_punctuation = function() {
2698
- var resulting_string = this.__patterns.punct.read();
2699
-
2700
- if (resulting_string !== '') {
2701
- if (resulting_string === '=') {
2702
- return this._create_token(TOKEN.EQUALS, resulting_string);
2703
- } else if (resulting_string === '?.') {
2704
- return this._create_token(TOKEN.DOT, resulting_string);
2705
- } else {
2706
- return this._create_token(TOKEN.OPERATOR, resulting_string);
2707
- }
2708
- }
2709
- };
2710
-
2711
- Tokenizer.prototype._read_non_javascript = function(c) {
2712
- var resulting_string = '';
2713
-
2714
- if (c === '#') {
2715
- if (this._is_first_token()) {
2716
- resulting_string = this.__patterns.shebang.read();
2717
-
2718
- if (resulting_string) {
2719
- return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\n');
2720
- }
2721
- }
2722
-
2723
- // handles extendscript #includes
2724
- resulting_string = this.__patterns.include.read();
2725
-
2726
- if (resulting_string) {
2727
- return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\n');
2728
- }
2729
-
2730
- c = this._input.next();
2731
-
2732
- // Spidermonkey-specific sharp variables for circular references. Considered obsolete.
2733
- var sharp = '#';
2734
- if (this._input.hasNext() && this._input.testChar(digit)) {
2735
- do {
2736
- c = this._input.next();
2737
- sharp += c;
2738
- } while (this._input.hasNext() && c !== '#' && c !== '=');
2739
- if (c === '#') {
2740
- //
2741
- } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {
2742
- sharp += '[]';
2743
- this._input.next();
2744
- this._input.next();
2745
- } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {
2746
- sharp += '{}';
2747
- this._input.next();
2748
- this._input.next();
2749
- }
2750
- return this._create_token(TOKEN.WORD, sharp);
2751
- }
2752
-
2753
- this._input.back();
2754
-
2755
- } else if (c === '<' && this._is_first_token()) {
2756
- resulting_string = this.__patterns.html_comment_start.read();
2757
- if (resulting_string) {
2758
- while (this._input.hasNext() && !this._input.testChar(acorn.newline)) {
2759
- resulting_string += this._input.next();
2760
- }
2761
- in_html_comment = true;
2762
- return this._create_token(TOKEN.COMMENT, resulting_string);
2763
- }
2764
- } else if (in_html_comment && c === '-') {
2765
- resulting_string = this.__patterns.html_comment_end.read();
2766
- if (resulting_string) {
2767
- in_html_comment = false;
2768
- return this._create_token(TOKEN.COMMENT, resulting_string);
2769
- }
2770
- }
2771
-
2772
- return null;
2773
- };
2774
-
2775
- Tokenizer.prototype._read_comment = function(c) {
2776
- var token = null;
2777
- if (c === '/') {
2778
- var comment = '';
2779
- if (this._input.peek(1) === '*') {
2780
- // peek for comment /* ... */
2781
- comment = this.__patterns.block_comment.read();
2782
- var directives = directives_core.get_directives(comment);
2783
- if (directives && directives.ignore === 'start') {
2784
- comment += directives_core.readIgnored(this._input);
2785
- }
2786
- comment = comment.replace(acorn.allLineBreaks, '\n');
2787
- token = this._create_token(TOKEN.BLOCK_COMMENT, comment);
2788
- token.directives = directives;
2789
- } else if (this._input.peek(1) === '/') {
2790
- // peek for comment // ...
2791
- comment = this.__patterns.comment.read();
2792
- token = this._create_token(TOKEN.COMMENT, comment);
2793
- }
2794
- }
2795
- return token;
2796
- };
2797
-
2798
- Tokenizer.prototype._read_string = function(c) {
2799
- if (c === '`' || c === "'" || c === '"') {
2800
- var resulting_string = this._input.next();
2801
- this.has_char_escapes = false;
2802
-
2803
- if (c === '`') {
2804
- resulting_string += this._read_string_recursive('`', true, '${');
2805
- } else {
2806
- resulting_string += this._read_string_recursive(c);
2807
- }
2808
-
2809
- if (this.has_char_escapes && this._options.unescape_strings) {
2810
- resulting_string = unescape_string(resulting_string);
2811
- }
2812
-
2813
- if (this._input.peek() === c) {
2814
- resulting_string += this._input.next();
2815
- }
2816
-
2817
- resulting_string = resulting_string.replace(acorn.allLineBreaks, '\n');
2818
-
2819
- return this._create_token(TOKEN.STRING, resulting_string);
2820
- }
2821
-
2822
- return null;
2823
- };
2824
-
2825
- Tokenizer.prototype._allow_regexp_or_xml = function(previous_token) {
2826
- // regex and xml can only appear in specific locations during parsing
2827
- return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||
2828
- (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&
2829
- previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||
2830
- (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,
2831
- TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA
2832
- ]));
2833
- };
2834
-
2835
- Tokenizer.prototype._read_regexp = function(c, previous_token) {
2836
-
2837
- if (c === '/' && this._allow_regexp_or_xml(previous_token)) {
2838
- // handle regexp
2839
- //
2840
- var resulting_string = this._input.next();
2841
- var esc = false;
2842
-
2843
- var in_char_class = false;
2844
- while (this._input.hasNext() &&
2845
- ((esc || in_char_class || this._input.peek() !== c) &&
2846
- !this._input.testChar(acorn.newline))) {
2847
- resulting_string += this._input.peek();
2848
- if (!esc) {
2849
- esc = this._input.peek() === '\\';
2850
- if (this._input.peek() === '[') {
2851
- in_char_class = true;
2852
- } else if (this._input.peek() === ']') {
2853
- in_char_class = false;
2854
- }
2855
- } else {
2856
- esc = false;
2857
- }
2858
- this._input.next();
2859
- }
2860
-
2861
- if (this._input.peek() === c) {
2862
- resulting_string += this._input.next();
2863
-
2864
- // regexps may have modifiers /regexp/MOD , so fetch those, too
2865
- // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.
2866
- resulting_string += this._input.read(acorn.identifier);
2867
- }
2868
- return this._create_token(TOKEN.STRING, resulting_string);
2869
- }
2870
- return null;
2871
- };
2872
-
2873
- Tokenizer.prototype._read_xml = function(c, previous_token) {
2874
-
2875
- if (this._options.e4x && c === "<" && this._allow_regexp_or_xml(previous_token)) {
2876
- var xmlStr = '';
2877
- var match = this.__patterns.xml.read_match();
2878
- // handle e4x xml literals
2879
- //
2880
- if (match) {
2881
- // Trim root tag to attempt to
2882
- var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}');
2883
- var isCurlyRoot = rootTag.indexOf('{') === 0;
2884
- var depth = 0;
2885
- while (match) {
2886
- var isEndTag = !!match[1];
2887
- var tagName = match[2];
2888
- var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA[");
2889
- if (!isSingletonTag &&
2890
- (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) {
2891
- if (isEndTag) {
2892
- --depth;
2893
- } else {
2894
- ++depth;
2895
- }
2896
- }
2897
- xmlStr += match[0];
2898
- if (depth <= 0) {
2899
- break;
2900
- }
2901
- match = this.__patterns.xml.read_match();
2902
- }
2903
- // if we didn't close correctly, keep unformatted.
2904
- if (!match) {
2905
- xmlStr += this._input.match(/[\s\S]*/g)[0];
2906
- }
2907
- xmlStr = xmlStr.replace(acorn.allLineBreaks, '\n');
2908
- return this._create_token(TOKEN.STRING, xmlStr);
2909
- }
2910
- }
2911
-
2912
- return null;
2913
- };
2914
-
2915
- function unescape_string(s) {
2916
- // You think that a regex would work for this
2917
- // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) {
2918
- // return String.fromCharCode(parseInt(val, 16));
2919
- // })
2920
- // However, dealing with '\xff', '\\xff', '\\\xff' makes this more fun.
2921
- var out = '',
2922
- escaped = 0;
2923
-
2924
- var input_scan = new InputScanner(s);
2925
- var matched = null;
2926
-
2927
- while (input_scan.hasNext()) {
2928
- // Keep any whitespace, non-slash characters
2929
- // also keep slash pairs.
2930
- matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g);
2931
-
2932
- if (matched) {
2933
- out += matched[0];
2934
- }
2935
-
2936
- if (input_scan.peek() === '\\') {
2937
- input_scan.next();
2938
- if (input_scan.peek() === 'x') {
2939
- matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);
2940
- } else if (input_scan.peek() === 'u') {
2941
- matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);
2942
- } else {
2943
- out += '\\';
2944
- if (input_scan.hasNext()) {
2945
- out += input_scan.next();
2946
- }
2947
- continue;
2948
- }
2949
-
2950
- // If there's some error decoding, return the original string
2951
- if (!matched) {
2952
- return s;
2953
- }
2954
-
2955
- escaped = parseInt(matched[1], 16);
2956
-
2957
- if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {
2958
- // we bail out on \x7f..\xff,
2959
- // leaving whole string escaped,
2960
- // as it's probably completely binary
2961
- return s;
2962
- } else if (escaped >= 0x00 && escaped < 0x20) {
2963
- // leave 0x00...0x1f escaped
2964
- out += '\\' + matched[0];
2965
- continue;
2966
- } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {
2967
- // single-quote, apostrophe, backslash - escape these
2968
- out += '\\' + String.fromCharCode(escaped);
2969
- } else {
2970
- out += String.fromCharCode(escaped);
2971
- }
2972
- }
2973
- }
2974
-
2975
- return out;
2976
- }
2977
-
2978
- // handle string
2979
- //
2980
- Tokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {
2981
- var current_char;
2982
- var pattern;
2983
- if (delimiter === '\'') {
2984
- pattern = this.__patterns.single_quote;
2985
- } else if (delimiter === '"') {
2986
- pattern = this.__patterns.double_quote;
2987
- } else if (delimiter === '`') {
2988
- pattern = this.__patterns.template_text;
2989
- } else if (delimiter === '}') {
2990
- pattern = this.__patterns.template_expression;
2991
- }
2992
-
2993
- var resulting_string = pattern.read();
2994
- var next = '';
2995
- while (this._input.hasNext()) {
2996
- next = this._input.next();
2997
- if (next === delimiter ||
2998
- (!allow_unescaped_newlines && acorn.newline.test(next))) {
2999
- this._input.back();
3000
- break;
3001
- } else if (next === '\\' && this._input.hasNext()) {
3002
- current_char = this._input.peek();
3003
-
3004
- if (current_char === 'x' || current_char === 'u') {
3005
- this.has_char_escapes = true;
3006
- } else if (current_char === '\r' && this._input.peek(1) === '\n') {
3007
- this._input.next();
3008
- }
3009
- next += this._input.next();
3010
- } else if (start_sub) {
3011
- if (start_sub === '${' && next === '$' && this._input.peek() === '{') {
3012
- next += this._input.next();
3013
- }
3014
-
3015
- if (start_sub === next) {
3016
- if (delimiter === '`') {
3017
- next += this._read_string_recursive('}', allow_unescaped_newlines, '`');
3018
- } else {
3019
- next += this._read_string_recursive('`', allow_unescaped_newlines, '${');
3020
- }
3021
- if (this._input.hasNext()) {
3022
- next += this._input.next();
3023
- }
3024
- }
3025
- }
3026
- next += pattern.read();
3027
- resulting_string += next;
3028
- }
3029
-
3030
- return resulting_string;
3031
- };
3032
-
3033
- module.exports.Tokenizer = Tokenizer;
3034
- module.exports.TOKEN = TOKEN;
3035
- module.exports.positionable_operators = positionable_operators.slice();
3036
- module.exports.line_starters = line_starters.slice();
3037
-
3038
-
3039
- /***/ }),
3040
- /* 8 */
3041
- /***/ (function(module) {
3042
-
3043
- /*jshint node:true */
3044
- /*
3045
-
3046
- The MIT License (MIT)
3047
-
3048
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3049
-
3050
- Permission is hereby granted, free of charge, to any person
3051
- obtaining a copy of this software and associated documentation files
3052
- (the "Software"), to deal in the Software without restriction,
3053
- including without limitation the rights to use, copy, modify, merge,
3054
- publish, distribute, sublicense, and/or sell copies of the Software,
3055
- and to permit persons to whom the Software is furnished to do so,
3056
- subject to the following conditions:
3057
-
3058
- The above copyright notice and this permission notice shall be
3059
- included in all copies or substantial portions of the Software.
3060
-
3061
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3062
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3063
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3064
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3065
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3066
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3067
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3068
- SOFTWARE.
3069
- */
3070
-
3071
-
3072
-
3073
- var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
3074
-
3075
- function InputScanner(input_string) {
3076
- this.__input = input_string || '';
3077
- this.__input_length = this.__input.length;
3078
- this.__position = 0;
3079
- }
3080
-
3081
- InputScanner.prototype.restart = function() {
3082
- this.__position = 0;
3083
- };
3084
-
3085
- InputScanner.prototype.back = function() {
3086
- if (this.__position > 0) {
3087
- this.__position -= 1;
3088
- }
3089
- };
3090
-
3091
- InputScanner.prototype.hasNext = function() {
3092
- return this.__position < this.__input_length;
3093
- };
3094
-
3095
- InputScanner.prototype.next = function() {
3096
- var val = null;
3097
- if (this.hasNext()) {
3098
- val = this.__input.charAt(this.__position);
3099
- this.__position += 1;
3100
- }
3101
- return val;
3102
- };
3103
-
3104
- InputScanner.prototype.peek = function(index) {
3105
- var val = null;
3106
- index = index || 0;
3107
- index += this.__position;
3108
- if (index >= 0 && index < this.__input_length) {
3109
- val = this.__input.charAt(index);
3110
- }
3111
- return val;
3112
- };
3113
-
3114
- // This is a JavaScript only helper function (not in python)
3115
- // Javascript doesn't have a match method
3116
- // and not all implementation support "sticky" flag.
3117
- // If they do not support sticky then both this.match() and this.test() method
3118
- // must get the match and check the index of the match.
3119
- // If sticky is supported and set, this method will use it.
3120
- // Otherwise it will check that global is set, and fall back to the slower method.
3121
- InputScanner.prototype.__match = function(pattern, index) {
3122
- pattern.lastIndex = index;
3123
- var pattern_match = pattern.exec(this.__input);
3124
-
3125
- if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
3126
- if (pattern_match.index !== index) {
3127
- pattern_match = null;
3128
- }
3129
- }
3130
-
3131
- return pattern_match;
3132
- };
3133
-
3134
- InputScanner.prototype.test = function(pattern, index) {
3135
- index = index || 0;
3136
- index += this.__position;
3137
-
3138
- if (index >= 0 && index < this.__input_length) {
3139
- return !!this.__match(pattern, index);
3140
- } else {
3141
- return false;
3142
- }
3143
- };
3144
-
3145
- InputScanner.prototype.testChar = function(pattern, index) {
3146
- // test one character regex match
3147
- var val = this.peek(index);
3148
- pattern.lastIndex = 0;
3149
- return val !== null && pattern.test(val);
3150
- };
3151
-
3152
- InputScanner.prototype.match = function(pattern) {
3153
- var pattern_match = this.__match(pattern, this.__position);
3154
- if (pattern_match) {
3155
- this.__position += pattern_match[0].length;
3156
- } else {
3157
- pattern_match = null;
3158
- }
3159
- return pattern_match;
3160
- };
3161
-
3162
- InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
3163
- var val = '';
3164
- var match;
3165
- if (starting_pattern) {
3166
- match = this.match(starting_pattern);
3167
- if (match) {
3168
- val += match[0];
3169
- }
3170
- }
3171
- if (until_pattern && (match || !starting_pattern)) {
3172
- val += this.readUntil(until_pattern, until_after);
3173
- }
3174
- return val;
3175
- };
3176
-
3177
- InputScanner.prototype.readUntil = function(pattern, until_after) {
3178
- var val = '';
3179
- var match_index = this.__position;
3180
- pattern.lastIndex = this.__position;
3181
- var pattern_match = pattern.exec(this.__input);
3182
- if (pattern_match) {
3183
- match_index = pattern_match.index;
3184
- if (until_after) {
3185
- match_index += pattern_match[0].length;
3186
- }
3187
- } else {
3188
- match_index = this.__input_length;
3189
- }
3190
-
3191
- val = this.__input.substring(this.__position, match_index);
3192
- this.__position = match_index;
3193
- return val;
3194
- };
3195
-
3196
- InputScanner.prototype.readUntilAfter = function(pattern) {
3197
- return this.readUntil(pattern, true);
3198
- };
3199
-
3200
- InputScanner.prototype.get_regexp = function(pattern, match_from) {
3201
- var result = null;
3202
- var flags = 'g';
3203
- if (match_from && regexp_has_sticky) {
3204
- flags = 'y';
3205
- }
3206
- // strings are converted to regexp
3207
- if (typeof pattern === "string" && pattern !== '') {
3208
- // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
3209
- result = new RegExp(pattern, flags);
3210
- } else if (pattern) {
3211
- result = new RegExp(pattern.source, flags);
3212
- }
3213
- return result;
3214
- };
3215
-
3216
- InputScanner.prototype.get_literal_regexp = function(literal_string) {
3217
- return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
3218
- };
3219
-
3220
- /* css beautifier legacy helpers */
3221
- InputScanner.prototype.peekUntilAfter = function(pattern) {
3222
- var start = this.__position;
3223
- var val = this.readUntilAfter(pattern);
3224
- this.__position = start;
3225
- return val;
3226
- };
3227
-
3228
- InputScanner.prototype.lookBack = function(testVal) {
3229
- var start = this.__position - 1;
3230
- return start >= testVal.length && this.__input.substring(start - testVal.length, start)
3231
- .toLowerCase() === testVal;
3232
- };
3233
-
3234
- module.exports.InputScanner = InputScanner;
3235
-
3236
-
3237
- /***/ }),
3238
- /* 9 */
3239
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3240
-
3241
- /*jshint node:true */
3242
- /*
3243
-
3244
- The MIT License (MIT)
3245
-
3246
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3247
-
3248
- Permission is hereby granted, free of charge, to any person
3249
- obtaining a copy of this software and associated documentation files
3250
- (the "Software"), to deal in the Software without restriction,
3251
- including without limitation the rights to use, copy, modify, merge,
3252
- publish, distribute, sublicense, and/or sell copies of the Software,
3253
- and to permit persons to whom the Software is furnished to do so,
3254
- subject to the following conditions:
3255
-
3256
- The above copyright notice and this permission notice shall be
3257
- included in all copies or substantial portions of the Software.
3258
-
3259
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3260
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3261
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3262
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3263
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3264
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3265
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3266
- SOFTWARE.
3267
- */
3268
-
3269
-
3270
-
3271
- var InputScanner = (__webpack_require__(8).InputScanner);
3272
- var Token = (__webpack_require__(3).Token);
3273
- var TokenStream = (__webpack_require__(10).TokenStream);
3274
- var WhitespacePattern = (__webpack_require__(11).WhitespacePattern);
3275
-
3276
- var TOKEN = {
3277
- START: 'TK_START',
3278
- RAW: 'TK_RAW',
3279
- EOF: 'TK_EOF'
3280
- };
3281
-
3282
- var Tokenizer = function(input_string, options) {
3283
- this._input = new InputScanner(input_string);
3284
- this._options = options || {};
3285
- this.__tokens = null;
3286
-
3287
- this._patterns = {};
3288
- this._patterns.whitespace = new WhitespacePattern(this._input);
3289
- };
3290
-
3291
- Tokenizer.prototype.tokenize = function() {
3292
- this._input.restart();
3293
- this.__tokens = new TokenStream();
3294
-
3295
- this._reset();
3296
-
3297
- var current;
3298
- var previous = new Token(TOKEN.START, '');
3299
- var open_token = null;
3300
- var open_stack = [];
3301
- var comments = new TokenStream();
3302
-
3303
- while (previous.type !== TOKEN.EOF) {
3304
- current = this._get_next_token(previous, open_token);
3305
- while (this._is_comment(current)) {
3306
- comments.add(current);
3307
- current = this._get_next_token(previous, open_token);
3308
- }
3309
-
3310
- if (!comments.isEmpty()) {
3311
- current.comments_before = comments;
3312
- comments = new TokenStream();
3313
- }
3314
-
3315
- current.parent = open_token;
3316
-
3317
- if (this._is_opening(current)) {
3318
- open_stack.push(open_token);
3319
- open_token = current;
3320
- } else if (open_token && this._is_closing(current, open_token)) {
3321
- current.opened = open_token;
3322
- open_token.closed = current;
3323
- open_token = open_stack.pop();
3324
- current.parent = open_token;
3325
- }
3326
-
3327
- current.previous = previous;
3328
- previous.next = current;
3329
-
3330
- this.__tokens.add(current);
3331
- previous = current;
3332
- }
3333
-
3334
- return this.__tokens;
3335
- };
3336
-
3337
-
3338
- Tokenizer.prototype._is_first_token = function() {
3339
- return this.__tokens.isEmpty();
3340
- };
3341
-
3342
- Tokenizer.prototype._reset = function() {};
3343
-
3344
- Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
3345
- this._readWhitespace();
3346
- var resulting_string = this._input.read(/.+/g);
3347
- if (resulting_string) {
3348
- return this._create_token(TOKEN.RAW, resulting_string);
3349
- } else {
3350
- return this._create_token(TOKEN.EOF, '');
3351
- }
3352
- };
3353
-
3354
- Tokenizer.prototype._is_comment = function(current_token) { // jshint unused:false
3355
- return false;
3356
- };
3357
-
3358
- Tokenizer.prototype._is_opening = function(current_token) { // jshint unused:false
3359
- return false;
3360
- };
3361
-
3362
- Tokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false
3363
- return false;
3364
- };
3365
-
3366
- Tokenizer.prototype._create_token = function(type, text) {
3367
- var token = new Token(type, text,
3368
- this._patterns.whitespace.newline_count,
3369
- this._patterns.whitespace.whitespace_before_token);
3370
- return token;
3371
- };
3372
-
3373
- Tokenizer.prototype._readWhitespace = function() {
3374
- return this._patterns.whitespace.read();
3375
- };
3376
-
3377
-
3378
-
3379
- module.exports.Tokenizer = Tokenizer;
3380
- module.exports.TOKEN = TOKEN;
3381
-
3382
-
3383
- /***/ }),
3384
- /* 10 */
3385
- /***/ (function(module) {
3386
-
3387
- /*jshint node:true */
3388
- /*
3389
-
3390
- The MIT License (MIT)
3391
-
3392
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3393
-
3394
- Permission is hereby granted, free of charge, to any person
3395
- obtaining a copy of this software and associated documentation files
3396
- (the "Software"), to deal in the Software without restriction,
3397
- including without limitation the rights to use, copy, modify, merge,
3398
- publish, distribute, sublicense, and/or sell copies of the Software,
3399
- and to permit persons to whom the Software is furnished to do so,
3400
- subject to the following conditions:
3401
-
3402
- The above copyright notice and this permission notice shall be
3403
- included in all copies or substantial portions of the Software.
3404
-
3405
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3406
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3407
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3408
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3409
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3410
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3411
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3412
- SOFTWARE.
3413
- */
3414
-
3415
-
3416
-
3417
- function TokenStream(parent_token) {
3418
- // private
3419
- this.__tokens = [];
3420
- this.__tokens_length = this.__tokens.length;
3421
- this.__position = 0;
3422
- this.__parent_token = parent_token;
3423
- }
3424
-
3425
- TokenStream.prototype.restart = function() {
3426
- this.__position = 0;
3427
- };
3428
-
3429
- TokenStream.prototype.isEmpty = function() {
3430
- return this.__tokens_length === 0;
3431
- };
3432
-
3433
- TokenStream.prototype.hasNext = function() {
3434
- return this.__position < this.__tokens_length;
3435
- };
3436
-
3437
- TokenStream.prototype.next = function() {
3438
- var val = null;
3439
- if (this.hasNext()) {
3440
- val = this.__tokens[this.__position];
3441
- this.__position += 1;
3442
- }
3443
- return val;
3444
- };
3445
-
3446
- TokenStream.prototype.peek = function(index) {
3447
- var val = null;
3448
- index = index || 0;
3449
- index += this.__position;
3450
- if (index >= 0 && index < this.__tokens_length) {
3451
- val = this.__tokens[index];
3452
- }
3453
- return val;
3454
- };
3455
-
3456
- TokenStream.prototype.add = function(token) {
3457
- if (this.__parent_token) {
3458
- token.parent = this.__parent_token;
3459
- }
3460
- this.__tokens.push(token);
3461
- this.__tokens_length += 1;
3462
- };
3463
-
3464
- module.exports.TokenStream = TokenStream;
3465
-
3466
-
3467
- /***/ }),
3468
- /* 11 */
3469
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3470
-
3471
- /*jshint node:true */
3472
- /*
3473
-
3474
- The MIT License (MIT)
3475
-
3476
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3477
-
3478
- Permission is hereby granted, free of charge, to any person
3479
- obtaining a copy of this software and associated documentation files
3480
- (the "Software"), to deal in the Software without restriction,
3481
- including without limitation the rights to use, copy, modify, merge,
3482
- publish, distribute, sublicense, and/or sell copies of the Software,
3483
- and to permit persons to whom the Software is furnished to do so,
3484
- subject to the following conditions:
3485
-
3486
- The above copyright notice and this permission notice shall be
3487
- included in all copies or substantial portions of the Software.
3488
-
3489
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3490
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3491
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3492
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3493
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3494
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3495
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3496
- SOFTWARE.
3497
- */
3498
-
3499
-
3500
-
3501
- var Pattern = (__webpack_require__(12).Pattern);
3502
-
3503
- function WhitespacePattern(input_scanner, parent) {
3504
- Pattern.call(this, input_scanner, parent);
3505
- if (parent) {
3506
- this._line_regexp = this._input.get_regexp(parent._line_regexp);
3507
- } else {
3508
- this.__set_whitespace_patterns('', '');
3509
- }
3510
-
3511
- this.newline_count = 0;
3512
- this.whitespace_before_token = '';
3513
- }
3514
- WhitespacePattern.prototype = new Pattern();
3515
-
3516
- WhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) {
3517
- whitespace_chars += '\\t ';
3518
- newline_chars += '\\n\\r';
3519
-
3520
- this._match_pattern = this._input.get_regexp(
3521
- '[' + whitespace_chars + newline_chars + ']+', true);
3522
- this._newline_regexp = this._input.get_regexp(
3523
- '\\r\\n|[' + newline_chars + ']');
3524
- };
3525
-
3526
- WhitespacePattern.prototype.read = function() {
3527
- this.newline_count = 0;
3528
- this.whitespace_before_token = '';
3529
-
3530
- var resulting_string = this._input.read(this._match_pattern);
3531
- if (resulting_string === ' ') {
3532
- this.whitespace_before_token = ' ';
3533
- } else if (resulting_string) {
3534
- var matches = this.__split(this._newline_regexp, resulting_string);
3535
- this.newline_count = matches.length - 1;
3536
- this.whitespace_before_token = matches[this.newline_count];
3537
- }
3538
-
3539
- return resulting_string;
3540
- };
3541
-
3542
- WhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) {
3543
- var result = this._create();
3544
- result.__set_whitespace_patterns(whitespace_chars, newline_chars);
3545
- result._update();
3546
- return result;
3547
- };
3548
-
3549
- WhitespacePattern.prototype._create = function() {
3550
- return new WhitespacePattern(this._input, this);
3551
- };
3552
-
3553
- WhitespacePattern.prototype.__split = function(regexp, input_string) {
3554
- regexp.lastIndex = 0;
3555
- var start_index = 0;
3556
- var result = [];
3557
- var next_match = regexp.exec(input_string);
3558
- while (next_match) {
3559
- result.push(input_string.substring(start_index, next_match.index));
3560
- start_index = next_match.index + next_match[0].length;
3561
- next_match = regexp.exec(input_string);
3562
- }
3563
-
3564
- if (start_index < input_string.length) {
3565
- result.push(input_string.substring(start_index, input_string.length));
3566
- } else {
3567
- result.push('');
3568
- }
3569
-
3570
- return result;
3571
- };
3572
-
3573
-
3574
-
3575
- module.exports.WhitespacePattern = WhitespacePattern;
3576
-
3577
-
3578
- /***/ }),
3579
- /* 12 */
3580
- /***/ (function(module) {
3581
-
3582
- /*jshint node:true */
3583
- /*
3584
-
3585
- The MIT License (MIT)
3586
-
3587
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3588
-
3589
- Permission is hereby granted, free of charge, to any person
3590
- obtaining a copy of this software and associated documentation files
3591
- (the "Software"), to deal in the Software without restriction,
3592
- including without limitation the rights to use, copy, modify, merge,
3593
- publish, distribute, sublicense, and/or sell copies of the Software,
3594
- and to permit persons to whom the Software is furnished to do so,
3595
- subject to the following conditions:
3596
-
3597
- The above copyright notice and this permission notice shall be
3598
- included in all copies or substantial portions of the Software.
3599
-
3600
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3601
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3602
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3603
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3604
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3605
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3606
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3607
- SOFTWARE.
3608
- */
3609
-
3610
-
3611
-
3612
- function Pattern(input_scanner, parent) {
3613
- this._input = input_scanner;
3614
- this._starting_pattern = null;
3615
- this._match_pattern = null;
3616
- this._until_pattern = null;
3617
- this._until_after = false;
3618
-
3619
- if (parent) {
3620
- this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true);
3621
- this._match_pattern = this._input.get_regexp(parent._match_pattern, true);
3622
- this._until_pattern = this._input.get_regexp(parent._until_pattern);
3623
- this._until_after = parent._until_after;
3624
- }
3625
- }
3626
-
3627
- Pattern.prototype.read = function() {
3628
- var result = this._input.read(this._starting_pattern);
3629
- if (!this._starting_pattern || result) {
3630
- result += this._input.read(this._match_pattern, this._until_pattern, this._until_after);
3631
- }
3632
- return result;
3633
- };
3634
-
3635
- Pattern.prototype.read_match = function() {
3636
- return this._input.match(this._match_pattern);
3637
- };
3638
-
3639
- Pattern.prototype.until_after = function(pattern) {
3640
- var result = this._create();
3641
- result._until_after = true;
3642
- result._until_pattern = this._input.get_regexp(pattern);
3643
- result._update();
3644
- return result;
3645
- };
3646
-
3647
- Pattern.prototype.until = function(pattern) {
3648
- var result = this._create();
3649
- result._until_after = false;
3650
- result._until_pattern = this._input.get_regexp(pattern);
3651
- result._update();
3652
- return result;
3653
- };
3654
-
3655
- Pattern.prototype.starting_with = function(pattern) {
3656
- var result = this._create();
3657
- result._starting_pattern = this._input.get_regexp(pattern, true);
3658
- result._update();
3659
- return result;
3660
- };
3661
-
3662
- Pattern.prototype.matching = function(pattern) {
3663
- var result = this._create();
3664
- result._match_pattern = this._input.get_regexp(pattern, true);
3665
- result._update();
3666
- return result;
3667
- };
3668
-
3669
- Pattern.prototype._create = function() {
3670
- return new Pattern(this._input, this);
3671
- };
3672
-
3673
- Pattern.prototype._update = function() {};
3674
-
3675
- module.exports.Pattern = Pattern;
3676
-
3677
-
3678
- /***/ }),
3679
- /* 13 */
3680
- /***/ (function(module) {
3681
-
3682
- /*jshint node:true */
3683
- /*
3684
-
3685
- The MIT License (MIT)
3686
-
3687
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3688
-
3689
- Permission is hereby granted, free of charge, to any person
3690
- obtaining a copy of this software and associated documentation files
3691
- (the "Software"), to deal in the Software without restriction,
3692
- including without limitation the rights to use, copy, modify, merge,
3693
- publish, distribute, sublicense, and/or sell copies of the Software,
3694
- and to permit persons to whom the Software is furnished to do so,
3695
- subject to the following conditions:
3696
-
3697
- The above copyright notice and this permission notice shall be
3698
- included in all copies or substantial portions of the Software.
3699
-
3700
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3701
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3702
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3703
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3704
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3705
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3706
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3707
- SOFTWARE.
3708
- */
3709
-
3710
-
3711
-
3712
- function Directives(start_block_pattern, end_block_pattern) {
3713
- start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
3714
- end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
3715
- this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
3716
- this.__directive_pattern = / (\w+)[:](\w+)/g;
3717
-
3718
- this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
3719
- }
3720
-
3721
- Directives.prototype.get_directives = function(text) {
3722
- if (!text.match(this.__directives_block_pattern)) {
3723
- return null;
3724
- }
3725
-
3726
- var directives = {};
3727
- this.__directive_pattern.lastIndex = 0;
3728
- var directive_match = this.__directive_pattern.exec(text);
3729
-
3730
- while (directive_match) {
3731
- directives[directive_match[1]] = directive_match[2];
3732
- directive_match = this.__directive_pattern.exec(text);
3733
- }
3734
-
3735
- return directives;
3736
- };
3737
-
3738
- Directives.prototype.readIgnored = function(input) {
3739
- return input.readUntilAfter(this.__directives_end_ignore_pattern);
3740
- };
3741
-
3742
-
3743
- module.exports.Directives = Directives;
3744
-
3745
-
3746
- /***/ }),
3747
- /* 14 */
3748
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3749
-
3750
- /*jshint node:true */
3751
- /*
3752
-
3753
- The MIT License (MIT)
3754
-
3755
- Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
3756
-
3757
- Permission is hereby granted, free of charge, to any person
3758
- obtaining a copy of this software and associated documentation files
3759
- (the "Software"), to deal in the Software without restriction,
3760
- including without limitation the rights to use, copy, modify, merge,
3761
- publish, distribute, sublicense, and/or sell copies of the Software,
3762
- and to permit persons to whom the Software is furnished to do so,
3763
- subject to the following conditions:
3764
-
3765
- The above copyright notice and this permission notice shall be
3766
- included in all copies or substantial portions of the Software.
3767
-
3768
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3769
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3770
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3771
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3772
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3773
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3774
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3775
- SOFTWARE.
3776
- */
3777
-
3778
-
3779
-
3780
- var Pattern = (__webpack_require__(12).Pattern);
3781
-
3782
-
3783
- var template_names = {
3784
- django: false,
3785
- erb: false,
3786
- handlebars: false,
3787
- php: false,
3788
- smarty: false
3789
- };
3790
-
3791
- // This lets templates appear anywhere we would do a readUntil
3792
- // The cost is higher but it is pay to play.
3793
- function TemplatablePattern(input_scanner, parent) {
3794
- Pattern.call(this, input_scanner, parent);
3795
- this.__template_pattern = null;
3796
- this._disabled = Object.assign({}, template_names);
3797
- this._excluded = Object.assign({}, template_names);
3798
-
3799
- if (parent) {
3800
- this.__template_pattern = this._input.get_regexp(parent.__template_pattern);
3801
- this._excluded = Object.assign(this._excluded, parent._excluded);
3802
- this._disabled = Object.assign(this._disabled, parent._disabled);
3803
- }
3804
- var pattern = new Pattern(input_scanner);
3805
- this.__patterns = {
3806
- handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
3807
- handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
3808
- handlebars: pattern.starting_with(/{{/).until_after(/}}/),
3809
- php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
3810
- erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
3811
- // django coflicts with handlebars a bit.
3812
- django: pattern.starting_with(/{%/).until_after(/%}/),
3813
- django_value: pattern.starting_with(/{{/).until_after(/}}/),
3814
- django_comment: pattern.starting_with(/{#/).until_after(/#}/),
3815
- smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
3816
- smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
3817
- smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
3818
- };
3819
- }
3820
- TemplatablePattern.prototype = new Pattern();
3821
-
3822
- TemplatablePattern.prototype._create = function() {
3823
- return new TemplatablePattern(this._input, this);
3824
- };
3825
-
3826
- TemplatablePattern.prototype._update = function() {
3827
- this.__set_templated_pattern();
3828
- };
3829
-
3830
- TemplatablePattern.prototype.disable = function(language) {
3831
- var result = this._create();
3832
- result._disabled[language] = true;
3833
- result._update();
3834
- return result;
3835
- };
3836
-
3837
- TemplatablePattern.prototype.read_options = function(options) {
3838
- var result = this._create();
3839
- for (var language in template_names) {
3840
- result._disabled[language] = options.templating.indexOf(language) === -1;
3841
- }
3842
- result._update();
3843
- return result;
3844
- };
3845
-
3846
- TemplatablePattern.prototype.exclude = function(language) {
3847
- var result = this._create();
3848
- result._excluded[language] = true;
3849
- result._update();
3850
- return result;
3851
- };
3852
-
3853
- TemplatablePattern.prototype.read = function() {
3854
- var result = '';
3855
- if (this._match_pattern) {
3856
- result = this._input.read(this._starting_pattern);
3857
- } else {
3858
- result = this._input.read(this._starting_pattern, this.__template_pattern);
3859
- }
3860
- var next = this._read_template();
3861
- while (next) {
3862
- if (this._match_pattern) {
3863
- next += this._input.read(this._match_pattern);
3864
- } else {
3865
- next += this._input.readUntil(this.__template_pattern);
3866
- }
3867
- result += next;
3868
- next = this._read_template();
3869
- }
3870
-
3871
- if (this._until_after) {
3872
- result += this._input.readUntilAfter(this._until_pattern);
3873
- }
3874
- return result;
3875
- };
3876
-
3877
- TemplatablePattern.prototype.__set_templated_pattern = function() {
3878
- var items = [];
3879
-
3880
- if (!this._disabled.php) {
3881
- items.push(this.__patterns.php._starting_pattern.source);
3882
- }
3883
- if (!this._disabled.handlebars) {
3884
- items.push(this.__patterns.handlebars._starting_pattern.source);
3885
- }
3886
- if (!this._disabled.erb) {
3887
- items.push(this.__patterns.erb._starting_pattern.source);
3888
- }
3889
- if (!this._disabled.django) {
3890
- items.push(this.__patterns.django._starting_pattern.source);
3891
- // The starting pattern for django is more complex because it has different
3892
- // patterns for value, comment, and other sections
3893
- items.push(this.__patterns.django_value._starting_pattern.source);
3894
- items.push(this.__patterns.django_comment._starting_pattern.source);
3895
- }
3896
- if (!this._disabled.smarty) {
3897
- items.push(this.__patterns.smarty._starting_pattern.source);
3898
- }
3899
-
3900
- if (this._until_pattern) {
3901
- items.push(this._until_pattern.source);
3902
- }
3903
- this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')');
3904
- };
3905
-
3906
- TemplatablePattern.prototype._read_template = function() {
3907
- var resulting_string = '';
3908
- var c = this._input.peek();
3909
- if (c === '<') {
3910
- var peek1 = this._input.peek(1);
3911
- //if we're in a comment, do something special
3912
- // We treat all comments as literals, even more than preformatted tags
3913
- // we just look for the appropriate close tag
3914
- if (!this._disabled.php && !this._excluded.php && peek1 === '?') {
3915
- resulting_string = resulting_string ||
3916
- this.__patterns.php.read();
3917
- }
3918
- if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') {
3919
- resulting_string = resulting_string ||
3920
- this.__patterns.erb.read();
3921
- }
3922
- } else if (c === '{') {
3923
- if (!this._disabled.handlebars && !this._excluded.handlebars) {
3924
- resulting_string = resulting_string ||
3925
- this.__patterns.handlebars_comment.read();
3926
- resulting_string = resulting_string ||
3927
- this.__patterns.handlebars_unescaped.read();
3928
- resulting_string = resulting_string ||
3929
- this.__patterns.handlebars.read();
3930
- }
3931
- if (!this._disabled.django) {
3932
- // django coflicts with handlebars a bit.
3933
- if (!this._excluded.django && !this._excluded.handlebars) {
3934
- resulting_string = resulting_string ||
3935
- this.__patterns.django_value.read();
3936
- }
3937
- if (!this._excluded.django) {
3938
- resulting_string = resulting_string ||
3939
- this.__patterns.django_comment.read();
3940
- resulting_string = resulting_string ||
3941
- this.__patterns.django.read();
3942
- }
3943
- }
3944
- if (!this._disabled.smarty) {
3945
- // smarty cannot be enabled with django or handlebars enabled
3946
- if (this._disabled.django && this._disabled.handlebars) {
3947
- resulting_string = resulting_string ||
3948
- this.__patterns.smarty_comment.read();
3949
- resulting_string = resulting_string ||
3950
- this.__patterns.smarty_literal.read();
3951
- resulting_string = resulting_string ||
3952
- this.__patterns.smarty.read();
3953
- }
3954
- }
3955
- }
3956
- return resulting_string;
3957
- };
3958
-
3959
-
3960
- module.exports.TemplatablePattern = TemplatablePattern;
3961
-
3962
-
3963
- /***/ })
3964
- /******/ ]);
3965
- /************************************************************************/
3966
- /******/ // The module cache
3967
- /******/ var __webpack_module_cache__ = {};
3968
- /******/
3969
- /******/ // The require function
3970
- /******/ function __webpack_require__(moduleId) {
3971
- /******/ // Check if module is in cache
3972
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
3973
- /******/ if (cachedModule !== undefined) {
3974
- /******/ return cachedModule.exports;
3975
- /******/ }
3976
- /******/ // Create a new module (and put it into the cache)
3977
- /******/ var module = __webpack_module_cache__[moduleId] = {
3978
- /******/ // no module.id needed
3979
- /******/ // no module.loaded needed
3980
- /******/ exports: {}
3981
- /******/ };
3982
- /******/
3983
- /******/ // Execute the module function
3984
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3985
- /******/
3986
- /******/ // Return the exports of the module
3987
- /******/ return module.exports;
3988
- /******/ }
3989
- /******/
3990
- /************************************************************************/
3991
- /******/
3992
- /******/ // startup
3993
- /******/ // Load entry module and return exports
3994
- /******/ // This entry module is referenced by other modules so it can't be inlined
3995
- /******/ var __webpack_exports__ = __webpack_require__(0);
3996
- /******/ legacy_beautify_js = __webpack_exports__;
3997
- /******/
3998
- /******/ })()
3999
- ;
4000
- var js_beautify = legacy_beautify_js;
4001
- /* Footer */
4002
- if (typeof define === "function" && define.amd) {
4003
- // Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
4004
- define([], function() {
4005
- return { js_beautify: js_beautify };
4006
- });
4007
- } else if (typeof exports !== "undefined") {
4008
- // Add support for CommonJS. Just put this file somewhere on your require.paths
4009
- // and you will be able to `var js_beautify = require("beautify").js_beautify`.
4010
- exports.js_beautify = js_beautify;
4011
- } else if (typeof window !== "undefined") {
4012
- // If we're running a web page and don't have either of the above, add our one global
4013
- window.js_beautify = js_beautify;
4014
- } else if (typeof global !== "undefined") {
4015
- // If we don't even have window, try global.
4016
- global.js_beautify = js_beautify;
4017
- }
4018
-
4019
- }());
4020
-