├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── eslint.config.mjs ├── package.json ├── pnpm-lock.yaml ├── src ├── JSONSchemaToZod.ts ├── Type.ts └── index.ts ├── tests ├── JSONSchemaToZod.test.ts ├── conditional.test.ts ├── nullable-anyof.test.ts ├── nullable.test.ts └── undefined-type.test.ts ├── tsconfig.eslint.json ├── tsconfig.json └── vitest.config.ts /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .dev.vars 4 | .env 5 | .DS_Store -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src/ 2 | tests/ 3 | bun.lockb 4 | .env 5 | .dev.vars 6 | .gitignore 7 | .eslintrc 8 | .eslintignore 9 | .npmignore 10 | eslint.config.mjs 11 | tsconfig.json 12 | tsconfig.eslint.json 13 | vitest.config.ts 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # JSON Schema to Zod 3 | 4 | **JSON Schema to Zod is a TypeScript library that converts JSON Schemas into Zod schemas, enabling dynamic validation of data structures.** This utility is particularly useful in scenarios where JSON Schemas are stored in databases and need to be dynamically converted into Zod schemas for validation, providing flexibility in your code. 5 | 6 | ## Installation 7 | 8 | Install the package using pnpm: 9 | 10 | ```bash 11 | pnpm add @dmitryrechkin/json-schema-to-zod 12 | ``` 13 | 14 | ## Features 15 | 16 | - **Dynamic Schema Generation**: Convert JSON Schemas into Zod schemas on the fly, making your code more adaptable to changing data structures. 17 | - **Supports Complex Schemas**: Handles various schema types, including strings, numbers, objects, arrays, and combinators like `oneOf`, `anyOf`, and `allOf`. 18 | - **Serverless Ready**: Works seamlessly in serverless environments like Cloudflare Workers. 19 | - **No Alternatives**: While the popular `json-schema-to-typescript` is designed for generating static TypeScript types from JSON Schemas, it falls short in dynamic use cases where schemas need to be generated and used at runtime. This limitation makes it less flexible for scenarios where JSON Schemas are stored in databases or require real-time validation, which is where `@dmitryrechkin/json-schema-to-zod` excels. 20 | 21 | ## Usage 22 | 23 | ### Basic Conversion 24 | 25 | ```typescript 26 | import { JSONSchemaToZod } from '@dmitryrechkin/json-schema-to-zod'; 27 | 28 | const jsonSchema = { 29 | type: 'object', 30 | properties: { 31 | name: { type: 'string' }, 32 | age: { type: 'number', minimum: 0 }, 33 | }, 34 | required: ['name', 'age'], 35 | }; 36 | 37 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 38 | 39 | // Now you can use `zodSchema` to validate data 40 | const parsedData = zodSchema.parse({ 41 | name: 'John Doe', 42 | age: 30, 43 | }); 44 | 45 | console.log(parsedData); 46 | // Output: { name: 'John Doe', age: 30 } 47 | ``` 48 | 49 | ### Handling Complex Schemas 50 | 51 | ```typescript 52 | const complexJsonSchema = { 53 | type: 'object', 54 | properties: { 55 | name: { type: 'string' }, 56 | contact: { 57 | type: 'object', 58 | properties: { 59 | email: { type: 'string', format: 'email' }, 60 | phone: { type: 'string', pattern: '^\+?[1-9]\d{1,14}$' } 61 | }, 62 | required: ['email'] 63 | }, 64 | }, 65 | required: ['name'], 66 | }; 67 | 68 | const complexZodSchema = JSONSchemaToZod.convert(complexJsonSchema); 69 | 70 | // Validate complex data structures dynamically 71 | const complexParsedData = complexZodSchema.parse({ 72 | name: 'Jane Doe', 73 | contact: { 74 | email: 'jane.doe@example.com', 75 | phone: '+1234567890', 76 | }, 77 | }); 78 | 79 | console.log(complexParsedData); 80 | // Output: { name: 'Jane Doe', contact: { email: 'jane.doe@example.com', phone: '+1234567890' } } 81 | ``` 82 | 83 | ### Using Combinators 84 | 85 | ```typescript 86 | const combinatorJsonSchema = { 87 | oneOf: [ 88 | { type: 'string' }, 89 | { type: 'number' }, 90 | ] 91 | }; 92 | 93 | const combinatorZodSchema = JSONSchemaToZod.convert(combinatorJsonSchema); 94 | 95 | // Validate data that can be of multiple types 96 | console.log(combinatorZodSchema.parse('Hello World')); 97 | // Output: "Hello World" 98 | 99 | console.log(combinatorZodSchema.parse(42)); 100 | // Output: 42 101 | ``` 102 | 103 | ## Rationale 104 | 105 | The `JSONSchemaToZod` class is designed to dynamically generate Zod schemas from JSON Schemas, which can be particularly useful in environments where JSON Schemas are stored in databases and need to be validated at runtime. This approach offers unparalleled flexibility compared to other solutions like `json-schema-to-typescript` that generate static TypeScript types, which are not suitable for dynamic use cases. Additionally, the library is built to work seamlessly in serverless environments like Cloudflare Workers, making it an excellent choice for modern web applications. 106 | 107 | ## Installation & Setup 108 | 109 | Install the package using pnpm: 110 | 111 | ```bash 112 | pnpm add @dmitryrechkin/json-schema-to-zod 113 | ``` 114 | 115 | Ensure that your project is set up to handle TypeScript and supports ES modules, as this library is built with modern JavaScript standards. 116 | 117 | ## Contributing 118 | 119 | Contributions are welcome! Feel free to fork this project and submit pull requests. Before submitting, please ensure your code passes all linting and unit tests. 120 | 121 | You can run unit tests using: 122 | 123 | ```bash 124 | pnpm test 125 | ``` 126 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import eslintConfig from '@dmitryrechkin/eslint-standard/eslint.config.mjs'; 2 | 3 | export default eslintConfig({ 4 | tsconfigPath: './tsconfig.eslint.json', 5 | ignores: ['packages/**', 'tests/**'], 6 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@dmitryrechkin/json-schema-to-zod", 3 | "type": "module", 4 | "version": "1.0.1", 5 | "main": "dist/index.js", 6 | "types": "dist/index.d.ts", 7 | "scripts": { 8 | "lint": "eslint .", 9 | "format": "eslint --fix .", 10 | "test": "vitest run", 11 | "check": "tsc --noEmit", 12 | "build": "shx rm -rf dist && tsc && fix-esm-import-path dist", 13 | "package:publish": "pnpm publish --access public", 14 | "prepublishOnly": "pnpm run build" 15 | }, 16 | "devDependencies": { 17 | "@dmitryrechkin/eslint-standard": "^1.0.7", 18 | "dotenv": "^16.4.5", 19 | "eslint": "^8.0.0", 20 | "eslint-plugin-unused-imports": "^3.0.0", 21 | "fix-esm-import-path": "^1.0.1", 22 | "shx": "^0.3.4", 23 | "tsconfig-paths": "^4.2.0", 24 | "typescript": "^5.5.3", 25 | "vite": "^6.2.1", 26 | "vitest": "^0.24.5" 27 | }, 28 | "dependencies": { 29 | "zod": "^3.23.8" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | dependencies: 11 | zod: 12 | specifier: ^3.23.8 13 | version: 3.23.8 14 | devDependencies: 15 | '@dmitryrechkin/eslint-standard': 16 | specifier: ^1.0.7 17 | version: 1.0.7(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) 18 | dotenv: 19 | specifier: ^16.4.5 20 | version: 16.4.5 21 | eslint: 22 | specifier: ^8.0.0 23 | version: 8.57.0 24 | eslint-plugin-unused-imports: 25 | specifier: ^3.0.0 26 | version: 3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) 27 | fix-esm-import-path: 28 | specifier: ^1.0.1 29 | version: 1.10.0 30 | shx: 31 | specifier: ^0.3.4 32 | version: 0.3.4 33 | tsconfig-paths: 34 | specifier: ^4.2.0 35 | version: 4.2.0 36 | typescript: 37 | specifier: ^5.5.3 38 | version: 5.5.4 39 | vite: 40 | specifier: ^6.2.1 41 | version: 6.2.1(@types/node@20.14.15) 42 | vitest: 43 | specifier: ^0.24.5 44 | version: 0.24.5 45 | 46 | packages: 47 | 48 | '@dmitryrechkin/eslint-standard@1.0.7': 49 | resolution: {integrity: sha512-QtIdXK1kYzpIC4Gr19lt/q/0Cr3mDRVohx5OpNQoc3PUFOh9M3YjnDEf5y/an0fwcILvs3J4H3hA5/b+Fx96Ew==} 50 | peerDependencies: 51 | '@typescript-eslint/eslint-plugin': ^7.0.0 52 | '@typescript-eslint/parser': ^7.0.0 53 | eslint: ^8.0.0 54 | eslint-plugin-unused-imports: ^3.0.0 55 | 56 | '@esbuild/aix-ppc64@0.25.0': 57 | resolution: {integrity: sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==} 58 | engines: {node: '>=18'} 59 | cpu: [ppc64] 60 | os: [aix] 61 | 62 | '@esbuild/android-arm64@0.25.0': 63 | resolution: {integrity: sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==} 64 | engines: {node: '>=18'} 65 | cpu: [arm64] 66 | os: [android] 67 | 68 | '@esbuild/android-arm@0.15.18': 69 | resolution: {integrity: sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==} 70 | engines: {node: '>=12'} 71 | cpu: [arm] 72 | os: [android] 73 | 74 | '@esbuild/android-arm@0.25.0': 75 | resolution: {integrity: sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==} 76 | engines: {node: '>=18'} 77 | cpu: [arm] 78 | os: [android] 79 | 80 | '@esbuild/android-x64@0.25.0': 81 | resolution: {integrity: sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==} 82 | engines: {node: '>=18'} 83 | cpu: [x64] 84 | os: [android] 85 | 86 | '@esbuild/darwin-arm64@0.25.0': 87 | resolution: {integrity: sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==} 88 | engines: {node: '>=18'} 89 | cpu: [arm64] 90 | os: [darwin] 91 | 92 | '@esbuild/darwin-x64@0.25.0': 93 | resolution: {integrity: sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==} 94 | engines: {node: '>=18'} 95 | cpu: [x64] 96 | os: [darwin] 97 | 98 | '@esbuild/freebsd-arm64@0.25.0': 99 | resolution: {integrity: sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==} 100 | engines: {node: '>=18'} 101 | cpu: [arm64] 102 | os: [freebsd] 103 | 104 | '@esbuild/freebsd-x64@0.25.0': 105 | resolution: {integrity: sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==} 106 | engines: {node: '>=18'} 107 | cpu: [x64] 108 | os: [freebsd] 109 | 110 | '@esbuild/linux-arm64@0.25.0': 111 | resolution: {integrity: sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==} 112 | engines: {node: '>=18'} 113 | cpu: [arm64] 114 | os: [linux] 115 | 116 | '@esbuild/linux-arm@0.25.0': 117 | resolution: {integrity: sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==} 118 | engines: {node: '>=18'} 119 | cpu: [arm] 120 | os: [linux] 121 | 122 | '@esbuild/linux-ia32@0.25.0': 123 | resolution: {integrity: sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==} 124 | engines: {node: '>=18'} 125 | cpu: [ia32] 126 | os: [linux] 127 | 128 | '@esbuild/linux-loong64@0.15.18': 129 | resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==} 130 | engines: {node: '>=12'} 131 | cpu: [loong64] 132 | os: [linux] 133 | 134 | '@esbuild/linux-loong64@0.25.0': 135 | resolution: {integrity: sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==} 136 | engines: {node: '>=18'} 137 | cpu: [loong64] 138 | os: [linux] 139 | 140 | '@esbuild/linux-mips64el@0.25.0': 141 | resolution: {integrity: sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==} 142 | engines: {node: '>=18'} 143 | cpu: [mips64el] 144 | os: [linux] 145 | 146 | '@esbuild/linux-ppc64@0.25.0': 147 | resolution: {integrity: sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==} 148 | engines: {node: '>=18'} 149 | cpu: [ppc64] 150 | os: [linux] 151 | 152 | '@esbuild/linux-riscv64@0.25.0': 153 | resolution: {integrity: sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==} 154 | engines: {node: '>=18'} 155 | cpu: [riscv64] 156 | os: [linux] 157 | 158 | '@esbuild/linux-s390x@0.25.0': 159 | resolution: {integrity: sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==} 160 | engines: {node: '>=18'} 161 | cpu: [s390x] 162 | os: [linux] 163 | 164 | '@esbuild/linux-x64@0.25.0': 165 | resolution: {integrity: sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==} 166 | engines: {node: '>=18'} 167 | cpu: [x64] 168 | os: [linux] 169 | 170 | '@esbuild/netbsd-arm64@0.25.0': 171 | resolution: {integrity: sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==} 172 | engines: {node: '>=18'} 173 | cpu: [arm64] 174 | os: [netbsd] 175 | 176 | '@esbuild/netbsd-x64@0.25.0': 177 | resolution: {integrity: sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==} 178 | engines: {node: '>=18'} 179 | cpu: [x64] 180 | os: [netbsd] 181 | 182 | '@esbuild/openbsd-arm64@0.25.0': 183 | resolution: {integrity: sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==} 184 | engines: {node: '>=18'} 185 | cpu: [arm64] 186 | os: [openbsd] 187 | 188 | '@esbuild/openbsd-x64@0.25.0': 189 | resolution: {integrity: sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==} 190 | engines: {node: '>=18'} 191 | cpu: [x64] 192 | os: [openbsd] 193 | 194 | '@esbuild/sunos-x64@0.25.0': 195 | resolution: {integrity: sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==} 196 | engines: {node: '>=18'} 197 | cpu: [x64] 198 | os: [sunos] 199 | 200 | '@esbuild/win32-arm64@0.25.0': 201 | resolution: {integrity: sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==} 202 | engines: {node: '>=18'} 203 | cpu: [arm64] 204 | os: [win32] 205 | 206 | '@esbuild/win32-ia32@0.25.0': 207 | resolution: {integrity: sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==} 208 | engines: {node: '>=18'} 209 | cpu: [ia32] 210 | os: [win32] 211 | 212 | '@esbuild/win32-x64@0.25.0': 213 | resolution: {integrity: sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==} 214 | engines: {node: '>=18'} 215 | cpu: [x64] 216 | os: [win32] 217 | 218 | '@eslint-community/eslint-utils@4.4.0': 219 | resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} 220 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 221 | peerDependencies: 222 | eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 223 | 224 | '@eslint-community/regexpp@4.11.0': 225 | resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} 226 | engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} 227 | 228 | '@eslint/eslintrc@2.1.4': 229 | resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} 230 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 231 | 232 | '@eslint/js@8.57.0': 233 | resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} 234 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 235 | 236 | '@humanwhocodes/config-array@0.11.14': 237 | resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} 238 | engines: {node: '>=10.10.0'} 239 | deprecated: Use @eslint/config-array instead 240 | 241 | '@humanwhocodes/module-importer@1.0.1': 242 | resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} 243 | engines: {node: '>=12.22'} 244 | 245 | '@humanwhocodes/object-schema@2.0.3': 246 | resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} 247 | deprecated: Use @eslint/object-schema instead 248 | 249 | '@nodelib/fs.scandir@2.1.5': 250 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} 251 | engines: {node: '>= 8'} 252 | 253 | '@nodelib/fs.stat@2.0.5': 254 | resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} 255 | engines: {node: '>= 8'} 256 | 257 | '@nodelib/fs.walk@1.2.8': 258 | resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} 259 | engines: {node: '>= 8'} 260 | 261 | '@rollup/rollup-android-arm-eabi@4.35.0': 262 | resolution: {integrity: sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==} 263 | cpu: [arm] 264 | os: [android] 265 | 266 | '@rollup/rollup-android-arm64@4.35.0': 267 | resolution: {integrity: sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==} 268 | cpu: [arm64] 269 | os: [android] 270 | 271 | '@rollup/rollup-darwin-arm64@4.35.0': 272 | resolution: {integrity: sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==} 273 | cpu: [arm64] 274 | os: [darwin] 275 | 276 | '@rollup/rollup-darwin-x64@4.35.0': 277 | resolution: {integrity: sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==} 278 | cpu: [x64] 279 | os: [darwin] 280 | 281 | '@rollup/rollup-freebsd-arm64@4.35.0': 282 | resolution: {integrity: sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==} 283 | cpu: [arm64] 284 | os: [freebsd] 285 | 286 | '@rollup/rollup-freebsd-x64@4.35.0': 287 | resolution: {integrity: sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==} 288 | cpu: [x64] 289 | os: [freebsd] 290 | 291 | '@rollup/rollup-linux-arm-gnueabihf@4.35.0': 292 | resolution: {integrity: sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==} 293 | cpu: [arm] 294 | os: [linux] 295 | 296 | '@rollup/rollup-linux-arm-musleabihf@4.35.0': 297 | resolution: {integrity: sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==} 298 | cpu: [arm] 299 | os: [linux] 300 | 301 | '@rollup/rollup-linux-arm64-gnu@4.35.0': 302 | resolution: {integrity: sha512-uagpnH2M2g2b5iLsCTZ35CL1FgyuzzJQ8L9VtlJ+FckBXroTwNOaD0z0/UF+k5K3aNQjbm8LIVpxykUOQt1m/A==} 303 | cpu: [arm64] 304 | os: [linux] 305 | 306 | '@rollup/rollup-linux-arm64-musl@4.35.0': 307 | resolution: {integrity: sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==} 308 | cpu: [arm64] 309 | os: [linux] 310 | 311 | '@rollup/rollup-linux-loongarch64-gnu@4.35.0': 312 | resolution: {integrity: sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==} 313 | cpu: [loong64] 314 | os: [linux] 315 | 316 | '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': 317 | resolution: {integrity: sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==} 318 | cpu: [ppc64] 319 | os: [linux] 320 | 321 | '@rollup/rollup-linux-riscv64-gnu@4.35.0': 322 | resolution: {integrity: sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==} 323 | cpu: [riscv64] 324 | os: [linux] 325 | 326 | '@rollup/rollup-linux-s390x-gnu@4.35.0': 327 | resolution: {integrity: sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==} 328 | cpu: [s390x] 329 | os: [linux] 330 | 331 | '@rollup/rollup-linux-x64-gnu@4.35.0': 332 | resolution: {integrity: sha512-Pim1T8rXOri+0HmV4CdKSGrqcBWX0d1HoPnQ0uw0bdp1aP5SdQVNBy8LjYncvnLgu3fnnCt17xjWGd4cqh8/hA==} 333 | cpu: [x64] 334 | os: [linux] 335 | 336 | '@rollup/rollup-linux-x64-musl@4.35.0': 337 | resolution: {integrity: sha512-QysqXzYiDvQWfUiTm8XmJNO2zm9yC9P/2Gkrwg2dH9cxotQzunBHYr6jk4SujCTqnfGxduOmQcI7c2ryuW8XVg==} 338 | cpu: [x64] 339 | os: [linux] 340 | 341 | '@rollup/rollup-win32-arm64-msvc@4.35.0': 342 | resolution: {integrity: sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==} 343 | cpu: [arm64] 344 | os: [win32] 345 | 346 | '@rollup/rollup-win32-ia32-msvc@4.35.0': 347 | resolution: {integrity: sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==} 348 | cpu: [ia32] 349 | os: [win32] 350 | 351 | '@rollup/rollup-win32-x64-msvc@4.35.0': 352 | resolution: {integrity: sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==} 353 | cpu: [x64] 354 | os: [win32] 355 | 356 | '@types/chai-subset@1.3.5': 357 | resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} 358 | 359 | '@types/chai@4.3.17': 360 | resolution: {integrity: sha512-zmZ21EWzR71B4Sscphjief5djsLre50M6lI622OSySTmn9DB3j+C3kWroHfBQWXbOBwbgg/M8CG/hUxDLIloow==} 361 | 362 | '@types/estree@1.0.6': 363 | resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} 364 | 365 | '@types/node@20.14.15': 366 | resolution: {integrity: sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==} 367 | 368 | '@typescript-eslint/eslint-plugin@7.18.0': 369 | resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} 370 | engines: {node: ^18.18.0 || >=20.0.0} 371 | peerDependencies: 372 | '@typescript-eslint/parser': ^7.0.0 373 | eslint: ^8.56.0 374 | typescript: '*' 375 | peerDependenciesMeta: 376 | typescript: 377 | optional: true 378 | 379 | '@typescript-eslint/parser@7.18.0': 380 | resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} 381 | engines: {node: ^18.18.0 || >=20.0.0} 382 | peerDependencies: 383 | eslint: ^8.56.0 384 | typescript: '*' 385 | peerDependenciesMeta: 386 | typescript: 387 | optional: true 388 | 389 | '@typescript-eslint/scope-manager@7.18.0': 390 | resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} 391 | engines: {node: ^18.18.0 || >=20.0.0} 392 | 393 | '@typescript-eslint/type-utils@7.18.0': 394 | resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} 395 | engines: {node: ^18.18.0 || >=20.0.0} 396 | peerDependencies: 397 | eslint: ^8.56.0 398 | typescript: '*' 399 | peerDependenciesMeta: 400 | typescript: 401 | optional: true 402 | 403 | '@typescript-eslint/types@7.18.0': 404 | resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} 405 | engines: {node: ^18.18.0 || >=20.0.0} 406 | 407 | '@typescript-eslint/typescript-estree@7.18.0': 408 | resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} 409 | engines: {node: ^18.18.0 || >=20.0.0} 410 | peerDependencies: 411 | typescript: '*' 412 | peerDependenciesMeta: 413 | typescript: 414 | optional: true 415 | 416 | '@typescript-eslint/utils@7.18.0': 417 | resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} 418 | engines: {node: ^18.18.0 || >=20.0.0} 419 | peerDependencies: 420 | eslint: ^8.56.0 421 | 422 | '@typescript-eslint/visitor-keys@7.18.0': 423 | resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} 424 | engines: {node: ^18.18.0 || >=20.0.0} 425 | 426 | '@ungap/structured-clone@1.2.0': 427 | resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} 428 | 429 | acorn-jsx@5.3.2: 430 | resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} 431 | peerDependencies: 432 | acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 433 | 434 | acorn@8.12.1: 435 | resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} 436 | engines: {node: '>=0.4.0'} 437 | hasBin: true 438 | 439 | ajv@6.12.6: 440 | resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} 441 | 442 | ansi-regex@5.0.1: 443 | resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} 444 | engines: {node: '>=8'} 445 | 446 | ansi-styles@4.3.0: 447 | resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 448 | engines: {node: '>=8'} 449 | 450 | argparse@2.0.1: 451 | resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} 452 | 453 | array-union@2.1.0: 454 | resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} 455 | engines: {node: '>=8'} 456 | 457 | assertion-error@1.1.0: 458 | resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} 459 | 460 | balanced-match@1.0.2: 461 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 462 | 463 | brace-expansion@1.1.11: 464 | resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} 465 | 466 | brace-expansion@2.0.1: 467 | resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} 468 | 469 | braces@3.0.3: 470 | resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 471 | engines: {node: '>=8'} 472 | 473 | callsites@3.1.0: 474 | resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} 475 | engines: {node: '>=6'} 476 | 477 | chai@4.5.0: 478 | resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} 479 | engines: {node: '>=4'} 480 | 481 | chalk@4.1.2: 482 | resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} 483 | engines: {node: '>=10'} 484 | 485 | check-error@1.0.3: 486 | resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} 487 | 488 | color-convert@2.0.1: 489 | resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 490 | engines: {node: '>=7.0.0'} 491 | 492 | color-name@1.1.4: 493 | resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} 494 | 495 | concat-map@0.0.1: 496 | resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} 497 | 498 | cross-spawn@7.0.3: 499 | resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} 500 | engines: {node: '>= 8'} 501 | 502 | debug@4.3.6: 503 | resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} 504 | engines: {node: '>=6.0'} 505 | peerDependencies: 506 | supports-color: '*' 507 | peerDependenciesMeta: 508 | supports-color: 509 | optional: true 510 | 511 | deep-eql@4.1.4: 512 | resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} 513 | engines: {node: '>=6'} 514 | 515 | deep-is@0.1.4: 516 | resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} 517 | 518 | dir-glob@3.0.1: 519 | resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} 520 | engines: {node: '>=8'} 521 | 522 | doctrine@3.0.0: 523 | resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} 524 | engines: {node: '>=6.0.0'} 525 | 526 | dotenv@16.4.5: 527 | resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} 528 | engines: {node: '>=12'} 529 | 530 | esbuild-android-64@0.15.18: 531 | resolution: {integrity: sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==} 532 | engines: {node: '>=12'} 533 | cpu: [x64] 534 | os: [android] 535 | 536 | esbuild-android-arm64@0.15.18: 537 | resolution: {integrity: sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==} 538 | engines: {node: '>=12'} 539 | cpu: [arm64] 540 | os: [android] 541 | 542 | esbuild-darwin-64@0.15.18: 543 | resolution: {integrity: sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==} 544 | engines: {node: '>=12'} 545 | cpu: [x64] 546 | os: [darwin] 547 | 548 | esbuild-darwin-arm64@0.15.18: 549 | resolution: {integrity: sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==} 550 | engines: {node: '>=12'} 551 | cpu: [arm64] 552 | os: [darwin] 553 | 554 | esbuild-freebsd-64@0.15.18: 555 | resolution: {integrity: sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==} 556 | engines: {node: '>=12'} 557 | cpu: [x64] 558 | os: [freebsd] 559 | 560 | esbuild-freebsd-arm64@0.15.18: 561 | resolution: {integrity: sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==} 562 | engines: {node: '>=12'} 563 | cpu: [arm64] 564 | os: [freebsd] 565 | 566 | esbuild-linux-32@0.15.18: 567 | resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==} 568 | engines: {node: '>=12'} 569 | cpu: [ia32] 570 | os: [linux] 571 | 572 | esbuild-linux-64@0.15.18: 573 | resolution: {integrity: sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==} 574 | engines: {node: '>=12'} 575 | cpu: [x64] 576 | os: [linux] 577 | 578 | esbuild-linux-arm64@0.15.18: 579 | resolution: {integrity: sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==} 580 | engines: {node: '>=12'} 581 | cpu: [arm64] 582 | os: [linux] 583 | 584 | esbuild-linux-arm@0.15.18: 585 | resolution: {integrity: sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==} 586 | engines: {node: '>=12'} 587 | cpu: [arm] 588 | os: [linux] 589 | 590 | esbuild-linux-mips64le@0.15.18: 591 | resolution: {integrity: sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==} 592 | engines: {node: '>=12'} 593 | cpu: [mips64el] 594 | os: [linux] 595 | 596 | esbuild-linux-ppc64le@0.15.18: 597 | resolution: {integrity: sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==} 598 | engines: {node: '>=12'} 599 | cpu: [ppc64] 600 | os: [linux] 601 | 602 | esbuild-linux-riscv64@0.15.18: 603 | resolution: {integrity: sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==} 604 | engines: {node: '>=12'} 605 | cpu: [riscv64] 606 | os: [linux] 607 | 608 | esbuild-linux-s390x@0.15.18: 609 | resolution: {integrity: sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==} 610 | engines: {node: '>=12'} 611 | cpu: [s390x] 612 | os: [linux] 613 | 614 | esbuild-netbsd-64@0.15.18: 615 | resolution: {integrity: sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==} 616 | engines: {node: '>=12'} 617 | cpu: [x64] 618 | os: [netbsd] 619 | 620 | esbuild-openbsd-64@0.15.18: 621 | resolution: {integrity: sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==} 622 | engines: {node: '>=12'} 623 | cpu: [x64] 624 | os: [openbsd] 625 | 626 | esbuild-sunos-64@0.15.18: 627 | resolution: {integrity: sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==} 628 | engines: {node: '>=12'} 629 | cpu: [x64] 630 | os: [sunos] 631 | 632 | esbuild-windows-32@0.15.18: 633 | resolution: {integrity: sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==} 634 | engines: {node: '>=12'} 635 | cpu: [ia32] 636 | os: [win32] 637 | 638 | esbuild-windows-64@0.15.18: 639 | resolution: {integrity: sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==} 640 | engines: {node: '>=12'} 641 | cpu: [x64] 642 | os: [win32] 643 | 644 | esbuild-windows-arm64@0.15.18: 645 | resolution: {integrity: sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==} 646 | engines: {node: '>=12'} 647 | cpu: [arm64] 648 | os: [win32] 649 | 650 | esbuild@0.15.18: 651 | resolution: {integrity: sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==} 652 | engines: {node: '>=12'} 653 | hasBin: true 654 | 655 | esbuild@0.25.0: 656 | resolution: {integrity: sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==} 657 | engines: {node: '>=18'} 658 | hasBin: true 659 | 660 | escape-string-regexp@4.0.0: 661 | resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} 662 | engines: {node: '>=10'} 663 | 664 | eslint-plugin-unused-imports@3.2.0: 665 | resolution: {integrity: sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==} 666 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 667 | peerDependencies: 668 | '@typescript-eslint/eslint-plugin': 6 - 7 669 | eslint: '8' 670 | peerDependenciesMeta: 671 | '@typescript-eslint/eslint-plugin': 672 | optional: true 673 | 674 | eslint-rule-composer@0.3.0: 675 | resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==} 676 | engines: {node: '>=4.0.0'} 677 | 678 | eslint-scope@7.2.2: 679 | resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} 680 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 681 | 682 | eslint-visitor-keys@3.4.3: 683 | resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} 684 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 685 | 686 | eslint@8.57.0: 687 | resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} 688 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 689 | hasBin: true 690 | 691 | espree@9.6.1: 692 | resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} 693 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 694 | 695 | esquery@1.6.0: 696 | resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} 697 | engines: {node: '>=0.10'} 698 | 699 | esrecurse@4.3.0: 700 | resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} 701 | engines: {node: '>=4.0'} 702 | 703 | estraverse@5.3.0: 704 | resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} 705 | engines: {node: '>=4.0'} 706 | 707 | esutils@2.0.3: 708 | resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 709 | engines: {node: '>=0.10.0'} 710 | 711 | fast-deep-equal@3.1.3: 712 | resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} 713 | 714 | fast-glob@3.3.2: 715 | resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} 716 | engines: {node: '>=8.6.0'} 717 | 718 | fast-json-stable-stringify@2.1.0: 719 | resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} 720 | 721 | fast-levenshtein@2.0.6: 722 | resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} 723 | 724 | fastq@1.17.1: 725 | resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} 726 | 727 | file-entry-cache@6.0.1: 728 | resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} 729 | engines: {node: ^10.12.0 || >=12.0.0} 730 | 731 | fill-range@7.1.1: 732 | resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} 733 | engines: {node: '>=8'} 734 | 735 | find-up@5.0.0: 736 | resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} 737 | engines: {node: '>=10'} 738 | 739 | fix-esm-import-path@1.10.0: 740 | resolution: {integrity: sha512-c4BoKC4qA8GFAPrApmF4j0QNDWeeaGy51C9/QQw2z671sgfdDmOwUbGmPp/bdyQ4SoThB7CEjy97PJ3LlfuvfA==} 741 | hasBin: true 742 | 743 | flat-cache@3.2.0: 744 | resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} 745 | engines: {node: ^10.12.0 || >=12.0.0} 746 | 747 | flatted@3.3.1: 748 | resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} 749 | 750 | fs.realpath@1.0.0: 751 | resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} 752 | 753 | fsevents@2.3.3: 754 | resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} 755 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} 756 | os: [darwin] 757 | 758 | function-bind@1.1.2: 759 | resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} 760 | 761 | get-func-name@2.0.2: 762 | resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} 763 | 764 | glob-parent@5.1.2: 765 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 766 | engines: {node: '>= 6'} 767 | 768 | glob-parent@6.0.2: 769 | resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} 770 | engines: {node: '>=10.13.0'} 771 | 772 | glob@7.2.3: 773 | resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} 774 | deprecated: Glob versions prior to v9 are no longer supported 775 | 776 | globals@13.24.0: 777 | resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} 778 | engines: {node: '>=8'} 779 | 780 | globby@11.1.0: 781 | resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} 782 | engines: {node: '>=10'} 783 | 784 | graphemer@1.4.0: 785 | resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} 786 | 787 | has-flag@4.0.0: 788 | resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} 789 | engines: {node: '>=8'} 790 | 791 | hasown@2.0.2: 792 | resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} 793 | engines: {node: '>= 0.4'} 794 | 795 | ignore@5.3.1: 796 | resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} 797 | engines: {node: '>= 4'} 798 | 799 | import-fresh@3.3.0: 800 | resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} 801 | engines: {node: '>=6'} 802 | 803 | imurmurhash@0.1.4: 804 | resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} 805 | engines: {node: '>=0.8.19'} 806 | 807 | inflight@1.0.6: 808 | resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} 809 | deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. 810 | 811 | inherits@2.0.4: 812 | resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} 813 | 814 | interpret@1.4.0: 815 | resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} 816 | engines: {node: '>= 0.10'} 817 | 818 | is-core-module@2.15.0: 819 | resolution: {integrity: sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==} 820 | engines: {node: '>= 0.4'} 821 | 822 | is-extglob@2.1.1: 823 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 824 | engines: {node: '>=0.10.0'} 825 | 826 | is-glob@4.0.3: 827 | resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 828 | engines: {node: '>=0.10.0'} 829 | 830 | is-number@7.0.0: 831 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 832 | engines: {node: '>=0.12.0'} 833 | 834 | is-path-inside@3.0.3: 835 | resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} 836 | engines: {node: '>=8'} 837 | 838 | isexe@2.0.0: 839 | resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} 840 | 841 | js-yaml@4.1.0: 842 | resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} 843 | hasBin: true 844 | 845 | json-buffer@3.0.1: 846 | resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} 847 | 848 | json-schema-traverse@0.4.1: 849 | resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} 850 | 851 | json-stable-stringify-without-jsonify@1.0.1: 852 | resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} 853 | 854 | json5@2.2.3: 855 | resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} 856 | engines: {node: '>=6'} 857 | hasBin: true 858 | 859 | keyv@4.5.4: 860 | resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} 861 | 862 | levn@0.4.1: 863 | resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} 864 | engines: {node: '>= 0.8.0'} 865 | 866 | local-pkg@0.4.3: 867 | resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} 868 | engines: {node: '>=14'} 869 | 870 | locate-path@6.0.0: 871 | resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} 872 | engines: {node: '>=10'} 873 | 874 | lodash.merge@4.6.2: 875 | resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} 876 | 877 | loupe@2.3.7: 878 | resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} 879 | 880 | merge2@1.4.1: 881 | resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} 882 | engines: {node: '>= 8'} 883 | 884 | micromatch@4.0.7: 885 | resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} 886 | engines: {node: '>=8.6'} 887 | 888 | minimatch@3.1.2: 889 | resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} 890 | 891 | minimatch@9.0.5: 892 | resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} 893 | engines: {node: '>=16 || 14 >=14.17'} 894 | 895 | minimist@1.2.8: 896 | resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} 897 | 898 | ms@2.1.2: 899 | resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} 900 | 901 | nanoid@3.3.7: 902 | resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} 903 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 904 | hasBin: true 905 | 906 | nanoid@3.3.9: 907 | resolution: {integrity: sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==} 908 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 909 | hasBin: true 910 | 911 | natural-compare@1.4.0: 912 | resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} 913 | 914 | once@1.4.0: 915 | resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} 916 | 917 | optionator@0.9.4: 918 | resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} 919 | engines: {node: '>= 0.8.0'} 920 | 921 | p-limit@3.1.0: 922 | resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} 923 | engines: {node: '>=10'} 924 | 925 | p-locate@5.0.0: 926 | resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} 927 | engines: {node: '>=10'} 928 | 929 | parent-module@1.0.1: 930 | resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} 931 | engines: {node: '>=6'} 932 | 933 | path-exists@4.0.0: 934 | resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} 935 | engines: {node: '>=8'} 936 | 937 | path-is-absolute@1.0.1: 938 | resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} 939 | engines: {node: '>=0.10.0'} 940 | 941 | path-key@3.1.1: 942 | resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} 943 | engines: {node: '>=8'} 944 | 945 | path-parse@1.0.7: 946 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} 947 | 948 | path-type@4.0.0: 949 | resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} 950 | engines: {node: '>=8'} 951 | 952 | pathval@1.1.1: 953 | resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} 954 | 955 | picocolors@1.0.1: 956 | resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} 957 | 958 | picocolors@1.1.1: 959 | resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} 960 | 961 | picomatch@2.3.1: 962 | resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 963 | engines: {node: '>=8.6'} 964 | 965 | postcss@8.4.41: 966 | resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} 967 | engines: {node: ^10 || ^12 || >=14} 968 | 969 | postcss@8.5.3: 970 | resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} 971 | engines: {node: ^10 || ^12 || >=14} 972 | 973 | prelude-ls@1.2.1: 974 | resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} 975 | engines: {node: '>= 0.8.0'} 976 | 977 | punycode@2.3.1: 978 | resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} 979 | engines: {node: '>=6'} 980 | 981 | queue-microtask@1.2.3: 982 | resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 983 | 984 | rechoir@0.6.2: 985 | resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} 986 | engines: {node: '>= 0.10'} 987 | 988 | resolve-from@4.0.0: 989 | resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} 990 | engines: {node: '>=4'} 991 | 992 | resolve@1.22.8: 993 | resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} 994 | hasBin: true 995 | 996 | reusify@1.0.4: 997 | resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} 998 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 999 | 1000 | rimraf@3.0.2: 1001 | resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} 1002 | deprecated: Rimraf versions prior to v4 are no longer supported 1003 | hasBin: true 1004 | 1005 | rollup@2.79.1: 1006 | resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} 1007 | engines: {node: '>=10.0.0'} 1008 | hasBin: true 1009 | 1010 | rollup@4.35.0: 1011 | resolution: {integrity: sha512-kg6oI4g+vc41vePJyO6dHt/yl0Rz3Thv0kJeVQ3D1kS3E5XSuKbPc29G4IpT/Kv1KQwgHVcN+HtyS+HYLNSvQg==} 1012 | engines: {node: '>=18.0.0', npm: '>=8.0.0'} 1013 | hasBin: true 1014 | 1015 | run-parallel@1.2.0: 1016 | resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 1017 | 1018 | semver@7.6.3: 1019 | resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} 1020 | engines: {node: '>=10'} 1021 | hasBin: true 1022 | 1023 | shebang-command@2.0.0: 1024 | resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} 1025 | engines: {node: '>=8'} 1026 | 1027 | shebang-regex@3.0.0: 1028 | resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} 1029 | engines: {node: '>=8'} 1030 | 1031 | shelljs@0.8.5: 1032 | resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} 1033 | engines: {node: '>=4'} 1034 | hasBin: true 1035 | 1036 | shx@0.3.4: 1037 | resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==} 1038 | engines: {node: '>=6'} 1039 | hasBin: true 1040 | 1041 | slash@3.0.0: 1042 | resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} 1043 | engines: {node: '>=8'} 1044 | 1045 | source-map-js@1.2.0: 1046 | resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} 1047 | engines: {node: '>=0.10.0'} 1048 | 1049 | source-map-js@1.2.1: 1050 | resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} 1051 | engines: {node: '>=0.10.0'} 1052 | 1053 | strip-ansi@6.0.1: 1054 | resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} 1055 | engines: {node: '>=8'} 1056 | 1057 | strip-bom@3.0.0: 1058 | resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} 1059 | engines: {node: '>=4'} 1060 | 1061 | strip-json-comments@3.1.1: 1062 | resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} 1063 | engines: {node: '>=8'} 1064 | 1065 | strip-literal@0.4.2: 1066 | resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} 1067 | 1068 | supports-color@7.2.0: 1069 | resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 1070 | engines: {node: '>=8'} 1071 | 1072 | supports-preserve-symlinks-flag@1.0.0: 1073 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} 1074 | engines: {node: '>= 0.4'} 1075 | 1076 | text-table@0.2.0: 1077 | resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} 1078 | 1079 | tinybench@2.9.0: 1080 | resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} 1081 | 1082 | tinypool@0.3.1: 1083 | resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} 1084 | engines: {node: '>=14.0.0'} 1085 | 1086 | tinyspy@1.1.1: 1087 | resolution: {integrity: sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==} 1088 | engines: {node: '>=14.0.0'} 1089 | 1090 | to-regex-range@5.0.1: 1091 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 1092 | engines: {node: '>=8.0'} 1093 | 1094 | ts-api-utils@1.3.0: 1095 | resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} 1096 | engines: {node: '>=16'} 1097 | peerDependencies: 1098 | typescript: '>=4.2.0' 1099 | 1100 | tsconfig-paths@4.2.0: 1101 | resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} 1102 | engines: {node: '>=6'} 1103 | 1104 | type-check@0.4.0: 1105 | resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} 1106 | engines: {node: '>= 0.8.0'} 1107 | 1108 | type-detect@4.1.0: 1109 | resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} 1110 | engines: {node: '>=4'} 1111 | 1112 | type-fest@0.20.2: 1113 | resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} 1114 | engines: {node: '>=10'} 1115 | 1116 | typescript@5.5.4: 1117 | resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} 1118 | engines: {node: '>=14.17'} 1119 | hasBin: true 1120 | 1121 | undici-types@5.26.5: 1122 | resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} 1123 | 1124 | uri-js@4.4.1: 1125 | resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} 1126 | 1127 | vite@3.2.10: 1128 | resolution: {integrity: sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==} 1129 | engines: {node: ^14.18.0 || >=16.0.0} 1130 | hasBin: true 1131 | peerDependencies: 1132 | '@types/node': '>= 14' 1133 | less: '*' 1134 | sass: '*' 1135 | stylus: '*' 1136 | sugarss: '*' 1137 | terser: ^5.4.0 1138 | peerDependenciesMeta: 1139 | '@types/node': 1140 | optional: true 1141 | less: 1142 | optional: true 1143 | sass: 1144 | optional: true 1145 | stylus: 1146 | optional: true 1147 | sugarss: 1148 | optional: true 1149 | terser: 1150 | optional: true 1151 | 1152 | vite@6.2.1: 1153 | resolution: {integrity: sha512-n2GnqDb6XPhlt9B8olZPrgMD/es/Nd1RdChF6CBD/fHW6pUyUTt2sQW2fPRX5GiD9XEa6+8A6A4f2vT6pSsE7Q==} 1154 | engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} 1155 | hasBin: true 1156 | peerDependencies: 1157 | '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 1158 | jiti: '>=1.21.0' 1159 | less: '*' 1160 | lightningcss: ^1.21.0 1161 | sass: '*' 1162 | sass-embedded: '*' 1163 | stylus: '*' 1164 | sugarss: '*' 1165 | terser: ^5.16.0 1166 | tsx: ^4.8.1 1167 | yaml: ^2.4.2 1168 | peerDependenciesMeta: 1169 | '@types/node': 1170 | optional: true 1171 | jiti: 1172 | optional: true 1173 | less: 1174 | optional: true 1175 | lightningcss: 1176 | optional: true 1177 | sass: 1178 | optional: true 1179 | sass-embedded: 1180 | optional: true 1181 | stylus: 1182 | optional: true 1183 | sugarss: 1184 | optional: true 1185 | terser: 1186 | optional: true 1187 | tsx: 1188 | optional: true 1189 | yaml: 1190 | optional: true 1191 | 1192 | vitest@0.24.5: 1193 | resolution: {integrity: sha512-zw6JhPUHtLILQDe5Q39b/SzoITkG+R7hcFjuthp4xsi6zpmfQPOZcHodZ+3bqoWl4EdGK/p1fuMiEwdxgbGLOA==} 1194 | engines: {node: '>=v14.16.0'} 1195 | hasBin: true 1196 | peerDependencies: 1197 | '@edge-runtime/vm': '*' 1198 | '@vitest/browser': '*' 1199 | '@vitest/ui': '*' 1200 | happy-dom: '*' 1201 | jsdom: '*' 1202 | peerDependenciesMeta: 1203 | '@edge-runtime/vm': 1204 | optional: true 1205 | '@vitest/browser': 1206 | optional: true 1207 | '@vitest/ui': 1208 | optional: true 1209 | happy-dom: 1210 | optional: true 1211 | jsdom: 1212 | optional: true 1213 | 1214 | which@2.0.2: 1215 | resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} 1216 | engines: {node: '>= 8'} 1217 | hasBin: true 1218 | 1219 | word-wrap@1.2.5: 1220 | resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} 1221 | engines: {node: '>=0.10.0'} 1222 | 1223 | wrappy@1.0.2: 1224 | resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} 1225 | 1226 | yocto-queue@0.1.0: 1227 | resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 1228 | engines: {node: '>=10'} 1229 | 1230 | zod@3.23.8: 1231 | resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} 1232 | 1233 | snapshots: 1234 | 1235 | '@dmitryrechkin/eslint-standard@1.0.7(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0)': 1236 | dependencies: 1237 | '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) 1238 | '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) 1239 | eslint: 8.57.0 1240 | eslint-plugin-unused-imports: 3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0) 1241 | 1242 | '@esbuild/aix-ppc64@0.25.0': 1243 | optional: true 1244 | 1245 | '@esbuild/android-arm64@0.25.0': 1246 | optional: true 1247 | 1248 | '@esbuild/android-arm@0.15.18': 1249 | optional: true 1250 | 1251 | '@esbuild/android-arm@0.25.0': 1252 | optional: true 1253 | 1254 | '@esbuild/android-x64@0.25.0': 1255 | optional: true 1256 | 1257 | '@esbuild/darwin-arm64@0.25.0': 1258 | optional: true 1259 | 1260 | '@esbuild/darwin-x64@0.25.0': 1261 | optional: true 1262 | 1263 | '@esbuild/freebsd-arm64@0.25.0': 1264 | optional: true 1265 | 1266 | '@esbuild/freebsd-x64@0.25.0': 1267 | optional: true 1268 | 1269 | '@esbuild/linux-arm64@0.25.0': 1270 | optional: true 1271 | 1272 | '@esbuild/linux-arm@0.25.0': 1273 | optional: true 1274 | 1275 | '@esbuild/linux-ia32@0.25.0': 1276 | optional: true 1277 | 1278 | '@esbuild/linux-loong64@0.15.18': 1279 | optional: true 1280 | 1281 | '@esbuild/linux-loong64@0.25.0': 1282 | optional: true 1283 | 1284 | '@esbuild/linux-mips64el@0.25.0': 1285 | optional: true 1286 | 1287 | '@esbuild/linux-ppc64@0.25.0': 1288 | optional: true 1289 | 1290 | '@esbuild/linux-riscv64@0.25.0': 1291 | optional: true 1292 | 1293 | '@esbuild/linux-s390x@0.25.0': 1294 | optional: true 1295 | 1296 | '@esbuild/linux-x64@0.25.0': 1297 | optional: true 1298 | 1299 | '@esbuild/netbsd-arm64@0.25.0': 1300 | optional: true 1301 | 1302 | '@esbuild/netbsd-x64@0.25.0': 1303 | optional: true 1304 | 1305 | '@esbuild/openbsd-arm64@0.25.0': 1306 | optional: true 1307 | 1308 | '@esbuild/openbsd-x64@0.25.0': 1309 | optional: true 1310 | 1311 | '@esbuild/sunos-x64@0.25.0': 1312 | optional: true 1313 | 1314 | '@esbuild/win32-arm64@0.25.0': 1315 | optional: true 1316 | 1317 | '@esbuild/win32-ia32@0.25.0': 1318 | optional: true 1319 | 1320 | '@esbuild/win32-x64@0.25.0': 1321 | optional: true 1322 | 1323 | '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': 1324 | dependencies: 1325 | eslint: 8.57.0 1326 | eslint-visitor-keys: 3.4.3 1327 | 1328 | '@eslint-community/regexpp@4.11.0': {} 1329 | 1330 | '@eslint/eslintrc@2.1.4': 1331 | dependencies: 1332 | ajv: 6.12.6 1333 | debug: 4.3.6 1334 | espree: 9.6.1 1335 | globals: 13.24.0 1336 | ignore: 5.3.1 1337 | import-fresh: 3.3.0 1338 | js-yaml: 4.1.0 1339 | minimatch: 3.1.2 1340 | strip-json-comments: 3.1.1 1341 | transitivePeerDependencies: 1342 | - supports-color 1343 | 1344 | '@eslint/js@8.57.0': {} 1345 | 1346 | '@humanwhocodes/config-array@0.11.14': 1347 | dependencies: 1348 | '@humanwhocodes/object-schema': 2.0.3 1349 | debug: 4.3.6 1350 | minimatch: 3.1.2 1351 | transitivePeerDependencies: 1352 | - supports-color 1353 | 1354 | '@humanwhocodes/module-importer@1.0.1': {} 1355 | 1356 | '@humanwhocodes/object-schema@2.0.3': {} 1357 | 1358 | '@nodelib/fs.scandir@2.1.5': 1359 | dependencies: 1360 | '@nodelib/fs.stat': 2.0.5 1361 | run-parallel: 1.2.0 1362 | 1363 | '@nodelib/fs.stat@2.0.5': {} 1364 | 1365 | '@nodelib/fs.walk@1.2.8': 1366 | dependencies: 1367 | '@nodelib/fs.scandir': 2.1.5 1368 | fastq: 1.17.1 1369 | 1370 | '@rollup/rollup-android-arm-eabi@4.35.0': 1371 | optional: true 1372 | 1373 | '@rollup/rollup-android-arm64@4.35.0': 1374 | optional: true 1375 | 1376 | '@rollup/rollup-darwin-arm64@4.35.0': 1377 | optional: true 1378 | 1379 | '@rollup/rollup-darwin-x64@4.35.0': 1380 | optional: true 1381 | 1382 | '@rollup/rollup-freebsd-arm64@4.35.0': 1383 | optional: true 1384 | 1385 | '@rollup/rollup-freebsd-x64@4.35.0': 1386 | optional: true 1387 | 1388 | '@rollup/rollup-linux-arm-gnueabihf@4.35.0': 1389 | optional: true 1390 | 1391 | '@rollup/rollup-linux-arm-musleabihf@4.35.0': 1392 | optional: true 1393 | 1394 | '@rollup/rollup-linux-arm64-gnu@4.35.0': 1395 | optional: true 1396 | 1397 | '@rollup/rollup-linux-arm64-musl@4.35.0': 1398 | optional: true 1399 | 1400 | '@rollup/rollup-linux-loongarch64-gnu@4.35.0': 1401 | optional: true 1402 | 1403 | '@rollup/rollup-linux-powerpc64le-gnu@4.35.0': 1404 | optional: true 1405 | 1406 | '@rollup/rollup-linux-riscv64-gnu@4.35.0': 1407 | optional: true 1408 | 1409 | '@rollup/rollup-linux-s390x-gnu@4.35.0': 1410 | optional: true 1411 | 1412 | '@rollup/rollup-linux-x64-gnu@4.35.0': 1413 | optional: true 1414 | 1415 | '@rollup/rollup-linux-x64-musl@4.35.0': 1416 | optional: true 1417 | 1418 | '@rollup/rollup-win32-arm64-msvc@4.35.0': 1419 | optional: true 1420 | 1421 | '@rollup/rollup-win32-ia32-msvc@4.35.0': 1422 | optional: true 1423 | 1424 | '@rollup/rollup-win32-x64-msvc@4.35.0': 1425 | optional: true 1426 | 1427 | '@types/chai-subset@1.3.5': 1428 | dependencies: 1429 | '@types/chai': 4.3.17 1430 | 1431 | '@types/chai@4.3.17': {} 1432 | 1433 | '@types/estree@1.0.6': {} 1434 | 1435 | '@types/node@20.14.15': 1436 | dependencies: 1437 | undici-types: 5.26.5 1438 | 1439 | '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': 1440 | dependencies: 1441 | '@eslint-community/regexpp': 4.11.0 1442 | '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) 1443 | '@typescript-eslint/scope-manager': 7.18.0 1444 | '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) 1445 | '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) 1446 | '@typescript-eslint/visitor-keys': 7.18.0 1447 | eslint: 8.57.0 1448 | graphemer: 1.4.0 1449 | ignore: 5.3.1 1450 | natural-compare: 1.4.0 1451 | ts-api-utils: 1.3.0(typescript@5.5.4) 1452 | optionalDependencies: 1453 | typescript: 5.5.4 1454 | transitivePeerDependencies: 1455 | - supports-color 1456 | 1457 | '@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4)': 1458 | dependencies: 1459 | '@typescript-eslint/scope-manager': 7.18.0 1460 | '@typescript-eslint/types': 7.18.0 1461 | '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) 1462 | '@typescript-eslint/visitor-keys': 7.18.0 1463 | debug: 4.3.6 1464 | eslint: 8.57.0 1465 | optionalDependencies: 1466 | typescript: 5.5.4 1467 | transitivePeerDependencies: 1468 | - supports-color 1469 | 1470 | '@typescript-eslint/scope-manager@7.18.0': 1471 | dependencies: 1472 | '@typescript-eslint/types': 7.18.0 1473 | '@typescript-eslint/visitor-keys': 7.18.0 1474 | 1475 | '@typescript-eslint/type-utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': 1476 | dependencies: 1477 | '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) 1478 | '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) 1479 | debug: 4.3.6 1480 | eslint: 8.57.0 1481 | ts-api-utils: 1.3.0(typescript@5.5.4) 1482 | optionalDependencies: 1483 | typescript: 5.5.4 1484 | transitivePeerDependencies: 1485 | - supports-color 1486 | 1487 | '@typescript-eslint/types@7.18.0': {} 1488 | 1489 | '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': 1490 | dependencies: 1491 | '@typescript-eslint/types': 7.18.0 1492 | '@typescript-eslint/visitor-keys': 7.18.0 1493 | debug: 4.3.6 1494 | globby: 11.1.0 1495 | is-glob: 4.0.3 1496 | minimatch: 9.0.5 1497 | semver: 7.6.3 1498 | ts-api-utils: 1.3.0(typescript@5.5.4) 1499 | optionalDependencies: 1500 | typescript: 5.5.4 1501 | transitivePeerDependencies: 1502 | - supports-color 1503 | 1504 | '@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': 1505 | dependencies: 1506 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) 1507 | '@typescript-eslint/scope-manager': 7.18.0 1508 | '@typescript-eslint/types': 7.18.0 1509 | '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) 1510 | eslint: 8.57.0 1511 | transitivePeerDependencies: 1512 | - supports-color 1513 | - typescript 1514 | 1515 | '@typescript-eslint/visitor-keys@7.18.0': 1516 | dependencies: 1517 | '@typescript-eslint/types': 7.18.0 1518 | eslint-visitor-keys: 3.4.3 1519 | 1520 | '@ungap/structured-clone@1.2.0': {} 1521 | 1522 | acorn-jsx@5.3.2(acorn@8.12.1): 1523 | dependencies: 1524 | acorn: 8.12.1 1525 | 1526 | acorn@8.12.1: {} 1527 | 1528 | ajv@6.12.6: 1529 | dependencies: 1530 | fast-deep-equal: 3.1.3 1531 | fast-json-stable-stringify: 2.1.0 1532 | json-schema-traverse: 0.4.1 1533 | uri-js: 4.4.1 1534 | 1535 | ansi-regex@5.0.1: {} 1536 | 1537 | ansi-styles@4.3.0: 1538 | dependencies: 1539 | color-convert: 2.0.1 1540 | 1541 | argparse@2.0.1: {} 1542 | 1543 | array-union@2.1.0: {} 1544 | 1545 | assertion-error@1.1.0: {} 1546 | 1547 | balanced-match@1.0.2: {} 1548 | 1549 | brace-expansion@1.1.11: 1550 | dependencies: 1551 | balanced-match: 1.0.2 1552 | concat-map: 0.0.1 1553 | 1554 | brace-expansion@2.0.1: 1555 | dependencies: 1556 | balanced-match: 1.0.2 1557 | 1558 | braces@3.0.3: 1559 | dependencies: 1560 | fill-range: 7.1.1 1561 | 1562 | callsites@3.1.0: {} 1563 | 1564 | chai@4.5.0: 1565 | dependencies: 1566 | assertion-error: 1.1.0 1567 | check-error: 1.0.3 1568 | deep-eql: 4.1.4 1569 | get-func-name: 2.0.2 1570 | loupe: 2.3.7 1571 | pathval: 1.1.1 1572 | type-detect: 4.1.0 1573 | 1574 | chalk@4.1.2: 1575 | dependencies: 1576 | ansi-styles: 4.3.0 1577 | supports-color: 7.2.0 1578 | 1579 | check-error@1.0.3: 1580 | dependencies: 1581 | get-func-name: 2.0.2 1582 | 1583 | color-convert@2.0.1: 1584 | dependencies: 1585 | color-name: 1.1.4 1586 | 1587 | color-name@1.1.4: {} 1588 | 1589 | concat-map@0.0.1: {} 1590 | 1591 | cross-spawn@7.0.3: 1592 | dependencies: 1593 | path-key: 3.1.1 1594 | shebang-command: 2.0.0 1595 | which: 2.0.2 1596 | 1597 | debug@4.3.6: 1598 | dependencies: 1599 | ms: 2.1.2 1600 | 1601 | deep-eql@4.1.4: 1602 | dependencies: 1603 | type-detect: 4.1.0 1604 | 1605 | deep-is@0.1.4: {} 1606 | 1607 | dir-glob@3.0.1: 1608 | dependencies: 1609 | path-type: 4.0.0 1610 | 1611 | doctrine@3.0.0: 1612 | dependencies: 1613 | esutils: 2.0.3 1614 | 1615 | dotenv@16.4.5: {} 1616 | 1617 | esbuild-android-64@0.15.18: 1618 | optional: true 1619 | 1620 | esbuild-android-arm64@0.15.18: 1621 | optional: true 1622 | 1623 | esbuild-darwin-64@0.15.18: 1624 | optional: true 1625 | 1626 | esbuild-darwin-arm64@0.15.18: 1627 | optional: true 1628 | 1629 | esbuild-freebsd-64@0.15.18: 1630 | optional: true 1631 | 1632 | esbuild-freebsd-arm64@0.15.18: 1633 | optional: true 1634 | 1635 | esbuild-linux-32@0.15.18: 1636 | optional: true 1637 | 1638 | esbuild-linux-64@0.15.18: 1639 | optional: true 1640 | 1641 | esbuild-linux-arm64@0.15.18: 1642 | optional: true 1643 | 1644 | esbuild-linux-arm@0.15.18: 1645 | optional: true 1646 | 1647 | esbuild-linux-mips64le@0.15.18: 1648 | optional: true 1649 | 1650 | esbuild-linux-ppc64le@0.15.18: 1651 | optional: true 1652 | 1653 | esbuild-linux-riscv64@0.15.18: 1654 | optional: true 1655 | 1656 | esbuild-linux-s390x@0.15.18: 1657 | optional: true 1658 | 1659 | esbuild-netbsd-64@0.15.18: 1660 | optional: true 1661 | 1662 | esbuild-openbsd-64@0.15.18: 1663 | optional: true 1664 | 1665 | esbuild-sunos-64@0.15.18: 1666 | optional: true 1667 | 1668 | esbuild-windows-32@0.15.18: 1669 | optional: true 1670 | 1671 | esbuild-windows-64@0.15.18: 1672 | optional: true 1673 | 1674 | esbuild-windows-arm64@0.15.18: 1675 | optional: true 1676 | 1677 | esbuild@0.15.18: 1678 | optionalDependencies: 1679 | '@esbuild/android-arm': 0.15.18 1680 | '@esbuild/linux-loong64': 0.15.18 1681 | esbuild-android-64: 0.15.18 1682 | esbuild-android-arm64: 0.15.18 1683 | esbuild-darwin-64: 0.15.18 1684 | esbuild-darwin-arm64: 0.15.18 1685 | esbuild-freebsd-64: 0.15.18 1686 | esbuild-freebsd-arm64: 0.15.18 1687 | esbuild-linux-32: 0.15.18 1688 | esbuild-linux-64: 0.15.18 1689 | esbuild-linux-arm: 0.15.18 1690 | esbuild-linux-arm64: 0.15.18 1691 | esbuild-linux-mips64le: 0.15.18 1692 | esbuild-linux-ppc64le: 0.15.18 1693 | esbuild-linux-riscv64: 0.15.18 1694 | esbuild-linux-s390x: 0.15.18 1695 | esbuild-netbsd-64: 0.15.18 1696 | esbuild-openbsd-64: 0.15.18 1697 | esbuild-sunos-64: 0.15.18 1698 | esbuild-windows-32: 0.15.18 1699 | esbuild-windows-64: 0.15.18 1700 | esbuild-windows-arm64: 0.15.18 1701 | 1702 | esbuild@0.25.0: 1703 | optionalDependencies: 1704 | '@esbuild/aix-ppc64': 0.25.0 1705 | '@esbuild/android-arm': 0.25.0 1706 | '@esbuild/android-arm64': 0.25.0 1707 | '@esbuild/android-x64': 0.25.0 1708 | '@esbuild/darwin-arm64': 0.25.0 1709 | '@esbuild/darwin-x64': 0.25.0 1710 | '@esbuild/freebsd-arm64': 0.25.0 1711 | '@esbuild/freebsd-x64': 0.25.0 1712 | '@esbuild/linux-arm': 0.25.0 1713 | '@esbuild/linux-arm64': 0.25.0 1714 | '@esbuild/linux-ia32': 0.25.0 1715 | '@esbuild/linux-loong64': 0.25.0 1716 | '@esbuild/linux-mips64el': 0.25.0 1717 | '@esbuild/linux-ppc64': 0.25.0 1718 | '@esbuild/linux-riscv64': 0.25.0 1719 | '@esbuild/linux-s390x': 0.25.0 1720 | '@esbuild/linux-x64': 0.25.0 1721 | '@esbuild/netbsd-arm64': 0.25.0 1722 | '@esbuild/netbsd-x64': 0.25.0 1723 | '@esbuild/openbsd-arm64': 0.25.0 1724 | '@esbuild/openbsd-x64': 0.25.0 1725 | '@esbuild/sunos-x64': 0.25.0 1726 | '@esbuild/win32-arm64': 0.25.0 1727 | '@esbuild/win32-ia32': 0.25.0 1728 | '@esbuild/win32-x64': 0.25.0 1729 | 1730 | escape-string-regexp@4.0.0: {} 1731 | 1732 | eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0): 1733 | dependencies: 1734 | eslint: 8.57.0 1735 | eslint-rule-composer: 0.3.0 1736 | optionalDependencies: 1737 | '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) 1738 | 1739 | eslint-rule-composer@0.3.0: {} 1740 | 1741 | eslint-scope@7.2.2: 1742 | dependencies: 1743 | esrecurse: 4.3.0 1744 | estraverse: 5.3.0 1745 | 1746 | eslint-visitor-keys@3.4.3: {} 1747 | 1748 | eslint@8.57.0: 1749 | dependencies: 1750 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) 1751 | '@eslint-community/regexpp': 4.11.0 1752 | '@eslint/eslintrc': 2.1.4 1753 | '@eslint/js': 8.57.0 1754 | '@humanwhocodes/config-array': 0.11.14 1755 | '@humanwhocodes/module-importer': 1.0.1 1756 | '@nodelib/fs.walk': 1.2.8 1757 | '@ungap/structured-clone': 1.2.0 1758 | ajv: 6.12.6 1759 | chalk: 4.1.2 1760 | cross-spawn: 7.0.3 1761 | debug: 4.3.6 1762 | doctrine: 3.0.0 1763 | escape-string-regexp: 4.0.0 1764 | eslint-scope: 7.2.2 1765 | eslint-visitor-keys: 3.4.3 1766 | espree: 9.6.1 1767 | esquery: 1.6.0 1768 | esutils: 2.0.3 1769 | fast-deep-equal: 3.1.3 1770 | file-entry-cache: 6.0.1 1771 | find-up: 5.0.0 1772 | glob-parent: 6.0.2 1773 | globals: 13.24.0 1774 | graphemer: 1.4.0 1775 | ignore: 5.3.1 1776 | imurmurhash: 0.1.4 1777 | is-glob: 4.0.3 1778 | is-path-inside: 3.0.3 1779 | js-yaml: 4.1.0 1780 | json-stable-stringify-without-jsonify: 1.0.1 1781 | levn: 0.4.1 1782 | lodash.merge: 4.6.2 1783 | minimatch: 3.1.2 1784 | natural-compare: 1.4.0 1785 | optionator: 0.9.4 1786 | strip-ansi: 6.0.1 1787 | text-table: 0.2.0 1788 | transitivePeerDependencies: 1789 | - supports-color 1790 | 1791 | espree@9.6.1: 1792 | dependencies: 1793 | acorn: 8.12.1 1794 | acorn-jsx: 5.3.2(acorn@8.12.1) 1795 | eslint-visitor-keys: 3.4.3 1796 | 1797 | esquery@1.6.0: 1798 | dependencies: 1799 | estraverse: 5.3.0 1800 | 1801 | esrecurse@4.3.0: 1802 | dependencies: 1803 | estraverse: 5.3.0 1804 | 1805 | estraverse@5.3.0: {} 1806 | 1807 | esutils@2.0.3: {} 1808 | 1809 | fast-deep-equal@3.1.3: {} 1810 | 1811 | fast-glob@3.3.2: 1812 | dependencies: 1813 | '@nodelib/fs.stat': 2.0.5 1814 | '@nodelib/fs.walk': 1.2.8 1815 | glob-parent: 5.1.2 1816 | merge2: 1.4.1 1817 | micromatch: 4.0.7 1818 | 1819 | fast-json-stable-stringify@2.1.0: {} 1820 | 1821 | fast-levenshtein@2.0.6: {} 1822 | 1823 | fastq@1.17.1: 1824 | dependencies: 1825 | reusify: 1.0.4 1826 | 1827 | file-entry-cache@6.0.1: 1828 | dependencies: 1829 | flat-cache: 3.2.0 1830 | 1831 | fill-range@7.1.1: 1832 | dependencies: 1833 | to-regex-range: 5.0.1 1834 | 1835 | find-up@5.0.0: 1836 | dependencies: 1837 | locate-path: 6.0.0 1838 | path-exists: 4.0.0 1839 | 1840 | fix-esm-import-path@1.10.0: 1841 | dependencies: 1842 | debug: 4.3.6 1843 | transitivePeerDependencies: 1844 | - supports-color 1845 | 1846 | flat-cache@3.2.0: 1847 | dependencies: 1848 | flatted: 3.3.1 1849 | keyv: 4.5.4 1850 | rimraf: 3.0.2 1851 | 1852 | flatted@3.3.1: {} 1853 | 1854 | fs.realpath@1.0.0: {} 1855 | 1856 | fsevents@2.3.3: 1857 | optional: true 1858 | 1859 | function-bind@1.1.2: {} 1860 | 1861 | get-func-name@2.0.2: {} 1862 | 1863 | glob-parent@5.1.2: 1864 | dependencies: 1865 | is-glob: 4.0.3 1866 | 1867 | glob-parent@6.0.2: 1868 | dependencies: 1869 | is-glob: 4.0.3 1870 | 1871 | glob@7.2.3: 1872 | dependencies: 1873 | fs.realpath: 1.0.0 1874 | inflight: 1.0.6 1875 | inherits: 2.0.4 1876 | minimatch: 3.1.2 1877 | once: 1.4.0 1878 | path-is-absolute: 1.0.1 1879 | 1880 | globals@13.24.0: 1881 | dependencies: 1882 | type-fest: 0.20.2 1883 | 1884 | globby@11.1.0: 1885 | dependencies: 1886 | array-union: 2.1.0 1887 | dir-glob: 3.0.1 1888 | fast-glob: 3.3.2 1889 | ignore: 5.3.1 1890 | merge2: 1.4.1 1891 | slash: 3.0.0 1892 | 1893 | graphemer@1.4.0: {} 1894 | 1895 | has-flag@4.0.0: {} 1896 | 1897 | hasown@2.0.2: 1898 | dependencies: 1899 | function-bind: 1.1.2 1900 | 1901 | ignore@5.3.1: {} 1902 | 1903 | import-fresh@3.3.0: 1904 | dependencies: 1905 | parent-module: 1.0.1 1906 | resolve-from: 4.0.0 1907 | 1908 | imurmurhash@0.1.4: {} 1909 | 1910 | inflight@1.0.6: 1911 | dependencies: 1912 | once: 1.4.0 1913 | wrappy: 1.0.2 1914 | 1915 | inherits@2.0.4: {} 1916 | 1917 | interpret@1.4.0: {} 1918 | 1919 | is-core-module@2.15.0: 1920 | dependencies: 1921 | hasown: 2.0.2 1922 | 1923 | is-extglob@2.1.1: {} 1924 | 1925 | is-glob@4.0.3: 1926 | dependencies: 1927 | is-extglob: 2.1.1 1928 | 1929 | is-number@7.0.0: {} 1930 | 1931 | is-path-inside@3.0.3: {} 1932 | 1933 | isexe@2.0.0: {} 1934 | 1935 | js-yaml@4.1.0: 1936 | dependencies: 1937 | argparse: 2.0.1 1938 | 1939 | json-buffer@3.0.1: {} 1940 | 1941 | json-schema-traverse@0.4.1: {} 1942 | 1943 | json-stable-stringify-without-jsonify@1.0.1: {} 1944 | 1945 | json5@2.2.3: {} 1946 | 1947 | keyv@4.5.4: 1948 | dependencies: 1949 | json-buffer: 3.0.1 1950 | 1951 | levn@0.4.1: 1952 | dependencies: 1953 | prelude-ls: 1.2.1 1954 | type-check: 0.4.0 1955 | 1956 | local-pkg@0.4.3: {} 1957 | 1958 | locate-path@6.0.0: 1959 | dependencies: 1960 | p-locate: 5.0.0 1961 | 1962 | lodash.merge@4.6.2: {} 1963 | 1964 | loupe@2.3.7: 1965 | dependencies: 1966 | get-func-name: 2.0.2 1967 | 1968 | merge2@1.4.1: {} 1969 | 1970 | micromatch@4.0.7: 1971 | dependencies: 1972 | braces: 3.0.3 1973 | picomatch: 2.3.1 1974 | 1975 | minimatch@3.1.2: 1976 | dependencies: 1977 | brace-expansion: 1.1.11 1978 | 1979 | minimatch@9.0.5: 1980 | dependencies: 1981 | brace-expansion: 2.0.1 1982 | 1983 | minimist@1.2.8: {} 1984 | 1985 | ms@2.1.2: {} 1986 | 1987 | nanoid@3.3.7: {} 1988 | 1989 | nanoid@3.3.9: {} 1990 | 1991 | natural-compare@1.4.0: {} 1992 | 1993 | once@1.4.0: 1994 | dependencies: 1995 | wrappy: 1.0.2 1996 | 1997 | optionator@0.9.4: 1998 | dependencies: 1999 | deep-is: 0.1.4 2000 | fast-levenshtein: 2.0.6 2001 | levn: 0.4.1 2002 | prelude-ls: 1.2.1 2003 | type-check: 0.4.0 2004 | word-wrap: 1.2.5 2005 | 2006 | p-limit@3.1.0: 2007 | dependencies: 2008 | yocto-queue: 0.1.0 2009 | 2010 | p-locate@5.0.0: 2011 | dependencies: 2012 | p-limit: 3.1.0 2013 | 2014 | parent-module@1.0.1: 2015 | dependencies: 2016 | callsites: 3.1.0 2017 | 2018 | path-exists@4.0.0: {} 2019 | 2020 | path-is-absolute@1.0.1: {} 2021 | 2022 | path-key@3.1.1: {} 2023 | 2024 | path-parse@1.0.7: {} 2025 | 2026 | path-type@4.0.0: {} 2027 | 2028 | pathval@1.1.1: {} 2029 | 2030 | picocolors@1.0.1: {} 2031 | 2032 | picocolors@1.1.1: {} 2033 | 2034 | picomatch@2.3.1: {} 2035 | 2036 | postcss@8.4.41: 2037 | dependencies: 2038 | nanoid: 3.3.7 2039 | picocolors: 1.0.1 2040 | source-map-js: 1.2.0 2041 | 2042 | postcss@8.5.3: 2043 | dependencies: 2044 | nanoid: 3.3.9 2045 | picocolors: 1.1.1 2046 | source-map-js: 1.2.1 2047 | 2048 | prelude-ls@1.2.1: {} 2049 | 2050 | punycode@2.3.1: {} 2051 | 2052 | queue-microtask@1.2.3: {} 2053 | 2054 | rechoir@0.6.2: 2055 | dependencies: 2056 | resolve: 1.22.8 2057 | 2058 | resolve-from@4.0.0: {} 2059 | 2060 | resolve@1.22.8: 2061 | dependencies: 2062 | is-core-module: 2.15.0 2063 | path-parse: 1.0.7 2064 | supports-preserve-symlinks-flag: 1.0.0 2065 | 2066 | reusify@1.0.4: {} 2067 | 2068 | rimraf@3.0.2: 2069 | dependencies: 2070 | glob: 7.2.3 2071 | 2072 | rollup@2.79.1: 2073 | optionalDependencies: 2074 | fsevents: 2.3.3 2075 | 2076 | rollup@4.35.0: 2077 | dependencies: 2078 | '@types/estree': 1.0.6 2079 | optionalDependencies: 2080 | '@rollup/rollup-android-arm-eabi': 4.35.0 2081 | '@rollup/rollup-android-arm64': 4.35.0 2082 | '@rollup/rollup-darwin-arm64': 4.35.0 2083 | '@rollup/rollup-darwin-x64': 4.35.0 2084 | '@rollup/rollup-freebsd-arm64': 4.35.0 2085 | '@rollup/rollup-freebsd-x64': 4.35.0 2086 | '@rollup/rollup-linux-arm-gnueabihf': 4.35.0 2087 | '@rollup/rollup-linux-arm-musleabihf': 4.35.0 2088 | '@rollup/rollup-linux-arm64-gnu': 4.35.0 2089 | '@rollup/rollup-linux-arm64-musl': 4.35.0 2090 | '@rollup/rollup-linux-loongarch64-gnu': 4.35.0 2091 | '@rollup/rollup-linux-powerpc64le-gnu': 4.35.0 2092 | '@rollup/rollup-linux-riscv64-gnu': 4.35.0 2093 | '@rollup/rollup-linux-s390x-gnu': 4.35.0 2094 | '@rollup/rollup-linux-x64-gnu': 4.35.0 2095 | '@rollup/rollup-linux-x64-musl': 4.35.0 2096 | '@rollup/rollup-win32-arm64-msvc': 4.35.0 2097 | '@rollup/rollup-win32-ia32-msvc': 4.35.0 2098 | '@rollup/rollup-win32-x64-msvc': 4.35.0 2099 | fsevents: 2.3.3 2100 | 2101 | run-parallel@1.2.0: 2102 | dependencies: 2103 | queue-microtask: 1.2.3 2104 | 2105 | semver@7.6.3: {} 2106 | 2107 | shebang-command@2.0.0: 2108 | dependencies: 2109 | shebang-regex: 3.0.0 2110 | 2111 | shebang-regex@3.0.0: {} 2112 | 2113 | shelljs@0.8.5: 2114 | dependencies: 2115 | glob: 7.2.3 2116 | interpret: 1.4.0 2117 | rechoir: 0.6.2 2118 | 2119 | shx@0.3.4: 2120 | dependencies: 2121 | minimist: 1.2.8 2122 | shelljs: 0.8.5 2123 | 2124 | slash@3.0.0: {} 2125 | 2126 | source-map-js@1.2.0: {} 2127 | 2128 | source-map-js@1.2.1: {} 2129 | 2130 | strip-ansi@6.0.1: 2131 | dependencies: 2132 | ansi-regex: 5.0.1 2133 | 2134 | strip-bom@3.0.0: {} 2135 | 2136 | strip-json-comments@3.1.1: {} 2137 | 2138 | strip-literal@0.4.2: 2139 | dependencies: 2140 | acorn: 8.12.1 2141 | 2142 | supports-color@7.2.0: 2143 | dependencies: 2144 | has-flag: 4.0.0 2145 | 2146 | supports-preserve-symlinks-flag@1.0.0: {} 2147 | 2148 | text-table@0.2.0: {} 2149 | 2150 | tinybench@2.9.0: {} 2151 | 2152 | tinypool@0.3.1: {} 2153 | 2154 | tinyspy@1.1.1: {} 2155 | 2156 | to-regex-range@5.0.1: 2157 | dependencies: 2158 | is-number: 7.0.0 2159 | 2160 | ts-api-utils@1.3.0(typescript@5.5.4): 2161 | dependencies: 2162 | typescript: 5.5.4 2163 | 2164 | tsconfig-paths@4.2.0: 2165 | dependencies: 2166 | json5: 2.2.3 2167 | minimist: 1.2.8 2168 | strip-bom: 3.0.0 2169 | 2170 | type-check@0.4.0: 2171 | dependencies: 2172 | prelude-ls: 1.2.1 2173 | 2174 | type-detect@4.1.0: {} 2175 | 2176 | type-fest@0.20.2: {} 2177 | 2178 | typescript@5.5.4: {} 2179 | 2180 | undici-types@5.26.5: {} 2181 | 2182 | uri-js@4.4.1: 2183 | dependencies: 2184 | punycode: 2.3.1 2185 | 2186 | vite@3.2.10(@types/node@20.14.15): 2187 | dependencies: 2188 | esbuild: 0.15.18 2189 | postcss: 8.4.41 2190 | resolve: 1.22.8 2191 | rollup: 2.79.1 2192 | optionalDependencies: 2193 | '@types/node': 20.14.15 2194 | fsevents: 2.3.3 2195 | 2196 | vite@6.2.1(@types/node@20.14.15): 2197 | dependencies: 2198 | esbuild: 0.25.0 2199 | postcss: 8.5.3 2200 | rollup: 4.35.0 2201 | optionalDependencies: 2202 | '@types/node': 20.14.15 2203 | fsevents: 2.3.3 2204 | 2205 | vitest@0.24.5: 2206 | dependencies: 2207 | '@types/chai': 4.3.17 2208 | '@types/chai-subset': 1.3.5 2209 | '@types/node': 20.14.15 2210 | chai: 4.5.0 2211 | debug: 4.3.6 2212 | local-pkg: 0.4.3 2213 | strip-literal: 0.4.2 2214 | tinybench: 2.9.0 2215 | tinypool: 0.3.1 2216 | tinyspy: 1.1.1 2217 | vite: 3.2.10(@types/node@20.14.15) 2218 | transitivePeerDependencies: 2219 | - less 2220 | - sass 2221 | - stylus 2222 | - sugarss 2223 | - supports-color 2224 | - terser 2225 | 2226 | which@2.0.2: 2227 | dependencies: 2228 | isexe: 2.0.0 2229 | 2230 | word-wrap@1.2.5: {} 2231 | 2232 | wrappy@1.0.2: {} 2233 | 2234 | yocto-queue@0.1.0: {} 2235 | 2236 | zod@3.23.8: {} 2237 | -------------------------------------------------------------------------------- /src/JSONSchemaToZod.ts: -------------------------------------------------------------------------------- 1 | import { z, ZodSchema, type ZodTypeAny } from 'zod'; 2 | import { type JSONSchema, type JSONValue, type JSONObject } from './Type'; 3 | 4 | export class JSONSchemaToZod 5 | { 6 | /** 7 | * Converts a JSON schema to a Zod schema. 8 | * 9 | * @param {JSONSchema} schema - The JSON schema. 10 | * @returns {ZodSchema} - The Zod schema. 11 | */ 12 | public static convert(schema: JSONSchema): ZodSchema 13 | { 14 | return this.parseSchema(schema); 15 | } 16 | 17 | /** 18 | * Checks if data matches a condition schema. 19 | * 20 | * @param {JSONValue} data - The data to check. 21 | * @param {JSONSchema} condition - The condition schema. 22 | * @returns {boolean} - Whether the data matches the condition. 23 | */ 24 | private static matchesCondition(data: JSONValue, condition: JSONSchema): boolean 25 | { 26 | // If no properties to check, condition is met 27 | if (!condition.properties) 28 | { 29 | return true; 30 | } 31 | 32 | // If data is not an object or is null, it can't match a schema with properties 33 | if (typeof data !== 'object' || data === null || Array.isArray(data)) 34 | { 35 | return false; 36 | } 37 | 38 | // Now we know data is a JSONObject 39 | const objectData = data as JSONObject; 40 | 41 | // Check all property conditions 42 | for (const [key, propCondition] of Object.entries(condition.properties)) 43 | { 44 | // If property doesn't exist in data 45 | if (!(key in objectData)) 46 | { 47 | // If there's a const condition and property is missing, it doesn't match 48 | if ('const' in propCondition) 49 | { 50 | return false; 51 | } 52 | 53 | // For other conditions, skip this property 54 | continue; 55 | } 56 | 57 | const value = objectData[key]; 58 | 59 | // Check for const condition 60 | if ('const' in propCondition && value !== propCondition['const']) 61 | { 62 | return false; 63 | } 64 | 65 | // Check for minimum condition 66 | if ('minimum' in propCondition && typeof value === 'number' && value < propCondition['minimum']) 67 | { 68 | return false; 69 | } 70 | 71 | // Check for maximum condition 72 | if ('maximum' in propCondition && typeof value === 'number' && value > propCondition['maximum']) 73 | { 74 | return false; 75 | } 76 | } 77 | 78 | return true; 79 | } 80 | 81 | /** 82 | * Validates data against a conditional schema and adds issues to context if validation fails. 83 | * 84 | * @param {JSONValue} data - The data to validate. 85 | * @param {JSONSchema} schema - The conditional schema. 86 | * @param {z.RefinementCtx} ctx - The Zod refinement context. 87 | */ 88 | private static validateConditionalSchema(data: JSONValue, schema: JSONSchema, ctx: z.RefinementCtx): void 89 | { 90 | this.validateRequiredProperties(data, schema, ctx); 91 | this.validatePropertyPatterns(data, schema, ctx); 92 | this.validateNestedConditions(data, schema, ctx); 93 | } 94 | 95 | /** 96 | * Validates that all required properties are present in the data. 97 | * 98 | * @param {JSONValue} data - The data to validate. 99 | * @param {JSONSchema} schema - The schema containing required properties. 100 | * @param {z.RefinementCtx} ctx - The Zod refinement context. 101 | */ 102 | private static validateRequiredProperties(data: JSONValue, schema: JSONSchema, ctx: z.RefinementCtx): void 103 | { 104 | if (!schema.required) 105 | { 106 | return; 107 | } 108 | 109 | // If data is not an object or is null, all required properties are missing 110 | if (typeof data !== 'object' || data === null) 111 | { 112 | for (const requiredProp of schema.required) 113 | { 114 | ctx.addIssue({ 115 | code: z.ZodIssueCode.custom, 116 | message: `Required property '${requiredProp}' is missing`, 117 | path: [requiredProp] 118 | }); 119 | } 120 | return; 121 | } 122 | 123 | // Now we know data is an object (either a plain object or an array) 124 | for (const requiredProp of schema.required) 125 | { 126 | if (!(requiredProp in data)) 127 | { 128 | ctx.addIssue({ 129 | code: z.ZodIssueCode.custom, 130 | message: `Required property '${requiredProp}' is missing`, 131 | path: [requiredProp] 132 | }); 133 | } 134 | } 135 | } 136 | 137 | /** 138 | * Validates property patterns for string properties. 139 | * 140 | * @param {JSONValue} data - The data to validate. 141 | * @param {JSONSchema} schema - The schema containing property patterns. 142 | * @param {z.RefinementCtx} ctx - The Zod refinement context. 143 | */ 144 | private static validatePropertyPatterns(data: JSONValue, schema: JSONSchema, ctx: z.RefinementCtx): void 145 | { 146 | if (!schema.properties) 147 | { 148 | return; 149 | } 150 | 151 | // If data is not an object or is null, we can't validate property patterns 152 | if (typeof data !== 'object' || data === null) 153 | { 154 | return; 155 | } 156 | 157 | // If data is an array, we can't validate property patterns 158 | if (Array.isArray(data)) 159 | { 160 | return; 161 | } 162 | 163 | // Now we know data is a JSONObject 164 | const objectData = data as JSONObject; 165 | 166 | // Process each property in the schema 167 | for (const [key, propSchema] of Object.entries(schema.properties)) 168 | { 169 | // Skip if property doesn't exist in data 170 | if (!(key in objectData)) 171 | { 172 | continue; 173 | } 174 | 175 | const value = objectData[key]; 176 | 177 | // Check pattern validation for strings 178 | if (propSchema['pattern'] && typeof value === 'string') 179 | { 180 | const regex = new RegExp(propSchema['pattern']); 181 | if (!regex.test(value)) 182 | { 183 | ctx.addIssue({ 184 | code: z.ZodIssueCode.custom, 185 | message: `String '${value}' does not match pattern '${propSchema['pattern']}'`, 186 | path: [key] 187 | }); 188 | } 189 | } 190 | } 191 | } 192 | 193 | /** 194 | * Validates nested if-then-else conditions. 195 | * 196 | * @param {JSONValue} data - The data to validate. 197 | * @param {JSONSchema} schema - The schema containing if-then-else conditions. 198 | * @param {z.RefinementCtx} ctx - The Zod refinement context. 199 | */ 200 | private static validateNestedConditions(data: JSONValue, schema: JSONSchema, ctx: z.RefinementCtx): void 201 | { 202 | if (!schema['if'] || !schema['then']) 203 | { 204 | return; 205 | } 206 | 207 | const matchesIf = this.matchesCondition(data, schema['if']); 208 | if (matchesIf) 209 | { 210 | this.validateConditionalSchema(data, schema['then'], ctx); 211 | } 212 | else if (schema['else']) 213 | { 214 | this.validateConditionalSchema(data, schema['else'], ctx); 215 | } 216 | } 217 | 218 | /** 219 | * Parses a JSON schema and returns the corresponding Zod schema. 220 | * This is the main entry point for schema conversion. 221 | * 222 | * @param {JSONSchema} schema - The JSON schema. 223 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 224 | */ 225 | private static parseSchema(schema: JSONSchema): ZodTypeAny 226 | { 227 | // Handle array of types (e.g., ['string', 'null'] for nullable types) 228 | if (Array.isArray(schema.type)) 229 | { 230 | return this.handleTypeArray(schema); 231 | } 232 | 233 | // Handle combinators (oneOf, anyOf, allOf) 234 | if (schema.oneOf || schema.anyOf || schema.allOf) 235 | { 236 | return this.parseCombinator(schema); 237 | } 238 | 239 | // Handle if-then-else conditional validation 240 | if (schema['if'] && schema['then']) 241 | { 242 | return this.parseObject(schema); 243 | } 244 | 245 | // Handle object schema without explicit type but with properties 246 | if (schema.properties && (!schema.type || schema.type === 'object')) 247 | { 248 | return this.parseObject(schema); 249 | } 250 | 251 | // Handle all other types 252 | return this.handleSingleType(schema); 253 | } 254 | 255 | /** 256 | * Handles schemas with an array of types. 257 | * 258 | * @param {JSONSchema} schema - The JSON schema with type array. 259 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 260 | */ 261 | private static handleTypeArray(schema: JSONSchema): ZodTypeAny 262 | { 263 | if (!Array.isArray(schema.type)) 264 | { 265 | throw new Error('Expected schema.type to be an array'); 266 | } 267 | 268 | // Check if the type array includes 'null' to create a nullable type 269 | if (schema.type.includes('null')) 270 | { 271 | return this.handleNullableType(schema); 272 | } 273 | 274 | // If no 'null' in the type array, handle as a union of types 275 | return this.createUnionFromTypes(schema.type, schema); 276 | } 277 | 278 | /** 279 | * Handles nullable types by creating a nullable schema. 280 | * 281 | * @param {JSONSchema} schema - The JSON schema with nullable type. 282 | * @returns {ZodTypeAny} - The nullable Zod schema. 283 | */ 284 | private static handleNullableType(schema: JSONSchema): ZodTypeAny 285 | { 286 | if (!Array.isArray(schema.type)) 287 | { 288 | throw new Error('Expected schema.type to be an array'); 289 | } 290 | 291 | // Create a copy of the schema without the 'null' type 292 | const nonNullSchema = { ...schema }; 293 | nonNullSchema.type = schema.type.filter(t => t !== 'null'); 294 | 295 | // If there's only one type left, handle it as a single type and make it nullable 296 | if (nonNullSchema.type.length === 1) 297 | { 298 | const singleTypeSchema = this.handleSingleType({ ...schema, type: nonNullSchema.type[0] }); 299 | return singleTypeSchema.nullable(); 300 | } 301 | 302 | // If multiple non-null types, create a union and make it nullable 303 | const unionSchema = this.parseSchema(nonNullSchema); 304 | return unionSchema.nullable(); 305 | } 306 | 307 | /** 308 | * Creates a union type from an array of types. 309 | * 310 | * @param {string[]} types - Array of type strings. 311 | * @param {JSONSchema} baseSchema - The base schema to apply to each type. 312 | * @returns {ZodTypeAny} - The union Zod schema. 313 | */ 314 | private static createUnionFromTypes(types: string[], baseSchema: JSONSchema): ZodTypeAny 315 | { 316 | const schemas = types.map(type => 317 | { 318 | const singleTypeSchema = { ...baseSchema, type }; 319 | return this.parseSchema(singleTypeSchema); 320 | }); 321 | 322 | return z.union(schemas as [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]); 323 | } 324 | 325 | /** 326 | * Handles schemas with a single type. 327 | * 328 | * @param {JSONSchema} schema - The JSON schema with single type. 329 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 330 | */ 331 | private static handleSingleType(schema: JSONSchema): ZodTypeAny 332 | { 333 | // Handle schemas without a type property 334 | if (schema.type === undefined) 335 | { 336 | // Check for combinators first 337 | if (schema.oneOf || schema.anyOf || schema.allOf) 338 | { 339 | return this.parseCombinator(schema); 340 | } 341 | 342 | // Check for object properties 343 | if (schema.properties) 344 | { 345 | return this.parseObject(schema); 346 | } 347 | 348 | // Default to any() for schemas with no type and no other indicators 349 | return z.any(); 350 | } 351 | 352 | // Handle specific types 353 | switch (schema.type) 354 | { 355 | case 'string': return this.parseString(schema); 356 | case 'number': 357 | case 'integer': return this.parseNumberSchema(schema); 358 | case 'boolean': return z.boolean(); 359 | case 'array': return this.parseArray(schema); 360 | case 'object': return this.parseObject(schema); 361 | default: throw new Error('Unsupported schema type'); 362 | } 363 | } 364 | 365 | /** 366 | * Parses a number schema. 367 | * 368 | * @param {JSONSchema} schema - The JSON schema for a number. 369 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 370 | */ 371 | private static parseNumberSchema(schema: JSONSchema): ZodTypeAny 372 | { 373 | let numberSchema = z.number(); 374 | 375 | // Apply all number validations 376 | let result: z.ZodTypeAny = numberSchema; 377 | result = this.applyNumberBounds(numberSchema, schema); 378 | result = this.applyNumberMultipleOf(numberSchema, schema); 379 | result = this.applyNumberEnum(numberSchema, schema); 380 | result = this.applyIntegerConstraint(numberSchema, schema); 381 | 382 | return result; 383 | } 384 | 385 | /** 386 | * Applies bounds validation to a number schema. 387 | * 388 | * @param {z.ZodNumber} numberSchema - The base number schema. 389 | * @param {JSONSchema} schema - The JSON schema with bounds. 390 | * @returns {z.ZodNumber} - The updated schema with bounds validation. 391 | */ 392 | private static applyNumberBounds(numberSchema: z.ZodNumber, schema: JSONSchema): z.ZodTypeAny 393 | { 394 | let result = numberSchema; 395 | 396 | if (schema['minimum'] !== undefined) 397 | { 398 | result = schema['exclusiveMinimum'] ? 399 | result.gt(schema['minimum']) : 400 | result.gte(schema['minimum']); 401 | } 402 | 403 | if (schema['maximum'] !== undefined) 404 | { 405 | result = schema['exclusiveMaximum'] ? 406 | result.lt(schema['maximum']) : 407 | result.lte(schema['maximum']); 408 | } 409 | 410 | return result; 411 | } 412 | 413 | /** 414 | * Applies multipleOf validation to a number schema. 415 | * 416 | * @param {z.ZodNumber} numberSchema - The base number schema. 417 | * @param {JSONSchema} schema - The JSON schema with multipleOf. 418 | * @returns {z.ZodNumber} - The updated schema with multipleOf validation. 419 | */ 420 | private static applyNumberMultipleOf(numberSchema: z.ZodNumber, schema: JSONSchema): z.ZodTypeAny 421 | { 422 | if (schema['multipleOf'] === undefined) 423 | { 424 | return numberSchema; 425 | } 426 | 427 | return numberSchema.refine( 428 | val => val % schema['multipleOf']! === 0, 429 | { message: `Number must be a multiple of ${schema['multipleOf']}` } 430 | ); 431 | } 432 | 433 | /** 434 | * Applies enum validation to a number schema. 435 | * 436 | * @param {z.ZodNumber} numberSchema - The base number schema. 437 | * @param {JSONSchema} schema - The JSON schema with enum. 438 | * @returns {z.ZodNumber} - The updated schema with enum validation. 439 | */ 440 | private static applyNumberEnum(numberSchema: z.ZodNumber, schema: JSONSchema): z.ZodTypeAny 441 | { 442 | if (!schema.enum) 443 | { 444 | return numberSchema; 445 | } 446 | 447 | // Filter out non-number values from enum 448 | const numberEnums = schema.enum.filter(val => typeof val === 'number') as number[]; 449 | if (numberEnums.length === 0) 450 | { 451 | return numberSchema; 452 | } 453 | 454 | // Use refinement to validate against enum values 455 | return numberSchema.refine( 456 | val => numberEnums.includes(val), 457 | { message: `Number must be one of: ${numberEnums.join(', ')}` } 458 | ); 459 | } 460 | 461 | /** 462 | * Applies integer constraint to a number schema if needed. 463 | * 464 | * @param {z.ZodNumber} numberSchema - The base number schema. 465 | * @param {JSONSchema} schema - The JSON schema. 466 | * @returns {z.ZodNumber} - The updated schema with integer validation if needed. 467 | */ 468 | private static applyIntegerConstraint(numberSchema: z.ZodNumber, schema: JSONSchema): z.ZodTypeAny 469 | { 470 | if (schema.type !== 'integer') 471 | { 472 | return numberSchema; 473 | } 474 | 475 | return numberSchema.refine( 476 | val => Number.isInteger(val), 477 | { message: 'Number must be an integer' } 478 | ); 479 | } 480 | 481 | /** 482 | * Parses a string schema. 483 | * 484 | * @param {JSONSchema} schema - The JSON schema for a string. 485 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 486 | */ 487 | private static parseString(schema: JSONSchema): ZodTypeAny 488 | { 489 | let stringSchema = z.string(); 490 | let result: z.ZodTypeAny = stringSchema; 491 | 492 | // Apply all string validations 493 | if (schema.format) 494 | { 495 | // Handle format-specific string validation 496 | return this.applyStringFormat(stringSchema, schema); 497 | } 498 | else 499 | { 500 | // Only apply other validations if format is not specified 501 | // or apply them to the formatted string 502 | result = this.applyStringPattern(stringSchema, schema) as z.ZodTypeAny; 503 | result = this.applyStringLength(stringSchema, schema) as z.ZodTypeAny; 504 | result = this.applyStringEnum(stringSchema, schema); 505 | } 506 | 507 | return result; 508 | } 509 | 510 | /** 511 | * Applies format validation to a string schema. 512 | * 513 | * @param {z.ZodString} stringSchema - The base string schema. 514 | * @param {JSONSchema} schema - The JSON schema with format. 515 | * @returns {ZodTypeAny} - The updated schema with format validation. 516 | */ 517 | private static applyStringFormat(stringSchema: z.ZodString, schema: JSONSchema): ZodTypeAny 518 | { 519 | if (!schema.format) 520 | { 521 | return stringSchema; 522 | } 523 | 524 | switch (schema.format) 525 | { 526 | case 'email': 527 | return stringSchema.email(); 528 | case 'date-time': 529 | return stringSchema.datetime(); 530 | case 'uri': 531 | return stringSchema.url(); 532 | case 'uuid': 533 | return stringSchema.uuid(); 534 | case 'date': 535 | return stringSchema.date(); 536 | default: 537 | return stringSchema; 538 | } 539 | } 540 | 541 | /** 542 | * Applies pattern validation to a string schema. 543 | * 544 | * @param {z.ZodString} stringSchema - The base string schema. 545 | * @param {JSONSchema} schema - The JSON schema with pattern. 546 | * @returns {z.ZodString} - The updated schema with pattern validation. 547 | */ 548 | private static applyStringPattern(stringSchema: z.ZodString, schema: JSONSchema): z.ZodTypeAny 549 | { 550 | if (!schema['pattern']) 551 | { 552 | return stringSchema; 553 | } 554 | 555 | const regex = new RegExp(schema['pattern']); 556 | return stringSchema.regex(regex, { message: `String must match pattern: ${schema['pattern']}` }); 557 | } 558 | 559 | /** 560 | * Applies length constraints to a string schema. 561 | * 562 | * @param {z.ZodString} stringSchema - The base string schema. 563 | * @param {JSONSchema} schema - The JSON schema with length constraints. 564 | * @returns {z.ZodString} - The updated schema with length validation. 565 | */ 566 | private static applyStringLength(stringSchema: z.ZodString, schema: JSONSchema): z.ZodTypeAny 567 | { 568 | let result = stringSchema; 569 | 570 | if (schema['minLength'] !== undefined) 571 | { 572 | stringSchema = stringSchema.min(schema['minLength']); 573 | } 574 | 575 | if (schema['maxLength'] !== undefined) 576 | { 577 | stringSchema = stringSchema.max(schema['maxLength']); 578 | } 579 | 580 | return result; 581 | } 582 | 583 | /** 584 | * Applies enum validation to a string schema. 585 | * 586 | * @param {z.ZodString} stringSchema - The base string schema. 587 | * @param {JSONSchema} schema - The JSON schema with enum. 588 | * @returns {ZodTypeAny} - The updated schema with enum validation. 589 | */ 590 | private static applyStringEnum(stringSchema: z.ZodString, schema: JSONSchema): ZodTypeAny 591 | { 592 | if (!schema.enum) 593 | { 594 | return stringSchema; 595 | } 596 | 597 | // Use refinement to validate against enum values 598 | return stringSchema.refine((val) => schema.enum?.includes(val), { 599 | message: `Value must be one of: ${schema.enum?.join(', ')}` 600 | }); 601 | } 602 | 603 | /** 604 | * Parses a JSON schema of type array and returns the corresponding Zod schema. 605 | * 606 | * @param {JSONSchema} schema - The JSON schema. 607 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 608 | */ 609 | private static parseArray(schema: JSONSchema): ZodTypeAny 610 | { 611 | // Handle tuple validation (items is an array) 612 | if (Array.isArray(schema.items)) 613 | { 614 | const tupleSchemas = schema.items.map(item => this.parseSchema(item)); 615 | return z.union(tupleSchemas as [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]); 616 | } 617 | 618 | // Create regular array schema 619 | const itemSchema = schema.items ? this.parseSchema(schema.items) : z.any(); 620 | let arraySchema = z.array(itemSchema); 621 | 622 | // Apply array constraints 623 | let result: z.ZodTypeAny = arraySchema; 624 | result = this.applyArrayConstraints(arraySchema, schema); 625 | 626 | return result; 627 | } 628 | 629 | /** 630 | * Applies constraints to an array schema. 631 | * 632 | * @param {z.ZodArray} arraySchema - The base array schema. 633 | * @param {JSONSchema} schema - The JSON schema with array constraints. 634 | * @returns {z.ZodTypeAny} - The updated array schema with constraints. 635 | */ 636 | private static applyArrayConstraints(arraySchema: z.ZodArray, schema: JSONSchema): z.ZodTypeAny 637 | { 638 | // Handle minItems 639 | if (schema['minItems'] !== undefined) 640 | { 641 | arraySchema = arraySchema.min(schema['minItems']); 642 | } 643 | 644 | // Handle maxItems 645 | if (schema['maxItems'] !== undefined) 646 | { 647 | arraySchema = arraySchema.max(schema['maxItems']); 648 | } 649 | 650 | // Handle uniqueItems 651 | if (schema['uniqueItems']) 652 | { 653 | return arraySchema.refine( 654 | (items) => new Set(items).size === items.length, 655 | { message: 'Array items must be unique' } 656 | ); 657 | } 658 | 659 | return arraySchema; 660 | } 661 | 662 | /** 663 | * Parses an object schema. 664 | * 665 | * @param {JSONSchema} schema - The JSON schema for an object. 666 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 667 | */ 668 | private static parseObject(schema: JSONSchema): ZodTypeAny 669 | { 670 | // Handle conditional validation (if-then-else) first 671 | if (schema['if'] && schema['then']) 672 | { 673 | return this.parseConditional(schema); 674 | } 675 | 676 | // Create shape object for Zod 677 | const shape: Record = {}; 678 | 679 | // Process properties 680 | this.processObjectProperties(schema, shape); 681 | 682 | // Create the object schema and handle additionalProperties 683 | return this.processAdditionalProperties(schema, z.object(shape)); 684 | } 685 | 686 | /** 687 | * Processes object properties and builds the shape object. 688 | * 689 | * @param {JSONSchema} schema - The JSON schema for an object. 690 | * @param {Record} shape - The shape object to populate. 691 | */ 692 | private static processObjectProperties(schema: JSONSchema, shape: Record): void 693 | { 694 | const required = new Set(schema.required || []); 695 | 696 | if (!schema.properties) 697 | { 698 | return; 699 | } 700 | 701 | for (const [key, propSchema] of Object.entries(schema.properties)) 702 | { 703 | const zodSchema = this.parseSchema(propSchema); 704 | shape[key] = required.has(key) ? zodSchema : zodSchema.optional(); 705 | } 706 | } 707 | 708 | /** 709 | * Processes additionalProperties configuration. 710 | * 711 | * @param {JSONSchema} schema - The JSON schema for an object. 712 | * @param {z.ZodObject} objectSchema - The Zod object schema. 713 | * @returns {z.ZodObject} - The updated Zod object schema. 714 | */ 715 | private static processAdditionalProperties(schema: JSONSchema, objectSchema: z.ZodObject): z.ZodObject 716 | { 717 | if (schema.additionalProperties === true) 718 | { 719 | return objectSchema.passthrough(); 720 | } 721 | else if (schema.additionalProperties && typeof schema.additionalProperties === 'object') 722 | { 723 | // Handle schema for additional properties 724 | const additionalPropSchema = this.parseSchema(schema.additionalProperties); 725 | return objectSchema.catchall(additionalPropSchema); 726 | } 727 | else 728 | { 729 | return objectSchema.strict(); 730 | } 731 | } 732 | 733 | /** 734 | * Parses a conditional schema with if-then-else. 735 | * 736 | * @param {JSONSchema} schema - The JSON schema with conditional validation. 737 | * @returns {ZodTypeAny} - The conditional Zod schema. 738 | */ 739 | private static parseConditional(schema: JSONSchema): ZodTypeAny 740 | { 741 | // Create base object schema 742 | const zodObject = this.createBaseObjectSchema(schema); 743 | 744 | // Extract conditional parts 745 | const ifCondition = schema['if']; 746 | const thenSchema = schema['then']; 747 | const elseSchema = schema['else']; 748 | 749 | // Apply conditional validation using superRefine 750 | return zodObject.superRefine((data, ctx) => 751 | { 752 | // Apply default values to data for condition checking 753 | const dataWithDefaults = this.applyDefaultValues(data, schema); 754 | 755 | // Apply appropriate validation based on condition 756 | if (this.matchesCondition(dataWithDefaults, ifCondition)) 757 | { 758 | this.validateConditionalSchema(dataWithDefaults, thenSchema, ctx); 759 | } 760 | else if (elseSchema) 761 | { 762 | this.validateConditionalSchema(dataWithDefaults, elseSchema, ctx); 763 | } 764 | }); 765 | } 766 | 767 | /** 768 | * Creates a base object schema from the given JSON schema. 769 | * 770 | * @param {JSONSchema} schema - The JSON schema. 771 | * @returns {z.ZodObject} - The base Zod object schema. 772 | */ 773 | private static createBaseObjectSchema(schema: JSONSchema): z.ZodObject 774 | { 775 | const shape: Record = {}; 776 | const required = new Set(schema.required || []); 777 | 778 | for (const [key, value] of Object.entries(schema.properties || {})) 779 | { 780 | const zodSchema = this.parseSchema(value); 781 | shape[key] = required.has(key) ? zodSchema : zodSchema.optional(); 782 | } 783 | 784 | const zodObject = z.object(shape); 785 | return this.processAdditionalProperties(schema, zodObject); 786 | } 787 | 788 | /** 789 | * Applies default values from schema properties to data object. 790 | * 791 | * @param {JSONValue} data - The original data object. 792 | * @param {JSONSchema} schema - The schema with default values. 793 | * @returns {JSONValue} - The data object with defaults applied. 794 | */ 795 | private static applyDefaultValues(data: JSONValue, schema: JSONSchema): JSONValue 796 | { 797 | // If data is not an object or is null, we can't apply defaults 798 | if (typeof data !== 'object' || data === null) 799 | { 800 | return data; 801 | } 802 | 803 | // If data is an array, we can't apply defaults from schema properties 804 | if (Array.isArray(data)) 805 | { 806 | return data; 807 | } 808 | 809 | // Now we know data is a JSONObject 810 | const objectData = data as JSONObject; 811 | const dataWithDefaults = { ...objectData }; 812 | 813 | if (!schema.properties) 814 | { 815 | return dataWithDefaults; 816 | } 817 | 818 | for (const [key, propSchema] of Object.entries(schema.properties)) 819 | { 820 | if (!(key in dataWithDefaults) && 'default' in propSchema) 821 | { 822 | dataWithDefaults[key] = propSchema['default']; 823 | } 824 | } 825 | 826 | return dataWithDefaults; 827 | } 828 | 829 | /** 830 | * Parses a schema with combinators (oneOf, anyOf, allOf). 831 | * Delegates to the appropriate combinator parser based on which combinator is present. 832 | * 833 | * @param {JSONSchema} schema - The JSON schema with combinators. 834 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 835 | */ 836 | private static parseCombinator(schema: JSONSchema): ZodTypeAny 837 | { 838 | if (schema.oneOf) 839 | { 840 | return this.parseOneOf(schema.oneOf); 841 | } 842 | 843 | if (schema.anyOf) 844 | { 845 | return this.parseAnyOf(schema.anyOf); 846 | } 847 | 848 | if (schema.allOf) 849 | { 850 | return this.parseAllOf(schema.allOf); 851 | } 852 | 853 | // Should not reach here if schema has combinators 854 | throw new Error('Unsupported schema type'); 855 | } 856 | 857 | /** 858 | * Parses a oneOf combinator schema. 859 | * 860 | * @param {JSONSchema[]} schemas - Array of JSON schemas in the oneOf. 861 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 862 | */ 863 | private static parseOneOf(schemas: JSONSchema[]): ZodTypeAny 864 | { 865 | return this.createUnionFromSchemas(schemas); 866 | } 867 | 868 | /** 869 | * Parses an anyOf combinator schema. 870 | * 871 | * @param {JSONSchema[]} schemas - Array of JSON schemas in the anyOf. 872 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 873 | */ 874 | private static parseAnyOf(schemas: JSONSchema[]): ZodTypeAny 875 | { 876 | return this.createUnionFromSchemas(schemas); 877 | } 878 | 879 | /** 880 | * Creates a union from an array of schemas, handling special cases. 881 | * 882 | * @param {JSONSchema[]} schemas - Array of JSON schemas to create a union from. 883 | * @returns {ZodTypeAny} - The union Zod schema. 884 | */ 885 | private static createUnionFromSchemas(schemas: JSONSchema[]): ZodTypeAny 886 | { 887 | // Handle empty array case 888 | if (schemas.length === 0) 889 | { 890 | return z.any(); 891 | } 892 | 893 | // Handle single schema case 894 | if (schemas.length === 1) 895 | { 896 | return this.parseSchema(schemas[0]); 897 | } 898 | 899 | // Process each subschema individually 900 | const zodSchemas: ZodTypeAny[] = []; 901 | 902 | for (const subSchema of schemas) 903 | { 904 | // Handle null type specially 905 | if (subSchema.type === 'null') 906 | { 907 | zodSchemas.push(z.null()); 908 | } 909 | else 910 | { 911 | zodSchemas.push(this.parseSchema(subSchema)); 912 | } 913 | } 914 | 915 | // Return appropriate schema based on number of valid schemas 916 | if (zodSchemas.length >= 2) 917 | { 918 | return z.union(zodSchemas as [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]); 919 | } 920 | else if (zodSchemas.length === 1) 921 | { 922 | return zodSchemas[0]; 923 | } 924 | 925 | // Fallback if no valid schemas were created 926 | return z.any(); 927 | } 928 | 929 | /** 930 | * Parses an allOf combinator schema by merging all schemas. 931 | * 932 | * @param {JSONSchema[]} schemas - Array of JSON schemas in the allOf. 933 | * @returns {ZodTypeAny} - The ZodTypeAny schema. 934 | */ 935 | private static parseAllOf(schemas: JSONSchema[]): ZodTypeAny 936 | { 937 | // Handle empty array case 938 | if (schemas.length === 0) 939 | { 940 | return z.any(); 941 | } 942 | 943 | // Handle single schema case 944 | if (schemas.length === 1) 945 | { 946 | return this.parseSchema(schemas[0]); 947 | } 948 | 949 | // Merge all schemas together 950 | const mergedSchema = schemas.reduce( 951 | (acc, currentSchema) => this.mergeSchemas(acc, currentSchema) 952 | ); 953 | 954 | return this.parseSchema(mergedSchema); 955 | } 956 | 957 | /** 958 | * Merges two JSON schemas together. 959 | * 960 | * @param {JSONSchema} baseSchema - The base JSON schema. 961 | * @param {JSONSchema} addSchema - The JSON schema to add. 962 | * @returns {JSONSchema} - The merged JSON schema 963 | */ 964 | private static mergeSchemas(baseSchema: JSONSchema, addSchema: JSONSchema): JSONSchema 965 | { 966 | const merged: JSONSchema = { ...baseSchema, ...addSchema }; 967 | if (baseSchema.properties && addSchema.properties) 968 | { 969 | const mergedProperties = { ...baseSchema.properties, ...addSchema.properties }; 970 | merged.properties = mergedProperties; 971 | } 972 | if (baseSchema.required && addSchema.required) 973 | { 974 | const mergedRequired = [...new Set([...baseSchema.required, ...addSchema.required])]; 975 | merged.required = mergedRequired; 976 | } 977 | return merged; 978 | } 979 | } 980 | -------------------------------------------------------------------------------- /src/Type.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Represents any valid JSON value. 3 | */ 4 | export type JSONValue = 5 | | string 6 | | number 7 | | boolean 8 | | null 9 | | JSONObject 10 | | JSONValue[]; 11 | 12 | /** 13 | * Represents a JSON object. 14 | */ 15 | export type JSONObject = { 16 | [key: string]: JSONValue 17 | }; 18 | 19 | export type JSONSchema = { 20 | type?: string | string[]; 21 | properties?: Record; 22 | items?: JSONSchema | JSONSchema[]; 23 | required?: string[]; 24 | enum?: (string | number)[]; 25 | format?: string; 26 | oneOf?: JSONSchema[]; 27 | allOf?: JSONSchema[]; 28 | anyOf?: JSONSchema[]; 29 | additionalProperties?: boolean | JSONSchema; 30 | [key: string]: any; // For any other additional properties 31 | }; 32 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './JSONSchemaToZod'; 2 | export * from './Type'; 3 | -------------------------------------------------------------------------------- /tests/JSONSchemaToZod.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | import { z, ZodError } from 'zod'; 3 | import { JSONSchemaToZod } from '../src/JSONSchemaToZod'; 4 | import { type JSONSchema } from '../src/Type'; 5 | 6 | describe('JSONSchemaToZod', () => 7 | { 8 | it('should convert a simple string schema', () => 9 | { 10 | const jsonSchema = { type: 'string' }; 11 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 12 | 13 | expect(zodSchema).toBeInstanceOf(z.ZodString); 14 | expect(() => zodSchema.parse('test')).not.toThrow(); 15 | expect(() => zodSchema.parse(123)).toThrow(ZodError); 16 | }); 17 | 18 | it('should convert a number schema', () => 19 | { 20 | const jsonSchema = { type: 'number' }; 21 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 22 | 23 | expect(zodSchema).toBeInstanceOf(z.ZodNumber); 24 | expect(() => zodSchema.parse(123)).not.toThrow(); 25 | expect(() => zodSchema.parse('test')).toThrow(ZodError); 26 | }); 27 | 28 | it('should convert a boolean schema', () => 29 | { 30 | const jsonSchema = { type: 'boolean' }; 31 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 32 | 33 | expect(zodSchema).toBeInstanceOf(z.ZodBoolean); 34 | expect(() => zodSchema.parse(true)).not.toThrow(); 35 | expect(() => zodSchema.parse(false)).not.toThrow(); 36 | expect(() => zodSchema.parse('true')).toThrow(ZodError); 37 | }); 38 | 39 | it('should convert an array schema', () => 40 | { 41 | const jsonSchema = { type: 'array', items: { type: 'string' } }; 42 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 43 | 44 | expect(zodSchema).toBeInstanceOf(z.ZodArray); 45 | expect(() => zodSchema.parse(['test'])).not.toThrow(); 46 | expect(() => zodSchema.parse([123])).toThrow(ZodError); 47 | }); 48 | 49 | it('should convert an object schema', () => 50 | { 51 | const jsonSchema = { 52 | type: 'object', 53 | properties: { 54 | name: { type: 'string' }, 55 | age: { type: 'number' } 56 | }, 57 | required: ['name'] 58 | }; 59 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 60 | 61 | expect(zodSchema).toBeInstanceOf(z.ZodObject); 62 | expect(() => zodSchema.parse({ name: 'John', age: 30 })).not.toThrow(); 63 | expect(() => zodSchema.parse({ name: 'John' })).not.toThrow(); 64 | expect(() => zodSchema.parse({ age: 30 })).toThrow(ZodError); 65 | }); 66 | 67 | it('should handle enum values in string schema', () => 68 | { 69 | const jsonSchema = { type: 'string', enum: ['Alice', 'Bob'] }; 70 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 71 | 72 | expect(zodSchema).toBeInstanceOf(z.ZodEffects); 73 | expect(() => zodSchema.parse('Alice')).not.toThrow(); 74 | expect(() => zodSchema.parse('Charlie')).toThrow(ZodError); 75 | }); 76 | 77 | it('should handle format-specific string schemas (email)', () => 78 | { 79 | const jsonSchema = { type: 'string', format: 'email' }; 80 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 81 | 82 | expect(zodSchema).toBeInstanceOf(z.ZodString); 83 | expect(() => zodSchema.parse('test@example.com')).not.toThrow(); 84 | expect(() => zodSchema.parse('invalid-email')).toThrow(ZodError); 85 | }); 86 | 87 | it('should handle oneOf combinator', () => 88 | { 89 | const jsonSchema = { oneOf: [{ type: 'string' }, { type: 'number' }] }; 90 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 91 | 92 | expect(zodSchema).toBeInstanceOf(z.ZodUnion); 93 | expect(() => zodSchema.parse('test')).not.toThrow(); 94 | expect(() => zodSchema.parse(123)).not.toThrow(); 95 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 96 | }); 97 | 98 | it('should handle allOf combinator', () => 99 | { 100 | const jsonSchema: JSONSchema = { 101 | allOf: [ 102 | { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] }, 103 | { type: 'object', properties: { age: { type: 'number' } }, required: ['age'] } 104 | ] 105 | }; 106 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 107 | 108 | expect(zodSchema).toBeInstanceOf(z.ZodObject); 109 | expect(() => zodSchema.parse({ name: 'John', age: 30 })).not.toThrow(); 110 | expect(() => zodSchema.parse({ name: 'John' })).toThrow(ZodError); 111 | }); 112 | 113 | it('should handle anyOf combinator', () => 114 | { 115 | const jsonSchema = { anyOf: [{ type: 'string' }, { type: 'number' }] }; 116 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 117 | 118 | expect(zodSchema).toBeInstanceOf(z.ZodUnion); 119 | expect(() => zodSchema.parse('test')).not.toThrow(); 120 | expect(() => zodSchema.parse(123)).not.toThrow(); 121 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 122 | }); 123 | 124 | it('should handle additionalProperties as true', () => 125 | { 126 | const jsonSchema = { 127 | type: 'object', 128 | properties: { name: { type: 'string' } }, 129 | additionalProperties: true 130 | }; 131 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 132 | 133 | expect(zodSchema).toBeInstanceOf(z.ZodObject); 134 | expect(() => zodSchema.parse({ name: 'John', age: 30 })).not.toThrow(); 135 | }); 136 | 137 | it('should handle additionalProperties as a schema', () => 138 | { 139 | const jsonSchema = { 140 | type: 'object', 141 | properties: { name: { type: 'string' } }, 142 | additionalProperties: { type: 'number' } 143 | }; 144 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 145 | 146 | expect(zodSchema).toBeInstanceOf(z.ZodObject); 147 | expect(() => zodSchema.parse({ name: 'John', age: 30 })).not.toThrow(); 148 | expect(() => zodSchema.parse({ name: 'John', age: 'thirty' })).toThrow(ZodError); 149 | }); 150 | 151 | it('should throw error for unsupported schema type', () => 152 | { 153 | const jsonSchema = { type: 'unsupportedType' }; 154 | expect(() => JSONSchemaToZod.convert(jsonSchema)).toThrow('Unsupported schema type'); 155 | }); 156 | }); 157 | -------------------------------------------------------------------------------- /tests/conditional.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | import { z, ZodError } from 'zod'; 3 | import { JSONSchemaToZod } from '../src/JSONSchemaToZod'; 4 | import { type JSONSchema } from '../src/Type'; 5 | 6 | describe('JSONSchemaToZod Conditional Validation', () => { 7 | it('should handle if-then-else conditional validation for postal codes', () => { 8 | const jsonSchema: JSONSchema = { 9 | type: 'object', 10 | properties: { 11 | street_address: { 12 | type: 'string' 13 | }, 14 | country: { 15 | default: 'United States of America', 16 | enum: ['United States of America', 'Canada'] 17 | }, 18 | postal_code: { 19 | type: 'string' 20 | } 21 | }, 22 | if: { 23 | properties: { 24 | country: { const: 'United States of America' } 25 | } 26 | }, 27 | then: { 28 | properties: { 29 | postal_code: { pattern: '[0-9]{5}(-[0-9]{4})?' } 30 | } 31 | }, 32 | else: { 33 | properties: { 34 | postal_code: { pattern: '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]' } 35 | } 36 | } 37 | }; 38 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 39 | 40 | // Should be a refined schema (ZodEffects wrapping ZodObject) 41 | expect(zodSchema).toBeInstanceOf(z.ZodEffects); 42 | 43 | // Should accept US address with valid US postal code 44 | expect(() => zodSchema.parse({ 45 | street_address: '123 Main St', 46 | country: 'United States of America', 47 | postal_code: '12345' 48 | })).not.toThrow(); 49 | 50 | // Should accept US address with valid US postal code with extension 51 | expect(() => zodSchema.parse({ 52 | street_address: '123 Main St', 53 | country: 'United States of America', 54 | postal_code: '12345-6789' 55 | })).not.toThrow(); 56 | 57 | // Should reject US address with invalid US postal code 58 | expect(() => zodSchema.parse({ 59 | street_address: '123 Main St', 60 | country: 'United States of America', 61 | postal_code: 'A1B 2C3' 62 | })).toThrow(ZodError); 63 | 64 | // Should accept Canadian address with valid Canadian postal code 65 | expect(() => zodSchema.parse({ 66 | street_address: '123 Main St', 67 | country: 'Canada', 68 | postal_code: 'A1B 2C3' 69 | })).not.toThrow(); 70 | 71 | // Should reject Canadian address with invalid Canadian postal code 72 | expect(() => zodSchema.parse({ 73 | street_address: '123 Main St', 74 | country: 'Canada', 75 | postal_code: '12345' 76 | })).toThrow(ZodError); 77 | 78 | // Should use default country (US) if not specified 79 | expect(() => zodSchema.parse({ 80 | street_address: '123 Main St', 81 | postal_code: '12345' 82 | })).not.toThrow(); 83 | 84 | // Should reject default country (US) with invalid postal code 85 | expect(() => zodSchema.parse({ 86 | street_address: '123 Main St', 87 | postal_code: 'A1B 2C3' 88 | })).toThrow(ZodError); 89 | }); 90 | 91 | it('should handle simple if-then condition without else', () => { 92 | const jsonSchema: JSONSchema = { 93 | type: 'object', 94 | properties: { 95 | age: { type: 'number' }, 96 | drivingLicense: { type: 'string' } 97 | }, 98 | if: { 99 | properties: { 100 | age: { minimum: 18 } 101 | } 102 | }, 103 | then: { 104 | required: ['drivingLicense'] 105 | } 106 | }; 107 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 108 | 109 | // Should accept adult with driving license 110 | expect(() => zodSchema.parse({ 111 | age: 21, 112 | drivingLicense: 'ABC123' 113 | })).not.toThrow(); 114 | 115 | // Should reject adult without driving license 116 | expect(() => zodSchema.parse({ 117 | age: 21 118 | })).toThrow(ZodError); 119 | 120 | // Should accept minor without driving license 121 | expect(() => zodSchema.parse({ 122 | age: 16 123 | })).not.toThrow(); 124 | }); 125 | 126 | it('should handle nested conditional validation', () => { 127 | const jsonSchema: JSONSchema = { 128 | type: 'object', 129 | properties: { 130 | paymentMethod: { 131 | type: 'string', 132 | enum: ['credit_card', 'bank_transfer', 'paypal'] 133 | }, 134 | creditCardNumber: { type: 'string' }, 135 | bankAccount: { type: 'string' }, 136 | paypalEmail: { type: 'string', format: 'email' } 137 | }, 138 | required: ['paymentMethod'], 139 | if: { 140 | properties: { 141 | paymentMethod: { const: 'credit_card' } 142 | } 143 | }, 144 | then: { 145 | required: ['creditCardNumber'] 146 | }, 147 | else: { 148 | if: { 149 | properties: { 150 | paymentMethod: { const: 'bank_transfer' } 151 | } 152 | }, 153 | then: { 154 | required: ['bankAccount'] 155 | }, 156 | else: { 157 | required: ['paypalEmail'] 158 | } 159 | } 160 | }; 161 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 162 | 163 | // Should accept credit card payment with credit card number 164 | expect(() => zodSchema.parse({ 165 | paymentMethod: 'credit_card', 166 | creditCardNumber: '4111111111111111' 167 | })).not.toThrow(); 168 | 169 | // Should reject credit card payment without credit card number 170 | expect(() => zodSchema.parse({ 171 | paymentMethod: 'credit_card' 172 | })).toThrow(ZodError); 173 | 174 | // Should accept bank transfer with bank account 175 | expect(() => zodSchema.parse({ 176 | paymentMethod: 'bank_transfer', 177 | bankAccount: '123456789' 178 | })).not.toThrow(); 179 | 180 | // Should reject bank transfer without bank account 181 | expect(() => zodSchema.parse({ 182 | paymentMethod: 'bank_transfer' 183 | })).toThrow(ZodError); 184 | 185 | // Should accept paypal with email 186 | expect(() => zodSchema.parse({ 187 | paymentMethod: 'paypal', 188 | paypalEmail: 'test@example.com' 189 | })).not.toThrow(); 190 | 191 | // Should reject paypal without email 192 | expect(() => zodSchema.parse({ 193 | paymentMethod: 'paypal' 194 | })).toThrow(ZodError); 195 | 196 | // Should reject paypal with invalid email 197 | expect(() => zodSchema.parse({ 198 | paymentMethod: 'paypal', 199 | paypalEmail: 'invalid-email' 200 | })).toThrow(ZodError); 201 | }); 202 | }); -------------------------------------------------------------------------------- /tests/nullable-anyof.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | import { z, ZodError } from 'zod'; 3 | import { JSONSchemaToZod } from '../src/JSONSchemaToZod'; 4 | import { type JSONSchema } from '../src/Type'; 5 | 6 | describe('JSONSchemaToZod Nullable Types with anyOf', () => { 7 | it('should handle nullable string using anyOf syntax', () => { 8 | const jsonSchema: JSONSchema = { 9 | anyOf: [ 10 | { type: 'string' }, 11 | { type: 'null' } 12 | ] 13 | }; 14 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 15 | 16 | // Should be a union schema 17 | expect(zodSchema).toBeInstanceOf(z.ZodUnion); 18 | 19 | // Should accept string values 20 | expect(() => zodSchema.parse('test')).not.toThrow(); 21 | 22 | // Should accept null 23 | expect(() => zodSchema.parse(null)).not.toThrow(); 24 | 25 | // Should reject other types 26 | expect(() => zodSchema.parse(123)).toThrow(ZodError); 27 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 28 | }); 29 | 30 | it('should handle nullable string with format using anyOf syntax', () => { 31 | const jsonSchema: JSONSchema = { 32 | anyOf: [ 33 | { type: 'string', format: 'email' }, 34 | { type: 'null' } 35 | ] 36 | }; 37 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 38 | 39 | // Should accept valid email 40 | expect(() => zodSchema.parse('test@example.com')).not.toThrow(); 41 | 42 | // Should accept null 43 | expect(() => zodSchema.parse(null)).not.toThrow(); 44 | 45 | // Should reject invalid email 46 | expect(() => zodSchema.parse('not-an-email')).toThrow(ZodError); 47 | }); 48 | 49 | it('should handle nullable number using anyOf syntax', () => { 50 | const jsonSchema: JSONSchema = { 51 | anyOf: [ 52 | { type: 'number' }, 53 | { type: 'null' } 54 | ] 55 | }; 56 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 57 | 58 | // Should accept number values 59 | expect(() => zodSchema.parse(42)).not.toThrow(); 60 | 61 | // Should accept null 62 | expect(() => zodSchema.parse(null)).not.toThrow(); 63 | 64 | // Should reject other types 65 | expect(() => zodSchema.parse('test')).toThrow(ZodError); 66 | }); 67 | 68 | it('should handle multiple types with null using anyOf syntax', () => { 69 | const jsonSchema: JSONSchema = { 70 | anyOf: [ 71 | { type: 'string' }, 72 | { type: 'number' }, 73 | { type: 'null' } 74 | ] 75 | }; 76 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 77 | 78 | // Should accept string values 79 | expect(() => zodSchema.parse('test')).not.toThrow(); 80 | 81 | // Should accept number values 82 | expect(() => zodSchema.parse(42)).not.toThrow(); 83 | 84 | // Should accept null 85 | expect(() => zodSchema.parse(null)).not.toThrow(); 86 | 87 | // Should reject other types 88 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 89 | }); 90 | 91 | it('should handle nullable in object properties using anyOf syntax', () => { 92 | const jsonSchema: JSONSchema = { 93 | type: 'object', 94 | properties: { 95 | requiredString: { type: 'string' }, 96 | nullableString: { 97 | anyOf: [ 98 | { type: 'string' }, 99 | { type: 'null' } 100 | ] 101 | } 102 | }, 103 | required: ['requiredString'] 104 | }; 105 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 106 | 107 | // Should accept object with string in nullable field 108 | expect(() => zodSchema.parse({ 109 | requiredString: 'hello', 110 | nullableString: 'world' 111 | })).not.toThrow(); 112 | 113 | // Should accept object with null in nullable field 114 | expect(() => zodSchema.parse({ 115 | requiredString: 'hello', 116 | nullableString: null 117 | })).not.toThrow(); 118 | 119 | // Should accept object without the optional nullable field 120 | expect(() => zodSchema.parse({ 121 | requiredString: 'hello' 122 | })).not.toThrow(); 123 | 124 | // Should reject object with wrong type in nullable field 125 | expect(() => zodSchema.parse({ 126 | requiredString: 'hello', 127 | nullableString: 123 128 | })).toThrow(ZodError); 129 | }); 130 | 131 | // Compare both approaches to ensure they produce equivalent results 132 | it('should produce equivalent results for type array and anyOf approaches', () => { 133 | const typeArraySchema: JSONSchema = { type: ['string', 'null'] }; 134 | const anyOfSchema: JSONSchema = { 135 | anyOf: [ 136 | { type: 'string' }, 137 | { type: 'null' } 138 | ] 139 | }; 140 | 141 | const typeArrayZodSchema = JSONSchemaToZod.convert(typeArraySchema); 142 | const anyOfZodSchema = JSONSchemaToZod.convert(anyOfSchema); 143 | 144 | // Both should accept string values 145 | expect(() => typeArrayZodSchema.parse('test')).not.toThrow(); 146 | expect(() => anyOfZodSchema.parse('test')).not.toThrow(); 147 | 148 | // Both should accept null 149 | expect(() => typeArrayZodSchema.parse(null)).not.toThrow(); 150 | expect(() => anyOfZodSchema.parse(null)).not.toThrow(); 151 | 152 | // Both should reject other types 153 | expect(() => typeArrayZodSchema.parse(123)).toThrow(ZodError); 154 | expect(() => anyOfZodSchema.parse(123)).toThrow(ZodError); 155 | }); 156 | }); -------------------------------------------------------------------------------- /tests/nullable.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | import { z, ZodError } from 'zod'; 3 | import { JSONSchemaToZod } from '../src/JSONSchemaToZod'; 4 | import { type JSONSchema } from '../src/Type'; 5 | 6 | describe('JSONSchemaToZod Nullable Types', () => { 7 | it('should handle nullable string using type array', () => { 8 | const jsonSchema: JSONSchema = { type: ['string', 'null'] }; 9 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 10 | 11 | // Should be a nullable string schema 12 | expect(zodSchema).toBeInstanceOf(z.ZodNullable); 13 | 14 | // Should accept string values 15 | expect(() => zodSchema.parse('test')).not.toThrow(); 16 | 17 | // Should accept null 18 | expect(() => zodSchema.parse(null)).not.toThrow(); 19 | 20 | // Should reject other types 21 | expect(() => zodSchema.parse(123)).toThrow(ZodError); 22 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 23 | }); 24 | 25 | it('should handle nullable string with format', () => { 26 | const jsonSchema: JSONSchema = { 27 | type: ['string', 'null'], 28 | format: 'email' 29 | }; 30 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 31 | 32 | // Should accept valid email 33 | expect(() => zodSchema.parse('test@example.com')).not.toThrow(); 34 | 35 | // Should accept null 36 | expect(() => zodSchema.parse(null)).not.toThrow(); 37 | 38 | // Should reject invalid email 39 | expect(() => zodSchema.parse('not-an-email')).toThrow(ZodError); 40 | }); 41 | 42 | it('should handle nullable number', () => { 43 | const jsonSchema: JSONSchema = { type: ['number', 'null'] }; 44 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 45 | 46 | // Should accept number values 47 | expect(() => zodSchema.parse(42)).not.toThrow(); 48 | 49 | // Should accept null 50 | expect(() => zodSchema.parse(null)).not.toThrow(); 51 | 52 | // Should reject other types 53 | expect(() => zodSchema.parse('test')).toThrow(ZodError); 54 | }); 55 | 56 | it('should handle multiple non-null types with null', () => { 57 | const jsonSchema: JSONSchema = { type: ['string', 'number', 'null'] }; 58 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 59 | 60 | // Should accept string values 61 | expect(() => zodSchema.parse('test')).not.toThrow(); 62 | 63 | // Should accept number values 64 | expect(() => zodSchema.parse(42)).not.toThrow(); 65 | 66 | // Should accept null 67 | expect(() => zodSchema.parse(null)).not.toThrow(); 68 | 69 | // Should reject other types 70 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 71 | }); 72 | 73 | it('should handle nullable in object properties', () => { 74 | const jsonSchema: JSONSchema = { 75 | type: 'object', 76 | properties: { 77 | requiredString: { type: 'string' }, 78 | nullableString: { type: ['string', 'null'] } 79 | }, 80 | required: ['requiredString'] 81 | }; 82 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 83 | 84 | // Should accept object with string in nullable field 85 | expect(() => zodSchema.parse({ 86 | requiredString: 'hello', 87 | nullableString: 'world' 88 | })).not.toThrow(); 89 | 90 | // Should accept object with null in nullable field 91 | expect(() => zodSchema.parse({ 92 | requiredString: 'hello', 93 | nullableString: null 94 | })).not.toThrow(); 95 | 96 | // Should accept object without the optional nullable field 97 | expect(() => zodSchema.parse({ 98 | requiredString: 'hello' 99 | })).not.toThrow(); 100 | 101 | // Should reject object with wrong type in nullable field 102 | expect(() => zodSchema.parse({ 103 | requiredString: 'hello', 104 | nullableString: 123 105 | })).toThrow(ZodError); 106 | }); 107 | }); -------------------------------------------------------------------------------- /tests/undefined-type.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | import { z, ZodError } from 'zod'; 3 | import { JSONSchemaToZod } from '../src/JSONSchemaToZod'; 4 | import { type JSONSchema } from '../src/Type'; 5 | 6 | describe('JSONSchemaToZod Undefined Type', () => { 7 | it('should handle schema without type property', () => { 8 | const jsonSchema: JSONSchema = {}; 9 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 10 | 11 | // Should be an any schema 12 | expect(() => zodSchema.parse('test')).not.toThrow(); 13 | expect(() => zodSchema.parse(123)).not.toThrow(); 14 | expect(() => zodSchema.parse(true)).not.toThrow(); 15 | expect(() => zodSchema.parse(null)).not.toThrow(); 16 | }); 17 | 18 | it('should handle schema with oneOf but no type property', () => { 19 | const jsonSchema: JSONSchema = { 20 | oneOf: [ 21 | { type: 'string' }, 22 | { type: 'number' } 23 | ] 24 | }; 25 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 26 | 27 | // Should be a union schema 28 | expect(zodSchema).toBeInstanceOf(z.ZodUnion); 29 | expect(() => zodSchema.parse('test')).not.toThrow(); 30 | expect(() => zodSchema.parse(123)).not.toThrow(); 31 | expect(() => zodSchema.parse(true)).toThrow(ZodError); 32 | }); 33 | 34 | it('should handle schema with properties but no type property', () => { 35 | const jsonSchema: JSONSchema = { 36 | properties: { 37 | name: { type: 'string' }, 38 | age: { type: 'number' } 39 | }, 40 | required: ['name'] 41 | }; 42 | const zodSchema = JSONSchemaToZod.convert(jsonSchema); 43 | 44 | // Should be an object schema 45 | expect(zodSchema).toBeInstanceOf(z.ZodObject); 46 | expect(() => zodSchema.parse({ name: 'John', age: 30 })).not.toThrow(); 47 | expect(() => zodSchema.parse({ name: 'John' })).not.toThrow(); 48 | expect(() => zodSchema.parse({ age: 30 })).toThrow(ZodError); 49 | }); 50 | }); -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["**/*.ts", "**/*.tsx"], 4 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["ESNext", "DOM"], 4 | "target": "ESNext", 5 | "module": "ESNext", 6 | 7 | // Node module resolution 8 | "moduleResolution": "node", 9 | "verbatimModuleSyntax": true, 10 | "esModuleInterop": true, 11 | 12 | // Emit options 13 | "declaration": true, 14 | "emitDeclarationOnly": false, 15 | "outDir": "./dist", 16 | "resolveJsonModule": true, 17 | "allowSyntheticDefaultImports": true, 18 | 19 | // Best practices 20 | "strict": true, 21 | "skipLibCheck": true, 22 | "noFallthroughCasesInSwitch": true, 23 | 24 | // Some stricter flags (disabled by default) 25 | "noUnusedLocals": true, 26 | "noUnusedParameters": true, 27 | "noPropertyAccessFromIndexSignature": true 28 | }, 29 | "include": ["src/**/*.ts", "tests/**/*.ts"], 30 | "exclude": ["node_modules", "dist", "tests"] 31 | } -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['tests/**/*.test.ts'] 8 | } 9 | }); 10 | --------------------------------------------------------------------------------