[
  {
    "path": ".editorconfig",
    "content": "# EditorConfig is awesome: http://EditorConfig.org\n\nroot = true\n\n[*]\nindent_style = space\nindent_size = 4\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[package.json]\nindent_size = 2\n\n[*.md]\nindent_size = 2\ntrim_trailing_whitespace = false\n\n[*.yml]\nindent_size = 2\n"
  },
  {
    "path": ".eslintignore",
    "content": "coverage/\ndist/\n"
  },
  {
    "path": ".eslintrc.json",
    "content": "{\n    \"root\": true,\n    \"extends\": [\n        \"standard\",\n        \"plugin:node/recommended\"\n    ],\n    \"rules\": {\n        \"array-bracket-spacing\": [\n            \"error\",\n            \"never\"\n        ],\n        \"arrow-parens\": [\n            \"error\",\n            \"as-needed\"\n        ],\n        \"comma-dangle\": [\n            \"error\",\n            \"always-multiline\"\n        ],\n        \"indent\": [\n            \"error\",\n            4\n        ],\n        \"no-process-exit\": \"off\",\n        \"object-curly-spacing\": [\n            \"error\",\n            \"never\"\n        ]\n    }\n}\n"
  },
  {
    "path": ".github/issue_template.md",
    "content": "If you are reporting a security vulnerability, please do not submit an issue.\nInstead, follow the guidelines described in our\n[security policy](../blob/main/SECURITY.md).\n\nIf you are submitting a bug report because you are receiving an error or because\nthis project is incompatible with the [official JSON5 specification][spec],\nplease continue.\n\nIf you are submitting a feature request or code improvement that is compatible\nwith the [official JSON5 specification][spec], please continue.\n\n> An example of this is adding a `quote` option to `stringify()` that allows the\n> user to chose which quote character is used.\n\nIf you are submitting a feature request or code improvement that is\n*incompatible* with the [official JSON5 specification][spec], please open an\nissue on the [specification repository](https://github.com/json5/json5-spec)\ninstead.\n\n> An example of this is adding first class support for `Date` or `RegExp`\n> objects to the JSON5 format. This is outside the scope of this project.\n\n[spec]: https://json5.github.io/json5-spec/\n\nThank you for your cooperation. You may delete this message and the instructions\nabove.\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "If you are patching a security vulnerability, please do not submit a pull\nrequest. Instead, follow the guidelines described in our\n[security policy](../blob/main/SECURITY.md).\n\nIf you are submitting a bug fix for an error or fixing an incompatibility\nwith the [official JSON5 specification][spec], please continue.\n\nIf you are submitting a feature request or code improvement that is compatible\nwith the [official JSON5 specification][spec], please continue.\n\n> An example of this is adding a `quote` option to `stringify()` that allows the\n> user to chose which quote character is used.\n\nIf you are submitting a feature request or code improvement that is\n*incompatible* with the [official JSON5 specification][spec], please open a pull\nrequest on the [specification repository](https://github.com/json5/json5-spec)\ninstead.\n\n> An example of this is adding first class support for `Date` or `RegExp`\n> objects to the JSON5 format. This is outside the scope of this project.\n\n[spec]: https://json5.github.io/json5-spec/\n\nThank you for your cooperation. You may delete this message and the instructions\nabove.\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules\njspm_packages\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n\n.vscode/\ndist/\n\ntest/output.json\ntest/test.json\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"11\"\n  - \"10\"\n  - \"8\"\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "### Unreleased [[code][c-unreleased], [diff][d-unreleased]]\n\n[c-unreleased]: https://github.com/json5/json5/tree/main\n[d-unreleased]: https://github.com/json5/json5/compare/v2.2.3...HEAD\n\n### v2.2.3 [[code][c2.2.3], [diff][d2.2.3]]\n\n[c2.2.3]: https://github.com/json5/json5/tree/v2.2.3\n[d2.2.3]: https://github.com/json5/json5/compare/v2.2.2...v2.2.3\n\n- Fix: json5@2.2.3 is now the 'latest' release according to npm instead of\n  v1.0.2. ([#299])\n\n### v2.2.2 [[code][c2.2.2], [diff][d2.2.2]]\n\n[c2.2.2]: https://github.com/json5/json5/tree/v2.2.2\n[d2.2.2]: https://github.com/json5/json5/compare/v2.2.1...v2.2.2\n\n- Fix: Properties with the name `__proto__` are added to objects and arrays.\n  ([#199]) This also fixes a prototype pollution vulnerability reported by\n  Jonathan Gregson! ([#295]).\n\n### v2.2.1 [[code][c2.2.1], [diff][d2.2.1]]\n\n[c2.2.1]: https://github.com/json5/json5/tree/v2.2.1\n[d2.2.1]: https://github.com/json5/json5/compare/v2.2.0...v2.2.1\n\n- Fix: Removed dependence on minimist to patch CVE-2021-44906. ([#266])\n\n### v2.2.0 [[code][c2.2.0], [diff][d2.2.0]]\n\n[c2.2.0]: https://github.com/json5/json5/tree/v2.2.0\n[d2.2.0]: https://github.com/json5/json5/compare/v2.1.3...v2.2.0\n\n- New: Accurate and documented TypeScript declarations are now included. There\n  is no need to install `@types/json5`. ([#236], [#244])\n\n### v2.1.3 [[code][c2.1.3], [diff][d2.1.3]]\n\n[c2.1.3]: https://github.com/json5/json5/tree/v2.1.3\n[d2.1.3]: https://github.com/json5/json5/compare/v2.1.2...v2.1.3\n\n- Fix: An out of memory bug when parsing numbers has been fixed. ([#228],\n  [#229])\n\n### v2.1.2 [[code][c2.1.2], [diff][d2.1.2]]\n\n[c2.1.2]: https://github.com/json5/json5/tree/v2.1.2\n[d2.1.2]: https://github.com/json5/json5/compare/v2.1.1...v2.1.2\n\n- Fix: Bump `minimist` to `v1.2.5`. ([#222])\n\n### v2.1.1 [[code][c2.1.1], [diff][d2.1.1]]\n\n[c2.1.1]: https://github.com/json5/json5/tree/v2.1.1\n[d2.1.1]: https://github.com/json5/json5/compare/v2.0.1...v2.1.1\n\n- New: `package.json` and `package.json5` include a `module` property so\n  bundlers like webpack, rollup and parcel can take advantage of the ES Module\n  build. ([#208])\n- Fix: `stringify` outputs `\\0` as `\\\\x00` when followed by a digit. ([#210])\n- Fix: Spelling mistakes have been fixed. ([#196])\n\n### v2.1.0 [[code][c2.1.0], [diff][d2.1.0]]\n\n[c2.1.0]: https://github.com/json5/json5/tree/v2.1.0\n[d2.1.0]: https://github.com/json5/json5/compare/v2.0.1...v2.1.0\n\n- New: The `index.mjs` and `index.min.mjs` browser builds in the `dist`\n  directory support ES6 modules. ([#187])\n\n### v2.0.1 [[code][c2.0.1], [diff][d2.0.1]]\n\n[c2.0.1]: https://github.com/json5/json5/tree/v2.0.1\n[d2.0.1]: https://github.com/json5/json5/compare/v2.0.0...v2.0.1\n\n- Fix: The browser builds in the `dist` directory support ES5. ([#182])\n\n### v2.0.0 [[code][c2.0.0], [diff][d2.0.0]]\n\n[c2.0.0]: https://github.com/json5/json5/tree/v2.0.0\n[d2.0.0]: https://github.com/json5/json5/compare/v1.0.1...v2.0.0\n\n- **Major**: JSON5 officially supports Node.js v6 and later. Support for Node.js\n  v4 has been dropped. Since Node.js v6 supports ES5 features, the code has been\n  rewritten in native ES5, and the dependence on Babel has been eliminated.\n\n- New: Support for Unicode 10 has been added.\n\n- New: The test framework has been migrated from Mocha to Tap.\n\n- New: The browser build at `dist/index.js` is no longer minified by default. A\n  minified version is available at `dist/index.min.js`. ([#181])\n\n- Fix: The warning has been made clearer when line and paragraph separators are\n  used in strings.\n\n- Fix: `package.json5` has been restored, and it is automatically generated and\n  committed when the version is bumped. A new `build-package` NPM script has\n  been added to facilitate this.\n\n### v1.0.1 [[code][c1.0.1], [diff][d1.0.1]]\n\n[c1.0.1]: https://github.com/json5/json5/tree/v1.0.1\n[d1.0.1]: https://github.com/json5/json5/compare/v1.0.0...v1.0.1\n\nThis release includes a bug fix and minor change.\n\n- Fix: `parse` throws on unclosed objects and arrays.\n\n- New: `package.json5` has been removed until an easier way to keep it in sync\n  with `package.json` is found.\n\n\n### v1.0.0 [[code][c1.0.0], [diff][d1.0.0]]\n\n[c1.0.0]: https://github.com/json5/json5/tree/v1.0.0\n[d1.0.0]: https://github.com/json5/json5/compare/v0.5.1...v1.0.0\n\nThis release includes major internal changes and public API enhancements.\n\n- **Major**: JSON5 officially supports Node.js v4 and later. Support for Node.js\n  v0.10 and v0.12 have been dropped.\n\n- New: Unicode property names and Unicode escapes in property names are\n  supported. ([#1])\n\n- New: `stringify` outputs trailing commas in objects and arrays when a `space`\n  option is provided. ([#66])\n\n- New: JSON5 allows line and paragraph separator characters (U+2028 and U+2029)\n  in strings in order to be compatible with JSON. However, ES5 does not allow\n  these characters in strings, so JSON5 gives a warning when they are parsed and\n  escapes them when they are stringified. ([#70])\n\n- New: `stringify` accepts an options object as its second argument. The\n  supported options are `replacer`, `space`, and a new `quote` option that\n  specifies the quote character used in strings. ([#71])\n\n- New: The CLI supports STDIN and STDOUT and adds `--out-file`, `--space`, and\n  `--validate` options. See `json5 --help` for more information. ([#72], [#84],\n  and [#108])\n\n- New: In addition to the white space characters space `\\t`, `\\v`, `\\f`, `\\n`,\n  `\\r`, and `\\xA0`, the additional white space characters `\\u2028`, `\\u2029`,\n  and all other characters in the Space Separator Unicode category are allowed.\n\n- New: In addition to the character escapes `\\'`, `\\\"`, `\\\\`, `\\b`, `\\f`, `\\n`,\n  `\\r`, and `\\t`, the additional character escapes `\\v` and `\\0`, hexadecimal\n  escapes like `\\x0F`, and unnecessary escapes like `\\a` are allowed in string\n  values and string property names.\n\n- New: `stringify` outputs strings with single quotes by default but\n  intelligently uses double quotes if there are more single quotes than double\n  quotes inside the string. (i.e. `stringify('Stay here.')` outputs\n  `'Stay here.'` while `stringify('Let\\'s go.')` outputs `\"Let's go.\"`)\n\n- New: When a character is not allowed in a string, `stringify` outputs a\n  character escape like `\\t` when available, a hexadecimal escape like `\\x0F`\n  when the Unicode code point is less than 256, or a Unicode character escape\n  like `\\u01FF`, in that order.\n\n- New: `stringify` checks for a `toJSON5` method on objects and, if it exists,\n  stringifies its return value instead of the object. `toJSON5` overrides\n  `toJSON` if they both exist.\n\n- New: To `require` or `import` JSON5 files, use `require('json5/lib/register')`\n  or `import 'json5/lib/register'`. Previous versions used `json5/lib/require`,\n  which still exists for backward compatibility but is deprecated and will give\n  a warning.\n\n- New: To use JSON5 in browsers, use the file at `dist/index.js` or\n  `https://unpkg.com/json5@^1.0.0`.\n\n- Fix: `stringify` properly outputs `Infinity` and `NaN`. ([#67])\n\n- Fix: `isWord` no longer becomes a property of `JSON5` after calling\n  `stringify`. ([#68] and [#89])\n\n- Fix: `stringify` no longer throws when an object does not have a `prototype`.\n  ([#154])\n\n- Fix: `stringify` properly handles the `key` argument of `toJSON(key)` methods.\n  `toJSON5(key)` follows this pattern.\n\n- Fix: `stringify` accepts `Number` and `String` objects as its `space`\n  argument.\n\n- Fix: In addition to a function, `stringify` also accepts an array of keys to\n  include in the output as its `replacer` argument. Numbers, `Number` objects,\n  and `String` objects will be converted to a string if they are given as array\n  values.\n\n\n### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]]\n\n[c0.5.1]: https://github.com/json5/json5/tree/v0.5.1\n[d0.5.1]: https://github.com/json5/json5/compare/v0.5.0...v0.5.1\n\nThis release includes a minor fix for indentations when stringifying empty\narrays.\n\n- Fix: Indents no longer appear in empty arrays when stringified. ([#134])\n\n\n### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]]\n\n[c0.5.0]: https://github.com/json5/json5/tree/v0.5.0\n[d0.5.0]: https://github.com/json5/json5/compare/v0.4.0...v0.5.0\n\nThis release includes major internal changes and public API enhancements.\n\n- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for\n  Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12\n  remain.\n\n- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97])\n\n- New: `parse` and the CLI provide line and column numbers when displaying error\n  messages. ([#101]; awesome work by [@amb26].)\n\n\n### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]]\n\n[c0.4.0]: https://github.com/json5/json5/tree/v0.4.0\n[d0.4.0]: https://github.com/json5/json5/compare/v0.2.0...v0.4.0\n\nNote that v0.3.0 was tagged, but never published to npm, so this v0.4.0\nchangelog entry includes v0.3.0 features.\n\nThis is a massive release that adds `stringify` support, among other things.\n\n- **Major:** `JSON5.stringify()` now exists!\n  This method is analogous to the native `JSON.stringify()`;\n  it just avoids quoting keys where possible.\n  See the [usage documentation](./README.md#usage) for more.\n  ([#32]; huge thanks and props [@aeisenberg]!)\n\n- New: `NaN` and `-NaN` are now allowed number literals.\n  ([#30]; thanks [@rowanhill].)\n\n- New: Duplicate object keys are now allowed; the last value is used.\n  This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].)\n\n- Fix: Properly handle various whitespace and newline cases now.\n  E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings,\n  and JSON5 now accepts the same whitespace as JSON (stricter than ES5).\n  ([#58], [#60], and [#63]; thanks [@jordanbtucker].)\n\n- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again.\n  (They were disallowed in v0.2.0; see below.)\n  It turns out they *are* valid in ES5, so JSON5 supports them now too.\n  ([#36]; thanks [@jordanbtucker]!)\n\n\n### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]]\n\n[c0.2.0]: https://github.com/json5/json5/tree/v0.2.0\n[d0.2.0]: https://github.com/json5/json5/compare/v0.1.0...v0.2.0\n\nThis release fixes some bugs and adds some more utility features to help you\nexpress data more easily:\n\n- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now.\n  While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid\n  in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome\n  and Node), so JSON5 officially rejects them now, too. ([#36])\n\n- New: Trailing decimal points in decimal numbers are allowed again.\n  (They were disallowed in v0.1.0; see below.)\n  They're allowed by ES5, and differentiating between integers and floats may\n  make sense on some platforms. ([#16]; thanks [@Midar].)\n\n- New: `Infinity` and `-Infinity` are now allowed number literals.\n  ([#30]; thanks [@pepkin88].)\n\n- New: Plus signs (`+`) in front of numbers are now allowed, since it can\n  be helpful in some contexts to explicitly mark numbers as positive.\n  (E.g. when a property represents changes or deltas.)\n\n- Fix: unescaped newlines in strings are rejected now.\n  ([#24]; thanks [@Midar].)\n\n\n### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]]\n\n[c0.1.0]: https://github.com/json5/json5/tree/v0.1.0\n[d0.1.0]: https://github.com/json5/json5/compare/v0.0.1...v0.1.0\n\nThis release tightens JSON5 support and adds helpful utility features:\n\n- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].)\n\n- Fix: Reject octal numbers properly now. Previously, they were accepted but\n  improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].)\n\n- **Breaking:** Reject \"noctal\" numbers now (base-10 numbers that begin with a\n  leading zero). These are disallowed by both JSON5 and JSON, as well as by\n  ES5's strict mode. (Thanks [@MaxNanasy].)\n\n- New: Support leading decimal points in decimal numbers.\n  (Thanks [@MaxNanasy].)\n\n- **Breaking:** Reject trailing decimal points in decimal numbers now. These\n  are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].)\n\n- **Breaking:** Reject omitted elements in arrays now. These are disallowed by\n  both JSON5 and JSON.\n\n- Fix: Throw proper `SyntaxError` instances on errors now.\n\n- New: Add Node.js `require()` hook. Register via `json5/lib/require`.\n\n- New: Add Node.js `json5` executable to compile JSON5 files to JSON.\n\n\n### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]]\n\n[c0.0.1]: https://github.com/json5/json5/tree/v0.0.1\n[d0.0.1]: https://github.com/json5/json5/compare/v0.0.0...v0.0.1\n\nThis was the first implementation of this JSON5 parser.\n\n- Support unquoted object keys, including reserved words. Unicode characters\n  and escape sequences aren't yet supported.\n\n- Support single-quoted strings.\n\n- Support multi-line strings.\n\n- Support trailing commas in arrays and objects.\n\n- Support comments, both inline and block.\n\n\n### v0.0.0 [[code](https://github.com/json5/json5/tree/v0.0.0)]\n\nLet's consider this to be Douglas Crockford's original [json_parse.js] — a\nparser for the regular JSON format.\n\n\n[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js\n[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240\n\n[@MaxNanasy]: https://github.com/MaxNanasy\n[@Midar]: https://github.com/Midar\n[@pepkin88]: https://github.com/pepkin88\n[@rowanhill]: https://github.com/rowanhill\n[@aeisenberg]: https://github.com/aeisenberg\n[@jordanbtucker]: https://github.com/jordanbtucker\n[@amb26]: https://github.com/amb26\n\n[#1]: https://github.com/json5/json5/issues/1\n[#16]: https://github.com/json5/json5/issues/16\n[#24]: https://github.com/json5/json5/issues/24\n[#30]: https://github.com/json5/json5/issues/30\n[#32]: https://github.com/json5/json5/issues/32\n[#36]: https://github.com/json5/json5/issues/36\n[#57]: https://github.com/json5/json5/issues/57\n[#58]: https://github.com/json5/json5/pull/58\n[#60]: https://github.com/json5/json5/pull/60\n[#63]: https://github.com/json5/json5/pull/63\n[#66]: https://github.com/json5/json5/issues/66\n[#67]: https://github.com/json5/json5/issues/67\n[#68]: https://github.com/json5/json5/issues/68\n[#70]: https://github.com/json5/json5/issues/70\n[#71]: https://github.com/json5/json5/issues/71\n[#72]: https://github.com/json5/json5/issues/72\n[#84]: https://github.com/json5/json5/pull/84\n[#89]: https://github.com/json5/json5/pull/89\n[#97]: https://github.com/json5/json5/pull/97\n[#101]: https://github.com/json5/json5/pull/101\n[#108]: https://github.com/json5/json5/pull/108\n[#134]: https://github.com/json5/json5/pull/134\n[#154]: https://github.com/json5/json5/issues/154\n[#181]: https://github.com/json5/json5/issues/181\n[#182]: https://github.com/json5/json5/issues/182\n[#187]: https://github.com/json5/json5/issues/187\n[#196]: https://github.com/json5/json5/issues/196\n[#199]: https://github.com/json5/json5/issues/199\n[#208]: https://github.com/json5/json5/issues/208\n[#210]: https://github.com/json5/json5/issues/210\n[#222]: https://github.com/json5/json5/issues/222\n[#228]: https://github.com/json5/json5/issues/228\n[#229]: https://github.com/json5/json5/issues/229\n[#236]: https://github.com/json5/json5/issues/236\n[#244]: https://github.com/json5/json5/issues/244\n[#266]: https://github.com/json5/json5/issues/266\n[#295]: https://github.com/json5/json5/issues/295\n[#299]: https://github.com/json5/json5/issues/299\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to JSON5\nWe're glad you're interested in contributing to JSON5.\n\n## Development\n```sh\ngit clone https://github.com/json5/json5\ncd json5\nnpm install\n```\n\nWhen contributing code, please write relevant tests and run `npm test` and `npm\nrun lint` before submitting pull requests. Please use an editor that supports\n[EditorConfig](http://editorconfig.org/).\n\n## Issues\nTo report bugs or request features regarding the JSON5 data format, please\nsubmit an issue to the [official specification\nrepository](https://github.com/json5/json5-spec).\n\nTo report bugs or request features regarding the JavaScript implementation of\nJSON5, please submit an issue to this repository.\n"
  },
  {
    "path": "LICENSE.md",
    "content": "MIT License\n\nCopyright (c) 2012-2018 Aseem Kishore, and [others].\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n[others]: https://github.com/json5/json5/contributors\n"
  },
  {
    "path": "README.md",
    "content": "# JSON5 – JSON for Humans\n\n[![Build Status](https://app.travis-ci.com/json5/json5.svg?branch=main)][Build\nStatus] [![Coverage\nStatus](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage\nStatus]\n\nJSON5 is an extension to the popular [JSON] file format that aims to be\neasier to **write and maintain _by hand_ (e.g. for config files)**.\nIt is _not intended_ to be used for machine-to-machine communication.\n(Keep using JSON or other file formats for that. 🙂)\n\nJSON5 was started in 2012, and as of 2022, now gets **[>65M downloads/week](https://www.npmjs.com/package/json5)**,\nranks in the **[top 0.1%](https://gist.github.com/anvaka/8e8fa57c7ee1350e3491)** of the most depended-upon packages on npm,\nand has been adopted by major projects like\n**[Chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;drc=5de823b36e68fd99009a29281b17bc3a1d6b329c),\n[Next.js](https://github.com/vercel/next.js/blob/b88f20c90bf4659b8ad5cb2a27956005eac2c7e8/packages/next/lib/find-config.ts#L43-L46),\n[Babel](https://babeljs.io/docs/en/config-files#supported-file-extensions),\n[Retool](https://community.retool.com/t/i-am-attempting-to-append-several-text-fields-to-a-google-sheet-but-receiving-a-json5-invalid-character-error/7626),\n[WebStorm](https://www.jetbrains.com/help/webstorm/json.html),\nand [more](https://github.com/json5/json5/wiki/In-the-Wild)**.\nIt's also natively supported on **[Apple platforms](https://developer.apple.com/documentation/foundation/jsondecoder/3766916-allowsjson5)**\nlike **macOS** and **iOS**.\n\nFormally, the **[JSON5 Data Interchange Format](https://spec.json5.org/)** is a superset of JSON\n(so valid JSON files will always be valid JSON5 files)\nthat expands its syntax to include some productions from [ECMAScript 5.1] (ES5).\nIt's also a _subset_ of ES5, so valid JSON5 files will always be valid ES5.[*](#ecmascript-compatibility)\n\nThis JavaScript library is a reference implementation for JSON5 parsing and serialization,\nand is directly used in many of the popular projects mentioned above\n(where e.g. extreme performance isn't necessary),\nbut others have created [many other libraries](https://github.com/json5/json5/wiki/In-the-Wild)\nacross many other platforms.\n\n[Build Status]: https://app.travis-ci.com/json5/json5\n\n[Coverage Status]: https://coveralls.io/github/json5/json5\n\n[JSON]: https://tools.ietf.org/html/rfc7159\n\n[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/\n\n## Summary of Features\nThe following ECMAScript 5.1 features, which are not supported in JSON, have\nbeen extended to JSON5.\n\n### Objects\n- Object keys may be an ECMAScript 5.1 _[IdentifierName]_.\n- Objects may have a single trailing comma.\n\n### Arrays\n- Arrays may have a single trailing comma.\n\n### Strings\n- Strings may be single quoted.\n- Strings may span multiple lines by escaping new line characters.\n- Strings may include character escapes.\n\n### Numbers\n- Numbers may be hexadecimal.\n- Numbers may have a leading or trailing decimal point.\n- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN.\n- Numbers may begin with an explicit plus sign.\n\n### Comments\n- Single and multi-line comments are allowed.\n\n### White Space\n- Additional white space characters are allowed.\n\n[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6\n\n[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933\n\n## Example\nKitchen-sink example:\n\n```js\n{\n  // comments\n  unquoted: 'and you can quote me on that',\n  singleQuotes: 'I can use \"double quotes\" here',\n  lineBreaks: \"Look, Mom! \\\nNo \\\\n's!\",\n  hexadecimal: 0xdecaf,\n  leadingDecimalPoint: .8675309, andTrailing: 8675309.,\n  positiveSign: +1,\n  trailingComma: 'in objects', andIn: ['arrays',],\n  \"backwardsCompatible\": \"with JSON\",\n}\n```\n\nA more real-world example is [this config file](https://github.com/chromium/chromium/blob/feb3c9f670515edf9a88f185301cbd7794ee3e52/third_party/blink/renderer/platform/runtime_enabled_features.json5)\nfrom the Chromium/Blink project.\n\n## Specification\nFor a detailed explanation of the JSON5 format, please read the [official\nspecification](https://json5.github.io/json5-spec/).\n\n## Installation and Usage\n### Node.js\n```sh\nnpm install json5\n```\n\n#### CommonJS\n```js\nconst JSON5 = require('json5')\n```\n\n#### Modules\n```js\nimport JSON5 from 'json5'\n```\n\n### Browsers\n#### UMD\n```html\n<!-- This will create a global `JSON5` variable. -->\n<script src=\"https://unpkg.com/json5@2/dist/index.min.js\"></script>\n```\n\n#### Modules\n```html\n<script type=\"module\">\n  import JSON5 from 'https://unpkg.com/json5@2/dist/index.min.mjs'\n</script>\n```\n\n## API\nThe JSON5 API is compatible with the [JSON API].\n\n[JSON API]:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON\n\n### JSON5.parse()\nParses a JSON5 string, constructing the JavaScript value or object described by\nthe string. An optional reviver function can be provided to perform a\ntransformation on the resulting object before it is returned.\n\n#### Syntax\n    JSON5.parse(text[, reviver])\n\n#### Parameters\n- `text`: The string to parse as JSON5.\n- `reviver`: If a function, this prescribes how the value originally produced by\n  parsing is transformed, before being returned.\n\n#### Return value\nThe object corresponding to the given JSON5 text.\n\n### JSON5.stringify()\nConverts a JavaScript value to a JSON5 string, optionally replacing values if a\nreplacer function is specified, or optionally including only the specified\nproperties if a replacer array is specified.\n\n#### Syntax\n    JSON5.stringify(value[, replacer[, space]])\n    JSON5.stringify(value[, options])\n\n#### Parameters\n- `value`: The value to convert to a JSON5 string.\n- `replacer`: A function that alters the behavior of the stringification\n  process, or an array of String and Number objects that serve as a whitelist\n  for selecting/filtering the properties of the value object to be included in\n  the JSON5 string. If this value is null or not provided, all properties of the\n  object are included in the resulting JSON5 string.\n- `space`: A String or Number object that's used to insert white space into the\n  output JSON5 string for readability purposes. If this is a Number, it\n  indicates the number of space characters to use as white space; this number is\n  capped at 10 (if it is greater, the value is just 10). Values less than 1\n  indicate that no space should be used. If this is a String, the string (or the\n  first 10 characters of the string, if it's longer than that) is used as white\n  space. If this parameter is not provided (or is null), no white space is used.\n  If white space is used, trailing commas will be used in objects and arrays.\n- `options`: An object with the following properties:\n  - `replacer`: Same as the `replacer` parameter.\n  - `space`: Same as the `space` parameter.\n  - `quote`: A String representing the quote character to use when serializing\n    strings.\n\n#### Return value\nA JSON5 string representing the value.\n\n### Node.js `require()` JSON5 files\nWhen using Node.js, you can `require()` JSON5 files by adding the following\nstatement.\n\n```js\nrequire('json5/lib/register')\n```\n\nThen you can load a JSON5 file with a Node.js `require()` statement. For\nexample:\n\n```js\nconst config = require('./config.json5')\n```\n\n## CLI\nSince JSON is more widely used than JSON5, this package includes a CLI for\nconverting JSON5 to JSON and for validating the syntax of JSON5 documents.\n\n### Installation\n```sh\nnpm install --global json5\n```\n\n### Usage\n```sh\njson5 [options] <file>\n```\n\nIf `<file>` is not provided, then STDIN is used.\n\n#### Options:\n- `-s`, `--space`: The number of spaces to indent or `t` for tabs\n- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT\n- `-v`, `--validate`: Validate JSON5 but do not output JSON\n- `-V`, `--version`: Output the version number\n- `-h`, `--help`: Output usage information\n\n## Contributing\n### Development\n```sh\ngit clone https://github.com/json5/json5\ncd json5\nnpm install\n```\n\nWhen contributing code, please write relevant tests and run `npm test` and `npm\nrun lint` before submitting pull requests. Please use an editor that supports\n[EditorConfig](http://editorconfig.org/).\n\n### Issues\nTo report bugs or request features regarding the JSON5 **data format**,\nplease submit an issue to the official\n**[_specification_ repository](https://github.com/json5/json5-spec)**.\n\nNote that we will never add any features that make JSON5 incompatible with ES5;\nthat compatibility is a fundamental premise of JSON5.[*](#ecmascript-compatibility)\n\nTo report bugs or request features regarding this **JavaScript implementation**\nof JSON5, please submit an issue to **_this_ repository**.\n\n### Security Vulnerabilities and Disclosures\nTo report a security vulnerability, please follow the follow the guidelines\ndescribed in our [security policy](./SECURITY.md).\n\n## ECMAScript Compatibility\nWhile JSON5 aims to be fully compatible with ES5, there is one exception where\nboth JSON and JSON5 are not. Both JSON and JSON5 allow unescaped line and\nparagraph separator characters (U+2028 and U+2029) in strings, however ES5 does\nnot. A [proposal](https://github.com/tc39/proposal-json-superset) to allow these\ncharacters in strings was adopted into ES2019, making JSON and JSON5 fully\ncompatible with ES2019.\n\n## License\nMIT. See [LICENSE.md](./LICENSE.md) for details.\n\n## Credits\n[Aseem Kishore](https://github.com/aseemk) founded this project.\nHe wrote a [blog post](https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5)\nabout the journey and lessons learned 10 years in.\n\n[Michael Bolin](http://bolinfest.com/) independently arrived at and published\nsome of these same ideas with awesome explanations and detail. Recommended\nreading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html)\n\n[Douglas Crockford](http://www.crockford.com/) of course designed and built\nJSON, but his state machine diagrams on the [JSON website](http://json.org/), as\ncheesy as it may sound, gave us motivation and confidence that building a new\nparser to implement these ideas was within reach! The original\nimplementation of JSON5 was also modeled directly off of Doug’s open-source\n[json_parse.js] parser. We’re grateful for that clean and well-documented\ncode.\n\n[json_parse.js]:\nhttps://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js\n\n[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific\nsupporter, contributing multiple patches and ideas.\n\n[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original\n`stringify` method.\n\n[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely\nwith ES5, wrote the official JSON5 specification, completely rewrote the\ncodebase from the ground up, and is actively maintaining this project.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# JSON5 Security Policy\n\nWe take security seriously. Responsible reporting and disclosure of security\nvulnerabilities is important for the protection and privacy of our users. If you\ndiscover any security vulnerabilities, please follow these guidelines.\n\nPublished security advisories are available on our [GitHub Security Advisories]\npage.\n\nTo report a vulnerability, please draft a [new security advisory on GitHub]. Any\nfields that you are unsure of or don't understand can be left at their default\nvalues. The important part is that the vulnerability is reported. Once the\nsecurity advisory draft has been created, we will validate the vulnerability and\ncoordinate with you to fix it, release a patch, and responsibly disclose the\nvulnerability to the public. Read GitHub's documentation on [privately reporting\na security vulnerability] for details.\n\nIf you are unable to draft a security advisory, or if you need help or have\nsecurity related questions, please send an email to [security@json5.org].\n\nPlease do not report undisclosed vulnerabilities on public sites or forums,\nincluding GitHub issues and pull requests. Reporting vulnerabilities to the\npublic could allow attackers to exploit vulnerable applications before we have\nbeen able to release a patch and before applications have had time to install\nthe patch. Once we have released a patch and sufficient time has passed for\napplications to install the patch, we will disclose the vulnerability to the\npublic, at which time you will be free to publish details of the vulnerability\non public sites and forums.\n\nIf you have a fix for a security vulnerability, please do not submit a GitHub\npull request. Instead, report the vulnerability as described in this policy.\nOnce we have verified the vulnerability, we can create a [temporary private\nfork] to collaborate on a patch.\n\nWe appreciate your cooperation in helping keep our users safe by following this\npolicy.\n\n[github security advisories]: https://github.com/json5/json5/security/advisories\n[new security advisory on github]:\n  https://github.com/json5/json5/security/advisories/new\n[privately reporting a security vulnerability]:\n  https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability\n[security@json5.org]: mailto:security@json5.org\n[temporary private fork]:\n  https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/collaborating-in-a-temporary-private-fork-to-resolve-a-repository-security-vulnerability\n"
  },
  {
    "path": "build/es5.js",
    "content": "require('core-js/fn/string/code-point-at')\nrequire('core-js/fn/string/from-code-point')\n\nconst JSON5 = require('../lib')\n\nmodule.exports = JSON5\n"
  },
  {
    "path": "build/package.js",
    "content": "const fs = require('fs')\nconst path = require('path')\n\nconst JSON5 = require('../lib')\n\nconst pkg = require('../package.json')\n\nlet pkg5 = '// This is a generated file. Do not edit.\\n'\npkg5 += pkg5 = JSON5.stringify(pkg, null, 2)\n\nfs.writeFileSync(path.resolve(__dirname, '..', 'package.json5'), pkg5)\n"
  },
  {
    "path": "build/unicode.js",
    "content": "/* eslint-disable camelcase */\n\nconst fs = require('fs')\nconst path = require('path')\nconst regenerate = require('regenerate')\n\nconst libDir = 'lib'\n\nconst Space_Separator = regenerate()\n    .add(require('unicode-10.0.0/General_Category/Space_Separator/code-points'))\n    .remove('\\t', '\\v', '\\f', ' ', '\\u00A0', '\\uFEFF')\n\nconst ID_Start = regenerate()\n    .add(require('unicode-10.0.0/General_Category/Uppercase_Letter/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Lowercase_Letter/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Titlecase_Letter/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Modifier_Letter/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Other_Letter/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Letter_Number/code-points'))\n    .remove('$', '_')\n    .removeRange('A', 'Z')\n    .removeRange('a', 'z')\n\nconst ID_Continue = regenerate()\n    .add(ID_Start)\n    .add(require('unicode-10.0.0/General_Category/Nonspacing_Mark/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Spacing_Mark/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Decimal_Number/code-points'))\n    .add(require('unicode-10.0.0/General_Category/Connector_Punctuation/code-points'))\n    .remove('$', '_')\n    .removeRange('0', '9')\n    .removeRange('A', 'Z')\n    .removeRange('a', 'z')\n\nconst outDir = libDir\nconst outPath = path.join(outDir, 'unicode.js')\n\nif (!fs.existsSync(outDir)) {\n    fs.mkdirSync(outDir)\n}\n\nconst data = {\n    Space_Separator,\n    ID_Start,\n    ID_Continue,\n}\n\nlet es6 = '// This is a generated file. Do not edit.\\n'\nes6 += Object.keys(data).map(key => `module.exports.${key} = /${data[key]}/\\n`).join('')\n\nfs.writeFileSync(outPath, es6)\n"
  },
  {
    "path": "lib/cli.js",
    "content": "#!/usr/bin/env node\n\nconst fs = require('fs')\nconst path = require('path')\nconst pkg = require('../package.json')\nconst JSON5 = require('./')\n\nconst argv = parseArgs()\n\nif (argv.version) {\n    version()\n} else if (argv.help) {\n    usage()\n} else {\n    const inFilename = argv.defaults[0]\n\n    let readStream\n    if (inFilename) {\n        readStream = fs.createReadStream(inFilename)\n    } else {\n        readStream = process.stdin\n    }\n\n    let json5 = ''\n    readStream.on('data', data => {\n        json5 += data\n    })\n\n    readStream.on('end', () => {\n        let space\n        if (argv.space === 't' || argv.space === 'tab') {\n            space = '\\t'\n        } else {\n            space = Number(argv.space)\n        }\n\n        let value\n        try {\n            value = JSON5.parse(json5)\n            if (!argv.validate) {\n                const json = JSON.stringify(value, null, space)\n\n                let writeStream\n\n                // --convert is for backward compatibility with v0.5.1. If\n                // specified with <file> and not --out-file, then a file with\n                // the same name but with a .json extension will be written.\n                if (argv.convert && inFilename && !argv.outFile) {\n                    const parsedFilename = path.parse(inFilename)\n                    const outFilename = path.format(\n                        Object.assign(\n                            parsedFilename,\n                            {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'}\n                        )\n                    )\n\n                    writeStream = fs.createWriteStream(outFilename)\n                } else if (argv.outFile) {\n                    writeStream = fs.createWriteStream(argv.outFile)\n                } else {\n                    writeStream = process.stdout\n                }\n\n                writeStream.write(json)\n            }\n        } catch (err) {\n            console.error(err.message)\n            process.exit(1)\n        }\n    })\n}\n\nfunction parseArgs () {\n    let convert\n    let space\n    let validate\n    let outFile\n    let version\n    let help\n    const defaults = []\n\n    const args = process.argv.slice(2)\n    for (let i = 0; i < args.length; i++) {\n        const arg = args[i]\n        switch (arg) {\n        case '--convert':\n        case '-c':\n            convert = true\n            break\n\n        case '--space':\n        case '-s':\n            space = args[++i]\n            break\n\n        case '--validate':\n        case '-v':\n            validate = true\n            break\n\n        case '--out-file':\n        case '-o':\n            outFile = args[++i]\n            break\n\n        case '--version':\n        case '-V':\n            version = true\n            break\n\n        case '--help':\n        case '-h':\n            help = true\n            break\n\n        default:\n            defaults.push(arg)\n            break\n        }\n    }\n\n    return {\n        convert,\n        space,\n        validate,\n        outFile,\n        version,\n        help,\n        defaults,\n    }\n}\n\nfunction version () {\n    console.log(pkg.version)\n}\n\nfunction usage () {\n    console.log(\n        `\n  Usage: json5 [options] <file>\n\n  If <file> is not provided, then STDIN is used.\n\n  Options:\n\n    -s, --space              The number of spaces to indent or 't' for tabs\n    -o, --out-file [file]    Output to the specified file, otherwise STDOUT\n    -v, --validate           Validate JSON5 but do not output JSON\n    -V, --version            Output the version number\n    -h, --help               Output usage information`\n    )\n}\n"
  },
  {
    "path": "lib/index.d.ts",
    "content": "import parse = require('./parse')\nimport stringify = require('./stringify')\n\nexport {parse, stringify}\n"
  },
  {
    "path": "lib/index.js",
    "content": "const parse = require('./parse')\nconst stringify = require('./stringify')\n\nconst JSON5 = {\n    parse,\n    stringify,\n}\n\nmodule.exports = JSON5\n"
  },
  {
    "path": "lib/parse.d.ts",
    "content": "/**\n * Parses a JSON5 string, constructing the JavaScript value or object described\n * by the string.\n * @template T The type of the return value.\n * @param text The string to parse as JSON5.\n * @param reviver A function that prescribes how the value originally produced\n * by parsing is transformed before being returned.\n * @returns The JavaScript value converted from the JSON5 string.\n */\ndeclare function parse<T = any>(\n    text: string,\n    reviver?: ((this: any, key: string, value: any) => any) | null,\n): T\n\nexport = parse\n"
  },
  {
    "path": "lib/parse.js",
    "content": "const util = require('./util')\n\nlet source\nlet parseState\nlet stack\nlet pos\nlet line\nlet column\nlet token\nlet key\nlet root\n\nmodule.exports = function parse (text, reviver) {\n    source = String(text)\n    parseState = 'start'\n    stack = []\n    pos = 0\n    line = 1\n    column = 0\n    token = undefined\n    key = undefined\n    root = undefined\n\n    do {\n        token = lex()\n\n        // This code is unreachable.\n        // if (!parseStates[parseState]) {\n        //     throw invalidParseState()\n        // }\n\n        parseStates[parseState]()\n    } while (token.type !== 'eof')\n\n    if (typeof reviver === 'function') {\n        return internalize({'': root}, '', reviver)\n    }\n\n    return root\n}\n\nfunction internalize (holder, name, reviver) {\n    const value = holder[name]\n    if (value != null && typeof value === 'object') {\n        if (Array.isArray(value)) {\n            for (let i = 0; i < value.length; i++) {\n                const key = String(i)\n                const replacement = internalize(value, key, reviver)\n                if (replacement === undefined) {\n                    delete value[key]\n                } else {\n                    Object.defineProperty(value, key, {\n                        value: replacement,\n                        writable: true,\n                        enumerable: true,\n                        configurable: true,\n                    })\n                }\n            }\n        } else {\n            for (const key in value) {\n                const replacement = internalize(value, key, reviver)\n                if (replacement === undefined) {\n                    delete value[key]\n                } else {\n                    Object.defineProperty(value, key, {\n                        value: replacement,\n                        writable: true,\n                        enumerable: true,\n                        configurable: true,\n                    })\n                }\n            }\n        }\n    }\n\n    return reviver.call(holder, name, value)\n}\n\nlet lexState\nlet buffer\nlet doubleQuote\nlet sign\nlet c\n\nfunction lex () {\n    lexState = 'default'\n    buffer = ''\n    doubleQuote = false\n    sign = 1\n\n    for (;;) {\n        c = peek()\n\n        // This code is unreachable.\n        // if (!lexStates[lexState]) {\n        //     throw invalidLexState(lexState)\n        // }\n\n        const token = lexStates[lexState]()\n        if (token) {\n            return token\n        }\n    }\n}\n\nfunction peek () {\n    if (source[pos]) {\n        return String.fromCodePoint(source.codePointAt(pos))\n    }\n}\n\nfunction read () {\n    const c = peek()\n\n    if (c === '\\n') {\n        line++\n        column = 0\n    } else if (c) {\n        column += c.length\n    } else {\n        column++\n    }\n\n    if (c) {\n        pos += c.length\n    }\n\n    return c\n}\n\nconst lexStates = {\n    default () {\n        switch (c) {\n        case '\\t':\n        case '\\v':\n        case '\\f':\n        case ' ':\n        case '\\u00A0':\n        case '\\uFEFF':\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n            read()\n            return\n\n        case '/':\n            read()\n            lexState = 'comment'\n            return\n\n        case undefined:\n            read()\n            return newToken('eof')\n        }\n\n        if (util.isSpaceSeparator(c)) {\n            read()\n            return\n        }\n\n        // This code is unreachable.\n        // if (!lexStates[parseState]) {\n        //     throw invalidLexState(parseState)\n        // }\n\n        return lexStates[parseState]()\n    },\n\n    comment () {\n        switch (c) {\n        case '*':\n            read()\n            lexState = 'multiLineComment'\n            return\n\n        case '/':\n            read()\n            lexState = 'singleLineComment'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    multiLineComment () {\n        switch (c) {\n        case '*':\n            read()\n            lexState = 'multiLineCommentAsterisk'\n            return\n\n        case undefined:\n            throw invalidChar(read())\n        }\n\n        read()\n    },\n\n    multiLineCommentAsterisk () {\n        switch (c) {\n        case '*':\n            read()\n            return\n\n        case '/':\n            read()\n            lexState = 'default'\n            return\n\n        case undefined:\n            throw invalidChar(read())\n        }\n\n        read()\n        lexState = 'multiLineComment'\n    },\n\n    singleLineComment () {\n        switch (c) {\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n            read()\n            lexState = 'default'\n            return\n\n        case undefined:\n            read()\n            return newToken('eof')\n        }\n\n        read()\n    },\n\n    value () {\n        switch (c) {\n        case '{':\n        case '[':\n            return newToken('punctuator', read())\n\n        case 'n':\n            read()\n            literal('ull')\n            return newToken('null', null)\n\n        case 't':\n            read()\n            literal('rue')\n            return newToken('boolean', true)\n\n        case 'f':\n            read()\n            literal('alse')\n            return newToken('boolean', false)\n\n        case '-':\n        case '+':\n            if (read() === '-') {\n                sign = -1\n            }\n\n            lexState = 'sign'\n            return\n\n        case '.':\n            buffer = read()\n            lexState = 'decimalPointLeading'\n            return\n\n        case '0':\n            buffer = read()\n            lexState = 'zero'\n            return\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n            buffer = read()\n            lexState = 'decimalInteger'\n            return\n\n        case 'I':\n            read()\n            literal('nfinity')\n            return newToken('numeric', Infinity)\n\n        case 'N':\n            read()\n            literal('aN')\n            return newToken('numeric', NaN)\n\n        case '\"':\n        case \"'\":\n            doubleQuote = (read() === '\"')\n            buffer = ''\n            lexState = 'string'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    identifierNameStartEscape () {\n        if (c !== 'u') {\n            throw invalidChar(read())\n        }\n\n        read()\n        const u = unicodeEscape()\n        switch (u) {\n        case '$':\n        case '_':\n            break\n\n        default:\n            if (!util.isIdStartChar(u)) {\n                throw invalidIdentifier()\n            }\n\n            break\n        }\n\n        buffer += u\n        lexState = 'identifierName'\n    },\n\n    identifierName () {\n        switch (c) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n            buffer += read()\n            return\n\n        case '\\\\':\n            read()\n            lexState = 'identifierNameEscape'\n            return\n        }\n\n        if (util.isIdContinueChar(c)) {\n            buffer += read()\n            return\n        }\n\n        return newToken('identifier', buffer)\n    },\n\n    identifierNameEscape () {\n        if (c !== 'u') {\n            throw invalidChar(read())\n        }\n\n        read()\n        const u = unicodeEscape()\n        switch (u) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n            break\n\n        default:\n            if (!util.isIdContinueChar(u)) {\n                throw invalidIdentifier()\n            }\n\n            break\n        }\n\n        buffer += u\n        lexState = 'identifierName'\n    },\n\n    sign () {\n        switch (c) {\n        case '.':\n            buffer = read()\n            lexState = 'decimalPointLeading'\n            return\n\n        case '0':\n            buffer = read()\n            lexState = 'zero'\n            return\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n            buffer = read()\n            lexState = 'decimalInteger'\n            return\n\n        case 'I':\n            read()\n            literal('nfinity')\n            return newToken('numeric', sign * Infinity)\n\n        case 'N':\n            read()\n            literal('aN')\n            return newToken('numeric', NaN)\n        }\n\n        throw invalidChar(read())\n    },\n\n    zero () {\n        switch (c) {\n        case '.':\n            buffer += read()\n            lexState = 'decimalPoint'\n            return\n\n        case 'e':\n        case 'E':\n            buffer += read()\n            lexState = 'decimalExponent'\n            return\n\n        case 'x':\n        case 'X':\n            buffer += read()\n            lexState = 'hexadecimal'\n            return\n        }\n\n        return newToken('numeric', sign * 0)\n    },\n\n    decimalInteger () {\n        switch (c) {\n        case '.':\n            buffer += read()\n            lexState = 'decimalPoint'\n            return\n\n        case 'e':\n        case 'E':\n            buffer += read()\n            lexState = 'decimalExponent'\n            return\n        }\n\n        if (util.isDigit(c)) {\n            buffer += read()\n            return\n        }\n\n        return newToken('numeric', sign * Number(buffer))\n    },\n\n    decimalPointLeading () {\n        if (util.isDigit(c)) {\n            buffer += read()\n            lexState = 'decimalFraction'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    decimalPoint () {\n        switch (c) {\n        case 'e':\n        case 'E':\n            buffer += read()\n            lexState = 'decimalExponent'\n            return\n        }\n\n        if (util.isDigit(c)) {\n            buffer += read()\n            lexState = 'decimalFraction'\n            return\n        }\n\n        return newToken('numeric', sign * Number(buffer))\n    },\n\n    decimalFraction () {\n        switch (c) {\n        case 'e':\n        case 'E':\n            buffer += read()\n            lexState = 'decimalExponent'\n            return\n        }\n\n        if (util.isDigit(c)) {\n            buffer += read()\n            return\n        }\n\n        return newToken('numeric', sign * Number(buffer))\n    },\n\n    decimalExponent () {\n        switch (c) {\n        case '+':\n        case '-':\n            buffer += read()\n            lexState = 'decimalExponentSign'\n            return\n        }\n\n        if (util.isDigit(c)) {\n            buffer += read()\n            lexState = 'decimalExponentInteger'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    decimalExponentSign () {\n        if (util.isDigit(c)) {\n            buffer += read()\n            lexState = 'decimalExponentInteger'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    decimalExponentInteger () {\n        if (util.isDigit(c)) {\n            buffer += read()\n            return\n        }\n\n        return newToken('numeric', sign * Number(buffer))\n    },\n\n    hexadecimal () {\n        if (util.isHexDigit(c)) {\n            buffer += read()\n            lexState = 'hexadecimalInteger'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    hexadecimalInteger () {\n        if (util.isHexDigit(c)) {\n            buffer += read()\n            return\n        }\n\n        return newToken('numeric', sign * Number(buffer))\n    },\n\n    string () {\n        switch (c) {\n        case '\\\\':\n            read()\n            buffer += escape()\n            return\n\n        case '\"':\n            if (doubleQuote) {\n                read()\n                return newToken('string', buffer)\n            }\n\n            buffer += read()\n            return\n\n        case \"'\":\n            if (!doubleQuote) {\n                read()\n                return newToken('string', buffer)\n            }\n\n            buffer += read()\n            return\n\n        case '\\n':\n        case '\\r':\n            throw invalidChar(read())\n\n        case '\\u2028':\n        case '\\u2029':\n            separatorChar(c)\n            break\n\n        case undefined:\n            throw invalidChar(read())\n        }\n\n        buffer += read()\n    },\n\n    start () {\n        switch (c) {\n        case '{':\n        case '[':\n            return newToken('punctuator', read())\n\n        // This code is unreachable since the default lexState handles eof.\n        // case undefined:\n        //     return newToken('eof')\n        }\n\n        lexState = 'value'\n    },\n\n    beforePropertyName () {\n        switch (c) {\n        case '$':\n        case '_':\n            buffer = read()\n            lexState = 'identifierName'\n            return\n\n        case '\\\\':\n            read()\n            lexState = 'identifierNameStartEscape'\n            return\n\n        case '}':\n            return newToken('punctuator', read())\n\n        case '\"':\n        case \"'\":\n            doubleQuote = (read() === '\"')\n            lexState = 'string'\n            return\n        }\n\n        if (util.isIdStartChar(c)) {\n            buffer += read()\n            lexState = 'identifierName'\n            return\n        }\n\n        throw invalidChar(read())\n    },\n\n    afterPropertyName () {\n        if (c === ':') {\n            return newToken('punctuator', read())\n        }\n\n        throw invalidChar(read())\n    },\n\n    beforePropertyValue () {\n        lexState = 'value'\n    },\n\n    afterPropertyValue () {\n        switch (c) {\n        case ',':\n        case '}':\n            return newToken('punctuator', read())\n        }\n\n        throw invalidChar(read())\n    },\n\n    beforeArrayValue () {\n        if (c === ']') {\n            return newToken('punctuator', read())\n        }\n\n        lexState = 'value'\n    },\n\n    afterArrayValue () {\n        switch (c) {\n        case ',':\n        case ']':\n            return newToken('punctuator', read())\n        }\n\n        throw invalidChar(read())\n    },\n\n    end () {\n        // This code is unreachable since it's handled by the default lexState.\n        // if (c === undefined) {\n        //     read()\n        //     return newToken('eof')\n        // }\n\n        throw invalidChar(read())\n    },\n}\n\nfunction newToken (type, value) {\n    return {\n        type,\n        value,\n        line,\n        column,\n    }\n}\n\nfunction literal (s) {\n    for (const c of s) {\n        const p = peek()\n\n        if (p !== c) {\n            throw invalidChar(read())\n        }\n\n        read()\n    }\n}\n\nfunction escape () {\n    const c = peek()\n    switch (c) {\n    case 'b':\n        read()\n        return '\\b'\n\n    case 'f':\n        read()\n        return '\\f'\n\n    case 'n':\n        read()\n        return '\\n'\n\n    case 'r':\n        read()\n        return '\\r'\n\n    case 't':\n        read()\n        return '\\t'\n\n    case 'v':\n        read()\n        return '\\v'\n\n    case '0':\n        read()\n        if (util.isDigit(peek())) {\n            throw invalidChar(read())\n        }\n\n        return '\\0'\n\n    case 'x':\n        read()\n        return hexEscape()\n\n    case 'u':\n        read()\n        return unicodeEscape()\n\n    case '\\n':\n    case '\\u2028':\n    case '\\u2029':\n        read()\n        return ''\n\n    case '\\r':\n        read()\n        if (peek() === '\\n') {\n            read()\n        }\n\n        return ''\n\n    case '1':\n    case '2':\n    case '3':\n    case '4':\n    case '5':\n    case '6':\n    case '7':\n    case '8':\n    case '9':\n        throw invalidChar(read())\n\n    case undefined:\n        throw invalidChar(read())\n    }\n\n    return read()\n}\n\nfunction hexEscape () {\n    let buffer = ''\n    let c = peek()\n\n    if (!util.isHexDigit(c)) {\n        throw invalidChar(read())\n    }\n\n    buffer += read()\n\n    c = peek()\n    if (!util.isHexDigit(c)) {\n        throw invalidChar(read())\n    }\n\n    buffer += read()\n\n    return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nfunction unicodeEscape () {\n    let buffer = ''\n    let count = 4\n\n    while (count-- > 0) {\n        const c = peek()\n        if (!util.isHexDigit(c)) {\n            throw invalidChar(read())\n        }\n\n        buffer += read()\n    }\n\n    return String.fromCodePoint(parseInt(buffer, 16))\n}\n\nconst parseStates = {\n    start () {\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        push()\n    },\n\n    beforePropertyName () {\n        switch (token.type) {\n        case 'identifier':\n        case 'string':\n            key = token.value\n            parseState = 'afterPropertyName'\n            return\n\n        case 'punctuator':\n            // This code is unreachable since it's handled by the lexState.\n            // if (token.value !== '}') {\n            //     throw invalidToken()\n            // }\n\n            pop()\n            return\n\n        case 'eof':\n            throw invalidEOF()\n        }\n\n        // This code is unreachable since it's handled by the lexState.\n        // throw invalidToken()\n    },\n\n    afterPropertyName () {\n        // This code is unreachable since it's handled by the lexState.\n        // if (token.type !== 'punctuator' || token.value !== ':') {\n        //     throw invalidToken()\n        // }\n\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        parseState = 'beforePropertyValue'\n    },\n\n    beforePropertyValue () {\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        push()\n    },\n\n    beforeArrayValue () {\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        if (token.type === 'punctuator' && token.value === ']') {\n            pop()\n            return\n        }\n\n        push()\n    },\n\n    afterPropertyValue () {\n        // This code is unreachable since it's handled by the lexState.\n        // if (token.type !== 'punctuator') {\n        //     throw invalidToken()\n        // }\n\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        switch (token.value) {\n        case ',':\n            parseState = 'beforePropertyName'\n            return\n\n        case '}':\n            pop()\n        }\n\n        // This code is unreachable since it's handled by the lexState.\n        // throw invalidToken()\n    },\n\n    afterArrayValue () {\n        // This code is unreachable since it's handled by the lexState.\n        // if (token.type !== 'punctuator') {\n        //     throw invalidToken()\n        // }\n\n        if (token.type === 'eof') {\n            throw invalidEOF()\n        }\n\n        switch (token.value) {\n        case ',':\n            parseState = 'beforeArrayValue'\n            return\n\n        case ']':\n            pop()\n        }\n\n        // This code is unreachable since it's handled by the lexState.\n        // throw invalidToken()\n    },\n\n    end () {\n        // This code is unreachable since it's handled by the lexState.\n        // if (token.type !== 'eof') {\n        //     throw invalidToken()\n        // }\n    },\n}\n\nfunction push () {\n    let value\n\n    switch (token.type) {\n    case 'punctuator':\n        switch (token.value) {\n        case '{':\n            value = {}\n            break\n\n        case '[':\n            value = []\n            break\n        }\n\n        break\n\n    case 'null':\n    case 'boolean':\n    case 'numeric':\n    case 'string':\n        value = token.value\n        break\n\n    // This code is unreachable.\n    // default:\n    //     throw invalidToken()\n    }\n\n    if (root === undefined) {\n        root = value\n    } else {\n        const parent = stack[stack.length - 1]\n        if (Array.isArray(parent)) {\n            parent.push(value)\n        } else {\n            Object.defineProperty(parent, key, {\n                value,\n                writable: true,\n                enumerable: true,\n                configurable: true,\n            })\n        }\n    }\n\n    if (value !== null && typeof value === 'object') {\n        stack.push(value)\n\n        if (Array.isArray(value)) {\n            parseState = 'beforeArrayValue'\n        } else {\n            parseState = 'beforePropertyName'\n        }\n    } else {\n        const current = stack[stack.length - 1]\n        if (current == null) {\n            parseState = 'end'\n        } else if (Array.isArray(current)) {\n            parseState = 'afterArrayValue'\n        } else {\n            parseState = 'afterPropertyValue'\n        }\n    }\n}\n\nfunction pop () {\n    stack.pop()\n\n    const current = stack[stack.length - 1]\n    if (current == null) {\n        parseState = 'end'\n    } else if (Array.isArray(current)) {\n        parseState = 'afterArrayValue'\n    } else {\n        parseState = 'afterPropertyValue'\n    }\n}\n\n// This code is unreachable.\n// function invalidParseState () {\n//     return new Error(`JSON5: invalid parse state '${parseState}'`)\n// }\n\n// This code is unreachable.\n// function invalidLexState (state) {\n//     return new Error(`JSON5: invalid lex state '${state}'`)\n// }\n\nfunction invalidChar (c) {\n    if (c === undefined) {\n        return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n    }\n\n    return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n}\n\nfunction invalidEOF () {\n    return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n}\n\n// This code is unreachable.\n// function invalidToken () {\n//     if (token.type === 'eof') {\n//         return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n//     }\n\n//     const c = String.fromCodePoint(token.value.codePointAt(0))\n//     return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n// }\n\nfunction invalidIdentifier () {\n    column -= 5\n    return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)\n}\n\nfunction separatorChar (c) {\n    console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`)\n}\n\nfunction formatChar (c) {\n    const replacements = {\n        \"'\": \"\\\\'\",\n        '\"': '\\\\\"',\n        '\\\\': '\\\\\\\\',\n        '\\b': '\\\\b',\n        '\\f': '\\\\f',\n        '\\n': '\\\\n',\n        '\\r': '\\\\r',\n        '\\t': '\\\\t',\n        '\\v': '\\\\v',\n        '\\0': '\\\\0',\n        '\\u2028': '\\\\u2028',\n        '\\u2029': '\\\\u2029',\n    }\n\n    if (replacements[c]) {\n        return replacements[c]\n    }\n\n    if (c < ' ') {\n        const hexString = c.charCodeAt(0).toString(16)\n        return '\\\\x' + ('00' + hexString).substring(hexString.length)\n    }\n\n    return c\n}\n\nfunction syntaxError (message) {\n    const err = new SyntaxError(message)\n    err.lineNumber = line\n    err.columnNumber = column\n    return err\n}\n"
  },
  {
    "path": "lib/register.js",
    "content": "const fs = require('fs')\nconst JSON5 = require('./')\n\n// eslint-disable-next-line node/no-deprecated-api\nrequire.extensions['.json5'] = function (module, filename) {\n    const content = fs.readFileSync(filename, 'utf8')\n    try {\n        module.exports = JSON5.parse(content)\n    } catch (err) {\n        err.message = filename + ': ' + err.message\n        throw err\n    }\n}\n"
  },
  {
    "path": "lib/require.js",
    "content": "// This file is for backward compatibility with v0.5.1.\nrequire('./register')\n\nconsole.warn(\"'json5/require' is deprecated. Please use 'json5/register' instead.\")\n"
  },
  {
    "path": "lib/stringify.d.ts",
    "content": "declare type StringifyOptions = {\n    /**\n     * A function that alters the behavior of the stringification process, or an\n     * array of String and Number objects that serve as a allowlist for\n     * selecting/filtering the properties of the value object to be included in\n     * the JSON5 string. If this value is null or not provided, all properties\n     * of the object are included in the resulting JSON5 string.\n     */\n    replacer?:\n        | ((this: any, key: string, value: any) => any)\n        | (string | number)[]\n        | null\n\n    /**\n     * A String or Number object that's used to insert white space into the\n     * output JSON5 string for readability purposes. If this is a Number, it\n     * indicates the number of space characters to use as white space; this\n     * number is capped at 10 (if it is greater, the value is just 10). Values\n     * less than 1 indicate that no space should be used. If this is a String,\n     * the string (or the first 10 characters of the string, if it's longer than\n     * that) is used as white space. If this parameter is not provided (or is\n     * null), no white space is used. If white space is used, trailing commas\n     * will be used in objects and arrays.\n     */\n    space?: string | number | null\n\n    /**\n     * A String representing the quote character to use when serializing\n     * strings.\n     */\n    quote?: string | null\n}\n\n/**\n * Converts a JavaScript value to a JSON5 string.\n * @param value The value to convert to a JSON5 string.\n * @param replacer A function that alters the behavior of the stringification\n * process. If this value is null or not provided, all properties of the object\n * are included in the resulting JSON5 string.\n * @param space A String or Number object that's used to insert white space into\n * the output JSON5 string for readability purposes. If this is a Number, it\n * indicates the number of space characters to use as white space; this number\n * is capped at 10 (if it is greater, the value is just 10). Values less than 1\n * indicate that no space should be used. If this is a String, the string (or\n * the first 10 characters of the string, if it's longer than that) is used as\n * white space. If this parameter is not provided (or is null), no white space\n * is used. If white space is used, trailing commas will be used in objects and\n * arrays.\n * @returns The JSON5 string converted from the JavaScript value.\n */\ndeclare function stringify(\n    value: any,\n    replacer?: ((this: any, key: string, value: any) => any) | null,\n    space?: string | number | null,\n): string\n\n/**\n * Converts a JavaScript value to a JSON5 string.\n * @param value The value to convert to a JSON5 string.\n * @param replacer An array of String and Number objects that serve as a\n * allowlist for selecting/filtering the properties of the value object to be\n * included in the JSON5 string. If this value is null or not provided, all\n * properties of the object are included in the resulting JSON5 string.\n * @param space A String or Number object that's used to insert white space into\n * the output JSON5 string for readability purposes. If this is a Number, it\n * indicates the number of space characters to use as white space; this number\n * is capped at 10 (if it is greater, the value is just 10). Values less than 1\n * indicate that no space should be used. If this is a String, the string (or\n * the first 10 characters of the string, if it's longer than that) is used as\n * white space. If this parameter is not provided (or is null), no white space\n * is used. If white space is used, trailing commas will be used in objects and\n * arrays.\n * @returns The JSON5 string converted from the JavaScript value.\n */\ndeclare function stringify(\n    value: any,\n    replacer: (string | number)[],\n    space?: string | number | null,\n): string\n\n/**\n * Converts a JavaScript value to a JSON5 string.\n * @param value The value to convert to a JSON5 string.\n * @param options An object specifying options.\n * @returns The JSON5 string converted from the JavaScript value.\n */\ndeclare function stringify(value: any, options: StringifyOptions): string\n\nexport = stringify\n"
  },
  {
    "path": "lib/stringify.js",
    "content": "const util = require('./util')\n\nmodule.exports = function stringify (value, replacer, space) {\n    const stack = []\n    let indent = ''\n    let propertyList\n    let replacerFunc\n    let gap = ''\n    let quote\n\n    if (\n        replacer != null &&\n        typeof replacer === 'object' &&\n        !Array.isArray(replacer)\n    ) {\n        space = replacer.space\n        quote = replacer.quote\n        replacer = replacer.replacer\n    }\n\n    if (typeof replacer === 'function') {\n        replacerFunc = replacer\n    } else if (Array.isArray(replacer)) {\n        propertyList = []\n        for (const v of replacer) {\n            let item\n\n            if (typeof v === 'string') {\n                item = v\n            } else if (\n                typeof v === 'number' ||\n                v instanceof String ||\n                v instanceof Number\n            ) {\n                item = String(v)\n            }\n\n            if (item !== undefined && propertyList.indexOf(item) < 0) {\n                propertyList.push(item)\n            }\n        }\n    }\n\n    if (space instanceof Number) {\n        space = Number(space)\n    } else if (space instanceof String) {\n        space = String(space)\n    }\n\n    if (typeof space === 'number') {\n        if (space > 0) {\n            space = Math.min(10, Math.floor(space))\n            gap = '          '.substr(0, space)\n        }\n    } else if (typeof space === 'string') {\n        gap = space.substr(0, 10)\n    }\n\n    return serializeProperty('', {'': value})\n\n    function serializeProperty (key, holder) {\n        let value = holder[key]\n        if (value != null) {\n            if (typeof value.toJSON5 === 'function') {\n                value = value.toJSON5(key)\n            } else if (typeof value.toJSON === 'function') {\n                value = value.toJSON(key)\n            }\n        }\n\n        if (replacerFunc) {\n            value = replacerFunc.call(holder, key, value)\n        }\n\n        if (value instanceof Number) {\n            value = Number(value)\n        } else if (value instanceof String) {\n            value = String(value)\n        } else if (value instanceof Boolean) {\n            value = value.valueOf()\n        }\n\n        switch (value) {\n        case null: return 'null'\n        case true: return 'true'\n        case false: return 'false'\n        }\n\n        if (typeof value === 'string') {\n            return quoteString(value, false)\n        }\n\n        if (typeof value === 'number') {\n            return String(value)\n        }\n\n        if (typeof value === 'object') {\n            return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n        }\n\n        return undefined\n    }\n\n    function quoteString (value) {\n        const quotes = {\n            \"'\": 0.1,\n            '\"': 0.2,\n        }\n\n        const replacements = {\n            \"'\": \"\\\\'\",\n            '\"': '\\\\\"',\n            '\\\\': '\\\\\\\\',\n            '\\b': '\\\\b',\n            '\\f': '\\\\f',\n            '\\n': '\\\\n',\n            '\\r': '\\\\r',\n            '\\t': '\\\\t',\n            '\\v': '\\\\v',\n            '\\0': '\\\\0',\n            '\\u2028': '\\\\u2028',\n            '\\u2029': '\\\\u2029',\n        }\n\n        let product = ''\n\n        for (let i = 0; i < value.length; i++) {\n            const c = value[i]\n            switch (c) {\n            case \"'\":\n            case '\"':\n                quotes[c]++\n                product += c\n                continue\n\n            case '\\0':\n                if (util.isDigit(value[i + 1])) {\n                    product += '\\\\x00'\n                    continue\n                }\n            }\n\n            if (replacements[c]) {\n                product += replacements[c]\n                continue\n            }\n\n            if (c < ' ') {\n                let hexString = c.charCodeAt(0).toString(16)\n                product += '\\\\x' + ('00' + hexString).substring(hexString.length)\n                continue\n            }\n\n            product += c\n        }\n\n        const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b)\n\n        product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar])\n\n        return quoteChar + product + quoteChar\n    }\n\n    function serializeObject (value) {\n        if (stack.indexOf(value) >= 0) {\n            throw TypeError('Converting circular structure to JSON5')\n        }\n\n        stack.push(value)\n\n        let stepback = indent\n        indent = indent + gap\n\n        let keys = propertyList || Object.keys(value)\n        let partial = []\n        for (const key of keys) {\n            const propertyString = serializeProperty(key, value)\n            if (propertyString !== undefined) {\n                let member = serializeKey(key) + ':'\n                if (gap !== '') {\n                    member += ' '\n                }\n                member += propertyString\n                partial.push(member)\n            }\n        }\n\n        let final\n        if (partial.length === 0) {\n            final = '{}'\n        } else {\n            let properties\n            if (gap === '') {\n                properties = partial.join(',')\n                final = '{' + properties + '}'\n            } else {\n                let separator = ',\\n' + indent\n                properties = partial.join(separator)\n                final = '{\\n' + indent + properties + ',\\n' + stepback + '}'\n            }\n        }\n\n        stack.pop()\n        indent = stepback\n        return final\n    }\n\n    function serializeKey (key) {\n        if (key.length === 0) {\n            return quoteString(key, true)\n        }\n\n        const firstChar = String.fromCodePoint(key.codePointAt(0))\n        if (!util.isIdStartChar(firstChar)) {\n            return quoteString(key, true)\n        }\n\n        for (let i = firstChar.length; i < key.length; i++) {\n            if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n                return quoteString(key, true)\n            }\n        }\n\n        return key\n    }\n\n    function serializeArray (value) {\n        if (stack.indexOf(value) >= 0) {\n            throw TypeError('Converting circular structure to JSON5')\n        }\n\n        stack.push(value)\n\n        let stepback = indent\n        indent = indent + gap\n\n        let partial = []\n        for (let i = 0; i < value.length; i++) {\n            const propertyString = serializeProperty(String(i), value)\n            partial.push((propertyString !== undefined) ? propertyString : 'null')\n        }\n\n        let final\n        if (partial.length === 0) {\n            final = '[]'\n        } else {\n            if (gap === '') {\n                let properties = partial.join(',')\n                final = '[' + properties + ']'\n            } else {\n                let separator = ',\\n' + indent\n                let properties = partial.join(separator)\n                final = '[\\n' + indent + properties + ',\\n' + stepback + ']'\n            }\n        }\n\n        stack.pop()\n        indent = stepback\n        return final\n    }\n}\n"
  },
  {
    "path": "lib/unicode.d.ts",
    "content": "export declare const Space_Separator: RegExp\nexport declare const ID_Start: RegExp\nexport declare const ID_Continue: RegExp\n"
  },
  {
    "path": "lib/unicode.js",
    "content": "// This is a generated file. Do not edit.\nmodule.exports.Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/\nmodule.exports.ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\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-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/\nmodule.exports.ID_Continue = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u09FC\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9-\\u0AFF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D00-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\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\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\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-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDE00-\\uDE3E\\uDE47\\uDE50-\\uDE83\\uDE86-\\uDE99\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/\n"
  },
  {
    "path": "lib/util.d.ts",
    "content": "export declare function isSpaceSeparator(c?: string): boolean\nexport declare function isIdStartChar(c?: string): boolean\nexport declare function isIdContinueChar(c?: string): boolean\nexport declare function isDigit(c?: string): boolean\nexport declare function isHexDigit(c?: string): boolean\n"
  },
  {
    "path": "lib/util.js",
    "content": "const unicode = require('../lib/unicode')\n\nmodule.exports = {\n    isSpaceSeparator (c) {\n        return typeof c === 'string' && unicode.Space_Separator.test(c)\n    },\n\n    isIdStartChar (c) {\n        return typeof c === 'string' && (\n            (c >= 'a' && c <= 'z') ||\n        (c >= 'A' && c <= 'Z') ||\n        (c === '$') || (c === '_') ||\n        unicode.ID_Start.test(c)\n        )\n    },\n\n    isIdContinueChar (c) {\n        return typeof c === 'string' && (\n            (c >= 'a' && c <= 'z') ||\n        (c >= 'A' && c <= 'Z') ||\n        (c >= '0' && c <= '9') ||\n        (c === '$') || (c === '_') ||\n        (c === '\\u200C') || (c === '\\u200D') ||\n        unicode.ID_Continue.test(c)\n        )\n    },\n\n    isDigit (c) {\n        return typeof c === 'string' && /[0-9]/.test(c)\n    },\n\n    isHexDigit (c) {\n        return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n    },\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"json5\",\n  \"version\": \"2.2.3\",\n  \"description\": \"JSON for Humans\",\n  \"main\": \"lib/index.js\",\n  \"module\": \"dist/index.mjs\",\n  \"bin\": \"lib/cli.js\",\n  \"browser\": \"dist/index.js\",\n  \"types\": \"lib/index.d.ts\",\n  \"files\": [\n    \"lib/\",\n    \"dist/\"\n  ],\n  \"engines\": {\n    \"node\": \">=6\"\n  },\n  \"scripts\": {\n    \"build\": \"rollup -c\",\n    \"build-package\": \"node build/package.js\",\n    \"build-unicode\": \"node build/unicode.js\",\n    \"coverage\": \"tap --coverage-report html test\",\n    \"lint\": \"eslint --fix .\",\n    \"lint-report\": \"eslint .\",\n    \"prepublishOnly\": \"npm run production\",\n    \"preversion\": \"npm run production\",\n    \"production\": \"run-s test build\",\n    \"tap\": \"tap -Rspec --100 test\",\n    \"test\": \"run-s lint-report tap\",\n    \"version\": \"npm run build-package && git add package.json5\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/json5/json5.git\"\n  },\n  \"keywords\": [\n    \"json\",\n    \"json5\",\n    \"es5\",\n    \"es2015\",\n    \"ecmascript\"\n  ],\n  \"author\": \"Aseem Kishore <aseem.kishore@gmail.com>\",\n  \"contributors\": [\n    \"Max Nanasy <max.nanasy@gmail.com>\",\n    \"Andrew Eisenberg <andrew@eisenberg.as>\",\n    \"Jordan Tucker <jordanbtucker@gmail.com>\"\n  ],\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/json5/json5/issues\"\n  },\n  \"homepage\": \"http://json5.org/\",\n  \"devDependencies\": {\n    \"core-js\": \"^2.6.5\",\n    \"eslint\": \"^5.15.3\",\n    \"eslint-config-standard\": \"^12.0.0\",\n    \"eslint-plugin-import\": \"^2.16.0\",\n    \"eslint-plugin-node\": \"^8.0.1\",\n    \"eslint-plugin-promise\": \"^4.0.1\",\n    \"eslint-plugin-standard\": \"^4.0.0\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"regenerate\": \"^1.4.0\",\n    \"rollup\": \"^0.64.1\",\n    \"rollup-plugin-buble\": \"^0.19.6\",\n    \"rollup-plugin-commonjs\": \"^9.2.1\",\n    \"rollup-plugin-node-resolve\": \"^3.4.0\",\n    \"rollup-plugin-terser\": \"^1.0.1\",\n    \"sinon\": \"^6.3.5\",\n    \"tap\": \"^12.6.0\",\n    \"unicode-10.0.0\": \"^0.7.5\"\n  }\n}\n"
  },
  {
    "path": "package.json5",
    "content": "// This is a generated file. Do not edit.\n{\n  name: 'json5',\n  version: '2.2.3',\n  description: 'JSON for Humans',\n  main: 'lib/index.js',\n  module: 'dist/index.mjs',\n  bin: 'lib/cli.js',\n  browser: 'dist/index.js',\n  types: 'lib/index.d.ts',\n  files: [\n    'lib/',\n    'dist/',\n  ],\n  engines: {\n    node: '>=6',\n  },\n  scripts: {\n    build: 'rollup -c',\n    'build-package': 'node build/package.js',\n    'build-unicode': 'node build/unicode.js',\n    coverage: 'tap --coverage-report html test',\n    lint: 'eslint --fix .',\n    'lint-report': 'eslint .',\n    prepublishOnly: 'npm run production',\n    preversion: 'npm run production',\n    production: 'run-s test build',\n    tap: 'tap -Rspec --100 test',\n    test: 'run-s lint-report tap',\n    version: 'npm run build-package && git add package.json5',\n  },\n  repository: {\n    type: 'git',\n    url: 'git+https://github.com/json5/json5.git',\n  },\n  keywords: [\n    'json',\n    'json5',\n    'es5',\n    'es2015',\n    'ecmascript',\n  ],\n  author: 'Aseem Kishore <aseem.kishore@gmail.com>',\n  contributors: [\n    'Max Nanasy <max.nanasy@gmail.com>',\n    'Andrew Eisenberg <andrew@eisenberg.as>',\n    'Jordan Tucker <jordanbtucker@gmail.com>',\n  ],\n  license: 'MIT',\n  bugs: {\n    url: 'https://github.com/json5/json5/issues',\n  },\n  homepage: 'http://json5.org/',\n  devDependencies: {\n    'core-js': '^2.6.5',\n    eslint: '^5.15.3',\n    'eslint-config-standard': '^12.0.0',\n    'eslint-plugin-import': '^2.16.0',\n    'eslint-plugin-node': '^8.0.1',\n    'eslint-plugin-promise': '^4.0.1',\n    'eslint-plugin-standard': '^4.0.0',\n    'npm-run-all': '^4.1.5',\n    regenerate: '^1.4.0',\n    rollup: '^0.64.1',\n    'rollup-plugin-buble': '^0.19.6',\n    'rollup-plugin-commonjs': '^9.2.1',\n    'rollup-plugin-node-resolve': '^3.4.0',\n    'rollup-plugin-terser': '^1.0.1',\n    sinon: '^6.3.5',\n    tap: '^12.6.0',\n    'unicode-10.0.0': '^0.7.5',\n  },\n}"
  },
  {
    "path": "rollup.config.js",
    "content": "const resolve = require('rollup-plugin-node-resolve')\nconst commonjs = require('rollup-plugin-commonjs')\nconst buble = require('rollup-plugin-buble')\nconst terser = require('rollup-plugin-terser').terser\nconst pkg = require('./package.json')\n\nmodule.exports = [\n    // ES5 Non-minified\n    {\n        input: 'build/es5.js',\n        output: {\n            file: pkg.browser,\n            format: 'umd',\n            name: 'JSON5',\n        },\n        plugins: [\n            resolve(),\n            commonjs(),\n            buble({transforms: {dangerousForOf: true}}),\n        ],\n    },\n    // ES5 Minified\n    {\n        input: 'build/es5.js',\n        output: {\n            file: pkg.browser.replace(/\\.js$/, '.min.js'),\n            format: 'umd',\n            name: 'JSON5',\n        },\n        plugins: [\n            resolve(),\n            commonjs(),\n            buble({transforms: {dangerousForOf: true}}),\n            terser(),\n        ],\n    },\n    // ES6 Modules Non-minified\n    {\n        input: 'lib/index.js',\n        output: {\n            file: pkg.browser.replace(/\\.js$/, '.mjs'),\n            format: 'esm',\n        },\n        plugins: [\n            resolve(),\n            commonjs(),\n        ],\n    },\n    // ES6 Modules Minified\n    {\n        input: 'lib/index.js',\n        output: {\n            file: pkg.browser.replace(/\\.js$/, '.min.mjs'),\n            format: 'esm',\n        },\n        plugins: [\n            resolve(),\n            commonjs(),\n            terser(),\n        ],\n    },\n]\n"
  },
  {
    "path": "test/cli.js",
    "content": "const assert = require('assert')\nconst child = require('child_process')\nconst fs = require('fs')\nconst path = require('path')\nconst pkg = require('../package.json')\n\nconst cliPath = path.resolve(__dirname, '../lib/cli.js')\n\nconst t = require('tap')\n\nt.test('CLI', t => {\n    t.test('converts JSON5 to JSON from stdin to stdout', t => {\n        const proc = child.spawn(process.execPath, [cliPath])\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, '{\"a\":1,\"b\":2}')\n            t.end()\n        })\n\n        fs.createReadStream(path.resolve(__dirname, 'test.json5')).pipe(proc.stdin)\n    })\n\n    t.test('reads from the specified file', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n            ]\n        )\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, '{\"a\":1,\"b\":2}')\n            t.end()\n        })\n    })\n\n    t.test('indents output with the number of spaces specified with -s', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '-s',\n                '4',\n            ]\n        )\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, '{\\n    \"a\": 1,\\n    \"b\": 2\\n}')\n            t.end()\n        })\n    })\n\n    t.test('indents output with the number of spaces specified with --space', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '--space',\n                '4',\n            ]\n        )\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, '{\\n    \"a\": 1,\\n    \"b\": 2\\n}')\n            t.end()\n        })\n    })\n\n    t.test('indents output with tabs when specified with -s', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '-s',\n                't',\n            ]\n        )\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, '{\\n\\t\"a\": 1,\\n\\t\"b\": 2\\n}')\n            t.end()\n        })\n    })\n\n    t.test('outputs to the specified file with -o', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '-o',\n                path.resolve(__dirname, 'output.json'),\n            ]\n        )\n\n        proc.on('exit', () => {\n            assert.strictEqual(\n                fs.readFileSync(\n                    path.resolve(__dirname, 'output.json'),\n                    'utf8'\n                ),\n                '{\"a\":1,\"b\":2}'\n            )\n            t.end()\n        })\n\n        t.tearDown(() => {\n            try {\n                fs.unlinkSync(path.resolve(__dirname, 'output.json'))\n            } catch (err) {}\n        })\n    })\n\n    t.test('outputs to the specified file with --out-file', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '--out-file',\n                path.resolve(__dirname, 'output.json'),\n            ]\n        )\n\n        proc.on('exit', () => {\n            assert.strictEqual(\n                fs.readFileSync(\n                    path.resolve(__dirname, 'output.json'),\n                    'utf8'\n                ),\n                '{\"a\":1,\"b\":2}'\n            )\n            t.end()\n        })\n\n        t.tearDown(() => {\n            try {\n                fs.unlinkSync(path.resolve(__dirname, 'output.json'))\n            } catch (err) {}\n        })\n    })\n\n    t.test('validates valid JSON5 files with -v', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '-v',\n            ]\n        )\n\n        proc.on('exit', code => {\n            assert.strictEqual(code, 0)\n            t.end()\n        })\n    })\n\n    t.test('validates valid JSON5 files with --validate', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'test.json5'),\n                '--validate',\n            ]\n        )\n\n        proc.on('exit', code => {\n            assert.strictEqual(code, 0)\n            t.end()\n        })\n    })\n\n    t.test('validates invalid JSON5 files with -v', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                path.resolve(__dirname, 'invalid.json5'),\n                '-v',\n            ]\n        )\n\n        let error = ''\n        proc.stderr.on('data', data => {\n            error += data\n        })\n\n        proc.stderr.on('end', () => {\n            assert.strictEqual(error, \"JSON5: invalid character 'a' at 1:1\\n\")\n        })\n\n        proc.on('exit', code => {\n            assert.strictEqual(code, 1)\n            t.end()\n        })\n    })\n\n    t.test('outputs the version number when specified with -V', t => {\n        const proc = child.spawn(process.execPath, [cliPath, '-V'])\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, pkg.version + '\\n')\n            t.end()\n        })\n    })\n\n    t.test('outputs the version number when specified with --version', t => {\n        const proc = child.spawn(process.execPath, [cliPath, '--version'])\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert.strictEqual(output, pkg.version + '\\n')\n            t.end()\n        })\n    })\n\n    t.test('outputs usage information when specified with -h', t => {\n        const proc = child.spawn(process.execPath, [cliPath, '-h'])\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert(/Usage/.test(output))\n            t.end()\n        })\n    })\n\n    t.test('outputs usage information when specified with --help', t => {\n        const proc = child.spawn(process.execPath, [cliPath, '--help'])\n\n        let output = ''\n        proc.stdout.on('data', data => {\n            output += data\n        })\n\n        proc.stdout.on('end', () => {\n            assert(/Usage/.test(output))\n            t.end()\n        })\n    })\n\n    t.test('is backward compatible with v0.5.1 with -c', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                '-c',\n                path.resolve(__dirname, 'test.json5'),\n            ]\n        )\n\n        proc.on('exit', () => {\n            assert.strictEqual(\n                fs.readFileSync(\n                    path.resolve(__dirname, 'test.json'),\n                    'utf8'\n                ),\n                '{\"a\":1,\"b\":2}'\n            )\n            t.end()\n        })\n\n        t.tearDown(() => {\n            try {\n                fs.unlinkSync(path.resolve(__dirname, 'test.json'))\n            } catch (err) {}\n        })\n    })\n\n    t.test('is backward compatible with v0.5.1 with --convert', t => {\n        const proc = child.spawn(\n            process.execPath,\n            [\n                cliPath,\n                '--convert',\n                path.resolve(__dirname, 'test.json5'),\n            ]\n        )\n\n        proc.on('exit', () => {\n            assert.strictEqual(\n                fs.readFileSync(\n                    path.resolve(__dirname, 'test.json'),\n                    'utf8'\n                ),\n                '{\"a\":1,\"b\":2}'\n            )\n            t.end()\n        })\n\n        t.tearDown(() => {\n            try {\n                fs.unlinkSync(path.resolve(__dirname, 'test.json'))\n            } catch (err) {}\n        })\n    })\n\n    t.end()\n})\n"
  },
  {
    "path": "test/errors.js",
    "content": "const JSON5 = require('../lib')\n\nconst t = require('tap')\n\nt.test('JSON5', t => {\n    t.test('#parse()', t => {\n        t.test('errors', t => {\n            t.throws(\n                () => { JSON5.parse('') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 1,\n                },\n                'throws on empty documents'\n            )\n\n            t.throws(\n                () => { JSON5.parse('//a') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on documents with only comments'\n            )\n\n            t.throws(\n                () => { JSON5.parse('/a') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on incomplete single line comments'\n            )\n\n            t.throws(\n                () => { JSON5.parse('/*') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on unterminated multiline comments'\n            )\n\n            t.throws(\n                () => { JSON5.parse('/**') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on unterminated multiline comment closings'\n            )\n\n            t.throws(\n                () => { JSON5.parse('a') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 1,\n                },\n                'throws on invalid characters in values'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{\\\\a:1}') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid characters in identifier start escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{\\\\u0021:1}') },\n                {\n                    message: /^JSON5: invalid identifier character/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on invalid identifier start characters'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a\\\\a:1}') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on invalid characters in identifier continue escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a\\\\u0021:1}') },\n                {\n                    message: /^JSON5: invalid identifier character/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid identifier continue characters'\n            )\n\n            t.throws(\n                () => { JSON5.parse('-a') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on invalid characters following a sign'\n            )\n\n            t.throws(\n                () => { JSON5.parse('.a') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on invalid characters following a leading decimal point'\n            )\n\n            t.throws(\n                () => { JSON5.parse('1ea') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid characters following an exponent indicator'\n            )\n\n            t.throws(\n                () => { JSON5.parse('1e-a') },\n                {\n                    message: /^JSON5: invalid character 'a'/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on invalid characters following an exponent sign'\n            )\n\n            t.throws(\n                () => { JSON5.parse('0xg') },\n                {\n                    message: /^JSON5: invalid character 'g'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid characters following a hexadecimal indicator'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"\\n\"') },\n                {\n                    message: /^JSON5: invalid character '\\\\n'/,\n                    lineNumber: 2,\n                    columnNumber: 0,\n                },\n                'throws on invalid new lines in strings'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on unterminated strings'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{!:1}') },\n                {\n                    message: /^JSON5: invalid character '!'/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on invalid identifier start characters in property names'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a!1}') },\n                {\n                    message: /^JSON5: invalid character '!'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid characters following a property name'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a:1!}') },\n                {\n                    message: /^JSON5: invalid character '!'/,\n                    lineNumber: 1,\n                    columnNumber: 5,\n                },\n                'throws on invalid characters following a property value'\n            )\n\n            t.throws(\n                () => { JSON5.parse('[1!]') },\n                {\n                    message: /^JSON5: invalid character '!'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on invalid characters following an array value'\n            )\n\n            t.throws(\n                () => { JSON5.parse('tru!') },\n                {\n                    message: /^JSON5: invalid character '!'/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on invalid characters in literals'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"\\\\') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on unterminated escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"\\\\xg\"') },\n                {\n                    message: /^JSON5: invalid character 'g'/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on invalid first digits in hexadecimal escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"\\\\x0g\"') },\n                {\n                    message: /^JSON5: invalid character 'g'/,\n                    lineNumber: 1,\n                    columnNumber: 5,\n                },\n                'throws on invalid second digits in hexadecimal escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\"\\\\u000g\"') },\n                {\n                    message: /^JSON5: invalid character 'g'/,\n                    lineNumber: 1,\n                    columnNumber: 7,\n                },\n                'throws on invalid unicode escapes'\n            )\n\n            for (let i = 1; i <= 9; i++) {\n                t.throws(\n                    () => { JSON5.parse(`'\\\\${i}'`) },\n                    {\n                        message: /^JSON5: invalid character '\\d'/,\n                        lineNumber: 1,\n                        columnNumber: 3,\n                    },\n                    `throws on escaped digit ${i}`\n                )\n            }\n\n            t.throws(\n                () => { JSON5.parse(\"'\\\\01'\") },\n                {\n                    message: /^JSON5: invalid character '1'/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on octal escapes'\n            )\n\n            t.throws(\n                () => { JSON5.parse('1 2') },\n                {\n                    message: /^JSON5: invalid character '2'/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on multiple values'\n            )\n\n            t.throws(\n                () => { JSON5.parse('\\x01') },\n                {\n                    message: /^JSON5: invalid character '\\\\x01'/,\n                    lineNumber: 1,\n                    columnNumber: 1,\n                },\n                'throws with control characters escaped in the message'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on unclosed objects before property names'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on unclosed objects after property names'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a:') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 4,\n                },\n                'throws on unclosed objects before property values'\n            )\n\n            t.throws(\n                () => { JSON5.parse('{a:1') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 5,\n                },\n                'throws on unclosed objects after property values'\n            )\n\n            t.throws(\n                () => { JSON5.parse('[') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 2,\n                },\n                'throws on unclosed arrays before values'\n            )\n\n            t.throws(\n                () => { JSON5.parse('[1') },\n                {\n                    message: /^JSON5: invalid end of input/,\n                    lineNumber: 1,\n                    columnNumber: 3,\n                },\n                'throws on unclosed arrays after values'\n            )\n\n            t.end()\n        })\n\n        t.end()\n    })\n\n    t.end()\n})\n"
  },
  {
    "path": "test/invalid.json5",
    "content": "a\n"
  },
  {
    "path": "test/parse.js",
    "content": "const assert = require('assert')\nconst sinon = require('sinon')\nconst JSON5 = require('../lib')\n\nconst t = require('tap')\n\nt.test('parse(text)', t => {\n    t.test('objects', t => {\n        t.strictSame(\n            JSON5.parse('{}'),\n            {},\n            'parses empty objects'\n        )\n\n        t.strictSame(\n            JSON5.parse('{\"a\":1}'),\n            {a: 1},\n            'parses double string property names'\n        )\n\n        t.strictSame(\n            JSON5.parse(\"{'a':1}\"),\n            {a: 1},\n            'parses single string property names'\n        )\n\n        t.strictSame(\n            JSON5.parse('{a:1}'),\n            {a: 1},\n            'parses unquoted property names'\n        )\n\n        t.strictSame(\n            JSON5.parse('{$_:1,_$:2,a\\u200C:3}'),\n            {$_: 1, _$: 2, 'a\\u200C': 3},\n            'parses special character property names'\n        )\n\n        t.strictSame(\n            JSON5.parse('{ùńîċõďë:9}'),\n            {'ùńîċõďë': 9},\n            'parses unicode property names'\n        )\n\n        t.strictSame(\n            JSON5.parse('{\\\\u0061\\\\u0062:1,\\\\u0024\\\\u005F:2,\\\\u005F\\\\u0024:3}'),\n            {ab: 1, $_: 2, _$: 3},\n            'parses escaped property names'\n        )\n\n        t.strictSame(\n            // eslint-disable-next-line no-proto\n            JSON5.parse('{\"__proto__\":1}').__proto__,\n            1,\n            'preserves __proto__ property names'\n        )\n\n        t.strictSame(\n            JSON5.parse('{abc:1,def:2}'),\n            {abc: 1, def: 2},\n            'parses multiple properties'\n        )\n\n        t.strictSame(\n            JSON5.parse('{a:{b:2}}'),\n            {a: {b: 2}},\n            'parses nested objects'\n        )\n\n        t.end()\n    })\n\n    t.test('arrays', t => {\n        t.strictSame(\n            JSON5.parse('[]'),\n            [],\n            'parses empty arrays'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1]'),\n            [1],\n            'parses array values'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1,2]'),\n            [1, 2],\n            'parses multiple array values'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1,[2,3]]'),\n            [1, [2, 3]],\n            'parses nested arrays'\n        )\n\n        t.end()\n    })\n\n    t.test('nulls', t => {\n        t.equal(\n            JSON5.parse('null'),\n            null,\n            'parses nulls'\n        )\n\n        t.end()\n    })\n\n    t.test('Booleans', t => {\n        t.equal(\n            JSON5.parse('true'),\n            true,\n            'parses true'\n        )\n\n        t.equal(\n            JSON5.parse('false'),\n            false,\n            'parses false'\n        )\n\n        t.end()\n    })\n\n    t.test('numbers', t => {\n        t.strictSame(\n            JSON5.parse('[0,0.,0e0]'),\n            [0, 0, 0],\n            'parses leading zeroes'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1,23,456,7890]'),\n            [1, 23, 456, 7890],\n            'parses integers'\n        )\n\n        t.strictSame(\n            JSON5.parse('[-1,+2,-.1,-0]'),\n            [-1, +2, -0.1, -0],\n            'parses signed numbers'\n        )\n\n        t.strictSame(\n            JSON5.parse('[.1,.23]'),\n            [0.1, 0.23],\n            'parses leading decimal points'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1.0,1.23]'),\n            [1, 1.23],\n            'parses fractional numbers'\n        )\n\n        t.strictSame(\n            JSON5.parse('[1e0,1e1,1e01,1.e0,1.1e0,1e-1,1e+1]'),\n            [1, 10, 10, 1, 1.1, 0.1, 10],\n            'parses exponents'\n        )\n\n        t.strictSame(\n            JSON5.parse('[0x1,0x10,0xff,0xFF]'),\n            [1, 16, 255, 255],\n            'parses hexadecimal numbers'\n        )\n\n        t.strictSame(\n            JSON5.parse('[Infinity,-Infinity]'),\n            [Infinity, -Infinity],\n            'parses signed and unsigned Infinity'\n        )\n\n        t.ok(\n            isNaN(JSON5.parse('NaN')),\n            'parses NaN'\n        )\n\n        t.ok(\n            isNaN(JSON5.parse('-NaN')),\n            'parses signed NaN'\n        )\n\n        t.strictSame(\n            JSON5.parse('1'),\n            1,\n            'parses 1'\n        )\n\n        t.strictSame(\n            JSON5.parse('+1.23e100'),\n            1.23e100,\n            'parses +1.23e100'\n        )\n\n        t.strictSame(\n            JSON5.parse('0x1'),\n            0x1,\n            'parses bare hexadecimal number'\n        )\n\n        t.strictSame(\n            JSON5.parse('-0x0123456789abcdefABCDEF'),\n            -0x0123456789abcdefABCDEF,\n            'parses bare long hexadecimal number'\n        )\n\n        t.end()\n    })\n\n    t.test('strings', t => {\n        t.equal(\n            JSON5.parse('\"abc\"'),\n            'abc',\n            'parses double quoted strings'\n        )\n\n        t.equal(\n            JSON5.parse(\"'abc'\"),\n            'abc',\n            'parses single quoted strings'\n        )\n\n        t.strictSame(\n            JSON5.parse(`['\"',\"'\"]`),\n            ['\"', \"'\"],\n            'parses quotes in strings')\n\n        t.equal(\n            JSON5.parse(`'\\\\b\\\\f\\\\n\\\\r\\\\t\\\\v\\\\0\\\\x0f\\\\u01fF\\\\\\n\\\\\\r\\n\\\\\\r\\\\\\u2028\\\\\\u2029\\\\a\\\\'\\\\\"'`),\n            `\\b\\f\\n\\r\\t\\v\\0\\x0f\\u01FF\\a'\"`, // eslint-disable-line no-useless-escape\n            'parses escaped characters'\n        )\n\n        t.test('parses line and paragraph separators with a warning', t => {\n            const mock = sinon.mock(console)\n            mock\n                .expects('warn')\n                .twice()\n                .calledWithMatch('not valid ECMAScript')\n\n            assert.deepStrictEqual(\n                JSON5.parse(\"'\\u2028\\u2029'\"),\n                '\\u2028\\u2029'\n            )\n\n            mock.verify()\n            mock.restore()\n\n            t.end()\n        })\n\n        t.end()\n    })\n\n    t.test('comments', t => {\n        t.strictSame(\n            JSON5.parse('{//comment\\n}'),\n            {},\n            'parses single-line comments'\n        )\n\n        t.strictSame(\n            JSON5.parse('{}//comment'),\n            {},\n            'parses single-line comments at end of input'\n        )\n\n        t.strictSame(\n            JSON5.parse('{/*comment\\n** */}'),\n            {},\n            'parses multi-line comments'\n        )\n\n        t.end()\n    })\n\n    t.test('whitespace', t => {\n        t.strictSame(\n            JSON5.parse('{\\t\\v\\f \\u00A0\\uFEFF\\n\\r\\u2028\\u2029\\u2003}'),\n            {},\n            'parses whitespace'\n        )\n\n        t.end()\n    })\n\n    t.end()\n})\n\nt.test('parse(text, reviver)', t => {\n    t.strictSame(\n        JSON5.parse('{a:1,b:2}', (k, v) => (k === 'a') ? 'revived' : v),\n        {a: 'revived', b: 2},\n        'modifies property values'\n    )\n\n    t.strictSame(\n        JSON5.parse('{a:{b:2}}', (k, v) => (k === 'b') ? 'revived' : v),\n        {a: {b: 'revived'}},\n        'modifies nested object property values'\n    )\n\n    t.strictSame(\n        JSON5.parse('{a:1,b:2}', (k, v) => (k === 'a') ? undefined : v),\n        {b: 2},\n        'deletes property values'\n    )\n\n    t.strictSame(\n        JSON5.parse('[0,1,2]', (k, v) => (k === '1') ? 'revived' : v),\n        [0, 'revived', 2],\n        'modifies array values'\n    )\n\n    t.strictSame(\n        JSON5.parse('[0,[1,2,3]]', (k, v) => (k === '2') ? 'revived' : v),\n        [0, [1, 2, 'revived']],\n        'modifies nested array values'\n    )\n\n    t.strictSame(\n        JSON5.parse('[0,1,2]', (k, v) => (k === '1') ? undefined : v),\n        [0, , 2], // eslint-disable-line no-sparse-arrays\n        'deletes array values'\n    )\n\n    t.equal(\n        JSON5.parse('1', (k, v) => (k === '') ? 'revived' : v),\n        'revived',\n        'modifies the root value'\n    )\n\n    t.strictSame(\n        JSON5.parse('{a:{b:2}}', function (k, v) { return (k === 'b' && this.b) ? 'revived' : v }),\n        {a: {b: 'revived'}},\n        'sets `this` to the parent value'\n    )\n\n    t.end()\n})\n"
  },
  {
    "path": "test/require.js",
    "content": "const assert = require('assert')\nconst sinon = require('sinon')\n\nconst t = require('tap')\n\nt.test('require(*.json5)', t => {\n    t.test('parses a JSON5 document', t => {\n        require('../lib/register')\n        assert.deepStrictEqual({a: 1, b: 2}, require('./test.json5'))\n        t.end()\n    })\n\n    t.test('is backward compatible with v0.5.1, but gives a deprecation warning', t => {\n        const mock = sinon.mock(console)\n        mock.expects('warn').once().withExactArgs(\"'json5/require' is deprecated. Please use 'json5/register' instead.\")\n        require('../lib/require')\n        assert.deepStrictEqual({a: 1, b: 2}, require('./test.json5'))\n        mock.verify()\n        t.end()\n    })\n\n    t.test('throws on invalid JSON5', t => {\n        require('../lib/register')\n        assert.throws(() => { require('./invalid.json5') }, SyntaxError)\n        t.end()\n    })\n\n    t.end()\n})\n"
  },
  {
    "path": "test/stringify.js",
    "content": "const assert = require('assert')\nconst JSON5 = require('../lib')\n\nconst t = require('tap')\n\nt.test('JSON5', t => {\n    t.test('#stringify', t => {\n        t.test('objects', t => {\n            t.strictSame(\n                JSON5.stringify({}),\n                '{}',\n                'stringifies empty objects'\n            )\n\n            t.strictSame(\n                JSON5.stringify({a: 1}),\n                '{a:1}',\n                'stringifies unquoted property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({'a-b': 1}),\n                \"{'a-b':1}\",\n                'stringifies single quoted string property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({\"a'\": 1}),\n                `{\"a'\":1}`,\n                'stringifies double quoted string property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({'': 1}),\n                \"{'':1}\",\n                'stringifies empty string property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({$_: 1, _$: 2, 'a\\u200C': 3}),\n                '{$_:1,_$:2,a\\u200C:3}',\n                'stringifies special character property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({'ùńîċõďë': 9}),\n                '{ùńîċõďë:9}',\n                'stringifies unicode property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({'\\\\\\b\\f\\n\\r\\t\\v\\0\\x01': 1}),\n                \"{'\\\\\\\\\\\\b\\\\f\\\\n\\\\r\\\\t\\\\v\\\\0\\\\x01':1}\",\n                'stringifies escaped property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({'\\0\\x001': 1}),\n                \"{'\\\\0\\\\x001':1}\",\n                'stringifies escaped null character property names'\n            )\n\n            t.strictSame(\n                JSON5.stringify({abc: 1, def: 2}),\n                '{abc:1,def:2}',\n                'stringifies multiple properties'\n            )\n\n            t.strictSame(\n                JSON5.stringify({a: {b: 2}}),\n                '{a:{b:2}}',\n                'stringifies nested objects'\n            )\n\n            t.end()\n        })\n\n        t.test('arrays', t => {\n            t.strictSame(\n                JSON5.stringify([]),\n                '[]',\n                'stringifies empty arrays'\n            )\n\n            t.strictSame(\n                JSON5.stringify([1]),\n                '[1]',\n                'stringifies array values'\n            )\n\n            t.strictSame(\n                JSON5.stringify([1, 2]),\n                '[1,2]',\n                'stringifies multiple array values'\n            )\n\n            t.strictSame(\n                JSON5.stringify([1, [2, 3]]),\n                '[1,[2,3]]',\n                'stringifies nested arrays'\n            )\n\n            t.end()\n        })\n\n        t.strictSame(\n            JSON5.stringify(null),\n            'null',\n            'stringifies nulls'\n        )\n\n        t.strictSame(\n            JSON5.stringify(() => {}),\n            undefined,\n            'returns undefined for functions'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a () {}}),\n            '{}',\n            'ignores function properties'\n        )\n\n        t.strictSame(\n            JSON5.stringify([() => {}]),\n            '[null]',\n            'returns null for functions in arrays'\n        )\n\n        t.test('Booleans', t => {\n            t.strictSame(\n                JSON5.stringify(true),\n                'true',\n                'stringifies true'\n            )\n\n            t.strictSame(\n                JSON5.stringify(false),\n                'false',\n                'stringifies false'\n            )\n\n            t.strictSame(\n                // eslint-disable-next-line no-new-wrappers\n                JSON5.stringify(new Boolean(true)),\n                'true',\n                'stringifies true Boolean objects'\n            )\n\n            t.strictSame(\n                // eslint-disable-next-line no-new-wrappers\n                JSON5.stringify(new Boolean(false)),\n                'false',\n                'stringifies false Boolean objects'\n            )\n\n            t.end()\n        })\n\n        t.test('numbers', t => {\n            t.strictSame(\n                JSON5.stringify(-1.2),\n                '-1.2',\n                'stringifies numbers'\n            )\n\n            t.strictSame(\n                JSON5.stringify([Infinity, -Infinity, NaN]),\n                '[Infinity,-Infinity,NaN]',\n                'stringifies non-finite numbers'\n            )\n\n            t.strictSame(\n                // eslint-disable-next-line no-new-wrappers\n                JSON5.stringify(new Number(-1.2)),\n                '-1.2',\n                'stringifies Number objects'\n            )\n\n            t.end()\n        })\n\n        t.test('strings', t => {\n            t.strictSame(\n                JSON5.stringify('abc'),\n                \"'abc'\",\n                'stringifies single quoted strings'\n            )\n\n            t.strictSame(\n                JSON5.stringify(\"abc'\"),\n                `\"abc'\"`,\n                'stringifies double quoted strings'\n            )\n\n            t.strictSame(\n                JSON5.stringify('\\\\\\b\\f\\n\\r\\t\\v\\0\\x0f'),\n                \"'\\\\\\\\\\\\b\\\\f\\\\n\\\\r\\\\t\\\\v\\\\0\\\\x0f'\",\n                'stringifies escaped characters'\n            )\n\n            t.strictSame(\n                JSON5.stringify('\\0\\x001'),\n                \"'\\\\0\\\\x001'\",\n                'stringifies escaped null characters'\n            )\n\n            t.strictSame(\n                JSON5.stringify(`'\"`),\n                `'\\\\'\"'`,\n                'stringifies escaped single quotes'\n            )\n\n            t.strictSame(\n                JSON5.stringify(`''\"`),\n                `\"''\\\\\"\"`,\n                'stringifies escaped double quotes'\n            )\n\n            t.strictSame(\n                JSON5.stringify('\\u2028\\u2029'),\n                \"'\\\\u2028\\\\u2029'\",\n                'stringifies escaped line and paragraph separators'\n            )\n\n            t.strictSame(\n                // eslint-disable-next-line no-new-wrappers\n                JSON5.stringify(new String('abc')),\n                \"'abc'\",\n                'stringifies String objects'\n            )\n\n            t.end()\n        })\n\n        t.strictSame(\n            JSON5.stringify(new Date('2016-01-01T00:00:00.000Z')),\n            \"'2016-01-01T00:00:00.000Z'\",\n            'stringifies using built-in toJSON methods'\n        )\n\n        t.test('stringifies using user defined toJSON methods', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON () { return {a: 1, b: 2} }})\n            assert.strictEqual(JSON5.stringify(new C()), '{a:1,b:2}')\n            t.end()\n        })\n\n        t.test('stringifies using user defined toJSON(key) methods', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON (key) { return (key === 'a') ? 1 : 2 }})\n            assert.strictEqual(JSON5.stringify({a: new C(), b: new C()}), '{a:1,b:2}')\n            t.end()\n        })\n\n        t.test('stringifies using toJSON5 methods', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON5 () { return {a: 1, b: 2} }})\n            assert.strictEqual(JSON5.stringify(new C()), '{a:1,b:2}')\n            t.end()\n        })\n\n        t.test('stringifies using toJSON5(key) methods', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON5 (key) { return (key === 'a') ? 1 : 2 }})\n            assert.strictEqual(JSON5.stringify({a: new C(), b: new C()}), '{a:1,b:2}')\n            t.end()\n        })\n\n        t.test('calls toJSON5 instead of toJSON if both are defined', t => {\n            function C () {}\n            Object.assign(C.prototype, {\n                toJSON () { return {a: 1, b: 2} },\n                toJSON5 () { return {a: 2, b: 2} },\n            })\n            assert.strictEqual(JSON5.stringify(new C()), '{a:2,b:2}')\n            t.end()\n        })\n\n        t.test('throws on circular objects', t => {\n            let a = {}\n            a.a = a\n            assert.throws(() => { JSON5.stringify(a) }, TypeError, 'Converting circular structure to JSON5')\n            t.end()\n        })\n\n        t.test('throws on circular arrays', t => {\n            let a = []\n            a[0] = a\n            assert.throws(() => { JSON5.stringify(a) }, TypeError, 'Converting circular structure to JSON5')\n            t.end()\n        })\n\n        t.end()\n    })\n\n    t.test('#stringify(value, null, space)', t => {\n        t.strictSame(\n            JSON5.stringify([1]),\n            '[1]',\n            'does not indent when no value is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, 0),\n            '[1]',\n            'does not indent when 0 is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, ''),\n            '[1]',\n            'does not indent when an empty string is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, 2),\n            '[\\n  1,\\n]',\n            'indents n spaces when a number is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, 11),\n            '[\\n          1,\\n]',\n            'does not indent more than 10 spaces when a number is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, '\\t'),\n            '[\\n\\t1,\\n]',\n            'indents with the string provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, '           '),\n            '[\\n          1,\\n]',\n            'does not indent more than 10 characters of the string provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], null, 2),\n            '[\\n  1,\\n]',\n            'indents in arrays'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1, [2], 3], null, 2),\n            '[\\n  1,\\n  [\\n    2,\\n  ],\\n  3,\\n]',\n            'indents in nested arrays'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a: 1}, null, 2),\n            '{\\n  a: 1,\\n}',\n            'indents in objects'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a: {b: 2}}, null, 2),\n            '{\\n  a: {\\n    b: 2,\\n  },\\n}',\n            'indents in nested objects'\n        )\n\n        t.strictSame(\n            // eslint-disable-next-line no-new-wrappers\n            JSON5.stringify([1], null, new Number(2)),\n            '[\\n  1,\\n]',\n            'accepts Number objects'\n        )\n\n        t.strictSame(\n            // eslint-disable-next-line no-new-wrappers\n            JSON5.stringify([1], null, new String('\\t')),\n            '[\\n\\t1,\\n]',\n            'accepts String objects'\n        )\n\n        t.end()\n    })\n\n    t.test('#stringify(value, replacer)', t => {\n        t.strictSame(\n            JSON5.stringify({a: 1, b: 2, 3: 3}, ['a', 3]),\n            \"{a:1,'3':3}\",\n            'filters keys when an array is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a: 1, b: 2, 3: 3, false: 4}, ['a', 3, false]),\n            \"{a:1,'3':3}\",\n            'only filters string and number keys when an array is provided'\n        )\n\n        t.strictSame(\n            // eslint-disable-next-line no-new-wrappers\n            JSON5.stringify({a: 1, b: 2, 3: 3}, [new String('a'), new Number(3)]),\n            \"{a:1,'3':3}\",\n            'accepts String and Number objects when an array is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a: 1, b: 2}, (key, value) => (key === 'a') ? 2 : value),\n            '{a:2,b:2}',\n            'replaces values when a function is provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify({a: {b: 1}}, function (k, v) { return (k === 'b' && this.b) ? 2 : v }),\n            '{a:{b:2}}',\n            'sets `this` to the parent value'\n        )\n\n        t.test('is called after toJSON', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON () { return {a: 1, b: 2} }})\n            assert.strictEqual(\n                JSON5.stringify(new C(), (key, value) => (key === 'a') ? 2 : value),\n                '{a:2,b:2}'\n            )\n            t.end()\n        })\n\n        t.test('is called after toJSON5', t => {\n            function C () {}\n            Object.assign(C.prototype, {toJSON5 () { return {a: 1, b: 2} }})\n            assert.strictEqual(\n                JSON5.stringify(new C(), (key, value) => (key === 'a') ? 2 : value),\n                '{a:2,b:2}'\n            )\n            t.end()\n        })\n\n        t.strictSame(\n            JSON5.stringify(\n                {a: 1},\n                (key, value) => {\n                    JSON5.stringify({}, null, 4)\n                    return value\n                },\n                2\n            ),\n            '{\\n  a: 1,\\n}',\n            'does not affect space when calls are nested'\n        )\n\n        t.end()\n    })\n\n    t.test('#stringify(value, options)', t => {\n        t.strictSame(\n            JSON5.stringify({a: 1, b: 2, 3: 3}, {replacer: ['a', 3]}),\n            \"{a:1,'3':3}\",\n            'accepts replacer as an option'\n        )\n\n        t.strictSame(\n            JSON5.stringify([1], {space: 2}),\n            '[\\n  1,\\n]',\n            'accepts space as an option'\n        )\n\n        t.end()\n    })\n\n    t.test('#stringify(value, {quote})', t => {\n        t.strictSame(\n            JSON5.stringify({'a\"': '1\"'}, {quote: '\"'}),\n            '{\"a\\\\\"\":\"1\\\\\"\"}',\n            'uses double quotes if provided'\n        )\n\n        t.strictSame(\n            JSON5.stringify({\"a'\": \"1'\"}, {quote: \"'\"}),\n            \"{'a\\\\'':'1\\\\''}\",\n            'uses single quotes if provided'\n        )\n\n        t.end()\n    })\n\n    t.end()\n})\n"
  },
  {
    "path": "test/test.json5",
    "content": "{a: 1, b: 2}\n"
  }
]