projen 0.99.71 → 0.99.73

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 (534) hide show
  1. package/.jsii +3 -3
  2. package/lib/ai-instructions.js +2 -2
  3. package/lib/awscdk/auto-discover.js +6 -6
  4. package/lib/awscdk/awscdk-app-java.js +1 -1
  5. package/lib/awscdk/awscdk-app-py.js +1 -1
  6. package/lib/awscdk/awscdk-app-ts.js +1 -1
  7. package/lib/awscdk/awscdk-construct.js +2 -2
  8. package/lib/awscdk/awscdk-deps-java.js +1 -1
  9. package/lib/awscdk/awscdk-deps-js.js +1 -1
  10. package/lib/awscdk/awscdk-deps-py.js +1 -1
  11. package/lib/awscdk/awscdk-deps.js +1 -1
  12. package/lib/awscdk/cdk-config.js +4 -4
  13. package/lib/awscdk/cdk-tasks.js +1 -1
  14. package/lib/awscdk/integration-test.js +1 -1
  15. package/lib/awscdk/lambda-extension.js +1 -1
  16. package/lib/awscdk/lambda-function.js +2 -2
  17. package/lib/awscdk/private/feature-flags-v2.const.d.ts +1 -1
  18. package/lib/awscdk/private/feature-flags-v2.const.js +2 -2
  19. package/lib/build/build-workflow.js +1 -1
  20. package/lib/cdk/auto-discover-base.js +2 -2
  21. package/lib/cdk/construct-lib.js +1 -1
  22. package/lib/cdk/integration-test-base.js +1 -1
  23. package/lib/cdk/jsii-build.js +1 -1
  24. package/lib/cdk/jsii-docgen.js +1 -1
  25. package/lib/cdk/jsii-project.js +1 -1
  26. package/lib/cdk8s/auto-discover.js +2 -2
  27. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  28. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  29. package/lib/cdk8s/cdk8s-construct.js +1 -1
  30. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  31. package/lib/cdk8s/cdk8s-deps.js +1 -1
  32. package/lib/cdk8s/integration-test.js +1 -1
  33. package/lib/cdktf/cdktf-construct.js +1 -1
  34. package/lib/circleci/circleci.js +1 -1
  35. package/lib/component.js +1 -1
  36. package/lib/dependencies.js +1 -1
  37. package/lib/dev-env.js +1 -1
  38. package/lib/docker-compose/docker-compose-service.js +1 -1
  39. package/lib/docker-compose/docker-compose.js +1 -1
  40. package/lib/file.js +1 -1
  41. package/lib/gitattributes.js +1 -1
  42. package/lib/github/actions-provider.js +1 -1
  43. package/lib/github/auto-approve.js +1 -1
  44. package/lib/github/auto-merge.js +1 -1
  45. package/lib/github/auto-queue.js +1 -1
  46. package/lib/github/dependabot.js +1 -1
  47. package/lib/github/dependency-review.js +1 -1
  48. package/lib/github/github-credentials.js +1 -1
  49. package/lib/github/github-project.js +1 -1
  50. package/lib/github/github.js +1 -1
  51. package/lib/github/merge-queue.js +1 -1
  52. package/lib/github/mergify.js +1 -1
  53. package/lib/github/pr-template.js +1 -1
  54. package/lib/github/pull-request-backport.js +1 -1
  55. package/lib/github/pull-request-lint.js +1 -1
  56. package/lib/github/stale.js +1 -1
  57. package/lib/github/task-workflow-job.js +1 -1
  58. package/lib/github/task-workflow.js +1 -1
  59. package/lib/github/workflow-actions.js +1 -1
  60. package/lib/github/workflow-jobs.js +1 -1
  61. package/lib/github/workflow-steps.js +1 -1
  62. package/lib/github/workflows.js +1 -1
  63. package/lib/gitlab/configuration.js +1 -1
  64. package/lib/gitlab/gitlab-configuration.js +1 -1
  65. package/lib/gitlab/nested-configuration.js +1 -1
  66. package/lib/gitpod.js +1 -1
  67. package/lib/ignore-file.js +1 -1
  68. package/lib/ini.js +1 -1
  69. package/lib/java/java-project.js +1 -1
  70. package/lib/java/junit.js +1 -1
  71. package/lib/java/maven-compile.js +1 -1
  72. package/lib/java/maven-packaging.js +1 -1
  73. package/lib/java/maven-sample.js +1 -1
  74. package/lib/java/pom.js +2 -2
  75. package/lib/java/projenrc.js +1 -1
  76. package/lib/javascript/biome/biome.js +1 -1
  77. package/lib/javascript/bundler.js +1 -1
  78. package/lib/javascript/eslint.js +1 -1
  79. package/lib/javascript/jest.js +4 -4
  80. package/lib/javascript/license-checker.js +1 -1
  81. package/lib/javascript/node-package.js +1 -1
  82. package/lib/javascript/node-project.js +1 -1
  83. package/lib/javascript/npm-config.js +1 -1
  84. package/lib/javascript/prettier.js +1 -1
  85. package/lib/javascript/projenrc.js +1 -1
  86. package/lib/javascript/typescript-config.js +2 -2
  87. package/lib/javascript/upgrade-dependencies.js +2 -2
  88. package/lib/javascript/yarnrc.js +1 -1
  89. package/lib/json-patch.js +1 -1
  90. package/lib/json.js +1 -1
  91. package/lib/license.js +1 -1
  92. package/lib/logger.js +1 -1
  93. package/lib/makefile.js +1 -1
  94. package/lib/object-file.js +1 -1
  95. package/lib/project-build.js +1 -1
  96. package/lib/project-tree.js +1 -1
  97. package/lib/project.js +1 -1
  98. package/lib/projects.js +1 -1
  99. package/lib/projenrc-json.js +2 -2
  100. package/lib/projenrc.js +1 -1
  101. package/lib/python/pip.js +1 -1
  102. package/lib/python/poetry.js +2 -2
  103. package/lib/python/projenrc.js +1 -1
  104. package/lib/python/pyproject-toml-file.js +1 -1
  105. package/lib/python/pytest-sample.js +1 -1
  106. package/lib/python/pytest.js +1 -1
  107. package/lib/python/python-project.js +1 -1
  108. package/lib/python/python-sample.js +1 -1
  109. package/lib/python/requirements-file.js +1 -1
  110. package/lib/python/setuppy.js +1 -1
  111. package/lib/python/setuptools.js +1 -1
  112. package/lib/python/uv.js +1 -1
  113. package/lib/python/venv.js +1 -1
  114. package/lib/readme.js +1 -1
  115. package/lib/release/publisher.js +1 -1
  116. package/lib/release/release-trigger.js +1 -1
  117. package/lib/release/release.js +1 -1
  118. package/lib/renovatebot.js +1 -1
  119. package/lib/sample-file.js +2 -2
  120. package/lib/semver.js +1 -1
  121. package/lib/source-code.js +1 -1
  122. package/lib/task-runtime.js +1 -1
  123. package/lib/task.js +1 -1
  124. package/lib/tasks.js +1 -1
  125. package/lib/testing.js +1 -1
  126. package/lib/textfile.js +1 -1
  127. package/lib/toml.js +1 -1
  128. package/lib/typescript/projenrc-ts.js +1 -1
  129. package/lib/typescript/projenrc.js +1 -1
  130. package/lib/typescript/typescript-typedoc.js +1 -1
  131. package/lib/typescript/typescript.js +6 -6
  132. package/lib/version.js +2 -2
  133. package/lib/vscode/devcontainer.js +1 -1
  134. package/lib/vscode/extensions.js +1 -1
  135. package/lib/vscode/launch-config.js +1 -1
  136. package/lib/vscode/settings.js +1 -1
  137. package/lib/vscode/vscode.js +1 -1
  138. package/lib/web/next.js +3 -3
  139. package/lib/web/postcss.js +1 -1
  140. package/lib/web/react.js +4 -4
  141. package/lib/web/tailwind.js +1 -1
  142. package/lib/xmlfile.js +1 -1
  143. package/lib/yaml.js +1 -1
  144. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/README.md +10 -15
  145. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/enoent.js +1 -1
  146. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/parse.js +1 -35
  147. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/readShebang.js +1 -10
  148. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/resolveCommand.js +4 -3
  149. package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/package.json +23 -25
  150. package/node_modules/execa/index.d.ts +564 -0
  151. package/node_modules/execa/index.js +268 -0
  152. package/node_modules/execa/lib/command.js +52 -0
  153. package/node_modules/execa/lib/error.js +88 -0
  154. package/node_modules/execa/lib/kill.js +115 -0
  155. package/node_modules/execa/lib/promise.js +46 -0
  156. package/node_modules/execa/lib/stdio.js +52 -0
  157. package/node_modules/execa/lib/stream.js +97 -0
  158. package/node_modules/execa/license +9 -0
  159. package/node_modules/execa/package.json +74 -0
  160. package/node_modules/execa/readme.md +663 -0
  161. package/node_modules/fastq/README.md +0 -2
  162. package/node_modules/fastq/eslint.config.js +11 -0
  163. package/node_modules/fastq/example.mjs +0 -2
  164. package/node_modules/fastq/index.d.ts +2 -0
  165. package/node_modules/fastq/package.json +5 -9
  166. package/node_modules/fastq/queue.js +36 -1
  167. package/node_modules/fastq/test/promise.js +34 -0
  168. package/node_modules/fastq/test/test.js +80 -0
  169. package/node_modules/get-stream/buffer-stream.js +52 -0
  170. package/node_modules/get-stream/index.d.ts +105 -0
  171. package/node_modules/get-stream/index.js +61 -0
  172. package/node_modules/get-stream/license +9 -0
  173. package/node_modules/{shelljs/node_modules/get-stream → get-stream}/package.json +11 -10
  174. package/node_modules/{shelljs/node_modules/get-stream → get-stream}/readme.md +19 -18
  175. package/node_modules/human-signals/LICENSE +201 -0
  176. package/node_modules/human-signals/README.md +165 -0
  177. package/node_modules/human-signals/build/src/core.js +273 -0
  178. package/node_modules/human-signals/build/src/core.js.map +1 -0
  179. package/node_modules/human-signals/build/src/main.d.ts +52 -0
  180. package/node_modules/human-signals/build/src/main.js +71 -0
  181. package/node_modules/human-signals/build/src/main.js.map +1 -0
  182. package/node_modules/human-signals/build/src/realtime.js +19 -0
  183. package/node_modules/human-signals/build/src/realtime.js.map +1 -0
  184. package/node_modules/human-signals/build/src/signals.js +35 -0
  185. package/node_modules/human-signals/build/src/signals.js.map +1 -0
  186. package/node_modules/human-signals/package.json +64 -0
  187. package/node_modules/is-stream/index.d.ts +79 -0
  188. package/node_modules/is-stream/index.js +28 -0
  189. package/node_modules/is-stream/license +9 -0
  190. package/node_modules/is-stream/package.json +42 -0
  191. package/node_modules/is-stream/readme.md +60 -0
  192. package/node_modules/js-yaml/README.md +4 -20
  193. package/node_modules/js-yaml/bin/js-yaml.js +53 -62
  194. package/node_modules/js-yaml/dist/js-yaml.js +2404 -3880
  195. package/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
  196. package/node_modules/js-yaml/dist/js-yaml.min.js +33 -2
  197. package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -0
  198. package/node_modules/js-yaml/dist/js-yaml.mjs +2381 -3855
  199. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -0
  200. package/node_modules/js-yaml/index.js +32 -35
  201. package/node_modules/js-yaml/lib/common.js +28 -37
  202. package/node_modules/js-yaml/lib/dumper.js +450 -478
  203. package/node_modules/js-yaml/lib/exception.js +23 -27
  204. package/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +37 -0
  205. package/node_modules/js-yaml/lib/loader.js +927 -866
  206. package/node_modules/js-yaml/lib/schema/core.js +2 -4
  207. package/node_modules/js-yaml/lib/schema/default.js +2 -4
  208. package/node_modules/js-yaml/lib/schema/failsafe.js +3 -6
  209. package/node_modules/js-yaml/lib/schema/json.js +2 -4
  210. package/node_modules/js-yaml/lib/schema.js +56 -68
  211. package/node_modules/js-yaml/lib/snippet.js +47 -52
  212. package/node_modules/js-yaml/lib/type/binary.js +61 -64
  213. package/node_modules/js-yaml/lib/type/bool.js +14 -14
  214. package/node_modules/js-yaml/lib/type/float.js +47 -45
  215. package/node_modules/js-yaml/lib/type/int.js +65 -79
  216. package/node_modules/js-yaml/lib/type/map.js +4 -4
  217. package/node_modules/js-yaml/lib/type/merge.js +5 -5
  218. package/node_modules/js-yaml/lib/type/null.js +16 -16
  219. package/node_modules/js-yaml/lib/type/omap.js +22 -21
  220. package/node_modules/js-yaml/lib/type/pairs.js +24 -27
  221. package/node_modules/js-yaml/lib/type/seq.js +4 -4
  222. package/node_modules/js-yaml/lib/type/set.js +12 -12
  223. package/node_modules/js-yaml/lib/type/str.js +4 -4
  224. package/node_modules/js-yaml/lib/type/timestamp.js +53 -53
  225. package/node_modules/js-yaml/lib/type.js +30 -30
  226. package/node_modules/js-yaml/package.json +32 -21
  227. package/node_modules/{nice-try → merge-stream}/LICENSE +1 -1
  228. package/node_modules/merge-stream/README.md +78 -0
  229. package/node_modules/merge-stream/index.js +41 -0
  230. package/node_modules/merge-stream/package.json +19 -0
  231. package/node_modules/mimic-fn/index.d.ts +54 -0
  232. package/node_modules/mimic-fn/index.js +13 -0
  233. package/node_modules/mimic-fn/package.json +42 -0
  234. package/node_modules/mimic-fn/readme.md +69 -0
  235. package/node_modules/npm-run-path/index.d.ts +89 -0
  236. package/node_modules/npm-run-path/index.js +47 -0
  237. package/node_modules/npm-run-path/package.json +44 -0
  238. package/node_modules/{shelljs/node_modules/npm-run-path → npm-run-path}/readme.md +39 -5
  239. package/node_modules/onetime/index.d.ts +64 -0
  240. package/node_modules/onetime/index.js +44 -0
  241. package/node_modules/onetime/license +9 -0
  242. package/node_modules/onetime/package.json +43 -0
  243. package/node_modules/onetime/readme.md +94 -0
  244. package/node_modules/path-key/index.d.ts +40 -0
  245. package/node_modules/path-key/index.js +16 -0
  246. package/node_modules/path-key/license +9 -0
  247. package/node_modules/path-key/package.json +39 -0
  248. package/node_modules/{shelljs/node_modules/path-key → path-key}/readme.md +15 -5
  249. package/node_modules/semver/classes/range.js +11 -2
  250. package/node_modules/semver/package.json +2 -2
  251. package/node_modules/shebang-command/index.js +19 -0
  252. package/node_modules/shebang-command/license +9 -0
  253. package/node_modules/shebang-command/package.json +34 -0
  254. package/node_modules/{shelljs/node_modules/shebang-command → shebang-command}/readme.md +1 -6
  255. package/node_modules/shebang-regex/index.d.ts +22 -0
  256. package/node_modules/shebang-regex/index.js +2 -0
  257. package/node_modules/shebang-regex/license +9 -0
  258. package/node_modules/shebang-regex/package.json +35 -0
  259. package/node_modules/shebang-regex/readme.md +33 -0
  260. package/node_modules/shelljs/README.md +7 -1
  261. package/node_modules/shelljs/global.js +4 -1
  262. package/node_modules/shelljs/package.json +8 -13
  263. package/node_modules/shelljs/shell.js +9 -7
  264. package/node_modules/shelljs/src/cat.js +1 -1
  265. package/node_modules/shelljs/src/chmod.js +1 -1
  266. package/node_modules/shelljs/src/cmd.js +25 -9
  267. package/node_modules/shelljs/src/common.js +11 -8
  268. package/node_modules/shelljs/src/dirs.js +1 -1
  269. package/node_modules/shelljs/src/exec.js +6 -6
  270. package/node_modules/shelljs/src/grep.js +121 -7
  271. package/node_modules/shelljs/src/head.js +1 -1
  272. package/node_modules/shelljs/src/ls.js +1 -1
  273. package/node_modules/shelljs/src/mkdir.js +1 -1
  274. package/node_modules/shelljs/src/rm.js +1 -1
  275. package/node_modules/shelljs/src/sed.js +1 -1
  276. package/node_modules/shelljs/src/sort.js +1 -1
  277. package/node_modules/shelljs/src/tail.js +1 -1
  278. package/node_modules/shelljs/src/tempdir.js +1 -1
  279. package/node_modules/shelljs/src/test.js +1 -1
  280. package/node_modules/shelljs/src/to.js +1 -1
  281. package/node_modules/shelljs/src/toEnd.js +1 -1
  282. package/node_modules/shelljs/src/touch.js +1 -1
  283. package/node_modules/shelljs/src/uniq.js +1 -1
  284. package/node_modules/shelljs/src/which.js +1 -1
  285. package/node_modules/strip-final-newline/index.js +16 -0
  286. package/node_modules/strip-final-newline/license +9 -0
  287. package/node_modules/strip-final-newline/package.json +40 -0
  288. package/node_modules/strip-final-newline/readme.md +30 -0
  289. package/node_modules/{shelljs/node_modules/which → which}/README.md +3 -0
  290. package/node_modules/which/package.json +43 -0
  291. package/node_modules/which/which.js +125 -0
  292. package/package.json +5 -2
  293. package/node_modules/end-of-stream/LICENSE +0 -21
  294. package/node_modules/end-of-stream/README.md +0 -54
  295. package/node_modules/end-of-stream/index.js +0 -96
  296. package/node_modules/end-of-stream/package.json +0 -37
  297. package/node_modules/fastq/.github/dependabot.yml +0 -11
  298. package/node_modules/fastq/.github/workflows/ci.yml +0 -75
  299. package/node_modules/function-bind/.eslintrc +0 -21
  300. package/node_modules/function-bind/.github/FUNDING.yml +0 -12
  301. package/node_modules/function-bind/.github/SECURITY.md +0 -3
  302. package/node_modules/function-bind/.nycrc +0 -13
  303. package/node_modules/function-bind/CHANGELOG.md +0 -136
  304. package/node_modules/function-bind/LICENSE +0 -20
  305. package/node_modules/function-bind/README.md +0 -46
  306. package/node_modules/function-bind/implementation.js +0 -84
  307. package/node_modules/function-bind/index.js +0 -5
  308. package/node_modules/function-bind/package.json +0 -87
  309. package/node_modules/function-bind/test/.eslintrc +0 -9
  310. package/node_modules/function-bind/test/index.js +0 -252
  311. package/node_modules/hasown/.eslintrc +0 -5
  312. package/node_modules/hasown/.github/FUNDING.yml +0 -12
  313. package/node_modules/hasown/.nycrc +0 -13
  314. package/node_modules/hasown/CHANGELOG.md +0 -40
  315. package/node_modules/hasown/LICENSE +0 -21
  316. package/node_modules/hasown/README.md +0 -40
  317. package/node_modules/hasown/index.d.ts +0 -3
  318. package/node_modules/hasown/index.js +0 -8
  319. package/node_modules/hasown/package.json +0 -92
  320. package/node_modules/hasown/tsconfig.json +0 -6
  321. package/node_modules/interpret/LICENSE +0 -22
  322. package/node_modules/interpret/README.md +0 -187
  323. package/node_modules/interpret/index.js +0 -168
  324. package/node_modules/interpret/mjs-stub.js +0 -1
  325. package/node_modules/interpret/package.json +0 -75
  326. package/node_modules/is-core-module/.eslintrc +0 -18
  327. package/node_modules/is-core-module/.nycrc +0 -9
  328. package/node_modules/is-core-module/CHANGELOG.md +0 -218
  329. package/node_modules/is-core-module/LICENSE +0 -20
  330. package/node_modules/is-core-module/README.md +0 -40
  331. package/node_modules/is-core-module/core.json +0 -162
  332. package/node_modules/is-core-module/index.js +0 -69
  333. package/node_modules/is-core-module/package.json +0 -76
  334. package/node_modules/is-core-module/test/index.js +0 -157
  335. package/node_modules/nice-try/README.md +0 -32
  336. package/node_modules/nice-try/package.json +0 -33
  337. package/node_modules/nice-try/src/index.js +0 -12
  338. package/node_modules/once/README.md +0 -79
  339. package/node_modules/once/once.js +0 -42
  340. package/node_modules/once/package.json +0 -33
  341. package/node_modules/p-finally/index.js +0 -15
  342. package/node_modules/p-finally/license +0 -21
  343. package/node_modules/p-finally/package.json +0 -42
  344. package/node_modules/p-finally/readme.md +0 -47
  345. package/node_modules/path-parse/LICENSE +0 -21
  346. package/node_modules/path-parse/README.md +0 -42
  347. package/node_modules/path-parse/index.js +0 -75
  348. package/node_modules/path-parse/package.json +0 -33
  349. package/node_modules/pump/.github/FUNDING.yml +0 -2
  350. package/node_modules/pump/.travis.yml +0 -5
  351. package/node_modules/pump/LICENSE +0 -21
  352. package/node_modules/pump/README.md +0 -74
  353. package/node_modules/pump/SECURITY.md +0 -5
  354. package/node_modules/pump/index.js +0 -86
  355. package/node_modules/pump/package.json +0 -24
  356. package/node_modules/pump/test-browser.js +0 -66
  357. package/node_modules/pump/test-node.js +0 -53
  358. package/node_modules/rechoir/.npmignore +0 -1
  359. package/node_modules/rechoir/.travis.yml +0 -24
  360. package/node_modules/rechoir/CHANGELOG +0 -38
  361. package/node_modules/rechoir/LICENSE +0 -22
  362. package/node_modules/rechoir/README.md +0 -42
  363. package/node_modules/rechoir/index.js +0 -59
  364. package/node_modules/rechoir/lib/extension.js +0 -11
  365. package/node_modules/rechoir/lib/normalize.js +0 -15
  366. package/node_modules/rechoir/lib/register.js +0 -15
  367. package/node_modules/rechoir/package.json +0 -88
  368. package/node_modules/resolve/.editorconfig +0 -37
  369. package/node_modules/resolve/.eslintrc +0 -65
  370. package/node_modules/resolve/.github/FUNDING.yml +0 -12
  371. package/node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md +0 -119
  372. package/node_modules/resolve/.github/THREAT_MODEL.md +0 -74
  373. package/node_modules/resolve/LICENSE +0 -21
  374. package/node_modules/resolve/SECURITY.md +0 -11
  375. package/node_modules/resolve/async.js +0 -3
  376. package/node_modules/resolve/bin/resolve +0 -50
  377. package/node_modules/resolve/example/async.js +0 -5
  378. package/node_modules/resolve/example/sync.js +0 -3
  379. package/node_modules/resolve/index.js +0 -6
  380. package/node_modules/resolve/lib/async.js +0 -333
  381. package/node_modules/resolve/lib/caller.js +0 -8
  382. package/node_modules/resolve/lib/core.js +0 -12
  383. package/node_modules/resolve/lib/core.json +0 -162
  384. package/node_modules/resolve/lib/homedir.js +0 -24
  385. package/node_modules/resolve/lib/is-core.js +0 -5
  386. package/node_modules/resolve/lib/node-modules-paths.js +0 -45
  387. package/node_modules/resolve/lib/normalize-options.js +0 -10
  388. package/node_modules/resolve/lib/sync.js +0 -212
  389. package/node_modules/resolve/package.json +0 -75
  390. package/node_modules/resolve/readme.markdown +0 -301
  391. package/node_modules/resolve/sync.js +0 -3
  392. package/node_modules/resolve/test/core.js +0 -88
  393. package/node_modules/resolve/test/dotdot/abc/index.js +0 -2
  394. package/node_modules/resolve/test/dotdot/index.js +0 -1
  395. package/node_modules/resolve/test/dotdot.js +0 -29
  396. package/node_modules/resolve/test/faulty_basedir.js +0 -29
  397. package/node_modules/resolve/test/filter.js +0 -34
  398. package/node_modules/resolve/test/filter_sync.js +0 -33
  399. package/node_modules/resolve/test/home_paths.js +0 -127
  400. package/node_modules/resolve/test/home_paths_sync.js +0 -114
  401. package/node_modules/resolve/test/mock.js +0 -315
  402. package/node_modules/resolve/test/mock_sync.js +0 -214
  403. package/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +0 -1
  404. package/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +0 -1
  405. package/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +0 -1
  406. package/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +0 -3
  407. package/node_modules/resolve/test/module_dir.js +0 -56
  408. package/node_modules/resolve/test/node-modules-paths.js +0 -143
  409. package/node_modules/resolve/test/node_path/x/aaa/index.js +0 -1
  410. package/node_modules/resolve/test/node_path/x/ccc/index.js +0 -1
  411. package/node_modules/resolve/test/node_path/y/bbb/index.js +0 -1
  412. package/node_modules/resolve/test/node_path/y/ccc/index.js +0 -1
  413. package/node_modules/resolve/test/node_path.js +0 -70
  414. package/node_modules/resolve/test/nonstring.js +0 -9
  415. package/node_modules/resolve/test/pathfilter/deep_ref/main.js +0 -0
  416. package/node_modules/resolve/test/pathfilter.js +0 -75
  417. package/node_modules/resolve/test/precedence/aaa/index.js +0 -1
  418. package/node_modules/resolve/test/precedence/aaa/main.js +0 -1
  419. package/node_modules/resolve/test/precedence/aaa.js +0 -1
  420. package/node_modules/resolve/test/precedence/bbb/main.js +0 -1
  421. package/node_modules/resolve/test/precedence/bbb.js +0 -1
  422. package/node_modules/resolve/test/precedence.js +0 -23
  423. package/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  424. package/node_modules/resolve/test/resolver/baz/package.json +0 -4
  425. package/node_modules/resolve/test/resolver/baz/quux.js +0 -1
  426. package/node_modules/resolve/test/resolver/browser_field/a.js +0 -0
  427. package/node_modules/resolve/test/resolver/browser_field/b.js +0 -0
  428. package/node_modules/resolve/test/resolver/browser_field/package.json +0 -5
  429. package/node_modules/resolve/test/resolver/cup.coffee +0 -1
  430. package/node_modules/resolve/test/resolver/dot_main/index.js +0 -1
  431. package/node_modules/resolve/test/resolver/dot_main/package.json +0 -3
  432. package/node_modules/resolve/test/resolver/dot_slash_main/index.js +0 -1
  433. package/node_modules/resolve/test/resolver/dot_slash_main/package.json +0 -3
  434. package/node_modules/resolve/test/resolver/false_main/index.js +0 -0
  435. package/node_modules/resolve/test/resolver/false_main/package.json +0 -4
  436. package/node_modules/resolve/test/resolver/foo.js +0 -1
  437. package/node_modules/resolve/test/resolver/incorrect_main/index.js +0 -2
  438. package/node_modules/resolve/test/resolver/incorrect_main/package.json +0 -3
  439. package/node_modules/resolve/test/resolver/invalid_main/package.json +0 -7
  440. package/node_modules/resolve/test/resolver/mug.coffee +0 -0
  441. package/node_modules/resolve/test/resolver/mug.js +0 -0
  442. package/node_modules/resolve/test/resolver/multirepo/lerna.json +0 -6
  443. package/node_modules/resolve/test/resolver/multirepo/package.json +0 -20
  444. package/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +0 -35
  445. package/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +0 -14
  446. package/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js +0 -0
  447. package/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +0 -14
  448. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +0 -26
  449. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +0 -15
  450. package/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +0 -12
  451. package/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  452. package/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  453. package/node_modules/resolve/test/resolver/quux/foo/index.js +0 -1
  454. package/node_modules/resolve/test/resolver/same_names/foo/index.js +0 -1
  455. package/node_modules/resolve/test/resolver/same_names/foo.js +0 -1
  456. package/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js +0 -0
  457. package/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep +0 -0
  458. package/node_modules/resolve/test/resolver/symlinked/package/bar.js +0 -1
  459. package/node_modules/resolve/test/resolver/symlinked/package/package.json +0 -3
  460. package/node_modules/resolve/test/resolver/without_basedir/main.js +0 -5
  461. package/node_modules/resolve/test/resolver.js +0 -597
  462. package/node_modules/resolve/test/resolver_sync.js +0 -730
  463. package/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
  464. package/node_modules/resolve/test/shadowed_core.js +0 -54
  465. package/node_modules/resolve/test/subdirs.js +0 -13
  466. package/node_modules/resolve/test/symlinks.js +0 -176
  467. package/node_modules/shelljs/bin/shjs +0 -48
  468. package/node_modules/shelljs/node_modules/execa/index.js +0 -361
  469. package/node_modules/shelljs/node_modules/execa/lib/errname.js +0 -39
  470. package/node_modules/shelljs/node_modules/execa/lib/stdio.js +0 -41
  471. package/node_modules/shelljs/node_modules/execa/package.json +0 -69
  472. package/node_modules/shelljs/node_modules/execa/readme.md +0 -327
  473. package/node_modules/shelljs/node_modules/get-stream/buffer-stream.js +0 -51
  474. package/node_modules/shelljs/node_modules/get-stream/index.js +0 -50
  475. package/node_modules/shelljs/node_modules/is-stream/index.js +0 -21
  476. package/node_modules/shelljs/node_modules/is-stream/license +0 -21
  477. package/node_modules/shelljs/node_modules/is-stream/package.json +0 -38
  478. package/node_modules/shelljs/node_modules/is-stream/readme.md +0 -42
  479. package/node_modules/shelljs/node_modules/npm-run-path/index.js +0 -39
  480. package/node_modules/shelljs/node_modules/npm-run-path/license +0 -21
  481. package/node_modules/shelljs/node_modules/npm-run-path/package.json +0 -45
  482. package/node_modules/shelljs/node_modules/path-key/index.js +0 -13
  483. package/node_modules/shelljs/node_modules/path-key/license +0 -21
  484. package/node_modules/shelljs/node_modules/path-key/package.json +0 -39
  485. package/node_modules/shelljs/node_modules/semver/LICENSE +0 -15
  486. package/node_modules/shelljs/node_modules/semver/README.md +0 -412
  487. package/node_modules/shelljs/node_modules/semver/bin/semver +0 -160
  488. package/node_modules/shelljs/node_modules/semver/package.json +0 -38
  489. package/node_modules/shelljs/node_modules/semver/range.bnf +0 -16
  490. package/node_modules/shelljs/node_modules/semver/semver.js +0 -1525
  491. package/node_modules/shelljs/node_modules/shebang-command/index.js +0 -19
  492. package/node_modules/shelljs/node_modules/shebang-command/license +0 -21
  493. package/node_modules/shelljs/node_modules/shebang-command/package.json +0 -39
  494. package/node_modules/shelljs/node_modules/shebang-regex/index.js +0 -2
  495. package/node_modules/shelljs/node_modules/shebang-regex/license +0 -21
  496. package/node_modules/shelljs/node_modules/shebang-regex/package.json +0 -32
  497. package/node_modules/shelljs/node_modules/shebang-regex/readme.md +0 -29
  498. package/node_modules/shelljs/node_modules/which/LICENSE +0 -15
  499. package/node_modules/shelljs/node_modules/which/package.json +0 -30
  500. package/node_modules/shelljs/node_modules/which/which.js +0 -135
  501. package/node_modules/strip-eof/index.js +0 -15
  502. package/node_modules/strip-eof/license +0 -21
  503. package/node_modules/strip-eof/package.json +0 -39
  504. package/node_modules/strip-eof/readme.md +0 -28
  505. package/node_modules/supports-preserve-symlinks-flag/.eslintrc +0 -14
  506. package/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +0 -12
  507. package/node_modules/supports-preserve-symlinks-flag/.nycrc +0 -9
  508. package/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +0 -22
  509. package/node_modules/supports-preserve-symlinks-flag/LICENSE +0 -21
  510. package/node_modules/supports-preserve-symlinks-flag/README.md +0 -42
  511. package/node_modules/supports-preserve-symlinks-flag/browser.js +0 -3
  512. package/node_modules/supports-preserve-symlinks-flag/index.js +0 -9
  513. package/node_modules/supports-preserve-symlinks-flag/package.json +0 -70
  514. package/node_modules/supports-preserve-symlinks-flag/test/index.js +0 -29
  515. package/node_modules/wrappy/LICENSE +0 -15
  516. package/node_modules/wrappy/README.md +0 -36
  517. package/node_modules/wrappy/package.json +0 -29
  518. package/node_modules/wrappy/wrappy.js +0 -33
  519. /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/LICENSE +0 -0
  520. /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/index.js +0 -0
  521. /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/escape.js +0 -0
  522. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/LICENSE +0 -0
  523. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/README.md +0 -0
  524. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/index.js +0 -0
  525. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/constants.js +0 -0
  526. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/parse.js +0 -0
  527. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/picomatch.js +0 -0
  528. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/scan.js +0 -0
  529. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/utils.js +0 -0
  530. /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/package.json +0 -0
  531. /package/node_modules/{shelljs/node_modules/execa → mimic-fn}/license +0 -0
  532. /package/node_modules/{shelljs/node_modules/get-stream → npm-run-path}/license +0 -0
  533. /package/node_modules/{once → which}/LICENSE +0 -0
  534. /package/node_modules/{shelljs/node_modules/which/bin/which → which/bin/node-which} +0 -0
