├── .editorconfig ├── .eslintrc.json ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── package.json ├── pnpm-lock.yaml ├── src ├── index.ts ├── parser.ts ├── primitive.ts ├── tokenizer.ts ├── tokens.ts └── utils.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = false 12 | insert_final_newline = false -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "es2021": true, 4 | "node": true 5 | }, 6 | "extends": ["airbnb-base", "airbnb-typescript/base", "plugin:prettier/recommended"], 7 | "parser": "@typescript-eslint/parser", 8 | "parserOptions": { 9 | "ecmaVersion": "latest", 10 | "sourceType": "module", 11 | "project": "./tsconfig.json" 12 | }, 13 | "plugins": ["@typescript-eslint"], 14 | "rules": { 15 | "no-restricted-exports": ["off"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | src/fibonacci.ts 2 | node_modules 3 | .env -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "tabWidth": 2, 4 | "printWidth": 100, 5 | "singleQuote": true, 6 | "trailingComma": "all", 7 | "bracketSpacing": true, 8 | "semi": true 9 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2022 Sam Zhang 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Type-level JSON Parser 2 | 3 | A JSON parser written in TypeScript, and only TypeScript. 4 | 5 | ## Usage 6 | 7 | First install `ts-json` with a package manager: 8 | 9 | ```bash 10 | $ npm i ts-json-parser 11 | ``` 12 | 13 | Example: 14 | 15 | ```ts 16 | import type { JSON } from 'ts-json-parser'; 17 | 18 | type Parsed = JSON<`{ 19 | "title": "My Awesome Title", 20 | "description": "My awesome description." 21 | }`>; 22 | 23 | /* 24 | type Parsed = { 25 | title: "My Awesome Title"; 26 | description: "My awesome description."; 27 | } 28 | */ 29 | ``` 30 | 31 | To primitive types: 32 | 33 | ```ts 34 | import type { JSONPrimitive } from 'ts-json-parser'; 35 | 36 | type Parsed = JSONPrimitive<`{ 37 | "title": "My Awesome Title", 38 | "description": "My awesome description.", 39 | "price": 10, 40 | "inStock": true 41 | }`>; 42 | 43 | /* 44 | type Parsed = { 45 | title: string; 46 | description: string; 47 | price: number; 48 | inStock: boolean; 49 | } 50 | */ 51 | ``` 52 | 53 | ## TODO 54 | 55 | - Support floating numbers 56 | - Support `stringify` 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ts-json-parser", 3 | "version": "1.0.0", 4 | "main": "./src/index.ts", 5 | "license": "MIT", 6 | "devDependencies": { 7 | "@typescript-eslint/eslint-plugin": "^5.42.0", 8 | "@typescript-eslint/parser": "^5.42.0", 9 | "eslint": "^7.32.0 || ^8.2.0", 10 | "eslint-config-airbnb-base": "^15.0.0", 11 | "eslint-config-airbnb-typescript": "^17.0.0", 12 | "eslint-config-prettier": "^8.5.0", 13 | "eslint-plugin-import": "^2.25.2", 14 | "eslint-plugin-prettier": "^4.2.1", 15 | "prettier": "^2.7.1", 16 | "typescript": "^4.8.4" 17 | }, 18 | "dependencies": { 19 | "tslib": "^2.4.1", 20 | "ts-arithmetic": "^0.1.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: 5.3 2 | 3 | specifiers: 4 | '@typescript-eslint/eslint-plugin': ^5.42.0 5 | '@typescript-eslint/parser': ^5.42.0 6 | eslint: ^7.32.0 || ^8.2.0 7 | eslint-config-airbnb-base: ^15.0.0 8 | eslint-config-airbnb-typescript: ^17.0.0 9 | eslint-config-prettier: ^8.5.0 10 | eslint-plugin-import: ^2.25.2 11 | eslint-plugin-prettier: ^4.2.1 12 | prettier: ^2.7.1 13 | ts-arithmetic: ^0.1.1 14 | tslib: ^2.4.1 15 | typescript: ^4.8.4 16 | 17 | dependencies: 18 | ts-arithmetic: 0.1.1 19 | tslib: 2.4.1 20 | 21 | devDependencies: 22 | '@typescript-eslint/eslint-plugin': 5.42.0_f5eddb1b5bef116e6689568bbae0b1cd 23 | '@typescript-eslint/parser': 5.42.0_eslint@8.26.0+typescript@4.8.4 24 | eslint: 8.26.0 25 | eslint-config-airbnb-base: 15.0.0_661b5bd590ec278724a5440c4af2ff63 26 | eslint-config-airbnb-typescript: 17.0.0_9a8bf6481c032ca63027f88192c7735c 27 | eslint-config-prettier: 8.5.0_eslint@8.26.0 28 | eslint-plugin-import: 2.26.0_eslint@8.26.0 29 | eslint-plugin-prettier: 4.2.1_03516513155bd96520649d3136b95513 30 | prettier: 2.7.1 31 | typescript: 4.8.4 32 | 33 | packages: 34 | 35 | /@eslint/eslintrc/1.3.3: 36 | resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} 37 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 38 | dependencies: 39 | ajv: 6.12.6 40 | debug: 4.3.4 41 | espree: 9.4.0 42 | globals: 13.17.0 43 | ignore: 5.2.0 44 | import-fresh: 3.3.0 45 | js-yaml: 4.1.0 46 | minimatch: 3.1.2 47 | strip-json-comments: 3.1.1 48 | transitivePeerDependencies: 49 | - supports-color 50 | dev: true 51 | 52 | /@humanwhocodes/config-array/0.11.7: 53 | resolution: {integrity: sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==} 54 | engines: {node: '>=10.10.0'} 55 | dependencies: 56 | '@humanwhocodes/object-schema': 1.2.1 57 | debug: 4.3.4 58 | minimatch: 3.1.2 59 | transitivePeerDependencies: 60 | - supports-color 61 | dev: true 62 | 63 | /@humanwhocodes/module-importer/1.0.1: 64 | resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} 65 | engines: {node: '>=12.22'} 66 | dev: true 67 | 68 | /@humanwhocodes/object-schema/1.2.1: 69 | resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} 70 | dev: true 71 | 72 | /@nodelib/fs.scandir/2.1.5: 73 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} 74 | engines: {node: '>= 8'} 75 | dependencies: 76 | '@nodelib/fs.stat': 2.0.5 77 | run-parallel: 1.2.0 78 | dev: true 79 | 80 | /@nodelib/fs.stat/2.0.5: 81 | resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} 82 | engines: {node: '>= 8'} 83 | dev: true 84 | 85 | /@nodelib/fs.walk/1.2.8: 86 | resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} 87 | engines: {node: '>= 8'} 88 | dependencies: 89 | '@nodelib/fs.scandir': 2.1.5 90 | fastq: 1.13.0 91 | dev: true 92 | 93 | /@types/json-schema/7.0.11: 94 | resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} 95 | dev: true 96 | 97 | /@types/json5/0.0.29: 98 | resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} 99 | dev: true 100 | 101 | /@types/semver/7.3.13: 102 | resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} 103 | dev: true 104 | 105 | /@typescript-eslint/eslint-plugin/5.42.0_f5eddb1b5bef116e6689568bbae0b1cd: 106 | resolution: {integrity: sha512-5TJh2AgL6+wpL8H/GTSjNb4WrjKoR2rqvFxR/DDTqYNk6uXn8BJMEcncLSpMbf/XV1aS0jAjYwn98uvVCiAywQ==} 107 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 108 | peerDependencies: 109 | '@typescript-eslint/parser': ^5.0.0 110 | eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 111 | typescript: '*' 112 | peerDependenciesMeta: 113 | typescript: 114 | optional: true 115 | dependencies: 116 | '@typescript-eslint/parser': 5.42.0_eslint@8.26.0+typescript@4.8.4 117 | '@typescript-eslint/scope-manager': 5.42.0 118 | '@typescript-eslint/type-utils': 5.42.0_eslint@8.26.0+typescript@4.8.4 119 | '@typescript-eslint/utils': 5.42.0_eslint@8.26.0+typescript@4.8.4 120 | debug: 4.3.4 121 | eslint: 8.26.0 122 | ignore: 5.2.0 123 | natural-compare-lite: 1.4.0 124 | regexpp: 3.2.0 125 | semver: 7.3.8 126 | tsutils: 3.21.0_typescript@4.8.4 127 | typescript: 4.8.4 128 | transitivePeerDependencies: 129 | - supports-color 130 | dev: true 131 | 132 | /@typescript-eslint/parser/5.42.0_eslint@8.26.0+typescript@4.8.4: 133 | resolution: {integrity: sha512-Ixh9qrOTDRctFg3yIwrLkgf33AHyEIn6lhyf5cCfwwiGtkWhNpVKlEZApi3inGQR/barWnY7qY8FbGKBO7p3JA==} 134 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 135 | peerDependencies: 136 | eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 137 | typescript: '*' 138 | peerDependenciesMeta: 139 | typescript: 140 | optional: true 141 | dependencies: 142 | '@typescript-eslint/scope-manager': 5.42.0 143 | '@typescript-eslint/types': 5.42.0 144 | '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 145 | debug: 4.3.4 146 | eslint: 8.26.0 147 | typescript: 4.8.4 148 | transitivePeerDependencies: 149 | - supports-color 150 | dev: true 151 | 152 | /@typescript-eslint/scope-manager/5.42.0: 153 | resolution: {integrity: sha512-l5/3IBHLH0Bv04y+H+zlcLiEMEMjWGaCX6WyHE5Uk2YkSGAMlgdUPsT/ywTSKgu9D1dmmKMYgYZijObfA39Wow==} 154 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 155 | dependencies: 156 | '@typescript-eslint/types': 5.42.0 157 | '@typescript-eslint/visitor-keys': 5.42.0 158 | dev: true 159 | 160 | /@typescript-eslint/type-utils/5.42.0_eslint@8.26.0+typescript@4.8.4: 161 | resolution: {integrity: sha512-HW14TXC45dFVZxnVW8rnUGnvYyRC0E/vxXShFCthcC9VhVTmjqOmtqj6H5rm9Zxv+ORxKA/1aLGD7vmlLsdlOg==} 162 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 163 | peerDependencies: 164 | eslint: '*' 165 | typescript: '*' 166 | peerDependenciesMeta: 167 | typescript: 168 | optional: true 169 | dependencies: 170 | '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 171 | '@typescript-eslint/utils': 5.42.0_eslint@8.26.0+typescript@4.8.4 172 | debug: 4.3.4 173 | eslint: 8.26.0 174 | tsutils: 3.21.0_typescript@4.8.4 175 | typescript: 4.8.4 176 | transitivePeerDependencies: 177 | - supports-color 178 | dev: true 179 | 180 | /@typescript-eslint/types/5.42.0: 181 | resolution: {integrity: sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw==} 182 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 183 | dev: true 184 | 185 | /@typescript-eslint/typescript-estree/5.42.0_typescript@4.8.4: 186 | resolution: {integrity: sha512-2O3vSq794x3kZGtV7i4SCWZWCwjEtkWfVqX4m5fbUBomOsEOyd6OAD1qU2lbvV5S8tgy/luJnOYluNyYVeOTTg==} 187 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 188 | peerDependencies: 189 | typescript: '*' 190 | peerDependenciesMeta: 191 | typescript: 192 | optional: true 193 | dependencies: 194 | '@typescript-eslint/types': 5.42.0 195 | '@typescript-eslint/visitor-keys': 5.42.0 196 | debug: 4.3.4 197 | globby: 11.1.0 198 | is-glob: 4.0.3 199 | semver: 7.3.8 200 | tsutils: 3.21.0_typescript@4.8.4 201 | typescript: 4.8.4 202 | transitivePeerDependencies: 203 | - supports-color 204 | dev: true 205 | 206 | /@typescript-eslint/utils/5.42.0_eslint@8.26.0+typescript@4.8.4: 207 | resolution: {integrity: sha512-JZ++3+h1vbeG1NUECXQZE3hg0kias9kOtcQr3+JVQ3whnjvKuMyktJAAIj6743OeNPnGBmjj7KEmiDL7qsdnCQ==} 208 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 209 | peerDependencies: 210 | eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 211 | dependencies: 212 | '@types/json-schema': 7.0.11 213 | '@types/semver': 7.3.13 214 | '@typescript-eslint/scope-manager': 5.42.0 215 | '@typescript-eslint/types': 5.42.0 216 | '@typescript-eslint/typescript-estree': 5.42.0_typescript@4.8.4 217 | eslint: 8.26.0 218 | eslint-scope: 5.1.1 219 | eslint-utils: 3.0.0_eslint@8.26.0 220 | semver: 7.3.8 221 | transitivePeerDependencies: 222 | - supports-color 223 | - typescript 224 | dev: true 225 | 226 | /@typescript-eslint/visitor-keys/5.42.0: 227 | resolution: {integrity: sha512-QHbu5Hf/2lOEOwy+IUw0GoSCuAzByTAWWrOTKzTzsotiUnWFpuKnXcAhC9YztAf2EElQ0VvIK+pHJUPkM0q7jg==} 228 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 229 | dependencies: 230 | '@typescript-eslint/types': 5.42.0 231 | eslint-visitor-keys: 3.3.0 232 | dev: true 233 | 234 | /acorn-jsx/5.3.2_acorn@8.8.1: 235 | resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} 236 | peerDependencies: 237 | acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 238 | dependencies: 239 | acorn: 8.8.1 240 | dev: true 241 | 242 | /acorn/8.8.1: 243 | resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} 244 | engines: {node: '>=0.4.0'} 245 | hasBin: true 246 | dev: true 247 | 248 | /ajv/6.12.6: 249 | resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} 250 | dependencies: 251 | fast-deep-equal: 3.1.3 252 | fast-json-stable-stringify: 2.1.0 253 | json-schema-traverse: 0.4.1 254 | uri-js: 4.4.1 255 | dev: true 256 | 257 | /ansi-regex/5.0.1: 258 | resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} 259 | engines: {node: '>=8'} 260 | dev: true 261 | 262 | /ansi-styles/4.3.0: 263 | resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 264 | engines: {node: '>=8'} 265 | dependencies: 266 | color-convert: 2.0.1 267 | dev: true 268 | 269 | /argparse/2.0.1: 270 | resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} 271 | dev: true 272 | 273 | /array-includes/3.1.5: 274 | resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==} 275 | engines: {node: '>= 0.4'} 276 | dependencies: 277 | call-bind: 1.0.2 278 | define-properties: 1.1.4 279 | es-abstract: 1.20.4 280 | get-intrinsic: 1.1.3 281 | is-string: 1.0.7 282 | dev: true 283 | 284 | /array-union/2.1.0: 285 | resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} 286 | engines: {node: '>=8'} 287 | dev: true 288 | 289 | /array.prototype.flat/1.3.1: 290 | resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} 291 | engines: {node: '>= 0.4'} 292 | dependencies: 293 | call-bind: 1.0.2 294 | define-properties: 1.1.4 295 | es-abstract: 1.20.4 296 | es-shim-unscopables: 1.0.0 297 | dev: true 298 | 299 | /balanced-match/1.0.2: 300 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 301 | dev: true 302 | 303 | /brace-expansion/1.1.11: 304 | resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} 305 | dependencies: 306 | balanced-match: 1.0.2 307 | concat-map: 0.0.1 308 | dev: true 309 | 310 | /braces/3.0.2: 311 | resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} 312 | engines: {node: '>=8'} 313 | dependencies: 314 | fill-range: 7.0.1 315 | dev: true 316 | 317 | /call-bind/1.0.2: 318 | resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} 319 | dependencies: 320 | function-bind: 1.1.1 321 | get-intrinsic: 1.1.3 322 | dev: true 323 | 324 | /callsites/3.1.0: 325 | resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} 326 | engines: {node: '>=6'} 327 | dev: true 328 | 329 | /chalk/4.1.2: 330 | resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} 331 | engines: {node: '>=10'} 332 | dependencies: 333 | ansi-styles: 4.3.0 334 | supports-color: 7.2.0 335 | dev: true 336 | 337 | /color-convert/2.0.1: 338 | resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 339 | engines: {node: '>=7.0.0'} 340 | dependencies: 341 | color-name: 1.1.4 342 | dev: true 343 | 344 | /color-name/1.1.4: 345 | resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} 346 | dev: true 347 | 348 | /concat-map/0.0.1: 349 | resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} 350 | dev: true 351 | 352 | /confusing-browser-globals/1.0.11: 353 | resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==} 354 | dev: true 355 | 356 | /cross-spawn/7.0.3: 357 | resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} 358 | engines: {node: '>= 8'} 359 | dependencies: 360 | path-key: 3.1.1 361 | shebang-command: 2.0.0 362 | which: 2.0.2 363 | dev: true 364 | 365 | /debug/2.6.9: 366 | resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} 367 | dependencies: 368 | ms: 2.0.0 369 | dev: true 370 | 371 | /debug/3.2.7: 372 | resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} 373 | dependencies: 374 | ms: 2.1.2 375 | dev: true 376 | 377 | /debug/4.3.4: 378 | resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} 379 | engines: {node: '>=6.0'} 380 | peerDependencies: 381 | supports-color: '*' 382 | peerDependenciesMeta: 383 | supports-color: 384 | optional: true 385 | dependencies: 386 | ms: 2.1.2 387 | dev: true 388 | 389 | /deep-is/0.1.4: 390 | resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} 391 | dev: true 392 | 393 | /define-properties/1.1.4: 394 | resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} 395 | engines: {node: '>= 0.4'} 396 | dependencies: 397 | has-property-descriptors: 1.0.0 398 | object-keys: 1.1.1 399 | dev: true 400 | 401 | /dir-glob/3.0.1: 402 | resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} 403 | engines: {node: '>=8'} 404 | dependencies: 405 | path-type: 4.0.0 406 | dev: true 407 | 408 | /doctrine/2.1.0: 409 | resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} 410 | engines: {node: '>=0.10.0'} 411 | dependencies: 412 | esutils: 2.0.3 413 | dev: true 414 | 415 | /doctrine/3.0.0: 416 | resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} 417 | engines: {node: '>=6.0.0'} 418 | dependencies: 419 | esutils: 2.0.3 420 | dev: true 421 | 422 | /es-abstract/1.20.4: 423 | resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} 424 | engines: {node: '>= 0.4'} 425 | dependencies: 426 | call-bind: 1.0.2 427 | es-to-primitive: 1.2.1 428 | function-bind: 1.1.1 429 | function.prototype.name: 1.1.5 430 | get-intrinsic: 1.1.3 431 | get-symbol-description: 1.0.0 432 | has: 1.0.3 433 | has-property-descriptors: 1.0.0 434 | has-symbols: 1.0.3 435 | internal-slot: 1.0.3 436 | is-callable: 1.2.7 437 | is-negative-zero: 2.0.2 438 | is-regex: 1.1.4 439 | is-shared-array-buffer: 1.0.2 440 | is-string: 1.0.7 441 | is-weakref: 1.0.2 442 | object-inspect: 1.12.2 443 | object-keys: 1.1.1 444 | object.assign: 4.1.4 445 | regexp.prototype.flags: 1.4.3 446 | safe-regex-test: 1.0.0 447 | string.prototype.trimend: 1.0.5 448 | string.prototype.trimstart: 1.0.5 449 | unbox-primitive: 1.0.2 450 | dev: true 451 | 452 | /es-shim-unscopables/1.0.0: 453 | resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} 454 | dependencies: 455 | has: 1.0.3 456 | dev: true 457 | 458 | /es-to-primitive/1.2.1: 459 | resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} 460 | engines: {node: '>= 0.4'} 461 | dependencies: 462 | is-callable: 1.2.7 463 | is-date-object: 1.0.5 464 | is-symbol: 1.0.4 465 | dev: true 466 | 467 | /escape-string-regexp/4.0.0: 468 | resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} 469 | engines: {node: '>=10'} 470 | dev: true 471 | 472 | /eslint-config-airbnb-base/15.0.0_661b5bd590ec278724a5440c4af2ff63: 473 | resolution: {integrity: sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==} 474 | engines: {node: ^10.12.0 || >=12.0.0} 475 | peerDependencies: 476 | eslint: ^7.32.0 || ^8.2.0 477 | eslint-plugin-import: ^2.25.2 478 | dependencies: 479 | confusing-browser-globals: 1.0.11 480 | eslint: 8.26.0 481 | eslint-plugin-import: 2.26.0_eslint@8.26.0 482 | object.assign: 4.1.4 483 | object.entries: 1.1.5 484 | semver: 6.3.0 485 | dev: true 486 | 487 | /eslint-config-airbnb-typescript/17.0.0_9a8bf6481c032ca63027f88192c7735c: 488 | resolution: {integrity: sha512-elNiuzD0kPAPTXjFWg+lE24nMdHMtuxgYoD30OyMD6yrW1AhFZPAg27VX7d3tzOErw+dgJTNWfRSDqEcXb4V0g==} 489 | peerDependencies: 490 | '@typescript-eslint/eslint-plugin': ^5.13.0 491 | '@typescript-eslint/parser': ^5.0.0 492 | eslint: ^7.32.0 || ^8.2.0 493 | eslint-plugin-import: ^2.25.3 494 | dependencies: 495 | '@typescript-eslint/eslint-plugin': 5.42.0_f5eddb1b5bef116e6689568bbae0b1cd 496 | '@typescript-eslint/parser': 5.42.0_eslint@8.26.0+typescript@4.8.4 497 | eslint: 8.26.0 498 | eslint-config-airbnb-base: 15.0.0_661b5bd590ec278724a5440c4af2ff63 499 | eslint-plugin-import: 2.26.0_eslint@8.26.0 500 | dev: true 501 | 502 | /eslint-config-prettier/8.5.0_eslint@8.26.0: 503 | resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} 504 | hasBin: true 505 | peerDependencies: 506 | eslint: '>=7.0.0' 507 | dependencies: 508 | eslint: 8.26.0 509 | dev: true 510 | 511 | /eslint-import-resolver-node/0.3.6: 512 | resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==} 513 | dependencies: 514 | debug: 3.2.7 515 | resolve: 1.22.1 516 | dev: true 517 | 518 | /eslint-module-utils/2.7.4_eslint@8.26.0: 519 | resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} 520 | engines: {node: '>=4'} 521 | peerDependencies: 522 | eslint: '*' 523 | peerDependenciesMeta: 524 | eslint: 525 | optional: true 526 | dependencies: 527 | debug: 3.2.7 528 | eslint: 8.26.0 529 | dev: true 530 | 531 | /eslint-plugin-import/2.26.0_eslint@8.26.0: 532 | resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} 533 | engines: {node: '>=4'} 534 | peerDependencies: 535 | eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 536 | dependencies: 537 | array-includes: 3.1.5 538 | array.prototype.flat: 1.3.1 539 | debug: 2.6.9 540 | doctrine: 2.1.0 541 | eslint: 8.26.0 542 | eslint-import-resolver-node: 0.3.6 543 | eslint-module-utils: 2.7.4_eslint@8.26.0 544 | has: 1.0.3 545 | is-core-module: 2.11.0 546 | is-glob: 4.0.3 547 | minimatch: 3.1.2 548 | object.values: 1.1.5 549 | resolve: 1.22.1 550 | tsconfig-paths: 3.14.1 551 | dev: true 552 | 553 | /eslint-plugin-prettier/4.2.1_03516513155bd96520649d3136b95513: 554 | resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} 555 | engines: {node: '>=12.0.0'} 556 | peerDependencies: 557 | eslint: '>=7.28.0' 558 | eslint-config-prettier: '*' 559 | prettier: '>=2.0.0' 560 | peerDependenciesMeta: 561 | eslint-config-prettier: 562 | optional: true 563 | dependencies: 564 | eslint: 8.26.0 565 | eslint-config-prettier: 8.5.0_eslint@8.26.0 566 | prettier: 2.7.1 567 | prettier-linter-helpers: 1.0.0 568 | dev: true 569 | 570 | /eslint-scope/5.1.1: 571 | resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} 572 | engines: {node: '>=8.0.0'} 573 | dependencies: 574 | esrecurse: 4.3.0 575 | estraverse: 4.3.0 576 | dev: true 577 | 578 | /eslint-scope/7.1.1: 579 | resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} 580 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 581 | dependencies: 582 | esrecurse: 4.3.0 583 | estraverse: 5.3.0 584 | dev: true 585 | 586 | /eslint-utils/3.0.0_eslint@8.26.0: 587 | resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} 588 | engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} 589 | peerDependencies: 590 | eslint: '>=5' 591 | dependencies: 592 | eslint: 8.26.0 593 | eslint-visitor-keys: 2.1.0 594 | dev: true 595 | 596 | /eslint-visitor-keys/2.1.0: 597 | resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} 598 | engines: {node: '>=10'} 599 | dev: true 600 | 601 | /eslint-visitor-keys/3.3.0: 602 | resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} 603 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 604 | dev: true 605 | 606 | /eslint/8.26.0: 607 | resolution: {integrity: sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==} 608 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 609 | hasBin: true 610 | dependencies: 611 | '@eslint/eslintrc': 1.3.3 612 | '@humanwhocodes/config-array': 0.11.7 613 | '@humanwhocodes/module-importer': 1.0.1 614 | '@nodelib/fs.walk': 1.2.8 615 | ajv: 6.12.6 616 | chalk: 4.1.2 617 | cross-spawn: 7.0.3 618 | debug: 4.3.4 619 | doctrine: 3.0.0 620 | escape-string-regexp: 4.0.0 621 | eslint-scope: 7.1.1 622 | eslint-utils: 3.0.0_eslint@8.26.0 623 | eslint-visitor-keys: 3.3.0 624 | espree: 9.4.0 625 | esquery: 1.4.0 626 | esutils: 2.0.3 627 | fast-deep-equal: 3.1.3 628 | file-entry-cache: 6.0.1 629 | find-up: 5.0.0 630 | glob-parent: 6.0.2 631 | globals: 13.17.0 632 | grapheme-splitter: 1.0.4 633 | ignore: 5.2.0 634 | import-fresh: 3.3.0 635 | imurmurhash: 0.1.4 636 | is-glob: 4.0.3 637 | is-path-inside: 3.0.3 638 | js-sdsl: 4.1.5 639 | js-yaml: 4.1.0 640 | json-stable-stringify-without-jsonify: 1.0.1 641 | levn: 0.4.1 642 | lodash.merge: 4.6.2 643 | minimatch: 3.1.2 644 | natural-compare: 1.4.0 645 | optionator: 0.9.1 646 | regexpp: 3.2.0 647 | strip-ansi: 6.0.1 648 | strip-json-comments: 3.1.1 649 | text-table: 0.2.0 650 | transitivePeerDependencies: 651 | - supports-color 652 | dev: true 653 | 654 | /espree/9.4.0: 655 | resolution: {integrity: sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==} 656 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 657 | dependencies: 658 | acorn: 8.8.1 659 | acorn-jsx: 5.3.2_acorn@8.8.1 660 | eslint-visitor-keys: 3.3.0 661 | dev: true 662 | 663 | /esquery/1.4.0: 664 | resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} 665 | engines: {node: '>=0.10'} 666 | dependencies: 667 | estraverse: 5.3.0 668 | dev: true 669 | 670 | /esrecurse/4.3.0: 671 | resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} 672 | engines: {node: '>=4.0'} 673 | dependencies: 674 | estraverse: 5.3.0 675 | dev: true 676 | 677 | /estraverse/4.3.0: 678 | resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} 679 | engines: {node: '>=4.0'} 680 | dev: true 681 | 682 | /estraverse/5.3.0: 683 | resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} 684 | engines: {node: '>=4.0'} 685 | dev: true 686 | 687 | /esutils/2.0.3: 688 | resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 689 | engines: {node: '>=0.10.0'} 690 | dev: true 691 | 692 | /fast-deep-equal/3.1.3: 693 | resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} 694 | dev: true 695 | 696 | /fast-diff/1.2.0: 697 | resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} 698 | dev: true 699 | 700 | /fast-glob/3.2.12: 701 | resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} 702 | engines: {node: '>=8.6.0'} 703 | dependencies: 704 | '@nodelib/fs.stat': 2.0.5 705 | '@nodelib/fs.walk': 1.2.8 706 | glob-parent: 5.1.2 707 | merge2: 1.4.1 708 | micromatch: 4.0.5 709 | dev: true 710 | 711 | /fast-json-stable-stringify/2.1.0: 712 | resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} 713 | dev: true 714 | 715 | /fast-levenshtein/2.0.6: 716 | resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} 717 | dev: true 718 | 719 | /fastq/1.13.0: 720 | resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} 721 | dependencies: 722 | reusify: 1.0.4 723 | dev: true 724 | 725 | /file-entry-cache/6.0.1: 726 | resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} 727 | engines: {node: ^10.12.0 || >=12.0.0} 728 | dependencies: 729 | flat-cache: 3.0.4 730 | dev: true 731 | 732 | /fill-range/7.0.1: 733 | resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} 734 | engines: {node: '>=8'} 735 | dependencies: 736 | to-regex-range: 5.0.1 737 | dev: true 738 | 739 | /find-up/5.0.0: 740 | resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} 741 | engines: {node: '>=10'} 742 | dependencies: 743 | locate-path: 6.0.0 744 | path-exists: 4.0.0 745 | dev: true 746 | 747 | /flat-cache/3.0.4: 748 | resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} 749 | engines: {node: ^10.12.0 || >=12.0.0} 750 | dependencies: 751 | flatted: 3.2.7 752 | rimraf: 3.0.2 753 | dev: true 754 | 755 | /flatted/3.2.7: 756 | resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} 757 | dev: true 758 | 759 | /fs.realpath/1.0.0: 760 | resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} 761 | dev: true 762 | 763 | /function-bind/1.1.1: 764 | resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} 765 | dev: true 766 | 767 | /function.prototype.name/1.1.5: 768 | resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} 769 | engines: {node: '>= 0.4'} 770 | dependencies: 771 | call-bind: 1.0.2 772 | define-properties: 1.1.4 773 | es-abstract: 1.20.4 774 | functions-have-names: 1.2.3 775 | dev: true 776 | 777 | /functions-have-names/1.2.3: 778 | resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} 779 | dev: true 780 | 781 | /get-intrinsic/1.1.3: 782 | resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} 783 | dependencies: 784 | function-bind: 1.1.1 785 | has: 1.0.3 786 | has-symbols: 1.0.3 787 | dev: true 788 | 789 | /get-symbol-description/1.0.0: 790 | resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} 791 | engines: {node: '>= 0.4'} 792 | dependencies: 793 | call-bind: 1.0.2 794 | get-intrinsic: 1.1.3 795 | dev: true 796 | 797 | /glob-parent/5.1.2: 798 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 799 | engines: {node: '>= 6'} 800 | dependencies: 801 | is-glob: 4.0.3 802 | dev: true 803 | 804 | /glob-parent/6.0.2: 805 | resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} 806 | engines: {node: '>=10.13.0'} 807 | dependencies: 808 | is-glob: 4.0.3 809 | dev: true 810 | 811 | /glob/7.2.3: 812 | resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} 813 | dependencies: 814 | fs.realpath: 1.0.0 815 | inflight: 1.0.6 816 | inherits: 2.0.4 817 | minimatch: 3.1.2 818 | once: 1.4.0 819 | path-is-absolute: 1.0.1 820 | dev: true 821 | 822 | /globals/13.17.0: 823 | resolution: {integrity: sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==} 824 | engines: {node: '>=8'} 825 | dependencies: 826 | type-fest: 0.20.2 827 | dev: true 828 | 829 | /globby/11.1.0: 830 | resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} 831 | engines: {node: '>=10'} 832 | dependencies: 833 | array-union: 2.1.0 834 | dir-glob: 3.0.1 835 | fast-glob: 3.2.12 836 | ignore: 5.2.0 837 | merge2: 1.4.1 838 | slash: 3.0.0 839 | dev: true 840 | 841 | /grapheme-splitter/1.0.4: 842 | resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} 843 | dev: true 844 | 845 | /has-bigints/1.0.2: 846 | resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} 847 | dev: true 848 | 849 | /has-flag/4.0.0: 850 | resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} 851 | engines: {node: '>=8'} 852 | dev: true 853 | 854 | /has-property-descriptors/1.0.0: 855 | resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} 856 | dependencies: 857 | get-intrinsic: 1.1.3 858 | dev: true 859 | 860 | /has-symbols/1.0.3: 861 | resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} 862 | engines: {node: '>= 0.4'} 863 | dev: true 864 | 865 | /has-tostringtag/1.0.0: 866 | resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} 867 | engines: {node: '>= 0.4'} 868 | dependencies: 869 | has-symbols: 1.0.3 870 | dev: true 871 | 872 | /has/1.0.3: 873 | resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} 874 | engines: {node: '>= 0.4.0'} 875 | dependencies: 876 | function-bind: 1.1.1 877 | dev: true 878 | 879 | /ignore/5.2.0: 880 | resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} 881 | engines: {node: '>= 4'} 882 | dev: true 883 | 884 | /import-fresh/3.3.0: 885 | resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} 886 | engines: {node: '>=6'} 887 | dependencies: 888 | parent-module: 1.0.1 889 | resolve-from: 4.0.0 890 | dev: true 891 | 892 | /imurmurhash/0.1.4: 893 | resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} 894 | engines: {node: '>=0.8.19'} 895 | dev: true 896 | 897 | /inflight/1.0.6: 898 | resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} 899 | dependencies: 900 | once: 1.4.0 901 | wrappy: 1.0.2 902 | dev: true 903 | 904 | /inherits/2.0.4: 905 | resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} 906 | dev: true 907 | 908 | /internal-slot/1.0.3: 909 | resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} 910 | engines: {node: '>= 0.4'} 911 | dependencies: 912 | get-intrinsic: 1.1.3 913 | has: 1.0.3 914 | side-channel: 1.0.4 915 | dev: true 916 | 917 | /is-bigint/1.0.4: 918 | resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} 919 | dependencies: 920 | has-bigints: 1.0.2 921 | dev: true 922 | 923 | /is-boolean-object/1.1.2: 924 | resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} 925 | engines: {node: '>= 0.4'} 926 | dependencies: 927 | call-bind: 1.0.2 928 | has-tostringtag: 1.0.0 929 | dev: true 930 | 931 | /is-callable/1.2.7: 932 | resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} 933 | engines: {node: '>= 0.4'} 934 | dev: true 935 | 936 | /is-core-module/2.11.0: 937 | resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} 938 | dependencies: 939 | has: 1.0.3 940 | dev: true 941 | 942 | /is-date-object/1.0.5: 943 | resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} 944 | engines: {node: '>= 0.4'} 945 | dependencies: 946 | has-tostringtag: 1.0.0 947 | dev: true 948 | 949 | /is-extglob/2.1.1: 950 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 951 | engines: {node: '>=0.10.0'} 952 | dev: true 953 | 954 | /is-glob/4.0.3: 955 | resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 956 | engines: {node: '>=0.10.0'} 957 | dependencies: 958 | is-extglob: 2.1.1 959 | dev: true 960 | 961 | /is-negative-zero/2.0.2: 962 | resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} 963 | engines: {node: '>= 0.4'} 964 | dev: true 965 | 966 | /is-number-object/1.0.7: 967 | resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} 968 | engines: {node: '>= 0.4'} 969 | dependencies: 970 | has-tostringtag: 1.0.0 971 | dev: true 972 | 973 | /is-number/7.0.0: 974 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 975 | engines: {node: '>=0.12.0'} 976 | dev: true 977 | 978 | /is-path-inside/3.0.3: 979 | resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} 980 | engines: {node: '>=8'} 981 | dev: true 982 | 983 | /is-regex/1.1.4: 984 | resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} 985 | engines: {node: '>= 0.4'} 986 | dependencies: 987 | call-bind: 1.0.2 988 | has-tostringtag: 1.0.0 989 | dev: true 990 | 991 | /is-shared-array-buffer/1.0.2: 992 | resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} 993 | dependencies: 994 | call-bind: 1.0.2 995 | dev: true 996 | 997 | /is-string/1.0.7: 998 | resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} 999 | engines: {node: '>= 0.4'} 1000 | dependencies: 1001 | has-tostringtag: 1.0.0 1002 | dev: true 1003 | 1004 | /is-symbol/1.0.4: 1005 | resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} 1006 | engines: {node: '>= 0.4'} 1007 | dependencies: 1008 | has-symbols: 1.0.3 1009 | dev: true 1010 | 1011 | /is-weakref/1.0.2: 1012 | resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} 1013 | dependencies: 1014 | call-bind: 1.0.2 1015 | dev: true 1016 | 1017 | /isexe/2.0.0: 1018 | resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} 1019 | dev: true 1020 | 1021 | /js-sdsl/4.1.5: 1022 | resolution: {integrity: sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==} 1023 | dev: true 1024 | 1025 | /js-yaml/4.1.0: 1026 | resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} 1027 | hasBin: true 1028 | dependencies: 1029 | argparse: 2.0.1 1030 | dev: true 1031 | 1032 | /json-schema-traverse/0.4.1: 1033 | resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} 1034 | dev: true 1035 | 1036 | /json-stable-stringify-without-jsonify/1.0.1: 1037 | resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} 1038 | dev: true 1039 | 1040 | /json5/1.0.1: 1041 | resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} 1042 | hasBin: true 1043 | dependencies: 1044 | minimist: 1.2.7 1045 | dev: true 1046 | 1047 | /levn/0.4.1: 1048 | resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} 1049 | engines: {node: '>= 0.8.0'} 1050 | dependencies: 1051 | prelude-ls: 1.2.1 1052 | type-check: 0.4.0 1053 | dev: true 1054 | 1055 | /locate-path/6.0.0: 1056 | resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} 1057 | engines: {node: '>=10'} 1058 | dependencies: 1059 | p-locate: 5.0.0 1060 | dev: true 1061 | 1062 | /lodash.merge/4.6.2: 1063 | resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} 1064 | dev: true 1065 | 1066 | /lru-cache/6.0.0: 1067 | resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} 1068 | engines: {node: '>=10'} 1069 | dependencies: 1070 | yallist: 4.0.0 1071 | dev: true 1072 | 1073 | /merge2/1.4.1: 1074 | resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} 1075 | engines: {node: '>= 8'} 1076 | dev: true 1077 | 1078 | /micromatch/4.0.5: 1079 | resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} 1080 | engines: {node: '>=8.6'} 1081 | dependencies: 1082 | braces: 3.0.2 1083 | picomatch: 2.3.1 1084 | dev: true 1085 | 1086 | /minimatch/3.1.2: 1087 | resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} 1088 | dependencies: 1089 | brace-expansion: 1.1.11 1090 | dev: true 1091 | 1092 | /minimist/1.2.7: 1093 | resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} 1094 | dev: true 1095 | 1096 | /ms/2.0.0: 1097 | resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} 1098 | dev: true 1099 | 1100 | /ms/2.1.2: 1101 | resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} 1102 | dev: true 1103 | 1104 | /natural-compare-lite/1.4.0: 1105 | resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} 1106 | dev: true 1107 | 1108 | /natural-compare/1.4.0: 1109 | resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} 1110 | dev: true 1111 | 1112 | /object-inspect/1.12.2: 1113 | resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} 1114 | dev: true 1115 | 1116 | /object-keys/1.1.1: 1117 | resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} 1118 | engines: {node: '>= 0.4'} 1119 | dev: true 1120 | 1121 | /object.assign/4.1.4: 1122 | resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} 1123 | engines: {node: '>= 0.4'} 1124 | dependencies: 1125 | call-bind: 1.0.2 1126 | define-properties: 1.1.4 1127 | has-symbols: 1.0.3 1128 | object-keys: 1.1.1 1129 | dev: true 1130 | 1131 | /object.entries/1.1.5: 1132 | resolution: {integrity: sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==} 1133 | engines: {node: '>= 0.4'} 1134 | dependencies: 1135 | call-bind: 1.0.2 1136 | define-properties: 1.1.4 1137 | es-abstract: 1.20.4 1138 | dev: true 1139 | 1140 | /object.values/1.1.5: 1141 | resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} 1142 | engines: {node: '>= 0.4'} 1143 | dependencies: 1144 | call-bind: 1.0.2 1145 | define-properties: 1.1.4 1146 | es-abstract: 1.20.4 1147 | dev: true 1148 | 1149 | /once/1.4.0: 1150 | resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} 1151 | dependencies: 1152 | wrappy: 1.0.2 1153 | dev: true 1154 | 1155 | /optionator/0.9.1: 1156 | resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} 1157 | engines: {node: '>= 0.8.0'} 1158 | dependencies: 1159 | deep-is: 0.1.4 1160 | fast-levenshtein: 2.0.6 1161 | levn: 0.4.1 1162 | prelude-ls: 1.2.1 1163 | type-check: 0.4.0 1164 | word-wrap: 1.2.3 1165 | dev: true 1166 | 1167 | /p-limit/3.1.0: 1168 | resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} 1169 | engines: {node: '>=10'} 1170 | dependencies: 1171 | yocto-queue: 0.1.0 1172 | dev: true 1173 | 1174 | /p-locate/5.0.0: 1175 | resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} 1176 | engines: {node: '>=10'} 1177 | dependencies: 1178 | p-limit: 3.1.0 1179 | dev: true 1180 | 1181 | /parent-module/1.0.1: 1182 | resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} 1183 | engines: {node: '>=6'} 1184 | dependencies: 1185 | callsites: 3.1.0 1186 | dev: true 1187 | 1188 | /path-exists/4.0.0: 1189 | resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} 1190 | engines: {node: '>=8'} 1191 | dev: true 1192 | 1193 | /path-is-absolute/1.0.1: 1194 | resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} 1195 | engines: {node: '>=0.10.0'} 1196 | dev: true 1197 | 1198 | /path-key/3.1.1: 1199 | resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} 1200 | engines: {node: '>=8'} 1201 | dev: true 1202 | 1203 | /path-parse/1.0.7: 1204 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} 1205 | dev: true 1206 | 1207 | /path-type/4.0.0: 1208 | resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} 1209 | engines: {node: '>=8'} 1210 | dev: true 1211 | 1212 | /picomatch/2.3.1: 1213 | resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 1214 | engines: {node: '>=8.6'} 1215 | dev: true 1216 | 1217 | /prelude-ls/1.2.1: 1218 | resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} 1219 | engines: {node: '>= 0.8.0'} 1220 | dev: true 1221 | 1222 | /prettier-linter-helpers/1.0.0: 1223 | resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} 1224 | engines: {node: '>=6.0.0'} 1225 | dependencies: 1226 | fast-diff: 1.2.0 1227 | dev: true 1228 | 1229 | /prettier/2.7.1: 1230 | resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} 1231 | engines: {node: '>=10.13.0'} 1232 | hasBin: true 1233 | dev: true 1234 | 1235 | /punycode/2.1.1: 1236 | resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} 1237 | engines: {node: '>=6'} 1238 | dev: true 1239 | 1240 | /queue-microtask/1.2.3: 1241 | resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 1242 | dev: true 1243 | 1244 | /regexp.prototype.flags/1.4.3: 1245 | resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} 1246 | engines: {node: '>= 0.4'} 1247 | dependencies: 1248 | call-bind: 1.0.2 1249 | define-properties: 1.1.4 1250 | functions-have-names: 1.2.3 1251 | dev: true 1252 | 1253 | /regexpp/3.2.0: 1254 | resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} 1255 | engines: {node: '>=8'} 1256 | dev: true 1257 | 1258 | /resolve-from/4.0.0: 1259 | resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} 1260 | engines: {node: '>=4'} 1261 | dev: true 1262 | 1263 | /resolve/1.22.1: 1264 | resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} 1265 | hasBin: true 1266 | dependencies: 1267 | is-core-module: 2.11.0 1268 | path-parse: 1.0.7 1269 | supports-preserve-symlinks-flag: 1.0.0 1270 | dev: true 1271 | 1272 | /reusify/1.0.4: 1273 | resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} 1274 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 1275 | dev: true 1276 | 1277 | /rimraf/3.0.2: 1278 | resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} 1279 | hasBin: true 1280 | dependencies: 1281 | glob: 7.2.3 1282 | dev: true 1283 | 1284 | /run-parallel/1.2.0: 1285 | resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 1286 | dependencies: 1287 | queue-microtask: 1.2.3 1288 | dev: true 1289 | 1290 | /safe-regex-test/1.0.0: 1291 | resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} 1292 | dependencies: 1293 | call-bind: 1.0.2 1294 | get-intrinsic: 1.1.3 1295 | is-regex: 1.1.4 1296 | dev: true 1297 | 1298 | /semver/6.3.0: 1299 | resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} 1300 | hasBin: true 1301 | dev: true 1302 | 1303 | /semver/7.3.8: 1304 | resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} 1305 | engines: {node: '>=10'} 1306 | hasBin: true 1307 | dependencies: 1308 | lru-cache: 6.0.0 1309 | dev: true 1310 | 1311 | /shebang-command/2.0.0: 1312 | resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} 1313 | engines: {node: '>=8'} 1314 | dependencies: 1315 | shebang-regex: 3.0.0 1316 | dev: true 1317 | 1318 | /shebang-regex/3.0.0: 1319 | resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} 1320 | engines: {node: '>=8'} 1321 | dev: true 1322 | 1323 | /side-channel/1.0.4: 1324 | resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} 1325 | dependencies: 1326 | call-bind: 1.0.2 1327 | get-intrinsic: 1.1.3 1328 | object-inspect: 1.12.2 1329 | dev: true 1330 | 1331 | /slash/3.0.0: 1332 | resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} 1333 | engines: {node: '>=8'} 1334 | dev: true 1335 | 1336 | /string.prototype.trimend/1.0.5: 1337 | resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==} 1338 | dependencies: 1339 | call-bind: 1.0.2 1340 | define-properties: 1.1.4 1341 | es-abstract: 1.20.4 1342 | dev: true 1343 | 1344 | /string.prototype.trimstart/1.0.5: 1345 | resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==} 1346 | dependencies: 1347 | call-bind: 1.0.2 1348 | define-properties: 1.1.4 1349 | es-abstract: 1.20.4 1350 | dev: true 1351 | 1352 | /strip-ansi/6.0.1: 1353 | resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} 1354 | engines: {node: '>=8'} 1355 | dependencies: 1356 | ansi-regex: 5.0.1 1357 | dev: true 1358 | 1359 | /strip-bom/3.0.0: 1360 | resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} 1361 | engines: {node: '>=4'} 1362 | dev: true 1363 | 1364 | /strip-json-comments/3.1.1: 1365 | resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} 1366 | engines: {node: '>=8'} 1367 | dev: true 1368 | 1369 | /supports-color/7.2.0: 1370 | resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 1371 | engines: {node: '>=8'} 1372 | dependencies: 1373 | has-flag: 4.0.0 1374 | dev: true 1375 | 1376 | /supports-preserve-symlinks-flag/1.0.0: 1377 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} 1378 | engines: {node: '>= 0.4'} 1379 | dev: true 1380 | 1381 | /text-table/0.2.0: 1382 | resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} 1383 | dev: true 1384 | 1385 | /to-regex-range/5.0.1: 1386 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 1387 | engines: {node: '>=8.0'} 1388 | dependencies: 1389 | is-number: 7.0.0 1390 | dev: true 1391 | 1392 | /ts-arithmetic/0.1.1: 1393 | resolution: {integrity: sha512-3VqgsRgzaYfj+zKWn+7O66ifHwbOOnT2BoOrHwdEUBz7az0DetoZOS20+juNJh1klgzvWEi2Qxden41pomOUAQ==} 1394 | dev: false 1395 | 1396 | /tsconfig-paths/3.14.1: 1397 | resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} 1398 | dependencies: 1399 | '@types/json5': 0.0.29 1400 | json5: 1.0.1 1401 | minimist: 1.2.7 1402 | strip-bom: 3.0.0 1403 | dev: true 1404 | 1405 | /tslib/1.14.1: 1406 | resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} 1407 | dev: true 1408 | 1409 | /tslib/2.4.1: 1410 | resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} 1411 | dev: false 1412 | 1413 | /tsutils/3.21.0_typescript@4.8.4: 1414 | resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} 1415 | engines: {node: '>= 6'} 1416 | peerDependencies: 1417 | typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' 1418 | dependencies: 1419 | tslib: 1.14.1 1420 | typescript: 4.8.4 1421 | dev: true 1422 | 1423 | /type-check/0.4.0: 1424 | resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} 1425 | engines: {node: '>= 0.8.0'} 1426 | dependencies: 1427 | prelude-ls: 1.2.1 1428 | dev: true 1429 | 1430 | /type-fest/0.20.2: 1431 | resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} 1432 | engines: {node: '>=10'} 1433 | dev: true 1434 | 1435 | /typescript/4.8.4: 1436 | resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} 1437 | engines: {node: '>=4.2.0'} 1438 | hasBin: true 1439 | dev: true 1440 | 1441 | /unbox-primitive/1.0.2: 1442 | resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} 1443 | dependencies: 1444 | call-bind: 1.0.2 1445 | has-bigints: 1.0.2 1446 | has-symbols: 1.0.3 1447 | which-boxed-primitive: 1.0.2 1448 | dev: true 1449 | 1450 | /uri-js/4.4.1: 1451 | resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} 1452 | dependencies: 1453 | punycode: 2.1.1 1454 | dev: true 1455 | 1456 | /which-boxed-primitive/1.0.2: 1457 | resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} 1458 | dependencies: 1459 | is-bigint: 1.0.4 1460 | is-boolean-object: 1.1.2 1461 | is-number-object: 1.0.7 1462 | is-string: 1.0.7 1463 | is-symbol: 1.0.4 1464 | dev: true 1465 | 1466 | /which/2.0.2: 1467 | resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} 1468 | engines: {node: '>= 8'} 1469 | hasBin: true 1470 | dependencies: 1471 | isexe: 2.0.0 1472 | dev: true 1473 | 1474 | /word-wrap/1.2.3: 1475 | resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} 1476 | engines: {node: '>=0.10.0'} 1477 | dev: true 1478 | 1479 | /wrappy/1.0.2: 1480 | resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} 1481 | dev: true 1482 | 1483 | /yallist/4.0.0: 1484 | resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} 1485 | dev: true 1486 | 1487 | /yocto-queue/0.1.0: 1488 | resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 1489 | engines: {node: '>=10'} 1490 | dev: true 1491 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export type { JSON, JSONPrimitive } from './parser'; 2 | -------------------------------------------------------------------------------- /src/parser.ts: -------------------------------------------------------------------------------- 1 | import type { ToPrimitive } from './primitive'; 2 | import type { GetFirstToken, Tokenize } from './tokenizer'; 3 | import type { 4 | Colon, 5 | Comma, 6 | IToken, 7 | Keyword, 8 | LBrace, 9 | LBracket, 10 | Number, 11 | RBrace, 12 | RBracket, 13 | String, 14 | } from './tokens'; 15 | import type { IfNot, SetProperty, JSONObject } from './utils'; 16 | 17 | /** 18 | * Parses a JSON string. 19 | * 20 | * Returns a tuple `[U, V]`. 21 | * 22 | * - U: The parsed string content. 23 | * - V: The remaining of `T` without `U`. 24 | * 25 | * @param T A list of tokens to parse. 26 | * @returns The resulted tuple. 27 | */ 28 | export type ParseString = IfNot< 29 | GetFirstToken, 30 | never, 31 | GetFirstToken[0]['type'] extends String 32 | ? [GetFirstToken[0]['val'], GetFirstToken[1]] 33 | : never 34 | >; 35 | 36 | /** 37 | * Parses a JSON keyword from `T`. 38 | * 39 | * Returns a tuple `[U, V]`. 40 | * 41 | * - U: The keyword value `true`, `false` or `null`. Can be `never` if invalid. 42 | * - V: The remainings of `T` without `U`. 43 | * 44 | * @param T A list of tokens to parse from. 45 | * @returns The resulted tuple. 46 | */ 47 | export type ParseKeyword = IfNot< 48 | GetFirstToken, 49 | never, 50 | GetFirstToken[0]['type'] extends Keyword 51 | ? GetFirstToken[0]['val'] extends 'true' 52 | ? [true, GetFirstToken[1]] 53 | : GetFirstToken[0]['val'] extends 'false' 54 | ? [false, GetFirstToken[1]] 55 | : GetFirstToken[0]['val'] extends 'null' 56 | ? [null, GetFirstToken[1]] 57 | : never 58 | : never 59 | >; 60 | 61 | /** 62 | * Parses a JSON key-value pair from `T`. 63 | * 64 | * Returns a tuple `[U, V]`. 65 | * 66 | * - U: A tuple `[K, W]`. 67 | * - K: The key of current key-value pair. 68 | * - W: The value of current key-value pair, may be any literal type. 69 | * - V: The remaining tokens from `T` stripping tokens of `U`. 70 | * 71 | * @param T A list of tokens to parse from. 72 | * @returns The resulted tuple. 73 | */ 74 | export type ParseKeyValuePair = IfNot< 75 | ParseString, 76 | never, 77 | IfNot< 78 | GetFirstToken[1]>, 79 | never, 80 | GetFirstToken[1]>[0]['type'] extends Colon 81 | ? ParseLiteral[1]>[1]> extends never 82 | ? never 83 | : [ 84 | [ParseString[0], ParseLiteral[1]>[1]>[0]], 85 | ParseLiteral[1]>[1]>[1], 86 | ] 87 | : never 88 | > 89 | >; 90 | 91 | /** 92 | * Recursively parses a JSON record. 93 | * 94 | * @internal 95 | * @see ParseObject 96 | * 97 | * @param T A list of tokens to parse. 98 | * @param C Temporary object for storing processed values. 99 | * @returns The resulted tuple. 100 | */ 101 | type ParseObjectImpl = IfNot< 102 | ParseKeyValuePair, 103 | never, 104 | IfNot< 105 | GetFirstToken[1]>, 106 | never, 107 | GetFirstToken[1]>[0]['type'] extends RBrace 108 | ? [ 109 | SetProperty[0][0], ParseKeyValuePair[0][1]>, 110 | GetFirstToken[1]>[1], 111 | ] 112 | : GetFirstToken[1]>[0]['type'] extends Comma 113 | ? ParseObjectImpl< 114 | GetFirstToken[1]>[1], 115 | SetProperty[0][0], ParseKeyValuePair[0][1]> 116 | > 117 | : never 118 | > 119 | >; 120 | 121 | /** 122 | * Parses a JSON record. 123 | * 124 | * Returns a tuple `[U, V]`. 125 | * 126 | * - U: The processed record object. 127 | * - V: Remainings from `T` without `U`. 128 | * 129 | * @param T A list of tokens to parse. 130 | * @returns The resulted tuple. 131 | */ 132 | export type ParseObject = T extends [infer U, ...infer V] 133 | ? U extends IToken 134 | ? V extends IToken[] 135 | ? U['type'] extends RBrace 136 | ? [{}, V] 137 | : ParseObjectImpl 138 | : never 139 | : never 140 | : never; 141 | 142 | /** 143 | * Recursively parses a JSON array. 144 | * 145 | * @internal 146 | * @see ParseArray 147 | * 148 | * @param T A list of tokens to parse. 149 | * @param C Temporary storage for processed array items. 150 | * @returns The resulted tuple. 151 | */ 152 | type ParseArrayImpl = IfNot< 153 | ParseLiteral, 154 | never, 155 | IfNot< 156 | GetFirstToken[1]>, 157 | never, 158 | GetFirstToken[1]>[0]['type'] extends Comma 159 | ? ParseArrayImpl[1]>[1], [...C, ParseLiteral[0]]> 160 | : GetFirstToken[1]>[0]['type'] extends RBracket 161 | ? [[...C, ParseLiteral[0]], GetFirstToken[1]>[1]] 162 | : never 163 | > 164 | >; 165 | 166 | /** 167 | * Parses a JSON array. 168 | * 169 | * Returns a tuple `[U, V]`. 170 | * 171 | * - U: The processed array of literals. 172 | * - V The remaining tokens of `T` without `U`. 173 | * 174 | * @param T A list of tokens to parse. 175 | * @returns The resulted tuple. 176 | */ 177 | export type ParseArray = T extends [infer U, ...infer V] 178 | ? [U, V] extends [IToken, IToken[]] 179 | ? [U, V][0]['type'] extends RBracket 180 | ? [[], V] 181 | : ParseArrayImpl 182 | : never 183 | : never; 184 | 185 | /** 186 | * Parses a JSON number. 187 | * 188 | * Returns a tuple `[U, V]`. 189 | * 190 | * - U: The number value. 191 | * - V: The remaining tokens from `T` without `U`. 192 | * 193 | * @param T A list of tokens to parse. 194 | * @returns The resulted tuple. 195 | */ 196 | export type ParseNumber = IfNot< 197 | GetFirstToken, 198 | never, 199 | GetFirstToken[0]['type'] extends Number 200 | ? [GetFirstToken[0]['val'], GetFirstToken[1]] 201 | : never 202 | >; 203 | 204 | /** 205 | * Parses a JSON root. 206 | * 207 | * A JSON root can be either an object or an array, in which these 208 | * are the top-most building blocks of JSON. 209 | * 210 | * @see ParseObject 211 | * @see ParseArray 212 | * 213 | * @param T A list of tokens to parse. 214 | * @returns The processed object or array. 215 | */ 216 | export type ParseRoot = IfNot< 217 | GetFirstToken, 218 | never, 219 | GetFirstToken[0]['type'] extends LBrace 220 | ? ParseObject[1]> 221 | : GetFirstToken[0]['type'] extends LBracket 222 | ? ParseArray[1]> 223 | : never 224 | >; 225 | 226 | /** 227 | * Parses a JSON literal. 228 | * 229 | * A JSON literal can be one of: 230 | * 231 | * - JSON object 232 | * - JSON array 233 | * - JSON string 234 | * - JSON number 235 | * - JSON keyword 236 | * 237 | * A plain JSON object is also a valid JSON literal. 238 | * 239 | * @see ParseRoot 240 | * @see ParseString 241 | * @see ParseKeyword 242 | * @see ParseNumber 243 | * 244 | * @param T A list of tokens to parse. 245 | * @returns The parsed result. 246 | */ 247 | export type ParseLiteral = 248 | | ParseRoot 249 | | ParseString 250 | | ParseKeyword 251 | | ParseNumber; 252 | 253 | /** 254 | * Convert a string to a typed object. 255 | * 256 | * @param T The JSON string to convert. 257 | * @returns The converted JSON type object. 258 | */ 259 | export type JSON = JSONObject>[0]>; 260 | 261 | /** 262 | * Convert a string to a typed object, where each field is a 263 | * primitive representation of the actual value. 264 | * 265 | * @param T The JSON string to convert. 266 | * @returns The converted primitive JSON type object. 267 | */ 268 | export type JSONPrimitive = ToPrimitive>; 269 | -------------------------------------------------------------------------------- /src/primitive.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Converts a literal type to a primitive type. 3 | * 4 | * @param T The literal to convert. 5 | * @returns The converted primitive variant of `T`. 6 | */ 7 | export type ToPrimitive = { 8 | [K in keyof T]: T[K] extends object 9 | ? ToPrimitive 10 | : T[K] extends string 11 | ? string 12 | : T[K] extends number 13 | ? number 14 | : T[K] extends boolean 15 | ? boolean 16 | : T[K] extends null 17 | ? null 18 | : never; 19 | }; 20 | -------------------------------------------------------------------------------- /src/tokenizer.ts: -------------------------------------------------------------------------------- 1 | import type { Add, Multiply } from 'ts-arithmetic'; 2 | import type { 3 | Alpha, 4 | Colon, 5 | Comma, 6 | IToken, 7 | Keyword, 8 | LBrace, 9 | LBracket, 10 | Number, 11 | RBrace, 12 | RBracket, 13 | String, 14 | Token, 15 | } from './tokens'; 16 | import type { IfNot, ConvertToNumber } from './utils'; 17 | 18 | /** 19 | * Get the string content from `T`. 20 | * @param T The JSON string to extract strings from. 21 | * @param C Temporary storage for processed strings. 22 | * @returns The extracted string content from the beginning of `T`, or `never` if `T` does not begin with a JSON string. 23 | */ 24 | export type GetStringContent< 25 | T extends string, 26 | C extends string = '', 27 | > = T extends `${infer U}${infer V}` 28 | ? // transpiles escape characters 29 | U extends '\\' 30 | ? V extends `${infer R}${infer F}` 31 | ? R extends '"' 32 | ? GetStringContent 33 | : R extends '\\' 34 | ? GetStringContent 35 | : R extends 'n' 36 | ? GetStringContent 37 | : R extends 'r' 38 | ? GetStringContent 39 | : R extends 't' 40 | ? GetStringContent 41 | : never 42 | : never 43 | : U extends '"' 44 | ? [Token, V] 45 | : GetStringContent 46 | : never; 47 | 48 | /** 49 | * Get keyword content from `T`. 50 | * 51 | * Keywords extracted here may not be correct as this is simply a 52 | * pattern-matching function. E.g.: 53 | * 54 | * ```json 55 | * { 56 | * "key": value 57 | * } 58 | * ``` 59 | * 60 | * Can still be validly extract by this function, meaning that the 61 | * keyword is not validated. 62 | * 63 | * @see ParseKeyword 64 | * 65 | * @param T The JSON string to extract keywords from. 66 | * @param C Temporary storage for processed keywords. 67 | * @returns A keyword token taken from the beginning of `T` or `never` if `T` does not begin with a keyword-like pattern. 68 | */ 69 | export type GetKeywordContent< 70 | T extends string, 71 | C extends string = '', 72 | > = T extends `${infer U}${infer V}` 73 | ? U extends Alpha 74 | ? GetKeywordContent 75 | : IfNot, T]> 76 | : IfNot, T]>; 77 | 78 | /** 79 | * Get the actual number content from `T`. 80 | * @param T The JSON string to extract number from. 81 | * @param C Temporary storage for processed numbers. 82 | * @returns A number taken from the beginning of `T` or `never` if `T` does not begin with a number. 83 | */ 84 | export type GetNumberContent< 85 | T extends string, 86 | C extends number = 0, 87 | > = T extends `${infer U}${infer V}` 88 | ? U extends Number 89 | ? GetNumberContent, ConvertToNumber>> 90 | : IfNot, T]> 91 | : IfNot, T]>; 92 | 93 | /** 94 | * Tokenize a given JSON string. 95 | * @param T The JSON string to tokenize. 96 | * @param C The temporary storage for processed tokens. 97 | * @returns A list of tokens processed, or `never` if `T` is invalid. 98 | */ 99 | export type Tokenize = T extends `${infer U}${infer V}` 100 | ? U extends '\n' | '\r' | '\t' | ' ' 101 | ? Tokenize 102 | : U extends LBrace 103 | ? Tokenize]> 104 | : U extends RBrace 105 | ? Tokenize]> 106 | : U extends LBracket 107 | ? Tokenize]> 108 | : U extends RBracket 109 | ? Tokenize]> 110 | : U extends Comma 111 | ? Tokenize]> 112 | : U extends Colon 113 | ? Tokenize]> 114 | : U extends String 115 | ? GetStringContent extends [IToken, string] 116 | ? Tokenize[1], [...C, GetStringContent[0]]> 117 | : never 118 | : U extends Alpha 119 | ? // IMPORTANT: Use `T` instead of `V` to get full keyword content 120 | GetKeywordContent extends [IToken, string] 121 | ? Tokenize[1], [...C, GetKeywordContent[0]]> 122 | : never 123 | : U extends Number 124 | ? GetNumberContent extends [IToken, string] 125 | ? Tokenize[1], [...C, GetNumberContent[0]]> 126 | : never 127 | : never 128 | : C; 129 | 130 | /** 131 | * Take the first token from `T`. 132 | * 133 | * Returns a tuple where the first value is the first token from `T` and the second value being the rest of tokens from `T`. 134 | * 135 | * @param T A list of tokens. 136 | * @returns The resulted tuple. 137 | */ 138 | export type GetFirstToken = T extends [infer U, ...infer V] 139 | ? [U, V] extends [IToken, IToken[]] 140 | ? [U, V] 141 | : never 142 | : never; 143 | -------------------------------------------------------------------------------- /src/tokens.ts: -------------------------------------------------------------------------------- 1 | export type LBrace = '{'; 2 | export type RBrace = '}'; 3 | export type LBracket = '['; 4 | export type RBracket = ']'; 5 | export type String = '"'; 6 | export type Comma = ','; 7 | export type Colon = ':'; 8 | export type Alpha = 9 | | 'a' 10 | | 'b' 11 | | 'c' 12 | | 'd' 13 | | 'e' 14 | | 'f' 15 | | 'g' 16 | | 'h' 17 | | 'i' 18 | | 'j' 19 | | 'k' 20 | | 'l' 21 | | 'm' 22 | | 'n' 23 | | 'o' 24 | | 'p' 25 | | 'q' 26 | | 'r' 27 | | 's' 28 | | 't' 29 | | 'u' 30 | | 'v' 31 | | 'w' 32 | | 'x' 33 | | 'y' 34 | | 'z'; 35 | export type Number = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; 36 | 37 | export type Keyword = 'true' | 'false' | 'null'; 38 | 39 | export type TokenType = 40 | | LBrace 41 | | RBrace 42 | | LBracket 43 | | RBracket 44 | | String 45 | | Colon 46 | | Comma 47 | | Alpha 48 | | Keyword 49 | | Number; 50 | 51 | export interface IToken { 52 | type: TokenType; 53 | val?: any; 54 | } 55 | 56 | export type Token = { 57 | type: T; 58 | val: V; 59 | }; 60 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import type { Number } from './tokens'; 2 | 3 | export type IfNot = C extends Q ? never : U; 4 | 5 | export type SetProperty = { 6 | [P in keyof T | K]: P extends K ? V : P extends keyof T ? T[P] : never; 7 | }; 8 | 9 | export type JSONObject = T extends object 10 | ? { 11 | [P in keyof T]: JSONObject; 12 | } 13 | : T; 14 | 15 | export type ConvertToNumber = T extends '0' 16 | ? 0 17 | : T extends '1' 18 | ? 1 19 | : T extends '2' 20 | ? 2 21 | : T extends '3' 22 | ? 3 23 | : T extends '4' 24 | ? 4 25 | : T extends '5' 26 | ? 5 27 | : T extends '6' 28 | ? 6 29 | : T extends '7' 30 | ? 7 31 | : T extends '8' 32 | ? 8 33 | : T extends '9' 34 | ? 9 35 | : never; 36 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "sourceMap": true, 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["src/**/*", ".eslintrc.js"], 8 | "exclude": ["node_modules", "**/*.spec.ts"] 9 | } 10 | --------------------------------------------------------------------------------