@@ -1,202 +1,195 @@
1
- 'use strict';
2
-
3
- /*eslint-disable no-use-before-define*/
4
-
5
- var common = require('./common');
6
- var YAMLException = require('./exception');
7
- var DEFAULT_SCHEMA = require('./schema/default');
8
-
9
- var _toString = Object.prototype.toString;
10
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
11
-
12
- var CHAR_BOM = 0xFEFF;
13
- var CHAR_TAB = 0x09; /* Tab */
14
- var CHAR_LINE_FEED = 0x0A; /* LF */
15
- var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
16
- var CHAR_SPACE = 0x20; /* Space */
17
- var CHAR_EXCLAMATION = 0x21; /* ! */
18
- var CHAR_DOUBLE_QUOTE = 0x22; /* " */
19
- var CHAR_SHARP = 0x23; /* # */
20
- var CHAR_PERCENT = 0x25; /* % */
21
- var CHAR_AMPERSAND = 0x26; /* & */
22
- var CHAR_SINGLE_QUOTE = 0x27; /* ' */
23
- var CHAR_ASTERISK = 0x2A; /* * */
24
- var CHAR_COMMA = 0x2C; /* , */
25
- var CHAR_MINUS = 0x2D; /* - */
26
- var CHAR_COLON = 0x3A; /* : */
27
- var CHAR_EQUALS = 0x3D; /* = */
28
- var CHAR_GREATER_THAN = 0x3E; /* > */
29
- var CHAR_QUESTION = 0x3F; /* ? */
30
- var CHAR_COMMERCIAL_AT = 0x40; /* @ */
31
- var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
32
- var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
33
- var CHAR_GRAVE_ACCENT = 0x60; /* ` */
34
- var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
35
- var CHAR_VERTICAL_LINE = 0x7C; /* | */
36
- var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
37
-
38
- var ESCAPE_SEQUENCES = {};
39
-
40
- ESCAPE_SEQUENCES[0x00] = '\\0';
41
- ESCAPE_SEQUENCES[0x07] = '\\a';
42
- ESCAPE_SEQUENCES[0x08] = '\\b';
43
- ESCAPE_SEQUENCES[0x09] = '\\t';
44
- ESCAPE_SEQUENCES[0x0A] = '\\n';
45
- ESCAPE_SEQUENCES[0x0B] = '\\v';
46
- ESCAPE_SEQUENCES[0x0C] = '\\f';
47
- ESCAPE_SEQUENCES[0x0D] = '\\r';
48
- ESCAPE_SEQUENCES[0x1B] = '\\e';
49
- ESCAPE_SEQUENCES[0x22] = '\\"';
50
- ESCAPE_SEQUENCES[0x5C] = '\\\\';
51
- ESCAPE_SEQUENCES[0x85] = '\\N';
52
- ESCAPE_SEQUENCES[0xA0] = '\\_';
53
- ESCAPE_SEQUENCES[0x2028] = '\\L';
54
- ESCAPE_SEQUENCES[0x2029] = '\\P';
55
-
56
- var DEPRECATED_BOOLEANS_SYNTAX = [
1
+ 'use strict'
2
+
3
+ const common = require('./common')
4
+ const YAMLException = require('./exception')
5
+ const DEFAULT_SCHEMA = require('./schema/default')
6
+
7
+ const _toString = Object.prototype.toString
8
+ const _hasOwnProperty = Object.prototype.hasOwnProperty
9
+
10
+ const CHAR_BOM = 0xFEFF
11
+ const CHAR_TAB = 0x09 /* Tab */
12
+ const CHAR_LINE_FEED = 0x0A /* LF */
13
+ const CHAR_CARRIAGE_RETURN = 0x0D /* CR */
14
+ const CHAR_SPACE = 0x20 /* Space */
15
+ const CHAR_EXCLAMATION = 0x21 /* ! */
16
+ const CHAR_DOUBLE_QUOTE = 0x22 /* " */
17
+ const CHAR_SHARP = 0x23 /* # */
18
+ const CHAR_PERCENT = 0x25 /* % */
19
+ const CHAR_AMPERSAND = 0x26 /* & */
20
+ const CHAR_SINGLE_QUOTE = 0x27 /* ' */
21
+ const CHAR_ASTERISK = 0x2A /* * */
22
+ const CHAR_COMMA = 0x2C /* , */
23
+ const CHAR_MINUS = 0x2D /* - */
24
+ const CHAR_COLON = 0x3A /* : */
25
+ const CHAR_EQUALS = 0x3D /* = */
26
+ const CHAR_GREATER_THAN = 0x3E /* > */
27
+ const CHAR_QUESTION = 0x3F /* ? */
28
+ const CHAR_COMMERCIAL_AT = 0x40 /* @ */
29
+ const CHAR_LEFT_SQUARE_BRACKET = 0x5B /* [ */
30
+ const CHAR_RIGHT_SQUARE_BRACKET = 0x5D /* ] */
31
+ const CHAR_GRAVE_ACCENT = 0x60 /* ` */
32
+ const CHAR_LEFT_CURLY_BRACKET = 0x7B /* { */
33
+ const CHAR_VERTICAL_LINE = 0x7C /* | */
34
+ const CHAR_RIGHT_CURLY_BRACKET = 0x7D /* } */
35
+
36
+ const ESCAPE_SEQUENCES = {}
37
+
38
+ ESCAPE_SEQUENCES[0x00] = '\\0'
39
+ ESCAPE_SEQUENCES[0x07] = '\\a'
40
+ ESCAPE_SEQUENCES[0x08] = '\\b'
41
+ ESCAPE_SEQUENCES[0x09] = '\\t'
42
+ ESCAPE_SEQUENCES[0x0A] = '\\n'
43
+ ESCAPE_SEQUENCES[0x0B] = '\\v'
44
+ ESCAPE_SEQUENCES[0x0C] = '\\f'
45
+ ESCAPE_SEQUENCES[0x0D] = '\\r'
46
+ ESCAPE_SEQUENCES[0x1B] = '\\e'
47
+ ESCAPE_SEQUENCES[0x22] = '\\"'
48
+ ESCAPE_SEQUENCES[0x5C] = '\\\\'
49
+ ESCAPE_SEQUENCES[0x85] = '\\N'
50
+ ESCAPE_SEQUENCES[0xA0] = '\\_'
51
+ ESCAPE_SEQUENCES[0x2028] = '\\L'
52
+ ESCAPE_SEQUENCES[0x2029] = '\\P'
53
+
54
+ const DEPRECATED_BOOLEANS_SYNTAX = [
57
55
  'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
58
56
  'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
59
- ];
57
+ ]
60
58
 
61
- var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
59
+ const DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/
62
60
 
63
- function compileStyleMap(schema, map) {
64
- var result, keys, index, length, tag, style, type;
61
+ function compileStyleMap (schema, map) {
62
+ if (map === null) return {}
65
63
 
66
- if (map === null) return {};
64
+ const result = {}
65
+ const keys = Object.keys(map)
67
66
 
68
- result = {};
69
- keys = Object.keys(map);
70
-
71
- for (index = 0, length = keys.length; index < length; index += 1) {
72
- tag = keys[index];
73
- style = String(map[tag]);
67
+ for (let index = 0, length = keys.length; index < length; index += 1) {
68
+ let tag = keys[index]
69
+ let style = String(map[tag])
74
70
 
75
71
  if (tag.slice(0, 2) === '!!') {
76
- tag = 'tag:yaml.org,2002:' + tag.slice(2);
72
+ tag = 'tag:yaml.org,2002:' + tag.slice(2)
77
73
  }
78
- type = schema.compiledTypeMap['fallback'][tag];
74
+ const type = schema.compiledTypeMap['fallback'][tag]
79
75
 
80
76
  if (type && _hasOwnProperty.call(type.styleAliases, style)) {
81
- style = type.styleAliases[style];
77
+ style = type.styleAliases[style]
82
78
  }
83
79
 
84
- result[tag] = style;
80
+ result[tag] = style
85
81
  }
86
82
 
87
- return result;
83
+ return result
88
84
  }
89
85
 
90
- function encodeHex(character) {
91
- var string, handle, length;
86
+ function encodeHex (character) {
87
+ let handle
88
+ let length
92
89
 
93
- string = character.toString(16).toUpperCase();
90
+ const string = character.toString(16).toUpperCase()
94
91
 
95
92
  if (character <= 0xFF) {
96
- handle = 'x';
97
- length = 2;
93
+ handle = 'x'
94
+ length = 2
98
95
  } else if (character <= 0xFFFF) {
99
- handle = 'u';
100
- length = 4;
96
+ handle = 'u'
97
+ length = 4
101
98
  } else if (character <= 0xFFFFFFFF) {
102
- handle = 'U';
103
- length = 8;
99
+ handle = 'U'
100
+ length = 8
104
101
  } else {
105
- throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
102
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF')
106
103
  }
107
104
 
108
- return '\\' + handle + common.repeat('0', length - string.length) + string;
105
+ return '\\' + handle + common.repeat('0', length - string.length) + string
109
106
  }
110
107
 
111
-
112
- var QUOTING_TYPE_SINGLE = 1,
113
- QUOTING_TYPE_DOUBLE = 2;
114
-
115
- function State(options) {
116
- this.schema = options['schema'] || DEFAULT_SCHEMA;
117
- this.indent = Math.max(1, (options['indent'] || 2));
118
- this.noArrayIndent = options['noArrayIndent'] || false;
119
- this.skipInvalid = options['skipInvalid'] || false;
120
- this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
121
- this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
122
- this.sortKeys = options['sortKeys'] || false;
123
- this.lineWidth = options['lineWidth'] || 80;
124
- this.noRefs = options['noRefs'] || false;
125
- this.noCompatMode = options['noCompatMode'] || false;
126
- this.condenseFlow = options['condenseFlow'] || false;
127
- this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
128
- this.forceQuotes = options['forceQuotes'] || false;
129
- this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
130
-
131
- this.implicitTypes = this.schema.compiledImplicit;
132
- this.explicitTypes = this.schema.compiledExplicit;
133
-
134
- this.tag = null;
135
- this.result = '';
136
-
137
- this.duplicates = [];
138
- this.usedDuplicates = null;
108
+ const QUOTING_TYPE_SINGLE = 1
109
+ const QUOTING_TYPE_DOUBLE = 2
110
+
111
+ function State (options) {
112
+ this.schema = options['schema'] || DEFAULT_SCHEMA
113
+ this.indent = Math.max(1, (options['indent'] || 2))
114
+ this.noArrayIndent = options['noArrayIndent'] || false
115
+ this.skipInvalid = options['skipInvalid'] || false
116
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'])
117
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null)
118
+ this.sortKeys = options['sortKeys'] || false
119
+ this.lineWidth = options['lineWidth'] || 80
120
+ this.noRefs = options['noRefs'] || false
121
+ this.noCompatMode = options['noCompatMode'] || false
122
+ this.condenseFlow = options['condenseFlow'] || false
123
+ this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE
124
+ this.forceQuotes = options['forceQuotes'] || false
125
+ this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null
126
+
127
+ this.implicitTypes = this.schema.compiledImplicit
128
+ this.explicitTypes = this.schema.compiledExplicit
129
+
130
+ this.tag = null
131
+ this.result = ''
132
+
133
+ this.duplicates = []
134
+ this.usedDuplicates = null
139
135
  }
140
136
 
141
137
  // Indents every line in a string. Empty lines (\n only) are not indented.
142
- function indentString(string, spaces) {
143
- var ind = common.repeat(' ', spaces),
144
- position = 0,
145
- next = -1,
146
- result = '',
147
- line,
148
- length = string.length;
138
+ function indentString (string, spaces) {
139
+ const ind = common.repeat(' ', spaces)
140
+ let position = 0
141
+ let result = ''
142
+ const length = string.length
149
143
 
150
144
  while (position < length) {
151
- next = string.indexOf('\n', position);
145
+ let line
146
+ const next = string.indexOf('\n', position)
152
147
  if (next === -1) {
153
- line = string.slice(position);
154
- position = length;
148
+ line = string.slice(position)
149
+ position = length
155
150
  } else {
156
- line = string.slice(position, next + 1);
157
- position = next + 1;
151
+ line = string.slice(position, next + 1)
152
+ position = next + 1
158
153
  }
159
154
 
160
- if (line.length && line !== '\n') result += ind;
155
+ if (line.length && line !== '\n') result += ind
161
156
 
162
- result += line;
157
+ result += line
163
158
  }
164
159
 
165
- return result;
160
+ return result
166
161
  }
167
162
 
168
- function generateNextLine(state, level) {
169
- return '\n' + common.repeat(' ', state.indent * level);
163
+ function generateNextLine (state, level) {
164
+ return '\n' + common.repeat(' ', state.indent * level)
170
165
  }
171
166
 
172
- function testImplicitResolving(state, str) {
173
- var index, length, type;
174
-
175
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
176
- type = state.implicitTypes[index];
167
+ function testImplicitResolving (state, str) {
168
+ for (let index = 0, length = state.implicitTypes.length; index < length; index += 1) {
169
+ const type = state.implicitTypes[index]
177
170
 
178
171
  if (type.resolve(str)) {
179
- return true;
172
+ return true
180
173
  }
181
174
  }
182
175
 
183
- return false;
176
+ return false
184
177
  }
185
178
 
186
179
  // [33] s-white ::= s-space | s-tab
187
- function isWhitespace(c) {
188
- return c === CHAR_SPACE || c === CHAR_TAB;
180
+ function isWhitespace (c) {
181
+ return c === CHAR_SPACE || c === CHAR_TAB
189
182
  }
190
183
 
191
184
  // Returns true if the character can be printed without escaping.
192
185
  // From YAML 1.2: "any allowed characters known to be non-printable
193
186
  // should also be escaped. [However,] This isn’t mandatory"
194
187
  // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
195
- function isPrintable(c) {
196
- return (0x00020 <= c && c <= 0x00007E)
197
- || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
198
- || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
199
- || (0x10000 <= c && c <= 0x10FFFF);
188
+ function isPrintable (c) {
189
+ return (c >= 0x00020 && c <= 0x00007E) ||
190
+ ((c >= 0x000A1 && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) ||
191
+ ((c >= 0x0E000 && c <= 0x00FFFD) && c !== CHAR_BOM) ||
192
+ (c >= 0x10000 && c <= 0x10FFFF)
200
193
  }
201
194
 
202
195
  // [34] ns-char ::= nb-char - s-white
@@ -204,12 +197,12 @@ function isPrintable(c) {
204
197
  // [26] b-char ::= b-line-feed | b-carriage-return
205
198
  // Including s-white (for some reason, examples doesn't match specs in this aspect)
206
199
  // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
207
- function isNsCharOrWhitespace(c) {
208
- return isPrintable(c)
209
- && c !== CHAR_BOM
200
+ function isNsCharOrWhitespace (c) {
201
+ return isPrintable(c) &&
202
+ c !== CHAR_BOM &&
210
203
  // - b-char
211
- && c !== CHAR_CARRIAGE_RETURN
212
- && c !== CHAR_LINE_FEED;
204
+ c !== CHAR_CARRIAGE_RETURN &&
205
+ c !== CHAR_LINE_FEED
213
206
  }
214
207
 
215
208
  // [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out
@@ -221,91 +214,96 @@ function isNsCharOrWhitespace(c) {
221
214
  // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )
222
215
  // | ( /* An ns-char preceding */ “#” )
223
216
  // | ( “:” /* Followed by an ns-plain-safe(c) */ )
224
- function isPlainSafe(c, prev, inblock) {
225
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
226
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
217
+ function isPlainSafe (c, prev, inblock) {
218
+ const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c)
219
+ const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c)
227
220
  return (
228
- // ns-plain-safe
229
- inblock ? // c = flow-in
230
- cIsNsCharOrWhitespace
231
- : cIsNsCharOrWhitespace
232
- // - c-flow-indicator
233
- && c !== CHAR_COMMA
234
- && c !== CHAR_LEFT_SQUARE_BRACKET
235
- && c !== CHAR_RIGHT_SQUARE_BRACKET
236
- && c !== CHAR_LEFT_CURLY_BRACKET
237
- && c !== CHAR_RIGHT_CURLY_BRACKET
238
- )
221
+ (
222
+ // ns-plain-safe
223
+ inblock // c = flow-in
224
+ ? cIsNsCharOrWhitespace
225
+ : cIsNsCharOrWhitespace &&
226
+ // - c-flow-indicator
227
+ c !== CHAR_COMMA &&
228
+ c !== CHAR_LEFT_SQUARE_BRACKET &&
229
+ c !== CHAR_RIGHT_SQUARE_BRACKET &&
230
+ c !== CHAR_LEFT_CURLY_BRACKET &&
231
+ c !== CHAR_RIGHT_CURLY_BRACKET
232
+ ) &&
239
233
  // ns-plain-char
240
- && c !== CHAR_SHARP // false on '#'
241
- && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
242
- || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
243
- || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
234
+ c !== CHAR_SHARP && // false on '#'
235
+ !(prev === CHAR_COLON && !cIsNsChar)
236
+ ) || // false on ': '
237
+ (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) || // change to true on '[^ ]#'
238
+ (prev === CHAR_COLON && cIsNsChar) // change to true on ':[^ ]'
244
239
  }
245
240
 
246
241
  // Simplified test for values allowed as the first character in plain style.
247
- function isPlainSafeFirst(c) {
242
+ function isPlainSafeFirst (c) {
248
243
  // Uses a subset of ns-char - c-indicator
249
244
  // where ns-char = nb-char - s-white.
250
245
  // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part
251
- return isPrintable(c) && c !== CHAR_BOM
252
- && !isWhitespace(c) // - s-white
246
+ return isPrintable(c) &&
247
+ c !== CHAR_BOM &&
248
+ !isWhitespace(c) && // - s-white
253
249
  // - (c-indicator ::=
254
250
  // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
255
- && c !== CHAR_MINUS
256
- && c !== CHAR_QUESTION
257
- && c !== CHAR_COLON
258
- && c !== CHAR_COMMA
259
- && c !== CHAR_LEFT_SQUARE_BRACKET
260
- && c !== CHAR_RIGHT_SQUARE_BRACKET
261
- && c !== CHAR_LEFT_CURLY_BRACKET
262
- && c !== CHAR_RIGHT_CURLY_BRACKET
251
+ c !== CHAR_MINUS &&
252
+ c !== CHAR_QUESTION &&
253
+ c !== CHAR_COLON &&
254
+ c !== CHAR_COMMA &&
255
+ c !== CHAR_LEFT_SQUARE_BRACKET &&
256
+ c !== CHAR_RIGHT_SQUARE_BRACKET &&
257
+ c !== CHAR_LEFT_CURLY_BRACKET &&
258
+ c !== CHAR_RIGHT_CURLY_BRACKET &&
263
259
  // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
264
- && c !== CHAR_SHARP
265
- && c !== CHAR_AMPERSAND
266
- && c !== CHAR_ASTERISK
267
- && c !== CHAR_EXCLAMATION
268
- && c !== CHAR_VERTICAL_LINE
269
- && c !== CHAR_EQUALS
270
- && c !== CHAR_GREATER_THAN
271
- && c !== CHAR_SINGLE_QUOTE
272
- && c !== CHAR_DOUBLE_QUOTE
260
+ c !== CHAR_SHARP &&
261
+ c !== CHAR_AMPERSAND &&
262
+ c !== CHAR_ASTERISK &&
263
+ c !== CHAR_EXCLAMATION &&
264
+ c !== CHAR_VERTICAL_LINE &&
265
+ c !== CHAR_EQUALS &&
266
+ c !== CHAR_GREATER_THAN &&
267
+ c !== CHAR_SINGLE_QUOTE &&
268
+ c !== CHAR_DOUBLE_QUOTE &&
273
269
  // | “%” | “@” | “`”)
274
- && c !== CHAR_PERCENT
275
- && c !== CHAR_COMMERCIAL_AT
276
- && c !== CHAR_GRAVE_ACCENT;
270
+ c !== CHAR_PERCENT &&
271
+ c !== CHAR_COMMERCIAL_AT &&
272
+ c !== CHAR_GRAVE_ACCENT
277
273
  }
278
274
 
279
275
  // Simplified test for values allowed as the last character in plain style.
280
- function isPlainSafeLast(c) {
276
+ function isPlainSafeLast (c) {
281
277
  // just not whitespace or colon, it will be checked to be plain character later
282
- return !isWhitespace(c) && c !== CHAR_COLON;
278
+ return !isWhitespace(c) && c !== CHAR_COLON
283
279
  }
284
280
 
285
281
  // Same as 'string'.codePointAt(pos), but works in older browsers.
286
- function codePointAt(string, pos) {
287
- var first = string.charCodeAt(pos), second;
282
+ function codePointAt (string, pos) {
283
+ const first = string.charCodeAt(pos)
284
+ let second
285
+
288
286
  if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
289
- second = string.charCodeAt(pos + 1);
287
+ second = string.charCodeAt(pos + 1)
290
288
  if (second >= 0xDC00 && second <= 0xDFFF) {
291
289
  // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
292
- return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
290
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000
293
291
  }
294
292
  }
295
- return first;
293
+ return first
296
294
  }
297
295
 
298
296
  // Determines whether block indentation indicator is required.
299
- function needIndentIndicator(string) {
300
- var leadingSpaceRe = /^\n* /;
301
- return leadingSpaceRe.test(string);
297
+ function needIndentIndicator (string) {
298
+ const leadingSpaceRe = /^\n* /
299
+ return leadingSpaceRe.test(string)
302
300
  }
303
301
 
304
- var STYLE_PLAIN = 1,
305
- STYLE_SINGLE = 2,
306
- STYLE_LITERAL = 3,
307
- STYLE_FOLDED = 4,
308
- STYLE_DOUBLE = 5;
302
+ const STYLE_PLAIN = 1
303
+ const STYLE_SINGLE = 2
304
+ const STYLE_LITERAL = 3
305
+ const STYLE_FOLDED = 4
306
+ const STYLE_DOUBLE = 5
309
307
 
310
308
  // Determines which scalar styles are possible and returns the preferred style.
311
309
  // lineWidth = -1 => no limit.
@@ -314,54 +312,53 @@ var STYLE_PLAIN = 1,
314
312
  // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
315
313
  // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
316
314
  // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
317
- function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
315
+ function chooseScalarStyle (string, singleLineOnly, indentPerLevel, lineWidth,
318
316
  testAmbiguousType, quotingType, forceQuotes, inblock) {
319
-
320
- var i;
321
- var char = 0;
322
- var prevChar = null;
323
- var hasLineBreak = false;
324
- var hasFoldableLine = false; // only checked if shouldTrackWidth
325
- var shouldTrackWidth = lineWidth !== -1;
326
- var previousLineBreak = -1; // count the first line correctly
327
- var plain = isPlainSafeFirst(codePointAt(string, 0))
328
- && isPlainSafeLast(codePointAt(string, string.length - 1));
317
+ let i
318
+ let char = 0
319
+ let prevChar = null
320
+ let hasLineBreak = false
321
+ let hasFoldableLine = false // only checked if shouldTrackWidth
322
+ const shouldTrackWidth = lineWidth !== -1
323
+ let previousLineBreak = -1 // count the first line correctly
324
+ let plain = isPlainSafeFirst(codePointAt(string, 0)) &&
325
+ isPlainSafeLast(codePointAt(string, string.length - 1))
329
326
 
330
327
  if (singleLineOnly || forceQuotes) {
331
328
  // Case: no block styles.
332
329
  // Check for disallowed characters to rule out plain and single.
333
330
  for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
334
- char = codePointAt(string, i);
331
+ char = codePointAt(string, i)
335
332
  if (!isPrintable(char)) {
336
- return STYLE_DOUBLE;
333
+ return STYLE_DOUBLE
337
334
  }
338
- plain = plain && isPlainSafe(char, prevChar, inblock);
339
- prevChar = char;
335
+ plain = plain && isPlainSafe(char, prevChar, inblock)
336
+ prevChar = char
340
337
  }
341
338
  } else {
342
339
  // Case: block styles permitted.
343
340
  for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
344
- char = codePointAt(string, i);
341
+ char = codePointAt(string, i)
345
342
  if (char === CHAR_LINE_FEED) {
346
- hasLineBreak = true;
343
+ hasLineBreak = true
347
344
  // Check if any line can be folded.
348
345
  if (shouldTrackWidth) {
349
346
  hasFoldableLine = hasFoldableLine ||
350
347
  // Foldable line = too long, and not more-indented.
351
348
  (i - previousLineBreak - 1 > lineWidth &&
352
- string[previousLineBreak + 1] !== ' ');
353
- previousLineBreak = i;
349
+ string[previousLineBreak + 1] !== ' ')
350
+ previousLineBreak = i
354
351
  }
355
352
  } else if (!isPrintable(char)) {
356
- return STYLE_DOUBLE;
353
+ return STYLE_DOUBLE
357
354
  }
358
- plain = plain && isPlainSafe(char, prevChar, inblock);
359
- prevChar = char;
355
+ plain = plain && isPlainSafe(char, prevChar, inblock)
356
+ prevChar = char
360
357
  }
361
358
  // in case the end is missing a \n
362
359
  hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
363
360
  (i - previousLineBreak - 1 > lineWidth &&
364
- string[previousLineBreak + 1] !== ' '));
361
+ string[previousLineBreak + 1] !== ' '))
365
362
  }
366
363
  // Although every style can represent \n without escaping, prefer block styles
367
364
  // for multiline, since they're more readable and they don't add empty lines.
@@ -370,20 +367,20 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
370
367
  // Strings interpretable as another type have to be quoted;
371
368
  // e.g. the string 'true' vs. the boolean true.
372
369
  if (plain && !forceQuotes && !testAmbiguousType(string)) {
373
- return STYLE_PLAIN;
370
+ return STYLE_PLAIN
374
371
  }
375
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
372
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE
376
373
  }
377
374
  // Edge case: block indentation indicator can only have one digit.
378
375
  if (indentPerLevel > 9 && needIndentIndicator(string)) {
379
- return STYLE_DOUBLE;
376
+ return STYLE_DOUBLE
380
377
  }
381
378
  // At this point we know block styles are valid.
382
379
  // Prefer literal style unless we want to fold.
383
380
  if (!forceQuotes) {
384
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
381
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL
385
382
  }
386
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
383
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE
387
384
  }
388
385
 
389
386
  // Note: line breaking/folding is implemented for only the folded style.
@@ -392,18 +389,18 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
392
389
  // • No ending newline => unaffected; already using strip "-" chomping.
393
390
  // • Ending newline => removed then restored.
394
391
  // Importantly, this keeps the "+" chomp indicator from gaining an extra line.
395
- function writeScalar(state, string, level, iskey, inblock) {
392
+ function writeScalar (state, string, level, iskey, inblock) {
396
393
  state.dump = (function () {
397
394
  if (string.length === 0) {
398
- return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
395
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"
399
396
  }
400
397
  if (!state.noCompatMode) {
401
398
  if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
402
- return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
399
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'")
403
400
  }
404
401
  }
405
402
 
406
- var indent = state.indent * Math.max(1, level); // no 0-indent scalars
403
+ const indent = state.indent * Math.max(1, level) // no 0-indent scalars
407
404
  // As indentation gets deeper, let the width decrease monotonically
408
405
  // to the lower bound min(state.lineWidth, 40).
409
406
  // Note that this implies
@@ -411,461 +408,441 @@ function writeScalar(state, string, level, iskey, inblock) {
411
408
  // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
412
409
  // This behaves better than a constant minimum width which disallows narrower options,
413
410
  // or an indent threshold which causes the width to suddenly increase.
414
- var lineWidth = state.lineWidth === -1
415
- ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
411
+ const lineWidth = (state.lineWidth === -1)
412
+ ? -1
413
+ : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent)
416
414
 
417
415
  // Without knowing if keys are implicit/explicit, assume implicit for safety.
418
- var singleLineOnly = iskey
416
+ const singleLineOnly = iskey ||
419
417
  // No block styles in flow mode.
420
- || (state.flowLevel > -1 && level >= state.flowLevel);
421
- function testAmbiguity(string) {
422
- return testImplicitResolving(state, string);
418
+ (state.flowLevel > -1 && level >= state.flowLevel)
419
+ function testAmbiguity (string) {
420
+ return testImplicitResolving(state, string)
423
421
  }
424
422
 
425
423
  switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
426
424
  testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
427
-
428
425
  case STYLE_PLAIN:
429
- return string;
426
+ return string
430
427
  case STYLE_SINGLE:
431
- return "'" + string.replace(/'/g, "''") + "'";
428
+ return "'" + string.replace(/'/g, "''") + "'"
432
429
  case STYLE_LITERAL:
433
- return '|' + blockHeader(string, state.indent)
434
- + dropEndingNewline(indentString(string, indent));
430
+ return '|' + blockHeader(string, state.indent) +
431
+ dropEndingNewline(indentString(string, indent))
435
432
  case STYLE_FOLDED:
436
- return '>' + blockHeader(string, state.indent)
437
- + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
433
+ return '>' + blockHeader(string, state.indent) +
434
+ dropEndingNewline(indentString(foldString(string, lineWidth), indent))
438
435
  case STYLE_DOUBLE:
439
- return '"' + escapeString(string, lineWidth) + '"';
436
+ return '"' + escapeString(string, lineWidth) + '"'
440
437
  default:
441
- throw new YAMLException('impossible error: invalid scalar style');
438
+ throw new YAMLException('impossible error: invalid scalar style')
442
439
  }
443
- }());
440
+ }())
444
441
  }
445
442
 
446
443
  // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
447
- function blockHeader(string, indentPerLevel) {
448
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
444
+ function blockHeader (string, indentPerLevel) {
445
+ const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''
449
446
 
450
447
  // note the special case: the string '\n' counts as a "trailing" empty line.
451
- var clip = string[string.length - 1] === '\n';
452
- var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
453
- var chomp = keep ? '+' : (clip ? '' : '-');
448
+ const clip = string[string.length - 1] === '\n'
449
+ const keep = clip && (string[string.length - 2] === '\n' || string === '\n')
450
+ const chomp = keep ? '+' : (clip ? '' : '-')
454
451
 
455
- return indentIndicator + chomp + '\n';
452
+ return indentIndicator + chomp + '\n'
456
453
  }
457
454
 
458
455
  // (See the note for writeScalar.)
459
- function dropEndingNewline(string) {
460
- return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
456
+ function dropEndingNewline (string) {
457
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string
461
458
  }
462
459
 
463
460
  // Note: a long line without a suitable break point will exceed the width limit.
464
461
  // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
465
- function foldString(string, width) {
462
+ function foldString (string, width) {
466
463
  // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
467
464
  // unless they're before or after a more-indented line, or at the very
468
465
  // beginning or end, in which case $k$ maps to $k$.
469
466
  // Therefore, parse each chunk as newline(s) followed by a content line.
470
- var lineRe = /(\n+)([^\n]*)/g;
467
+ const lineRe = /(\n+)([^\n]*)/g
471
468
 
472
469
  // first line (possibly an empty line)
473
- var result = (function () {
474
- var nextLF = string.indexOf('\n');
475
- nextLF = nextLF !== -1 ? nextLF : string.length;
476
- lineRe.lastIndex = nextLF;
477
- return foldLine(string.slice(0, nextLF), width);
478
- }());
470
+ let result = (function () {
471
+ let nextLF = string.indexOf('\n')
472
+ nextLF = nextLF !== -1 ? nextLF : string.length
473
+ lineRe.lastIndex = nextLF
474
+ return foldLine(string.slice(0, nextLF), width)
475
+ }())
479
476
  // If we haven't reached the first content line yet, don't add an extra \n.
480
- var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
481
- var moreIndented;
477
+ let prevMoreIndented = string[0] === '\n' || string[0] === ' '
478
+ let moreIndented
482
479
 
483
480
  // rest of the lines
484
- var match;
481
+ let match
485
482
  while ((match = lineRe.exec(string))) {
486
- var prefix = match[1], line = match[2];
487
- moreIndented = (line[0] === ' ');
488
- result += prefix
489
- + (!prevMoreIndented && !moreIndented && line !== ''
490
- ? '\n' : '')
491
- + foldLine(line, width);
492
- prevMoreIndented = moreIndented;
483
+ const prefix = match[1]
484
+ const line = match[2]
485
+
486
+ moreIndented = (line[0] === ' ')
487
+ result += prefix +
488
+ ((!prevMoreIndented && !moreIndented && line !== '') ? '\n' : '') +
489
+ foldLine(line, width)
490
+ prevMoreIndented = moreIndented
493
491
  }
494
492
 
495
- return result;
493
+ return result
496
494
  }
497
495
 
498
496
  // Greedy line breaking.
499
497
  // Picks the longest line under the limit each time,
500
498
  // otherwise settles for the shortest line over the limit.
501
499
  // NB. More-indented lines *cannot* be folded, as that would add an extra \n.
502
- function foldLine(line, width) {
503
- if (line === '' || line[0] === ' ') return line;
500
+ function foldLine (line, width) {
501
+ if (line === '' || line[0] === ' ') return line
504
502
 
505
503
  // Since a more-indented line adds a \n, breaks can't be followed by a space.
506
- var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
507
- var match;
504
+ const breakRe = / [^ ]/g // note: the match index will always be <= length-2.
505
+ let match
508
506
  // start is an inclusive index. end, curr, and next are exclusive.
509
- var start = 0, end, curr = 0, next = 0;
510
- var result = '';
507
+ let start = 0
508
+ let end
509
+ let curr = 0
510
+ let next = 0
511
+ let result = ''
511
512
 
512
513
  // Invariants: 0 <= start <= length-1.
513
514
  // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
514
515
  // Inside the loop:
515
516
  // A match implies length >= 2, so curr and next are <= length-2.
516
517
  while ((match = breakRe.exec(line))) {
517
- next = match.index;
518
+ next = match.index
518
519
  // maintain invariant: curr - start <= width
519
520
  if (next - start > width) {
520
- end = (curr > start) ? curr : next; // derive end <= length-2
521
- result += '\n' + line.slice(start, end);
521
+ end = (curr > start) ? curr : next // derive end <= length-2
522
+ result += '\n' + line.slice(start, end)
522
523
  // skip the space that was output as \n
523
- start = end + 1; // derive start <= length-1
524
+ start = end + 1 // derive start <= length-1
524
525
  }
525
- curr = next;
526
+ curr = next
526
527
  }
527
528
 
528
529
  // By the invariants, start <= length-1, so there is something left over.
529
530
  // It is either the whole string or a part starting from non-whitespace.
530
- result += '\n';
531
+ result += '\n'
531
532
  // Insert a break if the remainder is too long and there is a break available.
532
533
  if (line.length - start > width && curr > start) {
533
- result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
534
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1)
534
535
  } else {
535
- result += line.slice(start);
536
+ result += line.slice(start)
536
537
  }
537
538
 
538
- return result.slice(1); // drop extra \n joiner
539
+ return result.slice(1) // drop extra \n joiner
539
540
  }
540
541
 
541
542
  // Escapes a double-quoted string.
542
- function escapeString(string) {
543
- var result = '';
544
- var char = 0;
545
- var escapeSeq;
543
+ function escapeString (string) {
544
+ let result = ''
545
+ let char = 0
546
546
 
547
- for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
548
- char = codePointAt(string, i);
549
- escapeSeq = ESCAPE_SEQUENCES[char];
547
+ for (let i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
548
+ char = codePointAt(string, i)
549
+ const escapeSeq = ESCAPE_SEQUENCES[char]
550
550
 
551
551
  if (!escapeSeq && isPrintable(char)) {
552
- result += string[i];
553
- if (char >= 0x10000) result += string[i + 1];
552
+ result += string[i]
553
+ if (char >= 0x10000) result += string[i + 1]
554
554
  } else {
555
- result += escapeSeq || encodeHex(char);
555
+ result += escapeSeq || encodeHex(char)
556
556
  }
557
557
  }
558
558
 
559
- return result;
559
+ return result
560
560
  }
561
561
 
562
- function writeFlowSequence(state, level, object) {
563
- var _result = '',
564
- _tag = state.tag,
565
- index,
566
- length,
567
- value;
562
+ function writeFlowSequence (state, level, object) {
563
+ let _result = ''
564
+ const _tag = state.tag
568
565
 
569
- for (index = 0, length = object.length; index < length; index += 1) {
570
- value = object[index];
566
+ for (let index = 0, length = object.length; index < length; index += 1) {
567
+ let value = object[index]
571
568
 
572
569
  if (state.replacer) {
573
- value = state.replacer.call(object, String(index), value);
570
+ value = state.replacer.call(object, String(index), value)
574
571
  }
575
572
 
576
573
  // Write only valid elements, put null instead of invalid elements.
577
574
  if (writeNode(state, level, value, false, false) ||
578
575
  (typeof value === 'undefined' &&
579
576
  writeNode(state, level, null, false, false))) {
580
-
581
- if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
582
- _result += state.dump;
577
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '')
578
+ _result += state.dump
583
579
  }
584
580
  }
585
581
 
586
- state.tag = _tag;
587
- state.dump = '[' + _result + ']';
582
+ state.tag = _tag
583
+ state.dump = '[' + _result + ']'
588
584
  }
589
585
 
590
- function writeBlockSequence(state, level, object, compact) {
591
- var _result = '',
592
- _tag = state.tag,
593
- index,
594
- length,
595
- value;
586
+ function writeBlockSequence (state, level, object, compact) {
587
+ let _result = ''
588
+ const _tag = state.tag
596
589
 
597
- for (index = 0, length = object.length; index < length; index += 1) {
598
- value = object[index];
590
+ for (let index = 0, length = object.length; index < length; index += 1) {
591
+ let value = object[index]
599
592
 
600
593
  if (state.replacer) {
601
- value = state.replacer.call(object, String(index), value);
594
+ value = state.replacer.call(object, String(index), value)
602
595
  }
603
596
 
604
597
  // Write only valid elements, put null instead of invalid elements.
605
598
  if (writeNode(state, level + 1, value, true, true, false, true) ||
606
599
  (typeof value === 'undefined' &&
607
600
  writeNode(state, level + 1, null, true, true, false, true))) {
608
-
609
601
  if (!compact || _result !== '') {
610
- _result += generateNextLine(state, level);
602
+ _result += generateNextLine(state, level)
611
603
  }
612
604
 
613
605
  if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
614
- _result += '-';
606
+ _result += '-'
615
607
  } else {
616
- _result += '- ';
608
+ _result += '- '
617
609
  }
618
610
 
619
- _result += state.dump;
611
+ _result += state.dump
620
612
  }
621
613
  }
622
614
 
623
- state.tag = _tag;
624
- state.dump = _result || '[]'; // Empty sequence if no valid values.
615
+ state.tag = _tag
616
+ state.dump = _result || '[]' // Empty sequence if no valid values.
625
617
  }
626
618
 
627
- function writeFlowMapping(state, level, object) {
628
- var _result = '',
629
- _tag = state.tag,
630
- objectKeyList = Object.keys(object),
631
- index,
632
- length,
633
- objectKey,
634
- objectValue,
635
- pairBuffer;
636
-
637
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
619
+ function writeFlowMapping (state, level, object) {
620
+ let _result = ''
621
+ const _tag = state.tag
622
+ const objectKeyList = Object.keys(object)
638
623
 
639
- pairBuffer = '';
640
- if (_result !== '') pairBuffer += ', ';
624
+ for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
625
+ let pairBuffer = ''
626
+ if (_result !== '') pairBuffer += ', '
641
627
 
642
- if (state.condenseFlow) pairBuffer += '"';
628
+ if (state.condenseFlow) pairBuffer += '"'
643
629
 
644
- objectKey = objectKeyList[index];
645
- objectValue = object[objectKey];
630
+ const objectKey = objectKeyList[index]
631
+ let objectValue = object[objectKey]
646
632
 
647
633
  if (state.replacer) {
648
- objectValue = state.replacer.call(object, objectKey, objectValue);
634
+ objectValue = state.replacer.call(object, objectKey, objectValue)
649
635
  }
650
636
 
651
637
  if (!writeNode(state, level, objectKey, false, false)) {
652
- continue; // Skip this pair because of invalid key;
638
+ continue // Skip this pair because of invalid key;
653
639
  }
654
640
 
655
- if (state.dump.length > 1024) pairBuffer += '? ';
641
+ if (state.dump.length > 1024) pairBuffer += '? '
656
642
 
657
- pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
643
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ')
658
644
 
659
645
  if (!writeNode(state, level, objectValue, false, false)) {
660
- continue; // Skip this pair because of invalid value.
646
+ continue // Skip this pair because of invalid value.
661
647
  }
662
648
 
663
- pairBuffer += state.dump;
649
+ pairBuffer += state.dump
664
650
 
665
651
  // Both key and value are valid.
666
- _result += pairBuffer;
652
+ _result += pairBuffer
667
653
  }
668
654
 
669
- state.tag = _tag;
670
- state.dump = '{' + _result + '}';
655
+ state.tag = _tag
656
+ state.dump = '{' + _result + '}'
671
657
  }
672
658
 
673
- function writeBlockMapping(state, level, object, compact) {
674
- var _result = '',
675
- _tag = state.tag,
676
- objectKeyList = Object.keys(object),
677
- index,
678
- length,
679
- objectKey,
680
- objectValue,
681
- explicitPair,
682
- pairBuffer;
659
+ function writeBlockMapping (state, level, object, compact) {
660
+ let _result = ''
661
+ const _tag = state.tag
662
+ const objectKeyList = Object.keys(object)
683
663
 
684
664
  // Allow sorting keys so that the output file is deterministic
685
665
  if (state.sortKeys === true) {
686
666
  // Default sorting
687
- objectKeyList.sort();
667
+ objectKeyList.sort()
688
668
  } else if (typeof state.sortKeys === 'function') {
689
669
  // Custom sort function
690
- objectKeyList.sort(state.sortKeys);
670
+ objectKeyList.sort(state.sortKeys)
691
671
  } else if (state.sortKeys) {
692
672
  // Something is wrong
693
- throw new YAMLException('sortKeys must be a boolean or a function');
673
+ throw new YAMLException('sortKeys must be a boolean or a function')
694
674
  }
695
675
 
696
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
697
- pairBuffer = '';
676
+ for (let index = 0, length = objectKeyList.length; index < length; index += 1) {
677
+ let pairBuffer = ''
698
678
 
699
679
  if (!compact || _result !== '') {
700
- pairBuffer += generateNextLine(state, level);
680
+ pairBuffer += generateNextLine(state, level)
701
681
  }
702
682
 
703
- objectKey = objectKeyList[index];
704
- objectValue = object[objectKey];
683
+ const objectKey = objectKeyList[index]
684
+ let objectValue = object[objectKey]
705
685
 
706
686
  if (state.replacer) {
707
- objectValue = state.replacer.call(object, objectKey, objectValue);
687
+ objectValue = state.replacer.call(object, objectKey, objectValue)
708
688
  }
709
689
 
710
690
  if (!writeNode(state, level + 1, objectKey, true, true, true)) {
711
- continue; // Skip this pair because of invalid key.
691
+ continue // Skip this pair because of invalid key.
712
692
  }
713
693
 
714
- explicitPair = (state.tag !== null && state.tag !== '?') ||
715
- (state.dump && state.dump.length > 1024);
694
+ const explicitPair = (state.tag !== null && state.tag !== '?') ||
695
+ (state.dump && state.dump.length > 1024)
716
696
 
717
697
  if (explicitPair) {
718
698
  if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
719
- pairBuffer += '?';
699
+ pairBuffer += '?'
720
700
  } else {
721
- pairBuffer += '? ';
701
+ pairBuffer += '? '
722
702
  }
723
703
  }
724
704
 
725
- pairBuffer += state.dump;
705
+ pairBuffer += state.dump
726
706
 
727
707
  if (explicitPair) {
728
- pairBuffer += generateNextLine(state, level);
708
+ pairBuffer += generateNextLine(state, level)
729
709
  }
730
710
 
731
711
  if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
732
- continue; // Skip this pair because of invalid value.
712
+ continue // Skip this pair because of invalid value.
733
713
  }
734
714
 
735
715
  if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
736
- pairBuffer += ':';
716
+ pairBuffer += ':'
737
717
  } else {
738
- pairBuffer += ': ';
718
+ pairBuffer += ': '
739
719
  }
740
720
 
741
- pairBuffer += state.dump;
721
+ pairBuffer += state.dump
742
722
 
743
723
  // Both key and value are valid.
744
- _result += pairBuffer;
724
+ _result += pairBuffer
745
725
  }
746
726
 
747
- state.tag = _tag;
748
- state.dump = _result || '{}'; // Empty mapping if no valid pairs.
727
+ state.tag = _tag
728
+ state.dump = _result || '{}' // Empty mapping if no valid pairs.
749
729
  }
750
730
 
751
- function detectType(state, object, explicit) {
752
- var _result, typeList, index, length, type, style;
731
+ function detectType (state, object, explicit) {
732
+ const typeList = explicit ? state.explicitTypes : state.implicitTypes
753
733
 
754
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
734
+ for (let index = 0, length = typeList.length; index < length; index += 1) {
735
+ const type = typeList[index]
755
736
 
756
- for (index = 0, length = typeList.length; index < length; index += 1) {
757
- type = typeList[index];
758
-
759
- if ((type.instanceOf || type.predicate) &&
737
+ if ((type.instanceOf || type.predicate) &&
760
738
  (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
761
- (!type.predicate || type.predicate(object))) {
762
-
739
+ (!type.predicate || type.predicate(object))) {
763
740
  if (explicit) {
764
741
  if (type.multi && type.representName) {
765
- state.tag = type.representName(object);
742
+ state.tag = type.representName(object)
766
743
  } else {
767
- state.tag = type.tag;
744
+ state.tag = type.tag
768
745
  }
769
746
  } else {
770
- state.tag = '?';
747
+ state.tag = '?'
771
748
  }
772
749
 
773
750
  if (type.represent) {
774
- style = state.styleMap[type.tag] || type.defaultStyle;
751
+ const style = state.styleMap[type.tag] || type.defaultStyle
775
752
 
753
+ let _result
776
754
  if (_toString.call(type.represent) === '[object Function]') {
777
- _result = type.represent(object, style);
755
+ _result = type.represent(object, style)
778
756
  } else if (_hasOwnProperty.call(type.represent, style)) {
779
- _result = type.represent[style](object, style);
757
+ _result = type.represent[style](object, style)
780
758
  } else {
781
- throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
759
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style')
782
760
  }
783
761
 
784
- state.dump = _result;
762
+ state.dump = _result
785
763
  }
786
764
 
787
- return true;
765
+ return true
788
766
  }
789
767
  }
790
768
 
791
- return false;
769
+ return false
792
770
  }
793
771
 
794
772
  // Serializes `object` and writes it to global `result`.
795
773
  // Returns true on success, or false on invalid object.
796
774
  //
797
- function writeNode(state, level, object, block, compact, iskey, isblockseq) {
798
- state.tag = null;
799
- state.dump = object;
775
+ function writeNode (state, level, object, block, compact, iskey, isblockseq) {
776
+ state.tag = null
777
+ state.dump = object
800
778
 
801
779
  if (!detectType(state, object, false)) {
802
- detectType(state, object, true);
780
+ detectType(state, object, true)
803
781
  }
804
782
 
805
- var type = _toString.call(state.dump);
806
- var inblock = block;
807
- var tagStr;
783
+ const type = _toString.call(state.dump)
784
+ const inblock = block
808
785
 
809
786
  if (block) {
810
- block = (state.flowLevel < 0 || state.flowLevel > level);
787
+ block = (state.flowLevel < 0 || state.flowLevel > level)
811
788
  }
812
789
 
813
- var objectOrArray = type === '[object Object]' || type === '[object Array]',
814
- duplicateIndex,
815
- duplicate;
790
+ const objectOrArray = type === '[object Object]' || type === '[object Array]'
791
+ let duplicateIndex
792
+ let duplicate
816
793
 
817
794
  if (objectOrArray) {
818
- duplicateIndex = state.duplicates.indexOf(object);
819
- duplicate = duplicateIndex !== -1;
795
+ duplicateIndex = state.duplicates.indexOf(object)
796
+ duplicate = duplicateIndex !== -1
820
797
  }
821
798
 
822
799
  if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
823
- compact = false;
800
+ compact = false
824
801
  }
825
802
 
826
803
  if (duplicate && state.usedDuplicates[duplicateIndex]) {
827
- state.dump = '*ref_' + duplicateIndex;
804
+ state.dump = '*ref_' + duplicateIndex
828
805
  } else {
829
806
  if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
830
- state.usedDuplicates[duplicateIndex] = true;
807
+ state.usedDuplicates[duplicateIndex] = true
831
808
  }
832
809
  if (type === '[object Object]') {
833
810
  if (block && (Object.keys(state.dump).length !== 0)) {
834
- writeBlockMapping(state, level, state.dump, compact);
811
+ writeBlockMapping(state, level, state.dump, compact)
835
812
  if (duplicate) {
836
- state.dump = '&ref_' + duplicateIndex + state.dump;
813
+ state.dump = '&ref_' + duplicateIndex + state.dump
837
814
  }
838
815
  } else {
839
- writeFlowMapping(state, level, state.dump);
816
+ writeFlowMapping(state, level, state.dump)
840
817
  if (duplicate) {
841
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
818
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump
842
819
  }
843
820
  }
844
821
  } else if (type === '[object Array]') {
845
822
  if (block && (state.dump.length !== 0)) {
846
823
  if (state.noArrayIndent && !isblockseq && level > 0) {
847
- writeBlockSequence(state, level - 1, state.dump, compact);
824
+ writeBlockSequence(state, level - 1, state.dump, compact)
848
825
  } else {
849
- writeBlockSequence(state, level, state.dump, compact);
826
+ writeBlockSequence(state, level, state.dump, compact)
850
827
  }
851
828
  if (duplicate) {
852
- state.dump = '&ref_' + duplicateIndex + state.dump;
829
+ state.dump = '&ref_' + duplicateIndex + state.dump
853
830
  }
854
831
  } else {
855
- writeFlowSequence(state, level, state.dump);
832
+ writeFlowSequence(state, level, state.dump)
856
833
  if (duplicate) {
857
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
834
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump
858
835
  }
859
836
  }
860
837
  } else if (type === '[object String]') {
861
838
  if (state.tag !== '?') {
862
- writeScalar(state, state.dump, level, iskey, inblock);
839
+ writeScalar(state, state.dump, level, iskey, inblock)
863
840
  }
864
841
  } else if (type === '[object Undefined]') {
865
- return false;
842
+ return false
866
843
  } else {
867
- if (state.skipInvalid) return false;
868
- throw new YAMLException('unacceptable kind of an object to dump ' + type);
844
+ if (state.skipInvalid) return false
845
+ throw new YAMLException('unacceptable kind of an object to dump ' + type)
869
846
  }
870
847
 
871
848
  if (state.tag !== null && state.tag !== '?') {
@@ -882,84 +859,79 @@ function writeNode(state, level, object, block, compact, iskey, isblockseq) {
882
859
  //
883
860
  // Also need to encode '!' because it has special meaning (end of tag prefix).
884
861
  //
885
- tagStr = encodeURI(
862
+ let tagStr = encodeURI(
886
863
  state.tag[0] === '!' ? state.tag.slice(1) : state.tag
887
- ).replace(/!/g, '%21');
864
+ ).replace(/!/g, '%21')
888
865
 
889
866
  if (state.tag[0] === '!') {
890
- tagStr = '!' + tagStr;
867
+ tagStr = '!' + tagStr
891
868
  } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
892
- tagStr = '!!' + tagStr.slice(18);
869
+ tagStr = '!!' + tagStr.slice(18)
893
870
  } else {
894
- tagStr = '!<' + tagStr + '>';
871
+ tagStr = '!<' + tagStr + '>'
895
872
  }
896
873
 
897
- state.dump = tagStr + ' ' + state.dump;
874
+ state.dump = tagStr + ' ' + state.dump
898
875
  }
899
876
  }
900
877
 
901
- return true;
878
+ return true
902
879
  }
903
880
 
904
- function getDuplicateReferences(object, state) {
905
- var objects = [],
906
- duplicatesIndexes = [],
907
- index,
908
- length;
881
+ function getDuplicateReferences (object, state) {
882
+ const objects = []
883
+ const duplicatesIndexes = []
909
884
 
910
- inspectNode(object, objects, duplicatesIndexes);
885
+ inspectNode(object, objects, duplicatesIndexes)
911
886
 
912
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
913
- state.duplicates.push(objects[duplicatesIndexes[index]]);
887
+ const length = duplicatesIndexes.length
888
+ for (let index = 0; index < length; index += 1) {
889
+ state.duplicates.push(objects[duplicatesIndexes[index]])
914
890
  }
915
- state.usedDuplicates = new Array(length);
891
+ state.usedDuplicates = new Array(length)
916
892
  }
917
893
 
918
- function inspectNode(object, objects, duplicatesIndexes) {
919
- var objectKeyList,
920
- index,
921
- length;
922
-
894
+ function inspectNode (object, objects, duplicatesIndexes) {
923
895
  if (object !== null && typeof object === 'object') {
924
- index = objects.indexOf(object);
896
+ const index = objects.indexOf(object)
925
897
  if (index !== -1) {
926
898
  if (duplicatesIndexes.indexOf(index) === -1) {
927
- duplicatesIndexes.push(index);
899
+ duplicatesIndexes.push(index)
928
900
  }
929
901
  } else {
930
- objects.push(object);
902
+ objects.push(object)
931
903
 
932
904
  if (Array.isArray(object)) {
933
- for (index = 0, length = object.length; index < length; index += 1) {
934
- inspectNode(object[index], objects, duplicatesIndexes);
905
+ for (let i = 0, length = object.length; i < length; i += 1) {
906
+ inspectNode(object[i], objects, duplicatesIndexes)
935
907
  }
936
908
  } else {
937
- objectKeyList = Object.keys(object);
909
+ const objectKeyList = Object.keys(object)
938
910
 
939
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
940
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
911
+ for (let i = 0, length = objectKeyList.length; i < length; i += 1) {
912
+ inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes)
941
913
  }
942
914
  }
943
915
  }
944
916
  }
945
917
  }
946
918
 
947
- function dump(input, options) {
948
- options = options || {};
919
+ function dump (input, options) {
920
+ options = options || {}
949
921
 
950
- var state = new State(options);
922
+ const state = new State(options)
951
923
 
952
- if (!state.noRefs) getDuplicateReferences(input, state);
924
+ if (!state.noRefs) getDuplicateReferences(input, state)
953
925
 
954
- var value = input;
926
+ let value = input
955
927
 
956
928
  if (state.replacer) {
957
- value = state.replacer.call({ '': value }, '', value);
929
+ value = state.replacer.call({ '': value }, '', value)
958
930
  }
959
931
 
960
- if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
932
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n'
961
933
 
962
- return '';
934
+ return ''
963
935
  }
964
936
 
965
- module.exports.dump = dump;
937
+ module.exports.dump = dump