ADAPT-Chase commited on
Commit
eaa66c2
·
verified ·
1 Parent(s): 280e716

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -0
  2. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +201 -0
  3. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md +105 -0
  4. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +384 -0
  5. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +27 -0
  6. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/index.d.ts +16 -0
  7. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +12 -0
  8. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js +65 -0
  9. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js +315 -0
  10. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json +74 -0
  11. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.js.map +0 -0
  12. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.mjs +0 -0
  13. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.mjs.map +0 -0
  14. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/package.json +91 -0
  15. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/LICENSE +201 -0
  16. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/README.md +369 -0
  17. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/index.cjs +1534 -0
  18. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/index.d.cts +143 -0
  19. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs +1335 -0
  20. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs +1677 -0
  21. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/types.ts +29 -0
  22. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/index.d.ts +143 -0
  23. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/index.js +1509 -0
  24. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/std__path/posix.js +1313 -0
  25. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/std__path/windows.js +1655 -0
  26. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/types.d.ts +23 -0
  27. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/types.ts +29 -0
  28. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/package.json +63 -0
  29. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/LICENSE +201 -0
  30. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/README.md +98 -0
  31. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/index.cjs +581 -0
  32. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/index.d.cts +24 -0
  33. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/types.cts +31 -0
  34. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/index.d.ts +24 -0
  35. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/index.js +579 -0
  36. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/types.d.ts +23 -0
  37. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/types.ts +31 -0
  38. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/package.json +57 -0
  39. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/LICENSE +201 -0
  40. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/README.md +30 -0
  41. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/dist/cjs/types.d.cts +847 -0
  42. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/dist/esm/types.d.ts +847 -0
  43. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/package.json +49 -0
  44. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/LICENSE +19 -0
  45. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/README.md +128 -0
  46. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/conf/config-schema.js +79 -0
  47. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/conf/environments.js +215 -0
  48. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +1212 -0
  49. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +1 -0
  50. platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -0
.gitattributes CHANGED
@@ -1945,3 +1945,7 @@ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-c
1945
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
1946
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
1947
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@esbuild/linux-x64/bin/esbuild filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
1945
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
1946
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
1947
  platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@esbuild/linux-x64/bin/esbuild filter=lfs diff=lfs merge=lfs -text
1948
+ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
1949
+ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@rollup/rollup-linux-x64-musl/rollup.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
1950
+ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@tailwindcss/oxide-linux-x64-gnu/tailwindcss-oxide.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
1951
+ platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@tailwindcss/oxide-linux-x64-musl/tailwindcss-oxide.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # eslint-visitor-keys
2
+
3
+ [![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys)
4
+ [![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys)
5
+ [![Build Status](https://github.com/eslint/eslint-visitor-keys/workflows/CI/badge.svg)](https://github.com/eslint/eslint-visitor-keys/actions)
6
+
7
+ Constants and utilities about visitor keys to traverse AST.
8
+
9
+ ## 💿 Installation
10
+
11
+ Use [npm] to install.
12
+
13
+ ```bash
14
+ $ npm install eslint-visitor-keys
15
+ ```
16
+
17
+ ### Requirements
18
+
19
+ - [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0`
20
+
21
+
22
+ ## 📖 Usage
23
+
24
+ To use in an ESM file:
25
+
26
+ ```js
27
+ import * as evk from "eslint-visitor-keys"
28
+ ```
29
+
30
+ To use in a CommonJS file:
31
+
32
+ ```js
33
+ const evk = require("eslint-visitor-keys")
34
+ ```
35
+
36
+ ### evk.KEYS
37
+
38
+ > type: `{ [type: string]: string[] | undefined }`
39
+
40
+ Visitor keys. This keys are frozen.
41
+
42
+ This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes.
43
+
44
+ For example:
45
+
46
+ ```
47
+ console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"]
48
+ ```
49
+
50
+ ### evk.getKeys(node)
51
+
52
+ > type: `(node: object) => string[]`
53
+
54
+ Get the visitor keys of a given AST node.
55
+
56
+ This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`.
57
+
58
+ This will be used to traverse unknown nodes.
59
+
60
+ For example:
61
+
62
+ ```js
63
+ const node = {
64
+ type: "AssignmentExpression",
65
+ left: { type: "Identifier", name: "foo" },
66
+ right: { type: "Literal", value: 0 }
67
+ }
68
+ console.log(evk.getKeys(node)) // → ["type", "left", "right"]
69
+ ```
70
+
71
+ ### evk.unionWith(additionalKeys)
72
+
73
+ > type: `(additionalKeys: object) => { [type: string]: string[] | undefined }`
74
+
75
+ Make the union set with `evk.KEYS` and the given keys.
76
+
77
+ - The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that.
78
+ - It removes duplicated keys as keeping the first one.
79
+
80
+ For example:
81
+
82
+ ```js
83
+ console.log(evk.unionWith({
84
+ MethodDefinition: ["decorators"]
85
+ })) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
86
+ ```
87
+
88
+ ## 📰 Change log
89
+
90
+ See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases).
91
+
92
+ ## 🍻 Contributing
93
+
94
+ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/).
95
+
96
+ ### Development commands
97
+
98
+ - `npm test` runs tests and measures code coverage.
99
+ - `npm run lint` checks source codes with ESLint.
100
+ - `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser.
101
+
102
+
103
+ [npm]: https://www.npmjs.com/
104
+ [Node.js]: https://nodejs.org/
105
+ [ESTree]: https://github.com/estree/estree
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
7
+ */
8
+
9
+ /**
10
+ * @type {VisitorKeys}
11
+ */
12
+ const KEYS = {
13
+ ArrayExpression: [
14
+ "elements"
15
+ ],
16
+ ArrayPattern: [
17
+ "elements"
18
+ ],
19
+ ArrowFunctionExpression: [
20
+ "params",
21
+ "body"
22
+ ],
23
+ AssignmentExpression: [
24
+ "left",
25
+ "right"
26
+ ],
27
+ AssignmentPattern: [
28
+ "left",
29
+ "right"
30
+ ],
31
+ AwaitExpression: [
32
+ "argument"
33
+ ],
34
+ BinaryExpression: [
35
+ "left",
36
+ "right"
37
+ ],
38
+ BlockStatement: [
39
+ "body"
40
+ ],
41
+ BreakStatement: [
42
+ "label"
43
+ ],
44
+ CallExpression: [
45
+ "callee",
46
+ "arguments"
47
+ ],
48
+ CatchClause: [
49
+ "param",
50
+ "body"
51
+ ],
52
+ ChainExpression: [
53
+ "expression"
54
+ ],
55
+ ClassBody: [
56
+ "body"
57
+ ],
58
+ ClassDeclaration: [
59
+ "id",
60
+ "superClass",
61
+ "body"
62
+ ],
63
+ ClassExpression: [
64
+ "id",
65
+ "superClass",
66
+ "body"
67
+ ],
68
+ ConditionalExpression: [
69
+ "test",
70
+ "consequent",
71
+ "alternate"
72
+ ],
73
+ ContinueStatement: [
74
+ "label"
75
+ ],
76
+ DebuggerStatement: [],
77
+ DoWhileStatement: [
78
+ "body",
79
+ "test"
80
+ ],
81
+ EmptyStatement: [],
82
+ ExperimentalRestProperty: [
83
+ "argument"
84
+ ],
85
+ ExperimentalSpreadProperty: [
86
+ "argument"
87
+ ],
88
+ ExportAllDeclaration: [
89
+ "exported",
90
+ "source"
91
+ ],
92
+ ExportDefaultDeclaration: [
93
+ "declaration"
94
+ ],
95
+ ExportNamedDeclaration: [
96
+ "declaration",
97
+ "specifiers",
98
+ "source"
99
+ ],
100
+ ExportSpecifier: [
101
+ "exported",
102
+ "local"
103
+ ],
104
+ ExpressionStatement: [
105
+ "expression"
106
+ ],
107
+ ForInStatement: [
108
+ "left",
109
+ "right",
110
+ "body"
111
+ ],
112
+ ForOfStatement: [
113
+ "left",
114
+ "right",
115
+ "body"
116
+ ],
117
+ ForStatement: [
118
+ "init",
119
+ "test",
120
+ "update",
121
+ "body"
122
+ ],
123
+ FunctionDeclaration: [
124
+ "id",
125
+ "params",
126
+ "body"
127
+ ],
128
+ FunctionExpression: [
129
+ "id",
130
+ "params",
131
+ "body"
132
+ ],
133
+ Identifier: [],
134
+ IfStatement: [
135
+ "test",
136
+ "consequent",
137
+ "alternate"
138
+ ],
139
+ ImportDeclaration: [
140
+ "specifiers",
141
+ "source"
142
+ ],
143
+ ImportDefaultSpecifier: [
144
+ "local"
145
+ ],
146
+ ImportExpression: [
147
+ "source"
148
+ ],
149
+ ImportNamespaceSpecifier: [
150
+ "local"
151
+ ],
152
+ ImportSpecifier: [
153
+ "imported",
154
+ "local"
155
+ ],
156
+ JSXAttribute: [
157
+ "name",
158
+ "value"
159
+ ],
160
+ JSXClosingElement: [
161
+ "name"
162
+ ],
163
+ JSXClosingFragment: [],
164
+ JSXElement: [
165
+ "openingElement",
166
+ "children",
167
+ "closingElement"
168
+ ],
169
+ JSXEmptyExpression: [],
170
+ JSXExpressionContainer: [
171
+ "expression"
172
+ ],
173
+ JSXFragment: [
174
+ "openingFragment",
175
+ "children",
176
+ "closingFragment"
177
+ ],
178
+ JSXIdentifier: [],
179
+ JSXMemberExpression: [
180
+ "object",
181
+ "property"
182
+ ],
183
+ JSXNamespacedName: [
184
+ "namespace",
185
+ "name"
186
+ ],
187
+ JSXOpeningElement: [
188
+ "name",
189
+ "attributes"
190
+ ],
191
+ JSXOpeningFragment: [],
192
+ JSXSpreadAttribute: [
193
+ "argument"
194
+ ],
195
+ JSXSpreadChild: [
196
+ "expression"
197
+ ],
198
+ JSXText: [],
199
+ LabeledStatement: [
200
+ "label",
201
+ "body"
202
+ ],
203
+ Literal: [],
204
+ LogicalExpression: [
205
+ "left",
206
+ "right"
207
+ ],
208
+ MemberExpression: [
209
+ "object",
210
+ "property"
211
+ ],
212
+ MetaProperty: [
213
+ "meta",
214
+ "property"
215
+ ],
216
+ MethodDefinition: [
217
+ "key",
218
+ "value"
219
+ ],
220
+ NewExpression: [
221
+ "callee",
222
+ "arguments"
223
+ ],
224
+ ObjectExpression: [
225
+ "properties"
226
+ ],
227
+ ObjectPattern: [
228
+ "properties"
229
+ ],
230
+ PrivateIdentifier: [],
231
+ Program: [
232
+ "body"
233
+ ],
234
+ Property: [
235
+ "key",
236
+ "value"
237
+ ],
238
+ PropertyDefinition: [
239
+ "key",
240
+ "value"
241
+ ],
242
+ RestElement: [
243
+ "argument"
244
+ ],
245
+ ReturnStatement: [
246
+ "argument"
247
+ ],
248
+ SequenceExpression: [
249
+ "expressions"
250
+ ],
251
+ SpreadElement: [
252
+ "argument"
253
+ ],
254
+ StaticBlock: [
255
+ "body"
256
+ ],
257
+ Super: [],
258
+ SwitchCase: [
259
+ "test",
260
+ "consequent"
261
+ ],
262
+ SwitchStatement: [
263
+ "discriminant",
264
+ "cases"
265
+ ],
266
+ TaggedTemplateExpression: [
267
+ "tag",
268
+ "quasi"
269
+ ],
270
+ TemplateElement: [],
271
+ TemplateLiteral: [
272
+ "quasis",
273
+ "expressions"
274
+ ],
275
+ ThisExpression: [],
276
+ ThrowStatement: [
277
+ "argument"
278
+ ],
279
+ TryStatement: [
280
+ "block",
281
+ "handler",
282
+ "finalizer"
283
+ ],
284
+ UnaryExpression: [
285
+ "argument"
286
+ ],
287
+ UpdateExpression: [
288
+ "argument"
289
+ ],
290
+ VariableDeclaration: [
291
+ "declarations"
292
+ ],
293
+ VariableDeclarator: [
294
+ "id",
295
+ "init"
296
+ ],
297
+ WhileStatement: [
298
+ "test",
299
+ "body"
300
+ ],
301
+ WithStatement: [
302
+ "object",
303
+ "body"
304
+ ],
305
+ YieldExpression: [
306
+ "argument"
307
+ ]
308
+ };
309
+
310
+ // Types.
311
+ const NODE_TYPES = Object.keys(KEYS);
312
+
313
+ // Freeze the keys.
314
+ for (const type of NODE_TYPES) {
315
+ Object.freeze(KEYS[type]);
316
+ }
317
+ Object.freeze(KEYS);
318
+
319
+ /**
320
+ * @author Toru Nagashima <https://github.com/mysticatea>
321
+ * See LICENSE file in root directory for full license.
322
+ */
323
+
324
+ /**
325
+ * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
326
+ */
327
+
328
+ // List to ignore keys.
329
+ const KEY_BLACKLIST = new Set([
330
+ "parent",
331
+ "leadingComments",
332
+ "trailingComments"
333
+ ]);
334
+
335
+ /**
336
+ * Check whether a given key should be used or not.
337
+ * @param {string} key The key to check.
338
+ * @returns {boolean} `true` if the key should be used.
339
+ */
340
+ function filterKey(key) {
341
+ return !KEY_BLACKLIST.has(key) && key[0] !== "_";
342
+ }
343
+
344
+ /**
345
+ * Get visitor keys of a given node.
346
+ * @param {object} node The AST node to get keys.
347
+ * @returns {readonly string[]} Visitor keys of the node.
348
+ */
349
+ function getKeys(node) {
350
+ return Object.keys(node).filter(filterKey);
351
+ }
352
+
353
+ // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
354
+ // eslint-disable-next-line valid-jsdoc
355
+ /**
356
+ * Make the union set with `KEYS` and given keys.
357
+ * @param {VisitorKeys} additionalKeys The additional keys.
358
+ * @returns {VisitorKeys} The union set.
359
+ */
360
+ function unionWith(additionalKeys) {
361
+ const retv = /** @type {{
362
+ [type: string]: ReadonlyArray<string>
363
+ }} */ (Object.assign({}, KEYS));
364
+
365
+ for (const type of Object.keys(additionalKeys)) {
366
+ if (Object.prototype.hasOwnProperty.call(retv, type)) {
367
+ const keys = new Set(additionalKeys[type]);
368
+
369
+ for (const key of retv[type]) {
370
+ keys.add(key);
371
+ }
372
+
373
+ retv[type] = Object.freeze(Array.from(keys));
374
+ } else {
375
+ retv[type] = Object.freeze(Array.from(additionalKeys[type]));
376
+ }
377
+ }
378
+
379
+ return Object.freeze(retv);
380
+ }
381
+
382
+ exports.KEYS = KEYS;
383
+ exports.getKeys = getKeys;
384
+ exports.unionWith = unionWith;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ type VisitorKeys$1 = {
2
+ readonly [type: string]: readonly string[];
3
+ };
4
+ /**
5
+ * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
6
+ */
7
+ /**
8
+ * @type {VisitorKeys}
9
+ */
10
+ declare const KEYS: VisitorKeys$1;
11
+
12
+ /**
13
+ * Get visitor keys of a given node.
14
+ * @param {object} node The AST node to get keys.
15
+ * @returns {readonly string[]} Visitor keys of the node.
16
+ */
17
+ declare function getKeys(node: object): readonly string[];
18
+ /**
19
+ * Make the union set with `KEYS` and given keys.
20
+ * @param {VisitorKeys} additionalKeys The additional keys.
21
+ * @returns {VisitorKeys} The union set.
22
+ */
23
+ declare function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
24
+
25
+ type VisitorKeys = VisitorKeys$1;
26
+
27
+ export { KEYS, VisitorKeys, getKeys, unionWith };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/index.d.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Get visitor keys of a given node.
3
+ * @param {object} node The AST node to get keys.
4
+ * @returns {readonly string[]} Visitor keys of the node.
5
+ */
6
+ export function getKeys(node: object): readonly string[];
7
+ /**
8
+ * Make the union set with `KEYS` and given keys.
9
+ * @param {VisitorKeys} additionalKeys The additional keys.
10
+ * @returns {VisitorKeys} The union set.
11
+ */
12
+ export function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
13
+ export { KEYS };
14
+ export type VisitorKeys = import('./visitor-keys.js').VisitorKeys;
15
+ import KEYS from "./visitor-keys.js";
16
+ //# sourceMappingURL=index.d.ts.map
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default KEYS;
2
+ export type VisitorKeys = {
3
+ readonly [type: string]: readonly string[];
4
+ };
5
+ /**
6
+ * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
7
+ */
8
+ /**
9
+ * @type {VisitorKeys}
10
+ */
11
+ declare const KEYS: VisitorKeys;
12
+ //# sourceMappingURL=visitor-keys.d.ts.map
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @author Toru Nagashima <https://github.com/mysticatea>
3
+ * See LICENSE file in root directory for full license.
4
+ */
5
+ import KEYS from "./visitor-keys.js";
6
+
7
+ /**
8
+ * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
9
+ */
10
+
11
+ // List to ignore keys.
12
+ const KEY_BLACKLIST = new Set([
13
+ "parent",
14
+ "leadingComments",
15
+ "trailingComments"
16
+ ]);
17
+
18
+ /**
19
+ * Check whether a given key should be used or not.
20
+ * @param {string} key The key to check.
21
+ * @returns {boolean} `true` if the key should be used.
22
+ */
23
+ function filterKey(key) {
24
+ return !KEY_BLACKLIST.has(key) && key[0] !== "_";
25
+ }
26
+
27
+ /**
28
+ * Get visitor keys of a given node.
29
+ * @param {object} node The AST node to get keys.
30
+ * @returns {readonly string[]} Visitor keys of the node.
31
+ */
32
+ export function getKeys(node) {
33
+ return Object.keys(node).filter(filterKey);
34
+ }
35
+
36
+ // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
37
+ // eslint-disable-next-line valid-jsdoc
38
+ /**
39
+ * Make the union set with `KEYS` and given keys.
40
+ * @param {VisitorKeys} additionalKeys The additional keys.
41
+ * @returns {VisitorKeys} The union set.
42
+ */
43
+ export function unionWith(additionalKeys) {
44
+ const retv = /** @type {{
45
+ [type: string]: ReadonlyArray<string>
46
+ }} */ (Object.assign({}, KEYS));
47
+
48
+ for (const type of Object.keys(additionalKeys)) {
49
+ if (Object.prototype.hasOwnProperty.call(retv, type)) {
50
+ const keys = new Set(additionalKeys[type]);
51
+
52
+ for (const key of retv[type]) {
53
+ keys.add(key);
54
+ }
55
+
56
+ retv[type] = Object.freeze(Array.from(keys));
57
+ } else {
58
+ retv[type] = Object.freeze(Array.from(additionalKeys[type]));
59
+ }
60
+ }
61
+
62
+ return Object.freeze(retv);
63
+ }
64
+
65
+ export { KEYS };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.js ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
3
+ */
4
+
5
+ /**
6
+ * @type {VisitorKeys}
7
+ */
8
+ const KEYS = {
9
+ ArrayExpression: [
10
+ "elements"
11
+ ],
12
+ ArrayPattern: [
13
+ "elements"
14
+ ],
15
+ ArrowFunctionExpression: [
16
+ "params",
17
+ "body"
18
+ ],
19
+ AssignmentExpression: [
20
+ "left",
21
+ "right"
22
+ ],
23
+ AssignmentPattern: [
24
+ "left",
25
+ "right"
26
+ ],
27
+ AwaitExpression: [
28
+ "argument"
29
+ ],
30
+ BinaryExpression: [
31
+ "left",
32
+ "right"
33
+ ],
34
+ BlockStatement: [
35
+ "body"
36
+ ],
37
+ BreakStatement: [
38
+ "label"
39
+ ],
40
+ CallExpression: [
41
+ "callee",
42
+ "arguments"
43
+ ],
44
+ CatchClause: [
45
+ "param",
46
+ "body"
47
+ ],
48
+ ChainExpression: [
49
+ "expression"
50
+ ],
51
+ ClassBody: [
52
+ "body"
53
+ ],
54
+ ClassDeclaration: [
55
+ "id",
56
+ "superClass",
57
+ "body"
58
+ ],
59
+ ClassExpression: [
60
+ "id",
61
+ "superClass",
62
+ "body"
63
+ ],
64
+ ConditionalExpression: [
65
+ "test",
66
+ "consequent",
67
+ "alternate"
68
+ ],
69
+ ContinueStatement: [
70
+ "label"
71
+ ],
72
+ DebuggerStatement: [],
73
+ DoWhileStatement: [
74
+ "body",
75
+ "test"
76
+ ],
77
+ EmptyStatement: [],
78
+ ExperimentalRestProperty: [
79
+ "argument"
80
+ ],
81
+ ExperimentalSpreadProperty: [
82
+ "argument"
83
+ ],
84
+ ExportAllDeclaration: [
85
+ "exported",
86
+ "source"
87
+ ],
88
+ ExportDefaultDeclaration: [
89
+ "declaration"
90
+ ],
91
+ ExportNamedDeclaration: [
92
+ "declaration",
93
+ "specifiers",
94
+ "source"
95
+ ],
96
+ ExportSpecifier: [
97
+ "exported",
98
+ "local"
99
+ ],
100
+ ExpressionStatement: [
101
+ "expression"
102
+ ],
103
+ ForInStatement: [
104
+ "left",
105
+ "right",
106
+ "body"
107
+ ],
108
+ ForOfStatement: [
109
+ "left",
110
+ "right",
111
+ "body"
112
+ ],
113
+ ForStatement: [
114
+ "init",
115
+ "test",
116
+ "update",
117
+ "body"
118
+ ],
119
+ FunctionDeclaration: [
120
+ "id",
121
+ "params",
122
+ "body"
123
+ ],
124
+ FunctionExpression: [
125
+ "id",
126
+ "params",
127
+ "body"
128
+ ],
129
+ Identifier: [],
130
+ IfStatement: [
131
+ "test",
132
+ "consequent",
133
+ "alternate"
134
+ ],
135
+ ImportDeclaration: [
136
+ "specifiers",
137
+ "source"
138
+ ],
139
+ ImportDefaultSpecifier: [
140
+ "local"
141
+ ],
142
+ ImportExpression: [
143
+ "source"
144
+ ],
145
+ ImportNamespaceSpecifier: [
146
+ "local"
147
+ ],
148
+ ImportSpecifier: [
149
+ "imported",
150
+ "local"
151
+ ],
152
+ JSXAttribute: [
153
+ "name",
154
+ "value"
155
+ ],
156
+ JSXClosingElement: [
157
+ "name"
158
+ ],
159
+ JSXClosingFragment: [],
160
+ JSXElement: [
161
+ "openingElement",
162
+ "children",
163
+ "closingElement"
164
+ ],
165
+ JSXEmptyExpression: [],
166
+ JSXExpressionContainer: [
167
+ "expression"
168
+ ],
169
+ JSXFragment: [
170
+ "openingFragment",
171
+ "children",
172
+ "closingFragment"
173
+ ],
174
+ JSXIdentifier: [],
175
+ JSXMemberExpression: [
176
+ "object",
177
+ "property"
178
+ ],
179
+ JSXNamespacedName: [
180
+ "namespace",
181
+ "name"
182
+ ],
183
+ JSXOpeningElement: [
184
+ "name",
185
+ "attributes"
186
+ ],
187
+ JSXOpeningFragment: [],
188
+ JSXSpreadAttribute: [
189
+ "argument"
190
+ ],
191
+ JSXSpreadChild: [
192
+ "expression"
193
+ ],
194
+ JSXText: [],
195
+ LabeledStatement: [
196
+ "label",
197
+ "body"
198
+ ],
199
+ Literal: [],
200
+ LogicalExpression: [
201
+ "left",
202
+ "right"
203
+ ],
204
+ MemberExpression: [
205
+ "object",
206
+ "property"
207
+ ],
208
+ MetaProperty: [
209
+ "meta",
210
+ "property"
211
+ ],
212
+ MethodDefinition: [
213
+ "key",
214
+ "value"
215
+ ],
216
+ NewExpression: [
217
+ "callee",
218
+ "arguments"
219
+ ],
220
+ ObjectExpression: [
221
+ "properties"
222
+ ],
223
+ ObjectPattern: [
224
+ "properties"
225
+ ],
226
+ PrivateIdentifier: [],
227
+ Program: [
228
+ "body"
229
+ ],
230
+ Property: [
231
+ "key",
232
+ "value"
233
+ ],
234
+ PropertyDefinition: [
235
+ "key",
236
+ "value"
237
+ ],
238
+ RestElement: [
239
+ "argument"
240
+ ],
241
+ ReturnStatement: [
242
+ "argument"
243
+ ],
244
+ SequenceExpression: [
245
+ "expressions"
246
+ ],
247
+ SpreadElement: [
248
+ "argument"
249
+ ],
250
+ StaticBlock: [
251
+ "body"
252
+ ],
253
+ Super: [],
254
+ SwitchCase: [
255
+ "test",
256
+ "consequent"
257
+ ],
258
+ SwitchStatement: [
259
+ "discriminant",
260
+ "cases"
261
+ ],
262
+ TaggedTemplateExpression: [
263
+ "tag",
264
+ "quasi"
265
+ ],
266
+ TemplateElement: [],
267
+ TemplateLiteral: [
268
+ "quasis",
269
+ "expressions"
270
+ ],
271
+ ThisExpression: [],
272
+ ThrowStatement: [
273
+ "argument"
274
+ ],
275
+ TryStatement: [
276
+ "block",
277
+ "handler",
278
+ "finalizer"
279
+ ],
280
+ UnaryExpression: [
281
+ "argument"
282
+ ],
283
+ UpdateExpression: [
284
+ "argument"
285
+ ],
286
+ VariableDeclaration: [
287
+ "declarations"
288
+ ],
289
+ VariableDeclarator: [
290
+ "id",
291
+ "init"
292
+ ],
293
+ WhileStatement: [
294
+ "test",
295
+ "body"
296
+ ],
297
+ WithStatement: [
298
+ "object",
299
+ "body"
300
+ ],
301
+ YieldExpression: [
302
+ "argument"
303
+ ]
304
+ };
305
+
306
+ // Types.
307
+ const NODE_TYPES = Object.keys(KEYS);
308
+
309
+ // Freeze the keys.
310
+ for (const type of NODE_TYPES) {
311
+ Object.freeze(KEYS[type]);
312
+ }
313
+ Object.freeze(KEYS);
314
+
315
+ export default KEYS;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/package.json ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "eslint-visitor-keys",
3
+ "version": "3.4.3",
4
+ "description": "Constants and utilities about visitor keys to traverse AST.",
5
+ "type": "module",
6
+ "main": "dist/eslint-visitor-keys.cjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": [
10
+ {
11
+ "import": "./lib/index.js",
12
+ "require": "./dist/eslint-visitor-keys.cjs"
13
+ },
14
+ "./dist/eslint-visitor-keys.cjs"
15
+ ],
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist/index.d.ts",
20
+ "dist/visitor-keys.d.ts",
21
+ "dist/eslint-visitor-keys.cjs",
22
+ "dist/eslint-visitor-keys.d.cts",
23
+ "lib"
24
+ ],
25
+ "engines": {
26
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/estree": "^0.0.51",
30
+ "@types/estree-jsx": "^0.0.1",
31
+ "@typescript-eslint/parser": "^5.14.0",
32
+ "c8": "^7.11.0",
33
+ "chai": "^4.3.6",
34
+ "eslint": "^7.29.0",
35
+ "eslint-config-eslint": "^7.0.0",
36
+ "eslint-plugin-jsdoc": "^35.4.0",
37
+ "eslint-plugin-node": "^11.1.0",
38
+ "eslint-release": "^3.2.0",
39
+ "esquery": "^1.4.0",
40
+ "json-diff": "^0.7.3",
41
+ "mocha": "^9.2.1",
42
+ "opener": "^1.5.2",
43
+ "rollup": "^2.70.0",
44
+ "rollup-plugin-dts": "^4.2.3",
45
+ "tsd": "^0.19.1",
46
+ "typescript": "^4.6.2"
47
+ },
48
+ "scripts": {
49
+ "build": "npm run build:cjs && npm run build:types",
50
+ "build:cjs": "rollup -c",
51
+ "build:debug": "npm run build:cjs -- -m && npm run build:types",
52
+ "build:keys": "node tools/build-keys-from-ts",
53
+ "build:types": "tsc",
54
+ "lint": "eslint .",
55
+ "prepare": "npm run build",
56
+ "release:generate:latest": "eslint-generate-release",
57
+ "release:generate:alpha": "eslint-generate-prerelease alpha",
58
+ "release:generate:beta": "eslint-generate-prerelease beta",
59
+ "release:generate:rc": "eslint-generate-prerelease rc",
60
+ "release:publish": "eslint-publish-release",
61
+ "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run test:types",
62
+ "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html",
63
+ "test:types": "tsd"
64
+ },
65
+ "repository": "eslint/eslint-visitor-keys",
66
+ "funding": "https://opencollective.com/eslint",
67
+ "keywords": [],
68
+ "author": "Toru Nagashima (https://github.com/mysticatea)",
69
+ "license": "Apache-2.0",
70
+ "bugs": {
71
+ "url": "https://github.com/eslint/eslint-visitor-keys/issues"
72
+ },
73
+ "homepage": "https://github.com/eslint/eslint-visitor-keys#readme"
74
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.js.map ADDED
The diff for this file is too large to render. See raw diff
 
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.mjs ADDED
The diff for this file is too large to render. See raw diff
 
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/index.mjs.map ADDED
The diff for this file is too large to render. See raw diff
 
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint-community/regexpp/package.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@eslint-community/regexpp",
3
+ "version": "4.12.1",
4
+ "description": "Regular expression parser for ECMAScript.",
5
+ "keywords": [
6
+ "regexp",
7
+ "regular",
8
+ "expression",
9
+ "parser",
10
+ "validator",
11
+ "ast",
12
+ "abstract",
13
+ "syntax",
14
+ "tree",
15
+ "ecmascript",
16
+ "es2015",
17
+ "es2016",
18
+ "es2017",
19
+ "es2018",
20
+ "es2019",
21
+ "es2020",
22
+ "es2021",
23
+ "annexB"
24
+ ],
25
+ "homepage": "https://github.com/eslint-community/regexpp#readme",
26
+ "bugs": {
27
+ "url": "https://github.com/eslint-community/regexpp/issues"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/eslint-community/regexpp"
32
+ },
33
+ "license": "MIT",
34
+ "author": "Toru Nagashima",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./index.d.ts",
38
+ "import": "./index.mjs",
39
+ "default": "./index.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "main": "index",
44
+ "files": [
45
+ "index.*"
46
+ ],
47
+ "scripts": {
48
+ "prebuild": "npm run -s clean",
49
+ "build": "run-s build:*",
50
+ "build:tsc": "tsc --module es2015",
51
+ "build:rollup": "rollup -c",
52
+ "build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts",
53
+ "clean": "rimraf .temp index.*",
54
+ "lint": "eslint . --ext .ts",
55
+ "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
56
+ "debug": "mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000",
57
+ "update:test": "ts-node scripts/update-fixtures.ts",
58
+ "update:unicode": "run-s update:unicode:*",
59
+ "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
60
+ "update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
61
+ "update:test262:extract": "ts-node -T scripts/extract-test262.ts",
62
+ "preversion": "npm test && npm run -s build",
63
+ "postversion": "git push && git push --tags",
64
+ "prewatch": "npm run -s clean",
65
+ "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
66
+ },
67
+ "dependencies": {},
68
+ "devDependencies": {
69
+ "@eslint-community/eslint-plugin-mysticatea": "^15.5.1",
70
+ "@rollup/plugin-node-resolve": "^14.1.0",
71
+ "@types/eslint": "^8.44.3",
72
+ "@types/jsdom": "^16.2.15",
73
+ "@types/mocha": "^9.1.1",
74
+ "@types/node": "^12.20.55",
75
+ "dts-bundle": "^0.7.3",
76
+ "eslint": "^8.50.0",
77
+ "js-tokens": "^8.0.2",
78
+ "jsdom": "^19.0.0",
79
+ "mocha": "^9.2.2",
80
+ "npm-run-all2": "^6.2.2",
81
+ "nyc": "^14.1.1",
82
+ "rimraf": "^3.0.2",
83
+ "rollup": "^2.79.1",
84
+ "rollup-plugin-sourcemaps": "^0.6.3",
85
+ "ts-node": "^10.9.1",
86
+ "typescript": "~5.0.2"
87
+ },
88
+ "engines": {
89
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
90
+ }
91
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/README.md ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Config Array
2
+
3
+ ## Description
4
+
5
+ A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename.
6
+
7
+ **Note:** This is a generic package that can be used outside of ESLint. It contains no ESLint-specific functionality.
8
+
9
+ ## Installation
10
+
11
+ For Node.js and compatible runtimes:
12
+
13
+ ```shell
14
+ npm install @eslint/config-array
15
+ # or
16
+ yarn add @eslint/config-array
17
+ # or
18
+ pnpm install @eslint/config-array
19
+ # or
20
+ bun add @eslint/config-array
21
+ ```
22
+
23
+ For Deno:
24
+
25
+ ```shell
26
+ deno add @eslint/config-array
27
+ ```
28
+
29
+ ## Background
30
+
31
+ The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example:
32
+
33
+ ```js
34
+ export default [
35
+ // match all JSON files
36
+ {
37
+ name: "JSON Handler",
38
+ files: ["**/*.json"],
39
+ handler: jsonHandler,
40
+ },
41
+
42
+ // match only package.json
43
+ {
44
+ name: "package.json Handler",
45
+ files: ["package.json"],
46
+ handler: packageJsonHandler,
47
+ },
48
+ ];
49
+ ```
50
+
51
+ In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins).
52
+
53
+ ## Usage
54
+
55
+ First, import the `ConfigArray` constructor:
56
+
57
+ ```js
58
+ import { ConfigArray } from "@eslint/config-array";
59
+
60
+ // or using CommonJS
61
+
62
+ const { ConfigArray } = require("@eslint/config-array");
63
+ ```
64
+
65
+ When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example:
66
+
67
+ ```js
68
+ const configFilename = path.resolve(process.cwd(), "my.config.js");
69
+ const { default: rawConfigs } = await import(configFilename);
70
+ const configs = new ConfigArray(rawConfigs, {
71
+ // the path to match filenames from
72
+ basePath: process.cwd(),
73
+
74
+ // additional items in each config
75
+ schema: mySchema,
76
+ });
77
+ ```
78
+
79
+ This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, `basePath`, and `name`.
80
+
81
+ ### Specifying a Schema
82
+
83
+ The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@eslint/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example:
84
+
85
+ ```js
86
+ const configFilename = path.resolve(process.cwd(), "my.config.js");
87
+ const { default: rawConfigs } = await import(configFilename);
88
+
89
+ const mySchema = {
90
+
91
+ // define the handler key in configs
92
+ handler: {
93
+ required: true,
94
+ merge(a, b) {
95
+ if (!b) return a;
96
+ if (!a) return b;
97
+ },
98
+ validate(value) {
99
+ if (typeof value !== "function") {
100
+ throw new TypeError("Function expected.");
101
+ }
102
+ }
103
+ }
104
+ };
105
+
106
+ const configs = new ConfigArray(rawConfigs, {
107
+
108
+ // the path to match filenames from
109
+ basePath: process.cwd(),
110
+
111
+ // additional item schemas in each config
112
+ schema: mySchema,
113
+
114
+ // additional config types supported (default: [])
115
+ extraConfigTypes: ["array", "function"];
116
+ });
117
+ ```
118
+
119
+ ### Config Arrays
120
+
121
+ Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as:
122
+
123
+ ```js
124
+ export default [
125
+ // JS config
126
+ {
127
+ files: ["**/*.js"],
128
+ handler: jsHandler,
129
+ },
130
+
131
+ // JSON configs
132
+ [
133
+ // match all JSON files
134
+ {
135
+ name: "JSON Handler",
136
+ files: ["**/*.json"],
137
+ handler: jsonHandler,
138
+ },
139
+
140
+ // match only package.json
141
+ {
142
+ name: "package.json Handler",
143
+ files: ["package.json"],
144
+ handler: packageJsonHandler,
145
+ },
146
+ ],
147
+
148
+ // filename must match function
149
+ {
150
+ files: [filePath => filePath.endsWith(".md")],
151
+ handler: markdownHandler,
152
+ },
153
+
154
+ // filename must match all patterns in subarray
155
+ {
156
+ files: [["*.test.*", "*.js"]],
157
+ handler: jsTestHandler,
158
+ },
159
+
160
+ // filename must not match patterns beginning with !
161
+ {
162
+ name: "Non-JS files",
163
+ files: ["!*.js"],
164
+ settings: {
165
+ js: false,
166
+ },
167
+ },
168
+
169
+ // specific settings for files inside `src` directory
170
+ {
171
+ name: "Source files",
172
+ basePath: "src",
173
+ files: ["**/*"],
174
+ settings: {
175
+ source: true,
176
+ },
177
+ },
178
+ ];
179
+ ```
180
+
181
+ In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same.
182
+
183
+ If the `files` array contains a function, then that function is called with the path of the file as it was passed in. The function is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.)
184
+
185
+ If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used.
186
+
187
+ If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`.
188
+
189
+ You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example:
190
+
191
+ ```js
192
+ export default [
193
+
194
+ // Always ignored
195
+ {
196
+ ignores: ["**/.git/**", "**/node_modules/**"]
197
+ },
198
+
199
+ // .eslintrc.js file is ignored only when .js file matches
200
+ {
201
+ files: ["**/*.js"],
202
+ ignores: [".eslintrc.js"]
203
+ handler: jsHandler
204
+ }
205
+ ];
206
+ ```
207
+
208
+ You can use negated patterns in `ignores` to exclude a file that was already ignored, such as:
209
+
210
+ ```js
211
+ export default [
212
+ // Ignore all JSON files except tsconfig.json
213
+ {
214
+ files: ["**/*"],
215
+ ignores: ["**/*.json", "!tsconfig.json"],
216
+ },
217
+ ];
218
+ ```
219
+
220
+ ### Config Functions
221
+
222
+ Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example:
223
+
224
+ ```js
225
+ export default [
226
+ // JS config
227
+ {
228
+ files: ["**/*.js"],
229
+ handler: jsHandler,
230
+ },
231
+
232
+ // JSON configs
233
+ function (context) {
234
+ return [
235
+ // match all JSON files
236
+ {
237
+ name: context.name + " JSON Handler",
238
+ files: ["**/*.json"],
239
+ handler: jsonHandler,
240
+ },
241
+
242
+ // match only package.json
243
+ {
244
+ name: context.name + " package.json Handler",
245
+ files: ["package.json"],
246
+ handler: packageJsonHandler,
247
+ },
248
+ ];
249
+ },
250
+ ];
251
+ ```
252
+
253
+ When a config array is normalized, each function is executed and replaced in the config array with the return value.
254
+
255
+ **Note:** Config functions can also be async.
256
+
257
+ ### Normalizing Config Arrays
258
+
259
+ Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values.
260
+
261
+ To normalize a config array, call the `normalize()` method and pass in a context object:
262
+
263
+ ```js
264
+ await configs.normalize({
265
+ name: "MyApp",
266
+ });
267
+ ```
268
+
269
+ The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable.
270
+
271
+ If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise:
272
+
273
+ ```js
274
+ await configs.normalizeSync({
275
+ name: "MyApp",
276
+ });
277
+ ```
278
+
279
+ **Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy.
280
+
281
+ ### Getting Config for a File
282
+
283
+ To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for:
284
+
285
+ ```js
286
+ // pass in filename
287
+ const fileConfig = configs.getConfig(
288
+ path.resolve(process.cwd(), "package.json"),
289
+ );
290
+ ```
291
+
292
+ The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed.
293
+
294
+ A few things to keep in mind:
295
+
296
+ - If a filename is not an absolute path, it will be resolved relative to the base path directory.
297
+ - The returned config object never has `files`, `ignores`, `basePath`, or `name` properties; the only properties on the object will be the other configuration options specified.
298
+ - The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
299
+ - A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches.
300
+
301
+ ## Determining Ignored Paths
302
+
303
+ You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the path of any file, as in this example:
304
+
305
+ ```js
306
+ const ignored = configs.isFileIgnored("/foo/bar/baz.txt");
307
+ ```
308
+
309
+ A file is considered ignored if any of the following is true:
310
+
311
+ - **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored.
312
+ - **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored.
313
+ - **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
314
+ - **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
315
+ - **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
316
+
317
+ For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example:
318
+
319
+ ```js
320
+ const ignored = configs.isDirectoryIgnored("/foo/bar/");
321
+ ```
322
+
323
+ A directory is considered ignored if any of the following is true:
324
+
325
+ - **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored.
326
+ - **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored.
327
+ - **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
328
+ - **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
329
+ - **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.
330
+
331
+ **Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`.
332
+
333
+ ## Caching Mechanisms
334
+
335
+ Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways:
336
+
337
+ 1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in.
338
+ 2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`.
339
+
340
+ ## Acknowledgements
341
+
342
+ The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from:
343
+
344
+ - Teddy Katz (@not-an-aardvark)
345
+ - Toru Nagashima (@mysticatea)
346
+ - Kai Cataldo (@kaicataldo)
347
+
348
+ ## License
349
+
350
+ Apache 2.0
351
+
352
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
353
+ <!--sponsorsstart-->
354
+
355
+ ## Sponsors
356
+
357
+ The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
358
+ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
359
+
360
+ <h3>Diamond Sponsors</h3>
361
+ <p><a href="https://www.ag-grid.com/"><img src="https://images.opencollective.com/ag-grid/bec0580/logo.png" alt="AG Grid" height="128"></a></p><h3>Platinum Sponsors</h3>
362
+ <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
363
+ <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
364
+ <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
365
+ <p><a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
366
+ <h3>Technology Sponsors</h3>
367
+ Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
368
+ <p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
369
+ <!--sponsorsend-->
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/index.cjs ADDED
@@ -0,0 +1,1534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ var posixPath = require('./std__path/posix.cjs');
4
+ var windowsPath = require('./std__path/windows.cjs');
5
+ var minimatch = require('minimatch');
6
+ var createDebug = require('debug');
7
+ var objectSchema = require('@eslint/object-schema');
8
+
9
+ function _interopNamespaceDefault(e) {
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var posixPath__namespace = /*#__PURE__*/_interopNamespaceDefault(posixPath);
27
+ var windowsPath__namespace = /*#__PURE__*/_interopNamespaceDefault(windowsPath);
28
+
29
+ /**
30
+ * @fileoverview ConfigSchema
31
+ * @author Nicholas C. Zakas
32
+ */
33
+
34
+ //------------------------------------------------------------------------------
35
+ // Types
36
+ //------------------------------------------------------------------------------
37
+
38
+ /** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */
39
+ /** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */
40
+
41
+ //------------------------------------------------------------------------------
42
+ // Helpers
43
+ //------------------------------------------------------------------------------
44
+
45
+ /**
46
+ * A strategy that does nothing.
47
+ * @type {PropertyDefinition}
48
+ */
49
+ const NOOP_STRATEGY = {
50
+ required: false,
51
+ merge() {
52
+ return undefined;
53
+ },
54
+ validate() {},
55
+ };
56
+
57
+ //------------------------------------------------------------------------------
58
+ // Exports
59
+ //------------------------------------------------------------------------------
60
+
61
+ /**
62
+ * The base schema that every ConfigArray uses.
63
+ * @type {ObjectDefinition}
64
+ */
65
+ const baseSchema = Object.freeze({
66
+ name: {
67
+ required: false,
68
+ merge() {
69
+ return undefined;
70
+ },
71
+ validate(value) {
72
+ if (typeof value !== "string") {
73
+ throw new TypeError("Property must be a string.");
74
+ }
75
+ },
76
+ },
77
+ basePath: NOOP_STRATEGY,
78
+ files: NOOP_STRATEGY,
79
+ ignores: NOOP_STRATEGY,
80
+ });
81
+
82
+ /**
83
+ * @fileoverview ConfigSchema
84
+ * @author Nicholas C. Zakas
85
+ */
86
+
87
+ //------------------------------------------------------------------------------
88
+ // Types
89
+ //------------------------------------------------------------------------------
90
+
91
+
92
+ //------------------------------------------------------------------------------
93
+ // Helpers
94
+ //------------------------------------------------------------------------------
95
+
96
+ /**
97
+ * Asserts that a given value is an array.
98
+ * @param {*} value The value to check.
99
+ * @returns {void}
100
+ * @throws {TypeError} When the value is not an array.
101
+ */
102
+ function assertIsArray(value) {
103
+ if (!Array.isArray(value)) {
104
+ throw new TypeError("Expected value to be an array.");
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Asserts that a given value is an array containing only strings and functions.
110
+ * @param {*} value The value to check.
111
+ * @returns {void}
112
+ * @throws {TypeError} When the value is not an array of strings and functions.
113
+ */
114
+ function assertIsArrayOfStringsAndFunctions(value) {
115
+ assertIsArray(value);
116
+
117
+ if (
118
+ value.some(
119
+ item => typeof item !== "string" && typeof item !== "function",
120
+ )
121
+ ) {
122
+ throw new TypeError(
123
+ "Expected array to only contain strings and functions.",
124
+ );
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Asserts that a given value is a non-empty array.
130
+ * @param {*} value The value to check.
131
+ * @returns {void}
132
+ * @throws {TypeError} When the value is not an array or an empty array.
133
+ */
134
+ function assertIsNonEmptyArray(value) {
135
+ if (!Array.isArray(value) || value.length === 0) {
136
+ throw new TypeError("Expected value to be a non-empty array.");
137
+ }
138
+ }
139
+
140
+ //------------------------------------------------------------------------------
141
+ // Exports
142
+ //------------------------------------------------------------------------------
143
+
144
+ /**
145
+ * The schema for `files` and `ignores` that every ConfigArray uses.
146
+ * @type {ObjectDefinition}
147
+ */
148
+ const filesAndIgnoresSchema = Object.freeze({
149
+ basePath: {
150
+ required: false,
151
+ merge() {
152
+ return undefined;
153
+ },
154
+ validate(value) {
155
+ if (typeof value !== "string") {
156
+ throw new TypeError("Expected value to be a string.");
157
+ }
158
+ },
159
+ },
160
+ files: {
161
+ required: false,
162
+ merge() {
163
+ return undefined;
164
+ },
165
+ validate(value) {
166
+ // first check if it's an array
167
+ assertIsNonEmptyArray(value);
168
+
169
+ // then check each member
170
+ value.forEach(item => {
171
+ if (Array.isArray(item)) {
172
+ assertIsArrayOfStringsAndFunctions(item);
173
+ } else if (
174
+ typeof item !== "string" &&
175
+ typeof item !== "function"
176
+ ) {
177
+ throw new TypeError(
178
+ "Items must be a string, a function, or an array of strings and functions.",
179
+ );
180
+ }
181
+ });
182
+ },
183
+ },
184
+ ignores: {
185
+ required: false,
186
+ merge() {
187
+ return undefined;
188
+ },
189
+ validate: assertIsArrayOfStringsAndFunctions,
190
+ },
191
+ });
192
+
193
+ /**
194
+ * @fileoverview ConfigArray
195
+ * @author Nicholas C. Zakas
196
+ */
197
+
198
+
199
+ //------------------------------------------------------------------------------
200
+ // Types
201
+ //------------------------------------------------------------------------------
202
+
203
+ /** @typedef {import("./types.ts").ConfigObject} ConfigObject */
204
+ /** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */
205
+ /** @typedef {import("minimatch").IMinimatch} IMinimatch */
206
+ /** @typedef {import("@jsr/std__path")} PathImpl */
207
+
208
+ /*
209
+ * This is a bit of a hack to make TypeScript happy with the Rollup-created
210
+ * CommonJS file. Rollup doesn't do object destructuring for imported files
211
+ * and instead imports the default via `require()`. This messes up type checking
212
+ * for `ObjectSchema`. To work around that, we just import the type manually
213
+ * and give it a different name to use in the JSDoc comments.
214
+ */
215
+ /** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */
216
+
217
+ //------------------------------------------------------------------------------
218
+ // Helpers
219
+ //------------------------------------------------------------------------------
220
+
221
+ const Minimatch = minimatch.Minimatch;
222
+ const debug = createDebug("@eslint/config-array");
223
+
224
+ /**
225
+ * A cache for minimatch instances.
226
+ * @type {Map<string, IMinimatch>}
227
+ */
228
+ const minimatchCache = new Map();
229
+
230
+ /**
231
+ * A cache for negated minimatch instances.
232
+ * @type {Map<string, IMinimatch>}
233
+ */
234
+ const negatedMinimatchCache = new Map();
235
+
236
+ /**
237
+ * Options to use with minimatch.
238
+ * @type {Object}
239
+ */
240
+ const MINIMATCH_OPTIONS = {
241
+ // matchBase: true,
242
+ dot: true,
243
+ allowWindowsEscape: true,
244
+ };
245
+
246
+ /**
247
+ * The types of config objects that are supported.
248
+ * @type {Set<string>}
249
+ */
250
+ const CONFIG_TYPES = new Set(["array", "function"]);
251
+
252
+ /**
253
+ * Fields that are considered metadata and not part of the config object.
254
+ * @type {Set<string>}
255
+ */
256
+ const META_FIELDS = new Set(["name", "basePath"]);
257
+
258
+ /**
259
+ * A schema containing just files and ignores for early validation.
260
+ * @type {ObjectSchemaInstance}
261
+ */
262
+ const FILES_AND_IGNORES_SCHEMA = new objectSchema.ObjectSchema(filesAndIgnoresSchema);
263
+
264
+ // Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`.
265
+
266
+ const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" });
267
+ const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" });
268
+ const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({
269
+ status: "unconfigured",
270
+ });
271
+
272
+ // Match two leading dots followed by a slash or the end of input.
273
+ const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u;
274
+
275
+ /**
276
+ * Wrapper error for config validation errors that adds a name to the front of the
277
+ * error message.
278
+ */
279
+ class ConfigError extends Error {
280
+ /**
281
+ * Creates a new instance.
282
+ * @param {string} name The config object name causing the error.
283
+ * @param {number} index The index of the config object in the array.
284
+ * @param {Object} options The options for the error.
285
+ * @param {Error} [options.cause] The error that caused this error.
286
+ * @param {string} [options.message] The message to use for the error.
287
+ */
288
+ constructor(name, index, { cause, message }) {
289
+ const finalMessage = message || cause.message;
290
+
291
+ super(`Config ${name}: ${finalMessage}`, { cause });
292
+
293
+ // copy over custom properties that aren't represented
294
+ if (cause) {
295
+ for (const key of Object.keys(cause)) {
296
+ if (!(key in this)) {
297
+ this[key] = cause[key];
298
+ }
299
+ }
300
+ }
301
+
302
+ /**
303
+ * The name of the error.
304
+ * @type {string}
305
+ * @readonly
306
+ */
307
+ this.name = "ConfigError";
308
+
309
+ /**
310
+ * The index of the config object in the array.
311
+ * @type {number}
312
+ * @readonly
313
+ */
314
+ this.index = index;
315
+ }
316
+ }
317
+
318
+ /**
319
+ * Gets the name of a config object.
320
+ * @param {ConfigObject} config The config object to get the name of.
321
+ * @returns {string} The name of the config object.
322
+ */
323
+ function getConfigName(config) {
324
+ if (config && typeof config.name === "string" && config.name) {
325
+ return `"${config.name}"`;
326
+ }
327
+
328
+ return "(unnamed)";
329
+ }
330
+
331
+ /**
332
+ * Rethrows a config error with additional information about the config object.
333
+ * @param {object} config The config object to get the name of.
334
+ * @param {number} index The index of the config object in the array.
335
+ * @param {Error} error The error to rethrow.
336
+ * @throws {ConfigError} When the error is rethrown for a config.
337
+ */
338
+ function rethrowConfigError(config, index, error) {
339
+ const configName = getConfigName(config);
340
+ throw new ConfigError(configName, index, { cause: error });
341
+ }
342
+
343
+ /**
344
+ * Shorthand for checking if a value is a string.
345
+ * @param {any} value The value to check.
346
+ * @returns {boolean} True if a string, false if not.
347
+ */
348
+ function isString(value) {
349
+ return typeof value === "string";
350
+ }
351
+
352
+ /**
353
+ * Creates a function that asserts that the config is valid
354
+ * during normalization. This checks that the config is not nullish
355
+ * and that files and ignores keys of a config object are valid as per base schema.
356
+ * @param {Object} config The config object to check.
357
+ * @param {number} index The index of the config object in the array.
358
+ * @returns {void}
359
+ * @throws {ConfigError} If the files and ignores keys of a config object are not valid.
360
+ */
361
+ function assertValidBaseConfig(config, index) {
362
+ if (config === null) {
363
+ throw new ConfigError(getConfigName(config), index, {
364
+ message: "Unexpected null config.",
365
+ });
366
+ }
367
+
368
+ if (config === undefined) {
369
+ throw new ConfigError(getConfigName(config), index, {
370
+ message: "Unexpected undefined config.",
371
+ });
372
+ }
373
+
374
+ if (typeof config !== "object") {
375
+ throw new ConfigError(getConfigName(config), index, {
376
+ message: "Unexpected non-object config.",
377
+ });
378
+ }
379
+
380
+ const validateConfig = {};
381
+
382
+ if ("basePath" in config) {
383
+ validateConfig.basePath = config.basePath;
384
+ }
385
+
386
+ if ("files" in config) {
387
+ validateConfig.files = config.files;
388
+ }
389
+
390
+ if ("ignores" in config) {
391
+ validateConfig.ignores = config.ignores;
392
+ }
393
+
394
+ try {
395
+ FILES_AND_IGNORES_SCHEMA.validate(validateConfig);
396
+ } catch (validationError) {
397
+ rethrowConfigError(config, index, validationError);
398
+ }
399
+ }
400
+
401
+ /**
402
+ * Wrapper around minimatch that caches minimatch patterns for
403
+ * faster matching speed over multiple file path evaluations.
404
+ * @param {string} filepath The file path to match.
405
+ * @param {string} pattern The glob pattern to match against.
406
+ * @param {object} options The minimatch options to use.
407
+ * @returns
408
+ */
409
+ function doMatch(filepath, pattern, options = {}) {
410
+ let cache = minimatchCache;
411
+
412
+ if (options.flipNegate) {
413
+ cache = negatedMinimatchCache;
414
+ }
415
+
416
+ let matcher = cache.get(pattern);
417
+
418
+ if (!matcher) {
419
+ matcher = new Minimatch(
420
+ pattern,
421
+ Object.assign({}, MINIMATCH_OPTIONS, options),
422
+ );
423
+ cache.set(pattern, matcher);
424
+ }
425
+
426
+ return matcher.match(filepath);
427
+ }
428
+
429
+ /**
430
+ * Normalizes a pattern by removing the leading "./" if present.
431
+ * @param {string} pattern The pattern to normalize.
432
+ * @returns {string} The normalized pattern.
433
+ */
434
+ function normalizePattern(pattern) {
435
+ if (isString(pattern)) {
436
+ if (pattern.startsWith("./")) {
437
+ return pattern.slice(2);
438
+ }
439
+
440
+ if (pattern.startsWith("!./")) {
441
+ return `!${pattern.slice(3)}`;
442
+ }
443
+ }
444
+
445
+ return pattern;
446
+ }
447
+
448
+ /**
449
+ * Checks if a given pattern requires normalization.
450
+ * @param {any} pattern The pattern to check.
451
+ * @returns {boolean} True if the pattern needs normalization, false otherwise.
452
+ *
453
+ */
454
+ function needsPatternNormalization(pattern) {
455
+ return (
456
+ isString(pattern) &&
457
+ (pattern.startsWith("./") || pattern.startsWith("!./"))
458
+ );
459
+ }
460
+
461
+ /**
462
+ * Normalizes `files` and `ignores` patterns in a config by removing "./" prefixes.
463
+ * @param {Object} config The config object to normalize patterns in.
464
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base path is relative.
465
+ * @param {PathImpl} path Path-handling implementation.
466
+ * @returns {Object} The normalized config object.
467
+ */
468
+ function normalizeConfigPatterns(config, namespacedBasePath, path) {
469
+ if (!config) {
470
+ return config;
471
+ }
472
+
473
+ const hasBasePath = typeof config.basePath === "string";
474
+
475
+ let needsNormalization = false;
476
+
477
+ if (hasBasePath) {
478
+ needsNormalization = true;
479
+ }
480
+
481
+ if (!needsNormalization && Array.isArray(config.files)) {
482
+ needsNormalization = config.files.some(pattern => {
483
+ if (Array.isArray(pattern)) {
484
+ return pattern.some(needsPatternNormalization);
485
+ }
486
+ return needsPatternNormalization(pattern);
487
+ });
488
+ }
489
+
490
+ if (!needsNormalization && Array.isArray(config.ignores)) {
491
+ needsNormalization = config.ignores.some(needsPatternNormalization);
492
+ }
493
+
494
+ if (!needsNormalization) {
495
+ return config;
496
+ }
497
+
498
+ const newConfig = { ...config };
499
+
500
+ if (hasBasePath) {
501
+ if (path.isAbsolute(config.basePath)) {
502
+ newConfig.basePath = path.toNamespacedPath(config.basePath);
503
+ } else {
504
+ newConfig.basePath = path.resolve(
505
+ namespacedBasePath,
506
+ config.basePath,
507
+ );
508
+ }
509
+ }
510
+
511
+ if (Array.isArray(newConfig.files)) {
512
+ newConfig.files = newConfig.files.map(pattern => {
513
+ if (Array.isArray(pattern)) {
514
+ return pattern.map(normalizePattern);
515
+ }
516
+ return normalizePattern(pattern);
517
+ });
518
+ }
519
+
520
+ if (Array.isArray(newConfig.ignores)) {
521
+ newConfig.ignores = newConfig.ignores.map(normalizePattern);
522
+ }
523
+
524
+ return newConfig;
525
+ }
526
+
527
+ /**
528
+ * Normalizes a `ConfigArray` by flattening it and executing any functions
529
+ * that are found inside.
530
+ * @param {Array} items The items in a `ConfigArray`.
531
+ * @param {Object} context The context object to pass into any function
532
+ * found.
533
+ * @param {Array<string>} extraConfigTypes The config types to check.
534
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
535
+ * @param {PathImpl} path Path-handling implementation.
536
+ * @returns {Promise<Array>} A flattened array containing only config objects.
537
+ * @throws {TypeError} When a config function returns a function.
538
+ */
539
+ async function normalize(
540
+ items,
541
+ context,
542
+ extraConfigTypes,
543
+ namespacedBasePath,
544
+ path,
545
+ ) {
546
+ const allowFunctions = extraConfigTypes.includes("function");
547
+ const allowArrays = extraConfigTypes.includes("array");
548
+
549
+ async function* flatTraverse(array) {
550
+ for (let item of array) {
551
+ if (typeof item === "function") {
552
+ if (!allowFunctions) {
553
+ throw new TypeError("Unexpected function.");
554
+ }
555
+
556
+ item = item(context);
557
+ if (item.then) {
558
+ item = await item;
559
+ }
560
+ }
561
+
562
+ if (Array.isArray(item)) {
563
+ if (!allowArrays) {
564
+ throw new TypeError("Unexpected array.");
565
+ }
566
+ yield* flatTraverse(item);
567
+ } else if (typeof item === "function") {
568
+ throw new TypeError(
569
+ "A config function can only return an object or array.",
570
+ );
571
+ } else {
572
+ yield item;
573
+ }
574
+ }
575
+ }
576
+
577
+ /*
578
+ * Async iterables cannot be used with the spread operator, so we need to manually
579
+ * create the array to return.
580
+ */
581
+ const asyncIterable = await flatTraverse(items);
582
+ const configs = [];
583
+
584
+ for await (const config of asyncIterable) {
585
+ configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
586
+ }
587
+
588
+ return configs;
589
+ }
590
+
591
+ /**
592
+ * Normalizes a `ConfigArray` by flattening it and executing any functions
593
+ * that are found inside.
594
+ * @param {Array} items The items in a `ConfigArray`.
595
+ * @param {Object} context The context object to pass into any function
596
+ * found.
597
+ * @param {Array<string>} extraConfigTypes The config types to check.
598
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
599
+ * @param {PathImpl} path Path-handling implementation
600
+ * @returns {Array} A flattened array containing only config objects.
601
+ * @throws {TypeError} When a config function returns a function.
602
+ */
603
+ function normalizeSync(
604
+ items,
605
+ context,
606
+ extraConfigTypes,
607
+ namespacedBasePath,
608
+ path,
609
+ ) {
610
+ const allowFunctions = extraConfigTypes.includes("function");
611
+ const allowArrays = extraConfigTypes.includes("array");
612
+
613
+ function* flatTraverse(array) {
614
+ for (let item of array) {
615
+ if (typeof item === "function") {
616
+ if (!allowFunctions) {
617
+ throw new TypeError("Unexpected function.");
618
+ }
619
+
620
+ item = item(context);
621
+ if (item.then) {
622
+ throw new TypeError(
623
+ "Async config functions are not supported.",
624
+ );
625
+ }
626
+ }
627
+
628
+ if (Array.isArray(item)) {
629
+ if (!allowArrays) {
630
+ throw new TypeError("Unexpected array.");
631
+ }
632
+
633
+ yield* flatTraverse(item);
634
+ } else if (typeof item === "function") {
635
+ throw new TypeError(
636
+ "A config function can only return an object or array.",
637
+ );
638
+ } else {
639
+ yield item;
640
+ }
641
+ }
642
+ }
643
+
644
+ const configs = [];
645
+
646
+ for (const config of flatTraverse(items)) {
647
+ configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
648
+ }
649
+
650
+ return configs;
651
+ }
652
+
653
+ /**
654
+ * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`).
655
+ * @param {string} fileOrDirPath The unprocessed path to convert.
656
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative.
657
+ * @param {PathImpl} path Path-handling implementations.
658
+ * @returns {string} A relative path with all separator characters replaced by forward slashes.
659
+ */
660
+ function toRelativePath(fileOrDirPath, namespacedBasePath, path) {
661
+ const fullPath = path.resolve(namespacedBasePath, fileOrDirPath);
662
+ const namespacedFullPath = path.toNamespacedPath(fullPath);
663
+ const relativePath = path.relative(namespacedBasePath, namespacedFullPath);
664
+ return relativePath.replaceAll(path.SEPARATOR, "/");
665
+ }
666
+
667
+ /**
668
+ * Determines if a given file path should be ignored based on the given
669
+ * matcher.
670
+ * @param {Array<{ basePath?: string, ignores: Array<string|((string) => boolean)>}>} configs Configuration objects containing `ignores`.
671
+ * @param {string} filePath The unprocessed file path to check.
672
+ * @param {string} relativeFilePath The path of the file to check relative to the base path,
673
+ * using forward slash (`"/"`) as a separator.
674
+ * @param {Object} [basePathData] Additional data needed to recalculate paths for configuration objects
675
+ * that have `basePath` property.
676
+ * @param {string} [basePathData.basePath] Namespaced path to witch `relativeFilePath` is relative.
677
+ * @param {PathImpl} [basePathData.path] Path-handling implementation.
678
+ * @returns {boolean} True if the path should be ignored and false if not.
679
+ */
680
+ function shouldIgnorePath(
681
+ configs,
682
+ filePath,
683
+ relativeFilePath,
684
+ { basePath, path } = {},
685
+ ) {
686
+ let shouldIgnore = false;
687
+
688
+ for (const config of configs) {
689
+ let relativeFilePathToCheck = relativeFilePath;
690
+ if (config.basePath) {
691
+ relativeFilePathToCheck = toRelativePath(
692
+ path.resolve(basePath, relativeFilePath),
693
+ config.basePath,
694
+ path,
695
+ );
696
+
697
+ if (
698
+ relativeFilePathToCheck === "" ||
699
+ EXTERNAL_PATH_REGEX.test(relativeFilePathToCheck)
700
+ ) {
701
+ continue;
702
+ }
703
+
704
+ if (relativeFilePath.endsWith("/")) {
705
+ relativeFilePathToCheck += "/";
706
+ }
707
+ }
708
+ shouldIgnore = config.ignores.reduce((ignored, matcher) => {
709
+ if (!ignored) {
710
+ if (typeof matcher === "function") {
711
+ return matcher(filePath);
712
+ }
713
+
714
+ // don't check negated patterns because we're not ignored yet
715
+ if (!matcher.startsWith("!")) {
716
+ return doMatch(relativeFilePathToCheck, matcher);
717
+ }
718
+
719
+ // otherwise we're still not ignored
720
+ return false;
721
+ }
722
+
723
+ // only need to check negated patterns because we're ignored
724
+ if (typeof matcher === "string" && matcher.startsWith("!")) {
725
+ return !doMatch(relativeFilePathToCheck, matcher, {
726
+ flipNegate: true,
727
+ });
728
+ }
729
+
730
+ return ignored;
731
+ }, shouldIgnore);
732
+ }
733
+
734
+ return shouldIgnore;
735
+ }
736
+
737
+ /**
738
+ * Determines if a given file path is matched by a config. If the config
739
+ * has no `files` field, then it matches; otherwise, if a `files` field
740
+ * is present then we match the globs in `files` and exclude any globs in
741
+ * `ignores`.
742
+ * @param {string} filePath The unprocessed file path to check.
743
+ * @param {string} relativeFilePath The path of the file to check relative to the base path,
744
+ * using forward slash (`"/"`) as a separator.
745
+ * @param {Object} config The config object to check.
746
+ * @returns {boolean} True if the file path is matched by the config,
747
+ * false if not.
748
+ */
749
+ function pathMatches(filePath, relativeFilePath, config) {
750
+ // match both strings and functions
751
+ function match(pattern) {
752
+ if (isString(pattern)) {
753
+ return doMatch(relativeFilePath, pattern);
754
+ }
755
+
756
+ if (typeof pattern === "function") {
757
+ return pattern(filePath);
758
+ }
759
+
760
+ throw new TypeError(`Unexpected matcher type ${pattern}.`);
761
+ }
762
+
763
+ // check for all matches to config.files
764
+ let filePathMatchesPattern = config.files.some(pattern => {
765
+ if (Array.isArray(pattern)) {
766
+ return pattern.every(match);
767
+ }
768
+
769
+ return match(pattern);
770
+ });
771
+
772
+ /*
773
+ * If the file path matches the config.files patterns, then check to see
774
+ * if there are any files to ignore.
775
+ */
776
+ if (filePathMatchesPattern && config.ignores) {
777
+ /*
778
+ * Pass config object without `basePath`, because `relativeFilePath` is already
779
+ * calculated as relative to it.
780
+ */
781
+ filePathMatchesPattern = !shouldIgnorePath(
782
+ [{ ignores: config.ignores }],
783
+ filePath,
784
+ relativeFilePath,
785
+ );
786
+ }
787
+
788
+ return filePathMatchesPattern;
789
+ }
790
+
791
+ /**
792
+ * Ensures that a ConfigArray has been normalized.
793
+ * @param {ConfigArray} configArray The ConfigArray to check.
794
+ * @returns {void}
795
+ * @throws {Error} When the `ConfigArray` is not normalized.
796
+ */
797
+ function assertNormalized(configArray) {
798
+ // TODO: Throw more verbose error
799
+ if (!configArray.isNormalized()) {
800
+ throw new Error(
801
+ "ConfigArray must be normalized to perform this operation.",
802
+ );
803
+ }
804
+ }
805
+
806
+ /**
807
+ * Ensures that config types are valid.
808
+ * @param {Array<string>} extraConfigTypes The config types to check.
809
+ * @returns {void}
810
+ * @throws {TypeError} When the config types array is invalid.
811
+ */
812
+ function assertExtraConfigTypes(extraConfigTypes) {
813
+ if (extraConfigTypes.length > 2) {
814
+ throw new TypeError(
815
+ "configTypes must be an array with at most two items.",
816
+ );
817
+ }
818
+
819
+ for (const configType of extraConfigTypes) {
820
+ if (!CONFIG_TYPES.has(configType)) {
821
+ throw new TypeError(
822
+ `Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`,
823
+ );
824
+ }
825
+ }
826
+ }
827
+
828
+ /**
829
+ * Returns path-handling implementations for Unix or Windows, depending on a given absolute path.
830
+ * @param {string} fileOrDirPath The absolute path to check.
831
+ * @returns {PathImpl} Path-handling implementations for the specified path.
832
+ * @throws {Error} An error is thrown if the specified argument is not an absolute path.
833
+ */
834
+ function getPathImpl(fileOrDirPath) {
835
+ // Posix absolute paths always start with a slash.
836
+ if (fileOrDirPath.startsWith("/")) {
837
+ return posixPath__namespace;
838
+ }
839
+
840
+ // Windows absolute paths start with a letter followed by a colon and at least one backslash,
841
+ // or with two backslashes in the case of UNC paths.
842
+ // Forward slashed are automatically normalized to backslashes.
843
+ if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) {
844
+ return windowsPath__namespace;
845
+ }
846
+
847
+ throw new Error(
848
+ `Expected an absolute path but received "${fileOrDirPath}"`,
849
+ );
850
+ }
851
+
852
+ //------------------------------------------------------------------------------
853
+ // Public Interface
854
+ //------------------------------------------------------------------------------
855
+
856
+ const ConfigArraySymbol = {
857
+ isNormalized: Symbol("isNormalized"),
858
+ configCache: Symbol("configCache"),
859
+ schema: Symbol("schema"),
860
+ finalizeConfig: Symbol("finalizeConfig"),
861
+ preprocessConfig: Symbol("preprocessConfig"),
862
+ };
863
+
864
+ // used to store calculate data for faster lookup
865
+ const dataCache = new WeakMap();
866
+
867
+ /**
868
+ * Represents an array of config objects and provides method for working with
869
+ * those config objects.
870
+ */
871
+ class ConfigArray extends Array {
872
+ /**
873
+ * The namespaced path of the config file directory.
874
+ * @type {string}
875
+ */
876
+ #namespacedBasePath;
877
+
878
+ /**
879
+ * Path-handling implementations.
880
+ * @type {PathImpl}
881
+ */
882
+ #path;
883
+
884
+ /**
885
+ * Creates a new instance of ConfigArray.
886
+ * @param {Iterable|Function|Object} configs An iterable yielding config
887
+ * objects, or a config function, or a config object.
888
+ * @param {Object} options The options for the ConfigArray.
889
+ * @param {string} [options.basePath="/"] The absolute path of the config file directory.
890
+ * Defaults to `"/"`.
891
+ * @param {boolean} [options.normalized=false] Flag indicating if the
892
+ * configs have already been normalized.
893
+ * @param {Object} [options.schema] The additional schema
894
+ * definitions to use for the ConfigArray schema.
895
+ * @param {Array<string>} [options.extraConfigTypes] List of config types supported.
896
+ * @throws {TypeError} When the `basePath` is not a non-empty string,
897
+ */
898
+ constructor(
899
+ configs,
900
+ {
901
+ basePath = "/",
902
+ normalized = false,
903
+ schema: customSchema,
904
+ extraConfigTypes = [],
905
+ } = {},
906
+ ) {
907
+ super();
908
+
909
+ /**
910
+ * Tracks if the array has been normalized.
911
+ * @property isNormalized
912
+ * @type {boolean}
913
+ * @private
914
+ */
915
+ this[ConfigArraySymbol.isNormalized] = normalized;
916
+
917
+ /**
918
+ * The schema used for validating and merging configs.
919
+ * @property schema
920
+ * @type {ObjectSchemaInstance}
921
+ * @private
922
+ */
923
+ this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema(
924
+ Object.assign({}, customSchema, baseSchema),
925
+ );
926
+
927
+ if (!isString(basePath) || !basePath) {
928
+ throw new TypeError("basePath must be a non-empty string");
929
+ }
930
+
931
+ /**
932
+ * The path of the config file that this array was loaded from.
933
+ * This is used to calculate filename matches.
934
+ * @property basePath
935
+ * @type {string}
936
+ */
937
+ this.basePath = basePath;
938
+
939
+ assertExtraConfigTypes(extraConfigTypes);
940
+
941
+ /**
942
+ * The supported config types.
943
+ * @type {Array<string>}
944
+ */
945
+ this.extraConfigTypes = [...extraConfigTypes];
946
+ Object.freeze(this.extraConfigTypes);
947
+
948
+ /**
949
+ * A cache to store calculated configs for faster repeat lookup.
950
+ * @property configCache
951
+ * @type {Map<string, Object>}
952
+ * @private
953
+ */
954
+ this[ConfigArraySymbol.configCache] = new Map();
955
+
956
+ // init cache
957
+ dataCache.set(this, {
958
+ explicitMatches: new Map(),
959
+ directoryMatches: new Map(),
960
+ files: undefined,
961
+ ignores: undefined,
962
+ });
963
+
964
+ // load the configs into this array
965
+ if (Array.isArray(configs)) {
966
+ this.push(...configs);
967
+ } else {
968
+ this.push(configs);
969
+ }
970
+
971
+ // select path-handling implementations depending on the base path
972
+ this.#path = getPathImpl(basePath);
973
+
974
+ // On Windows, `path.relative()` returns an absolute path when given two paths on different drives.
975
+ // The namespaced base path is useful to make sure that calculated relative paths are always relative.
976
+ // On Unix, it is identical to the base path.
977
+ this.#namespacedBasePath = this.#path.toNamespacedPath(basePath);
978
+ }
979
+
980
+ /**
981
+ * Prevent normal array methods from creating a new `ConfigArray` instance.
982
+ * This is to ensure that methods such as `slice()` won't try to create a
983
+ * new instance of `ConfigArray` behind the scenes as doing so may throw
984
+ * an error due to the different constructor signature.
985
+ * @type {ArrayConstructor} The `Array` constructor.
986
+ */
987
+ static get [Symbol.species]() {
988
+ return Array;
989
+ }
990
+
991
+ /**
992
+ * Returns the `files` globs from every config object in the array.
993
+ * This can be used to determine which files will be matched by a
994
+ * config array or to use as a glob pattern when no patterns are provided
995
+ * for a command line interface.
996
+ * @returns {Array<string|Function>} An array of matchers.
997
+ */
998
+ get files() {
999
+ assertNormalized(this);
1000
+
1001
+ // if this data has been cached, retrieve it
1002
+ const cache = dataCache.get(this);
1003
+
1004
+ if (cache.files) {
1005
+ return cache.files;
1006
+ }
1007
+
1008
+ // otherwise calculate it
1009
+
1010
+ const result = [];
1011
+
1012
+ for (const config of this) {
1013
+ if (config.files) {
1014
+ config.files.forEach(filePattern => {
1015
+ result.push(filePattern);
1016
+ });
1017
+ }
1018
+ }
1019
+
1020
+ // store result
1021
+ cache.files = result;
1022
+ dataCache.set(this, cache);
1023
+
1024
+ return result;
1025
+ }
1026
+
1027
+ /**
1028
+ * Returns ignore matchers that should always be ignored regardless of
1029
+ * the matching `files` fields in any configs. This is necessary to mimic
1030
+ * the behavior of things like .gitignore and .eslintignore, allowing a
1031
+ * globbing operation to be faster.
1032
+ * @returns {Object[]} An array of config objects representing global ignores.
1033
+ */
1034
+ get ignores() {
1035
+ assertNormalized(this);
1036
+
1037
+ // if this data has been cached, retrieve it
1038
+ const cache = dataCache.get(this);
1039
+
1040
+ if (cache.ignores) {
1041
+ return cache.ignores;
1042
+ }
1043
+
1044
+ // otherwise calculate it
1045
+
1046
+ const result = [];
1047
+
1048
+ for (const config of this) {
1049
+ /*
1050
+ * We only count ignores if there are no other keys in the object.
1051
+ * In this case, it acts list a globally ignored pattern. If there
1052
+ * are additional keys, then ignores act like exclusions.
1053
+ */
1054
+ if (
1055
+ config.ignores &&
1056
+ Object.keys(config).filter(key => !META_FIELDS.has(key))
1057
+ .length === 1
1058
+ ) {
1059
+ result.push(config);
1060
+ }
1061
+ }
1062
+
1063
+ // store result
1064
+ cache.ignores = result;
1065
+ dataCache.set(this, cache);
1066
+
1067
+ return result;
1068
+ }
1069
+
1070
+ /**
1071
+ * Indicates if the config array has been normalized.
1072
+ * @returns {boolean} True if the config array is normalized, false if not.
1073
+ */
1074
+ isNormalized() {
1075
+ return this[ConfigArraySymbol.isNormalized];
1076
+ }
1077
+
1078
+ /**
1079
+ * Normalizes a config array by flattening embedded arrays and executing
1080
+ * config functions.
1081
+ * @param {Object} [context] The context object for config functions.
1082
+ * @returns {Promise<ConfigArray>} The current ConfigArray instance.
1083
+ */
1084
+ async normalize(context = {}) {
1085
+ if (!this.isNormalized()) {
1086
+ const normalizedConfigs = await normalize(
1087
+ this,
1088
+ context,
1089
+ this.extraConfigTypes,
1090
+ this.#namespacedBasePath,
1091
+ this.#path,
1092
+ );
1093
+ this.length = 0;
1094
+ this.push(
1095
+ ...normalizedConfigs.map(
1096
+ this[ConfigArraySymbol.preprocessConfig].bind(this),
1097
+ ),
1098
+ );
1099
+ this.forEach(assertValidBaseConfig);
1100
+ this[ConfigArraySymbol.isNormalized] = true;
1101
+
1102
+ // prevent further changes
1103
+ Object.freeze(this);
1104
+ }
1105
+
1106
+ return this;
1107
+ }
1108
+
1109
+ /**
1110
+ * Normalizes a config array by flattening embedded arrays and executing
1111
+ * config functions.
1112
+ * @param {Object} [context] The context object for config functions.
1113
+ * @returns {ConfigArray} The current ConfigArray instance.
1114
+ */
1115
+ normalizeSync(context = {}) {
1116
+ if (!this.isNormalized()) {
1117
+ const normalizedConfigs = normalizeSync(
1118
+ this,
1119
+ context,
1120
+ this.extraConfigTypes,
1121
+ this.#namespacedBasePath,
1122
+ this.#path,
1123
+ );
1124
+ this.length = 0;
1125
+ this.push(
1126
+ ...normalizedConfigs.map(
1127
+ this[ConfigArraySymbol.preprocessConfig].bind(this),
1128
+ ),
1129
+ );
1130
+ this.forEach(assertValidBaseConfig);
1131
+ this[ConfigArraySymbol.isNormalized] = true;
1132
+
1133
+ // prevent further changes
1134
+ Object.freeze(this);
1135
+ }
1136
+
1137
+ return this;
1138
+ }
1139
+
1140
+ /* eslint-disable class-methods-use-this -- Desired as instance methods */
1141
+
1142
+ /**
1143
+ * Finalizes the state of a config before being cached and returned by
1144
+ * `getConfig()`. Does nothing by default but is provided to be
1145
+ * overridden by subclasses as necessary.
1146
+ * @param {Object} config The config to finalize.
1147
+ * @returns {Object} The finalized config.
1148
+ */
1149
+ [ConfigArraySymbol.finalizeConfig](config) {
1150
+ return config;
1151
+ }
1152
+
1153
+ /**
1154
+ * Preprocesses a config during the normalization process. This is the
1155
+ * method to override if you want to convert an array item before it is
1156
+ * validated for the first time. For example, if you want to replace a
1157
+ * string with an object, this is the method to override.
1158
+ * @param {Object} config The config to preprocess.
1159
+ * @returns {Object} The config to use in place of the argument.
1160
+ */
1161
+ [ConfigArraySymbol.preprocessConfig](config) {
1162
+ return config;
1163
+ }
1164
+
1165
+ /* eslint-enable class-methods-use-this -- Desired as instance methods */
1166
+
1167
+ /**
1168
+ * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
1169
+ * @param {string} filePath The path of a file to get a config for.
1170
+ * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
1171
+ * An object with an optional property `config` and property `status`.
1172
+ * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
1173
+ * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
1174
+ */
1175
+ getConfigWithStatus(filePath) {
1176
+ assertNormalized(this);
1177
+
1178
+ const cache = this[ConfigArraySymbol.configCache];
1179
+
1180
+ // first check the cache for a filename match to avoid duplicate work
1181
+ if (cache.has(filePath)) {
1182
+ return cache.get(filePath);
1183
+ }
1184
+
1185
+ // check to see if the file is outside the base path
1186
+
1187
+ const relativeToBaseFilePath = toRelativePath(
1188
+ filePath,
1189
+ this.#namespacedBasePath,
1190
+ this.#path,
1191
+ );
1192
+
1193
+ if (EXTERNAL_PATH_REGEX.test(relativeToBaseFilePath)) {
1194
+ debug(`No config for file ${filePath} outside of base path`);
1195
+
1196
+ // cache and return result
1197
+ cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL);
1198
+ return CONFIG_WITH_STATUS_EXTERNAL;
1199
+ }
1200
+
1201
+ // next check to see if the file should be ignored
1202
+
1203
+ // check if this should be ignored due to its directory
1204
+ if (this.isDirectoryIgnored(this.#path.dirname(filePath))) {
1205
+ debug(`Ignoring ${filePath} based on directory pattern`);
1206
+
1207
+ // cache and return result
1208
+ cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
1209
+ return CONFIG_WITH_STATUS_IGNORED;
1210
+ }
1211
+
1212
+ if (
1213
+ shouldIgnorePath(this.ignores, filePath, relativeToBaseFilePath, {
1214
+ basePath: this.#namespacedBasePath,
1215
+ path: this.#path,
1216
+ })
1217
+ ) {
1218
+ debug(`Ignoring ${filePath} based on file pattern`);
1219
+
1220
+ // cache and return result
1221
+ cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
1222
+ return CONFIG_WITH_STATUS_IGNORED;
1223
+ }
1224
+
1225
+ // filePath isn't automatically ignored, so try to construct config
1226
+
1227
+ const matchingConfigIndices = [];
1228
+ let matchFound = false;
1229
+ const universalPattern = /^\*$|^!|\/\*{1,2}$/u;
1230
+
1231
+ this.forEach((config, index) => {
1232
+ const relativeFilePath = config.basePath
1233
+ ? toRelativePath(
1234
+ this.#path.resolve(this.#namespacedBasePath, filePath),
1235
+ config.basePath,
1236
+ this.#path,
1237
+ )
1238
+ : relativeToBaseFilePath;
1239
+
1240
+ if (config.basePath && EXTERNAL_PATH_REGEX.test(relativeFilePath)) {
1241
+ debug(
1242
+ `Skipped config found for ${filePath} (based on config's base path: ${config.basePath}`,
1243
+ );
1244
+ return;
1245
+ }
1246
+
1247
+ if (!config.files) {
1248
+ if (!config.ignores) {
1249
+ debug(`Universal config found for ${filePath}`);
1250
+ matchingConfigIndices.push(index);
1251
+ return;
1252
+ }
1253
+
1254
+ if (
1255
+ Object.keys(config).filter(key => !META_FIELDS.has(key))
1256
+ .length === 1
1257
+ ) {
1258
+ debug(
1259
+ `Skipped config found for ${filePath} (global ignores)`,
1260
+ );
1261
+ return;
1262
+ }
1263
+
1264
+ /*
1265
+ * Pass config object without `basePath`, because `relativeFilePath` is already
1266
+ * calculated as relative to it.
1267
+ */
1268
+ if (
1269
+ shouldIgnorePath(
1270
+ [{ ignores: config.ignores }],
1271
+ filePath,
1272
+ relativeFilePath,
1273
+ )
1274
+ ) {
1275
+ debug(
1276
+ `Skipped config found for ${filePath} (based on ignores: ${config.ignores})`,
1277
+ );
1278
+ return;
1279
+ }
1280
+
1281
+ debug(
1282
+ `Matching config found for ${filePath} (based on ignores: ${config.ignores})`,
1283
+ );
1284
+ matchingConfigIndices.push(index);
1285
+ return;
1286
+ }
1287
+
1288
+ /*
1289
+ * If a config has a files pattern * or patterns ending in /** or /*,
1290
+ * and the filePath only matches those patterns, then the config is only
1291
+ * applied if there is another config where the filePath matches
1292
+ * a file with a specific extensions such as *.js.
1293
+ */
1294
+
1295
+ const nonUniversalFiles = [];
1296
+ const universalFiles = config.files.filter(element => {
1297
+ if (Array.isArray(element)) {
1298
+ /*
1299
+ * filePath matches an element that is an array only if it matches
1300
+ * all patterns in it (AND operation). Therefore, if there is at least
1301
+ * one non-universal pattern in the array, and filePath matches the array,
1302
+ * then we know for sure that filePath matches at least one non-universal
1303
+ * pattern, so we can consider the entire array to be non-universal.
1304
+ * In other words, all patterns in the array need to be universal
1305
+ * for it to be considered universal.
1306
+ */
1307
+ if (
1308
+ element.every(pattern => universalPattern.test(pattern))
1309
+ ) {
1310
+ return true;
1311
+ }
1312
+
1313
+ nonUniversalFiles.push(element);
1314
+ return false;
1315
+ }
1316
+
1317
+ // element is a string
1318
+
1319
+ if (universalPattern.test(element)) {
1320
+ return true;
1321
+ }
1322
+
1323
+ nonUniversalFiles.push(element);
1324
+ return false;
1325
+ });
1326
+
1327
+ // universal patterns were found so we need to check the config twice
1328
+ if (universalFiles.length) {
1329
+ debug("Universal files patterns found. Checking carefully.");
1330
+
1331
+ // check that the config matches without the non-universal files first
1332
+ if (
1333
+ nonUniversalFiles.length &&
1334
+ pathMatches(filePath, relativeFilePath, {
1335
+ files: nonUniversalFiles,
1336
+ ignores: config.ignores,
1337
+ })
1338
+ ) {
1339
+ debug(`Matching config found for ${filePath}`);
1340
+ matchingConfigIndices.push(index);
1341
+ matchFound = true;
1342
+ return;
1343
+ }
1344
+
1345
+ // if there wasn't a match then check if it matches with universal files
1346
+ if (
1347
+ universalFiles.length &&
1348
+ pathMatches(filePath, relativeFilePath, {
1349
+ files: universalFiles,
1350
+ ignores: config.ignores,
1351
+ })
1352
+ ) {
1353
+ debug(`Matching config found for ${filePath}`);
1354
+ matchingConfigIndices.push(index);
1355
+ return;
1356
+ }
1357
+
1358
+ // if we make here, then there was no match
1359
+ return;
1360
+ }
1361
+
1362
+ // the normal case
1363
+ if (pathMatches(filePath, relativeFilePath, config)) {
1364
+ debug(`Matching config found for ${filePath}`);
1365
+ matchingConfigIndices.push(index);
1366
+ matchFound = true;
1367
+ }
1368
+ });
1369
+
1370
+ // if matching both files and ignores, there will be no config to create
1371
+ if (!matchFound) {
1372
+ debug(`No matching configs found for ${filePath}`);
1373
+
1374
+ // cache and return result
1375
+ cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED);
1376
+ return CONFIG_WITH_STATUS_UNCONFIGURED;
1377
+ }
1378
+
1379
+ // check to see if there is a config cached by indices
1380
+ const indicesKey = matchingConfigIndices.toString();
1381
+ let configWithStatus = cache.get(indicesKey);
1382
+
1383
+ if (configWithStatus) {
1384
+ // also store for filename for faster lookup next time
1385
+ cache.set(filePath, configWithStatus);
1386
+
1387
+ return configWithStatus;
1388
+ }
1389
+
1390
+ // otherwise construct the config
1391
+
1392
+ // eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error
1393
+ let finalConfig = matchingConfigIndices.reduce((result, index) => {
1394
+ try {
1395
+ return this[ConfigArraySymbol.schema].merge(
1396
+ result,
1397
+ this[index],
1398
+ );
1399
+ } catch (validationError) {
1400
+ rethrowConfigError(this[index], index, validationError);
1401
+ }
1402
+ }, {});
1403
+
1404
+ finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig);
1405
+
1406
+ configWithStatus = Object.freeze({
1407
+ config: finalConfig,
1408
+ status: "matched",
1409
+ });
1410
+ cache.set(filePath, configWithStatus);
1411
+ cache.set(indicesKey, configWithStatus);
1412
+
1413
+ return configWithStatus;
1414
+ }
1415
+
1416
+ /**
1417
+ * Returns the config object for a given file path.
1418
+ * @param {string} filePath The path of a file to get a config for.
1419
+ * @returns {Object|undefined} The config object for this file or `undefined`.
1420
+ */
1421
+ getConfig(filePath) {
1422
+ return this.getConfigWithStatus(filePath).config;
1423
+ }
1424
+
1425
+ /**
1426
+ * Determines whether a file has a config or why it doesn't.
1427
+ * @param {string} filePath The path of the file to check.
1428
+ * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
1429
+ * * `"ignored"`: the file is ignored
1430
+ * * `"external"`: the file is outside the base path
1431
+ * * `"unconfigured"`: the file is not matched by any config
1432
+ * * `"matched"`: the file has a matching config
1433
+ */
1434
+ getConfigStatus(filePath) {
1435
+ return this.getConfigWithStatus(filePath).status;
1436
+ }
1437
+
1438
+ /**
1439
+ * Determines if the given filepath is ignored based on the configs.
1440
+ * @param {string} filePath The path of a file to check.
1441
+ * @returns {boolean} True if the path is ignored, false if not.
1442
+ * @deprecated Use `isFileIgnored` instead.
1443
+ */
1444
+ isIgnored(filePath) {
1445
+ return this.isFileIgnored(filePath);
1446
+ }
1447
+
1448
+ /**
1449
+ * Determines if the given filepath is ignored based on the configs.
1450
+ * @param {string} filePath The path of a file to check.
1451
+ * @returns {boolean} True if the path is ignored, false if not.
1452
+ */
1453
+ isFileIgnored(filePath) {
1454
+ return this.getConfigStatus(filePath) === "ignored";
1455
+ }
1456
+
1457
+ /**
1458
+ * Determines if the given directory is ignored based on the configs.
1459
+ * This checks only default `ignores` that don't have `files` in the
1460
+ * same config. A pattern such as `/foo` be considered to ignore the directory
1461
+ * while a pattern such as `/foo/**` is not considered to ignore the
1462
+ * directory because it is matching files.
1463
+ * @param {string} directoryPath The path of a directory to check.
1464
+ * @returns {boolean} True if the directory is ignored, false if not. Will
1465
+ * return true for any directory that is not inside of `basePath`.
1466
+ * @throws {Error} When the `ConfigArray` is not normalized.
1467
+ */
1468
+ isDirectoryIgnored(directoryPath) {
1469
+ assertNormalized(this);
1470
+
1471
+ const relativeDirectoryPath = toRelativePath(
1472
+ directoryPath,
1473
+ this.#namespacedBasePath,
1474
+ this.#path,
1475
+ );
1476
+
1477
+ // basePath directory can never be ignored
1478
+ if (relativeDirectoryPath === "") {
1479
+ return false;
1480
+ }
1481
+
1482
+ if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) {
1483
+ return true;
1484
+ }
1485
+
1486
+ // first check the cache
1487
+ const cache = dataCache.get(this).directoryMatches;
1488
+
1489
+ if (cache.has(relativeDirectoryPath)) {
1490
+ return cache.get(relativeDirectoryPath);
1491
+ }
1492
+
1493
+ const directoryParts = relativeDirectoryPath.split("/");
1494
+ let relativeDirectoryToCheck = "";
1495
+ let result;
1496
+
1497
+ /*
1498
+ * In order to get the correct gitignore-style ignores, where an
1499
+ * ignored parent directory cannot have any descendants unignored,
1500
+ * we need to check every directory starting at the parent all
1501
+ * the way down to the actual requested directory.
1502
+ *
1503
+ * We aggressively cache all of this info to make sure we don't
1504
+ * have to recalculate everything for every call.
1505
+ */
1506
+ do {
1507
+ relativeDirectoryToCheck += `${directoryParts.shift()}/`;
1508
+
1509
+ result = shouldIgnorePath(
1510
+ this.ignores,
1511
+ this.#path.join(this.basePath, relativeDirectoryToCheck),
1512
+ relativeDirectoryToCheck,
1513
+ {
1514
+ basePath: this.#namespacedBasePath,
1515
+ path: this.#path,
1516
+ },
1517
+ );
1518
+
1519
+ cache.set(relativeDirectoryToCheck, result);
1520
+ } while (!result && directoryParts.length);
1521
+
1522
+ // also cache the result for the requested path
1523
+ cache.set(relativeDirectoryPath, result);
1524
+
1525
+ return result;
1526
+ }
1527
+ }
1528
+
1529
+ Object.defineProperty(exports, "ObjectSchema", {
1530
+ enumerable: true,
1531
+ get: function () { return objectSchema.ObjectSchema; }
1532
+ });
1533
+ exports.ConfigArray = ConfigArray;
1534
+ exports.ConfigArraySymbol = ConfigArraySymbol;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/index.d.cts ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export { ObjectSchema } from "@eslint/object-schema";
2
+ export type PropertyDefinition = import("@eslint/object-schema").PropertyDefinition;
3
+ export type ObjectDefinition = import("@eslint/object-schema").ObjectDefinition;
4
+ export type ConfigObject = import("./types.cts").ConfigObject;
5
+ export type IMinimatchStatic = import("minimatch").IMinimatchStatic;
6
+ export type IMinimatch = import("minimatch").IMinimatch;
7
+ export type PathImpl = typeof import("@jsr/std__path");
8
+ export type ObjectSchemaInstance = import("@eslint/object-schema").ObjectSchema;
9
+ /**
10
+ * Represents an array of config objects and provides method for working with
11
+ * those config objects.
12
+ */
13
+ export class ConfigArray extends Array<any> {
14
+ [x: symbol]: (config: any) => any;
15
+ /**
16
+ * Creates a new instance of ConfigArray.
17
+ * @param {Iterable|Function|Object} configs An iterable yielding config
18
+ * objects, or a config function, or a config object.
19
+ * @param {Object} options The options for the ConfigArray.
20
+ * @param {string} [options.basePath="/"] The absolute path of the config file directory.
21
+ * Defaults to `"/"`.
22
+ * @param {boolean} [options.normalized=false] Flag indicating if the
23
+ * configs have already been normalized.
24
+ * @param {Object} [options.schema] The additional schema
25
+ * definitions to use for the ConfigArray schema.
26
+ * @param {Array<string>} [options.extraConfigTypes] List of config types supported.
27
+ * @throws {TypeError} When the `basePath` is not a non-empty string,
28
+ */
29
+ constructor(configs: Iterable<any> | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: {
30
+ basePath?: string;
31
+ normalized?: boolean;
32
+ schema?: any;
33
+ extraConfigTypes?: Array<string>;
34
+ });
35
+ /**
36
+ * The path of the config file that this array was loaded from.
37
+ * This is used to calculate filename matches.
38
+ * @property basePath
39
+ * @type {string}
40
+ */
41
+ basePath: string;
42
+ /**
43
+ * The supported config types.
44
+ * @type {Array<string>}
45
+ */
46
+ extraConfigTypes: Array<string>;
47
+ /**
48
+ * Returns the `files` globs from every config object in the array.
49
+ * This can be used to determine which files will be matched by a
50
+ * config array or to use as a glob pattern when no patterns are provided
51
+ * for a command line interface.
52
+ * @returns {Array<string|Function>} An array of matchers.
53
+ */
54
+ get files(): Array<string | Function>;
55
+ /**
56
+ * Returns ignore matchers that should always be ignored regardless of
57
+ * the matching `files` fields in any configs. This is necessary to mimic
58
+ * the behavior of things like .gitignore and .eslintignore, allowing a
59
+ * globbing operation to be faster.
60
+ * @returns {Object[]} An array of config objects representing global ignores.
61
+ */
62
+ get ignores(): any[];
63
+ /**
64
+ * Indicates if the config array has been normalized.
65
+ * @returns {boolean} True if the config array is normalized, false if not.
66
+ */
67
+ isNormalized(): boolean;
68
+ /**
69
+ * Normalizes a config array by flattening embedded arrays and executing
70
+ * config functions.
71
+ * @param {Object} [context] The context object for config functions.
72
+ * @returns {Promise<ConfigArray>} The current ConfigArray instance.
73
+ */
74
+ normalize(context?: any): Promise<ConfigArray>;
75
+ /**
76
+ * Normalizes a config array by flattening embedded arrays and executing
77
+ * config functions.
78
+ * @param {Object} [context] The context object for config functions.
79
+ * @returns {ConfigArray} The current ConfigArray instance.
80
+ */
81
+ normalizeSync(context?: any): ConfigArray;
82
+ /**
83
+ * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
84
+ * @param {string} filePath The path of a file to get a config for.
85
+ * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
86
+ * An object with an optional property `config` and property `status`.
87
+ * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
88
+ * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
89
+ */
90
+ getConfigWithStatus(filePath: string): {
91
+ config?: any;
92
+ status: "ignored" | "external" | "unconfigured" | "matched";
93
+ };
94
+ /**
95
+ * Returns the config object for a given file path.
96
+ * @param {string} filePath The path of a file to get a config for.
97
+ * @returns {Object|undefined} The config object for this file or `undefined`.
98
+ */
99
+ getConfig(filePath: string): any | undefined;
100
+ /**
101
+ * Determines whether a file has a config or why it doesn't.
102
+ * @param {string} filePath The path of the file to check.
103
+ * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
104
+ * * `"ignored"`: the file is ignored
105
+ * * `"external"`: the file is outside the base path
106
+ * * `"unconfigured"`: the file is not matched by any config
107
+ * * `"matched"`: the file has a matching config
108
+ */
109
+ getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched";
110
+ /**
111
+ * Determines if the given filepath is ignored based on the configs.
112
+ * @param {string} filePath The path of a file to check.
113
+ * @returns {boolean} True if the path is ignored, false if not.
114
+ * @deprecated Use `isFileIgnored` instead.
115
+ */
116
+ isIgnored(filePath: string): boolean;
117
+ /**
118
+ * Determines if the given filepath is ignored based on the configs.
119
+ * @param {string} filePath The path of a file to check.
120
+ * @returns {boolean} True if the path is ignored, false if not.
121
+ */
122
+ isFileIgnored(filePath: string): boolean;
123
+ /**
124
+ * Determines if the given directory is ignored based on the configs.
125
+ * This checks only default `ignores` that don't have `files` in the
126
+ * same config. A pattern such as `/foo` be considered to ignore the directory
127
+ * while a pattern such as `/foo/**` is not considered to ignore the
128
+ * directory because it is matching files.
129
+ * @param {string} directoryPath The path of a directory to check.
130
+ * @returns {boolean} True if the directory is ignored, false if not. Will
131
+ * return true for any directory that is not inside of `basePath`.
132
+ * @throws {Error} When the `ConfigArray` is not normalized.
133
+ */
134
+ isDirectoryIgnored(directoryPath: string): boolean;
135
+ #private;
136
+ }
137
+ export namespace ConfigArraySymbol {
138
+ let isNormalized: symbol;
139
+ let configCache: symbol;
140
+ let schema: symbol;
141
+ let finalizeConfig: symbol;
142
+ let preprocessConfig: symbol;
143
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs ADDED
@@ -0,0 +1,1335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ // Copyright 2018-2025 the Deno authors. MIT license.
4
+ // Copyright the Browserify authors. MIT License.
5
+ function assertPath(path) {
6
+ if (typeof path !== "string") {
7
+ throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
8
+ }
9
+ }
10
+
11
+ // Copyright 2018-2025 the Deno authors. MIT license.
12
+ // This module is browser compatible.
13
+ function stripSuffix(name, suffix) {
14
+ if (suffix.length >= name.length) {
15
+ return name;
16
+ }
17
+ const lenDiff = name.length - suffix.length;
18
+ for(let i = suffix.length - 1; i >= 0; --i){
19
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
20
+ return name;
21
+ }
22
+ }
23
+ return name.slice(0, -suffix.length);
24
+ }
25
+ function lastPathSegment(path, isSep, start = 0) {
26
+ let matchedNonSeparator = false;
27
+ let end = path.length;
28
+ for(let i = path.length - 1; i >= start; --i){
29
+ if (isSep(path.charCodeAt(i))) {
30
+ if (matchedNonSeparator) {
31
+ start = i + 1;
32
+ break;
33
+ }
34
+ } else if (!matchedNonSeparator) {
35
+ matchedNonSeparator = true;
36
+ end = i + 1;
37
+ }
38
+ }
39
+ return path.slice(start, end);
40
+ }
41
+ function assertArgs$1(path, suffix) {
42
+ assertPath(path);
43
+ if (path.length === 0) return path;
44
+ if (typeof suffix !== "string") {
45
+ throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
46
+ }
47
+ }
48
+
49
+ // Copyright 2018-2025 the Deno authors. MIT license.
50
+ // This module is browser compatible.
51
+ function assertArg$3(url) {
52
+ url = url instanceof URL ? url : new URL(url);
53
+ if (url.protocol !== "file:") {
54
+ throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
55
+ }
56
+ return url;
57
+ }
58
+
59
+ // Copyright 2018-2025 the Deno authors. MIT license.
60
+ // This module is browser compatible.
61
+ /**
62
+ * Converts a file URL to a path string.
63
+ *
64
+ * @example Usage
65
+ * ```ts
66
+ * import { fromFileUrl } from "@std/path/posix/from-file-url";
67
+ * import { assertEquals } from "@std/assert";
68
+ *
69
+ * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
70
+ * ```
71
+ *
72
+ * @param url The file URL to convert.
73
+ * @returns The path string.
74
+ */ function fromFileUrl(url) {
75
+ url = assertArg$3(url);
76
+ return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
77
+ }
78
+
79
+ // Copyright 2018-2025 the Deno authors. MIT license.
80
+ // Copyright the Browserify authors. MIT License.
81
+ // Ported from https://github.com/browserify/path-browserify/
82
+ // This module is browser compatible.
83
+ function stripTrailingSeparators(segment, isSep) {
84
+ if (segment.length <= 1) {
85
+ return segment;
86
+ }
87
+ let end = segment.length;
88
+ for(let i = segment.length - 1; i > 0; i--){
89
+ if (isSep(segment.charCodeAt(i))) {
90
+ end = i;
91
+ } else {
92
+ break;
93
+ }
94
+ }
95
+ return segment.slice(0, end);
96
+ }
97
+
98
+ // Copyright 2018-2025 the Deno authors. MIT license.
99
+ // Copyright the Browserify authors. MIT License.
100
+ // Ported from https://github.com/browserify/path-browserify/
101
+ // This module is browser compatible.
102
+ // Alphabet chars.
103
+ // Non-alphabetic chars.
104
+ const CHAR_DOT = 46; /* . */
105
+ const CHAR_FORWARD_SLASH = 47; /* / */
106
+
107
+ // Copyright 2018-2025 the Deno authors. MIT license.
108
+ // Copyright the Browserify authors. MIT License.
109
+ // Ported from https://github.com/browserify/path-browserify/
110
+ // This module is browser compatible.
111
+ function isPosixPathSeparator(code) {
112
+ return code === CHAR_FORWARD_SLASH;
113
+ }
114
+
115
+ // Copyright 2018-2025 the Deno authors. MIT license.
116
+ // This module is browser compatible.
117
+ /**
118
+ * Return the last portion of a `path`.
119
+ * Trailing directory separators are ignored, and optional suffix is removed.
120
+ *
121
+ * @example Usage
122
+ * ```ts
123
+ * import { basename } from "@std/path/posix/basename";
124
+ * import { assertEquals } from "@std/assert";
125
+ *
126
+ * assertEquals(basename("/home/user/Documents/"), "Documents");
127
+ * assertEquals(basename("/home/user/Documents/image.png"), "image.png");
128
+ * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image");
129
+ * assertEquals(basename(new URL("file:///home/user/Documents/image.png")), "image.png");
130
+ * assertEquals(basename(new URL("file:///home/user/Documents/image.png"), ".png"), "image");
131
+ * ```
132
+ *
133
+ * @example Working with URLs
134
+ *
135
+ * Note: This function doesn't automatically strip hash and query parts from
136
+ * URLs. If your URL contains a hash or query, remove them before passing the
137
+ * URL to the function. This can be done by passing the URL to `new URL(url)`,
138
+ * and setting the `hash` and `search` properties to empty strings.
139
+ *
140
+ * ```ts
141
+ * import { basename } from "@std/path/posix/basename";
142
+ * import { assertEquals } from "@std/assert";
143
+ *
144
+ * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts");
145
+ * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod");
146
+ * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b");
147
+ * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header");
148
+ * ```
149
+ *
150
+ * @param path The path to extract the name from.
151
+ * @param suffix The suffix to remove from extracted name.
152
+ * @returns The extracted name.
153
+ */ function basename(path, suffix = "") {
154
+ if (path instanceof URL) {
155
+ path = fromFileUrl(path);
156
+ }
157
+ assertArgs$1(path, suffix);
158
+ const lastSegment = lastPathSegment(path, isPosixPathSeparator);
159
+ const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
160
+ return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
161
+ }
162
+
163
+ // Copyright 2018-2025 the Deno authors. MIT license.
164
+ // This module is browser compatible.
165
+ /**
166
+ * The character used to separate entries in the PATH environment variable.
167
+ */ const DELIMITER = ":";
168
+ /**
169
+ * The character used to separate components of a file path.
170
+ */ const SEPARATOR = "/";
171
+ /**
172
+ * A regular expression that matches one or more path separators.
173
+ */ const SEPARATOR_PATTERN = /\/+/;
174
+
175
+ // Copyright 2018-2025 the Deno authors. MIT license.
176
+ // This module is browser compatible.
177
+ function assertArg$2(path) {
178
+ assertPath(path);
179
+ if (path.length === 0) return ".";
180
+ }
181
+
182
+ // Copyright 2018-2025 the Deno authors. MIT license.
183
+ // This module is browser compatible.
184
+ /**
185
+ * Return the directory path of a `path`.
186
+ *
187
+ * @example Usage
188
+ * ```ts
189
+ * import { dirname } from "@std/path/posix/dirname";
190
+ * import { assertEquals } from "@std/assert";
191
+ *
192
+ * assertEquals(dirname("/home/user/Documents/"), "/home/user");
193
+ * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents");
194
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
195
+ * assertEquals(dirname(new URL("file:///home/user/Documents/image.png")), "/home/user/Documents");
196
+ * ```
197
+ *
198
+ * @example Working with URLs
199
+ *
200
+ * ```ts
201
+ * import { dirname } from "@std/path/posix/dirname";
202
+ * import { assertEquals } from "@std/assert";
203
+ *
204
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
205
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path");
206
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path");
207
+ * ```
208
+ *
209
+ * @param path The path to get the directory from.
210
+ * @returns The directory path.
211
+ */ function dirname(path) {
212
+ if (path instanceof URL) {
213
+ path = fromFileUrl(path);
214
+ }
215
+ assertArg$2(path);
216
+ let end = -1;
217
+ let matchedNonSeparator = false;
218
+ for(let i = path.length - 1; i >= 1; --i){
219
+ if (isPosixPathSeparator(path.charCodeAt(i))) {
220
+ if (matchedNonSeparator) {
221
+ end = i;
222
+ break;
223
+ }
224
+ } else {
225
+ matchedNonSeparator = true;
226
+ }
227
+ }
228
+ // No matches. Fallback based on provided path:
229
+ //
230
+ // - leading slashes paths
231
+ // "/foo" => "/"
232
+ // "///foo" => "/"
233
+ // - no slash path
234
+ // "foo" => "."
235
+ if (end === -1) {
236
+ return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
237
+ }
238
+ return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
239
+ }
240
+
241
+ // Copyright 2018-2025 the Deno authors. MIT license.
242
+ // This module is browser compatible.
243
+ /**
244
+ * Return the extension of the `path` with leading period.
245
+ *
246
+ * @example Usage
247
+ * ```ts
248
+ * import { extname } from "@std/path/posix/extname";
249
+ * import { assertEquals } from "@std/assert";
250
+ *
251
+ * assertEquals(extname("/home/user/Documents/file.ts"), ".ts");
252
+ * assertEquals(extname("/home/user/Documents/"), "");
253
+ * assertEquals(extname("/home/user/Documents/image.png"), ".png");
254
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts")), ".ts");
255
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts?a=b")), ".ts");
256
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts#header")), ".ts");
257
+ * ```
258
+ *
259
+ * @example Working with URLs
260
+ *
261
+ * Note: This function doesn't automatically strip hash and query parts from
262
+ * URLs. If your URL contains a hash or query, remove them before passing the
263
+ * URL to the function. This can be done by passing the URL to `new URL(url)`,
264
+ * and setting the `hash` and `search` properties to empty strings.
265
+ *
266
+ * ```ts
267
+ * import { extname } from "@std/path/posix/extname";
268
+ * import { assertEquals } from "@std/assert";
269
+ *
270
+ * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts");
271
+ * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b");
272
+ * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header");
273
+ * ```
274
+ *
275
+ * @param path The path to get the extension from.
276
+ * @returns The extension (ex. for `file.ts` returns `.ts`).
277
+ */ function extname(path) {
278
+ if (path instanceof URL) {
279
+ path = fromFileUrl(path);
280
+ }
281
+ assertPath(path);
282
+ let startDot = -1;
283
+ let startPart = 0;
284
+ let end = -1;
285
+ let matchedSlash = true;
286
+ // Track the state of characters (if any) we see before our first dot and
287
+ // after any path separator we find
288
+ let preDotState = 0;
289
+ for(let i = path.length - 1; i >= 0; --i){
290
+ const code = path.charCodeAt(i);
291
+ if (isPosixPathSeparator(code)) {
292
+ // If we reached a path separator that was not part of a set of path
293
+ // separators at the end of the string, stop now
294
+ if (!matchedSlash) {
295
+ startPart = i + 1;
296
+ break;
297
+ }
298
+ continue;
299
+ }
300
+ if (end === -1) {
301
+ // We saw the first non-path separator, mark this as the end of our
302
+ // extension
303
+ matchedSlash = false;
304
+ end = i + 1;
305
+ }
306
+ if (code === CHAR_DOT) {
307
+ // If this is our first dot, mark it as the start of our extension
308
+ if (startDot === -1) startDot = i;
309
+ else if (preDotState !== 1) preDotState = 1;
310
+ } else if (startDot !== -1) {
311
+ // We saw a non-dot and non-path separator before our dot, so we should
312
+ // have a good chance at having a non-empty extension
313
+ preDotState = -1;
314
+ }
315
+ }
316
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
317
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
318
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
319
+ return "";
320
+ }
321
+ return path.slice(startDot, end);
322
+ }
323
+
324
+ // Copyright 2018-2025 the Deno authors. MIT license.
325
+ // This module is browser compatible.
326
+ function _format(sep, pathObject) {
327
+ const dir = pathObject.dir || pathObject.root;
328
+ const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
329
+ if (!dir) return base;
330
+ if (base === sep) return dir;
331
+ if (dir === pathObject.root) return dir + base;
332
+ return dir + sep + base;
333
+ }
334
+ function assertArg$1(pathObject) {
335
+ if (pathObject === null || typeof pathObject !== "object") {
336
+ throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
337
+ }
338
+ }
339
+
340
+ // Copyright 2018-2025 the Deno authors. MIT license.
341
+ // This module is browser compatible.
342
+ /**
343
+ * Generate a path from `ParsedPath` object.
344
+ *
345
+ * @example Usage
346
+ * ```ts
347
+ * import { format } from "@std/path/posix/format";
348
+ * import { assertEquals } from "@std/assert";
349
+ *
350
+ * const path = format({
351
+ * root: "/",
352
+ * dir: "/path/dir",
353
+ * base: "file.txt",
354
+ * ext: ".txt",
355
+ * name: "file"
356
+ * });
357
+ * assertEquals(path, "/path/dir/file.txt");
358
+ * ```
359
+ *
360
+ * @param pathObject The path object to format.
361
+ * @returns The formatted path.
362
+ */ function format(pathObject) {
363
+ assertArg$1(pathObject);
364
+ return _format("/", pathObject);
365
+ }
366
+
367
+ // Copyright 2018-2025 the Deno authors. MIT license.
368
+ // This module is browser compatible.
369
+ /**
370
+ * Verifies whether provided path is absolute.
371
+ *
372
+ * @example Usage
373
+ * ```ts
374
+ * import { isAbsolute } from "@std/path/posix/is-absolute";
375
+ * import { assert, assertFalse } from "@std/assert";
376
+ *
377
+ * assert(isAbsolute("/home/user/Documents/"));
378
+ * assertFalse(isAbsolute("home/user/Documents/"));
379
+ * ```
380
+ *
381
+ * @param path The path to verify.
382
+ * @returns Whether the path is absolute.
383
+ */ function isAbsolute(path) {
384
+ assertPath(path);
385
+ return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
386
+ }
387
+
388
+ // Copyright 2018-2025 the Deno authors. MIT license.
389
+ // This module is browser compatible.
390
+ function assertArg(path) {
391
+ assertPath(path);
392
+ if (path.length === 0) return ".";
393
+ }
394
+
395
+ // Copyright 2018-2025 the Deno authors. MIT license.
396
+ // Copyright the Browserify authors. MIT License.
397
+ // Ported from https://github.com/browserify/path-browserify/
398
+ // This module is browser compatible.
399
+ // Resolves . and .. elements in a path with directory names
400
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
401
+ let res = "";
402
+ let lastSegmentLength = 0;
403
+ let lastSlash = -1;
404
+ let dots = 0;
405
+ let code;
406
+ for(let i = 0; i <= path.length; ++i){
407
+ if (i < path.length) code = path.charCodeAt(i);
408
+ else if (isPathSeparator(code)) break;
409
+ else code = CHAR_FORWARD_SLASH;
410
+ if (isPathSeparator(code)) {
411
+ if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
412
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
413
+ if (res.length > 2) {
414
+ const lastSlashIndex = res.lastIndexOf(separator);
415
+ if (lastSlashIndex === -1) {
416
+ res = "";
417
+ lastSegmentLength = 0;
418
+ } else {
419
+ res = res.slice(0, lastSlashIndex);
420
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
421
+ }
422
+ lastSlash = i;
423
+ dots = 0;
424
+ continue;
425
+ } else if (res.length === 2 || res.length === 1) {
426
+ res = "";
427
+ lastSegmentLength = 0;
428
+ lastSlash = i;
429
+ dots = 0;
430
+ continue;
431
+ }
432
+ }
433
+ if (allowAboveRoot) {
434
+ if (res.length > 0) res += `${separator}..`;
435
+ else res = "..";
436
+ lastSegmentLength = 2;
437
+ }
438
+ } else {
439
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
440
+ else res = path.slice(lastSlash + 1, i);
441
+ lastSegmentLength = i - lastSlash - 1;
442
+ }
443
+ lastSlash = i;
444
+ dots = 0;
445
+ } else if (code === CHAR_DOT && dots !== -1) {
446
+ ++dots;
447
+ } else {
448
+ dots = -1;
449
+ }
450
+ }
451
+ return res;
452
+ }
453
+
454
+ // Copyright 2018-2025 the Deno authors. MIT license.
455
+ // This module is browser compatible.
456
+ /**
457
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
458
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
459
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
460
+ *
461
+ * @example Usage
462
+ * ```ts
463
+ * import { normalize } from "@std/path/posix/normalize";
464
+ * import { assertEquals } from "@std/assert";
465
+ *
466
+ * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
467
+ * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
468
+ * ```
469
+ *
470
+ * @example Working with URLs
471
+ *
472
+ * Note: This function will remove the double slashes from a URL's scheme.
473
+ * Hence, do not pass a full URL to this function. Instead, pass the pathname of
474
+ * the URL.
475
+ *
476
+ * ```ts
477
+ * import { normalize } from "@std/path/posix/normalize";
478
+ * import { assertEquals } from "@std/assert";
479
+ *
480
+ * const url = new URL("https://deno.land");
481
+ * url.pathname = normalize("//std//assert//.//mod.ts");
482
+ * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
483
+ *
484
+ * url.pathname = normalize("std/assert/../async/retry.ts");
485
+ * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
486
+ * ```
487
+ *
488
+ * @param path The path to normalize.
489
+ * @returns The normalized path.
490
+ */ function normalize(path) {
491
+ if (path instanceof URL) {
492
+ path = fromFileUrl(path);
493
+ }
494
+ assertArg(path);
495
+ const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
496
+ const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
497
+ // Normalize the path
498
+ path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
499
+ if (path.length === 0 && !isAbsolute) path = ".";
500
+ if (path.length > 0 && trailingSeparator) path += "/";
501
+ if (isAbsolute) return `/${path}`;
502
+ return path;
503
+ }
504
+
505
+ // Copyright 2018-2025 the Deno authors. MIT license.
506
+ // This module is browser compatible.
507
+ /**
508
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
509
+ *
510
+ * @example Usage
511
+ * ```ts
512
+ * import { join } from "@std/path/posix/join";
513
+ * import { assertEquals } from "@std/assert";
514
+ *
515
+ * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
516
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
517
+ * ```
518
+ *
519
+ * @example Working with URLs
520
+ * ```ts
521
+ * import { join } from "@std/path/posix/join";
522
+ * import { assertEquals } from "@std/assert";
523
+ *
524
+ * const url = new URL("https://deno.land");
525
+ * url.pathname = join("std", "path", "mod.ts");
526
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
527
+ *
528
+ * url.pathname = join("//std", "path/", "/mod.ts");
529
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
530
+ * ```
531
+ *
532
+ * @param path The path to join. This can be string or file URL.
533
+ * @param paths The paths to join.
534
+ * @returns The joined path.
535
+ */ function join(path, ...paths) {
536
+ if (path === undefined) return ".";
537
+ if (path instanceof URL) {
538
+ path = fromFileUrl(path);
539
+ }
540
+ paths = path ? [
541
+ path,
542
+ ...paths
543
+ ] : paths;
544
+ paths.forEach((path)=>assertPath(path));
545
+ const joined = paths.filter((path)=>path.length > 0).join("/");
546
+ return joined === "" ? "." : normalize(joined);
547
+ }
548
+
549
+ // Copyright 2018-2025 the Deno authors. MIT license.
550
+ // This module is browser compatible.
551
+ /**
552
+ * Return a `ParsedPath` object of the `path`.
553
+ *
554
+ * @example Usage
555
+ * ```ts
556
+ * import { parse } from "@std/path/posix/parse";
557
+ * import { assertEquals } from "@std/assert";
558
+ *
559
+ * const path = parse("/home/user/file.txt");
560
+ * assertEquals(path, {
561
+ * root: "/",
562
+ * dir: "/home/user",
563
+ * base: "file.txt",
564
+ * ext: ".txt",
565
+ * name: "file"
566
+ * });
567
+ * ```
568
+ *
569
+ * @param path The path to parse.
570
+ * @returns The parsed path object.
571
+ */ function parse(path) {
572
+ assertPath(path);
573
+ const ret = {
574
+ root: "",
575
+ dir: "",
576
+ base: "",
577
+ ext: "",
578
+ name: ""
579
+ };
580
+ if (path.length === 0) return ret;
581
+ const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
582
+ let start;
583
+ if (isAbsolute) {
584
+ ret.root = "/";
585
+ start = 1;
586
+ } else {
587
+ start = 0;
588
+ }
589
+ let startDot = -1;
590
+ let startPart = 0;
591
+ let end = -1;
592
+ let matchedSlash = true;
593
+ let i = path.length - 1;
594
+ // Track the state of characters (if any) we see before our first dot and
595
+ // after any path separator we find
596
+ let preDotState = 0;
597
+ // Get non-dir info
598
+ for(; i >= start; --i){
599
+ const code = path.charCodeAt(i);
600
+ if (isPosixPathSeparator(code)) {
601
+ // If we reached a path separator that was not part of a set of path
602
+ // separators at the end of the string, stop now
603
+ if (!matchedSlash) {
604
+ startPart = i + 1;
605
+ break;
606
+ }
607
+ continue;
608
+ }
609
+ if (end === -1) {
610
+ // We saw the first non-path separator, mark this as the end of our
611
+ // extension
612
+ matchedSlash = false;
613
+ end = i + 1;
614
+ }
615
+ if (code === CHAR_DOT) {
616
+ // If this is our first dot, mark it as the start of our extension
617
+ if (startDot === -1) startDot = i;
618
+ else if (preDotState !== 1) preDotState = 1;
619
+ } else if (startDot !== -1) {
620
+ // We saw a non-dot and non-path separator before our dot, so we should
621
+ // have a good chance at having a non-empty extension
622
+ preDotState = -1;
623
+ }
624
+ }
625
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
626
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
627
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
628
+ if (end !== -1) {
629
+ if (startPart === 0 && isAbsolute) {
630
+ ret.base = ret.name = path.slice(1, end);
631
+ } else {
632
+ ret.base = ret.name = path.slice(startPart, end);
633
+ }
634
+ }
635
+ // Fallback to '/' in case there is no basename
636
+ ret.base = ret.base || "/";
637
+ } else {
638
+ if (startPart === 0 && isAbsolute) {
639
+ ret.name = path.slice(1, startDot);
640
+ ret.base = path.slice(1, end);
641
+ } else {
642
+ ret.name = path.slice(startPart, startDot);
643
+ ret.base = path.slice(startPart, end);
644
+ }
645
+ ret.ext = path.slice(startDot, end);
646
+ }
647
+ if (startPart > 0) {
648
+ ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
649
+ } else if (isAbsolute) ret.dir = "/";
650
+ return ret;
651
+ }
652
+
653
+ // Copyright 2018-2025 the Deno authors. MIT license.
654
+ // This module is browser compatible.
655
+ /**
656
+ * Resolves path segments into a `path`.
657
+ *
658
+ * @example Usage
659
+ * ```ts
660
+ * import { resolve } from "@std/path/posix/resolve";
661
+ * import { assertEquals } from "@std/assert";
662
+ *
663
+ * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
664
+ * assertEquals(path, "/foo/bar/baz/asdf");
665
+ * ```
666
+ *
667
+ * @param pathSegments The path segments to resolve.
668
+ * @returns The resolved path.
669
+ */ function resolve(...pathSegments) {
670
+ let resolvedPath = "";
671
+ let resolvedAbsolute = false;
672
+ for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){
673
+ let path;
674
+ if (i >= 0) path = pathSegments[i];
675
+ else {
676
+ // deno-lint-ignore no-explicit-any
677
+ const { Deno } = globalThis;
678
+ if (typeof Deno?.cwd !== "function") {
679
+ throw new TypeError("Resolved a relative path without a current working directory (CWD)");
680
+ }
681
+ path = Deno.cwd();
682
+ }
683
+ assertPath(path);
684
+ // Skip empty entries
685
+ if (path.length === 0) {
686
+ continue;
687
+ }
688
+ resolvedPath = `${path}/${resolvedPath}`;
689
+ resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
690
+ }
691
+ // At this point the path should be resolved to a full absolute path, but
692
+ // handle relative paths to be safe (might happen when Deno.cwd() fails)
693
+ // Normalize the path
694
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
695
+ if (resolvedAbsolute) {
696
+ if (resolvedPath.length > 0) return `/${resolvedPath}`;
697
+ else return "/";
698
+ } else if (resolvedPath.length > 0) return resolvedPath;
699
+ else return ".";
700
+ }
701
+
702
+ // Copyright 2018-2025 the Deno authors. MIT license.
703
+ // This module is browser compatible.
704
+ function assertArgs(from, to) {
705
+ assertPath(from);
706
+ assertPath(to);
707
+ if (from === to) return "";
708
+ }
709
+
710
+ // Copyright 2018-2025 the Deno authors. MIT license.
711
+ // This module is browser compatible.
712
+ /**
713
+ * Return the relative path from `from` to `to` based on current working directory.
714
+ *
715
+ * If `from` and `to` are the same, return an empty string.
716
+ *
717
+ * @example Usage
718
+ * ```ts
719
+ * import { relative } from "@std/path/posix/relative";
720
+ * import { assertEquals } from "@std/assert";
721
+ *
722
+ * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
723
+ * assertEquals(path, "../../impl/bbb");
724
+ * ```
725
+ *
726
+ * @param from The path to start from.
727
+ * @param to The path to reach.
728
+ * @returns The relative path.
729
+ */ function relative(from, to) {
730
+ assertArgs(from, to);
731
+ from = resolve(from);
732
+ to = resolve(to);
733
+ if (from === to) return "";
734
+ // Trim any leading backslashes
735
+ let fromStart = 1;
736
+ const fromEnd = from.length;
737
+ for(; fromStart < fromEnd; ++fromStart){
738
+ if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break;
739
+ }
740
+ const fromLen = fromEnd - fromStart;
741
+ // Trim any leading backslashes
742
+ let toStart = 1;
743
+ const toEnd = to.length;
744
+ for(; toStart < toEnd; ++toStart){
745
+ if (!isPosixPathSeparator(to.charCodeAt(toStart))) break;
746
+ }
747
+ const toLen = toEnd - toStart;
748
+ // Compare paths to find the longest common path from root
749
+ const length = fromLen < toLen ? fromLen : toLen;
750
+ let lastCommonSep = -1;
751
+ let i = 0;
752
+ for(; i <= length; ++i){
753
+ if (i === length) {
754
+ if (toLen > length) {
755
+ if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
756
+ // We get here if `from` is the exact base path for `to`.
757
+ // For example: from='/foo/bar'; to='/foo/bar/baz'
758
+ return to.slice(toStart + i + 1);
759
+ } else if (i === 0) {
760
+ // We get here if `from` is the root
761
+ // For example: from='/'; to='/foo'
762
+ return to.slice(toStart + i);
763
+ }
764
+ } else if (fromLen > length) {
765
+ if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
766
+ // We get here if `to` is the exact base path for `from`.
767
+ // For example: from='/foo/bar/baz'; to='/foo/bar'
768
+ lastCommonSep = i;
769
+ } else if (i === 0) {
770
+ // We get here if `to` is the root.
771
+ // For example: from='/foo'; to='/'
772
+ lastCommonSep = 0;
773
+ }
774
+ }
775
+ break;
776
+ }
777
+ const fromCode = from.charCodeAt(fromStart + i);
778
+ const toCode = to.charCodeAt(toStart + i);
779
+ if (fromCode !== toCode) break;
780
+ else if (isPosixPathSeparator(fromCode)) lastCommonSep = i;
781
+ }
782
+ let out = "";
783
+ // Generate the relative path based on the path difference between `to`
784
+ // and `from`
785
+ for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
786
+ if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
787
+ if (out.length === 0) out += "..";
788
+ else out += "/..";
789
+ }
790
+ }
791
+ // Lastly, append the rest of the destination (`to`) path that comes after
792
+ // the common path parts
793
+ if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
794
+ else {
795
+ toStart += lastCommonSep;
796
+ if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart;
797
+ return to.slice(toStart);
798
+ }
799
+ }
800
+
801
+ // Copyright 2018-2025 the Deno authors. MIT license.
802
+ // This module is browser compatible.
803
+ const WHITESPACE_ENCODINGS = {
804
+ "\u0009": "%09",
805
+ "\u000A": "%0A",
806
+ "\u000B": "%0B",
807
+ "\u000C": "%0C",
808
+ "\u000D": "%0D",
809
+ "\u0020": "%20"
810
+ };
811
+ function encodeWhitespace(string) {
812
+ return string.replaceAll(/[\s]/g, (c)=>{
813
+ return WHITESPACE_ENCODINGS[c] ?? c;
814
+ });
815
+ }
816
+
817
+ // Copyright 2018-2025 the Deno authors. MIT license.
818
+ // This module is browser compatible.
819
+ /**
820
+ * Converts a path string to a file URL.
821
+ *
822
+ * @example Usage
823
+ * ```ts
824
+ * import { toFileUrl } from "@std/path/posix/to-file-url";
825
+ * import { assertEquals } from "@std/assert";
826
+ *
827
+ * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
828
+ * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
829
+ * ```
830
+ *
831
+ * @param path The path to convert.
832
+ * @returns The file URL.
833
+ */ function toFileUrl(path) {
834
+ if (!isAbsolute(path)) {
835
+ throw new TypeError(`Path must be absolute: received "${path}"`);
836
+ }
837
+ const url = new URL("file:///");
838
+ url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
839
+ return url;
840
+ }
841
+
842
+ // Copyright 2018-2025 the Deno authors. MIT license.
843
+ // This module is browser compatible.
844
+ /**
845
+ * Converts a path to a namespaced path. This function returns the path as is on posix.
846
+ *
847
+ * @example Usage
848
+ * ```ts
849
+ * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
850
+ * import { assertEquals } from "@std/assert";
851
+ *
852
+ * assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
853
+ * ```
854
+ *
855
+ * @param path The path.
856
+ * @returns The namespaced path.
857
+ */ function toNamespacedPath(path) {
858
+ // Non-op on posix systems
859
+ return path;
860
+ }
861
+
862
+ // Copyright 2018-2025 the Deno authors. MIT license.
863
+ // This module is browser compatible.
864
+ function common$1(paths, sep) {
865
+ const [first = "", ...remaining] = paths;
866
+ const parts = first.split(sep);
867
+ let endOfPrefix = parts.length;
868
+ let append = "";
869
+ for (const path of remaining){
870
+ const compare = path.split(sep);
871
+ if (compare.length <= endOfPrefix) {
872
+ endOfPrefix = compare.length;
873
+ append = "";
874
+ }
875
+ for(let i = 0; i < endOfPrefix; i++){
876
+ if (compare[i] !== parts[i]) {
877
+ endOfPrefix = i;
878
+ append = i === 0 ? "" : sep;
879
+ break;
880
+ }
881
+ }
882
+ }
883
+ return parts.slice(0, endOfPrefix).join(sep) + append;
884
+ }
885
+
886
+ // Copyright 2018-2025 the Deno authors. MIT license.
887
+ // This module is browser compatible.
888
+ /** Determines the common path from a set of paths for POSIX systems.
889
+ *
890
+ * @example Usage
891
+ * ```ts
892
+ * import { common } from "@std/path/posix/common";
893
+ * import { assertEquals } from "@std/assert";
894
+ *
895
+ * const path = common([
896
+ * "./deno/std/path/mod.ts",
897
+ * "./deno/std/fs/mod.ts",
898
+ * ]);
899
+ * assertEquals(path, "./deno/std/");
900
+ * ```
901
+ *
902
+ * @param paths The paths to compare.
903
+ * @returns The common path.
904
+ */ function common(paths) {
905
+ return common$1(paths, SEPARATOR);
906
+ }
907
+
908
+ // Copyright 2018-2025 the Deno authors. MIT license.
909
+ // This module is browser compatible.
910
+ /**
911
+ * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
912
+ * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
913
+ */ const REG_EXP_ESCAPE_CHARS = [
914
+ "!",
915
+ "$",
916
+ "(",
917
+ ")",
918
+ "*",
919
+ "+",
920
+ ".",
921
+ "=",
922
+ "?",
923
+ "[",
924
+ "\\",
925
+ "^",
926
+ "{",
927
+ "|"
928
+ ];
929
+ const RANGE_ESCAPE_CHARS = [
930
+ "-",
931
+ "\\",
932
+ "]"
933
+ ];
934
+ function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
935
+ caseInsensitive = false } = {}) {
936
+ if (glob === "") {
937
+ return /(?!)/;
938
+ }
939
+ // Remove trailing separators.
940
+ let newLength = glob.length;
941
+ for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
942
+ glob = glob.slice(0, newLength);
943
+ let regExpString = "";
944
+ // Terminates correctly. Trust that `j` is incremented every iteration.
945
+ for(let j = 0; j < glob.length;){
946
+ let segment = "";
947
+ const groupStack = [];
948
+ let inRange = false;
949
+ let inEscape = false;
950
+ let endsWithSep = false;
951
+ let i = j;
952
+ // Terminates with `i` at the non-inclusive end of the current segment.
953
+ for(; i < glob.length && !c.seps.includes(glob[i]); i++){
954
+ if (inEscape) {
955
+ inEscape = false;
956
+ const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
957
+ segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
958
+ continue;
959
+ }
960
+ if (glob[i] === c.escapePrefix) {
961
+ inEscape = true;
962
+ continue;
963
+ }
964
+ if (glob[i] === "[") {
965
+ if (!inRange) {
966
+ inRange = true;
967
+ segment += "[";
968
+ if (glob[i + 1] === "!") {
969
+ i++;
970
+ segment += "^";
971
+ } else if (glob[i + 1] === "^") {
972
+ i++;
973
+ segment += "\\^";
974
+ }
975
+ continue;
976
+ } else if (glob[i + 1] === ":") {
977
+ let k = i + 1;
978
+ let value = "";
979
+ while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
980
+ value += glob[k + 1];
981
+ k++;
982
+ }
983
+ if (glob[k + 1] === ":" && glob[k + 2] === "]") {
984
+ i = k + 2;
985
+ if (value === "alnum") segment += "\\dA-Za-z";
986
+ else if (value === "alpha") segment += "A-Za-z";
987
+ else if (value === "ascii") segment += "\x00-\x7F";
988
+ else if (value === "blank") segment += "\t ";
989
+ else if (value === "cntrl") segment += "\x00-\x1F\x7F";
990
+ else if (value === "digit") segment += "\\d";
991
+ else if (value === "graph") segment += "\x21-\x7E";
992
+ else if (value === "lower") segment += "a-z";
993
+ else if (value === "print") segment += "\x20-\x7E";
994
+ else if (value === "punct") {
995
+ segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
996
+ } else if (value === "space") segment += "\\s\v";
997
+ else if (value === "upper") segment += "A-Z";
998
+ else if (value === "word") segment += "\\w";
999
+ else if (value === "xdigit") segment += "\\dA-Fa-f";
1000
+ continue;
1001
+ }
1002
+ }
1003
+ }
1004
+ if (glob[i] === "]" && inRange) {
1005
+ inRange = false;
1006
+ segment += "]";
1007
+ continue;
1008
+ }
1009
+ if (inRange) {
1010
+ segment += glob[i];
1011
+ continue;
1012
+ }
1013
+ if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1014
+ segment += ")";
1015
+ const type = groupStack.pop();
1016
+ if (type === "!") {
1017
+ segment += c.wildcard;
1018
+ } else if (type !== "@") {
1019
+ segment += type;
1020
+ }
1021
+ continue;
1022
+ }
1023
+ if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1024
+ segment += "|";
1025
+ continue;
1026
+ }
1027
+ if (glob[i] === "+" && extended && glob[i + 1] === "(") {
1028
+ i++;
1029
+ groupStack.push("+");
1030
+ segment += "(?:";
1031
+ continue;
1032
+ }
1033
+ if (glob[i] === "@" && extended && glob[i + 1] === "(") {
1034
+ i++;
1035
+ groupStack.push("@");
1036
+ segment += "(?:";
1037
+ continue;
1038
+ }
1039
+ if (glob[i] === "?") {
1040
+ if (extended && glob[i + 1] === "(") {
1041
+ i++;
1042
+ groupStack.push("?");
1043
+ segment += "(?:";
1044
+ } else {
1045
+ segment += ".";
1046
+ }
1047
+ continue;
1048
+ }
1049
+ if (glob[i] === "!" && extended && glob[i + 1] === "(") {
1050
+ i++;
1051
+ groupStack.push("!");
1052
+ segment += "(?!";
1053
+ continue;
1054
+ }
1055
+ if (glob[i] === "{") {
1056
+ groupStack.push("BRACE");
1057
+ segment += "(?:";
1058
+ continue;
1059
+ }
1060
+ if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
1061
+ groupStack.pop();
1062
+ segment += ")";
1063
+ continue;
1064
+ }
1065
+ if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
1066
+ segment += "|";
1067
+ continue;
1068
+ }
1069
+ if (glob[i] === "*") {
1070
+ if (extended && glob[i + 1] === "(") {
1071
+ i++;
1072
+ groupStack.push("*");
1073
+ segment += "(?:";
1074
+ } else {
1075
+ const prevChar = glob[i - 1];
1076
+ let numStars = 1;
1077
+ while(glob[i + 1] === "*"){
1078
+ i++;
1079
+ numStars++;
1080
+ }
1081
+ const nextChar = glob[i + 1];
1082
+ if (globstarOption && numStars === 2 && [
1083
+ ...c.seps,
1084
+ undefined
1085
+ ].includes(prevChar) && [
1086
+ ...c.seps,
1087
+ undefined
1088
+ ].includes(nextChar)) {
1089
+ segment += c.globstar;
1090
+ endsWithSep = true;
1091
+ } else {
1092
+ segment += c.wildcard;
1093
+ }
1094
+ }
1095
+ continue;
1096
+ }
1097
+ segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1098
+ }
1099
+ // Check for unclosed groups or a dangling backslash.
1100
+ if (groupStack.length > 0 || inRange || inEscape) {
1101
+ // Parse failure. Take all characters from this segment literally.
1102
+ segment = "";
1103
+ for (const c of glob.slice(j, i)){
1104
+ segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
1105
+ endsWithSep = false;
1106
+ }
1107
+ }
1108
+ regExpString += segment;
1109
+ if (!endsWithSep) {
1110
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
1111
+ endsWithSep = true;
1112
+ }
1113
+ // Terminates with `i` at the start of the next segment.
1114
+ while(c.seps.includes(glob[i]))i++;
1115
+ j = i;
1116
+ }
1117
+ regExpString = `^${regExpString}$`;
1118
+ return new RegExp(regExpString, caseInsensitive ? "i" : "");
1119
+ }
1120
+
1121
+ // Copyright 2018-2025 the Deno authors. MIT license.
1122
+ // This module is browser compatible.
1123
+ const constants = {
1124
+ sep: "/+",
1125
+ sepMaybe: "/*",
1126
+ seps: [
1127
+ "/"
1128
+ ],
1129
+ globstar: "(?:[^/]*(?:/|$)+)*",
1130
+ wildcard: "[^/]*",
1131
+ escapePrefix: "\\"
1132
+ };
1133
+ /** Convert a glob string to a regular expression.
1134
+ *
1135
+ * Tries to match bash glob expansion as closely as possible.
1136
+ *
1137
+ * Basic glob syntax:
1138
+ * - `*` - Matches everything without leaving the path segment.
1139
+ * - `?` - Matches any single character.
1140
+ * - `{foo,bar}` - Matches `foo` or `bar`.
1141
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
1142
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
1143
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
1144
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
1145
+ * - `[[:alnum:]]` - Matches any digit or letter.
1146
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
1147
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
1148
+ * for a complete list of supported character classes.
1149
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
1150
+ * - \` - Escapes the next character for `os` set to `"windows"`.
1151
+ * - `/` - Path separator.
1152
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
1153
+ *
1154
+ * Extended syntax:
1155
+ * - Requires `{ extended: true }`.
1156
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
1157
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
1158
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
1159
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
1160
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
1161
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
1162
+ *
1163
+ * Globstar syntax:
1164
+ * - Requires `{ globstar: true }`.
1165
+ * - `**` - Matches any number of any path segments.
1166
+ * - Must comprise its entire path segment in the provided glob.
1167
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
1168
+ *
1169
+ * Note the following properties:
1170
+ * - The generated `RegExp` is anchored at both start and end.
1171
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
1172
+ * provided glob have no meaning and are discarded.
1173
+ * - Absolute globs will only match absolute paths, etc.
1174
+ * - Empty globs will match nothing.
1175
+ * - Any special glob syntax must be contained to one path segment. For example,
1176
+ * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
1177
+ * first segment ends with an unclosed group.
1178
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
1179
+ * parse error has occurred. Every character for that segment is taken
1180
+ * literally in this event.
1181
+ *
1182
+ * Limitations:
1183
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
1184
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
1185
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
1186
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
1187
+ * the group occurs not nested at the end of the segment.
1188
+ *
1189
+ * @example Usage
1190
+ * ```ts
1191
+ * import { globToRegExp } from "@std/path/posix/glob-to-regexp";
1192
+ * import { assertEquals } from "@std/assert";
1193
+ *
1194
+ * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/);
1195
+ * ```
1196
+ *
1197
+ * @param glob Glob string to convert.
1198
+ * @param options Conversion options.
1199
+ * @returns The regular expression equivalent to the glob.
1200
+ */ function globToRegExp(glob, options = {}) {
1201
+ return _globToRegExp(constants, glob, options);
1202
+ }
1203
+
1204
+ // Copyright 2018-2025 the Deno authors. MIT license.
1205
+ // This module is browser compatible.
1206
+ /**
1207
+ * Test whether the given string is a glob.
1208
+ *
1209
+ * @example Usage
1210
+ * ```ts
1211
+ * import { isGlob } from "@std/path/is-glob";
1212
+ * import { assert } from "@std/assert";
1213
+ *
1214
+ * assert(!isGlob("foo/bar/../baz"));
1215
+ * assert(isGlob("foo/*ar/../baz"));
1216
+ * ```
1217
+ *
1218
+ * @param str String to test.
1219
+ * @returns `true` if the given string is a glob, otherwise `false`
1220
+ */ function isGlob(str) {
1221
+ const chars = {
1222
+ "{": "}",
1223
+ "(": ")",
1224
+ "[": "]"
1225
+ };
1226
+ const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
1227
+ if (str === "") {
1228
+ return false;
1229
+ }
1230
+ let match;
1231
+ while(match = regex.exec(str)){
1232
+ if (match[2]) return true;
1233
+ let idx = match.index + match[0].length;
1234
+ // if an open bracket/brace/paren is escaped,
1235
+ // set the index to the next closing character
1236
+ const open = match[1];
1237
+ const close = open ? chars[open] : null;
1238
+ if (open && close) {
1239
+ const n = str.indexOf(close, idx);
1240
+ if (n !== -1) {
1241
+ idx = n + 1;
1242
+ }
1243
+ }
1244
+ str = str.slice(idx);
1245
+ }
1246
+ return false;
1247
+ }
1248
+
1249
+ // Copyright 2018-2025 the Deno authors. MIT license.
1250
+ // This module is browser compatible.
1251
+ /**
1252
+ * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
1253
+ *
1254
+ * @example Usage
1255
+ * ```ts
1256
+ * import { normalizeGlob } from "@std/path/posix/normalize-glob";
1257
+ * import { assertEquals } from "@std/assert";
1258
+ *
1259
+ * const path = normalizeGlob("foo/bar/../*", { globstar: true });
1260
+ * assertEquals(path, "foo/*");
1261
+ * ```
1262
+ *
1263
+ * @param glob The glob to normalize.
1264
+ * @param options The options to use.
1265
+ * @returns The normalized path.
1266
+ */ function normalizeGlob(glob, options = {}) {
1267
+ const { globstar = false } = options;
1268
+ if (glob.match(/\0/g)) {
1269
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
1270
+ }
1271
+ if (!globstar) {
1272
+ return normalize(glob);
1273
+ }
1274
+ const s = SEPARATOR_PATTERN.source;
1275
+ const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
1276
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
1277
+ }
1278
+
1279
+ // Copyright 2018-2025 the Deno authors. MIT license.
1280
+ // This module is browser compatible.
1281
+ /**
1282
+ * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
1283
+ *
1284
+ * @example Usage
1285
+ * ```ts
1286
+ * import { joinGlobs } from "@std/path/posix/join-globs";
1287
+ * import { assertEquals } from "@std/assert";
1288
+ *
1289
+ * const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
1290
+ * assertEquals(path, "foo/bar/**");
1291
+ * ```
1292
+ *
1293
+ * @param globs The globs to join.
1294
+ * @param options The options to use.
1295
+ * @returns The joined path.
1296
+ */ function joinGlobs(globs, options = {}) {
1297
+ const { globstar = false } = options;
1298
+ if (!globstar || globs.length === 0) {
1299
+ return join(...globs);
1300
+ }
1301
+ let joined;
1302
+ for (const glob of globs){
1303
+ const path = glob;
1304
+ if (path.length > 0) {
1305
+ if (!joined) joined = path;
1306
+ else joined += `${SEPARATOR}${path}`;
1307
+ }
1308
+ }
1309
+ if (!joined) return ".";
1310
+ return normalizeGlob(joined, {
1311
+ globstar
1312
+ });
1313
+ }
1314
+
1315
+ exports.DELIMITER = DELIMITER;
1316
+ exports.SEPARATOR = SEPARATOR;
1317
+ exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
1318
+ exports.basename = basename;
1319
+ exports.common = common;
1320
+ exports.dirname = dirname;
1321
+ exports.extname = extname;
1322
+ exports.format = format;
1323
+ exports.fromFileUrl = fromFileUrl;
1324
+ exports.globToRegExp = globToRegExp;
1325
+ exports.isAbsolute = isAbsolute;
1326
+ exports.isGlob = isGlob;
1327
+ exports.join = join;
1328
+ exports.joinGlobs = joinGlobs;
1329
+ exports.normalize = normalize;
1330
+ exports.normalizeGlob = normalizeGlob;
1331
+ exports.parse = parse;
1332
+ exports.relative = relative;
1333
+ exports.resolve = resolve;
1334
+ exports.toFileUrl = toFileUrl;
1335
+ exports.toNamespacedPath = toNamespacedPath;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs ADDED
@@ -0,0 +1,1677 @@
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ // Copyright 2018-2025 the Deno authors. MIT license.
4
+ // Copyright the Browserify authors. MIT License.
5
+ function assertPath(path) {
6
+ if (typeof path !== "string") {
7
+ throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
8
+ }
9
+ }
10
+
11
+ // Copyright 2018-2025 the Deno authors. MIT license.
12
+ // This module is browser compatible.
13
+ function stripSuffix(name, suffix) {
14
+ if (suffix.length >= name.length) {
15
+ return name;
16
+ }
17
+ const lenDiff = name.length - suffix.length;
18
+ for(let i = suffix.length - 1; i >= 0; --i){
19
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
20
+ return name;
21
+ }
22
+ }
23
+ return name.slice(0, -suffix.length);
24
+ }
25
+ function lastPathSegment(path, isSep, start = 0) {
26
+ let matchedNonSeparator = false;
27
+ let end = path.length;
28
+ for(let i = path.length - 1; i >= start; --i){
29
+ if (isSep(path.charCodeAt(i))) {
30
+ if (matchedNonSeparator) {
31
+ start = i + 1;
32
+ break;
33
+ }
34
+ } else if (!matchedNonSeparator) {
35
+ matchedNonSeparator = true;
36
+ end = i + 1;
37
+ }
38
+ }
39
+ return path.slice(start, end);
40
+ }
41
+ function assertArgs$1(path, suffix) {
42
+ assertPath(path);
43
+ if (path.length === 0) return path;
44
+ if (typeof suffix !== "string") {
45
+ throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
46
+ }
47
+ }
48
+
49
+ // Copyright 2018-2025 the Deno authors. MIT license.
50
+ // Copyright the Browserify authors. MIT License.
51
+ // Ported from https://github.com/browserify/path-browserify/
52
+ // This module is browser compatible.
53
+ // Alphabet chars.
54
+ const CHAR_UPPERCASE_A = 65; /* A */
55
+ const CHAR_LOWERCASE_A = 97; /* a */
56
+ const CHAR_UPPERCASE_Z = 90; /* Z */
57
+ const CHAR_LOWERCASE_Z = 122; /* z */
58
+ // Non-alphabetic chars.
59
+ const CHAR_DOT = 46; /* . */
60
+ const CHAR_FORWARD_SLASH = 47; /* / */
61
+ const CHAR_BACKWARD_SLASH = 92; /* \ */
62
+ const CHAR_COLON = 58; /* : */
63
+ const CHAR_QUESTION_MARK = 63; /* ? */
64
+
65
+ // Copyright 2018-2025 the Deno authors. MIT license.
66
+ // Copyright the Browserify authors. MIT License.
67
+ // Ported from https://github.com/browserify/path-browserify/
68
+ // This module is browser compatible.
69
+ function stripTrailingSeparators(segment, isSep) {
70
+ if (segment.length <= 1) {
71
+ return segment;
72
+ }
73
+ let end = segment.length;
74
+ for(let i = segment.length - 1; i > 0; i--){
75
+ if (isSep(segment.charCodeAt(i))) {
76
+ end = i;
77
+ } else {
78
+ break;
79
+ }
80
+ }
81
+ return segment.slice(0, end);
82
+ }
83
+
84
+ // Copyright 2018-2025 the Deno authors. MIT license.
85
+ // Copyright the Browserify authors. MIT License.
86
+ // Ported from https://github.com/browserify/path-browserify/
87
+ // This module is browser compatible.
88
+ function isPosixPathSeparator(code) {
89
+ return code === CHAR_FORWARD_SLASH;
90
+ }
91
+ function isPathSeparator(code) {
92
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
93
+ }
94
+ function isWindowsDeviceRoot(code) {
95
+ return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
96
+ }
97
+
98
+ // Copyright 2018-2025 the Deno authors. MIT license.
99
+ // This module is browser compatible.
100
+ function assertArg$3(url) {
101
+ url = url instanceof URL ? url : new URL(url);
102
+ if (url.protocol !== "file:") {
103
+ throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
104
+ }
105
+ return url;
106
+ }
107
+
108
+ // Copyright 2018-2025 the Deno authors. MIT license.
109
+ // This module is browser compatible.
110
+ /**
111
+ * Converts a file URL to a path string.
112
+ *
113
+ * @example Usage
114
+ * ```ts
115
+ * import { fromFileUrl } from "@std/path/windows/from-file-url";
116
+ * import { assertEquals } from "@std/assert";
117
+ *
118
+ * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
119
+ * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
120
+ * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
121
+ * ```
122
+ *
123
+ * @param url The file URL to convert.
124
+ * @returns The path string.
125
+ */ function fromFileUrl(url) {
126
+ url = assertArg$3(url);
127
+ let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
128
+ if (url.hostname !== "") {
129
+ // Note: The `URL` implementation guarantees that the drive letter and
130
+ // hostname are mutually exclusive. Otherwise it would not have been valid
131
+ // to append the hostname and path like this.
132
+ path = `\\\\${url.hostname}${path}`;
133
+ }
134
+ return path;
135
+ }
136
+
137
+ // Copyright 2018-2025 the Deno authors. MIT license.
138
+ // This module is browser compatible.
139
+ /**
140
+ * Return the last portion of a `path`.
141
+ * Trailing directory separators are ignored, and optional suffix is removed.
142
+ *
143
+ * @example Usage
144
+ * ```ts
145
+ * import { basename } from "@std/path/windows/basename";
146
+ * import { assertEquals } from "@std/assert";
147
+ *
148
+ * assertEquals(basename("C:\\user\\Documents\\"), "Documents");
149
+ * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
150
+ * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image");
151
+ * assertEquals(basename(new URL("file:///C:/user/Documents/image.png")), "image.png");
152
+ * assertEquals(basename(new URL("file:///C:/user/Documents/image.png"), ".png"), "image");
153
+ * ```
154
+ *
155
+ * @param path The path to extract the name from.
156
+ * @param suffix The suffix to remove from extracted name.
157
+ * @returns The extracted name.
158
+ */ function basename(path, suffix = "") {
159
+ if (path instanceof URL) {
160
+ path = fromFileUrl(path);
161
+ }
162
+ assertArgs$1(path, suffix);
163
+ // Check for a drive letter prefix so as not to mistake the following
164
+ // path separator as an extra separator at the end of the path that can be
165
+ // disregarded
166
+ let start = 0;
167
+ if (path.length >= 2) {
168
+ const drive = path.charCodeAt(0);
169
+ if (isWindowsDeviceRoot(drive)) {
170
+ if (path.charCodeAt(1) === CHAR_COLON) start = 2;
171
+ }
172
+ }
173
+ const lastSegment = lastPathSegment(path, isPathSeparator, start);
174
+ const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
175
+ return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
176
+ }
177
+
178
+ // Copyright 2018-2025 the Deno authors. MIT license.
179
+ // This module is browser compatible.
180
+ /**
181
+ * The character used to separate entries in the PATH environment variable.
182
+ */ const DELIMITER = ";";
183
+ /**
184
+ * The character used to separate components of a file path.
185
+ */ const SEPARATOR = "\\";
186
+ /**
187
+ * A regular expression that matches one or more path separators.
188
+ */ const SEPARATOR_PATTERN = /[\\/]+/;
189
+
190
+ // Copyright 2018-2025 the Deno authors. MIT license.
191
+ // This module is browser compatible.
192
+ function assertArg$2(path) {
193
+ assertPath(path);
194
+ if (path.length === 0) return ".";
195
+ }
196
+
197
+ // Copyright 2018-2025 the Deno authors. MIT license.
198
+ // This module is browser compatible.
199
+ /**
200
+ * Return the directory path of a `path`.
201
+ *
202
+ * @example Usage
203
+ * ```ts
204
+ * import { dirname } from "@std/path/windows/dirname";
205
+ * import { assertEquals } from "@std/assert";
206
+ *
207
+ * assertEquals(dirname("C:\\foo\\bar\\baz.ext"), "C:\\foo\\bar");
208
+ * assertEquals(dirname(new URL("file:///C:/foo/bar/baz.ext")), "C:\\foo\\bar");
209
+ * ```
210
+ *
211
+ * @param path The path to get the directory from.
212
+ * @returns The directory path.
213
+ */ function dirname(path) {
214
+ if (path instanceof URL) {
215
+ path = fromFileUrl(path);
216
+ }
217
+ assertArg$2(path);
218
+ const len = path.length;
219
+ let rootEnd = -1;
220
+ let end = -1;
221
+ let matchedSlash = true;
222
+ let offset = 0;
223
+ const code = path.charCodeAt(0);
224
+ // Try to match a root
225
+ if (len > 1) {
226
+ if (isPathSeparator(code)) {
227
+ // Possible UNC root
228
+ rootEnd = offset = 1;
229
+ if (isPathSeparator(path.charCodeAt(1))) {
230
+ // Matched double path separator at beginning
231
+ let j = 2;
232
+ let last = j;
233
+ // Match 1 or more non-path separators
234
+ for(; j < len; ++j){
235
+ if (isPathSeparator(path.charCodeAt(j))) break;
236
+ }
237
+ if (j < len && j !== last) {
238
+ // Matched!
239
+ last = j;
240
+ // Match 1 or more path separators
241
+ for(; j < len; ++j){
242
+ if (!isPathSeparator(path.charCodeAt(j))) break;
243
+ }
244
+ if (j < len && j !== last) {
245
+ // Matched!
246
+ last = j;
247
+ // Match 1 or more non-path separators
248
+ for(; j < len; ++j){
249
+ if (isPathSeparator(path.charCodeAt(j))) break;
250
+ }
251
+ if (j === len) {
252
+ // We matched a UNC root only
253
+ return path;
254
+ }
255
+ if (j !== last) {
256
+ // We matched a UNC root with leftovers
257
+ // Offset by 1 to include the separator after the UNC root to
258
+ // treat it as a "normal root" on top of a (UNC) root
259
+ rootEnd = offset = j + 1;
260
+ }
261
+ }
262
+ }
263
+ }
264
+ } else if (isWindowsDeviceRoot(code)) {
265
+ // Possible device root
266
+ if (path.charCodeAt(1) === CHAR_COLON) {
267
+ rootEnd = offset = 2;
268
+ if (len > 2) {
269
+ if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
270
+ }
271
+ }
272
+ }
273
+ } else if (isPathSeparator(code)) {
274
+ // `path` contains just a path separator, exit early to avoid
275
+ // unnecessary work
276
+ return path;
277
+ }
278
+ for(let i = len - 1; i >= offset; --i){
279
+ if (isPathSeparator(path.charCodeAt(i))) {
280
+ if (!matchedSlash) {
281
+ end = i;
282
+ break;
283
+ }
284
+ } else {
285
+ // We saw the first non-path separator
286
+ matchedSlash = false;
287
+ }
288
+ }
289
+ if (end === -1) {
290
+ if (rootEnd === -1) return ".";
291
+ else end = rootEnd;
292
+ }
293
+ return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
294
+ }
295
+
296
+ // Copyright 2018-2025 the Deno authors. MIT license.
297
+ // This module is browser compatible.
298
+ /**
299
+ * Return the extension of the `path` with leading period.
300
+ *
301
+ * @example Usage
302
+ * ```ts
303
+ * import { extname } from "@std/path/windows/extname";
304
+ * import { assertEquals } from "@std/assert";
305
+ *
306
+ * assertEquals(extname("file.ts"), ".ts");
307
+ * assertEquals(extname(new URL("file:///C:/foo/bar/baz.ext")), ".ext");
308
+ * ```
309
+ *
310
+ * @param path The path to get the extension from.
311
+ * @returns The extension of the `path`.
312
+ */ function extname(path) {
313
+ if (path instanceof URL) {
314
+ path = fromFileUrl(path);
315
+ }
316
+ assertPath(path);
317
+ let start = 0;
318
+ let startDot = -1;
319
+ let startPart = 0;
320
+ let end = -1;
321
+ let matchedSlash = true;
322
+ // Track the state of characters (if any) we see before our first dot and
323
+ // after any path separator we find
324
+ let preDotState = 0;
325
+ // Check for a drive letter prefix so as not to mistake the following
326
+ // path separator as an extra separator at the end of the path that can be
327
+ // disregarded
328
+ if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
329
+ start = startPart = 2;
330
+ }
331
+ for(let i = path.length - 1; i >= start; --i){
332
+ const code = path.charCodeAt(i);
333
+ if (isPathSeparator(code)) {
334
+ // If we reached a path separator that was not part of a set of path
335
+ // separators at the end of the string, stop now
336
+ if (!matchedSlash) {
337
+ startPart = i + 1;
338
+ break;
339
+ }
340
+ continue;
341
+ }
342
+ if (end === -1) {
343
+ // We saw the first non-path separator, mark this as the end of our
344
+ // extension
345
+ matchedSlash = false;
346
+ end = i + 1;
347
+ }
348
+ if (code === CHAR_DOT) {
349
+ // If this is our first dot, mark it as the start of our extension
350
+ if (startDot === -1) startDot = i;
351
+ else if (preDotState !== 1) preDotState = 1;
352
+ } else if (startDot !== -1) {
353
+ // We saw a non-dot and non-path separator before our dot, so we should
354
+ // have a good chance at having a non-empty extension
355
+ preDotState = -1;
356
+ }
357
+ }
358
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
359
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
360
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
361
+ return "";
362
+ }
363
+ return path.slice(startDot, end);
364
+ }
365
+
366
+ // Copyright 2018-2025 the Deno authors. MIT license.
367
+ // This module is browser compatible.
368
+ function _format(sep, pathObject) {
369
+ const dir = pathObject.dir || pathObject.root;
370
+ const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
371
+ if (!dir) return base;
372
+ if (base === sep) return dir;
373
+ if (dir === pathObject.root) return dir + base;
374
+ return dir + sep + base;
375
+ }
376
+ function assertArg$1(pathObject) {
377
+ if (pathObject === null || typeof pathObject !== "object") {
378
+ throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
379
+ }
380
+ }
381
+
382
+ // Copyright 2018-2025 the Deno authors. MIT license.
383
+ // This module is browser compatible.
384
+ /**
385
+ * Generate a path from `ParsedPath` object.
386
+ *
387
+ * @example Usage
388
+ * ```ts
389
+ * import { format } from "@std/path/windows/format";
390
+ * import { assertEquals } from "@std/assert";
391
+ *
392
+ * const path = format({
393
+ * root: "C:\\",
394
+ * dir: "C:\\path\\dir",
395
+ * base: "file.txt",
396
+ * ext: ".txt",
397
+ * name: "file"
398
+ * });
399
+ * assertEquals(path, "C:\\path\\dir\\file.txt");
400
+ * ```
401
+ *
402
+ * @param pathObject The path object to format.
403
+ * @returns The formatted path.
404
+ */ function format(pathObject) {
405
+ assertArg$1(pathObject);
406
+ return _format("\\", pathObject);
407
+ }
408
+
409
+ // Copyright 2018-2025 the Deno authors. MIT license.
410
+ // This module is browser compatible.
411
+ /**
412
+ * Verifies whether provided path is absolute.
413
+ *
414
+ * @example Usage
415
+ * ```ts
416
+ * import { isAbsolute } from "@std/path/windows/is-absolute";
417
+ * import { assert, assertFalse } from "@std/assert";
418
+ *
419
+ * assert(isAbsolute("C:\\foo\\bar"));
420
+ * assertFalse(isAbsolute("..\\baz"));
421
+ * ```
422
+ *
423
+ * @param path The path to verify.
424
+ * @returns `true` if the path is absolute, `false` otherwise.
425
+ */ function isAbsolute(path) {
426
+ assertPath(path);
427
+ const len = path.length;
428
+ if (len === 0) return false;
429
+ const code = path.charCodeAt(0);
430
+ if (isPathSeparator(code)) {
431
+ return true;
432
+ } else if (isWindowsDeviceRoot(code)) {
433
+ // Possible device root
434
+ if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
435
+ if (isPathSeparator(path.charCodeAt(2))) return true;
436
+ }
437
+ }
438
+ return false;
439
+ }
440
+
441
+ // Copyright 2018-2025 the Deno authors. MIT license.
442
+ // This module is browser compatible.
443
+ function assertArg(path) {
444
+ assertPath(path);
445
+ if (path.length === 0) return ".";
446
+ }
447
+
448
+ // Copyright 2018-2025 the Deno authors. MIT license.
449
+ // Copyright the Browserify authors. MIT License.
450
+ // Ported from https://github.com/browserify/path-browserify/
451
+ // This module is browser compatible.
452
+ // Resolves . and .. elements in a path with directory names
453
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
454
+ let res = "";
455
+ let lastSegmentLength = 0;
456
+ let lastSlash = -1;
457
+ let dots = 0;
458
+ let code;
459
+ for(let i = 0; i <= path.length; ++i){
460
+ if (i < path.length) code = path.charCodeAt(i);
461
+ else if (isPathSeparator(code)) break;
462
+ else code = CHAR_FORWARD_SLASH;
463
+ if (isPathSeparator(code)) {
464
+ if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
465
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
466
+ if (res.length > 2) {
467
+ const lastSlashIndex = res.lastIndexOf(separator);
468
+ if (lastSlashIndex === -1) {
469
+ res = "";
470
+ lastSegmentLength = 0;
471
+ } else {
472
+ res = res.slice(0, lastSlashIndex);
473
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
474
+ }
475
+ lastSlash = i;
476
+ dots = 0;
477
+ continue;
478
+ } else if (res.length === 2 || res.length === 1) {
479
+ res = "";
480
+ lastSegmentLength = 0;
481
+ lastSlash = i;
482
+ dots = 0;
483
+ continue;
484
+ }
485
+ }
486
+ if (allowAboveRoot) {
487
+ if (res.length > 0) res += `${separator}..`;
488
+ else res = "..";
489
+ lastSegmentLength = 2;
490
+ }
491
+ } else {
492
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
493
+ else res = path.slice(lastSlash + 1, i);
494
+ lastSegmentLength = i - lastSlash - 1;
495
+ }
496
+ lastSlash = i;
497
+ dots = 0;
498
+ } else if (code === CHAR_DOT && dots !== -1) {
499
+ ++dots;
500
+ } else {
501
+ dots = -1;
502
+ }
503
+ }
504
+ return res;
505
+ }
506
+
507
+ // Copyright 2018-2025 the Deno authors. MIT license.
508
+ // This module is browser compatible.
509
+ /**
510
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
511
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
512
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
513
+ *
514
+ * @example Usage
515
+ * ```ts
516
+ * import { normalize } from "@std/path/windows/normalize";
517
+ * import { assertEquals } from "@std/assert";
518
+ *
519
+ * assertEquals(normalize("C:\\foo\\..\\bar"), "C:\\bar");
520
+ * assertEquals(normalize(new URL("file:///C:/foo/../bar")), "C:\\bar");
521
+ * ```
522
+ *
523
+ * @param path The path to normalize
524
+ * @returns The normalized path
525
+ */ function normalize(path) {
526
+ if (path instanceof URL) {
527
+ path = fromFileUrl(path);
528
+ }
529
+ assertArg(path);
530
+ const len = path.length;
531
+ let rootEnd = 0;
532
+ let device;
533
+ let isAbsolute = false;
534
+ const code = path.charCodeAt(0);
535
+ // Try to match a root
536
+ if (len > 1) {
537
+ if (isPathSeparator(code)) {
538
+ // Possible UNC root
539
+ // If we started with a separator, we know we at least have an absolute
540
+ // path of some kind (UNC or otherwise)
541
+ isAbsolute = true;
542
+ if (isPathSeparator(path.charCodeAt(1))) {
543
+ // Matched double path separator at beginning
544
+ let j = 2;
545
+ let last = j;
546
+ // Match 1 or more non-path separators
547
+ for(; j < len; ++j){
548
+ if (isPathSeparator(path.charCodeAt(j))) break;
549
+ }
550
+ if (j < len && j !== last) {
551
+ const firstPart = path.slice(last, j);
552
+ // Matched!
553
+ last = j;
554
+ // Match 1 or more path separators
555
+ for(; j < len; ++j){
556
+ if (!isPathSeparator(path.charCodeAt(j))) break;
557
+ }
558
+ if (j < len && j !== last) {
559
+ // Matched!
560
+ last = j;
561
+ // Match 1 or more non-path separators
562
+ for(; j < len; ++j){
563
+ if (isPathSeparator(path.charCodeAt(j))) break;
564
+ }
565
+ if (j === len) {
566
+ // We matched a UNC root only
567
+ // Return the normalized version of the UNC root since there
568
+ // is nothing left to process
569
+ return `\\\\${firstPart}\\${path.slice(last)}\\`;
570
+ } else if (j !== last) {
571
+ // We matched a UNC root with leftovers
572
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
573
+ rootEnd = j;
574
+ }
575
+ }
576
+ }
577
+ } else {
578
+ rootEnd = 1;
579
+ }
580
+ } else if (isWindowsDeviceRoot(code)) {
581
+ // Possible device root
582
+ if (path.charCodeAt(1) === CHAR_COLON) {
583
+ device = path.slice(0, 2);
584
+ rootEnd = 2;
585
+ if (len > 2) {
586
+ if (isPathSeparator(path.charCodeAt(2))) {
587
+ // Treat separator following drive name as an absolute path
588
+ // indicator
589
+ isAbsolute = true;
590
+ rootEnd = 3;
591
+ }
592
+ }
593
+ }
594
+ }
595
+ } else if (isPathSeparator(code)) {
596
+ // `path` contains just a path separator, exit early to avoid unnecessary
597
+ // work
598
+ return "\\";
599
+ }
600
+ let tail;
601
+ if (rootEnd < len) {
602
+ tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
603
+ } else {
604
+ tail = "";
605
+ }
606
+ if (tail.length === 0 && !isAbsolute) tail = ".";
607
+ if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
608
+ tail += "\\";
609
+ }
610
+ if (device === undefined) {
611
+ if (isAbsolute) {
612
+ if (tail.length > 0) return `\\${tail}`;
613
+ else return "\\";
614
+ }
615
+ return tail;
616
+ } else if (isAbsolute) {
617
+ if (tail.length > 0) return `${device}\\${tail}`;
618
+ else return `${device}\\`;
619
+ }
620
+ return device + tail;
621
+ }
622
+
623
+ // Copyright 2018-2025 the Deno authors. MIT license.
624
+ // This module is browser compatible.
625
+ /**
626
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
627
+ *
628
+ * @example Usage
629
+ * ```ts
630
+ * import { join } from "@std/path/windows/join";
631
+ * import { assertEquals } from "@std/assert";
632
+ *
633
+ * assertEquals(join("C:\\foo", "bar", "baz\\.."), "C:\\foo\\bar");
634
+ * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz\\.."), "C:\\foo\\bar");
635
+ * ```
636
+ *
637
+ * @param path The path to join. This can be string or file URL.
638
+ * @param paths The paths to join.
639
+ * @returns The joined path.
640
+ */ function join(path, ...paths) {
641
+ if (path instanceof URL) {
642
+ path = fromFileUrl(path);
643
+ }
644
+ paths = path ? [
645
+ path,
646
+ ...paths
647
+ ] : paths;
648
+ paths.forEach((path)=>assertPath(path));
649
+ paths = paths.filter((path)=>path.length > 0);
650
+ if (paths.length === 0) return ".";
651
+ // Make sure that the joined path doesn't start with two slashes, because
652
+ // normalize() will mistake it for an UNC path then.
653
+ //
654
+ // This step is skipped when it is very clear that the user actually
655
+ // intended to point at an UNC path. This is assumed when the first
656
+ // non-empty string arguments starts with exactly two slashes followed by
657
+ // at least one more non-slash character.
658
+ //
659
+ // Note that for normalize() to treat a path as an UNC path it needs to
660
+ // have at least 2 components, so we don't filter for that here.
661
+ // This means that the user can use join to construct UNC paths from
662
+ // a server name and a share name; for example:
663
+ // path.join('//server', 'share') -> '\\\\server\\share\\'
664
+ let needsReplace = true;
665
+ let slashCount = 0;
666
+ const firstPart = paths[0];
667
+ if (isPathSeparator(firstPart.charCodeAt(0))) {
668
+ ++slashCount;
669
+ const firstLen = firstPart.length;
670
+ if (firstLen > 1) {
671
+ if (isPathSeparator(firstPart.charCodeAt(1))) {
672
+ ++slashCount;
673
+ if (firstLen > 2) {
674
+ if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
675
+ else {
676
+ // We matched a UNC path in the first part
677
+ needsReplace = false;
678
+ }
679
+ }
680
+ }
681
+ }
682
+ }
683
+ let joined = paths.join("\\");
684
+ if (needsReplace) {
685
+ // Find any more consecutive slashes we need to replace
686
+ for(; slashCount < joined.length; ++slashCount){
687
+ if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
688
+ }
689
+ // Replace the slashes if needed
690
+ if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
691
+ }
692
+ return normalize(joined);
693
+ }
694
+
695
+ // Copyright 2018-2025 the Deno authors. MIT license.
696
+ // This module is browser compatible.
697
+ /**
698
+ * Return a `ParsedPath` object of the `path`.
699
+ *
700
+ * @example Usage
701
+ * ```ts
702
+ * import { parse } from "@std/path/windows/parse";
703
+ * import { assertEquals } from "@std/assert";
704
+ *
705
+ * const parsed = parse("C:\\foo\\bar\\baz.ext");
706
+ * assertEquals(parsed, {
707
+ * root: "C:\\",
708
+ * dir: "C:\\foo\\bar",
709
+ * base: "baz.ext",
710
+ * ext: ".ext",
711
+ * name: "baz",
712
+ * });
713
+ * ```
714
+ *
715
+ * @param path The path to parse.
716
+ * @returns The `ParsedPath` object.
717
+ */ function parse(path) {
718
+ assertPath(path);
719
+ const ret = {
720
+ root: "",
721
+ dir: "",
722
+ base: "",
723
+ ext: "",
724
+ name: ""
725
+ };
726
+ const len = path.length;
727
+ if (len === 0) return ret;
728
+ let rootEnd = 0;
729
+ let code = path.charCodeAt(0);
730
+ // Try to match a root
731
+ if (len > 1) {
732
+ if (isPathSeparator(code)) {
733
+ // Possible UNC root
734
+ rootEnd = 1;
735
+ if (isPathSeparator(path.charCodeAt(1))) {
736
+ // Matched double path separator at beginning
737
+ let j = 2;
738
+ let last = j;
739
+ // Match 1 or more non-path separators
740
+ for(; j < len; ++j){
741
+ if (isPathSeparator(path.charCodeAt(j))) break;
742
+ }
743
+ if (j < len && j !== last) {
744
+ // Matched!
745
+ last = j;
746
+ // Match 1 or more path separators
747
+ for(; j < len; ++j){
748
+ if (!isPathSeparator(path.charCodeAt(j))) break;
749
+ }
750
+ if (j < len && j !== last) {
751
+ // Matched!
752
+ last = j;
753
+ // Match 1 or more non-path separators
754
+ for(; j < len; ++j){
755
+ if (isPathSeparator(path.charCodeAt(j))) break;
756
+ }
757
+ if (j === len) {
758
+ // We matched a UNC root only
759
+ rootEnd = j;
760
+ } else if (j !== last) {
761
+ // We matched a UNC root with leftovers
762
+ rootEnd = j + 1;
763
+ }
764
+ }
765
+ }
766
+ }
767
+ } else if (isWindowsDeviceRoot(code)) {
768
+ // Possible device root
769
+ if (path.charCodeAt(1) === CHAR_COLON) {
770
+ rootEnd = 2;
771
+ if (len > 2) {
772
+ if (isPathSeparator(path.charCodeAt(2))) {
773
+ if (len === 3) {
774
+ // `path` contains just a drive root, exit early to avoid
775
+ // unnecessary work
776
+ ret.root = ret.dir = path;
777
+ ret.base = "\\";
778
+ return ret;
779
+ }
780
+ rootEnd = 3;
781
+ }
782
+ } else {
783
+ // `path` contains just a relative drive root, exit early to avoid
784
+ // unnecessary work
785
+ ret.root = ret.dir = path;
786
+ return ret;
787
+ }
788
+ }
789
+ }
790
+ } else if (isPathSeparator(code)) {
791
+ // `path` contains just a path separator, exit early to avoid
792
+ // unnecessary work
793
+ ret.root = ret.dir = path;
794
+ ret.base = "\\";
795
+ return ret;
796
+ }
797
+ if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
798
+ let startDot = -1;
799
+ let startPart = rootEnd;
800
+ let end = -1;
801
+ let matchedSlash = true;
802
+ let i = path.length - 1;
803
+ // Track the state of characters (if any) we see before our first dot and
804
+ // after any path separator we find
805
+ let preDotState = 0;
806
+ // Get non-dir info
807
+ for(; i >= rootEnd; --i){
808
+ code = path.charCodeAt(i);
809
+ if (isPathSeparator(code)) {
810
+ // If we reached a path separator that was not part of a set of path
811
+ // separators at the end of the string, stop now
812
+ if (!matchedSlash) {
813
+ startPart = i + 1;
814
+ break;
815
+ }
816
+ continue;
817
+ }
818
+ if (end === -1) {
819
+ // We saw the first non-path separator, mark this as the end of our
820
+ // extension
821
+ matchedSlash = false;
822
+ end = i + 1;
823
+ }
824
+ if (code === CHAR_DOT) {
825
+ // If this is our first dot, mark it as the start of our extension
826
+ if (startDot === -1) startDot = i;
827
+ else if (preDotState !== 1) preDotState = 1;
828
+ } else if (startDot !== -1) {
829
+ // We saw a non-dot and non-path separator before our dot, so we should
830
+ // have a good chance at having a non-empty extension
831
+ preDotState = -1;
832
+ }
833
+ }
834
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
835
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
836
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
837
+ if (end !== -1) {
838
+ ret.base = ret.name = path.slice(startPart, end);
839
+ }
840
+ } else {
841
+ ret.name = path.slice(startPart, startDot);
842
+ ret.base = path.slice(startPart, end);
843
+ ret.ext = path.slice(startDot, end);
844
+ }
845
+ // Fallback to '\' in case there is no basename
846
+ ret.base = ret.base || "\\";
847
+ // If the directory is the root, use the entire root as the `dir` including
848
+ // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
849
+ // trailing slash (`C:\abc\def` -> `C:\abc`).
850
+ if (startPart > 0 && startPart !== rootEnd) {
851
+ ret.dir = path.slice(0, startPart - 1);
852
+ } else ret.dir = ret.root;
853
+ return ret;
854
+ }
855
+
856
+ // Copyright 2018-2025 the Deno authors. MIT license.
857
+ // This module is browser compatible.
858
+ /**
859
+ * Resolves path segments into a `path`.
860
+ *
861
+ * @example Usage
862
+ * ```ts
863
+ * import { resolve } from "@std/path/windows/resolve";
864
+ * import { assertEquals } from "@std/assert";
865
+ *
866
+ * const resolved = resolve("C:\\foo\\bar", "..\\baz");
867
+ * assertEquals(resolved, "C:\\foo\\baz");
868
+ * ```
869
+ *
870
+ * @param pathSegments The path segments to process to path
871
+ * @returns The resolved path
872
+ */ function resolve(...pathSegments) {
873
+ let resolvedDevice = "";
874
+ let resolvedTail = "";
875
+ let resolvedAbsolute = false;
876
+ for(let i = pathSegments.length - 1; i >= -1; i--){
877
+ let path;
878
+ // deno-lint-ignore no-explicit-any
879
+ const { Deno } = globalThis;
880
+ if (i >= 0) {
881
+ path = pathSegments[i];
882
+ } else if (!resolvedDevice) {
883
+ if (typeof Deno?.cwd !== "function") {
884
+ throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");
885
+ }
886
+ path = Deno.cwd();
887
+ } else {
888
+ if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
889
+ throw new TypeError("Resolved a relative path without a current working directory (CWD)");
890
+ }
891
+ path = Deno.cwd();
892
+ // Verify that a cwd was found and that it actually points
893
+ // to our drive. If not, default to the drive's root.
894
+ if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
895
+ path = `${resolvedDevice}\\`;
896
+ }
897
+ }
898
+ assertPath(path);
899
+ const len = path.length;
900
+ // Skip empty entries
901
+ if (len === 0) continue;
902
+ let rootEnd = 0;
903
+ let device = "";
904
+ let isAbsolute = false;
905
+ const code = path.charCodeAt(0);
906
+ // Try to match a root
907
+ if (len > 1) {
908
+ if (isPathSeparator(code)) {
909
+ // Possible UNC root
910
+ // If we started with a separator, we know we at least have an
911
+ // absolute path of some kind (UNC or otherwise)
912
+ isAbsolute = true;
913
+ if (isPathSeparator(path.charCodeAt(1))) {
914
+ // Matched double path separator at beginning
915
+ let j = 2;
916
+ let last = j;
917
+ // Match 1 or more non-path separators
918
+ for(; j < len; ++j){
919
+ if (isPathSeparator(path.charCodeAt(j))) break;
920
+ }
921
+ if (j < len && j !== last) {
922
+ const firstPart = path.slice(last, j);
923
+ // Matched!
924
+ last = j;
925
+ // Match 1 or more path separators
926
+ for(; j < len; ++j){
927
+ if (!isPathSeparator(path.charCodeAt(j))) break;
928
+ }
929
+ if (j < len && j !== last) {
930
+ // Matched!
931
+ last = j;
932
+ // Match 1 or more non-path separators
933
+ for(; j < len; ++j){
934
+ if (isPathSeparator(path.charCodeAt(j))) break;
935
+ }
936
+ if (j === len) {
937
+ // We matched a UNC root only
938
+ device = `\\\\${firstPart}\\${path.slice(last)}`;
939
+ rootEnd = j;
940
+ } else if (j !== last) {
941
+ // We matched a UNC root with leftovers
942
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
943
+ rootEnd = j;
944
+ }
945
+ }
946
+ }
947
+ } else {
948
+ rootEnd = 1;
949
+ }
950
+ } else if (isWindowsDeviceRoot(code)) {
951
+ // Possible device root
952
+ if (path.charCodeAt(1) === CHAR_COLON) {
953
+ device = path.slice(0, 2);
954
+ rootEnd = 2;
955
+ if (len > 2) {
956
+ if (isPathSeparator(path.charCodeAt(2))) {
957
+ // Treat separator following drive name as an absolute path
958
+ // indicator
959
+ isAbsolute = true;
960
+ rootEnd = 3;
961
+ }
962
+ }
963
+ }
964
+ }
965
+ } else if (isPathSeparator(code)) {
966
+ // `path` contains just a path separator
967
+ rootEnd = 1;
968
+ isAbsolute = true;
969
+ }
970
+ if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
971
+ continue;
972
+ }
973
+ if (resolvedDevice.length === 0 && device.length > 0) {
974
+ resolvedDevice = device;
975
+ }
976
+ if (!resolvedAbsolute) {
977
+ resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
978
+ resolvedAbsolute = isAbsolute;
979
+ }
980
+ if (resolvedAbsolute && resolvedDevice.length > 0) break;
981
+ }
982
+ // At this point the path should be resolved to a full absolute path,
983
+ // but handle relative paths to be safe (might happen when Deno.cwd()
984
+ // fails)
985
+ // Normalize the tail path
986
+ resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
987
+ return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
988
+ }
989
+
990
+ // Copyright 2018-2025 the Deno authors. MIT license.
991
+ // This module is browser compatible.
992
+ function assertArgs(from, to) {
993
+ assertPath(from);
994
+ assertPath(to);
995
+ if (from === to) return "";
996
+ }
997
+
998
+ // Copyright 2018-2025 the Deno authors. MIT license.
999
+ // This module is browser compatible.
1000
+ /**
1001
+ * Return the relative path from `from` to `to` based on current working directory.
1002
+ *
1003
+ * An example in windws, for instance:
1004
+ * from = 'C:\\orandea\\test\\aaa'
1005
+ * to = 'C:\\orandea\\impl\\bbb'
1006
+ * The output of the function should be: '..\\..\\impl\\bbb'
1007
+ *
1008
+ * @example Usage
1009
+ * ```ts
1010
+ * import { relative } from "@std/path/windows/relative";
1011
+ * import { assertEquals } from "@std/assert";
1012
+ *
1013
+ * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
1014
+ * assertEquals(relativePath, "..\\..\\impl\\bbb");
1015
+ * ```
1016
+ *
1017
+ * @param from The path from which to calculate the relative path
1018
+ * @param to The path to which to calculate the relative path
1019
+ * @returns The relative path from `from` to `to`
1020
+ */ function relative(from, to) {
1021
+ assertArgs(from, to);
1022
+ const fromOrig = resolve(from);
1023
+ const toOrig = resolve(to);
1024
+ if (fromOrig === toOrig) return "";
1025
+ from = fromOrig.toLowerCase();
1026
+ to = toOrig.toLowerCase();
1027
+ if (from === to) return "";
1028
+ // Trim any leading backslashes
1029
+ let fromStart = 0;
1030
+ let fromEnd = from.length;
1031
+ for(; fromStart < fromEnd; ++fromStart){
1032
+ if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
1033
+ }
1034
+ // Trim trailing backslashes (applicable to UNC paths only)
1035
+ for(; fromEnd - 1 > fromStart; --fromEnd){
1036
+ if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
1037
+ }
1038
+ const fromLen = fromEnd - fromStart;
1039
+ // Trim any leading backslashes
1040
+ let toStart = 0;
1041
+ let toEnd = to.length;
1042
+ for(; toStart < toEnd; ++toStart){
1043
+ if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
1044
+ }
1045
+ // Trim trailing backslashes (applicable to UNC paths only)
1046
+ for(; toEnd - 1 > toStart; --toEnd){
1047
+ if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
1048
+ }
1049
+ const toLen = toEnd - toStart;
1050
+ // Compare paths to find the longest common path from root
1051
+ const length = fromLen < toLen ? fromLen : toLen;
1052
+ let lastCommonSep = -1;
1053
+ let i = 0;
1054
+ for(; i <= length; ++i){
1055
+ if (i === length) {
1056
+ if (toLen > length) {
1057
+ if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
1058
+ // We get here if `from` is the exact base path for `to`.
1059
+ // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
1060
+ return toOrig.slice(toStart + i + 1);
1061
+ } else if (i === 2) {
1062
+ // We get here if `from` is the device root.
1063
+ // For example: from='C:\\'; to='C:\\foo'
1064
+ return toOrig.slice(toStart + i);
1065
+ }
1066
+ }
1067
+ if (fromLen > length) {
1068
+ if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
1069
+ // We get here if `to` is the exact base path for `from`.
1070
+ // For example: from='C:\\foo\\bar'; to='C:\\foo'
1071
+ lastCommonSep = i;
1072
+ } else if (i === 2) {
1073
+ // We get here if `to` is the device root.
1074
+ // For example: from='C:\\foo\\bar'; to='C:\\'
1075
+ lastCommonSep = 3;
1076
+ }
1077
+ }
1078
+ break;
1079
+ }
1080
+ const fromCode = from.charCodeAt(fromStart + i);
1081
+ const toCode = to.charCodeAt(toStart + i);
1082
+ if (fromCode !== toCode) break;
1083
+ else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
1084
+ }
1085
+ // We found a mismatch before the first common path separator was seen, so
1086
+ // return the original `to`.
1087
+ if (i !== length && lastCommonSep === -1) {
1088
+ return toOrig;
1089
+ }
1090
+ let out = "";
1091
+ if (lastCommonSep === -1) lastCommonSep = 0;
1092
+ // Generate the relative path based on the path difference between `to` and
1093
+ // `from`
1094
+ for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
1095
+ if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
1096
+ if (out.length === 0) out += "..";
1097
+ else out += "\\..";
1098
+ }
1099
+ }
1100
+ // Lastly, append the rest of the destination (`to`) path that comes after
1101
+ // the common path parts
1102
+ if (out.length > 0) {
1103
+ return out + toOrig.slice(toStart + lastCommonSep, toEnd);
1104
+ } else {
1105
+ toStart += lastCommonSep;
1106
+ if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
1107
+ return toOrig.slice(toStart, toEnd);
1108
+ }
1109
+ }
1110
+
1111
+ // Copyright 2018-2025 the Deno authors. MIT license.
1112
+ // This module is browser compatible.
1113
+ const WHITESPACE_ENCODINGS = {
1114
+ "\u0009": "%09",
1115
+ "\u000A": "%0A",
1116
+ "\u000B": "%0B",
1117
+ "\u000C": "%0C",
1118
+ "\u000D": "%0D",
1119
+ "\u0020": "%20"
1120
+ };
1121
+ function encodeWhitespace(string) {
1122
+ return string.replaceAll(/[\s]/g, (c)=>{
1123
+ return WHITESPACE_ENCODINGS[c] ?? c;
1124
+ });
1125
+ }
1126
+
1127
+ // Copyright 2018-2025 the Deno authors. MIT license.
1128
+ // This module is browser compatible.
1129
+ /**
1130
+ * Converts a path string to a file URL.
1131
+ *
1132
+ * @example Usage
1133
+ * ```ts
1134
+ * import { toFileUrl } from "@std/path/windows/to-file-url";
1135
+ * import { assertEquals } from "@std/assert";
1136
+ *
1137
+ * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo"));
1138
+ * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo"));
1139
+ * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo"));
1140
+ * ```
1141
+ * @param path The path to convert.
1142
+ * @returns The file URL.
1143
+ */ function toFileUrl(path) {
1144
+ if (!isAbsolute(path)) {
1145
+ throw new TypeError(`Path must be absolute: received "${path}"`);
1146
+ }
1147
+ const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
1148
+ const url = new URL("file:///");
1149
+ url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
1150
+ if (hostname !== undefined && hostname !== "localhost") {
1151
+ url.hostname = hostname;
1152
+ if (!url.hostname) {
1153
+ throw new TypeError(`Invalid hostname: "${url.hostname}"`);
1154
+ }
1155
+ }
1156
+ return url;
1157
+ }
1158
+
1159
+ // Copyright 2018-2025 the Deno authors. MIT license.
1160
+ // This module is browser compatible.
1161
+ /**
1162
+ * Resolves path to a namespace path
1163
+ *
1164
+ * @example Usage
1165
+ * ```ts
1166
+ * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path";
1167
+ * import { assertEquals } from "@std/assert";
1168
+ *
1169
+ * const namespaced = toNamespacedPath("C:\\foo\\bar");
1170
+ * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar");
1171
+ * ```
1172
+ *
1173
+ * @param path The path to resolve to namespaced path
1174
+ * @returns The resolved namespaced path
1175
+ */ function toNamespacedPath(path) {
1176
+ // Note: this will *probably* throw somewhere.
1177
+ if (typeof path !== "string") return path;
1178
+ if (path.length === 0) return "";
1179
+ const resolvedPath = resolve(path);
1180
+ if (resolvedPath.length >= 3) {
1181
+ if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
1182
+ // Possible UNC root
1183
+ if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
1184
+ const code = resolvedPath.charCodeAt(2);
1185
+ if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
1186
+ // Matched non-long UNC root, convert the path to a long UNC path
1187
+ return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
1188
+ }
1189
+ }
1190
+ } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
1191
+ // Possible device root
1192
+ if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
1193
+ // Matched device root, convert the path to a long UNC path
1194
+ return `\\\\?\\${resolvedPath}`;
1195
+ }
1196
+ }
1197
+ }
1198
+ return path;
1199
+ }
1200
+
1201
+ // Copyright 2018-2025 the Deno authors. MIT license.
1202
+ // This module is browser compatible.
1203
+ function common$1(paths, sep) {
1204
+ const [first = "", ...remaining] = paths;
1205
+ const parts = first.split(sep);
1206
+ let endOfPrefix = parts.length;
1207
+ let append = "";
1208
+ for (const path of remaining){
1209
+ const compare = path.split(sep);
1210
+ if (compare.length <= endOfPrefix) {
1211
+ endOfPrefix = compare.length;
1212
+ append = "";
1213
+ }
1214
+ for(let i = 0; i < endOfPrefix; i++){
1215
+ if (compare[i] !== parts[i]) {
1216
+ endOfPrefix = i;
1217
+ append = i === 0 ? "" : sep;
1218
+ break;
1219
+ }
1220
+ }
1221
+ }
1222
+ return parts.slice(0, endOfPrefix).join(sep) + append;
1223
+ }
1224
+
1225
+ // Copyright 2018-2025 the Deno authors. MIT license.
1226
+ // This module is browser compatible.
1227
+ /**
1228
+ * Determines the common path from a set of paths for Windows systems.
1229
+ *
1230
+ * @example Usage
1231
+ * ```ts
1232
+ * import { common } from "@std/path/windows/common";
1233
+ * import { assertEquals } from "@std/assert";
1234
+ *
1235
+ * const path = common([
1236
+ * "C:\\foo\\bar",
1237
+ * "C:\\foo\\baz",
1238
+ * ]);
1239
+ * assertEquals(path, "C:\\foo\\");
1240
+ * ```
1241
+ *
1242
+ * @param paths The paths to compare.
1243
+ * @returns The common path.
1244
+ */ function common(paths) {
1245
+ return common$1(paths, SEPARATOR);
1246
+ }
1247
+
1248
+ // Copyright 2018-2025 the Deno authors. MIT license.
1249
+ // This module is browser compatible.
1250
+ /**
1251
+ * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
1252
+ * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
1253
+ */ const REG_EXP_ESCAPE_CHARS = [
1254
+ "!",
1255
+ "$",
1256
+ "(",
1257
+ ")",
1258
+ "*",
1259
+ "+",
1260
+ ".",
1261
+ "=",
1262
+ "?",
1263
+ "[",
1264
+ "\\",
1265
+ "^",
1266
+ "{",
1267
+ "|"
1268
+ ];
1269
+ const RANGE_ESCAPE_CHARS = [
1270
+ "-",
1271
+ "\\",
1272
+ "]"
1273
+ ];
1274
+ function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
1275
+ caseInsensitive = false } = {}) {
1276
+ if (glob === "") {
1277
+ return /(?!)/;
1278
+ }
1279
+ // Remove trailing separators.
1280
+ let newLength = glob.length;
1281
+ for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
1282
+ glob = glob.slice(0, newLength);
1283
+ let regExpString = "";
1284
+ // Terminates correctly. Trust that `j` is incremented every iteration.
1285
+ for(let j = 0; j < glob.length;){
1286
+ let segment = "";
1287
+ const groupStack = [];
1288
+ let inRange = false;
1289
+ let inEscape = false;
1290
+ let endsWithSep = false;
1291
+ let i = j;
1292
+ // Terminates with `i` at the non-inclusive end of the current segment.
1293
+ for(; i < glob.length && !c.seps.includes(glob[i]); i++){
1294
+ if (inEscape) {
1295
+ inEscape = false;
1296
+ const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
1297
+ segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1298
+ continue;
1299
+ }
1300
+ if (glob[i] === c.escapePrefix) {
1301
+ inEscape = true;
1302
+ continue;
1303
+ }
1304
+ if (glob[i] === "[") {
1305
+ if (!inRange) {
1306
+ inRange = true;
1307
+ segment += "[";
1308
+ if (glob[i + 1] === "!") {
1309
+ i++;
1310
+ segment += "^";
1311
+ } else if (glob[i + 1] === "^") {
1312
+ i++;
1313
+ segment += "\\^";
1314
+ }
1315
+ continue;
1316
+ } else if (glob[i + 1] === ":") {
1317
+ let k = i + 1;
1318
+ let value = "";
1319
+ while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
1320
+ value += glob[k + 1];
1321
+ k++;
1322
+ }
1323
+ if (glob[k + 1] === ":" && glob[k + 2] === "]") {
1324
+ i = k + 2;
1325
+ if (value === "alnum") segment += "\\dA-Za-z";
1326
+ else if (value === "alpha") segment += "A-Za-z";
1327
+ else if (value === "ascii") segment += "\x00-\x7F";
1328
+ else if (value === "blank") segment += "\t ";
1329
+ else if (value === "cntrl") segment += "\x00-\x1F\x7F";
1330
+ else if (value === "digit") segment += "\\d";
1331
+ else if (value === "graph") segment += "\x21-\x7E";
1332
+ else if (value === "lower") segment += "a-z";
1333
+ else if (value === "print") segment += "\x20-\x7E";
1334
+ else if (value === "punct") {
1335
+ segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
1336
+ } else if (value === "space") segment += "\\s\v";
1337
+ else if (value === "upper") segment += "A-Z";
1338
+ else if (value === "word") segment += "\\w";
1339
+ else if (value === "xdigit") segment += "\\dA-Fa-f";
1340
+ continue;
1341
+ }
1342
+ }
1343
+ }
1344
+ if (glob[i] === "]" && inRange) {
1345
+ inRange = false;
1346
+ segment += "]";
1347
+ continue;
1348
+ }
1349
+ if (inRange) {
1350
+ segment += glob[i];
1351
+ continue;
1352
+ }
1353
+ if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1354
+ segment += ")";
1355
+ const type = groupStack.pop();
1356
+ if (type === "!") {
1357
+ segment += c.wildcard;
1358
+ } else if (type !== "@") {
1359
+ segment += type;
1360
+ }
1361
+ continue;
1362
+ }
1363
+ if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1364
+ segment += "|";
1365
+ continue;
1366
+ }
1367
+ if (glob[i] === "+" && extended && glob[i + 1] === "(") {
1368
+ i++;
1369
+ groupStack.push("+");
1370
+ segment += "(?:";
1371
+ continue;
1372
+ }
1373
+ if (glob[i] === "@" && extended && glob[i + 1] === "(") {
1374
+ i++;
1375
+ groupStack.push("@");
1376
+ segment += "(?:";
1377
+ continue;
1378
+ }
1379
+ if (glob[i] === "?") {
1380
+ if (extended && glob[i + 1] === "(") {
1381
+ i++;
1382
+ groupStack.push("?");
1383
+ segment += "(?:";
1384
+ } else {
1385
+ segment += ".";
1386
+ }
1387
+ continue;
1388
+ }
1389
+ if (glob[i] === "!" && extended && glob[i + 1] === "(") {
1390
+ i++;
1391
+ groupStack.push("!");
1392
+ segment += "(?!";
1393
+ continue;
1394
+ }
1395
+ if (glob[i] === "{") {
1396
+ groupStack.push("BRACE");
1397
+ segment += "(?:";
1398
+ continue;
1399
+ }
1400
+ if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
1401
+ groupStack.pop();
1402
+ segment += ")";
1403
+ continue;
1404
+ }
1405
+ if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
1406
+ segment += "|";
1407
+ continue;
1408
+ }
1409
+ if (glob[i] === "*") {
1410
+ if (extended && glob[i + 1] === "(") {
1411
+ i++;
1412
+ groupStack.push("*");
1413
+ segment += "(?:";
1414
+ } else {
1415
+ const prevChar = glob[i - 1];
1416
+ let numStars = 1;
1417
+ while(glob[i + 1] === "*"){
1418
+ i++;
1419
+ numStars++;
1420
+ }
1421
+ const nextChar = glob[i + 1];
1422
+ if (globstarOption && numStars === 2 && [
1423
+ ...c.seps,
1424
+ undefined
1425
+ ].includes(prevChar) && [
1426
+ ...c.seps,
1427
+ undefined
1428
+ ].includes(nextChar)) {
1429
+ segment += c.globstar;
1430
+ endsWithSep = true;
1431
+ } else {
1432
+ segment += c.wildcard;
1433
+ }
1434
+ }
1435
+ continue;
1436
+ }
1437
+ segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1438
+ }
1439
+ // Check for unclosed groups or a dangling backslash.
1440
+ if (groupStack.length > 0 || inRange || inEscape) {
1441
+ // Parse failure. Take all characters from this segment literally.
1442
+ segment = "";
1443
+ for (const c of glob.slice(j, i)){
1444
+ segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
1445
+ endsWithSep = false;
1446
+ }
1447
+ }
1448
+ regExpString += segment;
1449
+ if (!endsWithSep) {
1450
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
1451
+ endsWithSep = true;
1452
+ }
1453
+ // Terminates with `i` at the start of the next segment.
1454
+ while(c.seps.includes(glob[i]))i++;
1455
+ j = i;
1456
+ }
1457
+ regExpString = `^${regExpString}$`;
1458
+ return new RegExp(regExpString, caseInsensitive ? "i" : "");
1459
+ }
1460
+
1461
+ // Copyright 2018-2025 the Deno authors. MIT license.
1462
+ // This module is browser compatible.
1463
+ const constants = {
1464
+ sep: "(?:\\\\|/)+",
1465
+ sepMaybe: "(?:\\\\|/)*",
1466
+ seps: [
1467
+ "\\",
1468
+ "/"
1469
+ ],
1470
+ globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
1471
+ wildcard: "[^\\\\/]*",
1472
+ escapePrefix: "`"
1473
+ };
1474
+ /** Convert a glob string to a regular expression.
1475
+ *
1476
+ * Tries to match bash glob expansion as closely as possible.
1477
+ *
1478
+ * Basic glob syntax:
1479
+ * - `*` - Matches everything without leaving the path segment.
1480
+ * - `?` - Matches any single character.
1481
+ * - `{foo,bar}` - Matches `foo` or `bar`.
1482
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
1483
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
1484
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
1485
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
1486
+ * - `[[:alnum:]]` - Matches any digit or letter.
1487
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
1488
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
1489
+ * for a complete list of supported character classes.
1490
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
1491
+ * - \` - Escapes the next character for `os` set to `"windows"`.
1492
+ * - `/` - Path separator.
1493
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
1494
+ *
1495
+ * Extended syntax:
1496
+ * - Requires `{ extended: true }`.
1497
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
1498
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
1499
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
1500
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
1501
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
1502
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
1503
+ *
1504
+ * Globstar syntax:
1505
+ * - Requires `{ globstar: true }`.
1506
+ * - `**` - Matches any number of any path segments.
1507
+ * - Must comprise its entire path segment in the provided glob.
1508
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
1509
+ *
1510
+ * Note the following properties:
1511
+ * - The generated `RegExp` is anchored at both start and end.
1512
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
1513
+ * provided glob have no meaning and are discarded.
1514
+ * - Absolute globs will only match absolute paths, etc.
1515
+ * - Empty globs will match nothing.
1516
+ * - Any special glob syntax must be contained to one path segment. For example,
1517
+ * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
1518
+ * first segment ends with an unclosed group.
1519
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
1520
+ * parse error has occurred. Every character for that segment is taken
1521
+ * literally in this event.
1522
+ *
1523
+ * Limitations:
1524
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
1525
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
1526
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
1527
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
1528
+ * the group occurs not nested at the end of the segment.
1529
+ *
1530
+ * @example Usage
1531
+ * ```ts
1532
+ * import { globToRegExp } from "@std/path/windows/glob-to-regexp";
1533
+ * import { assertEquals } from "@std/assert";
1534
+ *
1535
+ * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/);
1536
+ * ```
1537
+ *
1538
+ * @param glob Glob string to convert.
1539
+ * @param options Conversion options.
1540
+ * @returns The regular expression equivalent to the glob.
1541
+ */ function globToRegExp(glob, options = {}) {
1542
+ return _globToRegExp(constants, glob, options);
1543
+ }
1544
+
1545
+ // Copyright 2018-2025 the Deno authors. MIT license.
1546
+ // This module is browser compatible.
1547
+ /**
1548
+ * Test whether the given string is a glob.
1549
+ *
1550
+ * @example Usage
1551
+ * ```ts
1552
+ * import { isGlob } from "@std/path/is-glob";
1553
+ * import { assert } from "@std/assert";
1554
+ *
1555
+ * assert(!isGlob("foo/bar/../baz"));
1556
+ * assert(isGlob("foo/*ar/../baz"));
1557
+ * ```
1558
+ *
1559
+ * @param str String to test.
1560
+ * @returns `true` if the given string is a glob, otherwise `false`
1561
+ */ function isGlob(str) {
1562
+ const chars = {
1563
+ "{": "}",
1564
+ "(": ")",
1565
+ "[": "]"
1566
+ };
1567
+ const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
1568
+ if (str === "") {
1569
+ return false;
1570
+ }
1571
+ let match;
1572
+ while(match = regex.exec(str)){
1573
+ if (match[2]) return true;
1574
+ let idx = match.index + match[0].length;
1575
+ // if an open bracket/brace/paren is escaped,
1576
+ // set the index to the next closing character
1577
+ const open = match[1];
1578
+ const close = open ? chars[open] : null;
1579
+ if (open && close) {
1580
+ const n = str.indexOf(close, idx);
1581
+ if (n !== -1) {
1582
+ idx = n + 1;
1583
+ }
1584
+ }
1585
+ str = str.slice(idx);
1586
+ }
1587
+ return false;
1588
+ }
1589
+
1590
+ // Copyright 2018-2025 the Deno authors. MIT license.
1591
+ // This module is browser compatible.
1592
+ /**
1593
+ * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
1594
+ *
1595
+ * @example Usage
1596
+ * ```ts
1597
+ * import { normalizeGlob } from "@std/path/windows/normalize-glob";
1598
+ * import { assertEquals } from "@std/assert";
1599
+ *
1600
+ * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
1601
+ * assertEquals(normalized, "**\\bar");
1602
+ * ```
1603
+ *
1604
+ * @param glob The glob pattern to normalize.
1605
+ * @param options The options for glob pattern.
1606
+ * @returns The normalized glob pattern.
1607
+ */ function normalizeGlob(glob, options = {}) {
1608
+ const { globstar = false } = options;
1609
+ if (glob.match(/\0/g)) {
1610
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
1611
+ }
1612
+ if (!globstar) {
1613
+ return normalize(glob);
1614
+ }
1615
+ const s = SEPARATOR_PATTERN.source;
1616
+ const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
1617
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
1618
+ }
1619
+
1620
+ // Copyright 2018-2025 the Deno authors. MIT license.
1621
+ // This module is browser compatible.
1622
+ /**
1623
+ * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
1624
+ *
1625
+ * @example Usage
1626
+ *
1627
+ * ```ts
1628
+ * import { joinGlobs } from "@std/path/windows/join-globs";
1629
+ * import { assertEquals } from "@std/assert";
1630
+ *
1631
+ * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true });
1632
+ * assertEquals(joined, "foo\\**\\bar");
1633
+ * ```
1634
+ *
1635
+ * @param globs The globs to join.
1636
+ * @param options The options for glob pattern.
1637
+ * @returns The joined glob pattern.
1638
+ */ function joinGlobs(globs, options = {}) {
1639
+ const { globstar = false } = options;
1640
+ if (!globstar || globs.length === 0) {
1641
+ return join(...globs);
1642
+ }
1643
+ let joined;
1644
+ for (const glob of globs){
1645
+ const path = glob;
1646
+ if (path.length > 0) {
1647
+ if (!joined) joined = path;
1648
+ else joined += `${SEPARATOR}${path}`;
1649
+ }
1650
+ }
1651
+ if (!joined) return ".";
1652
+ return normalizeGlob(joined, {
1653
+ globstar
1654
+ });
1655
+ }
1656
+
1657
+ exports.DELIMITER = DELIMITER;
1658
+ exports.SEPARATOR = SEPARATOR;
1659
+ exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
1660
+ exports.basename = basename;
1661
+ exports.common = common;
1662
+ exports.dirname = dirname;
1663
+ exports.extname = extname;
1664
+ exports.format = format;
1665
+ exports.fromFileUrl = fromFileUrl;
1666
+ exports.globToRegExp = globToRegExp;
1667
+ exports.isAbsolute = isAbsolute;
1668
+ exports.isGlob = isGlob;
1669
+ exports.join = join;
1670
+ exports.joinGlobs = joinGlobs;
1671
+ exports.normalize = normalize;
1672
+ exports.normalizeGlob = normalizeGlob;
1673
+ exports.parse = parse;
1674
+ exports.relative = relative;
1675
+ exports.resolve = resolve;
1676
+ exports.toFileUrl = toFileUrl;
1677
+ exports.toNamespacedPath = toNamespacedPath;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/cjs/types.ts ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for the config-array package.
3
+ * @author Nicholas C. Zakas
4
+ */
5
+
6
+ export interface ConfigObject {
7
+ /**
8
+ * The base path for files and ignores.
9
+ */
10
+ basePath?: string;
11
+
12
+ /**
13
+ * The files to include.
14
+ */
15
+ files?: string[];
16
+
17
+ /**
18
+ * The files to exclude.
19
+ */
20
+ ignores?: string[];
21
+
22
+ /**
23
+ * The name of the config object.
24
+ */
25
+ name?: string;
26
+
27
+ // may also have any number of other properties
28
+ [key: string]: unknown;
29
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/index.d.ts ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export { ObjectSchema } from "@eslint/object-schema";
2
+ export type PropertyDefinition = import("@eslint/object-schema").PropertyDefinition;
3
+ export type ObjectDefinition = import("@eslint/object-schema").ObjectDefinition;
4
+ export type ConfigObject = import("./types.ts").ConfigObject;
5
+ export type IMinimatchStatic = import("minimatch").IMinimatchStatic;
6
+ export type IMinimatch = import("minimatch").IMinimatch;
7
+ export type PathImpl = typeof import("@jsr/std__path");
8
+ export type ObjectSchemaInstance = import("@eslint/object-schema").ObjectSchema;
9
+ /**
10
+ * Represents an array of config objects and provides method for working with
11
+ * those config objects.
12
+ */
13
+ export class ConfigArray extends Array<any> {
14
+ [x: symbol]: (config: any) => any;
15
+ /**
16
+ * Creates a new instance of ConfigArray.
17
+ * @param {Iterable|Function|Object} configs An iterable yielding config
18
+ * objects, or a config function, or a config object.
19
+ * @param {Object} options The options for the ConfigArray.
20
+ * @param {string} [options.basePath="/"] The absolute path of the config file directory.
21
+ * Defaults to `"/"`.
22
+ * @param {boolean} [options.normalized=false] Flag indicating if the
23
+ * configs have already been normalized.
24
+ * @param {Object} [options.schema] The additional schema
25
+ * definitions to use for the ConfigArray schema.
26
+ * @param {Array<string>} [options.extraConfigTypes] List of config types supported.
27
+ * @throws {TypeError} When the `basePath` is not a non-empty string,
28
+ */
29
+ constructor(configs: Iterable<any> | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: {
30
+ basePath?: string;
31
+ normalized?: boolean;
32
+ schema?: any;
33
+ extraConfigTypes?: Array<string>;
34
+ });
35
+ /**
36
+ * The path of the config file that this array was loaded from.
37
+ * This is used to calculate filename matches.
38
+ * @property basePath
39
+ * @type {string}
40
+ */
41
+ basePath: string;
42
+ /**
43
+ * The supported config types.
44
+ * @type {Array<string>}
45
+ */
46
+ extraConfigTypes: Array<string>;
47
+ /**
48
+ * Returns the `files` globs from every config object in the array.
49
+ * This can be used to determine which files will be matched by a
50
+ * config array or to use as a glob pattern when no patterns are provided
51
+ * for a command line interface.
52
+ * @returns {Array<string|Function>} An array of matchers.
53
+ */
54
+ get files(): Array<string | Function>;
55
+ /**
56
+ * Returns ignore matchers that should always be ignored regardless of
57
+ * the matching `files` fields in any configs. This is necessary to mimic
58
+ * the behavior of things like .gitignore and .eslintignore, allowing a
59
+ * globbing operation to be faster.
60
+ * @returns {Object[]} An array of config objects representing global ignores.
61
+ */
62
+ get ignores(): any[];
63
+ /**
64
+ * Indicates if the config array has been normalized.
65
+ * @returns {boolean} True if the config array is normalized, false if not.
66
+ */
67
+ isNormalized(): boolean;
68
+ /**
69
+ * Normalizes a config array by flattening embedded arrays and executing
70
+ * config functions.
71
+ * @param {Object} [context] The context object for config functions.
72
+ * @returns {Promise<ConfigArray>} The current ConfigArray instance.
73
+ */
74
+ normalize(context?: any): Promise<ConfigArray>;
75
+ /**
76
+ * Normalizes a config array by flattening embedded arrays and executing
77
+ * config functions.
78
+ * @param {Object} [context] The context object for config functions.
79
+ * @returns {ConfigArray} The current ConfigArray instance.
80
+ */
81
+ normalizeSync(context?: any): ConfigArray;
82
+ /**
83
+ * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
84
+ * @param {string} filePath The path of a file to get a config for.
85
+ * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
86
+ * An object with an optional property `config` and property `status`.
87
+ * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
88
+ * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
89
+ */
90
+ getConfigWithStatus(filePath: string): {
91
+ config?: any;
92
+ status: "ignored" | "external" | "unconfigured" | "matched";
93
+ };
94
+ /**
95
+ * Returns the config object for a given file path.
96
+ * @param {string} filePath The path of a file to get a config for.
97
+ * @returns {Object|undefined} The config object for this file or `undefined`.
98
+ */
99
+ getConfig(filePath: string): any | undefined;
100
+ /**
101
+ * Determines whether a file has a config or why it doesn't.
102
+ * @param {string} filePath The path of the file to check.
103
+ * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
104
+ * * `"ignored"`: the file is ignored
105
+ * * `"external"`: the file is outside the base path
106
+ * * `"unconfigured"`: the file is not matched by any config
107
+ * * `"matched"`: the file has a matching config
108
+ */
109
+ getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched";
110
+ /**
111
+ * Determines if the given filepath is ignored based on the configs.
112
+ * @param {string} filePath The path of a file to check.
113
+ * @returns {boolean} True if the path is ignored, false if not.
114
+ * @deprecated Use `isFileIgnored` instead.
115
+ */
116
+ isIgnored(filePath: string): boolean;
117
+ /**
118
+ * Determines if the given filepath is ignored based on the configs.
119
+ * @param {string} filePath The path of a file to check.
120
+ * @returns {boolean} True if the path is ignored, false if not.
121
+ */
122
+ isFileIgnored(filePath: string): boolean;
123
+ /**
124
+ * Determines if the given directory is ignored based on the configs.
125
+ * This checks only default `ignores` that don't have `files` in the
126
+ * same config. A pattern such as `/foo` be considered to ignore the directory
127
+ * while a pattern such as `/foo/**` is not considered to ignore the
128
+ * directory because it is matching files.
129
+ * @param {string} directoryPath The path of a directory to check.
130
+ * @returns {boolean} True if the directory is ignored, false if not. Will
131
+ * return true for any directory that is not inside of `basePath`.
132
+ * @throws {Error} When the `ConfigArray` is not normalized.
133
+ */
134
+ isDirectoryIgnored(directoryPath: string): boolean;
135
+ #private;
136
+ }
137
+ export namespace ConfigArraySymbol {
138
+ let isNormalized: symbol;
139
+ let configCache: symbol;
140
+ let schema: symbol;
141
+ let finalizeConfig: symbol;
142
+ let preprocessConfig: symbol;
143
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/index.js ADDED
@@ -0,0 +1,1509 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-self-types="./index.d.ts"
2
+ import * as posixPath from './std__path/posix.js';
3
+ import * as windowsPath from './std__path/windows.js';
4
+ import minimatch from 'minimatch';
5
+ import createDebug from 'debug';
6
+ import { ObjectSchema } from '@eslint/object-schema';
7
+ export { ObjectSchema } from '@eslint/object-schema';
8
+
9
+ /**
10
+ * @fileoverview ConfigSchema
11
+ * @author Nicholas C. Zakas
12
+ */
13
+
14
+ //------------------------------------------------------------------------------
15
+ // Types
16
+ //------------------------------------------------------------------------------
17
+
18
+ /** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */
19
+ /** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */
20
+
21
+ //------------------------------------------------------------------------------
22
+ // Helpers
23
+ //------------------------------------------------------------------------------
24
+
25
+ /**
26
+ * A strategy that does nothing.
27
+ * @type {PropertyDefinition}
28
+ */
29
+ const NOOP_STRATEGY = {
30
+ required: false,
31
+ merge() {
32
+ return undefined;
33
+ },
34
+ validate() {},
35
+ };
36
+
37
+ //------------------------------------------------------------------------------
38
+ // Exports
39
+ //------------------------------------------------------------------------------
40
+
41
+ /**
42
+ * The base schema that every ConfigArray uses.
43
+ * @type {ObjectDefinition}
44
+ */
45
+ const baseSchema = Object.freeze({
46
+ name: {
47
+ required: false,
48
+ merge() {
49
+ return undefined;
50
+ },
51
+ validate(value) {
52
+ if (typeof value !== "string") {
53
+ throw new TypeError("Property must be a string.");
54
+ }
55
+ },
56
+ },
57
+ basePath: NOOP_STRATEGY,
58
+ files: NOOP_STRATEGY,
59
+ ignores: NOOP_STRATEGY,
60
+ });
61
+
62
+ /**
63
+ * @fileoverview ConfigSchema
64
+ * @author Nicholas C. Zakas
65
+ */
66
+
67
+ //------------------------------------------------------------------------------
68
+ // Types
69
+ //------------------------------------------------------------------------------
70
+
71
+
72
+ //------------------------------------------------------------------------------
73
+ // Helpers
74
+ //------------------------------------------------------------------------------
75
+
76
+ /**
77
+ * Asserts that a given value is an array.
78
+ * @param {*} value The value to check.
79
+ * @returns {void}
80
+ * @throws {TypeError} When the value is not an array.
81
+ */
82
+ function assertIsArray(value) {
83
+ if (!Array.isArray(value)) {
84
+ throw new TypeError("Expected value to be an array.");
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Asserts that a given value is an array containing only strings and functions.
90
+ * @param {*} value The value to check.
91
+ * @returns {void}
92
+ * @throws {TypeError} When the value is not an array of strings and functions.
93
+ */
94
+ function assertIsArrayOfStringsAndFunctions(value) {
95
+ assertIsArray(value);
96
+
97
+ if (
98
+ value.some(
99
+ item => typeof item !== "string" && typeof item !== "function",
100
+ )
101
+ ) {
102
+ throw new TypeError(
103
+ "Expected array to only contain strings and functions.",
104
+ );
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Asserts that a given value is a non-empty array.
110
+ * @param {*} value The value to check.
111
+ * @returns {void}
112
+ * @throws {TypeError} When the value is not an array or an empty array.
113
+ */
114
+ function assertIsNonEmptyArray(value) {
115
+ if (!Array.isArray(value) || value.length === 0) {
116
+ throw new TypeError("Expected value to be a non-empty array.");
117
+ }
118
+ }
119
+
120
+ //------------------------------------------------------------------------------
121
+ // Exports
122
+ //------------------------------------------------------------------------------
123
+
124
+ /**
125
+ * The schema for `files` and `ignores` that every ConfigArray uses.
126
+ * @type {ObjectDefinition}
127
+ */
128
+ const filesAndIgnoresSchema = Object.freeze({
129
+ basePath: {
130
+ required: false,
131
+ merge() {
132
+ return undefined;
133
+ },
134
+ validate(value) {
135
+ if (typeof value !== "string") {
136
+ throw new TypeError("Expected value to be a string.");
137
+ }
138
+ },
139
+ },
140
+ files: {
141
+ required: false,
142
+ merge() {
143
+ return undefined;
144
+ },
145
+ validate(value) {
146
+ // first check if it's an array
147
+ assertIsNonEmptyArray(value);
148
+
149
+ // then check each member
150
+ value.forEach(item => {
151
+ if (Array.isArray(item)) {
152
+ assertIsArrayOfStringsAndFunctions(item);
153
+ } else if (
154
+ typeof item !== "string" &&
155
+ typeof item !== "function"
156
+ ) {
157
+ throw new TypeError(
158
+ "Items must be a string, a function, or an array of strings and functions.",
159
+ );
160
+ }
161
+ });
162
+ },
163
+ },
164
+ ignores: {
165
+ required: false,
166
+ merge() {
167
+ return undefined;
168
+ },
169
+ validate: assertIsArrayOfStringsAndFunctions,
170
+ },
171
+ });
172
+
173
+ /**
174
+ * @fileoverview ConfigArray
175
+ * @author Nicholas C. Zakas
176
+ */
177
+
178
+
179
+ //------------------------------------------------------------------------------
180
+ // Types
181
+ //------------------------------------------------------------------------------
182
+
183
+ /** @typedef {import("./types.ts").ConfigObject} ConfigObject */
184
+ /** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */
185
+ /** @typedef {import("minimatch").IMinimatch} IMinimatch */
186
+ /** @typedef {import("@jsr/std__path")} PathImpl */
187
+
188
+ /*
189
+ * This is a bit of a hack to make TypeScript happy with the Rollup-created
190
+ * CommonJS file. Rollup doesn't do object destructuring for imported files
191
+ * and instead imports the default via `require()`. This messes up type checking
192
+ * for `ObjectSchema`. To work around that, we just import the type manually
193
+ * and give it a different name to use in the JSDoc comments.
194
+ */
195
+ /** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */
196
+
197
+ //------------------------------------------------------------------------------
198
+ // Helpers
199
+ //------------------------------------------------------------------------------
200
+
201
+ const Minimatch = minimatch.Minimatch;
202
+ const debug = createDebug("@eslint/config-array");
203
+
204
+ /**
205
+ * A cache for minimatch instances.
206
+ * @type {Map<string, IMinimatch>}
207
+ */
208
+ const minimatchCache = new Map();
209
+
210
+ /**
211
+ * A cache for negated minimatch instances.
212
+ * @type {Map<string, IMinimatch>}
213
+ */
214
+ const negatedMinimatchCache = new Map();
215
+
216
+ /**
217
+ * Options to use with minimatch.
218
+ * @type {Object}
219
+ */
220
+ const MINIMATCH_OPTIONS = {
221
+ // matchBase: true,
222
+ dot: true,
223
+ allowWindowsEscape: true,
224
+ };
225
+
226
+ /**
227
+ * The types of config objects that are supported.
228
+ * @type {Set<string>}
229
+ */
230
+ const CONFIG_TYPES = new Set(["array", "function"]);
231
+
232
+ /**
233
+ * Fields that are considered metadata and not part of the config object.
234
+ * @type {Set<string>}
235
+ */
236
+ const META_FIELDS = new Set(["name", "basePath"]);
237
+
238
+ /**
239
+ * A schema containing just files and ignores for early validation.
240
+ * @type {ObjectSchemaInstance}
241
+ */
242
+ const FILES_AND_IGNORES_SCHEMA = new ObjectSchema(filesAndIgnoresSchema);
243
+
244
+ // Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`.
245
+
246
+ const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" });
247
+ const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" });
248
+ const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({
249
+ status: "unconfigured",
250
+ });
251
+
252
+ // Match two leading dots followed by a slash or the end of input.
253
+ const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u;
254
+
255
+ /**
256
+ * Wrapper error for config validation errors that adds a name to the front of the
257
+ * error message.
258
+ */
259
+ class ConfigError extends Error {
260
+ /**
261
+ * Creates a new instance.
262
+ * @param {string} name The config object name causing the error.
263
+ * @param {number} index The index of the config object in the array.
264
+ * @param {Object} options The options for the error.
265
+ * @param {Error} [options.cause] The error that caused this error.
266
+ * @param {string} [options.message] The message to use for the error.
267
+ */
268
+ constructor(name, index, { cause, message }) {
269
+ const finalMessage = message || cause.message;
270
+
271
+ super(`Config ${name}: ${finalMessage}`, { cause });
272
+
273
+ // copy over custom properties that aren't represented
274
+ if (cause) {
275
+ for (const key of Object.keys(cause)) {
276
+ if (!(key in this)) {
277
+ this[key] = cause[key];
278
+ }
279
+ }
280
+ }
281
+
282
+ /**
283
+ * The name of the error.
284
+ * @type {string}
285
+ * @readonly
286
+ */
287
+ this.name = "ConfigError";
288
+
289
+ /**
290
+ * The index of the config object in the array.
291
+ * @type {number}
292
+ * @readonly
293
+ */
294
+ this.index = index;
295
+ }
296
+ }
297
+
298
+ /**
299
+ * Gets the name of a config object.
300
+ * @param {ConfigObject} config The config object to get the name of.
301
+ * @returns {string} The name of the config object.
302
+ */
303
+ function getConfigName(config) {
304
+ if (config && typeof config.name === "string" && config.name) {
305
+ return `"${config.name}"`;
306
+ }
307
+
308
+ return "(unnamed)";
309
+ }
310
+
311
+ /**
312
+ * Rethrows a config error with additional information about the config object.
313
+ * @param {object} config The config object to get the name of.
314
+ * @param {number} index The index of the config object in the array.
315
+ * @param {Error} error The error to rethrow.
316
+ * @throws {ConfigError} When the error is rethrown for a config.
317
+ */
318
+ function rethrowConfigError(config, index, error) {
319
+ const configName = getConfigName(config);
320
+ throw new ConfigError(configName, index, { cause: error });
321
+ }
322
+
323
+ /**
324
+ * Shorthand for checking if a value is a string.
325
+ * @param {any} value The value to check.
326
+ * @returns {boolean} True if a string, false if not.
327
+ */
328
+ function isString(value) {
329
+ return typeof value === "string";
330
+ }
331
+
332
+ /**
333
+ * Creates a function that asserts that the config is valid
334
+ * during normalization. This checks that the config is not nullish
335
+ * and that files and ignores keys of a config object are valid as per base schema.
336
+ * @param {Object} config The config object to check.
337
+ * @param {number} index The index of the config object in the array.
338
+ * @returns {void}
339
+ * @throws {ConfigError} If the files and ignores keys of a config object are not valid.
340
+ */
341
+ function assertValidBaseConfig(config, index) {
342
+ if (config === null) {
343
+ throw new ConfigError(getConfigName(config), index, {
344
+ message: "Unexpected null config.",
345
+ });
346
+ }
347
+
348
+ if (config === undefined) {
349
+ throw new ConfigError(getConfigName(config), index, {
350
+ message: "Unexpected undefined config.",
351
+ });
352
+ }
353
+
354
+ if (typeof config !== "object") {
355
+ throw new ConfigError(getConfigName(config), index, {
356
+ message: "Unexpected non-object config.",
357
+ });
358
+ }
359
+
360
+ const validateConfig = {};
361
+
362
+ if ("basePath" in config) {
363
+ validateConfig.basePath = config.basePath;
364
+ }
365
+
366
+ if ("files" in config) {
367
+ validateConfig.files = config.files;
368
+ }
369
+
370
+ if ("ignores" in config) {
371
+ validateConfig.ignores = config.ignores;
372
+ }
373
+
374
+ try {
375
+ FILES_AND_IGNORES_SCHEMA.validate(validateConfig);
376
+ } catch (validationError) {
377
+ rethrowConfigError(config, index, validationError);
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Wrapper around minimatch that caches minimatch patterns for
383
+ * faster matching speed over multiple file path evaluations.
384
+ * @param {string} filepath The file path to match.
385
+ * @param {string} pattern The glob pattern to match against.
386
+ * @param {object} options The minimatch options to use.
387
+ * @returns
388
+ */
389
+ function doMatch(filepath, pattern, options = {}) {
390
+ let cache = minimatchCache;
391
+
392
+ if (options.flipNegate) {
393
+ cache = negatedMinimatchCache;
394
+ }
395
+
396
+ let matcher = cache.get(pattern);
397
+
398
+ if (!matcher) {
399
+ matcher = new Minimatch(
400
+ pattern,
401
+ Object.assign({}, MINIMATCH_OPTIONS, options),
402
+ );
403
+ cache.set(pattern, matcher);
404
+ }
405
+
406
+ return matcher.match(filepath);
407
+ }
408
+
409
+ /**
410
+ * Normalizes a pattern by removing the leading "./" if present.
411
+ * @param {string} pattern The pattern to normalize.
412
+ * @returns {string} The normalized pattern.
413
+ */
414
+ function normalizePattern(pattern) {
415
+ if (isString(pattern)) {
416
+ if (pattern.startsWith("./")) {
417
+ return pattern.slice(2);
418
+ }
419
+
420
+ if (pattern.startsWith("!./")) {
421
+ return `!${pattern.slice(3)}`;
422
+ }
423
+ }
424
+
425
+ return pattern;
426
+ }
427
+
428
+ /**
429
+ * Checks if a given pattern requires normalization.
430
+ * @param {any} pattern The pattern to check.
431
+ * @returns {boolean} True if the pattern needs normalization, false otherwise.
432
+ *
433
+ */
434
+ function needsPatternNormalization(pattern) {
435
+ return (
436
+ isString(pattern) &&
437
+ (pattern.startsWith("./") || pattern.startsWith("!./"))
438
+ );
439
+ }
440
+
441
+ /**
442
+ * Normalizes `files` and `ignores` patterns in a config by removing "./" prefixes.
443
+ * @param {Object} config The config object to normalize patterns in.
444
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base path is relative.
445
+ * @param {PathImpl} path Path-handling implementation.
446
+ * @returns {Object} The normalized config object.
447
+ */
448
+ function normalizeConfigPatterns(config, namespacedBasePath, path) {
449
+ if (!config) {
450
+ return config;
451
+ }
452
+
453
+ const hasBasePath = typeof config.basePath === "string";
454
+
455
+ let needsNormalization = false;
456
+
457
+ if (hasBasePath) {
458
+ needsNormalization = true;
459
+ }
460
+
461
+ if (!needsNormalization && Array.isArray(config.files)) {
462
+ needsNormalization = config.files.some(pattern => {
463
+ if (Array.isArray(pattern)) {
464
+ return pattern.some(needsPatternNormalization);
465
+ }
466
+ return needsPatternNormalization(pattern);
467
+ });
468
+ }
469
+
470
+ if (!needsNormalization && Array.isArray(config.ignores)) {
471
+ needsNormalization = config.ignores.some(needsPatternNormalization);
472
+ }
473
+
474
+ if (!needsNormalization) {
475
+ return config;
476
+ }
477
+
478
+ const newConfig = { ...config };
479
+
480
+ if (hasBasePath) {
481
+ if (path.isAbsolute(config.basePath)) {
482
+ newConfig.basePath = path.toNamespacedPath(config.basePath);
483
+ } else {
484
+ newConfig.basePath = path.resolve(
485
+ namespacedBasePath,
486
+ config.basePath,
487
+ );
488
+ }
489
+ }
490
+
491
+ if (Array.isArray(newConfig.files)) {
492
+ newConfig.files = newConfig.files.map(pattern => {
493
+ if (Array.isArray(pattern)) {
494
+ return pattern.map(normalizePattern);
495
+ }
496
+ return normalizePattern(pattern);
497
+ });
498
+ }
499
+
500
+ if (Array.isArray(newConfig.ignores)) {
501
+ newConfig.ignores = newConfig.ignores.map(normalizePattern);
502
+ }
503
+
504
+ return newConfig;
505
+ }
506
+
507
+ /**
508
+ * Normalizes a `ConfigArray` by flattening it and executing any functions
509
+ * that are found inside.
510
+ * @param {Array} items The items in a `ConfigArray`.
511
+ * @param {Object} context The context object to pass into any function
512
+ * found.
513
+ * @param {Array<string>} extraConfigTypes The config types to check.
514
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
515
+ * @param {PathImpl} path Path-handling implementation.
516
+ * @returns {Promise<Array>} A flattened array containing only config objects.
517
+ * @throws {TypeError} When a config function returns a function.
518
+ */
519
+ async function normalize(
520
+ items,
521
+ context,
522
+ extraConfigTypes,
523
+ namespacedBasePath,
524
+ path,
525
+ ) {
526
+ const allowFunctions = extraConfigTypes.includes("function");
527
+ const allowArrays = extraConfigTypes.includes("array");
528
+
529
+ async function* flatTraverse(array) {
530
+ for (let item of array) {
531
+ if (typeof item === "function") {
532
+ if (!allowFunctions) {
533
+ throw new TypeError("Unexpected function.");
534
+ }
535
+
536
+ item = item(context);
537
+ if (item.then) {
538
+ item = await item;
539
+ }
540
+ }
541
+
542
+ if (Array.isArray(item)) {
543
+ if (!allowArrays) {
544
+ throw new TypeError("Unexpected array.");
545
+ }
546
+ yield* flatTraverse(item);
547
+ } else if (typeof item === "function") {
548
+ throw new TypeError(
549
+ "A config function can only return an object or array.",
550
+ );
551
+ } else {
552
+ yield item;
553
+ }
554
+ }
555
+ }
556
+
557
+ /*
558
+ * Async iterables cannot be used with the spread operator, so we need to manually
559
+ * create the array to return.
560
+ */
561
+ const asyncIterable = await flatTraverse(items);
562
+ const configs = [];
563
+
564
+ for await (const config of asyncIterable) {
565
+ configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
566
+ }
567
+
568
+ return configs;
569
+ }
570
+
571
+ /**
572
+ * Normalizes a `ConfigArray` by flattening it and executing any functions
573
+ * that are found inside.
574
+ * @param {Array} items The items in a `ConfigArray`.
575
+ * @param {Object} context The context object to pass into any function
576
+ * found.
577
+ * @param {Array<string>} extraConfigTypes The config types to check.
578
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
579
+ * @param {PathImpl} path Path-handling implementation
580
+ * @returns {Array} A flattened array containing only config objects.
581
+ * @throws {TypeError} When a config function returns a function.
582
+ */
583
+ function normalizeSync(
584
+ items,
585
+ context,
586
+ extraConfigTypes,
587
+ namespacedBasePath,
588
+ path,
589
+ ) {
590
+ const allowFunctions = extraConfigTypes.includes("function");
591
+ const allowArrays = extraConfigTypes.includes("array");
592
+
593
+ function* flatTraverse(array) {
594
+ for (let item of array) {
595
+ if (typeof item === "function") {
596
+ if (!allowFunctions) {
597
+ throw new TypeError("Unexpected function.");
598
+ }
599
+
600
+ item = item(context);
601
+ if (item.then) {
602
+ throw new TypeError(
603
+ "Async config functions are not supported.",
604
+ );
605
+ }
606
+ }
607
+
608
+ if (Array.isArray(item)) {
609
+ if (!allowArrays) {
610
+ throw new TypeError("Unexpected array.");
611
+ }
612
+
613
+ yield* flatTraverse(item);
614
+ } else if (typeof item === "function") {
615
+ throw new TypeError(
616
+ "A config function can only return an object or array.",
617
+ );
618
+ } else {
619
+ yield item;
620
+ }
621
+ }
622
+ }
623
+
624
+ const configs = [];
625
+
626
+ for (const config of flatTraverse(items)) {
627
+ configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
628
+ }
629
+
630
+ return configs;
631
+ }
632
+
633
+ /**
634
+ * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`).
635
+ * @param {string} fileOrDirPath The unprocessed path to convert.
636
+ * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative.
637
+ * @param {PathImpl} path Path-handling implementations.
638
+ * @returns {string} A relative path with all separator characters replaced by forward slashes.
639
+ */
640
+ function toRelativePath(fileOrDirPath, namespacedBasePath, path) {
641
+ const fullPath = path.resolve(namespacedBasePath, fileOrDirPath);
642
+ const namespacedFullPath = path.toNamespacedPath(fullPath);
643
+ const relativePath = path.relative(namespacedBasePath, namespacedFullPath);
644
+ return relativePath.replaceAll(path.SEPARATOR, "/");
645
+ }
646
+
647
+ /**
648
+ * Determines if a given file path should be ignored based on the given
649
+ * matcher.
650
+ * @param {Array<{ basePath?: string, ignores: Array<string|((string) => boolean)>}>} configs Configuration objects containing `ignores`.
651
+ * @param {string} filePath The unprocessed file path to check.
652
+ * @param {string} relativeFilePath The path of the file to check relative to the base path,
653
+ * using forward slash (`"/"`) as a separator.
654
+ * @param {Object} [basePathData] Additional data needed to recalculate paths for configuration objects
655
+ * that have `basePath` property.
656
+ * @param {string} [basePathData.basePath] Namespaced path to witch `relativeFilePath` is relative.
657
+ * @param {PathImpl} [basePathData.path] Path-handling implementation.
658
+ * @returns {boolean} True if the path should be ignored and false if not.
659
+ */
660
+ function shouldIgnorePath(
661
+ configs,
662
+ filePath,
663
+ relativeFilePath,
664
+ { basePath, path } = {},
665
+ ) {
666
+ let shouldIgnore = false;
667
+
668
+ for (const config of configs) {
669
+ let relativeFilePathToCheck = relativeFilePath;
670
+ if (config.basePath) {
671
+ relativeFilePathToCheck = toRelativePath(
672
+ path.resolve(basePath, relativeFilePath),
673
+ config.basePath,
674
+ path,
675
+ );
676
+
677
+ if (
678
+ relativeFilePathToCheck === "" ||
679
+ EXTERNAL_PATH_REGEX.test(relativeFilePathToCheck)
680
+ ) {
681
+ continue;
682
+ }
683
+
684
+ if (relativeFilePath.endsWith("/")) {
685
+ relativeFilePathToCheck += "/";
686
+ }
687
+ }
688
+ shouldIgnore = config.ignores.reduce((ignored, matcher) => {
689
+ if (!ignored) {
690
+ if (typeof matcher === "function") {
691
+ return matcher(filePath);
692
+ }
693
+
694
+ // don't check negated patterns because we're not ignored yet
695
+ if (!matcher.startsWith("!")) {
696
+ return doMatch(relativeFilePathToCheck, matcher);
697
+ }
698
+
699
+ // otherwise we're still not ignored
700
+ return false;
701
+ }
702
+
703
+ // only need to check negated patterns because we're ignored
704
+ if (typeof matcher === "string" && matcher.startsWith("!")) {
705
+ return !doMatch(relativeFilePathToCheck, matcher, {
706
+ flipNegate: true,
707
+ });
708
+ }
709
+
710
+ return ignored;
711
+ }, shouldIgnore);
712
+ }
713
+
714
+ return shouldIgnore;
715
+ }
716
+
717
+ /**
718
+ * Determines if a given file path is matched by a config. If the config
719
+ * has no `files` field, then it matches; otherwise, if a `files` field
720
+ * is present then we match the globs in `files` and exclude any globs in
721
+ * `ignores`.
722
+ * @param {string} filePath The unprocessed file path to check.
723
+ * @param {string} relativeFilePath The path of the file to check relative to the base path,
724
+ * using forward slash (`"/"`) as a separator.
725
+ * @param {Object} config The config object to check.
726
+ * @returns {boolean} True if the file path is matched by the config,
727
+ * false if not.
728
+ */
729
+ function pathMatches(filePath, relativeFilePath, config) {
730
+ // match both strings and functions
731
+ function match(pattern) {
732
+ if (isString(pattern)) {
733
+ return doMatch(relativeFilePath, pattern);
734
+ }
735
+
736
+ if (typeof pattern === "function") {
737
+ return pattern(filePath);
738
+ }
739
+
740
+ throw new TypeError(`Unexpected matcher type ${pattern}.`);
741
+ }
742
+
743
+ // check for all matches to config.files
744
+ let filePathMatchesPattern = config.files.some(pattern => {
745
+ if (Array.isArray(pattern)) {
746
+ return pattern.every(match);
747
+ }
748
+
749
+ return match(pattern);
750
+ });
751
+
752
+ /*
753
+ * If the file path matches the config.files patterns, then check to see
754
+ * if there are any files to ignore.
755
+ */
756
+ if (filePathMatchesPattern && config.ignores) {
757
+ /*
758
+ * Pass config object without `basePath`, because `relativeFilePath` is already
759
+ * calculated as relative to it.
760
+ */
761
+ filePathMatchesPattern = !shouldIgnorePath(
762
+ [{ ignores: config.ignores }],
763
+ filePath,
764
+ relativeFilePath,
765
+ );
766
+ }
767
+
768
+ return filePathMatchesPattern;
769
+ }
770
+
771
+ /**
772
+ * Ensures that a ConfigArray has been normalized.
773
+ * @param {ConfigArray} configArray The ConfigArray to check.
774
+ * @returns {void}
775
+ * @throws {Error} When the `ConfigArray` is not normalized.
776
+ */
777
+ function assertNormalized(configArray) {
778
+ // TODO: Throw more verbose error
779
+ if (!configArray.isNormalized()) {
780
+ throw new Error(
781
+ "ConfigArray must be normalized to perform this operation.",
782
+ );
783
+ }
784
+ }
785
+
786
+ /**
787
+ * Ensures that config types are valid.
788
+ * @param {Array<string>} extraConfigTypes The config types to check.
789
+ * @returns {void}
790
+ * @throws {TypeError} When the config types array is invalid.
791
+ */
792
+ function assertExtraConfigTypes(extraConfigTypes) {
793
+ if (extraConfigTypes.length > 2) {
794
+ throw new TypeError(
795
+ "configTypes must be an array with at most two items.",
796
+ );
797
+ }
798
+
799
+ for (const configType of extraConfigTypes) {
800
+ if (!CONFIG_TYPES.has(configType)) {
801
+ throw new TypeError(
802
+ `Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`,
803
+ );
804
+ }
805
+ }
806
+ }
807
+
808
+ /**
809
+ * Returns path-handling implementations for Unix or Windows, depending on a given absolute path.
810
+ * @param {string} fileOrDirPath The absolute path to check.
811
+ * @returns {PathImpl} Path-handling implementations for the specified path.
812
+ * @throws {Error} An error is thrown if the specified argument is not an absolute path.
813
+ */
814
+ function getPathImpl(fileOrDirPath) {
815
+ // Posix absolute paths always start with a slash.
816
+ if (fileOrDirPath.startsWith("/")) {
817
+ return posixPath;
818
+ }
819
+
820
+ // Windows absolute paths start with a letter followed by a colon and at least one backslash,
821
+ // or with two backslashes in the case of UNC paths.
822
+ // Forward slashed are automatically normalized to backslashes.
823
+ if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) {
824
+ return windowsPath;
825
+ }
826
+
827
+ throw new Error(
828
+ `Expected an absolute path but received "${fileOrDirPath}"`,
829
+ );
830
+ }
831
+
832
+ //------------------------------------------------------------------------------
833
+ // Public Interface
834
+ //------------------------------------------------------------------------------
835
+
836
+ const ConfigArraySymbol = {
837
+ isNormalized: Symbol("isNormalized"),
838
+ configCache: Symbol("configCache"),
839
+ schema: Symbol("schema"),
840
+ finalizeConfig: Symbol("finalizeConfig"),
841
+ preprocessConfig: Symbol("preprocessConfig"),
842
+ };
843
+
844
+ // used to store calculate data for faster lookup
845
+ const dataCache = new WeakMap();
846
+
847
+ /**
848
+ * Represents an array of config objects and provides method for working with
849
+ * those config objects.
850
+ */
851
+ class ConfigArray extends Array {
852
+ /**
853
+ * The namespaced path of the config file directory.
854
+ * @type {string}
855
+ */
856
+ #namespacedBasePath;
857
+
858
+ /**
859
+ * Path-handling implementations.
860
+ * @type {PathImpl}
861
+ */
862
+ #path;
863
+
864
+ /**
865
+ * Creates a new instance of ConfigArray.
866
+ * @param {Iterable|Function|Object} configs An iterable yielding config
867
+ * objects, or a config function, or a config object.
868
+ * @param {Object} options The options for the ConfigArray.
869
+ * @param {string} [options.basePath="/"] The absolute path of the config file directory.
870
+ * Defaults to `"/"`.
871
+ * @param {boolean} [options.normalized=false] Flag indicating if the
872
+ * configs have already been normalized.
873
+ * @param {Object} [options.schema] The additional schema
874
+ * definitions to use for the ConfigArray schema.
875
+ * @param {Array<string>} [options.extraConfigTypes] List of config types supported.
876
+ * @throws {TypeError} When the `basePath` is not a non-empty string,
877
+ */
878
+ constructor(
879
+ configs,
880
+ {
881
+ basePath = "/",
882
+ normalized = false,
883
+ schema: customSchema,
884
+ extraConfigTypes = [],
885
+ } = {},
886
+ ) {
887
+ super();
888
+
889
+ /**
890
+ * Tracks if the array has been normalized.
891
+ * @property isNormalized
892
+ * @type {boolean}
893
+ * @private
894
+ */
895
+ this[ConfigArraySymbol.isNormalized] = normalized;
896
+
897
+ /**
898
+ * The schema used for validating and merging configs.
899
+ * @property schema
900
+ * @type {ObjectSchemaInstance}
901
+ * @private
902
+ */
903
+ this[ConfigArraySymbol.schema] = new ObjectSchema(
904
+ Object.assign({}, customSchema, baseSchema),
905
+ );
906
+
907
+ if (!isString(basePath) || !basePath) {
908
+ throw new TypeError("basePath must be a non-empty string");
909
+ }
910
+
911
+ /**
912
+ * The path of the config file that this array was loaded from.
913
+ * This is used to calculate filename matches.
914
+ * @property basePath
915
+ * @type {string}
916
+ */
917
+ this.basePath = basePath;
918
+
919
+ assertExtraConfigTypes(extraConfigTypes);
920
+
921
+ /**
922
+ * The supported config types.
923
+ * @type {Array<string>}
924
+ */
925
+ this.extraConfigTypes = [...extraConfigTypes];
926
+ Object.freeze(this.extraConfigTypes);
927
+
928
+ /**
929
+ * A cache to store calculated configs for faster repeat lookup.
930
+ * @property configCache
931
+ * @type {Map<string, Object>}
932
+ * @private
933
+ */
934
+ this[ConfigArraySymbol.configCache] = new Map();
935
+
936
+ // init cache
937
+ dataCache.set(this, {
938
+ explicitMatches: new Map(),
939
+ directoryMatches: new Map(),
940
+ files: undefined,
941
+ ignores: undefined,
942
+ });
943
+
944
+ // load the configs into this array
945
+ if (Array.isArray(configs)) {
946
+ this.push(...configs);
947
+ } else {
948
+ this.push(configs);
949
+ }
950
+
951
+ // select path-handling implementations depending on the base path
952
+ this.#path = getPathImpl(basePath);
953
+
954
+ // On Windows, `path.relative()` returns an absolute path when given two paths on different drives.
955
+ // The namespaced base path is useful to make sure that calculated relative paths are always relative.
956
+ // On Unix, it is identical to the base path.
957
+ this.#namespacedBasePath = this.#path.toNamespacedPath(basePath);
958
+ }
959
+
960
+ /**
961
+ * Prevent normal array methods from creating a new `ConfigArray` instance.
962
+ * This is to ensure that methods such as `slice()` won't try to create a
963
+ * new instance of `ConfigArray` behind the scenes as doing so may throw
964
+ * an error due to the different constructor signature.
965
+ * @type {ArrayConstructor} The `Array` constructor.
966
+ */
967
+ static get [Symbol.species]() {
968
+ return Array;
969
+ }
970
+
971
+ /**
972
+ * Returns the `files` globs from every config object in the array.
973
+ * This can be used to determine which files will be matched by a
974
+ * config array or to use as a glob pattern when no patterns are provided
975
+ * for a command line interface.
976
+ * @returns {Array<string|Function>} An array of matchers.
977
+ */
978
+ get files() {
979
+ assertNormalized(this);
980
+
981
+ // if this data has been cached, retrieve it
982
+ const cache = dataCache.get(this);
983
+
984
+ if (cache.files) {
985
+ return cache.files;
986
+ }
987
+
988
+ // otherwise calculate it
989
+
990
+ const result = [];
991
+
992
+ for (const config of this) {
993
+ if (config.files) {
994
+ config.files.forEach(filePattern => {
995
+ result.push(filePattern);
996
+ });
997
+ }
998
+ }
999
+
1000
+ // store result
1001
+ cache.files = result;
1002
+ dataCache.set(this, cache);
1003
+
1004
+ return result;
1005
+ }
1006
+
1007
+ /**
1008
+ * Returns ignore matchers that should always be ignored regardless of
1009
+ * the matching `files` fields in any configs. This is necessary to mimic
1010
+ * the behavior of things like .gitignore and .eslintignore, allowing a
1011
+ * globbing operation to be faster.
1012
+ * @returns {Object[]} An array of config objects representing global ignores.
1013
+ */
1014
+ get ignores() {
1015
+ assertNormalized(this);
1016
+
1017
+ // if this data has been cached, retrieve it
1018
+ const cache = dataCache.get(this);
1019
+
1020
+ if (cache.ignores) {
1021
+ return cache.ignores;
1022
+ }
1023
+
1024
+ // otherwise calculate it
1025
+
1026
+ const result = [];
1027
+
1028
+ for (const config of this) {
1029
+ /*
1030
+ * We only count ignores if there are no other keys in the object.
1031
+ * In this case, it acts list a globally ignored pattern. If there
1032
+ * are additional keys, then ignores act like exclusions.
1033
+ */
1034
+ if (
1035
+ config.ignores &&
1036
+ Object.keys(config).filter(key => !META_FIELDS.has(key))
1037
+ .length === 1
1038
+ ) {
1039
+ result.push(config);
1040
+ }
1041
+ }
1042
+
1043
+ // store result
1044
+ cache.ignores = result;
1045
+ dataCache.set(this, cache);
1046
+
1047
+ return result;
1048
+ }
1049
+
1050
+ /**
1051
+ * Indicates if the config array has been normalized.
1052
+ * @returns {boolean} True if the config array is normalized, false if not.
1053
+ */
1054
+ isNormalized() {
1055
+ return this[ConfigArraySymbol.isNormalized];
1056
+ }
1057
+
1058
+ /**
1059
+ * Normalizes a config array by flattening embedded arrays and executing
1060
+ * config functions.
1061
+ * @param {Object} [context] The context object for config functions.
1062
+ * @returns {Promise<ConfigArray>} The current ConfigArray instance.
1063
+ */
1064
+ async normalize(context = {}) {
1065
+ if (!this.isNormalized()) {
1066
+ const normalizedConfigs = await normalize(
1067
+ this,
1068
+ context,
1069
+ this.extraConfigTypes,
1070
+ this.#namespacedBasePath,
1071
+ this.#path,
1072
+ );
1073
+ this.length = 0;
1074
+ this.push(
1075
+ ...normalizedConfigs.map(
1076
+ this[ConfigArraySymbol.preprocessConfig].bind(this),
1077
+ ),
1078
+ );
1079
+ this.forEach(assertValidBaseConfig);
1080
+ this[ConfigArraySymbol.isNormalized] = true;
1081
+
1082
+ // prevent further changes
1083
+ Object.freeze(this);
1084
+ }
1085
+
1086
+ return this;
1087
+ }
1088
+
1089
+ /**
1090
+ * Normalizes a config array by flattening embedded arrays and executing
1091
+ * config functions.
1092
+ * @param {Object} [context] The context object for config functions.
1093
+ * @returns {ConfigArray} The current ConfigArray instance.
1094
+ */
1095
+ normalizeSync(context = {}) {
1096
+ if (!this.isNormalized()) {
1097
+ const normalizedConfigs = normalizeSync(
1098
+ this,
1099
+ context,
1100
+ this.extraConfigTypes,
1101
+ this.#namespacedBasePath,
1102
+ this.#path,
1103
+ );
1104
+ this.length = 0;
1105
+ this.push(
1106
+ ...normalizedConfigs.map(
1107
+ this[ConfigArraySymbol.preprocessConfig].bind(this),
1108
+ ),
1109
+ );
1110
+ this.forEach(assertValidBaseConfig);
1111
+ this[ConfigArraySymbol.isNormalized] = true;
1112
+
1113
+ // prevent further changes
1114
+ Object.freeze(this);
1115
+ }
1116
+
1117
+ return this;
1118
+ }
1119
+
1120
+ /* eslint-disable class-methods-use-this -- Desired as instance methods */
1121
+
1122
+ /**
1123
+ * Finalizes the state of a config before being cached and returned by
1124
+ * `getConfig()`. Does nothing by default but is provided to be
1125
+ * overridden by subclasses as necessary.
1126
+ * @param {Object} config The config to finalize.
1127
+ * @returns {Object} The finalized config.
1128
+ */
1129
+ [ConfigArraySymbol.finalizeConfig](config) {
1130
+ return config;
1131
+ }
1132
+
1133
+ /**
1134
+ * Preprocesses a config during the normalization process. This is the
1135
+ * method to override if you want to convert an array item before it is
1136
+ * validated for the first time. For example, if you want to replace a
1137
+ * string with an object, this is the method to override.
1138
+ * @param {Object} config The config to preprocess.
1139
+ * @returns {Object} The config to use in place of the argument.
1140
+ */
1141
+ [ConfigArraySymbol.preprocessConfig](config) {
1142
+ return config;
1143
+ }
1144
+
1145
+ /* eslint-enable class-methods-use-this -- Desired as instance methods */
1146
+
1147
+ /**
1148
+ * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
1149
+ * @param {string} filePath The path of a file to get a config for.
1150
+ * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
1151
+ * An object with an optional property `config` and property `status`.
1152
+ * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
1153
+ * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
1154
+ */
1155
+ getConfigWithStatus(filePath) {
1156
+ assertNormalized(this);
1157
+
1158
+ const cache = this[ConfigArraySymbol.configCache];
1159
+
1160
+ // first check the cache for a filename match to avoid duplicate work
1161
+ if (cache.has(filePath)) {
1162
+ return cache.get(filePath);
1163
+ }
1164
+
1165
+ // check to see if the file is outside the base path
1166
+
1167
+ const relativeToBaseFilePath = toRelativePath(
1168
+ filePath,
1169
+ this.#namespacedBasePath,
1170
+ this.#path,
1171
+ );
1172
+
1173
+ if (EXTERNAL_PATH_REGEX.test(relativeToBaseFilePath)) {
1174
+ debug(`No config for file ${filePath} outside of base path`);
1175
+
1176
+ // cache and return result
1177
+ cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL);
1178
+ return CONFIG_WITH_STATUS_EXTERNAL;
1179
+ }
1180
+
1181
+ // next check to see if the file should be ignored
1182
+
1183
+ // check if this should be ignored due to its directory
1184
+ if (this.isDirectoryIgnored(this.#path.dirname(filePath))) {
1185
+ debug(`Ignoring ${filePath} based on directory pattern`);
1186
+
1187
+ // cache and return result
1188
+ cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
1189
+ return CONFIG_WITH_STATUS_IGNORED;
1190
+ }
1191
+
1192
+ if (
1193
+ shouldIgnorePath(this.ignores, filePath, relativeToBaseFilePath, {
1194
+ basePath: this.#namespacedBasePath,
1195
+ path: this.#path,
1196
+ })
1197
+ ) {
1198
+ debug(`Ignoring ${filePath} based on file pattern`);
1199
+
1200
+ // cache and return result
1201
+ cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
1202
+ return CONFIG_WITH_STATUS_IGNORED;
1203
+ }
1204
+
1205
+ // filePath isn't automatically ignored, so try to construct config
1206
+
1207
+ const matchingConfigIndices = [];
1208
+ let matchFound = false;
1209
+ const universalPattern = /^\*$|^!|\/\*{1,2}$/u;
1210
+
1211
+ this.forEach((config, index) => {
1212
+ const relativeFilePath = config.basePath
1213
+ ? toRelativePath(
1214
+ this.#path.resolve(this.#namespacedBasePath, filePath),
1215
+ config.basePath,
1216
+ this.#path,
1217
+ )
1218
+ : relativeToBaseFilePath;
1219
+
1220
+ if (config.basePath && EXTERNAL_PATH_REGEX.test(relativeFilePath)) {
1221
+ debug(
1222
+ `Skipped config found for ${filePath} (based on config's base path: ${config.basePath}`,
1223
+ );
1224
+ return;
1225
+ }
1226
+
1227
+ if (!config.files) {
1228
+ if (!config.ignores) {
1229
+ debug(`Universal config found for ${filePath}`);
1230
+ matchingConfigIndices.push(index);
1231
+ return;
1232
+ }
1233
+
1234
+ if (
1235
+ Object.keys(config).filter(key => !META_FIELDS.has(key))
1236
+ .length === 1
1237
+ ) {
1238
+ debug(
1239
+ `Skipped config found for ${filePath} (global ignores)`,
1240
+ );
1241
+ return;
1242
+ }
1243
+
1244
+ /*
1245
+ * Pass config object without `basePath`, because `relativeFilePath` is already
1246
+ * calculated as relative to it.
1247
+ */
1248
+ if (
1249
+ shouldIgnorePath(
1250
+ [{ ignores: config.ignores }],
1251
+ filePath,
1252
+ relativeFilePath,
1253
+ )
1254
+ ) {
1255
+ debug(
1256
+ `Skipped config found for ${filePath} (based on ignores: ${config.ignores})`,
1257
+ );
1258
+ return;
1259
+ }
1260
+
1261
+ debug(
1262
+ `Matching config found for ${filePath} (based on ignores: ${config.ignores})`,
1263
+ );
1264
+ matchingConfigIndices.push(index);
1265
+ return;
1266
+ }
1267
+
1268
+ /*
1269
+ * If a config has a files pattern * or patterns ending in /** or /*,
1270
+ * and the filePath only matches those patterns, then the config is only
1271
+ * applied if there is another config where the filePath matches
1272
+ * a file with a specific extensions such as *.js.
1273
+ */
1274
+
1275
+ const nonUniversalFiles = [];
1276
+ const universalFiles = config.files.filter(element => {
1277
+ if (Array.isArray(element)) {
1278
+ /*
1279
+ * filePath matches an element that is an array only if it matches
1280
+ * all patterns in it (AND operation). Therefore, if there is at least
1281
+ * one non-universal pattern in the array, and filePath matches the array,
1282
+ * then we know for sure that filePath matches at least one non-universal
1283
+ * pattern, so we can consider the entire array to be non-universal.
1284
+ * In other words, all patterns in the array need to be universal
1285
+ * for it to be considered universal.
1286
+ */
1287
+ if (
1288
+ element.every(pattern => universalPattern.test(pattern))
1289
+ ) {
1290
+ return true;
1291
+ }
1292
+
1293
+ nonUniversalFiles.push(element);
1294
+ return false;
1295
+ }
1296
+
1297
+ // element is a string
1298
+
1299
+ if (universalPattern.test(element)) {
1300
+ return true;
1301
+ }
1302
+
1303
+ nonUniversalFiles.push(element);
1304
+ return false;
1305
+ });
1306
+
1307
+ // universal patterns were found so we need to check the config twice
1308
+ if (universalFiles.length) {
1309
+ debug("Universal files patterns found. Checking carefully.");
1310
+
1311
+ // check that the config matches without the non-universal files first
1312
+ if (
1313
+ nonUniversalFiles.length &&
1314
+ pathMatches(filePath, relativeFilePath, {
1315
+ files: nonUniversalFiles,
1316
+ ignores: config.ignores,
1317
+ })
1318
+ ) {
1319
+ debug(`Matching config found for ${filePath}`);
1320
+ matchingConfigIndices.push(index);
1321
+ matchFound = true;
1322
+ return;
1323
+ }
1324
+
1325
+ // if there wasn't a match then check if it matches with universal files
1326
+ if (
1327
+ universalFiles.length &&
1328
+ pathMatches(filePath, relativeFilePath, {
1329
+ files: universalFiles,
1330
+ ignores: config.ignores,
1331
+ })
1332
+ ) {
1333
+ debug(`Matching config found for ${filePath}`);
1334
+ matchingConfigIndices.push(index);
1335
+ return;
1336
+ }
1337
+
1338
+ // if we make here, then there was no match
1339
+ return;
1340
+ }
1341
+
1342
+ // the normal case
1343
+ if (pathMatches(filePath, relativeFilePath, config)) {
1344
+ debug(`Matching config found for ${filePath}`);
1345
+ matchingConfigIndices.push(index);
1346
+ matchFound = true;
1347
+ }
1348
+ });
1349
+
1350
+ // if matching both files and ignores, there will be no config to create
1351
+ if (!matchFound) {
1352
+ debug(`No matching configs found for ${filePath}`);
1353
+
1354
+ // cache and return result
1355
+ cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED);
1356
+ return CONFIG_WITH_STATUS_UNCONFIGURED;
1357
+ }
1358
+
1359
+ // check to see if there is a config cached by indices
1360
+ const indicesKey = matchingConfigIndices.toString();
1361
+ let configWithStatus = cache.get(indicesKey);
1362
+
1363
+ if (configWithStatus) {
1364
+ // also store for filename for faster lookup next time
1365
+ cache.set(filePath, configWithStatus);
1366
+
1367
+ return configWithStatus;
1368
+ }
1369
+
1370
+ // otherwise construct the config
1371
+
1372
+ // eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error
1373
+ let finalConfig = matchingConfigIndices.reduce((result, index) => {
1374
+ try {
1375
+ return this[ConfigArraySymbol.schema].merge(
1376
+ result,
1377
+ this[index],
1378
+ );
1379
+ } catch (validationError) {
1380
+ rethrowConfigError(this[index], index, validationError);
1381
+ }
1382
+ }, {});
1383
+
1384
+ finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig);
1385
+
1386
+ configWithStatus = Object.freeze({
1387
+ config: finalConfig,
1388
+ status: "matched",
1389
+ });
1390
+ cache.set(filePath, configWithStatus);
1391
+ cache.set(indicesKey, configWithStatus);
1392
+
1393
+ return configWithStatus;
1394
+ }
1395
+
1396
+ /**
1397
+ * Returns the config object for a given file path.
1398
+ * @param {string} filePath The path of a file to get a config for.
1399
+ * @returns {Object|undefined} The config object for this file or `undefined`.
1400
+ */
1401
+ getConfig(filePath) {
1402
+ return this.getConfigWithStatus(filePath).config;
1403
+ }
1404
+
1405
+ /**
1406
+ * Determines whether a file has a config or why it doesn't.
1407
+ * @param {string} filePath The path of the file to check.
1408
+ * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
1409
+ * * `"ignored"`: the file is ignored
1410
+ * * `"external"`: the file is outside the base path
1411
+ * * `"unconfigured"`: the file is not matched by any config
1412
+ * * `"matched"`: the file has a matching config
1413
+ */
1414
+ getConfigStatus(filePath) {
1415
+ return this.getConfigWithStatus(filePath).status;
1416
+ }
1417
+
1418
+ /**
1419
+ * Determines if the given filepath is ignored based on the configs.
1420
+ * @param {string} filePath The path of a file to check.
1421
+ * @returns {boolean} True if the path is ignored, false if not.
1422
+ * @deprecated Use `isFileIgnored` instead.
1423
+ */
1424
+ isIgnored(filePath) {
1425
+ return this.isFileIgnored(filePath);
1426
+ }
1427
+
1428
+ /**
1429
+ * Determines if the given filepath is ignored based on the configs.
1430
+ * @param {string} filePath The path of a file to check.
1431
+ * @returns {boolean} True if the path is ignored, false if not.
1432
+ */
1433
+ isFileIgnored(filePath) {
1434
+ return this.getConfigStatus(filePath) === "ignored";
1435
+ }
1436
+
1437
+ /**
1438
+ * Determines if the given directory is ignored based on the configs.
1439
+ * This checks only default `ignores` that don't have `files` in the
1440
+ * same config. A pattern such as `/foo` be considered to ignore the directory
1441
+ * while a pattern such as `/foo/**` is not considered to ignore the
1442
+ * directory because it is matching files.
1443
+ * @param {string} directoryPath The path of a directory to check.
1444
+ * @returns {boolean} True if the directory is ignored, false if not. Will
1445
+ * return true for any directory that is not inside of `basePath`.
1446
+ * @throws {Error} When the `ConfigArray` is not normalized.
1447
+ */
1448
+ isDirectoryIgnored(directoryPath) {
1449
+ assertNormalized(this);
1450
+
1451
+ const relativeDirectoryPath = toRelativePath(
1452
+ directoryPath,
1453
+ this.#namespacedBasePath,
1454
+ this.#path,
1455
+ );
1456
+
1457
+ // basePath directory can never be ignored
1458
+ if (relativeDirectoryPath === "") {
1459
+ return false;
1460
+ }
1461
+
1462
+ if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) {
1463
+ return true;
1464
+ }
1465
+
1466
+ // first check the cache
1467
+ const cache = dataCache.get(this).directoryMatches;
1468
+
1469
+ if (cache.has(relativeDirectoryPath)) {
1470
+ return cache.get(relativeDirectoryPath);
1471
+ }
1472
+
1473
+ const directoryParts = relativeDirectoryPath.split("/");
1474
+ let relativeDirectoryToCheck = "";
1475
+ let result;
1476
+
1477
+ /*
1478
+ * In order to get the correct gitignore-style ignores, where an
1479
+ * ignored parent directory cannot have any descendants unignored,
1480
+ * we need to check every directory starting at the parent all
1481
+ * the way down to the actual requested directory.
1482
+ *
1483
+ * We aggressively cache all of this info to make sure we don't
1484
+ * have to recalculate everything for every call.
1485
+ */
1486
+ do {
1487
+ relativeDirectoryToCheck += `${directoryParts.shift()}/`;
1488
+
1489
+ result = shouldIgnorePath(
1490
+ this.ignores,
1491
+ this.#path.join(this.basePath, relativeDirectoryToCheck),
1492
+ relativeDirectoryToCheck,
1493
+ {
1494
+ basePath: this.#namespacedBasePath,
1495
+ path: this.#path,
1496
+ },
1497
+ );
1498
+
1499
+ cache.set(relativeDirectoryToCheck, result);
1500
+ } while (!result && directoryParts.length);
1501
+
1502
+ // also cache the result for the requested path
1503
+ cache.set(relativeDirectoryPath, result);
1504
+
1505
+ return result;
1506
+ }
1507
+ }
1508
+
1509
+ export { ConfigArray, ConfigArraySymbol };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/std__path/posix.js ADDED
@@ -0,0 +1,1313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // Copyright the Browserify authors. MIT License.
3
+ function assertPath(path) {
4
+ if (typeof path !== "string") {
5
+ throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
6
+ }
7
+ }
8
+
9
+ // Copyright 2018-2025 the Deno authors. MIT license.
10
+ // This module is browser compatible.
11
+ function stripSuffix(name, suffix) {
12
+ if (suffix.length >= name.length) {
13
+ return name;
14
+ }
15
+ const lenDiff = name.length - suffix.length;
16
+ for(let i = suffix.length - 1; i >= 0; --i){
17
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
18
+ return name;
19
+ }
20
+ }
21
+ return name.slice(0, -suffix.length);
22
+ }
23
+ function lastPathSegment(path, isSep, start = 0) {
24
+ let matchedNonSeparator = false;
25
+ let end = path.length;
26
+ for(let i = path.length - 1; i >= start; --i){
27
+ if (isSep(path.charCodeAt(i))) {
28
+ if (matchedNonSeparator) {
29
+ start = i + 1;
30
+ break;
31
+ }
32
+ } else if (!matchedNonSeparator) {
33
+ matchedNonSeparator = true;
34
+ end = i + 1;
35
+ }
36
+ }
37
+ return path.slice(start, end);
38
+ }
39
+ function assertArgs$1(path, suffix) {
40
+ assertPath(path);
41
+ if (path.length === 0) return path;
42
+ if (typeof suffix !== "string") {
43
+ throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
44
+ }
45
+ }
46
+
47
+ // Copyright 2018-2025 the Deno authors. MIT license.
48
+ // This module is browser compatible.
49
+ function assertArg$3(url) {
50
+ url = url instanceof URL ? url : new URL(url);
51
+ if (url.protocol !== "file:") {
52
+ throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
53
+ }
54
+ return url;
55
+ }
56
+
57
+ // Copyright 2018-2025 the Deno authors. MIT license.
58
+ // This module is browser compatible.
59
+ /**
60
+ * Converts a file URL to a path string.
61
+ *
62
+ * @example Usage
63
+ * ```ts
64
+ * import { fromFileUrl } from "@std/path/posix/from-file-url";
65
+ * import { assertEquals } from "@std/assert";
66
+ *
67
+ * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
68
+ * ```
69
+ *
70
+ * @param url The file URL to convert.
71
+ * @returns The path string.
72
+ */ function fromFileUrl(url) {
73
+ url = assertArg$3(url);
74
+ return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
75
+ }
76
+
77
+ // Copyright 2018-2025 the Deno authors. MIT license.
78
+ // Copyright the Browserify authors. MIT License.
79
+ // Ported from https://github.com/browserify/path-browserify/
80
+ // This module is browser compatible.
81
+ function stripTrailingSeparators(segment, isSep) {
82
+ if (segment.length <= 1) {
83
+ return segment;
84
+ }
85
+ let end = segment.length;
86
+ for(let i = segment.length - 1; i > 0; i--){
87
+ if (isSep(segment.charCodeAt(i))) {
88
+ end = i;
89
+ } else {
90
+ break;
91
+ }
92
+ }
93
+ return segment.slice(0, end);
94
+ }
95
+
96
+ // Copyright 2018-2025 the Deno authors. MIT license.
97
+ // Copyright the Browserify authors. MIT License.
98
+ // Ported from https://github.com/browserify/path-browserify/
99
+ // This module is browser compatible.
100
+ // Alphabet chars.
101
+ // Non-alphabetic chars.
102
+ const CHAR_DOT = 46; /* . */
103
+ const CHAR_FORWARD_SLASH = 47; /* / */
104
+
105
+ // Copyright 2018-2025 the Deno authors. MIT license.
106
+ // Copyright the Browserify authors. MIT License.
107
+ // Ported from https://github.com/browserify/path-browserify/
108
+ // This module is browser compatible.
109
+ function isPosixPathSeparator(code) {
110
+ return code === CHAR_FORWARD_SLASH;
111
+ }
112
+
113
+ // Copyright 2018-2025 the Deno authors. MIT license.
114
+ // This module is browser compatible.
115
+ /**
116
+ * Return the last portion of a `path`.
117
+ * Trailing directory separators are ignored, and optional suffix is removed.
118
+ *
119
+ * @example Usage
120
+ * ```ts
121
+ * import { basename } from "@std/path/posix/basename";
122
+ * import { assertEquals } from "@std/assert";
123
+ *
124
+ * assertEquals(basename("/home/user/Documents/"), "Documents");
125
+ * assertEquals(basename("/home/user/Documents/image.png"), "image.png");
126
+ * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image");
127
+ * assertEquals(basename(new URL("file:///home/user/Documents/image.png")), "image.png");
128
+ * assertEquals(basename(new URL("file:///home/user/Documents/image.png"), ".png"), "image");
129
+ * ```
130
+ *
131
+ * @example Working with URLs
132
+ *
133
+ * Note: This function doesn't automatically strip hash and query parts from
134
+ * URLs. If your URL contains a hash or query, remove them before passing the
135
+ * URL to the function. This can be done by passing the URL to `new URL(url)`,
136
+ * and setting the `hash` and `search` properties to empty strings.
137
+ *
138
+ * ```ts
139
+ * import { basename } from "@std/path/posix/basename";
140
+ * import { assertEquals } from "@std/assert";
141
+ *
142
+ * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts");
143
+ * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod");
144
+ * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b");
145
+ * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header");
146
+ * ```
147
+ *
148
+ * @param path The path to extract the name from.
149
+ * @param suffix The suffix to remove from extracted name.
150
+ * @returns The extracted name.
151
+ */ function basename(path, suffix = "") {
152
+ if (path instanceof URL) {
153
+ path = fromFileUrl(path);
154
+ }
155
+ assertArgs$1(path, suffix);
156
+ const lastSegment = lastPathSegment(path, isPosixPathSeparator);
157
+ const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
158
+ return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
159
+ }
160
+
161
+ // Copyright 2018-2025 the Deno authors. MIT license.
162
+ // This module is browser compatible.
163
+ /**
164
+ * The character used to separate entries in the PATH environment variable.
165
+ */ const DELIMITER = ":";
166
+ /**
167
+ * The character used to separate components of a file path.
168
+ */ const SEPARATOR = "/";
169
+ /**
170
+ * A regular expression that matches one or more path separators.
171
+ */ const SEPARATOR_PATTERN = /\/+/;
172
+
173
+ // Copyright 2018-2025 the Deno authors. MIT license.
174
+ // This module is browser compatible.
175
+ function assertArg$2(path) {
176
+ assertPath(path);
177
+ if (path.length === 0) return ".";
178
+ }
179
+
180
+ // Copyright 2018-2025 the Deno authors. MIT license.
181
+ // This module is browser compatible.
182
+ /**
183
+ * Return the directory path of a `path`.
184
+ *
185
+ * @example Usage
186
+ * ```ts
187
+ * import { dirname } from "@std/path/posix/dirname";
188
+ * import { assertEquals } from "@std/assert";
189
+ *
190
+ * assertEquals(dirname("/home/user/Documents/"), "/home/user");
191
+ * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents");
192
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
193
+ * assertEquals(dirname(new URL("file:///home/user/Documents/image.png")), "/home/user/Documents");
194
+ * ```
195
+ *
196
+ * @example Working with URLs
197
+ *
198
+ * ```ts
199
+ * import { dirname } from "@std/path/posix/dirname";
200
+ * import { assertEquals } from "@std/assert";
201
+ *
202
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
203
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path");
204
+ * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path");
205
+ * ```
206
+ *
207
+ * @param path The path to get the directory from.
208
+ * @returns The directory path.
209
+ */ function dirname(path) {
210
+ if (path instanceof URL) {
211
+ path = fromFileUrl(path);
212
+ }
213
+ assertArg$2(path);
214
+ let end = -1;
215
+ let matchedNonSeparator = false;
216
+ for(let i = path.length - 1; i >= 1; --i){
217
+ if (isPosixPathSeparator(path.charCodeAt(i))) {
218
+ if (matchedNonSeparator) {
219
+ end = i;
220
+ break;
221
+ }
222
+ } else {
223
+ matchedNonSeparator = true;
224
+ }
225
+ }
226
+ // No matches. Fallback based on provided path:
227
+ //
228
+ // - leading slashes paths
229
+ // "/foo" => "/"
230
+ // "///foo" => "/"
231
+ // - no slash path
232
+ // "foo" => "."
233
+ if (end === -1) {
234
+ return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
235
+ }
236
+ return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
237
+ }
238
+
239
+ // Copyright 2018-2025 the Deno authors. MIT license.
240
+ // This module is browser compatible.
241
+ /**
242
+ * Return the extension of the `path` with leading period.
243
+ *
244
+ * @example Usage
245
+ * ```ts
246
+ * import { extname } from "@std/path/posix/extname";
247
+ * import { assertEquals } from "@std/assert";
248
+ *
249
+ * assertEquals(extname("/home/user/Documents/file.ts"), ".ts");
250
+ * assertEquals(extname("/home/user/Documents/"), "");
251
+ * assertEquals(extname("/home/user/Documents/image.png"), ".png");
252
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts")), ".ts");
253
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts?a=b")), ".ts");
254
+ * assertEquals(extname(new URL("file:///home/user/Documents/file.ts#header")), ".ts");
255
+ * ```
256
+ *
257
+ * @example Working with URLs
258
+ *
259
+ * Note: This function doesn't automatically strip hash and query parts from
260
+ * URLs. If your URL contains a hash or query, remove them before passing the
261
+ * URL to the function. This can be done by passing the URL to `new URL(url)`,
262
+ * and setting the `hash` and `search` properties to empty strings.
263
+ *
264
+ * ```ts
265
+ * import { extname } from "@std/path/posix/extname";
266
+ * import { assertEquals } from "@std/assert";
267
+ *
268
+ * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts");
269
+ * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b");
270
+ * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header");
271
+ * ```
272
+ *
273
+ * @param path The path to get the extension from.
274
+ * @returns The extension (ex. for `file.ts` returns `.ts`).
275
+ */ function extname(path) {
276
+ if (path instanceof URL) {
277
+ path = fromFileUrl(path);
278
+ }
279
+ assertPath(path);
280
+ let startDot = -1;
281
+ let startPart = 0;
282
+ let end = -1;
283
+ let matchedSlash = true;
284
+ // Track the state of characters (if any) we see before our first dot and
285
+ // after any path separator we find
286
+ let preDotState = 0;
287
+ for(let i = path.length - 1; i >= 0; --i){
288
+ const code = path.charCodeAt(i);
289
+ if (isPosixPathSeparator(code)) {
290
+ // If we reached a path separator that was not part of a set of path
291
+ // separators at the end of the string, stop now
292
+ if (!matchedSlash) {
293
+ startPart = i + 1;
294
+ break;
295
+ }
296
+ continue;
297
+ }
298
+ if (end === -1) {
299
+ // We saw the first non-path separator, mark this as the end of our
300
+ // extension
301
+ matchedSlash = false;
302
+ end = i + 1;
303
+ }
304
+ if (code === CHAR_DOT) {
305
+ // If this is our first dot, mark it as the start of our extension
306
+ if (startDot === -1) startDot = i;
307
+ else if (preDotState !== 1) preDotState = 1;
308
+ } else if (startDot !== -1) {
309
+ // We saw a non-dot and non-path separator before our dot, so we should
310
+ // have a good chance at having a non-empty extension
311
+ preDotState = -1;
312
+ }
313
+ }
314
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
315
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
316
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
317
+ return "";
318
+ }
319
+ return path.slice(startDot, end);
320
+ }
321
+
322
+ // Copyright 2018-2025 the Deno authors. MIT license.
323
+ // This module is browser compatible.
324
+ function _format(sep, pathObject) {
325
+ const dir = pathObject.dir || pathObject.root;
326
+ const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
327
+ if (!dir) return base;
328
+ if (base === sep) return dir;
329
+ if (dir === pathObject.root) return dir + base;
330
+ return dir + sep + base;
331
+ }
332
+ function assertArg$1(pathObject) {
333
+ if (pathObject === null || typeof pathObject !== "object") {
334
+ throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
335
+ }
336
+ }
337
+
338
+ // Copyright 2018-2025 the Deno authors. MIT license.
339
+ // This module is browser compatible.
340
+ /**
341
+ * Generate a path from `ParsedPath` object.
342
+ *
343
+ * @example Usage
344
+ * ```ts
345
+ * import { format } from "@std/path/posix/format";
346
+ * import { assertEquals } from "@std/assert";
347
+ *
348
+ * const path = format({
349
+ * root: "/",
350
+ * dir: "/path/dir",
351
+ * base: "file.txt",
352
+ * ext: ".txt",
353
+ * name: "file"
354
+ * });
355
+ * assertEquals(path, "/path/dir/file.txt");
356
+ * ```
357
+ *
358
+ * @param pathObject The path object to format.
359
+ * @returns The formatted path.
360
+ */ function format(pathObject) {
361
+ assertArg$1(pathObject);
362
+ return _format("/", pathObject);
363
+ }
364
+
365
+ // Copyright 2018-2025 the Deno authors. MIT license.
366
+ // This module is browser compatible.
367
+ /**
368
+ * Verifies whether provided path is absolute.
369
+ *
370
+ * @example Usage
371
+ * ```ts
372
+ * import { isAbsolute } from "@std/path/posix/is-absolute";
373
+ * import { assert, assertFalse } from "@std/assert";
374
+ *
375
+ * assert(isAbsolute("/home/user/Documents/"));
376
+ * assertFalse(isAbsolute("home/user/Documents/"));
377
+ * ```
378
+ *
379
+ * @param path The path to verify.
380
+ * @returns Whether the path is absolute.
381
+ */ function isAbsolute(path) {
382
+ assertPath(path);
383
+ return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
384
+ }
385
+
386
+ // Copyright 2018-2025 the Deno authors. MIT license.
387
+ // This module is browser compatible.
388
+ function assertArg(path) {
389
+ assertPath(path);
390
+ if (path.length === 0) return ".";
391
+ }
392
+
393
+ // Copyright 2018-2025 the Deno authors. MIT license.
394
+ // Copyright the Browserify authors. MIT License.
395
+ // Ported from https://github.com/browserify/path-browserify/
396
+ // This module is browser compatible.
397
+ // Resolves . and .. elements in a path with directory names
398
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
399
+ let res = "";
400
+ let lastSegmentLength = 0;
401
+ let lastSlash = -1;
402
+ let dots = 0;
403
+ let code;
404
+ for(let i = 0; i <= path.length; ++i){
405
+ if (i < path.length) code = path.charCodeAt(i);
406
+ else if (isPathSeparator(code)) break;
407
+ else code = CHAR_FORWARD_SLASH;
408
+ if (isPathSeparator(code)) {
409
+ if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
410
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
411
+ if (res.length > 2) {
412
+ const lastSlashIndex = res.lastIndexOf(separator);
413
+ if (lastSlashIndex === -1) {
414
+ res = "";
415
+ lastSegmentLength = 0;
416
+ } else {
417
+ res = res.slice(0, lastSlashIndex);
418
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
419
+ }
420
+ lastSlash = i;
421
+ dots = 0;
422
+ continue;
423
+ } else if (res.length === 2 || res.length === 1) {
424
+ res = "";
425
+ lastSegmentLength = 0;
426
+ lastSlash = i;
427
+ dots = 0;
428
+ continue;
429
+ }
430
+ }
431
+ if (allowAboveRoot) {
432
+ if (res.length > 0) res += `${separator}..`;
433
+ else res = "..";
434
+ lastSegmentLength = 2;
435
+ }
436
+ } else {
437
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
438
+ else res = path.slice(lastSlash + 1, i);
439
+ lastSegmentLength = i - lastSlash - 1;
440
+ }
441
+ lastSlash = i;
442
+ dots = 0;
443
+ } else if (code === CHAR_DOT && dots !== -1) {
444
+ ++dots;
445
+ } else {
446
+ dots = -1;
447
+ }
448
+ }
449
+ return res;
450
+ }
451
+
452
+ // Copyright 2018-2025 the Deno authors. MIT license.
453
+ // This module is browser compatible.
454
+ /**
455
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
456
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
457
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
458
+ *
459
+ * @example Usage
460
+ * ```ts
461
+ * import { normalize } from "@std/path/posix/normalize";
462
+ * import { assertEquals } from "@std/assert";
463
+ *
464
+ * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
465
+ * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
466
+ * ```
467
+ *
468
+ * @example Working with URLs
469
+ *
470
+ * Note: This function will remove the double slashes from a URL's scheme.
471
+ * Hence, do not pass a full URL to this function. Instead, pass the pathname of
472
+ * the URL.
473
+ *
474
+ * ```ts
475
+ * import { normalize } from "@std/path/posix/normalize";
476
+ * import { assertEquals } from "@std/assert";
477
+ *
478
+ * const url = new URL("https://deno.land");
479
+ * url.pathname = normalize("//std//assert//.//mod.ts");
480
+ * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
481
+ *
482
+ * url.pathname = normalize("std/assert/../async/retry.ts");
483
+ * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
484
+ * ```
485
+ *
486
+ * @param path The path to normalize.
487
+ * @returns The normalized path.
488
+ */ function normalize(path) {
489
+ if (path instanceof URL) {
490
+ path = fromFileUrl(path);
491
+ }
492
+ assertArg(path);
493
+ const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
494
+ const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
495
+ // Normalize the path
496
+ path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
497
+ if (path.length === 0 && !isAbsolute) path = ".";
498
+ if (path.length > 0 && trailingSeparator) path += "/";
499
+ if (isAbsolute) return `/${path}`;
500
+ return path;
501
+ }
502
+
503
+ // Copyright 2018-2025 the Deno authors. MIT license.
504
+ // This module is browser compatible.
505
+ /**
506
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
507
+ *
508
+ * @example Usage
509
+ * ```ts
510
+ * import { join } from "@std/path/posix/join";
511
+ * import { assertEquals } from "@std/assert";
512
+ *
513
+ * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
514
+ * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
515
+ * ```
516
+ *
517
+ * @example Working with URLs
518
+ * ```ts
519
+ * import { join } from "@std/path/posix/join";
520
+ * import { assertEquals } from "@std/assert";
521
+ *
522
+ * const url = new URL("https://deno.land");
523
+ * url.pathname = join("std", "path", "mod.ts");
524
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
525
+ *
526
+ * url.pathname = join("//std", "path/", "/mod.ts");
527
+ * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
528
+ * ```
529
+ *
530
+ * @param path The path to join. This can be string or file URL.
531
+ * @param paths The paths to join.
532
+ * @returns The joined path.
533
+ */ function join(path, ...paths) {
534
+ if (path === undefined) return ".";
535
+ if (path instanceof URL) {
536
+ path = fromFileUrl(path);
537
+ }
538
+ paths = path ? [
539
+ path,
540
+ ...paths
541
+ ] : paths;
542
+ paths.forEach((path)=>assertPath(path));
543
+ const joined = paths.filter((path)=>path.length > 0).join("/");
544
+ return joined === "" ? "." : normalize(joined);
545
+ }
546
+
547
+ // Copyright 2018-2025 the Deno authors. MIT license.
548
+ // This module is browser compatible.
549
+ /**
550
+ * Return a `ParsedPath` object of the `path`.
551
+ *
552
+ * @example Usage
553
+ * ```ts
554
+ * import { parse } from "@std/path/posix/parse";
555
+ * import { assertEquals } from "@std/assert";
556
+ *
557
+ * const path = parse("/home/user/file.txt");
558
+ * assertEquals(path, {
559
+ * root: "/",
560
+ * dir: "/home/user",
561
+ * base: "file.txt",
562
+ * ext: ".txt",
563
+ * name: "file"
564
+ * });
565
+ * ```
566
+ *
567
+ * @param path The path to parse.
568
+ * @returns The parsed path object.
569
+ */ function parse(path) {
570
+ assertPath(path);
571
+ const ret = {
572
+ root: "",
573
+ dir: "",
574
+ base: "",
575
+ ext: "",
576
+ name: ""
577
+ };
578
+ if (path.length === 0) return ret;
579
+ const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
580
+ let start;
581
+ if (isAbsolute) {
582
+ ret.root = "/";
583
+ start = 1;
584
+ } else {
585
+ start = 0;
586
+ }
587
+ let startDot = -1;
588
+ let startPart = 0;
589
+ let end = -1;
590
+ let matchedSlash = true;
591
+ let i = path.length - 1;
592
+ // Track the state of characters (if any) we see before our first dot and
593
+ // after any path separator we find
594
+ let preDotState = 0;
595
+ // Get non-dir info
596
+ for(; i >= start; --i){
597
+ const code = path.charCodeAt(i);
598
+ if (isPosixPathSeparator(code)) {
599
+ // If we reached a path separator that was not part of a set of path
600
+ // separators at the end of the string, stop now
601
+ if (!matchedSlash) {
602
+ startPart = i + 1;
603
+ break;
604
+ }
605
+ continue;
606
+ }
607
+ if (end === -1) {
608
+ // We saw the first non-path separator, mark this as the end of our
609
+ // extension
610
+ matchedSlash = false;
611
+ end = i + 1;
612
+ }
613
+ if (code === CHAR_DOT) {
614
+ // If this is our first dot, mark it as the start of our extension
615
+ if (startDot === -1) startDot = i;
616
+ else if (preDotState !== 1) preDotState = 1;
617
+ } else if (startDot !== -1) {
618
+ // We saw a non-dot and non-path separator before our dot, so we should
619
+ // have a good chance at having a non-empty extension
620
+ preDotState = -1;
621
+ }
622
+ }
623
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
624
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
625
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
626
+ if (end !== -1) {
627
+ if (startPart === 0 && isAbsolute) {
628
+ ret.base = ret.name = path.slice(1, end);
629
+ } else {
630
+ ret.base = ret.name = path.slice(startPart, end);
631
+ }
632
+ }
633
+ // Fallback to '/' in case there is no basename
634
+ ret.base = ret.base || "/";
635
+ } else {
636
+ if (startPart === 0 && isAbsolute) {
637
+ ret.name = path.slice(1, startDot);
638
+ ret.base = path.slice(1, end);
639
+ } else {
640
+ ret.name = path.slice(startPart, startDot);
641
+ ret.base = path.slice(startPart, end);
642
+ }
643
+ ret.ext = path.slice(startDot, end);
644
+ }
645
+ if (startPart > 0) {
646
+ ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
647
+ } else if (isAbsolute) ret.dir = "/";
648
+ return ret;
649
+ }
650
+
651
+ // Copyright 2018-2025 the Deno authors. MIT license.
652
+ // This module is browser compatible.
653
+ /**
654
+ * Resolves path segments into a `path`.
655
+ *
656
+ * @example Usage
657
+ * ```ts
658
+ * import { resolve } from "@std/path/posix/resolve";
659
+ * import { assertEquals } from "@std/assert";
660
+ *
661
+ * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
662
+ * assertEquals(path, "/foo/bar/baz/asdf");
663
+ * ```
664
+ *
665
+ * @param pathSegments The path segments to resolve.
666
+ * @returns The resolved path.
667
+ */ function resolve(...pathSegments) {
668
+ let resolvedPath = "";
669
+ let resolvedAbsolute = false;
670
+ for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){
671
+ let path;
672
+ if (i >= 0) path = pathSegments[i];
673
+ else {
674
+ // deno-lint-ignore no-explicit-any
675
+ const { Deno } = globalThis;
676
+ if (typeof Deno?.cwd !== "function") {
677
+ throw new TypeError("Resolved a relative path without a current working directory (CWD)");
678
+ }
679
+ path = Deno.cwd();
680
+ }
681
+ assertPath(path);
682
+ // Skip empty entries
683
+ if (path.length === 0) {
684
+ continue;
685
+ }
686
+ resolvedPath = `${path}/${resolvedPath}`;
687
+ resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
688
+ }
689
+ // At this point the path should be resolved to a full absolute path, but
690
+ // handle relative paths to be safe (might happen when Deno.cwd() fails)
691
+ // Normalize the path
692
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
693
+ if (resolvedAbsolute) {
694
+ if (resolvedPath.length > 0) return `/${resolvedPath}`;
695
+ else return "/";
696
+ } else if (resolvedPath.length > 0) return resolvedPath;
697
+ else return ".";
698
+ }
699
+
700
+ // Copyright 2018-2025 the Deno authors. MIT license.
701
+ // This module is browser compatible.
702
+ function assertArgs(from, to) {
703
+ assertPath(from);
704
+ assertPath(to);
705
+ if (from === to) return "";
706
+ }
707
+
708
+ // Copyright 2018-2025 the Deno authors. MIT license.
709
+ // This module is browser compatible.
710
+ /**
711
+ * Return the relative path from `from` to `to` based on current working directory.
712
+ *
713
+ * If `from` and `to` are the same, return an empty string.
714
+ *
715
+ * @example Usage
716
+ * ```ts
717
+ * import { relative } from "@std/path/posix/relative";
718
+ * import { assertEquals } from "@std/assert";
719
+ *
720
+ * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
721
+ * assertEquals(path, "../../impl/bbb");
722
+ * ```
723
+ *
724
+ * @param from The path to start from.
725
+ * @param to The path to reach.
726
+ * @returns The relative path.
727
+ */ function relative(from, to) {
728
+ assertArgs(from, to);
729
+ from = resolve(from);
730
+ to = resolve(to);
731
+ if (from === to) return "";
732
+ // Trim any leading backslashes
733
+ let fromStart = 1;
734
+ const fromEnd = from.length;
735
+ for(; fromStart < fromEnd; ++fromStart){
736
+ if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break;
737
+ }
738
+ const fromLen = fromEnd - fromStart;
739
+ // Trim any leading backslashes
740
+ let toStart = 1;
741
+ const toEnd = to.length;
742
+ for(; toStart < toEnd; ++toStart){
743
+ if (!isPosixPathSeparator(to.charCodeAt(toStart))) break;
744
+ }
745
+ const toLen = toEnd - toStart;
746
+ // Compare paths to find the longest common path from root
747
+ const length = fromLen < toLen ? fromLen : toLen;
748
+ let lastCommonSep = -1;
749
+ let i = 0;
750
+ for(; i <= length; ++i){
751
+ if (i === length) {
752
+ if (toLen > length) {
753
+ if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
754
+ // We get here if `from` is the exact base path for `to`.
755
+ // For example: from='/foo/bar'; to='/foo/bar/baz'
756
+ return to.slice(toStart + i + 1);
757
+ } else if (i === 0) {
758
+ // We get here if `from` is the root
759
+ // For example: from='/'; to='/foo'
760
+ return to.slice(toStart + i);
761
+ }
762
+ } else if (fromLen > length) {
763
+ if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
764
+ // We get here if `to` is the exact base path for `from`.
765
+ // For example: from='/foo/bar/baz'; to='/foo/bar'
766
+ lastCommonSep = i;
767
+ } else if (i === 0) {
768
+ // We get here if `to` is the root.
769
+ // For example: from='/foo'; to='/'
770
+ lastCommonSep = 0;
771
+ }
772
+ }
773
+ break;
774
+ }
775
+ const fromCode = from.charCodeAt(fromStart + i);
776
+ const toCode = to.charCodeAt(toStart + i);
777
+ if (fromCode !== toCode) break;
778
+ else if (isPosixPathSeparator(fromCode)) lastCommonSep = i;
779
+ }
780
+ let out = "";
781
+ // Generate the relative path based on the path difference between `to`
782
+ // and `from`
783
+ for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
784
+ if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
785
+ if (out.length === 0) out += "..";
786
+ else out += "/..";
787
+ }
788
+ }
789
+ // Lastly, append the rest of the destination (`to`) path that comes after
790
+ // the common path parts
791
+ if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
792
+ else {
793
+ toStart += lastCommonSep;
794
+ if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart;
795
+ return to.slice(toStart);
796
+ }
797
+ }
798
+
799
+ // Copyright 2018-2025 the Deno authors. MIT license.
800
+ // This module is browser compatible.
801
+ const WHITESPACE_ENCODINGS = {
802
+ "\u0009": "%09",
803
+ "\u000A": "%0A",
804
+ "\u000B": "%0B",
805
+ "\u000C": "%0C",
806
+ "\u000D": "%0D",
807
+ "\u0020": "%20"
808
+ };
809
+ function encodeWhitespace(string) {
810
+ return string.replaceAll(/[\s]/g, (c)=>{
811
+ return WHITESPACE_ENCODINGS[c] ?? c;
812
+ });
813
+ }
814
+
815
+ // Copyright 2018-2025 the Deno authors. MIT license.
816
+ // This module is browser compatible.
817
+ /**
818
+ * Converts a path string to a file URL.
819
+ *
820
+ * @example Usage
821
+ * ```ts
822
+ * import { toFileUrl } from "@std/path/posix/to-file-url";
823
+ * import { assertEquals } from "@std/assert";
824
+ *
825
+ * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
826
+ * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
827
+ * ```
828
+ *
829
+ * @param path The path to convert.
830
+ * @returns The file URL.
831
+ */ function toFileUrl(path) {
832
+ if (!isAbsolute(path)) {
833
+ throw new TypeError(`Path must be absolute: received "${path}"`);
834
+ }
835
+ const url = new URL("file:///");
836
+ url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
837
+ return url;
838
+ }
839
+
840
+ // Copyright 2018-2025 the Deno authors. MIT license.
841
+ // This module is browser compatible.
842
+ /**
843
+ * Converts a path to a namespaced path. This function returns the path as is on posix.
844
+ *
845
+ * @example Usage
846
+ * ```ts
847
+ * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
848
+ * import { assertEquals } from "@std/assert";
849
+ *
850
+ * assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
851
+ * ```
852
+ *
853
+ * @param path The path.
854
+ * @returns The namespaced path.
855
+ */ function toNamespacedPath(path) {
856
+ // Non-op on posix systems
857
+ return path;
858
+ }
859
+
860
+ // Copyright 2018-2025 the Deno authors. MIT license.
861
+ // This module is browser compatible.
862
+ function common$1(paths, sep) {
863
+ const [first = "", ...remaining] = paths;
864
+ const parts = first.split(sep);
865
+ let endOfPrefix = parts.length;
866
+ let append = "";
867
+ for (const path of remaining){
868
+ const compare = path.split(sep);
869
+ if (compare.length <= endOfPrefix) {
870
+ endOfPrefix = compare.length;
871
+ append = "";
872
+ }
873
+ for(let i = 0; i < endOfPrefix; i++){
874
+ if (compare[i] !== parts[i]) {
875
+ endOfPrefix = i;
876
+ append = i === 0 ? "" : sep;
877
+ break;
878
+ }
879
+ }
880
+ }
881
+ return parts.slice(0, endOfPrefix).join(sep) + append;
882
+ }
883
+
884
+ // Copyright 2018-2025 the Deno authors. MIT license.
885
+ // This module is browser compatible.
886
+ /** Determines the common path from a set of paths for POSIX systems.
887
+ *
888
+ * @example Usage
889
+ * ```ts
890
+ * import { common } from "@std/path/posix/common";
891
+ * import { assertEquals } from "@std/assert";
892
+ *
893
+ * const path = common([
894
+ * "./deno/std/path/mod.ts",
895
+ * "./deno/std/fs/mod.ts",
896
+ * ]);
897
+ * assertEquals(path, "./deno/std/");
898
+ * ```
899
+ *
900
+ * @param paths The paths to compare.
901
+ * @returns The common path.
902
+ */ function common(paths) {
903
+ return common$1(paths, SEPARATOR);
904
+ }
905
+
906
+ // Copyright 2018-2025 the Deno authors. MIT license.
907
+ // This module is browser compatible.
908
+ /**
909
+ * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
910
+ * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
911
+ */ const REG_EXP_ESCAPE_CHARS = [
912
+ "!",
913
+ "$",
914
+ "(",
915
+ ")",
916
+ "*",
917
+ "+",
918
+ ".",
919
+ "=",
920
+ "?",
921
+ "[",
922
+ "\\",
923
+ "^",
924
+ "{",
925
+ "|"
926
+ ];
927
+ const RANGE_ESCAPE_CHARS = [
928
+ "-",
929
+ "\\",
930
+ "]"
931
+ ];
932
+ function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
933
+ caseInsensitive = false } = {}) {
934
+ if (glob === "") {
935
+ return /(?!)/;
936
+ }
937
+ // Remove trailing separators.
938
+ let newLength = glob.length;
939
+ for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
940
+ glob = glob.slice(0, newLength);
941
+ let regExpString = "";
942
+ // Terminates correctly. Trust that `j` is incremented every iteration.
943
+ for(let j = 0; j < glob.length;){
944
+ let segment = "";
945
+ const groupStack = [];
946
+ let inRange = false;
947
+ let inEscape = false;
948
+ let endsWithSep = false;
949
+ let i = j;
950
+ // Terminates with `i` at the non-inclusive end of the current segment.
951
+ for(; i < glob.length && !c.seps.includes(glob[i]); i++){
952
+ if (inEscape) {
953
+ inEscape = false;
954
+ const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
955
+ segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
956
+ continue;
957
+ }
958
+ if (glob[i] === c.escapePrefix) {
959
+ inEscape = true;
960
+ continue;
961
+ }
962
+ if (glob[i] === "[") {
963
+ if (!inRange) {
964
+ inRange = true;
965
+ segment += "[";
966
+ if (glob[i + 1] === "!") {
967
+ i++;
968
+ segment += "^";
969
+ } else if (glob[i + 1] === "^") {
970
+ i++;
971
+ segment += "\\^";
972
+ }
973
+ continue;
974
+ } else if (glob[i + 1] === ":") {
975
+ let k = i + 1;
976
+ let value = "";
977
+ while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
978
+ value += glob[k + 1];
979
+ k++;
980
+ }
981
+ if (glob[k + 1] === ":" && glob[k + 2] === "]") {
982
+ i = k + 2;
983
+ if (value === "alnum") segment += "\\dA-Za-z";
984
+ else if (value === "alpha") segment += "A-Za-z";
985
+ else if (value === "ascii") segment += "\x00-\x7F";
986
+ else if (value === "blank") segment += "\t ";
987
+ else if (value === "cntrl") segment += "\x00-\x1F\x7F";
988
+ else if (value === "digit") segment += "\\d";
989
+ else if (value === "graph") segment += "\x21-\x7E";
990
+ else if (value === "lower") segment += "a-z";
991
+ else if (value === "print") segment += "\x20-\x7E";
992
+ else if (value === "punct") {
993
+ segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
994
+ } else if (value === "space") segment += "\\s\v";
995
+ else if (value === "upper") segment += "A-Z";
996
+ else if (value === "word") segment += "\\w";
997
+ else if (value === "xdigit") segment += "\\dA-Fa-f";
998
+ continue;
999
+ }
1000
+ }
1001
+ }
1002
+ if (glob[i] === "]" && inRange) {
1003
+ inRange = false;
1004
+ segment += "]";
1005
+ continue;
1006
+ }
1007
+ if (inRange) {
1008
+ segment += glob[i];
1009
+ continue;
1010
+ }
1011
+ if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1012
+ segment += ")";
1013
+ const type = groupStack.pop();
1014
+ if (type === "!") {
1015
+ segment += c.wildcard;
1016
+ } else if (type !== "@") {
1017
+ segment += type;
1018
+ }
1019
+ continue;
1020
+ }
1021
+ if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1022
+ segment += "|";
1023
+ continue;
1024
+ }
1025
+ if (glob[i] === "+" && extended && glob[i + 1] === "(") {
1026
+ i++;
1027
+ groupStack.push("+");
1028
+ segment += "(?:";
1029
+ continue;
1030
+ }
1031
+ if (glob[i] === "@" && extended && glob[i + 1] === "(") {
1032
+ i++;
1033
+ groupStack.push("@");
1034
+ segment += "(?:";
1035
+ continue;
1036
+ }
1037
+ if (glob[i] === "?") {
1038
+ if (extended && glob[i + 1] === "(") {
1039
+ i++;
1040
+ groupStack.push("?");
1041
+ segment += "(?:";
1042
+ } else {
1043
+ segment += ".";
1044
+ }
1045
+ continue;
1046
+ }
1047
+ if (glob[i] === "!" && extended && glob[i + 1] === "(") {
1048
+ i++;
1049
+ groupStack.push("!");
1050
+ segment += "(?!";
1051
+ continue;
1052
+ }
1053
+ if (glob[i] === "{") {
1054
+ groupStack.push("BRACE");
1055
+ segment += "(?:";
1056
+ continue;
1057
+ }
1058
+ if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
1059
+ groupStack.pop();
1060
+ segment += ")";
1061
+ continue;
1062
+ }
1063
+ if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
1064
+ segment += "|";
1065
+ continue;
1066
+ }
1067
+ if (glob[i] === "*") {
1068
+ if (extended && glob[i + 1] === "(") {
1069
+ i++;
1070
+ groupStack.push("*");
1071
+ segment += "(?:";
1072
+ } else {
1073
+ const prevChar = glob[i - 1];
1074
+ let numStars = 1;
1075
+ while(glob[i + 1] === "*"){
1076
+ i++;
1077
+ numStars++;
1078
+ }
1079
+ const nextChar = glob[i + 1];
1080
+ if (globstarOption && numStars === 2 && [
1081
+ ...c.seps,
1082
+ undefined
1083
+ ].includes(prevChar) && [
1084
+ ...c.seps,
1085
+ undefined
1086
+ ].includes(nextChar)) {
1087
+ segment += c.globstar;
1088
+ endsWithSep = true;
1089
+ } else {
1090
+ segment += c.wildcard;
1091
+ }
1092
+ }
1093
+ continue;
1094
+ }
1095
+ segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1096
+ }
1097
+ // Check for unclosed groups or a dangling backslash.
1098
+ if (groupStack.length > 0 || inRange || inEscape) {
1099
+ // Parse failure. Take all characters from this segment literally.
1100
+ segment = "";
1101
+ for (const c of glob.slice(j, i)){
1102
+ segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
1103
+ endsWithSep = false;
1104
+ }
1105
+ }
1106
+ regExpString += segment;
1107
+ if (!endsWithSep) {
1108
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
1109
+ endsWithSep = true;
1110
+ }
1111
+ // Terminates with `i` at the start of the next segment.
1112
+ while(c.seps.includes(glob[i]))i++;
1113
+ j = i;
1114
+ }
1115
+ regExpString = `^${regExpString}$`;
1116
+ return new RegExp(regExpString, caseInsensitive ? "i" : "");
1117
+ }
1118
+
1119
+ // Copyright 2018-2025 the Deno authors. MIT license.
1120
+ // This module is browser compatible.
1121
+ const constants = {
1122
+ sep: "/+",
1123
+ sepMaybe: "/*",
1124
+ seps: [
1125
+ "/"
1126
+ ],
1127
+ globstar: "(?:[^/]*(?:/|$)+)*",
1128
+ wildcard: "[^/]*",
1129
+ escapePrefix: "\\"
1130
+ };
1131
+ /** Convert a glob string to a regular expression.
1132
+ *
1133
+ * Tries to match bash glob expansion as closely as possible.
1134
+ *
1135
+ * Basic glob syntax:
1136
+ * - `*` - Matches everything without leaving the path segment.
1137
+ * - `?` - Matches any single character.
1138
+ * - `{foo,bar}` - Matches `foo` or `bar`.
1139
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
1140
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
1141
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
1142
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
1143
+ * - `[[:alnum:]]` - Matches any digit or letter.
1144
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
1145
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
1146
+ * for a complete list of supported character classes.
1147
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
1148
+ * - \` - Escapes the next character for `os` set to `"windows"`.
1149
+ * - `/` - Path separator.
1150
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
1151
+ *
1152
+ * Extended syntax:
1153
+ * - Requires `{ extended: true }`.
1154
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
1155
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
1156
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
1157
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
1158
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
1159
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
1160
+ *
1161
+ * Globstar syntax:
1162
+ * - Requires `{ globstar: true }`.
1163
+ * - `**` - Matches any number of any path segments.
1164
+ * - Must comprise its entire path segment in the provided glob.
1165
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
1166
+ *
1167
+ * Note the following properties:
1168
+ * - The generated `RegExp` is anchored at both start and end.
1169
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
1170
+ * provided glob have no meaning and are discarded.
1171
+ * - Absolute globs will only match absolute paths, etc.
1172
+ * - Empty globs will match nothing.
1173
+ * - Any special glob syntax must be contained to one path segment. For example,
1174
+ * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
1175
+ * first segment ends with an unclosed group.
1176
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
1177
+ * parse error has occurred. Every character for that segment is taken
1178
+ * literally in this event.
1179
+ *
1180
+ * Limitations:
1181
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
1182
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
1183
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
1184
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
1185
+ * the group occurs not nested at the end of the segment.
1186
+ *
1187
+ * @example Usage
1188
+ * ```ts
1189
+ * import { globToRegExp } from "@std/path/posix/glob-to-regexp";
1190
+ * import { assertEquals } from "@std/assert";
1191
+ *
1192
+ * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/);
1193
+ * ```
1194
+ *
1195
+ * @param glob Glob string to convert.
1196
+ * @param options Conversion options.
1197
+ * @returns The regular expression equivalent to the glob.
1198
+ */ function globToRegExp(glob, options = {}) {
1199
+ return _globToRegExp(constants, glob, options);
1200
+ }
1201
+
1202
+ // Copyright 2018-2025 the Deno authors. MIT license.
1203
+ // This module is browser compatible.
1204
+ /**
1205
+ * Test whether the given string is a glob.
1206
+ *
1207
+ * @example Usage
1208
+ * ```ts
1209
+ * import { isGlob } from "@std/path/is-glob";
1210
+ * import { assert } from "@std/assert";
1211
+ *
1212
+ * assert(!isGlob("foo/bar/../baz"));
1213
+ * assert(isGlob("foo/*ar/../baz"));
1214
+ * ```
1215
+ *
1216
+ * @param str String to test.
1217
+ * @returns `true` if the given string is a glob, otherwise `false`
1218
+ */ function isGlob(str) {
1219
+ const chars = {
1220
+ "{": "}",
1221
+ "(": ")",
1222
+ "[": "]"
1223
+ };
1224
+ const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
1225
+ if (str === "") {
1226
+ return false;
1227
+ }
1228
+ let match;
1229
+ while(match = regex.exec(str)){
1230
+ if (match[2]) return true;
1231
+ let idx = match.index + match[0].length;
1232
+ // if an open bracket/brace/paren is escaped,
1233
+ // set the index to the next closing character
1234
+ const open = match[1];
1235
+ const close = open ? chars[open] : null;
1236
+ if (open && close) {
1237
+ const n = str.indexOf(close, idx);
1238
+ if (n !== -1) {
1239
+ idx = n + 1;
1240
+ }
1241
+ }
1242
+ str = str.slice(idx);
1243
+ }
1244
+ return false;
1245
+ }
1246
+
1247
+ // Copyright 2018-2025 the Deno authors. MIT license.
1248
+ // This module is browser compatible.
1249
+ /**
1250
+ * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
1251
+ *
1252
+ * @example Usage
1253
+ * ```ts
1254
+ * import { normalizeGlob } from "@std/path/posix/normalize-glob";
1255
+ * import { assertEquals } from "@std/assert";
1256
+ *
1257
+ * const path = normalizeGlob("foo/bar/../*", { globstar: true });
1258
+ * assertEquals(path, "foo/*");
1259
+ * ```
1260
+ *
1261
+ * @param glob The glob to normalize.
1262
+ * @param options The options to use.
1263
+ * @returns The normalized path.
1264
+ */ function normalizeGlob(glob, options = {}) {
1265
+ const { globstar = false } = options;
1266
+ if (glob.match(/\0/g)) {
1267
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
1268
+ }
1269
+ if (!globstar) {
1270
+ return normalize(glob);
1271
+ }
1272
+ const s = SEPARATOR_PATTERN.source;
1273
+ const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
1274
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
1275
+ }
1276
+
1277
+ // Copyright 2018-2025 the Deno authors. MIT license.
1278
+ // This module is browser compatible.
1279
+ /**
1280
+ * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
1281
+ *
1282
+ * @example Usage
1283
+ * ```ts
1284
+ * import { joinGlobs } from "@std/path/posix/join-globs";
1285
+ * import { assertEquals } from "@std/assert";
1286
+ *
1287
+ * const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
1288
+ * assertEquals(path, "foo/bar/**");
1289
+ * ```
1290
+ *
1291
+ * @param globs The globs to join.
1292
+ * @param options The options to use.
1293
+ * @returns The joined path.
1294
+ */ function joinGlobs(globs, options = {}) {
1295
+ const { globstar = false } = options;
1296
+ if (!globstar || globs.length === 0) {
1297
+ return join(...globs);
1298
+ }
1299
+ let joined;
1300
+ for (const glob of globs){
1301
+ const path = glob;
1302
+ if (path.length > 0) {
1303
+ if (!joined) joined = path;
1304
+ else joined += `${SEPARATOR}${path}`;
1305
+ }
1306
+ }
1307
+ if (!joined) return ".";
1308
+ return normalizeGlob(joined, {
1309
+ globstar
1310
+ });
1311
+ }
1312
+
1313
+ export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/std__path/windows.js ADDED
@@ -0,0 +1,1655 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // Copyright the Browserify authors. MIT License.
3
+ function assertPath(path) {
4
+ if (typeof path !== "string") {
5
+ throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
6
+ }
7
+ }
8
+
9
+ // Copyright 2018-2025 the Deno authors. MIT license.
10
+ // This module is browser compatible.
11
+ function stripSuffix(name, suffix) {
12
+ if (suffix.length >= name.length) {
13
+ return name;
14
+ }
15
+ const lenDiff = name.length - suffix.length;
16
+ for(let i = suffix.length - 1; i >= 0; --i){
17
+ if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
18
+ return name;
19
+ }
20
+ }
21
+ return name.slice(0, -suffix.length);
22
+ }
23
+ function lastPathSegment(path, isSep, start = 0) {
24
+ let matchedNonSeparator = false;
25
+ let end = path.length;
26
+ for(let i = path.length - 1; i >= start; --i){
27
+ if (isSep(path.charCodeAt(i))) {
28
+ if (matchedNonSeparator) {
29
+ start = i + 1;
30
+ break;
31
+ }
32
+ } else if (!matchedNonSeparator) {
33
+ matchedNonSeparator = true;
34
+ end = i + 1;
35
+ }
36
+ }
37
+ return path.slice(start, end);
38
+ }
39
+ function assertArgs$1(path, suffix) {
40
+ assertPath(path);
41
+ if (path.length === 0) return path;
42
+ if (typeof suffix !== "string") {
43
+ throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
44
+ }
45
+ }
46
+
47
+ // Copyright 2018-2025 the Deno authors. MIT license.
48
+ // Copyright the Browserify authors. MIT License.
49
+ // Ported from https://github.com/browserify/path-browserify/
50
+ // This module is browser compatible.
51
+ // Alphabet chars.
52
+ const CHAR_UPPERCASE_A = 65; /* A */
53
+ const CHAR_LOWERCASE_A = 97; /* a */
54
+ const CHAR_UPPERCASE_Z = 90; /* Z */
55
+ const CHAR_LOWERCASE_Z = 122; /* z */
56
+ // Non-alphabetic chars.
57
+ const CHAR_DOT = 46; /* . */
58
+ const CHAR_FORWARD_SLASH = 47; /* / */
59
+ const CHAR_BACKWARD_SLASH = 92; /* \ */
60
+ const CHAR_COLON = 58; /* : */
61
+ const CHAR_QUESTION_MARK = 63; /* ? */
62
+
63
+ // Copyright 2018-2025 the Deno authors. MIT license.
64
+ // Copyright the Browserify authors. MIT License.
65
+ // Ported from https://github.com/browserify/path-browserify/
66
+ // This module is browser compatible.
67
+ function stripTrailingSeparators(segment, isSep) {
68
+ if (segment.length <= 1) {
69
+ return segment;
70
+ }
71
+ let end = segment.length;
72
+ for(let i = segment.length - 1; i > 0; i--){
73
+ if (isSep(segment.charCodeAt(i))) {
74
+ end = i;
75
+ } else {
76
+ break;
77
+ }
78
+ }
79
+ return segment.slice(0, end);
80
+ }
81
+
82
+ // Copyright 2018-2025 the Deno authors. MIT license.
83
+ // Copyright the Browserify authors. MIT License.
84
+ // Ported from https://github.com/browserify/path-browserify/
85
+ // This module is browser compatible.
86
+ function isPosixPathSeparator(code) {
87
+ return code === CHAR_FORWARD_SLASH;
88
+ }
89
+ function isPathSeparator(code) {
90
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
91
+ }
92
+ function isWindowsDeviceRoot(code) {
93
+ return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
94
+ }
95
+
96
+ // Copyright 2018-2025 the Deno authors. MIT license.
97
+ // This module is browser compatible.
98
+ function assertArg$3(url) {
99
+ url = url instanceof URL ? url : new URL(url);
100
+ if (url.protocol !== "file:") {
101
+ throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
102
+ }
103
+ return url;
104
+ }
105
+
106
+ // Copyright 2018-2025 the Deno authors. MIT license.
107
+ // This module is browser compatible.
108
+ /**
109
+ * Converts a file URL to a path string.
110
+ *
111
+ * @example Usage
112
+ * ```ts
113
+ * import { fromFileUrl } from "@std/path/windows/from-file-url";
114
+ * import { assertEquals } from "@std/assert";
115
+ *
116
+ * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
117
+ * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
118
+ * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
119
+ * ```
120
+ *
121
+ * @param url The file URL to convert.
122
+ * @returns The path string.
123
+ */ function fromFileUrl(url) {
124
+ url = assertArg$3(url);
125
+ let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
126
+ if (url.hostname !== "") {
127
+ // Note: The `URL` implementation guarantees that the drive letter and
128
+ // hostname are mutually exclusive. Otherwise it would not have been valid
129
+ // to append the hostname and path like this.
130
+ path = `\\\\${url.hostname}${path}`;
131
+ }
132
+ return path;
133
+ }
134
+
135
+ // Copyright 2018-2025 the Deno authors. MIT license.
136
+ // This module is browser compatible.
137
+ /**
138
+ * Return the last portion of a `path`.
139
+ * Trailing directory separators are ignored, and optional suffix is removed.
140
+ *
141
+ * @example Usage
142
+ * ```ts
143
+ * import { basename } from "@std/path/windows/basename";
144
+ * import { assertEquals } from "@std/assert";
145
+ *
146
+ * assertEquals(basename("C:\\user\\Documents\\"), "Documents");
147
+ * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
148
+ * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image");
149
+ * assertEquals(basename(new URL("file:///C:/user/Documents/image.png")), "image.png");
150
+ * assertEquals(basename(new URL("file:///C:/user/Documents/image.png"), ".png"), "image");
151
+ * ```
152
+ *
153
+ * @param path The path to extract the name from.
154
+ * @param suffix The suffix to remove from extracted name.
155
+ * @returns The extracted name.
156
+ */ function basename(path, suffix = "") {
157
+ if (path instanceof URL) {
158
+ path = fromFileUrl(path);
159
+ }
160
+ assertArgs$1(path, suffix);
161
+ // Check for a drive letter prefix so as not to mistake the following
162
+ // path separator as an extra separator at the end of the path that can be
163
+ // disregarded
164
+ let start = 0;
165
+ if (path.length >= 2) {
166
+ const drive = path.charCodeAt(0);
167
+ if (isWindowsDeviceRoot(drive)) {
168
+ if (path.charCodeAt(1) === CHAR_COLON) start = 2;
169
+ }
170
+ }
171
+ const lastSegment = lastPathSegment(path, isPathSeparator, start);
172
+ const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
173
+ return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
174
+ }
175
+
176
+ // Copyright 2018-2025 the Deno authors. MIT license.
177
+ // This module is browser compatible.
178
+ /**
179
+ * The character used to separate entries in the PATH environment variable.
180
+ */ const DELIMITER = ";";
181
+ /**
182
+ * The character used to separate components of a file path.
183
+ */ const SEPARATOR = "\\";
184
+ /**
185
+ * A regular expression that matches one or more path separators.
186
+ */ const SEPARATOR_PATTERN = /[\\/]+/;
187
+
188
+ // Copyright 2018-2025 the Deno authors. MIT license.
189
+ // This module is browser compatible.
190
+ function assertArg$2(path) {
191
+ assertPath(path);
192
+ if (path.length === 0) return ".";
193
+ }
194
+
195
+ // Copyright 2018-2025 the Deno authors. MIT license.
196
+ // This module is browser compatible.
197
+ /**
198
+ * Return the directory path of a `path`.
199
+ *
200
+ * @example Usage
201
+ * ```ts
202
+ * import { dirname } from "@std/path/windows/dirname";
203
+ * import { assertEquals } from "@std/assert";
204
+ *
205
+ * assertEquals(dirname("C:\\foo\\bar\\baz.ext"), "C:\\foo\\bar");
206
+ * assertEquals(dirname(new URL("file:///C:/foo/bar/baz.ext")), "C:\\foo\\bar");
207
+ * ```
208
+ *
209
+ * @param path The path to get the directory from.
210
+ * @returns The directory path.
211
+ */ function dirname(path) {
212
+ if (path instanceof URL) {
213
+ path = fromFileUrl(path);
214
+ }
215
+ assertArg$2(path);
216
+ const len = path.length;
217
+ let rootEnd = -1;
218
+ let end = -1;
219
+ let matchedSlash = true;
220
+ let offset = 0;
221
+ const code = path.charCodeAt(0);
222
+ // Try to match a root
223
+ if (len > 1) {
224
+ if (isPathSeparator(code)) {
225
+ // Possible UNC root
226
+ rootEnd = offset = 1;
227
+ if (isPathSeparator(path.charCodeAt(1))) {
228
+ // Matched double path separator at beginning
229
+ let j = 2;
230
+ let last = j;
231
+ // Match 1 or more non-path separators
232
+ for(; j < len; ++j){
233
+ if (isPathSeparator(path.charCodeAt(j))) break;
234
+ }
235
+ if (j < len && j !== last) {
236
+ // Matched!
237
+ last = j;
238
+ // Match 1 or more path separators
239
+ for(; j < len; ++j){
240
+ if (!isPathSeparator(path.charCodeAt(j))) break;
241
+ }
242
+ if (j < len && j !== last) {
243
+ // Matched!
244
+ last = j;
245
+ // Match 1 or more non-path separators
246
+ for(; j < len; ++j){
247
+ if (isPathSeparator(path.charCodeAt(j))) break;
248
+ }
249
+ if (j === len) {
250
+ // We matched a UNC root only
251
+ return path;
252
+ }
253
+ if (j !== last) {
254
+ // We matched a UNC root with leftovers
255
+ // Offset by 1 to include the separator after the UNC root to
256
+ // treat it as a "normal root" on top of a (UNC) root
257
+ rootEnd = offset = j + 1;
258
+ }
259
+ }
260
+ }
261
+ }
262
+ } else if (isWindowsDeviceRoot(code)) {
263
+ // Possible device root
264
+ if (path.charCodeAt(1) === CHAR_COLON) {
265
+ rootEnd = offset = 2;
266
+ if (len > 2) {
267
+ if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
268
+ }
269
+ }
270
+ }
271
+ } else if (isPathSeparator(code)) {
272
+ // `path` contains just a path separator, exit early to avoid
273
+ // unnecessary work
274
+ return path;
275
+ }
276
+ for(let i = len - 1; i >= offset; --i){
277
+ if (isPathSeparator(path.charCodeAt(i))) {
278
+ if (!matchedSlash) {
279
+ end = i;
280
+ break;
281
+ }
282
+ } else {
283
+ // We saw the first non-path separator
284
+ matchedSlash = false;
285
+ }
286
+ }
287
+ if (end === -1) {
288
+ if (rootEnd === -1) return ".";
289
+ else end = rootEnd;
290
+ }
291
+ return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
292
+ }
293
+
294
+ // Copyright 2018-2025 the Deno authors. MIT license.
295
+ // This module is browser compatible.
296
+ /**
297
+ * Return the extension of the `path` with leading period.
298
+ *
299
+ * @example Usage
300
+ * ```ts
301
+ * import { extname } from "@std/path/windows/extname";
302
+ * import { assertEquals } from "@std/assert";
303
+ *
304
+ * assertEquals(extname("file.ts"), ".ts");
305
+ * assertEquals(extname(new URL("file:///C:/foo/bar/baz.ext")), ".ext");
306
+ * ```
307
+ *
308
+ * @param path The path to get the extension from.
309
+ * @returns The extension of the `path`.
310
+ */ function extname(path) {
311
+ if (path instanceof URL) {
312
+ path = fromFileUrl(path);
313
+ }
314
+ assertPath(path);
315
+ let start = 0;
316
+ let startDot = -1;
317
+ let startPart = 0;
318
+ let end = -1;
319
+ let matchedSlash = true;
320
+ // Track the state of characters (if any) we see before our first dot and
321
+ // after any path separator we find
322
+ let preDotState = 0;
323
+ // Check for a drive letter prefix so as not to mistake the following
324
+ // path separator as an extra separator at the end of the path that can be
325
+ // disregarded
326
+ if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
327
+ start = startPart = 2;
328
+ }
329
+ for(let i = path.length - 1; i >= start; --i){
330
+ const code = path.charCodeAt(i);
331
+ if (isPathSeparator(code)) {
332
+ // If we reached a path separator that was not part of a set of path
333
+ // separators at the end of the string, stop now
334
+ if (!matchedSlash) {
335
+ startPart = i + 1;
336
+ break;
337
+ }
338
+ continue;
339
+ }
340
+ if (end === -1) {
341
+ // We saw the first non-path separator, mark this as the end of our
342
+ // extension
343
+ matchedSlash = false;
344
+ end = i + 1;
345
+ }
346
+ if (code === CHAR_DOT) {
347
+ // If this is our first dot, mark it as the start of our extension
348
+ if (startDot === -1) startDot = i;
349
+ else if (preDotState !== 1) preDotState = 1;
350
+ } else if (startDot !== -1) {
351
+ // We saw a non-dot and non-path separator before our dot, so we should
352
+ // have a good chance at having a non-empty extension
353
+ preDotState = -1;
354
+ }
355
+ }
356
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
357
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
358
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
359
+ return "";
360
+ }
361
+ return path.slice(startDot, end);
362
+ }
363
+
364
+ // Copyright 2018-2025 the Deno authors. MIT license.
365
+ // This module is browser compatible.
366
+ function _format(sep, pathObject) {
367
+ const dir = pathObject.dir || pathObject.root;
368
+ const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
369
+ if (!dir) return base;
370
+ if (base === sep) return dir;
371
+ if (dir === pathObject.root) return dir + base;
372
+ return dir + sep + base;
373
+ }
374
+ function assertArg$1(pathObject) {
375
+ if (pathObject === null || typeof pathObject !== "object") {
376
+ throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
377
+ }
378
+ }
379
+
380
+ // Copyright 2018-2025 the Deno authors. MIT license.
381
+ // This module is browser compatible.
382
+ /**
383
+ * Generate a path from `ParsedPath` object.
384
+ *
385
+ * @example Usage
386
+ * ```ts
387
+ * import { format } from "@std/path/windows/format";
388
+ * import { assertEquals } from "@std/assert";
389
+ *
390
+ * const path = format({
391
+ * root: "C:\\",
392
+ * dir: "C:\\path\\dir",
393
+ * base: "file.txt",
394
+ * ext: ".txt",
395
+ * name: "file"
396
+ * });
397
+ * assertEquals(path, "C:\\path\\dir\\file.txt");
398
+ * ```
399
+ *
400
+ * @param pathObject The path object to format.
401
+ * @returns The formatted path.
402
+ */ function format(pathObject) {
403
+ assertArg$1(pathObject);
404
+ return _format("\\", pathObject);
405
+ }
406
+
407
+ // Copyright 2018-2025 the Deno authors. MIT license.
408
+ // This module is browser compatible.
409
+ /**
410
+ * Verifies whether provided path is absolute.
411
+ *
412
+ * @example Usage
413
+ * ```ts
414
+ * import { isAbsolute } from "@std/path/windows/is-absolute";
415
+ * import { assert, assertFalse } from "@std/assert";
416
+ *
417
+ * assert(isAbsolute("C:\\foo\\bar"));
418
+ * assertFalse(isAbsolute("..\\baz"));
419
+ * ```
420
+ *
421
+ * @param path The path to verify.
422
+ * @returns `true` if the path is absolute, `false` otherwise.
423
+ */ function isAbsolute(path) {
424
+ assertPath(path);
425
+ const len = path.length;
426
+ if (len === 0) return false;
427
+ const code = path.charCodeAt(0);
428
+ if (isPathSeparator(code)) {
429
+ return true;
430
+ } else if (isWindowsDeviceRoot(code)) {
431
+ // Possible device root
432
+ if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
433
+ if (isPathSeparator(path.charCodeAt(2))) return true;
434
+ }
435
+ }
436
+ return false;
437
+ }
438
+
439
+ // Copyright 2018-2025 the Deno authors. MIT license.
440
+ // This module is browser compatible.
441
+ function assertArg(path) {
442
+ assertPath(path);
443
+ if (path.length === 0) return ".";
444
+ }
445
+
446
+ // Copyright 2018-2025 the Deno authors. MIT license.
447
+ // Copyright the Browserify authors. MIT License.
448
+ // Ported from https://github.com/browserify/path-browserify/
449
+ // This module is browser compatible.
450
+ // Resolves . and .. elements in a path with directory names
451
+ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
452
+ let res = "";
453
+ let lastSegmentLength = 0;
454
+ let lastSlash = -1;
455
+ let dots = 0;
456
+ let code;
457
+ for(let i = 0; i <= path.length; ++i){
458
+ if (i < path.length) code = path.charCodeAt(i);
459
+ else if (isPathSeparator(code)) break;
460
+ else code = CHAR_FORWARD_SLASH;
461
+ if (isPathSeparator(code)) {
462
+ if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
463
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
464
+ if (res.length > 2) {
465
+ const lastSlashIndex = res.lastIndexOf(separator);
466
+ if (lastSlashIndex === -1) {
467
+ res = "";
468
+ lastSegmentLength = 0;
469
+ } else {
470
+ res = res.slice(0, lastSlashIndex);
471
+ lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
472
+ }
473
+ lastSlash = i;
474
+ dots = 0;
475
+ continue;
476
+ } else if (res.length === 2 || res.length === 1) {
477
+ res = "";
478
+ lastSegmentLength = 0;
479
+ lastSlash = i;
480
+ dots = 0;
481
+ continue;
482
+ }
483
+ }
484
+ if (allowAboveRoot) {
485
+ if (res.length > 0) res += `${separator}..`;
486
+ else res = "..";
487
+ lastSegmentLength = 2;
488
+ }
489
+ } else {
490
+ if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
491
+ else res = path.slice(lastSlash + 1, i);
492
+ lastSegmentLength = i - lastSlash - 1;
493
+ }
494
+ lastSlash = i;
495
+ dots = 0;
496
+ } else if (code === CHAR_DOT && dots !== -1) {
497
+ ++dots;
498
+ } else {
499
+ dots = -1;
500
+ }
501
+ }
502
+ return res;
503
+ }
504
+
505
+ // Copyright 2018-2025 the Deno authors. MIT license.
506
+ // This module is browser compatible.
507
+ /**
508
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
509
+ * Note that resolving these segments does not necessarily mean that all will be eliminated.
510
+ * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
511
+ *
512
+ * @example Usage
513
+ * ```ts
514
+ * import { normalize } from "@std/path/windows/normalize";
515
+ * import { assertEquals } from "@std/assert";
516
+ *
517
+ * assertEquals(normalize("C:\\foo\\..\\bar"), "C:\\bar");
518
+ * assertEquals(normalize(new URL("file:///C:/foo/../bar")), "C:\\bar");
519
+ * ```
520
+ *
521
+ * @param path The path to normalize
522
+ * @returns The normalized path
523
+ */ function normalize(path) {
524
+ if (path instanceof URL) {
525
+ path = fromFileUrl(path);
526
+ }
527
+ assertArg(path);
528
+ const len = path.length;
529
+ let rootEnd = 0;
530
+ let device;
531
+ let isAbsolute = false;
532
+ const code = path.charCodeAt(0);
533
+ // Try to match a root
534
+ if (len > 1) {
535
+ if (isPathSeparator(code)) {
536
+ // Possible UNC root
537
+ // If we started with a separator, we know we at least have an absolute
538
+ // path of some kind (UNC or otherwise)
539
+ isAbsolute = true;
540
+ if (isPathSeparator(path.charCodeAt(1))) {
541
+ // Matched double path separator at beginning
542
+ let j = 2;
543
+ let last = j;
544
+ // Match 1 or more non-path separators
545
+ for(; j < len; ++j){
546
+ if (isPathSeparator(path.charCodeAt(j))) break;
547
+ }
548
+ if (j < len && j !== last) {
549
+ const firstPart = path.slice(last, j);
550
+ // Matched!
551
+ last = j;
552
+ // Match 1 or more path separators
553
+ for(; j < len; ++j){
554
+ if (!isPathSeparator(path.charCodeAt(j))) break;
555
+ }
556
+ if (j < len && j !== last) {
557
+ // Matched!
558
+ last = j;
559
+ // Match 1 or more non-path separators
560
+ for(; j < len; ++j){
561
+ if (isPathSeparator(path.charCodeAt(j))) break;
562
+ }
563
+ if (j === len) {
564
+ // We matched a UNC root only
565
+ // Return the normalized version of the UNC root since there
566
+ // is nothing left to process
567
+ return `\\\\${firstPart}\\${path.slice(last)}\\`;
568
+ } else if (j !== last) {
569
+ // We matched a UNC root with leftovers
570
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
571
+ rootEnd = j;
572
+ }
573
+ }
574
+ }
575
+ } else {
576
+ rootEnd = 1;
577
+ }
578
+ } else if (isWindowsDeviceRoot(code)) {
579
+ // Possible device root
580
+ if (path.charCodeAt(1) === CHAR_COLON) {
581
+ device = path.slice(0, 2);
582
+ rootEnd = 2;
583
+ if (len > 2) {
584
+ if (isPathSeparator(path.charCodeAt(2))) {
585
+ // Treat separator following drive name as an absolute path
586
+ // indicator
587
+ isAbsolute = true;
588
+ rootEnd = 3;
589
+ }
590
+ }
591
+ }
592
+ }
593
+ } else if (isPathSeparator(code)) {
594
+ // `path` contains just a path separator, exit early to avoid unnecessary
595
+ // work
596
+ return "\\";
597
+ }
598
+ let tail;
599
+ if (rootEnd < len) {
600
+ tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
601
+ } else {
602
+ tail = "";
603
+ }
604
+ if (tail.length === 0 && !isAbsolute) tail = ".";
605
+ if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
606
+ tail += "\\";
607
+ }
608
+ if (device === undefined) {
609
+ if (isAbsolute) {
610
+ if (tail.length > 0) return `\\${tail}`;
611
+ else return "\\";
612
+ }
613
+ return tail;
614
+ } else if (isAbsolute) {
615
+ if (tail.length > 0) return `${device}\\${tail}`;
616
+ else return `${device}\\`;
617
+ }
618
+ return device + tail;
619
+ }
620
+
621
+ // Copyright 2018-2025 the Deno authors. MIT license.
622
+ // This module is browser compatible.
623
+ /**
624
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
625
+ *
626
+ * @example Usage
627
+ * ```ts
628
+ * import { join } from "@std/path/windows/join";
629
+ * import { assertEquals } from "@std/assert";
630
+ *
631
+ * assertEquals(join("C:\\foo", "bar", "baz\\.."), "C:\\foo\\bar");
632
+ * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz\\.."), "C:\\foo\\bar");
633
+ * ```
634
+ *
635
+ * @param path The path to join. This can be string or file URL.
636
+ * @param paths The paths to join.
637
+ * @returns The joined path.
638
+ */ function join(path, ...paths) {
639
+ if (path instanceof URL) {
640
+ path = fromFileUrl(path);
641
+ }
642
+ paths = path ? [
643
+ path,
644
+ ...paths
645
+ ] : paths;
646
+ paths.forEach((path)=>assertPath(path));
647
+ paths = paths.filter((path)=>path.length > 0);
648
+ if (paths.length === 0) return ".";
649
+ // Make sure that the joined path doesn't start with two slashes, because
650
+ // normalize() will mistake it for an UNC path then.
651
+ //
652
+ // This step is skipped when it is very clear that the user actually
653
+ // intended to point at an UNC path. This is assumed when the first
654
+ // non-empty string arguments starts with exactly two slashes followed by
655
+ // at least one more non-slash character.
656
+ //
657
+ // Note that for normalize() to treat a path as an UNC path it needs to
658
+ // have at least 2 components, so we don't filter for that here.
659
+ // This means that the user can use join to construct UNC paths from
660
+ // a server name and a share name; for example:
661
+ // path.join('//server', 'share') -> '\\\\server\\share\\'
662
+ let needsReplace = true;
663
+ let slashCount = 0;
664
+ const firstPart = paths[0];
665
+ if (isPathSeparator(firstPart.charCodeAt(0))) {
666
+ ++slashCount;
667
+ const firstLen = firstPart.length;
668
+ if (firstLen > 1) {
669
+ if (isPathSeparator(firstPart.charCodeAt(1))) {
670
+ ++slashCount;
671
+ if (firstLen > 2) {
672
+ if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
673
+ else {
674
+ // We matched a UNC path in the first part
675
+ needsReplace = false;
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+ let joined = paths.join("\\");
682
+ if (needsReplace) {
683
+ // Find any more consecutive slashes we need to replace
684
+ for(; slashCount < joined.length; ++slashCount){
685
+ if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
686
+ }
687
+ // Replace the slashes if needed
688
+ if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
689
+ }
690
+ return normalize(joined);
691
+ }
692
+
693
+ // Copyright 2018-2025 the Deno authors. MIT license.
694
+ // This module is browser compatible.
695
+ /**
696
+ * Return a `ParsedPath` object of the `path`.
697
+ *
698
+ * @example Usage
699
+ * ```ts
700
+ * import { parse } from "@std/path/windows/parse";
701
+ * import { assertEquals } from "@std/assert";
702
+ *
703
+ * const parsed = parse("C:\\foo\\bar\\baz.ext");
704
+ * assertEquals(parsed, {
705
+ * root: "C:\\",
706
+ * dir: "C:\\foo\\bar",
707
+ * base: "baz.ext",
708
+ * ext: ".ext",
709
+ * name: "baz",
710
+ * });
711
+ * ```
712
+ *
713
+ * @param path The path to parse.
714
+ * @returns The `ParsedPath` object.
715
+ */ function parse(path) {
716
+ assertPath(path);
717
+ const ret = {
718
+ root: "",
719
+ dir: "",
720
+ base: "",
721
+ ext: "",
722
+ name: ""
723
+ };
724
+ const len = path.length;
725
+ if (len === 0) return ret;
726
+ let rootEnd = 0;
727
+ let code = path.charCodeAt(0);
728
+ // Try to match a root
729
+ if (len > 1) {
730
+ if (isPathSeparator(code)) {
731
+ // Possible UNC root
732
+ rootEnd = 1;
733
+ if (isPathSeparator(path.charCodeAt(1))) {
734
+ // Matched double path separator at beginning
735
+ let j = 2;
736
+ let last = j;
737
+ // Match 1 or more non-path separators
738
+ for(; j < len; ++j){
739
+ if (isPathSeparator(path.charCodeAt(j))) break;
740
+ }
741
+ if (j < len && j !== last) {
742
+ // Matched!
743
+ last = j;
744
+ // Match 1 or more path separators
745
+ for(; j < len; ++j){
746
+ if (!isPathSeparator(path.charCodeAt(j))) break;
747
+ }
748
+ if (j < len && j !== last) {
749
+ // Matched!
750
+ last = j;
751
+ // Match 1 or more non-path separators
752
+ for(; j < len; ++j){
753
+ if (isPathSeparator(path.charCodeAt(j))) break;
754
+ }
755
+ if (j === len) {
756
+ // We matched a UNC root only
757
+ rootEnd = j;
758
+ } else if (j !== last) {
759
+ // We matched a UNC root with leftovers
760
+ rootEnd = j + 1;
761
+ }
762
+ }
763
+ }
764
+ }
765
+ } else if (isWindowsDeviceRoot(code)) {
766
+ // Possible device root
767
+ if (path.charCodeAt(1) === CHAR_COLON) {
768
+ rootEnd = 2;
769
+ if (len > 2) {
770
+ if (isPathSeparator(path.charCodeAt(2))) {
771
+ if (len === 3) {
772
+ // `path` contains just a drive root, exit early to avoid
773
+ // unnecessary work
774
+ ret.root = ret.dir = path;
775
+ ret.base = "\\";
776
+ return ret;
777
+ }
778
+ rootEnd = 3;
779
+ }
780
+ } else {
781
+ // `path` contains just a relative drive root, exit early to avoid
782
+ // unnecessary work
783
+ ret.root = ret.dir = path;
784
+ return ret;
785
+ }
786
+ }
787
+ }
788
+ } else if (isPathSeparator(code)) {
789
+ // `path` contains just a path separator, exit early to avoid
790
+ // unnecessary work
791
+ ret.root = ret.dir = path;
792
+ ret.base = "\\";
793
+ return ret;
794
+ }
795
+ if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
796
+ let startDot = -1;
797
+ let startPart = rootEnd;
798
+ let end = -1;
799
+ let matchedSlash = true;
800
+ let i = path.length - 1;
801
+ // Track the state of characters (if any) we see before our first dot and
802
+ // after any path separator we find
803
+ let preDotState = 0;
804
+ // Get non-dir info
805
+ for(; i >= rootEnd; --i){
806
+ code = path.charCodeAt(i);
807
+ if (isPathSeparator(code)) {
808
+ // If we reached a path separator that was not part of a set of path
809
+ // separators at the end of the string, stop now
810
+ if (!matchedSlash) {
811
+ startPart = i + 1;
812
+ break;
813
+ }
814
+ continue;
815
+ }
816
+ if (end === -1) {
817
+ // We saw the first non-path separator, mark this as the end of our
818
+ // extension
819
+ matchedSlash = false;
820
+ end = i + 1;
821
+ }
822
+ if (code === CHAR_DOT) {
823
+ // If this is our first dot, mark it as the start of our extension
824
+ if (startDot === -1) startDot = i;
825
+ else if (preDotState !== 1) preDotState = 1;
826
+ } else if (startDot !== -1) {
827
+ // We saw a non-dot and non-path separator before our dot, so we should
828
+ // have a good chance at having a non-empty extension
829
+ preDotState = -1;
830
+ }
831
+ }
832
+ if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
833
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
834
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
835
+ if (end !== -1) {
836
+ ret.base = ret.name = path.slice(startPart, end);
837
+ }
838
+ } else {
839
+ ret.name = path.slice(startPart, startDot);
840
+ ret.base = path.slice(startPart, end);
841
+ ret.ext = path.slice(startDot, end);
842
+ }
843
+ // Fallback to '\' in case there is no basename
844
+ ret.base = ret.base || "\\";
845
+ // If the directory is the root, use the entire root as the `dir` including
846
+ // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
847
+ // trailing slash (`C:\abc\def` -> `C:\abc`).
848
+ if (startPart > 0 && startPart !== rootEnd) {
849
+ ret.dir = path.slice(0, startPart - 1);
850
+ } else ret.dir = ret.root;
851
+ return ret;
852
+ }
853
+
854
+ // Copyright 2018-2025 the Deno authors. MIT license.
855
+ // This module is browser compatible.
856
+ /**
857
+ * Resolves path segments into a `path`.
858
+ *
859
+ * @example Usage
860
+ * ```ts
861
+ * import { resolve } from "@std/path/windows/resolve";
862
+ * import { assertEquals } from "@std/assert";
863
+ *
864
+ * const resolved = resolve("C:\\foo\\bar", "..\\baz");
865
+ * assertEquals(resolved, "C:\\foo\\baz");
866
+ * ```
867
+ *
868
+ * @param pathSegments The path segments to process to path
869
+ * @returns The resolved path
870
+ */ function resolve(...pathSegments) {
871
+ let resolvedDevice = "";
872
+ let resolvedTail = "";
873
+ let resolvedAbsolute = false;
874
+ for(let i = pathSegments.length - 1; i >= -1; i--){
875
+ let path;
876
+ // deno-lint-ignore no-explicit-any
877
+ const { Deno } = globalThis;
878
+ if (i >= 0) {
879
+ path = pathSegments[i];
880
+ } else if (!resolvedDevice) {
881
+ if (typeof Deno?.cwd !== "function") {
882
+ throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");
883
+ }
884
+ path = Deno.cwd();
885
+ } else {
886
+ if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
887
+ throw new TypeError("Resolved a relative path without a current working directory (CWD)");
888
+ }
889
+ path = Deno.cwd();
890
+ // Verify that a cwd was found and that it actually points
891
+ // to our drive. If not, default to the drive's root.
892
+ if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
893
+ path = `${resolvedDevice}\\`;
894
+ }
895
+ }
896
+ assertPath(path);
897
+ const len = path.length;
898
+ // Skip empty entries
899
+ if (len === 0) continue;
900
+ let rootEnd = 0;
901
+ let device = "";
902
+ let isAbsolute = false;
903
+ const code = path.charCodeAt(0);
904
+ // Try to match a root
905
+ if (len > 1) {
906
+ if (isPathSeparator(code)) {
907
+ // Possible UNC root
908
+ // If we started with a separator, we know we at least have an
909
+ // absolute path of some kind (UNC or otherwise)
910
+ isAbsolute = true;
911
+ if (isPathSeparator(path.charCodeAt(1))) {
912
+ // Matched double path separator at beginning
913
+ let j = 2;
914
+ let last = j;
915
+ // Match 1 or more non-path separators
916
+ for(; j < len; ++j){
917
+ if (isPathSeparator(path.charCodeAt(j))) break;
918
+ }
919
+ if (j < len && j !== last) {
920
+ const firstPart = path.slice(last, j);
921
+ // Matched!
922
+ last = j;
923
+ // Match 1 or more path separators
924
+ for(; j < len; ++j){
925
+ if (!isPathSeparator(path.charCodeAt(j))) break;
926
+ }
927
+ if (j < len && j !== last) {
928
+ // Matched!
929
+ last = j;
930
+ // Match 1 or more non-path separators
931
+ for(; j < len; ++j){
932
+ if (isPathSeparator(path.charCodeAt(j))) break;
933
+ }
934
+ if (j === len) {
935
+ // We matched a UNC root only
936
+ device = `\\\\${firstPart}\\${path.slice(last)}`;
937
+ rootEnd = j;
938
+ } else if (j !== last) {
939
+ // We matched a UNC root with leftovers
940
+ device = `\\\\${firstPart}\\${path.slice(last, j)}`;
941
+ rootEnd = j;
942
+ }
943
+ }
944
+ }
945
+ } else {
946
+ rootEnd = 1;
947
+ }
948
+ } else if (isWindowsDeviceRoot(code)) {
949
+ // Possible device root
950
+ if (path.charCodeAt(1) === CHAR_COLON) {
951
+ device = path.slice(0, 2);
952
+ rootEnd = 2;
953
+ if (len > 2) {
954
+ if (isPathSeparator(path.charCodeAt(2))) {
955
+ // Treat separator following drive name as an absolute path
956
+ // indicator
957
+ isAbsolute = true;
958
+ rootEnd = 3;
959
+ }
960
+ }
961
+ }
962
+ }
963
+ } else if (isPathSeparator(code)) {
964
+ // `path` contains just a path separator
965
+ rootEnd = 1;
966
+ isAbsolute = true;
967
+ }
968
+ if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
969
+ continue;
970
+ }
971
+ if (resolvedDevice.length === 0 && device.length > 0) {
972
+ resolvedDevice = device;
973
+ }
974
+ if (!resolvedAbsolute) {
975
+ resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
976
+ resolvedAbsolute = isAbsolute;
977
+ }
978
+ if (resolvedAbsolute && resolvedDevice.length > 0) break;
979
+ }
980
+ // At this point the path should be resolved to a full absolute path,
981
+ // but handle relative paths to be safe (might happen when Deno.cwd()
982
+ // fails)
983
+ // Normalize the tail path
984
+ resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
985
+ return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
986
+ }
987
+
988
+ // Copyright 2018-2025 the Deno authors. MIT license.
989
+ // This module is browser compatible.
990
+ function assertArgs(from, to) {
991
+ assertPath(from);
992
+ assertPath(to);
993
+ if (from === to) return "";
994
+ }
995
+
996
+ // Copyright 2018-2025 the Deno authors. MIT license.
997
+ // This module is browser compatible.
998
+ /**
999
+ * Return the relative path from `from` to `to` based on current working directory.
1000
+ *
1001
+ * An example in windws, for instance:
1002
+ * from = 'C:\\orandea\\test\\aaa'
1003
+ * to = 'C:\\orandea\\impl\\bbb'
1004
+ * The output of the function should be: '..\\..\\impl\\bbb'
1005
+ *
1006
+ * @example Usage
1007
+ * ```ts
1008
+ * import { relative } from "@std/path/windows/relative";
1009
+ * import { assertEquals } from "@std/assert";
1010
+ *
1011
+ * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
1012
+ * assertEquals(relativePath, "..\\..\\impl\\bbb");
1013
+ * ```
1014
+ *
1015
+ * @param from The path from which to calculate the relative path
1016
+ * @param to The path to which to calculate the relative path
1017
+ * @returns The relative path from `from` to `to`
1018
+ */ function relative(from, to) {
1019
+ assertArgs(from, to);
1020
+ const fromOrig = resolve(from);
1021
+ const toOrig = resolve(to);
1022
+ if (fromOrig === toOrig) return "";
1023
+ from = fromOrig.toLowerCase();
1024
+ to = toOrig.toLowerCase();
1025
+ if (from === to) return "";
1026
+ // Trim any leading backslashes
1027
+ let fromStart = 0;
1028
+ let fromEnd = from.length;
1029
+ for(; fromStart < fromEnd; ++fromStart){
1030
+ if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
1031
+ }
1032
+ // Trim trailing backslashes (applicable to UNC paths only)
1033
+ for(; fromEnd - 1 > fromStart; --fromEnd){
1034
+ if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
1035
+ }
1036
+ const fromLen = fromEnd - fromStart;
1037
+ // Trim any leading backslashes
1038
+ let toStart = 0;
1039
+ let toEnd = to.length;
1040
+ for(; toStart < toEnd; ++toStart){
1041
+ if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
1042
+ }
1043
+ // Trim trailing backslashes (applicable to UNC paths only)
1044
+ for(; toEnd - 1 > toStart; --toEnd){
1045
+ if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
1046
+ }
1047
+ const toLen = toEnd - toStart;
1048
+ // Compare paths to find the longest common path from root
1049
+ const length = fromLen < toLen ? fromLen : toLen;
1050
+ let lastCommonSep = -1;
1051
+ let i = 0;
1052
+ for(; i <= length; ++i){
1053
+ if (i === length) {
1054
+ if (toLen > length) {
1055
+ if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
1056
+ // We get here if `from` is the exact base path for `to`.
1057
+ // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
1058
+ return toOrig.slice(toStart + i + 1);
1059
+ } else if (i === 2) {
1060
+ // We get here if `from` is the device root.
1061
+ // For example: from='C:\\'; to='C:\\foo'
1062
+ return toOrig.slice(toStart + i);
1063
+ }
1064
+ }
1065
+ if (fromLen > length) {
1066
+ if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
1067
+ // We get here if `to` is the exact base path for `from`.
1068
+ // For example: from='C:\\foo\\bar'; to='C:\\foo'
1069
+ lastCommonSep = i;
1070
+ } else if (i === 2) {
1071
+ // We get here if `to` is the device root.
1072
+ // For example: from='C:\\foo\\bar'; to='C:\\'
1073
+ lastCommonSep = 3;
1074
+ }
1075
+ }
1076
+ break;
1077
+ }
1078
+ const fromCode = from.charCodeAt(fromStart + i);
1079
+ const toCode = to.charCodeAt(toStart + i);
1080
+ if (fromCode !== toCode) break;
1081
+ else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
1082
+ }
1083
+ // We found a mismatch before the first common path separator was seen, so
1084
+ // return the original `to`.
1085
+ if (i !== length && lastCommonSep === -1) {
1086
+ return toOrig;
1087
+ }
1088
+ let out = "";
1089
+ if (lastCommonSep === -1) lastCommonSep = 0;
1090
+ // Generate the relative path based on the path difference between `to` and
1091
+ // `from`
1092
+ for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
1093
+ if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
1094
+ if (out.length === 0) out += "..";
1095
+ else out += "\\..";
1096
+ }
1097
+ }
1098
+ // Lastly, append the rest of the destination (`to`) path that comes after
1099
+ // the common path parts
1100
+ if (out.length > 0) {
1101
+ return out + toOrig.slice(toStart + lastCommonSep, toEnd);
1102
+ } else {
1103
+ toStart += lastCommonSep;
1104
+ if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
1105
+ return toOrig.slice(toStart, toEnd);
1106
+ }
1107
+ }
1108
+
1109
+ // Copyright 2018-2025 the Deno authors. MIT license.
1110
+ // This module is browser compatible.
1111
+ const WHITESPACE_ENCODINGS = {
1112
+ "\u0009": "%09",
1113
+ "\u000A": "%0A",
1114
+ "\u000B": "%0B",
1115
+ "\u000C": "%0C",
1116
+ "\u000D": "%0D",
1117
+ "\u0020": "%20"
1118
+ };
1119
+ function encodeWhitespace(string) {
1120
+ return string.replaceAll(/[\s]/g, (c)=>{
1121
+ return WHITESPACE_ENCODINGS[c] ?? c;
1122
+ });
1123
+ }
1124
+
1125
+ // Copyright 2018-2025 the Deno authors. MIT license.
1126
+ // This module is browser compatible.
1127
+ /**
1128
+ * Converts a path string to a file URL.
1129
+ *
1130
+ * @example Usage
1131
+ * ```ts
1132
+ * import { toFileUrl } from "@std/path/windows/to-file-url";
1133
+ * import { assertEquals } from "@std/assert";
1134
+ *
1135
+ * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo"));
1136
+ * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo"));
1137
+ * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo"));
1138
+ * ```
1139
+ * @param path The path to convert.
1140
+ * @returns The file URL.
1141
+ */ function toFileUrl(path) {
1142
+ if (!isAbsolute(path)) {
1143
+ throw new TypeError(`Path must be absolute: received "${path}"`);
1144
+ }
1145
+ const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
1146
+ const url = new URL("file:///");
1147
+ url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
1148
+ if (hostname !== undefined && hostname !== "localhost") {
1149
+ url.hostname = hostname;
1150
+ if (!url.hostname) {
1151
+ throw new TypeError(`Invalid hostname: "${url.hostname}"`);
1152
+ }
1153
+ }
1154
+ return url;
1155
+ }
1156
+
1157
+ // Copyright 2018-2025 the Deno authors. MIT license.
1158
+ // This module is browser compatible.
1159
+ /**
1160
+ * Resolves path to a namespace path
1161
+ *
1162
+ * @example Usage
1163
+ * ```ts
1164
+ * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path";
1165
+ * import { assertEquals } from "@std/assert";
1166
+ *
1167
+ * const namespaced = toNamespacedPath("C:\\foo\\bar");
1168
+ * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar");
1169
+ * ```
1170
+ *
1171
+ * @param path The path to resolve to namespaced path
1172
+ * @returns The resolved namespaced path
1173
+ */ function toNamespacedPath(path) {
1174
+ // Note: this will *probably* throw somewhere.
1175
+ if (typeof path !== "string") return path;
1176
+ if (path.length === 0) return "";
1177
+ const resolvedPath = resolve(path);
1178
+ if (resolvedPath.length >= 3) {
1179
+ if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
1180
+ // Possible UNC root
1181
+ if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
1182
+ const code = resolvedPath.charCodeAt(2);
1183
+ if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
1184
+ // Matched non-long UNC root, convert the path to a long UNC path
1185
+ return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
1186
+ }
1187
+ }
1188
+ } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
1189
+ // Possible device root
1190
+ if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
1191
+ // Matched device root, convert the path to a long UNC path
1192
+ return `\\\\?\\${resolvedPath}`;
1193
+ }
1194
+ }
1195
+ }
1196
+ return path;
1197
+ }
1198
+
1199
+ // Copyright 2018-2025 the Deno authors. MIT license.
1200
+ // This module is browser compatible.
1201
+ function common$1(paths, sep) {
1202
+ const [first = "", ...remaining] = paths;
1203
+ const parts = first.split(sep);
1204
+ let endOfPrefix = parts.length;
1205
+ let append = "";
1206
+ for (const path of remaining){
1207
+ const compare = path.split(sep);
1208
+ if (compare.length <= endOfPrefix) {
1209
+ endOfPrefix = compare.length;
1210
+ append = "";
1211
+ }
1212
+ for(let i = 0; i < endOfPrefix; i++){
1213
+ if (compare[i] !== parts[i]) {
1214
+ endOfPrefix = i;
1215
+ append = i === 0 ? "" : sep;
1216
+ break;
1217
+ }
1218
+ }
1219
+ }
1220
+ return parts.slice(0, endOfPrefix).join(sep) + append;
1221
+ }
1222
+
1223
+ // Copyright 2018-2025 the Deno authors. MIT license.
1224
+ // This module is browser compatible.
1225
+ /**
1226
+ * Determines the common path from a set of paths for Windows systems.
1227
+ *
1228
+ * @example Usage
1229
+ * ```ts
1230
+ * import { common } from "@std/path/windows/common";
1231
+ * import { assertEquals } from "@std/assert";
1232
+ *
1233
+ * const path = common([
1234
+ * "C:\\foo\\bar",
1235
+ * "C:\\foo\\baz",
1236
+ * ]);
1237
+ * assertEquals(path, "C:\\foo\\");
1238
+ * ```
1239
+ *
1240
+ * @param paths The paths to compare.
1241
+ * @returns The common path.
1242
+ */ function common(paths) {
1243
+ return common$1(paths, SEPARATOR);
1244
+ }
1245
+
1246
+ // Copyright 2018-2025 the Deno authors. MIT license.
1247
+ // This module is browser compatible.
1248
+ /**
1249
+ * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
1250
+ * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
1251
+ */ const REG_EXP_ESCAPE_CHARS = [
1252
+ "!",
1253
+ "$",
1254
+ "(",
1255
+ ")",
1256
+ "*",
1257
+ "+",
1258
+ ".",
1259
+ "=",
1260
+ "?",
1261
+ "[",
1262
+ "\\",
1263
+ "^",
1264
+ "{",
1265
+ "|"
1266
+ ];
1267
+ const RANGE_ESCAPE_CHARS = [
1268
+ "-",
1269
+ "\\",
1270
+ "]"
1271
+ ];
1272
+ function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
1273
+ caseInsensitive = false } = {}) {
1274
+ if (glob === "") {
1275
+ return /(?!)/;
1276
+ }
1277
+ // Remove trailing separators.
1278
+ let newLength = glob.length;
1279
+ for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
1280
+ glob = glob.slice(0, newLength);
1281
+ let regExpString = "";
1282
+ // Terminates correctly. Trust that `j` is incremented every iteration.
1283
+ for(let j = 0; j < glob.length;){
1284
+ let segment = "";
1285
+ const groupStack = [];
1286
+ let inRange = false;
1287
+ let inEscape = false;
1288
+ let endsWithSep = false;
1289
+ let i = j;
1290
+ // Terminates with `i` at the non-inclusive end of the current segment.
1291
+ for(; i < glob.length && !c.seps.includes(glob[i]); i++){
1292
+ if (inEscape) {
1293
+ inEscape = false;
1294
+ const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
1295
+ segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1296
+ continue;
1297
+ }
1298
+ if (glob[i] === c.escapePrefix) {
1299
+ inEscape = true;
1300
+ continue;
1301
+ }
1302
+ if (glob[i] === "[") {
1303
+ if (!inRange) {
1304
+ inRange = true;
1305
+ segment += "[";
1306
+ if (glob[i + 1] === "!") {
1307
+ i++;
1308
+ segment += "^";
1309
+ } else if (glob[i + 1] === "^") {
1310
+ i++;
1311
+ segment += "\\^";
1312
+ }
1313
+ continue;
1314
+ } else if (glob[i + 1] === ":") {
1315
+ let k = i + 1;
1316
+ let value = "";
1317
+ while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
1318
+ value += glob[k + 1];
1319
+ k++;
1320
+ }
1321
+ if (glob[k + 1] === ":" && glob[k + 2] === "]") {
1322
+ i = k + 2;
1323
+ if (value === "alnum") segment += "\\dA-Za-z";
1324
+ else if (value === "alpha") segment += "A-Za-z";
1325
+ else if (value === "ascii") segment += "\x00-\x7F";
1326
+ else if (value === "blank") segment += "\t ";
1327
+ else if (value === "cntrl") segment += "\x00-\x1F\x7F";
1328
+ else if (value === "digit") segment += "\\d";
1329
+ else if (value === "graph") segment += "\x21-\x7E";
1330
+ else if (value === "lower") segment += "a-z";
1331
+ else if (value === "print") segment += "\x20-\x7E";
1332
+ else if (value === "punct") {
1333
+ segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
1334
+ } else if (value === "space") segment += "\\s\v";
1335
+ else if (value === "upper") segment += "A-Z";
1336
+ else if (value === "word") segment += "\\w";
1337
+ else if (value === "xdigit") segment += "\\dA-Fa-f";
1338
+ continue;
1339
+ }
1340
+ }
1341
+ }
1342
+ if (glob[i] === "]" && inRange) {
1343
+ inRange = false;
1344
+ segment += "]";
1345
+ continue;
1346
+ }
1347
+ if (inRange) {
1348
+ segment += glob[i];
1349
+ continue;
1350
+ }
1351
+ if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1352
+ segment += ")";
1353
+ const type = groupStack.pop();
1354
+ if (type === "!") {
1355
+ segment += c.wildcard;
1356
+ } else if (type !== "@") {
1357
+ segment += type;
1358
+ }
1359
+ continue;
1360
+ }
1361
+ if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
1362
+ segment += "|";
1363
+ continue;
1364
+ }
1365
+ if (glob[i] === "+" && extended && glob[i + 1] === "(") {
1366
+ i++;
1367
+ groupStack.push("+");
1368
+ segment += "(?:";
1369
+ continue;
1370
+ }
1371
+ if (glob[i] === "@" && extended && glob[i + 1] === "(") {
1372
+ i++;
1373
+ groupStack.push("@");
1374
+ segment += "(?:";
1375
+ continue;
1376
+ }
1377
+ if (glob[i] === "?") {
1378
+ if (extended && glob[i + 1] === "(") {
1379
+ i++;
1380
+ groupStack.push("?");
1381
+ segment += "(?:";
1382
+ } else {
1383
+ segment += ".";
1384
+ }
1385
+ continue;
1386
+ }
1387
+ if (glob[i] === "!" && extended && glob[i + 1] === "(") {
1388
+ i++;
1389
+ groupStack.push("!");
1390
+ segment += "(?!";
1391
+ continue;
1392
+ }
1393
+ if (glob[i] === "{") {
1394
+ groupStack.push("BRACE");
1395
+ segment += "(?:";
1396
+ continue;
1397
+ }
1398
+ if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
1399
+ groupStack.pop();
1400
+ segment += ")";
1401
+ continue;
1402
+ }
1403
+ if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
1404
+ segment += "|";
1405
+ continue;
1406
+ }
1407
+ if (glob[i] === "*") {
1408
+ if (extended && glob[i + 1] === "(") {
1409
+ i++;
1410
+ groupStack.push("*");
1411
+ segment += "(?:";
1412
+ } else {
1413
+ const prevChar = glob[i - 1];
1414
+ let numStars = 1;
1415
+ while(glob[i + 1] === "*"){
1416
+ i++;
1417
+ numStars++;
1418
+ }
1419
+ const nextChar = glob[i + 1];
1420
+ if (globstarOption && numStars === 2 && [
1421
+ ...c.seps,
1422
+ undefined
1423
+ ].includes(prevChar) && [
1424
+ ...c.seps,
1425
+ undefined
1426
+ ].includes(nextChar)) {
1427
+ segment += c.globstar;
1428
+ endsWithSep = true;
1429
+ } else {
1430
+ segment += c.wildcard;
1431
+ }
1432
+ }
1433
+ continue;
1434
+ }
1435
+ segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
1436
+ }
1437
+ // Check for unclosed groups or a dangling backslash.
1438
+ if (groupStack.length > 0 || inRange || inEscape) {
1439
+ // Parse failure. Take all characters from this segment literally.
1440
+ segment = "";
1441
+ for (const c of glob.slice(j, i)){
1442
+ segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
1443
+ endsWithSep = false;
1444
+ }
1445
+ }
1446
+ regExpString += segment;
1447
+ if (!endsWithSep) {
1448
+ regExpString += i < glob.length ? c.sep : c.sepMaybe;
1449
+ endsWithSep = true;
1450
+ }
1451
+ // Terminates with `i` at the start of the next segment.
1452
+ while(c.seps.includes(glob[i]))i++;
1453
+ j = i;
1454
+ }
1455
+ regExpString = `^${regExpString}$`;
1456
+ return new RegExp(regExpString, caseInsensitive ? "i" : "");
1457
+ }
1458
+
1459
+ // Copyright 2018-2025 the Deno authors. MIT license.
1460
+ // This module is browser compatible.
1461
+ const constants = {
1462
+ sep: "(?:\\\\|/)+",
1463
+ sepMaybe: "(?:\\\\|/)*",
1464
+ seps: [
1465
+ "\\",
1466
+ "/"
1467
+ ],
1468
+ globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
1469
+ wildcard: "[^\\\\/]*",
1470
+ escapePrefix: "`"
1471
+ };
1472
+ /** Convert a glob string to a regular expression.
1473
+ *
1474
+ * Tries to match bash glob expansion as closely as possible.
1475
+ *
1476
+ * Basic glob syntax:
1477
+ * - `*` - Matches everything without leaving the path segment.
1478
+ * - `?` - Matches any single character.
1479
+ * - `{foo,bar}` - Matches `foo` or `bar`.
1480
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
1481
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
1482
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
1483
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
1484
+ * - `[[:alnum:]]` - Matches any digit or letter.
1485
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
1486
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
1487
+ * for a complete list of supported character classes.
1488
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
1489
+ * - \` - Escapes the next character for `os` set to `"windows"`.
1490
+ * - `/` - Path separator.
1491
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
1492
+ *
1493
+ * Extended syntax:
1494
+ * - Requires `{ extended: true }`.
1495
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
1496
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
1497
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
1498
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
1499
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
1500
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
1501
+ *
1502
+ * Globstar syntax:
1503
+ * - Requires `{ globstar: true }`.
1504
+ * - `**` - Matches any number of any path segments.
1505
+ * - Must comprise its entire path segment in the provided glob.
1506
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
1507
+ *
1508
+ * Note the following properties:
1509
+ * - The generated `RegExp` is anchored at both start and end.
1510
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
1511
+ * provided glob have no meaning and are discarded.
1512
+ * - Absolute globs will only match absolute paths, etc.
1513
+ * - Empty globs will match nothing.
1514
+ * - Any special glob syntax must be contained to one path segment. For example,
1515
+ * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
1516
+ * first segment ends with an unclosed group.
1517
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
1518
+ * parse error has occurred. Every character for that segment is taken
1519
+ * literally in this event.
1520
+ *
1521
+ * Limitations:
1522
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
1523
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
1524
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
1525
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
1526
+ * the group occurs not nested at the end of the segment.
1527
+ *
1528
+ * @example Usage
1529
+ * ```ts
1530
+ * import { globToRegExp } from "@std/path/windows/glob-to-regexp";
1531
+ * import { assertEquals } from "@std/assert";
1532
+ *
1533
+ * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/);
1534
+ * ```
1535
+ *
1536
+ * @param glob Glob string to convert.
1537
+ * @param options Conversion options.
1538
+ * @returns The regular expression equivalent to the glob.
1539
+ */ function globToRegExp(glob, options = {}) {
1540
+ return _globToRegExp(constants, glob, options);
1541
+ }
1542
+
1543
+ // Copyright 2018-2025 the Deno authors. MIT license.
1544
+ // This module is browser compatible.
1545
+ /**
1546
+ * Test whether the given string is a glob.
1547
+ *
1548
+ * @example Usage
1549
+ * ```ts
1550
+ * import { isGlob } from "@std/path/is-glob";
1551
+ * import { assert } from "@std/assert";
1552
+ *
1553
+ * assert(!isGlob("foo/bar/../baz"));
1554
+ * assert(isGlob("foo/*ar/../baz"));
1555
+ * ```
1556
+ *
1557
+ * @param str String to test.
1558
+ * @returns `true` if the given string is a glob, otherwise `false`
1559
+ */ function isGlob(str) {
1560
+ const chars = {
1561
+ "{": "}",
1562
+ "(": ")",
1563
+ "[": "]"
1564
+ };
1565
+ const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
1566
+ if (str === "") {
1567
+ return false;
1568
+ }
1569
+ let match;
1570
+ while(match = regex.exec(str)){
1571
+ if (match[2]) return true;
1572
+ let idx = match.index + match[0].length;
1573
+ // if an open bracket/brace/paren is escaped,
1574
+ // set the index to the next closing character
1575
+ const open = match[1];
1576
+ const close = open ? chars[open] : null;
1577
+ if (open && close) {
1578
+ const n = str.indexOf(close, idx);
1579
+ if (n !== -1) {
1580
+ idx = n + 1;
1581
+ }
1582
+ }
1583
+ str = str.slice(idx);
1584
+ }
1585
+ return false;
1586
+ }
1587
+
1588
+ // Copyright 2018-2025 the Deno authors. MIT license.
1589
+ // This module is browser compatible.
1590
+ /**
1591
+ * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
1592
+ *
1593
+ * @example Usage
1594
+ * ```ts
1595
+ * import { normalizeGlob } from "@std/path/windows/normalize-glob";
1596
+ * import { assertEquals } from "@std/assert";
1597
+ *
1598
+ * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
1599
+ * assertEquals(normalized, "**\\bar");
1600
+ * ```
1601
+ *
1602
+ * @param glob The glob pattern to normalize.
1603
+ * @param options The options for glob pattern.
1604
+ * @returns The normalized glob pattern.
1605
+ */ function normalizeGlob(glob, options = {}) {
1606
+ const { globstar = false } = options;
1607
+ if (glob.match(/\0/g)) {
1608
+ throw new Error(`Glob contains invalid characters: "${glob}"`);
1609
+ }
1610
+ if (!globstar) {
1611
+ return normalize(glob);
1612
+ }
1613
+ const s = SEPARATOR_PATTERN.source;
1614
+ const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
1615
+ return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
1616
+ }
1617
+
1618
+ // Copyright 2018-2025 the Deno authors. MIT license.
1619
+ // This module is browser compatible.
1620
+ /**
1621
+ * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
1622
+ *
1623
+ * @example Usage
1624
+ *
1625
+ * ```ts
1626
+ * import { joinGlobs } from "@std/path/windows/join-globs";
1627
+ * import { assertEquals } from "@std/assert";
1628
+ *
1629
+ * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true });
1630
+ * assertEquals(joined, "foo\\**\\bar");
1631
+ * ```
1632
+ *
1633
+ * @param globs The globs to join.
1634
+ * @param options The options for glob pattern.
1635
+ * @returns The joined glob pattern.
1636
+ */ function joinGlobs(globs, options = {}) {
1637
+ const { globstar = false } = options;
1638
+ if (!globstar || globs.length === 0) {
1639
+ return join(...globs);
1640
+ }
1641
+ let joined;
1642
+ for (const glob of globs){
1643
+ const path = glob;
1644
+ if (path.length > 0) {
1645
+ if (!joined) joined = path;
1646
+ else joined += `${SEPARATOR}${path}`;
1647
+ }
1648
+ }
1649
+ if (!joined) return ".";
1650
+ return normalizeGlob(joined, {
1651
+ globstar
1652
+ });
1653
+ }
1654
+
1655
+ export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/types.d.ts ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for the config-array package.
3
+ * @author Nicholas C. Zakas
4
+ */
5
+ export interface ConfigObject {
6
+ /**
7
+ * The base path for files and ignores.
8
+ */
9
+ basePath?: string;
10
+ /**
11
+ * The files to include.
12
+ */
13
+ files?: string[];
14
+ /**
15
+ * The files to exclude.
16
+ */
17
+ ignores?: string[];
18
+ /**
19
+ * The name of the config object.
20
+ */
21
+ name?: string;
22
+ [key: string]: unknown;
23
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/dist/esm/types.ts ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for the config-array package.
3
+ * @author Nicholas C. Zakas
4
+ */
5
+
6
+ export interface ConfigObject {
7
+ /**
8
+ * The base path for files and ignores.
9
+ */
10
+ basePath?: string;
11
+
12
+ /**
13
+ * The files to include.
14
+ */
15
+ files?: string[];
16
+
17
+ /**
18
+ * The files to exclude.
19
+ */
20
+ ignores?: string[];
21
+
22
+ /**
23
+ * The name of the config object.
24
+ */
25
+ name?: string;
26
+
27
+ // may also have any number of other properties
28
+ [key: string]: unknown;
29
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-array/package.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@eslint/config-array",
3
+ "version": "0.21.0",
4
+ "description": "General purpose glob-based configuration matching.",
5
+ "author": "Nicholas C. Zakas",
6
+ "type": "module",
7
+ "main": "dist/esm/index.js",
8
+ "types": "dist/esm/index.d.ts",
9
+ "exports": {
10
+ "require": {
11
+ "types": "./dist/cjs/index.d.cts",
12
+ "default": "./dist/cjs/index.cjs"
13
+ },
14
+ "import": {
15
+ "types": "./dist/esm/index.d.ts",
16
+ "default": "./dist/esm/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/eslint/rewrite.git",
28
+ "directory": "packages/config-array"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/eslint/rewrite/issues"
32
+ },
33
+ "homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-array#readme",
34
+ "scripts": {
35
+ "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
36
+ "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
37
+ "build:std__path": "rollup -c rollup.std__path-config.js && node fix-std__path-imports",
38
+ "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts && npm run build:std__path",
39
+ "test:jsr": "npx jsr@latest publish --dry-run",
40
+ "pretest": "npm run build",
41
+ "test": "mocha tests/",
42
+ "test:coverage": "c8 npm test"
43
+ },
44
+ "keywords": [
45
+ "configuration",
46
+ "configarray",
47
+ "config file"
48
+ ],
49
+ "license": "Apache-2.0",
50
+ "dependencies": {
51
+ "@eslint/object-schema": "^2.1.6",
52
+ "debug": "^4.3.1",
53
+ "minimatch": "^3.1.2"
54
+ },
55
+ "devDependencies": {
56
+ "@jsr/std__path": "^1.0.4",
57
+ "@types/minimatch": "^3.0.5",
58
+ "rollup-plugin-copy": "^3.5.0"
59
+ },
60
+ "engines": {
61
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
62
+ }
63
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # @eslint/config-helpers
2
+
3
+ ## Description
4
+
5
+ Helper utilities for creating ESLint configuration.
6
+
7
+ ## Installation
8
+
9
+ For Node.js and compatible runtimes:
10
+
11
+ ```shell
12
+ npm install @eslint/config-helpers
13
+ # or
14
+ yarn add @eslint/config-helpers
15
+ # or
16
+ pnpm install @eslint/config-helpers
17
+ # or
18
+ bun add @eslint/config-helpers
19
+ ```
20
+
21
+ For Deno:
22
+
23
+ ```shell
24
+ deno add @eslint/config-helpers
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ### `defineConfig()`
30
+
31
+ The `defineConfig()` function allows you to specify an ESLint configuration with full type checking and additional capabilities, such as `extends`. Here's an example:
32
+
33
+ ```js
34
+ // eslint.config.js
35
+ import { defineConfig } from "@eslint/config-helpers";
36
+ import js from "@eslint/js";
37
+
38
+ export default defineConfig([
39
+ {
40
+ files: ["src/**/*.js"],
41
+ plugins: { js },
42
+ extends: ["js/recommended"],
43
+ rules: {
44
+ semi: "error",
45
+ "prefer-const": "error",
46
+ },
47
+ },
48
+ {
49
+ files: ["test/**/*.js"],
50
+ rules: {
51
+ "no-console": "off",
52
+ },
53
+ },
54
+ ]);
55
+ ```
56
+
57
+ ### `globalIgnores()`
58
+
59
+ The `globalIgnores()` function allows you to specify patterns for files and directories that should be globally ignored by ESLint. This is useful for excluding files that you don't want to lint, such as build directories or third-party libraries. Here's an example:
60
+
61
+ ```js
62
+ // eslint.config.js
63
+ import { defineConfig, globalIgnores } from "@eslint/config-helpers";
64
+
65
+ export default defineConfig([
66
+ {
67
+ files: ["src/**/*.js"],
68
+ rules: {
69
+ semi: "error",
70
+ "prefer-const": "error",
71
+ },
72
+ },
73
+ globalIgnores(["node_modules/", "dist/", "coverage/"]),
74
+ ]);
75
+ ```
76
+
77
+ ## License
78
+
79
+ Apache 2.0
80
+
81
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
82
+ <!--sponsorsstart-->
83
+
84
+ ## Sponsors
85
+
86
+ The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
87
+ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
88
+
89
+ <h3>Diamond Sponsors</h3>
90
+ <p><a href="https://www.ag-grid.com/"><img src="https://images.opencollective.com/ag-grid/bec0580/logo.png" alt="AG Grid" height="128"></a></p><h3>Platinum Sponsors</h3>
91
+ <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
92
+ <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
93
+ <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
94
+ <p><a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
95
+ <h3>Technology Sponsors</h3>
96
+ Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
97
+ <p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
98
+ <!--sponsorsend-->
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/index.cjs ADDED
@@ -0,0 +1,581 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ /**
4
+ * @fileoverview defineConfig helper
5
+ * @author Nicholas C. Zakas
6
+ */
7
+
8
+ //-----------------------------------------------------------------------------
9
+ // Type Definitions
10
+ //-----------------------------------------------------------------------------
11
+
12
+ /** @typedef {import("eslint").Linter.Config} Config */
13
+ /** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig */
14
+ /** @typedef {import("eslint").ESLint.Plugin} Plugin */
15
+ /** @typedef {import("eslint").Linter.RuleEntry} RuleEntry */
16
+ /** @typedef {import("./types.ts").ExtendsElement} ExtendsElement */
17
+ /** @typedef {import("./types.ts").SimpleExtendsElement} SimpleExtendsElement */
18
+ /** @typedef {import("./types.ts").ConfigWithExtends} ConfigWithExtends */
19
+ /** @typedef {import("./types.ts").InfiniteArray<Config>} InfiniteConfigArray */
20
+ /** @typedef {import("./types.ts").ConfigWithExtendsArray} ConfigWithExtendsArray */
21
+
22
+ //-----------------------------------------------------------------------------
23
+ // Helpers
24
+ //-----------------------------------------------------------------------------
25
+
26
+ const eslintrcKeys = [
27
+ "env",
28
+ "extends",
29
+ "globals",
30
+ "ignorePatterns",
31
+ "noInlineConfig",
32
+ "overrides",
33
+ "parser",
34
+ "parserOptions",
35
+ "reportUnusedDisableDirectives",
36
+ "root",
37
+ ];
38
+
39
+ const allowedGlobalIgnoreKeys = new Set(["basePath", "ignores", "name"]);
40
+
41
+ /**
42
+ * Gets the name of a config object.
43
+ * @param {Config} config The config object.
44
+ * @param {string} indexPath The index path of the config object.
45
+ * @return {string} The name of the config object.
46
+ */
47
+ function getConfigName(config, indexPath) {
48
+ if (config.name) {
49
+ return config.name;
50
+ }
51
+
52
+ return `UserConfig${indexPath}`;
53
+ }
54
+
55
+ /**
56
+ * Gets the name of an extension.
57
+ * @param {SimpleExtendsElement} extension The extension.
58
+ * @param {string} indexPath The index of the extension.
59
+ * @return {string} The name of the extension.
60
+ */
61
+ function getExtensionName(extension, indexPath) {
62
+ if (typeof extension === "string") {
63
+ return extension;
64
+ }
65
+
66
+ if (extension.name) {
67
+ return extension.name;
68
+ }
69
+
70
+ return `ExtendedConfig${indexPath}`;
71
+ }
72
+
73
+ /**
74
+ * Determines if a config object is a legacy config.
75
+ * @param {Config|LegacyConfig} config The config object to check.
76
+ * @return {config is LegacyConfig} `true` if the config object is a legacy config.
77
+ */
78
+ function isLegacyConfig(config) {
79
+ for (const key of eslintrcKeys) {
80
+ if (key in config) {
81
+ return true;
82
+ }
83
+ }
84
+
85
+ return false;
86
+ }
87
+
88
+ /**
89
+ * Determines if a config object is a global ignores config.
90
+ * @param {Config} config The config object to check.
91
+ * @return {boolean} `true` if the config object is a global ignores config.
92
+ */
93
+ function isGlobalIgnores(config) {
94
+ return Object.keys(config).every(key => allowedGlobalIgnoreKeys.has(key));
95
+ }
96
+
97
+ /**
98
+ * Parses a plugin member ID (rule, processor, etc.) and returns
99
+ * the namespace and member name.
100
+ * @param {string} id The ID to parse.
101
+ * @returns {{namespace:string, name:string}} The namespace and member name.
102
+ */
103
+ function getPluginMember(id) {
104
+ const firstSlashIndex = id.indexOf("/");
105
+
106
+ if (firstSlashIndex === -1) {
107
+ return { namespace: "", name: id };
108
+ }
109
+
110
+ let namespace = id.slice(0, firstSlashIndex);
111
+
112
+ /*
113
+ * Special cases:
114
+ * 1. The namespace is `@`, that means it's referring to the
115
+ * core plugin so `@` is the full namespace.
116
+ * 2. The namespace starts with `@`, that means it's referring to
117
+ * an npm scoped package. That means the namespace is the scope
118
+ * and the package name (i.e., `@eslint/core`).
119
+ */
120
+ if (namespace[0] === "@" && namespace !== "@") {
121
+ const secondSlashIndex = id.indexOf("/", firstSlashIndex + 1);
122
+ if (secondSlashIndex !== -1) {
123
+ namespace = id.slice(0, secondSlashIndex);
124
+ return { namespace, name: id.slice(secondSlashIndex + 1) };
125
+ }
126
+ }
127
+
128
+ const name = id.slice(firstSlashIndex + 1);
129
+
130
+ return { namespace, name };
131
+ }
132
+
133
+ /**
134
+ * Normalizes the plugin config by replacing the namespace with the plugin namespace.
135
+ * @param {string} userNamespace The namespace of the plugin.
136
+ * @param {Plugin} plugin The plugin config object.
137
+ * @param {Config} config The config object to normalize.
138
+ * @return {Config} The normalized config object.
139
+ */
140
+ function normalizePluginConfig(userNamespace, plugin, config) {
141
+ const pluginNamespace = plugin.meta?.namespace;
142
+
143
+ // don't do anything if the plugin doesn't have a namespace or rules
144
+ if (
145
+ !pluginNamespace ||
146
+ pluginNamespace === userNamespace ||
147
+ (!config.rules && !config.processor && !config.language)
148
+ ) {
149
+ return config;
150
+ }
151
+
152
+ const result = { ...config };
153
+
154
+ // update the rules
155
+ if (result.rules) {
156
+ const ruleIds = Object.keys(result.rules);
157
+
158
+ /** @type {Record<string,RuleEntry|undefined>} */
159
+ const newRules = {};
160
+
161
+ for (let i = 0; i < ruleIds.length; i++) {
162
+ const ruleId = ruleIds[i];
163
+ const { namespace: ruleNamespace, name: ruleName } =
164
+ getPluginMember(ruleId);
165
+
166
+ if (ruleNamespace === pluginNamespace) {
167
+ newRules[`${userNamespace}/${ruleName}`] = result.rules[ruleId];
168
+ } else {
169
+ newRules[ruleId] = result.rules[ruleId];
170
+ }
171
+ }
172
+
173
+ result.rules = newRules;
174
+ }
175
+
176
+ // update the processor
177
+
178
+ if (typeof result.processor === "string") {
179
+ const { namespace: processorNamespace, name: processorName } =
180
+ getPluginMember(result.processor);
181
+
182
+ if (processorNamespace) {
183
+ if (processorNamespace === pluginNamespace) {
184
+ result.processor = `${userNamespace}/${processorName}`;
185
+ }
186
+ }
187
+ }
188
+
189
+ // update the language
190
+ if (typeof result.language === "string") {
191
+ const { namespace: languageNamespace, name: languageName } =
192
+ getPluginMember(result.language);
193
+
194
+ if (languageNamespace === pluginNamespace) {
195
+ result.language = `${userNamespace}/${languageName}`;
196
+ }
197
+ }
198
+
199
+ return result;
200
+ }
201
+
202
+ /**
203
+ * Deeply normalizes a plugin config, traversing recursively into an arrays.
204
+ * @param {string} userPluginNamespace The namespace of the plugin.
205
+ * @param {Plugin} plugin The plugin object.
206
+ * @param {Config|LegacyConfig|(Config|LegacyConfig)[]} pluginConfig The plugin config to normalize.
207
+ * @param {string} pluginConfigName The name of the plugin config.
208
+ * @return {InfiniteConfigArray} The normalized plugin config.
209
+ * @throws {TypeError} If the plugin config is a legacy config.
210
+ */
211
+ function deepNormalizePluginConfig(
212
+ userPluginNamespace,
213
+ plugin,
214
+ pluginConfig,
215
+ pluginConfigName,
216
+ ) {
217
+ // if it's an array then it's definitely a new config
218
+ if (Array.isArray(pluginConfig)) {
219
+ return pluginConfig.map(pluginSubConfig =>
220
+ deepNormalizePluginConfig(
221
+ userPluginNamespace,
222
+ plugin,
223
+ pluginSubConfig,
224
+ pluginConfigName,
225
+ ),
226
+ );
227
+ }
228
+
229
+ // if it's a legacy config, throw an error
230
+ if (isLegacyConfig(pluginConfig)) {
231
+ throw new TypeError(
232
+ `Plugin config "${pluginConfigName}" is an eslintrc config and cannot be used in this context.`,
233
+ );
234
+ }
235
+
236
+ return normalizePluginConfig(userPluginNamespace, plugin, pluginConfig);
237
+ }
238
+
239
+ /**
240
+ * Finds a plugin config by name in the given config.
241
+ * @param {Config} config The config object.
242
+ * @param {string} pluginConfigName The name of the plugin config.
243
+ * @return {InfiniteConfigArray} The plugin config.
244
+ * @throws {TypeError} If the plugin config is not found or is a legacy config.
245
+ */
246
+ function findPluginConfig(config, pluginConfigName) {
247
+ const { namespace: userPluginNamespace, name: configName } =
248
+ getPluginMember(pluginConfigName);
249
+ const plugin = config.plugins?.[userPluginNamespace];
250
+
251
+ if (!plugin) {
252
+ throw new TypeError(`Plugin "${userPluginNamespace}" not found.`);
253
+ }
254
+
255
+ const directConfig = plugin.configs?.[configName];
256
+ if (directConfig) {
257
+ // Arrays are always flat configs, and non-legacy configs can be used directly
258
+ if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
259
+ return deepNormalizePluginConfig(
260
+ userPluginNamespace,
261
+ plugin,
262
+ directConfig,
263
+ pluginConfigName,
264
+ );
265
+ }
266
+
267
+ // If it's a legacy config, look for the flat version
268
+ const flatConfig = plugin.configs?.[`flat/${configName}`];
269
+
270
+ if (
271
+ flatConfig &&
272
+ (Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
273
+ ) {
274
+ return deepNormalizePluginConfig(
275
+ userPluginNamespace,
276
+ plugin,
277
+ flatConfig,
278
+ pluginConfigName,
279
+ );
280
+ }
281
+
282
+ throw new TypeError(
283
+ `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`,
284
+ );
285
+ }
286
+
287
+ throw new TypeError(
288
+ `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`,
289
+ );
290
+ }
291
+
292
+ /**
293
+ * Flattens an array while keeping track of the index path.
294
+ * @param {any[]} configList The array to traverse.
295
+ * @param {string} indexPath The index path of the value in a multidimensional array.
296
+ * @return {IterableIterator<{indexPath:string, value:any}>} The flattened list of values.
297
+ */
298
+ function* flatTraverse(configList, indexPath = "") {
299
+ for (let i = 0; i < configList.length; i++) {
300
+ const newIndexPath = indexPath ? `${indexPath}[${i}]` : `[${i}]`;
301
+
302
+ // if it's an array then traverse it as well
303
+ if (Array.isArray(configList[i])) {
304
+ yield* flatTraverse(configList[i], newIndexPath);
305
+ continue;
306
+ }
307
+
308
+ yield { indexPath: newIndexPath, value: configList[i] };
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Extends a list of config files by creating every combination of base and extension files.
314
+ * @param {(string|string[])[]} [baseFiles] The base files.
315
+ * @param {(string|string[])[]} [extensionFiles] The extension files.
316
+ * @return {(string|string[])[]} The extended files.
317
+ */
318
+ function extendConfigFiles(baseFiles = [], extensionFiles = []) {
319
+ if (!extensionFiles.length) {
320
+ return baseFiles.concat();
321
+ }
322
+
323
+ if (!baseFiles.length) {
324
+ return extensionFiles.concat();
325
+ }
326
+
327
+ /** @type {(string|string[])[]} */
328
+ const result = [];
329
+
330
+ for (const baseFile of baseFiles) {
331
+ for (const extensionFile of extensionFiles) {
332
+ /*
333
+ * Each entry can be a string or array of strings. The end result
334
+ * needs to be an array of strings, so we need to be sure to include
335
+ * all of the items when there's an array.
336
+ */
337
+
338
+ const entry = [];
339
+
340
+ if (Array.isArray(baseFile)) {
341
+ entry.push(...baseFile);
342
+ } else {
343
+ entry.push(baseFile);
344
+ }
345
+
346
+ if (Array.isArray(extensionFile)) {
347
+ entry.push(...extensionFile);
348
+ } else {
349
+ entry.push(extensionFile);
350
+ }
351
+
352
+ result.push(entry);
353
+ }
354
+ }
355
+
356
+ return result;
357
+ }
358
+
359
+ /**
360
+ * Extends a config object with another config object.
361
+ * @param {Config} baseConfig The base config object.
362
+ * @param {string} baseConfigName The name of the base config object.
363
+ * @param {Config} extension The extension config object.
364
+ * @param {string} extensionName The index of the extension config object.
365
+ * @return {Config} The extended config object.
366
+ */
367
+ function extendConfig(baseConfig, baseConfigName, extension, extensionName) {
368
+ const result = { ...extension };
369
+
370
+ // for global ignores there is no further work to be done, we just keep everything
371
+ if (!isGlobalIgnores(extension)) {
372
+ // for files we need to create every combination of base and extension files
373
+ if (baseConfig.files) {
374
+ result.files = extendConfigFiles(baseConfig.files, extension.files);
375
+ }
376
+
377
+ // for ignores we just concatenation the extension ignores onto the base ignores
378
+ if (baseConfig.ignores) {
379
+ result.ignores = baseConfig.ignores.concat(extension.ignores ?? []);
380
+ }
381
+ }
382
+
383
+ result.name = `${baseConfigName} > ${extensionName}`;
384
+
385
+ // @ts-ignore -- ESLint types aren't updated yet
386
+ if (baseConfig.basePath) {
387
+ // @ts-ignore -- ESLint types aren't updated yet
388
+ result.basePath = baseConfig.basePath;
389
+ }
390
+
391
+ return result;
392
+ }
393
+
394
+ /**
395
+ * Processes a list of extends elements.
396
+ * @param {ConfigWithExtends} config The config object.
397
+ * @param {WeakMap<Config, string>} configNames The map of config objects to their names.
398
+ * @return {Config[]} The flattened list of config objects.
399
+ * @throws {TypeError} If the `extends` property is not an array or if nested `extends` is found.
400
+ */
401
+ function processExtends(config, configNames) {
402
+ if (!config.extends) {
403
+ return [config];
404
+ }
405
+
406
+ if (!Array.isArray(config.extends)) {
407
+ throw new TypeError("The `extends` property must be an array.");
408
+ }
409
+
410
+ const {
411
+ /** @type {Config[]} */
412
+ extends: extendsList,
413
+
414
+ /** @type {Config} */
415
+ ...configObject
416
+ } = config;
417
+
418
+ const extensionNames = new WeakMap();
419
+
420
+ // replace strings with the actual configs
421
+ const objectExtends = extendsList.map(extendsElement => {
422
+ if (typeof extendsElement === "string") {
423
+ const pluginConfig = findPluginConfig(config, extendsElement);
424
+
425
+ // assign names
426
+ if (Array.isArray(pluginConfig)) {
427
+ pluginConfig.forEach((pluginConfigElement, index) => {
428
+ extensionNames.set(
429
+ pluginConfigElement,
430
+ `${extendsElement}[${index}]`,
431
+ );
432
+ });
433
+ } else {
434
+ extensionNames.set(pluginConfig, extendsElement);
435
+ }
436
+
437
+ return pluginConfig;
438
+ }
439
+
440
+ return /** @type {Config} */ (extendsElement);
441
+ });
442
+
443
+ const result = [];
444
+
445
+ for (const { indexPath, value: extendsElement } of flatTraverse(
446
+ objectExtends,
447
+ )) {
448
+ const extension = /** @type {Config} */ (extendsElement);
449
+
450
+ if ("basePath" in extension) {
451
+ throw new TypeError("'basePath' in `extends` is not allowed.");
452
+ }
453
+
454
+ if ("extends" in extension) {
455
+ throw new TypeError("Nested 'extends' is not allowed.");
456
+ }
457
+
458
+ const baseConfigName = /** @type {string} */ (configNames.get(config));
459
+ const extensionName =
460
+ extensionNames.get(extendsElement) ??
461
+ getExtensionName(extendsElement, indexPath);
462
+
463
+ result.push(
464
+ extendConfig(
465
+ configObject,
466
+ baseConfigName,
467
+ extension,
468
+ extensionName,
469
+ ),
470
+ );
471
+ }
472
+
473
+ /*
474
+ * If the base config object has only `ignores` and `extends`, then
475
+ * removing `extends` turns it into a global ignores, which is not what
476
+ * we want. So we need to check if the base config object is a global ignores
477
+ * and if so, we don't add it to the array.
478
+ *
479
+ * (The other option would be to add a `files` entry, but that would result
480
+ * in a config that didn't actually do anything because there are no
481
+ * other keys in the config.)
482
+ */
483
+ if (!isGlobalIgnores(configObject)) {
484
+ result.push(configObject);
485
+ }
486
+
487
+ return result.flat();
488
+ }
489
+
490
+ /**
491
+ * Processes a list of config objects and arrays.
492
+ * @param {ConfigWithExtends[]} configList The list of config objects and arrays.
493
+ * @param {WeakMap<Config, string>} configNames The map of config objects to their names.
494
+ * @return {Config[]} The flattened list of config objects.
495
+ */
496
+ function processConfigList(configList, configNames) {
497
+ return configList.flatMap(config => processExtends(config, configNames));
498
+ }
499
+
500
+ //-----------------------------------------------------------------------------
501
+ // Exports
502
+ //-----------------------------------------------------------------------------
503
+
504
+ /**
505
+ * Helper function to define a config array.
506
+ * @param {ConfigWithExtendsArray} args The arguments to the function.
507
+ * @returns {Config[]} The config array.
508
+ * @throws {TypeError} If no arguments are provided or if an argument is not an object.
509
+ */
510
+ function defineConfig(...args) {
511
+ const configNames = new WeakMap();
512
+ const configs = [];
513
+
514
+ if (args.length === 0) {
515
+ throw new TypeError("Expected one or more arguments.");
516
+ }
517
+
518
+ // first flatten the list of configs and get the names
519
+ for (const { indexPath, value } of flatTraverse(args)) {
520
+ if (typeof value !== "object" || value === null) {
521
+ throw new TypeError(
522
+ `Expected an object but received ${String(value)}.`,
523
+ );
524
+ }
525
+
526
+ const config = /** @type {ConfigWithExtends} */ (value);
527
+
528
+ // save config name for easy reference later
529
+ configNames.set(config, getConfigName(config, indexPath));
530
+ configs.push(config);
531
+ }
532
+
533
+ return processConfigList(configs, configNames);
534
+ }
535
+
536
+ /**
537
+ * @fileoverview Global ignores helper function.
538
+ * @author Nicholas C. Zakas
539
+ */
540
+
541
+ //-----------------------------------------------------------------------------
542
+ // Type Definitions
543
+ //-----------------------------------------------------------------------------
544
+
545
+
546
+ //-----------------------------------------------------------------------------
547
+ // Helpers
548
+ //-----------------------------------------------------------------------------
549
+
550
+ let globalIgnoreCount = 0;
551
+
552
+ //-----------------------------------------------------------------------------
553
+ // Exports
554
+ //-----------------------------------------------------------------------------
555
+
556
+ /**
557
+ * Creates a global ignores config with the given patterns.
558
+ * @param {string[]} ignorePatterns The ignore patterns.
559
+ * @param {string} [name] The name of the global ignores config.
560
+ * @returns {Config} The global ignores config.
561
+ * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
562
+ */
563
+ function globalIgnores(ignorePatterns, name) {
564
+ if (!Array.isArray(ignorePatterns)) {
565
+ throw new TypeError("ignorePatterns must be an array");
566
+ }
567
+
568
+ if (ignorePatterns.length === 0) {
569
+ throw new TypeError("ignorePatterns must contain at least one pattern");
570
+ }
571
+
572
+ const id = globalIgnoreCount++;
573
+
574
+ return {
575
+ name: name || `globalIgnores ${id}`,
576
+ ignores: ignorePatterns,
577
+ };
578
+ }
579
+
580
+ exports.defineConfig = defineConfig;
581
+ exports.globalIgnores = globalIgnores;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/index.d.cts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type Config = import("eslint").Linter.Config;
2
+ export type LegacyConfig = import("eslint").Linter.LegacyConfig;
3
+ export type Plugin = import("eslint").ESLint.Plugin;
4
+ export type RuleEntry = import("eslint").Linter.RuleEntry;
5
+ export type ExtendsElement = import("./types.cts").ExtendsElement;
6
+ export type SimpleExtendsElement = import("./types.cts").SimpleExtendsElement;
7
+ export type ConfigWithExtends = import("./types.cts").ConfigWithExtends;
8
+ export type InfiniteConfigArray = import("./types.cts").InfiniteArray<Config>;
9
+ export type ConfigWithExtendsArray = import("./types.cts").ConfigWithExtendsArray;
10
+ /**
11
+ * Helper function to define a config array.
12
+ * @param {ConfigWithExtendsArray} args The arguments to the function.
13
+ * @returns {Config[]} The config array.
14
+ * @throws {TypeError} If no arguments are provided or if an argument is not an object.
15
+ */
16
+ export function defineConfig(...args: ConfigWithExtendsArray): Config[];
17
+ /**
18
+ * Creates a global ignores config with the given patterns.
19
+ * @param {string[]} ignorePatterns The ignore patterns.
20
+ * @param {string} [name] The name of the global ignores config.
21
+ * @returns {Config} The global ignores config.
22
+ * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
23
+ */
24
+ export function globalIgnores(ignorePatterns: string[], name?: string): Config;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/cjs/types.cts ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for this package.
3
+ */
4
+
5
+ import type { Linter } from "eslint";
6
+
7
+ /**
8
+ * Infinite array type.
9
+ */
10
+ export type InfiniteArray<T> = T | InfiniteArray<T>[];
11
+
12
+ /**
13
+ * The type of array element in the `extends` property after flattening.
14
+ */
15
+ export type SimpleExtendsElement = string | Linter.Config;
16
+
17
+ /**
18
+ * The type of array element in the `extends` property before flattening.
19
+ */
20
+ export type ExtendsElement =
21
+ | SimpleExtendsElement
22
+ | InfiniteArray<Linter.Config>;
23
+
24
+ /**
25
+ * Config with extends. Valid only inside of `defineConfig()`.
26
+ */
27
+ export interface ConfigWithExtends extends Linter.Config {
28
+ extends?: ExtendsElement[];
29
+ }
30
+
31
+ export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/index.d.ts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type Config = import("eslint").Linter.Config;
2
+ export type LegacyConfig = import("eslint").Linter.LegacyConfig;
3
+ export type Plugin = import("eslint").ESLint.Plugin;
4
+ export type RuleEntry = import("eslint").Linter.RuleEntry;
5
+ export type ExtendsElement = import("./types.ts").ExtendsElement;
6
+ export type SimpleExtendsElement = import("./types.ts").SimpleExtendsElement;
7
+ export type ConfigWithExtends = import("./types.ts").ConfigWithExtends;
8
+ export type InfiniteConfigArray = import("./types.ts").InfiniteArray<Config>;
9
+ export type ConfigWithExtendsArray = import("./types.ts").ConfigWithExtendsArray;
10
+ /**
11
+ * Helper function to define a config array.
12
+ * @param {ConfigWithExtendsArray} args The arguments to the function.
13
+ * @returns {Config[]} The config array.
14
+ * @throws {TypeError} If no arguments are provided or if an argument is not an object.
15
+ */
16
+ export function defineConfig(...args: ConfigWithExtendsArray): Config[];
17
+ /**
18
+ * Creates a global ignores config with the given patterns.
19
+ * @param {string[]} ignorePatterns The ignore patterns.
20
+ * @param {string} [name] The name of the global ignores config.
21
+ * @returns {Config} The global ignores config.
22
+ * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
23
+ */
24
+ export function globalIgnores(ignorePatterns: string[], name?: string): Config;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/index.js ADDED
@@ -0,0 +1,579 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-self-types="./index.d.ts"
2
+ /**
3
+ * @fileoverview defineConfig helper
4
+ * @author Nicholas C. Zakas
5
+ */
6
+
7
+ //-----------------------------------------------------------------------------
8
+ // Type Definitions
9
+ //-----------------------------------------------------------------------------
10
+
11
+ /** @typedef {import("eslint").Linter.Config} Config */
12
+ /** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig */
13
+ /** @typedef {import("eslint").ESLint.Plugin} Plugin */
14
+ /** @typedef {import("eslint").Linter.RuleEntry} RuleEntry */
15
+ /** @typedef {import("./types.ts").ExtendsElement} ExtendsElement */
16
+ /** @typedef {import("./types.ts").SimpleExtendsElement} SimpleExtendsElement */
17
+ /** @typedef {import("./types.ts").ConfigWithExtends} ConfigWithExtends */
18
+ /** @typedef {import("./types.ts").InfiniteArray<Config>} InfiniteConfigArray */
19
+ /** @typedef {import("./types.ts").ConfigWithExtendsArray} ConfigWithExtendsArray */
20
+
21
+ //-----------------------------------------------------------------------------
22
+ // Helpers
23
+ //-----------------------------------------------------------------------------
24
+
25
+ const eslintrcKeys = [
26
+ "env",
27
+ "extends",
28
+ "globals",
29
+ "ignorePatterns",
30
+ "noInlineConfig",
31
+ "overrides",
32
+ "parser",
33
+ "parserOptions",
34
+ "reportUnusedDisableDirectives",
35
+ "root",
36
+ ];
37
+
38
+ const allowedGlobalIgnoreKeys = new Set(["basePath", "ignores", "name"]);
39
+
40
+ /**
41
+ * Gets the name of a config object.
42
+ * @param {Config} config The config object.
43
+ * @param {string} indexPath The index path of the config object.
44
+ * @return {string} The name of the config object.
45
+ */
46
+ function getConfigName(config, indexPath) {
47
+ if (config.name) {
48
+ return config.name;
49
+ }
50
+
51
+ return `UserConfig${indexPath}`;
52
+ }
53
+
54
+ /**
55
+ * Gets the name of an extension.
56
+ * @param {SimpleExtendsElement} extension The extension.
57
+ * @param {string} indexPath The index of the extension.
58
+ * @return {string} The name of the extension.
59
+ */
60
+ function getExtensionName(extension, indexPath) {
61
+ if (typeof extension === "string") {
62
+ return extension;
63
+ }
64
+
65
+ if (extension.name) {
66
+ return extension.name;
67
+ }
68
+
69
+ return `ExtendedConfig${indexPath}`;
70
+ }
71
+
72
+ /**
73
+ * Determines if a config object is a legacy config.
74
+ * @param {Config|LegacyConfig} config The config object to check.
75
+ * @return {config is LegacyConfig} `true` if the config object is a legacy config.
76
+ */
77
+ function isLegacyConfig(config) {
78
+ for (const key of eslintrcKeys) {
79
+ if (key in config) {
80
+ return true;
81
+ }
82
+ }
83
+
84
+ return false;
85
+ }
86
+
87
+ /**
88
+ * Determines if a config object is a global ignores config.
89
+ * @param {Config} config The config object to check.
90
+ * @return {boolean} `true` if the config object is a global ignores config.
91
+ */
92
+ function isGlobalIgnores(config) {
93
+ return Object.keys(config).every(key => allowedGlobalIgnoreKeys.has(key));
94
+ }
95
+
96
+ /**
97
+ * Parses a plugin member ID (rule, processor, etc.) and returns
98
+ * the namespace and member name.
99
+ * @param {string} id The ID to parse.
100
+ * @returns {{namespace:string, name:string}} The namespace and member name.
101
+ */
102
+ function getPluginMember(id) {
103
+ const firstSlashIndex = id.indexOf("/");
104
+
105
+ if (firstSlashIndex === -1) {
106
+ return { namespace: "", name: id };
107
+ }
108
+
109
+ let namespace = id.slice(0, firstSlashIndex);
110
+
111
+ /*
112
+ * Special cases:
113
+ * 1. The namespace is `@`, that means it's referring to the
114
+ * core plugin so `@` is the full namespace.
115
+ * 2. The namespace starts with `@`, that means it's referring to
116
+ * an npm scoped package. That means the namespace is the scope
117
+ * and the package name (i.e., `@eslint/core`).
118
+ */
119
+ if (namespace[0] === "@" && namespace !== "@") {
120
+ const secondSlashIndex = id.indexOf("/", firstSlashIndex + 1);
121
+ if (secondSlashIndex !== -1) {
122
+ namespace = id.slice(0, secondSlashIndex);
123
+ return { namespace, name: id.slice(secondSlashIndex + 1) };
124
+ }
125
+ }
126
+
127
+ const name = id.slice(firstSlashIndex + 1);
128
+
129
+ return { namespace, name };
130
+ }
131
+
132
+ /**
133
+ * Normalizes the plugin config by replacing the namespace with the plugin namespace.
134
+ * @param {string} userNamespace The namespace of the plugin.
135
+ * @param {Plugin} plugin The plugin config object.
136
+ * @param {Config} config The config object to normalize.
137
+ * @return {Config} The normalized config object.
138
+ */
139
+ function normalizePluginConfig(userNamespace, plugin, config) {
140
+ const pluginNamespace = plugin.meta?.namespace;
141
+
142
+ // don't do anything if the plugin doesn't have a namespace or rules
143
+ if (
144
+ !pluginNamespace ||
145
+ pluginNamespace === userNamespace ||
146
+ (!config.rules && !config.processor && !config.language)
147
+ ) {
148
+ return config;
149
+ }
150
+
151
+ const result = { ...config };
152
+
153
+ // update the rules
154
+ if (result.rules) {
155
+ const ruleIds = Object.keys(result.rules);
156
+
157
+ /** @type {Record<string,RuleEntry|undefined>} */
158
+ const newRules = {};
159
+
160
+ for (let i = 0; i < ruleIds.length; i++) {
161
+ const ruleId = ruleIds[i];
162
+ const { namespace: ruleNamespace, name: ruleName } =
163
+ getPluginMember(ruleId);
164
+
165
+ if (ruleNamespace === pluginNamespace) {
166
+ newRules[`${userNamespace}/${ruleName}`] = result.rules[ruleId];
167
+ } else {
168
+ newRules[ruleId] = result.rules[ruleId];
169
+ }
170
+ }
171
+
172
+ result.rules = newRules;
173
+ }
174
+
175
+ // update the processor
176
+
177
+ if (typeof result.processor === "string") {
178
+ const { namespace: processorNamespace, name: processorName } =
179
+ getPluginMember(result.processor);
180
+
181
+ if (processorNamespace) {
182
+ if (processorNamespace === pluginNamespace) {
183
+ result.processor = `${userNamespace}/${processorName}`;
184
+ }
185
+ }
186
+ }
187
+
188
+ // update the language
189
+ if (typeof result.language === "string") {
190
+ const { namespace: languageNamespace, name: languageName } =
191
+ getPluginMember(result.language);
192
+
193
+ if (languageNamespace === pluginNamespace) {
194
+ result.language = `${userNamespace}/${languageName}`;
195
+ }
196
+ }
197
+
198
+ return result;
199
+ }
200
+
201
+ /**
202
+ * Deeply normalizes a plugin config, traversing recursively into an arrays.
203
+ * @param {string} userPluginNamespace The namespace of the plugin.
204
+ * @param {Plugin} plugin The plugin object.
205
+ * @param {Config|LegacyConfig|(Config|LegacyConfig)[]} pluginConfig The plugin config to normalize.
206
+ * @param {string} pluginConfigName The name of the plugin config.
207
+ * @return {InfiniteConfigArray} The normalized plugin config.
208
+ * @throws {TypeError} If the plugin config is a legacy config.
209
+ */
210
+ function deepNormalizePluginConfig(
211
+ userPluginNamespace,
212
+ plugin,
213
+ pluginConfig,
214
+ pluginConfigName,
215
+ ) {
216
+ // if it's an array then it's definitely a new config
217
+ if (Array.isArray(pluginConfig)) {
218
+ return pluginConfig.map(pluginSubConfig =>
219
+ deepNormalizePluginConfig(
220
+ userPluginNamespace,
221
+ plugin,
222
+ pluginSubConfig,
223
+ pluginConfigName,
224
+ ),
225
+ );
226
+ }
227
+
228
+ // if it's a legacy config, throw an error
229
+ if (isLegacyConfig(pluginConfig)) {
230
+ throw new TypeError(
231
+ `Plugin config "${pluginConfigName}" is an eslintrc config and cannot be used in this context.`,
232
+ );
233
+ }
234
+
235
+ return normalizePluginConfig(userPluginNamespace, plugin, pluginConfig);
236
+ }
237
+
238
+ /**
239
+ * Finds a plugin config by name in the given config.
240
+ * @param {Config} config The config object.
241
+ * @param {string} pluginConfigName The name of the plugin config.
242
+ * @return {InfiniteConfigArray} The plugin config.
243
+ * @throws {TypeError} If the plugin config is not found or is a legacy config.
244
+ */
245
+ function findPluginConfig(config, pluginConfigName) {
246
+ const { namespace: userPluginNamespace, name: configName } =
247
+ getPluginMember(pluginConfigName);
248
+ const plugin = config.plugins?.[userPluginNamespace];
249
+
250
+ if (!plugin) {
251
+ throw new TypeError(`Plugin "${userPluginNamespace}" not found.`);
252
+ }
253
+
254
+ const directConfig = plugin.configs?.[configName];
255
+ if (directConfig) {
256
+ // Arrays are always flat configs, and non-legacy configs can be used directly
257
+ if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
258
+ return deepNormalizePluginConfig(
259
+ userPluginNamespace,
260
+ plugin,
261
+ directConfig,
262
+ pluginConfigName,
263
+ );
264
+ }
265
+
266
+ // If it's a legacy config, look for the flat version
267
+ const flatConfig = plugin.configs?.[`flat/${configName}`];
268
+
269
+ if (
270
+ flatConfig &&
271
+ (Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
272
+ ) {
273
+ return deepNormalizePluginConfig(
274
+ userPluginNamespace,
275
+ plugin,
276
+ flatConfig,
277
+ pluginConfigName,
278
+ );
279
+ }
280
+
281
+ throw new TypeError(
282
+ `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`,
283
+ );
284
+ }
285
+
286
+ throw new TypeError(
287
+ `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`,
288
+ );
289
+ }
290
+
291
+ /**
292
+ * Flattens an array while keeping track of the index path.
293
+ * @param {any[]} configList The array to traverse.
294
+ * @param {string} indexPath The index path of the value in a multidimensional array.
295
+ * @return {IterableIterator<{indexPath:string, value:any}>} The flattened list of values.
296
+ */
297
+ function* flatTraverse(configList, indexPath = "") {
298
+ for (let i = 0; i < configList.length; i++) {
299
+ const newIndexPath = indexPath ? `${indexPath}[${i}]` : `[${i}]`;
300
+
301
+ // if it's an array then traverse it as well
302
+ if (Array.isArray(configList[i])) {
303
+ yield* flatTraverse(configList[i], newIndexPath);
304
+ continue;
305
+ }
306
+
307
+ yield { indexPath: newIndexPath, value: configList[i] };
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Extends a list of config files by creating every combination of base and extension files.
313
+ * @param {(string|string[])[]} [baseFiles] The base files.
314
+ * @param {(string|string[])[]} [extensionFiles] The extension files.
315
+ * @return {(string|string[])[]} The extended files.
316
+ */
317
+ function extendConfigFiles(baseFiles = [], extensionFiles = []) {
318
+ if (!extensionFiles.length) {
319
+ return baseFiles.concat();
320
+ }
321
+
322
+ if (!baseFiles.length) {
323
+ return extensionFiles.concat();
324
+ }
325
+
326
+ /** @type {(string|string[])[]} */
327
+ const result = [];
328
+
329
+ for (const baseFile of baseFiles) {
330
+ for (const extensionFile of extensionFiles) {
331
+ /*
332
+ * Each entry can be a string or array of strings. The end result
333
+ * needs to be an array of strings, so we need to be sure to include
334
+ * all of the items when there's an array.
335
+ */
336
+
337
+ const entry = [];
338
+
339
+ if (Array.isArray(baseFile)) {
340
+ entry.push(...baseFile);
341
+ } else {
342
+ entry.push(baseFile);
343
+ }
344
+
345
+ if (Array.isArray(extensionFile)) {
346
+ entry.push(...extensionFile);
347
+ } else {
348
+ entry.push(extensionFile);
349
+ }
350
+
351
+ result.push(entry);
352
+ }
353
+ }
354
+
355
+ return result;
356
+ }
357
+
358
+ /**
359
+ * Extends a config object with another config object.
360
+ * @param {Config} baseConfig The base config object.
361
+ * @param {string} baseConfigName The name of the base config object.
362
+ * @param {Config} extension The extension config object.
363
+ * @param {string} extensionName The index of the extension config object.
364
+ * @return {Config} The extended config object.
365
+ */
366
+ function extendConfig(baseConfig, baseConfigName, extension, extensionName) {
367
+ const result = { ...extension };
368
+
369
+ // for global ignores there is no further work to be done, we just keep everything
370
+ if (!isGlobalIgnores(extension)) {
371
+ // for files we need to create every combination of base and extension files
372
+ if (baseConfig.files) {
373
+ result.files = extendConfigFiles(baseConfig.files, extension.files);
374
+ }
375
+
376
+ // for ignores we just concatenation the extension ignores onto the base ignores
377
+ if (baseConfig.ignores) {
378
+ result.ignores = baseConfig.ignores.concat(extension.ignores ?? []);
379
+ }
380
+ }
381
+
382
+ result.name = `${baseConfigName} > ${extensionName}`;
383
+
384
+ // @ts-ignore -- ESLint types aren't updated yet
385
+ if (baseConfig.basePath) {
386
+ // @ts-ignore -- ESLint types aren't updated yet
387
+ result.basePath = baseConfig.basePath;
388
+ }
389
+
390
+ return result;
391
+ }
392
+
393
+ /**
394
+ * Processes a list of extends elements.
395
+ * @param {ConfigWithExtends} config The config object.
396
+ * @param {WeakMap<Config, string>} configNames The map of config objects to their names.
397
+ * @return {Config[]} The flattened list of config objects.
398
+ * @throws {TypeError} If the `extends` property is not an array or if nested `extends` is found.
399
+ */
400
+ function processExtends(config, configNames) {
401
+ if (!config.extends) {
402
+ return [config];
403
+ }
404
+
405
+ if (!Array.isArray(config.extends)) {
406
+ throw new TypeError("The `extends` property must be an array.");
407
+ }
408
+
409
+ const {
410
+ /** @type {Config[]} */
411
+ extends: extendsList,
412
+
413
+ /** @type {Config} */
414
+ ...configObject
415
+ } = config;
416
+
417
+ const extensionNames = new WeakMap();
418
+
419
+ // replace strings with the actual configs
420
+ const objectExtends = extendsList.map(extendsElement => {
421
+ if (typeof extendsElement === "string") {
422
+ const pluginConfig = findPluginConfig(config, extendsElement);
423
+
424
+ // assign names
425
+ if (Array.isArray(pluginConfig)) {
426
+ pluginConfig.forEach((pluginConfigElement, index) => {
427
+ extensionNames.set(
428
+ pluginConfigElement,
429
+ `${extendsElement}[${index}]`,
430
+ );
431
+ });
432
+ } else {
433
+ extensionNames.set(pluginConfig, extendsElement);
434
+ }
435
+
436
+ return pluginConfig;
437
+ }
438
+
439
+ return /** @type {Config} */ (extendsElement);
440
+ });
441
+
442
+ const result = [];
443
+
444
+ for (const { indexPath, value: extendsElement } of flatTraverse(
445
+ objectExtends,
446
+ )) {
447
+ const extension = /** @type {Config} */ (extendsElement);
448
+
449
+ if ("basePath" in extension) {
450
+ throw new TypeError("'basePath' in `extends` is not allowed.");
451
+ }
452
+
453
+ if ("extends" in extension) {
454
+ throw new TypeError("Nested 'extends' is not allowed.");
455
+ }
456
+
457
+ const baseConfigName = /** @type {string} */ (configNames.get(config));
458
+ const extensionName =
459
+ extensionNames.get(extendsElement) ??
460
+ getExtensionName(extendsElement, indexPath);
461
+
462
+ result.push(
463
+ extendConfig(
464
+ configObject,
465
+ baseConfigName,
466
+ extension,
467
+ extensionName,
468
+ ),
469
+ );
470
+ }
471
+
472
+ /*
473
+ * If the base config object has only `ignores` and `extends`, then
474
+ * removing `extends` turns it into a global ignores, which is not what
475
+ * we want. So we need to check if the base config object is a global ignores
476
+ * and if so, we don't add it to the array.
477
+ *
478
+ * (The other option would be to add a `files` entry, but that would result
479
+ * in a config that didn't actually do anything because there are no
480
+ * other keys in the config.)
481
+ */
482
+ if (!isGlobalIgnores(configObject)) {
483
+ result.push(configObject);
484
+ }
485
+
486
+ return result.flat();
487
+ }
488
+
489
+ /**
490
+ * Processes a list of config objects and arrays.
491
+ * @param {ConfigWithExtends[]} configList The list of config objects and arrays.
492
+ * @param {WeakMap<Config, string>} configNames The map of config objects to their names.
493
+ * @return {Config[]} The flattened list of config objects.
494
+ */
495
+ function processConfigList(configList, configNames) {
496
+ return configList.flatMap(config => processExtends(config, configNames));
497
+ }
498
+
499
+ //-----------------------------------------------------------------------------
500
+ // Exports
501
+ //-----------------------------------------------------------------------------
502
+
503
+ /**
504
+ * Helper function to define a config array.
505
+ * @param {ConfigWithExtendsArray} args The arguments to the function.
506
+ * @returns {Config[]} The config array.
507
+ * @throws {TypeError} If no arguments are provided or if an argument is not an object.
508
+ */
509
+ function defineConfig(...args) {
510
+ const configNames = new WeakMap();
511
+ const configs = [];
512
+
513
+ if (args.length === 0) {
514
+ throw new TypeError("Expected one or more arguments.");
515
+ }
516
+
517
+ // first flatten the list of configs and get the names
518
+ for (const { indexPath, value } of flatTraverse(args)) {
519
+ if (typeof value !== "object" || value === null) {
520
+ throw new TypeError(
521
+ `Expected an object but received ${String(value)}.`,
522
+ );
523
+ }
524
+
525
+ const config = /** @type {ConfigWithExtends} */ (value);
526
+
527
+ // save config name for easy reference later
528
+ configNames.set(config, getConfigName(config, indexPath));
529
+ configs.push(config);
530
+ }
531
+
532
+ return processConfigList(configs, configNames);
533
+ }
534
+
535
+ /**
536
+ * @fileoverview Global ignores helper function.
537
+ * @author Nicholas C. Zakas
538
+ */
539
+
540
+ //-----------------------------------------------------------------------------
541
+ // Type Definitions
542
+ //-----------------------------------------------------------------------------
543
+
544
+
545
+ //-----------------------------------------------------------------------------
546
+ // Helpers
547
+ //-----------------------------------------------------------------------------
548
+
549
+ let globalIgnoreCount = 0;
550
+
551
+ //-----------------------------------------------------------------------------
552
+ // Exports
553
+ //-----------------------------------------------------------------------------
554
+
555
+ /**
556
+ * Creates a global ignores config with the given patterns.
557
+ * @param {string[]} ignorePatterns The ignore patterns.
558
+ * @param {string} [name] The name of the global ignores config.
559
+ * @returns {Config} The global ignores config.
560
+ * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
561
+ */
562
+ function globalIgnores(ignorePatterns, name) {
563
+ if (!Array.isArray(ignorePatterns)) {
564
+ throw new TypeError("ignorePatterns must be an array");
565
+ }
566
+
567
+ if (ignorePatterns.length === 0) {
568
+ throw new TypeError("ignorePatterns must contain at least one pattern");
569
+ }
570
+
571
+ const id = globalIgnoreCount++;
572
+
573
+ return {
574
+ name: name || `globalIgnores ${id}`,
575
+ ignores: ignorePatterns,
576
+ };
577
+ }
578
+
579
+ export { defineConfig, globalIgnores };
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/types.d.ts ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for this package.
3
+ */
4
+ import type { Linter } from "eslint";
5
+ /**
6
+ * Infinite array type.
7
+ */
8
+ export type InfiniteArray<T> = T | InfiniteArray<T>[];
9
+ /**
10
+ * The type of array element in the `extends` property after flattening.
11
+ */
12
+ export type SimpleExtendsElement = string | Linter.Config;
13
+ /**
14
+ * The type of array element in the `extends` property before flattening.
15
+ */
16
+ export type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;
17
+ /**
18
+ * Config with extends. Valid only inside of `defineConfig()`.
19
+ */
20
+ export interface ConfigWithExtends extends Linter.Config {
21
+ extends?: ExtendsElement[];
22
+ }
23
+ export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/dist/esm/types.ts ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Types for this package.
3
+ */
4
+
5
+ import type { Linter } from "eslint";
6
+
7
+ /**
8
+ * Infinite array type.
9
+ */
10
+ export type InfiniteArray<T> = T | InfiniteArray<T>[];
11
+
12
+ /**
13
+ * The type of array element in the `extends` property after flattening.
14
+ */
15
+ export type SimpleExtendsElement = string | Linter.Config;
16
+
17
+ /**
18
+ * The type of array element in the `extends` property before flattening.
19
+ */
20
+ export type ExtendsElement =
21
+ | SimpleExtendsElement
22
+ | InfiniteArray<Linter.Config>;
23
+
24
+ /**
25
+ * Config with extends. Valid only inside of `defineConfig()`.
26
+ */
27
+ export interface ConfigWithExtends extends Linter.Config {
28
+ extends?: ExtendsElement[];
29
+ }
30
+
31
+ export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/config-helpers/package.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@eslint/config-helpers",
3
+ "version": "0.3.0",
4
+ "description": "Helper utilities for creating ESLint configuration",
5
+ "type": "module",
6
+ "main": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "exports": {
9
+ "require": {
10
+ "types": "./dist/cjs/index.d.cts",
11
+ "default": "./dist/cjs/index.cjs"
12
+ },
13
+ "import": {
14
+ "types": "./dist/esm/index.d.ts",
15
+ "default": "./dist/esm/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "directories": {
25
+ "test": "tests"
26
+ },
27
+ "scripts": {
28
+ "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
29
+ "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
30
+ "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
31
+ "test:jsr": "npx jsr@latest publish --dry-run",
32
+ "test": "mocha tests/*.js",
33
+ "test:coverage": "c8 npm test",
34
+ "test:types": "tsc -p tests/types/tsconfig.json"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/eslint/rewrite.git",
39
+ "directory": "packages/config-helpers"
40
+ },
41
+ "keywords": [
42
+ "eslint"
43
+ ],
44
+ "license": "Apache-2.0",
45
+ "bugs": {
46
+ "url": "https://github.com/eslint/rewrite/issues"
47
+ },
48
+ "homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-helpers#readme",
49
+ "devDependencies": {
50
+ "@eslint/core": "^0.15.1",
51
+ "eslint": "^9.27.0",
52
+ "rollup-plugin-copy": "^3.5.0"
53
+ },
54
+ "engines": {
55
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
56
+ }
57
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ESLint Core
2
+
3
+ ## Overview
4
+
5
+ This package is the future home of the rewritten, runtime-agnostic ESLint core.
6
+
7
+ Right now, it exports the core types necessary to implement language plugins.
8
+
9
+ ## License
10
+
11
+ Apache 2.0
12
+
13
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
14
+ <!--sponsorsstart-->
15
+
16
+ ## Sponsors
17
+
18
+ The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
19
+ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
20
+
21
+ <h3>Diamond Sponsors</h3>
22
+ <p><a href="https://www.ag-grid.com/"><img src="https://images.opencollective.com/ag-grid/bec0580/logo.png" alt="AG Grid" height="128"></a></p><h3>Platinum Sponsors</h3>
23
+ <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
24
+ <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
25
+ <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
26
+ <p><a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
27
+ <h3>Technology Sponsors</h3>
28
+ Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
29
+ <p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
30
+ <!--sponsorsend-->
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/dist/cjs/types.d.cts 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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Shared types for ESLint Core.
3
+ */
4
+ import type { JSONSchema4 } from "json-schema";
5
+ /**
6
+ * Represents an error inside of a file.
7
+ */
8
+ export interface FileError {
9
+ message: string;
10
+ line: number;
11
+ column: number;
12
+ endLine?: number;
13
+ endColumn?: number;
14
+ }
15
+ /**
16
+ * Represents a problem found in a file.
17
+ */
18
+ export interface FileProblem {
19
+ ruleId: string | null;
20
+ message: string;
21
+ loc: SourceLocation;
22
+ }
23
+ /**
24
+ * Represents the start and end coordinates of a node inside the source.
25
+ */
26
+ export interface SourceLocation {
27
+ start: Position;
28
+ end: Position;
29
+ }
30
+ /**
31
+ * Represents the start and end coordinates of a node inside the source with an offset.
32
+ */
33
+ export interface SourceLocationWithOffset {
34
+ start: PositionWithOffset;
35
+ end: PositionWithOffset;
36
+ }
37
+ /**
38
+ * Represents a location coordinate inside the source. ESLint-style formats
39
+ * have just `line` and `column` while others may have `offset` as well.
40
+ */
41
+ export interface Position {
42
+ line: number;
43
+ column: number;
44
+ }
45
+ /**
46
+ * Represents a location coordinate inside the source with an offset.
47
+ */
48
+ export interface PositionWithOffset extends Position {
49
+ offset: number;
50
+ }
51
+ /**
52
+ * Represents a range of characters in the source.
53
+ */
54
+ export type SourceRange = [number, number];
55
+ /**
56
+ * What the rule is responsible for finding:
57
+ * - `problem` means the rule has noticed a potential error.
58
+ * - `suggestion` means the rule suggests an alternate or better approach.
59
+ * - `layout` means the rule is looking at spacing, indentation, etc.
60
+ */
61
+ export type RuleType = "problem" | "suggestion" | "layout";
62
+ /**
63
+ * The type of fix the rule can provide:
64
+ * - `code` means the rule can fix syntax.
65
+ * - `whitespace` means the rule can fix spacing and indentation.
66
+ */
67
+ export type RuleFixType = "code" | "whitespace";
68
+ /**
69
+ * An object containing visitor information for a rule. Each method is either the
70
+ * name of a node type or a selector, or is a method that will be called at specific
71
+ * times during the traversal.
72
+ */
73
+ export type RuleVisitor = Record<string, ((...args: any[]) => void) | undefined>;
74
+ /**
75
+ * Rule meta information used for documentation.
76
+ */
77
+ export interface RulesMetaDocs {
78
+ /**
79
+ * A short description of the rule.
80
+ */
81
+ description?: string | undefined;
82
+ /**
83
+ * The URL to the documentation for the rule.
84
+ */
85
+ url?: string | undefined;
86
+ /**
87
+ * The category the rule falls under.
88
+ * @deprecated No longer used.
89
+ */
90
+ category?: string | undefined;
91
+ /**
92
+ * Indicates if the rule is generally recommended for all users.
93
+ */
94
+ recommended?: boolean | undefined;
95
+ /**
96
+ * Indicates if the rule is frozen (no longer accepting feature requests).
97
+ */
98
+ frozen?: boolean | undefined;
99
+ }
100
+ /**
101
+ * Meta information about a rule.
102
+ */
103
+ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
104
+ /**
105
+ * Properties that are used when documenting the rule.
106
+ */
107
+ docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
108
+ /**
109
+ * The type of rule.
110
+ */
111
+ type?: RuleType | undefined;
112
+ /**
113
+ * The schema for the rule options. Required if the rule has options.
114
+ */
115
+ schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
116
+ /**
117
+ * Any default options to be recursively merged on top of any user-provided options.
118
+ **/
119
+ defaultOptions?: RuleOptions;
120
+ /**
121
+ * The messages that the rule can report.
122
+ */
123
+ messages?: Record<MessageIds, string>;
124
+ /**
125
+ * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
126
+ */
127
+ deprecated?: boolean | DeprecatedInfo | undefined;
128
+ /**
129
+ * @deprecated Use deprecated.replacedBy instead.
130
+ * The name of the rule(s) this rule was replaced by, if it was deprecated.
131
+ */
132
+ replacedBy?: readonly string[] | undefined;
133
+ /**
134
+ * Indicates if the rule is fixable, and if so, what type of fix it provides.
135
+ */
136
+ fixable?: RuleFixType | undefined;
137
+ /**
138
+ * Indicates if the rule may provide suggestions.
139
+ */
140
+ hasSuggestions?: boolean | undefined;
141
+ /**
142
+ * The language the rule is intended to lint.
143
+ */
144
+ language?: string;
145
+ /**
146
+ * The dialects of `language` that the rule is intended to lint.
147
+ */
148
+ dialects?: string[];
149
+ }
150
+ /**
151
+ * Provides additional metadata about a deprecation.
152
+ */
153
+ export interface DeprecatedInfo {
154
+ /**
155
+ * General message presented to the user, e.g. for the key rule why the rule
156
+ * is deprecated or for info how to replace the rule.
157
+ */
158
+ message?: string;
159
+ /**
160
+ * URL to more information about this deprecation in general.
161
+ */
162
+ url?: string;
163
+ /**
164
+ * An empty array explicitly states that there is no replacement.
165
+ */
166
+ replacedBy?: ReplacedByInfo[];
167
+ /**
168
+ * The package version since when the rule is deprecated (should use full
169
+ * semver without a leading "v").
170
+ */
171
+ deprecatedSince?: string;
172
+ /**
173
+ * The estimated version when the rule is removed (probably the next major
174
+ * version). null means the rule is "frozen" (will be available but will not
175
+ * be changed).
176
+ */
177
+ availableUntil?: string | null;
178
+ }
179
+ /**
180
+ * Provides metadata about a replacement
181
+ */
182
+ export interface ReplacedByInfo {
183
+ /**
184
+ * General message presented to the user, e.g. how to replace the rule
185
+ */
186
+ message?: string;
187
+ /**
188
+ * URL to more information about this replacement in general
189
+ */
190
+ url?: string;
191
+ /**
192
+ * Name should be "eslint" if the replacement is an ESLint core rule. Omit
193
+ * the property if the replacement is in the same plugin.
194
+ */
195
+ plugin?: ExternalSpecifier;
196
+ /**
197
+ * Name and documentation of the replacement rule
198
+ */
199
+ rule?: ExternalSpecifier;
200
+ }
201
+ /**
202
+ * Specifies the name and url of an external resource. At least one property
203
+ * should be set.
204
+ */
205
+ export interface ExternalSpecifier {
206
+ /**
207
+ * Name of the referenced plugin / rule.
208
+ */
209
+ name?: string;
210
+ /**
211
+ * URL pointing to documentation for the plugin / rule.
212
+ */
213
+ url?: string;
214
+ }
215
+ /**
216
+ * Generic type for `RuleContext`.
217
+ */
218
+ export interface RuleContextTypeOptions {
219
+ LangOptions: LanguageOptions;
220
+ Code: SourceCode;
221
+ RuleOptions: unknown[];
222
+ Node: unknown;
223
+ MessageIds: string;
224
+ }
225
+ /**
226
+ * Represents the context object that is passed to a rule. This object contains
227
+ * information about the current state of the linting process and is the rule's
228
+ * view into the outside world.
229
+ */
230
+ export interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
231
+ /**
232
+ * The current working directory for the session.
233
+ */
234
+ cwd: string;
235
+ /**
236
+ * Returns the current working directory for the session.
237
+ * @deprecated Use `cwd` instead.
238
+ */
239
+ getCwd(): string;
240
+ /**
241
+ * The filename of the file being linted.
242
+ */
243
+ filename: string;
244
+ /**
245
+ * Returns the filename of the file being linted.
246
+ * @deprecated Use `filename` instead.
247
+ */
248
+ getFilename(): string;
249
+ /**
250
+ * The physical filename of the file being linted.
251
+ */
252
+ physicalFilename: string;
253
+ /**
254
+ * Returns the physical filename of the file being linted.
255
+ * @deprecated Use `physicalFilename` instead.
256
+ */
257
+ getPhysicalFilename(): string;
258
+ /**
259
+ * The source code object that the rule is running on.
260
+ */
261
+ sourceCode: Options["Code"];
262
+ /**
263
+ * Returns the source code object that the rule is running on.
264
+ * @deprecated Use `sourceCode` instead.
265
+ */
266
+ getSourceCode(): Options["Code"];
267
+ /**
268
+ * Shared settings for the configuration.
269
+ */
270
+ settings: SettingsConfig;
271
+ /**
272
+ * Parser-specific options for the configuration.
273
+ * @deprecated Use `languageOptions.parserOptions` instead.
274
+ */
275
+ parserOptions: Record<string, unknown>;
276
+ /**
277
+ * The language options for the configuration.
278
+ */
279
+ languageOptions: Options["LangOptions"];
280
+ /**
281
+ * The CommonJS path to the parser used while parsing this file.
282
+ * @deprecated No longer used.
283
+ */
284
+ parserPath: string | undefined;
285
+ /**
286
+ * The rule ID.
287
+ */
288
+ id: string;
289
+ /**
290
+ * The rule's configured options.
291
+ */
292
+ options: Options["RuleOptions"];
293
+ /**
294
+ * The report function that the rule should use to report problems.
295
+ * @param violation The violation to report.
296
+ */
297
+ report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
298
+ }
299
+ /**
300
+ * Manager of text edits for a rule fix.
301
+ */
302
+ export interface RuleTextEditor<EditableSyntaxElement = unknown> {
303
+ /**
304
+ * Inserts text after the specified node or token.
305
+ * @param syntaxElement The node or token to insert after.
306
+ * @param text The edit to insert after the node or token.
307
+ */
308
+ insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
309
+ /**
310
+ * Inserts text after the specified range.
311
+ * @param range The range to insert after.
312
+ * @param text The edit to insert after the range.
313
+ */
314
+ insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
315
+ /**
316
+ * Inserts text before the specified node or token.
317
+ * @param syntaxElement A syntax element with location information to insert before.
318
+ * @param text The edit to insert before the node or token.
319
+ */
320
+ insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
321
+ /**
322
+ * Inserts text before the specified range.
323
+ * @param range The range to insert before.
324
+ * @param text The edit to insert before the range.
325
+ */
326
+ insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
327
+ /**
328
+ * Removes the specified node or token.
329
+ * @param syntaxElement A syntax element with location information to remove.
330
+ * @returns The edit to remove the node or token.
331
+ */
332
+ remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
333
+ /**
334
+ * Removes the specified range.
335
+ * @param range The range to remove.
336
+ * @returns The edit to remove the range.
337
+ */
338
+ removeRange(range: SourceRange): RuleTextEdit;
339
+ /**
340
+ * Replaces the specified node or token with the given text.
341
+ * @param syntaxElement A syntax element with location information to replace.
342
+ * @param text The text to replace the node or token with.
343
+ * @returns The edit to replace the node or token.
344
+ */
345
+ replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
346
+ /**
347
+ * Replaces the specified range with the given text.
348
+ * @param range The range to replace.
349
+ * @param text The text to replace the range with.
350
+ * @returns The edit to replace the range.
351
+ */
352
+ replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
353
+ }
354
+ /**
355
+ * Represents a fix for a rule violation implemented as a text edit.
356
+ */
357
+ export interface RuleTextEdit {
358
+ /**
359
+ * The range to replace.
360
+ */
361
+ range: SourceRange;
362
+ /**
363
+ * The text to insert.
364
+ */
365
+ text: string;
366
+ }
367
+ /**
368
+ * Fixes a violation.
369
+ * @param fixer The text editor to apply the fix.
370
+ * @returns The fix(es) for the violation.
371
+ */
372
+ type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
373
+ interface ViolationReportBase {
374
+ /**
375
+ * The type of node that the violation is for.
376
+ * @deprecated May be removed in the future.
377
+ */
378
+ nodeType?: string | undefined;
379
+ /**
380
+ * The data to insert into the message.
381
+ */
382
+ data?: Record<string, string> | undefined;
383
+ /**
384
+ * The fix to be applied for the violation.
385
+ */
386
+ fix?: RuleFixer | null | undefined;
387
+ /**
388
+ * An array of suggested fixes for the problem. These fixes may change the
389
+ * behavior of the code, so they are not applied automatically.
390
+ */
391
+ suggest?: SuggestedEdit[] | null | undefined;
392
+ }
393
+ type ViolationMessage<MessageIds = string> = {
394
+ message: string;
395
+ } | {
396
+ messageId: MessageIds;
397
+ };
398
+ type ViolationLocation<Node> = {
399
+ loc: SourceLocation | Position;
400
+ } | {
401
+ node: Node;
402
+ };
403
+ export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
404
+ interface SuggestedEditBase {
405
+ /**
406
+ * The data to insert into the message.
407
+ */
408
+ data?: Record<string, string> | undefined;
409
+ /**
410
+ * The fix to be applied for the suggestion.
411
+ */
412
+ fix?: RuleFixer | null | undefined;
413
+ }
414
+ type SuggestionMessage = {
415
+ desc: string;
416
+ } | {
417
+ messageId: string;
418
+ };
419
+ /**
420
+ * A suggested edit for a rule violation.
421
+ */
422
+ export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
423
+ /**
424
+ * Generic options for the `RuleDefinition` type.
425
+ */
426
+ export interface RuleDefinitionTypeOptions {
427
+ LangOptions: LanguageOptions;
428
+ Code: SourceCode;
429
+ RuleOptions: unknown[];
430
+ Visitor: RuleVisitor;
431
+ Node: unknown;
432
+ MessageIds: string;
433
+ ExtRuleDocs: unknown;
434
+ }
435
+ /**
436
+ * The definition of an ESLint rule.
437
+ */
438
+ export interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
439
+ /**
440
+ * The meta information for the rule.
441
+ */
442
+ meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
443
+ /**
444
+ * Creates the visitor that ESLint uses to apply the rule during traversal.
445
+ * @param context The rule context.
446
+ * @returns The rule visitor.
447
+ */
448
+ create(context: RuleContext<{
449
+ LangOptions: Options["LangOptions"];
450
+ Code: Options["Code"];
451
+ RuleOptions: Options["RuleOptions"];
452
+ Node: Options["Node"];
453
+ MessageIds: Options["MessageIds"];
454
+ }>): Options["Visitor"];
455
+ }
456
+ /**
457
+ * Defaults for non-language-related `RuleDefinition` options.
458
+ */
459
+ export interface CustomRuleTypeDefinitions {
460
+ RuleOptions: unknown[];
461
+ MessageIds: string;
462
+ ExtRuleDocs: Record<string, unknown>;
463
+ }
464
+ /**
465
+ * A helper type to define language specific specializations of the `RuleDefinition` type.
466
+ *
467
+ * @example
468
+ * ```ts
469
+ * type YourRuleDefinition<
470
+ * Options extends Partial<CustomRuleTypeDefinitions> = {},
471
+ * > = CustomRuleDefinitionType<
472
+ * {
473
+ * LangOptions: YourLanguageOptions;
474
+ * Code: YourSourceCode;
475
+ * Visitor: YourRuleVisitor;
476
+ * Node: YourNode;
477
+ * },
478
+ * Options
479
+ * >;
480
+ * ```
481
+ */
482
+ export type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = RuleDefinition<LanguageSpecificOptions & Required<Options & Omit<CustomRuleTypeDefinitions, keyof Options>>>;
483
+ /**
484
+ * The human readable severity level used in a configuration.
485
+ */
486
+ export type SeverityName = "off" | "warn" | "error";
487
+ /**
488
+ * The numeric severity level for a rule.
489
+ *
490
+ * - `0` means off.
491
+ * - `1` means warn.
492
+ * - `2` means error.
493
+ */
494
+ export type SeverityLevel = 0 | 1 | 2;
495
+ /**
496
+ * The severity of a rule in a configuration.
497
+ */
498
+ export type Severity = SeverityName | SeverityLevel;
499
+ /**
500
+ * Represents the configuration options for the core linter.
501
+ */
502
+ export interface LinterOptionsConfig {
503
+ /**
504
+ * Indicates whether or not inline configuration is evaluated.
505
+ */
506
+ noInlineConfig?: boolean;
507
+ /**
508
+ * Indicates what to do when an unused disable directive is found.
509
+ */
510
+ reportUnusedDisableDirectives?: boolean | Severity;
511
+ /**
512
+ * A severity value indicating if and how unused inline configs should be
513
+ * tracked and reported.
514
+ */
515
+ reportUnusedInlineConfigs?: Severity;
516
+ }
517
+ /**
518
+ * The configuration for a rule.
519
+ */
520
+ export type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
521
+ /**
522
+ * A collection of rules and their configurations.
523
+ */
524
+ export interface RulesConfig {
525
+ [key: string]: RuleConfig;
526
+ }
527
+ /**
528
+ * A collection of settings.
529
+ */
530
+ export interface SettingsConfig {
531
+ [key: string]: unknown;
532
+ }
533
+ /**
534
+ * Generic options for the `Language` type.
535
+ */
536
+ export interface LanguageTypeOptions {
537
+ LangOptions: LanguageOptions;
538
+ Code: SourceCode;
539
+ RootNode: unknown;
540
+ Node: unknown;
541
+ }
542
+ /**
543
+ * Represents a plugin language.
544
+ */
545
+ export interface Language<Options extends LanguageTypeOptions = {
546
+ LangOptions: LanguageOptions;
547
+ Code: SourceCode;
548
+ RootNode: unknown;
549
+ Node: unknown;
550
+ }> {
551
+ /**
552
+ * Indicates how ESLint should read the file.
553
+ */
554
+ fileType: "text";
555
+ /**
556
+ * First line number returned from the parser (text mode only).
557
+ */
558
+ lineStart: 0 | 1;
559
+ /**
560
+ * First column number returned from the parser (text mode only).
561
+ */
562
+ columnStart: 0 | 1;
563
+ /**
564
+ * The property to read the node type from. Used in selector querying.
565
+ */
566
+ nodeTypeKey: string;
567
+ /**
568
+ * The traversal path that tools should take when evaluating the AST
569
+ */
570
+ visitorKeys?: Record<string, string[]>;
571
+ /**
572
+ * Default language options. User-defined options are merged with this object.
573
+ */
574
+ defaultLanguageOptions?: LanguageOptions;
575
+ /**
576
+ * Validates languageOptions for this language.
577
+ */
578
+ validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
579
+ /**
580
+ * Normalizes languageOptions for this language.
581
+ */
582
+ normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
583
+ /**
584
+ * Helper for esquery that allows languages to match nodes against
585
+ * class. esquery currently has classes like `function` that will
586
+ * match all the various function nodes. This method allows languages
587
+ * to implement similar shorthands.
588
+ */
589
+ matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
590
+ /**
591
+ * Parses the given file input into its component parts. This file should not
592
+ * throws errors for parsing errors but rather should return any parsing
593
+ * errors as parse of the ParseResult object.
594
+ */
595
+ parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
596
+ /**
597
+ * Creates SourceCode object that ESLint uses to work with a file.
598
+ */
599
+ createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
600
+ }
601
+ /**
602
+ * Plugin-defined options for the language.
603
+ */
604
+ export type LanguageOptions = Record<string, unknown>;
605
+ /**
606
+ * The context object that is passed to the language plugin methods.
607
+ */
608
+ export interface LanguageContext<LangOptions = LanguageOptions> {
609
+ languageOptions: LangOptions;
610
+ }
611
+ /**
612
+ * Represents a file read by ESLint.
613
+ */
614
+ export interface File {
615
+ /**
616
+ * The path that ESLint uses for this file. May be a virtual path
617
+ * if it was returned by a processor.
618
+ */
619
+ path: string;
620
+ /**
621
+ * The path to the file on disk. This always maps directly to a file
622
+ * regardless of whether it was returned from a processor.
623
+ */
624
+ physicalPath: string;
625
+ /**
626
+ * Indicates if the original source contained a byte-order marker.
627
+ * ESLint strips the BOM from the `body`, but this info is needed
628
+ * to correctly apply autofixing.
629
+ */
630
+ bom: boolean;
631
+ /**
632
+ * The body of the file to parse.
633
+ */
634
+ body: string | Uint8Array;
635
+ }
636
+ /**
637
+ * Represents the successful result of parsing a file.
638
+ */
639
+ export interface OkParseResult<RootNode = unknown> {
640
+ /**
641
+ * Indicates if the parse was successful. If true, the parse was successful
642
+ * and ESLint should continue on to create a SourceCode object and run rules;
643
+ * if false, ESLint should just report the error(s) without doing anything
644
+ * else.
645
+ */
646
+ ok: true;
647
+ /**
648
+ * The abstract syntax tree created by the parser. (only when ok: true)
649
+ */
650
+ ast: RootNode;
651
+ /**
652
+ * Any additional data that the parser wants to provide.
653
+ */
654
+ [key: string]: any;
655
+ }
656
+ /**
657
+ * Represents the unsuccessful result of parsing a file.
658
+ */
659
+ export interface NotOkParseResult {
660
+ /**
661
+ * Indicates if the parse was successful. If true, the parse was successful
662
+ * and ESLint should continue on to create a SourceCode object and run rules;
663
+ * if false, ESLint should just report the error(s) without doing anything
664
+ * else.
665
+ */
666
+ ok: false;
667
+ /**
668
+ * Any parsing errors, whether fatal or not. (only when ok: false)
669
+ */
670
+ errors: FileError[];
671
+ /**
672
+ * Any additional data that the parser wants to provide.
673
+ */
674
+ [key: string]: any;
675
+ }
676
+ export type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
677
+ /**
678
+ * Represents inline configuration found in the source code.
679
+ */
680
+ interface InlineConfigElement {
681
+ /**
682
+ * The location of the inline config element.
683
+ */
684
+ loc: SourceLocation;
685
+ /**
686
+ * The interpreted configuration from the inline config element.
687
+ */
688
+ config: {
689
+ rules: RulesConfig;
690
+ };
691
+ }
692
+ /**
693
+ * Generic options for the `SourceCodeBase` type.
694
+ */
695
+ export interface SourceCodeBaseTypeOptions {
696
+ LangOptions: LanguageOptions;
697
+ RootNode: unknown;
698
+ SyntaxElementWithLoc: unknown;
699
+ ConfigNode: unknown;
700
+ }
701
+ /**
702
+ * Represents the basic interface for a source code object.
703
+ */
704
+ interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
705
+ LangOptions: LanguageOptions;
706
+ RootNode: unknown;
707
+ SyntaxElementWithLoc: unknown;
708
+ ConfigNode: unknown;
709
+ }> {
710
+ /**
711
+ * Root of the AST.
712
+ */
713
+ ast: Options["RootNode"];
714
+ /**
715
+ * The traversal path that tools should take when evaluating the AST.
716
+ * When present, this overrides the `visitorKeys` on the language for
717
+ * just this source code object.
718
+ */
719
+ visitorKeys?: Record<string, string[]>;
720
+ /**
721
+ * Retrieves the equivalent of `loc` for a given node or token.
722
+ * @param syntaxElement The node or token to get the location for.
723
+ * @returns The location of the node or token.
724
+ */
725
+ getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation;
726
+ /**
727
+ * Retrieves the equivalent of `range` for a given node or token.
728
+ * @param syntaxElement The node or token to get the range for.
729
+ * @returns The range of the node or token.
730
+ */
731
+ getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
732
+ /**
733
+ * Traversal of AST.
734
+ */
735
+ traverse(): Iterable<TraversalStep>;
736
+ /**
737
+ * Applies language options passed in from the ESLint core.
738
+ */
739
+ applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
740
+ /**
741
+ * Return all of the inline areas where ESLint should be disabled/enabled
742
+ * along with any problems found in evaluating the directives.
743
+ */
744
+ getDisableDirectives?(): {
745
+ directives: Directive[];
746
+ problems: FileProblem[];
747
+ };
748
+ /**
749
+ * Returns an array of all inline configuration nodes found in the
750
+ * source code.
751
+ */
752
+ getInlineConfigNodes?(): Options["ConfigNode"][];
753
+ /**
754
+ * Applies configuration found inside of the source code. This method is only
755
+ * called when ESLint is running with inline configuration allowed.
756
+ */
757
+ applyInlineConfig?(): {
758
+ configs: InlineConfigElement[];
759
+ problems: FileProblem[];
760
+ };
761
+ /**
762
+ * Called by ESLint core to indicate that it has finished providing
763
+ * information. We now add in all the missing variables and ensure that
764
+ * state-changing methods cannot be called by rules.
765
+ * @returns {void}
766
+ */
767
+ finalize?(): void;
768
+ }
769
+ /**
770
+ * Represents the source of a text file being linted.
771
+ */
772
+ export interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
773
+ LangOptions: LanguageOptions;
774
+ RootNode: unknown;
775
+ SyntaxElementWithLoc: unknown;
776
+ ConfigNode: unknown;
777
+ }> extends SourceCodeBase<Options> {
778
+ /**
779
+ * The body of the file that you'd like rule developers to access.
780
+ */
781
+ text: string;
782
+ }
783
+ /**
784
+ * Represents the source of a binary file being linted.
785
+ */
786
+ export interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
787
+ LangOptions: LanguageOptions;
788
+ RootNode: unknown;
789
+ SyntaxElementWithLoc: unknown;
790
+ ConfigNode: unknown;
791
+ }> extends SourceCodeBase<Options> {
792
+ /**
793
+ * The body of the file that you'd like rule developers to access.
794
+ */
795
+ body: Uint8Array;
796
+ }
797
+ export type SourceCode<Options extends SourceCodeBaseTypeOptions = {
798
+ LangOptions: LanguageOptions;
799
+ RootNode: unknown;
800
+ SyntaxElementWithLoc: unknown;
801
+ ConfigNode: unknown;
802
+ }> = TextSourceCode<Options> | BinarySourceCode<Options>;
803
+ /**
804
+ * Represents a traversal step visiting the AST.
805
+ */
806
+ export interface VisitTraversalStep {
807
+ kind: 1;
808
+ target: unknown;
809
+ phase: 1 | 2;
810
+ args: unknown[];
811
+ }
812
+ /**
813
+ * Represents a traversal step calling a function.
814
+ */
815
+ export interface CallTraversalStep {
816
+ kind: 2;
817
+ target: string;
818
+ phase?: string;
819
+ args: unknown[];
820
+ }
821
+ export type TraversalStep = VisitTraversalStep | CallTraversalStep;
822
+ /**
823
+ * The type of disable directive. This determines how ESLint will disable rules.
824
+ */
825
+ export type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
826
+ /**
827
+ * Represents a disable directive.
828
+ */
829
+ export interface Directive {
830
+ /**
831
+ * The type of directive.
832
+ */
833
+ type: DirectiveType;
834
+ /**
835
+ * The node of the directive. May be in the AST or a comment/token.
836
+ */
837
+ node: unknown;
838
+ /**
839
+ * The value of the directive.
840
+ */
841
+ value: string;
842
+ /**
843
+ * The justification for the directive.
844
+ */
845
+ justification?: string;
846
+ }
847
+ export {};
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/dist/esm/types.d.ts ADDED
@@ -0,0 +1,847 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Shared types for ESLint Core.
3
+ */
4
+ import type { JSONSchema4 } from "json-schema";
5
+ /**
6
+ * Represents an error inside of a file.
7
+ */
8
+ export interface FileError {
9
+ message: string;
10
+ line: number;
11
+ column: number;
12
+ endLine?: number;
13
+ endColumn?: number;
14
+ }
15
+ /**
16
+ * Represents a problem found in a file.
17
+ */
18
+ export interface FileProblem {
19
+ ruleId: string | null;
20
+ message: string;
21
+ loc: SourceLocation;
22
+ }
23
+ /**
24
+ * Represents the start and end coordinates of a node inside the source.
25
+ */
26
+ export interface SourceLocation {
27
+ start: Position;
28
+ end: Position;
29
+ }
30
+ /**
31
+ * Represents the start and end coordinates of a node inside the source with an offset.
32
+ */
33
+ export interface SourceLocationWithOffset {
34
+ start: PositionWithOffset;
35
+ end: PositionWithOffset;
36
+ }
37
+ /**
38
+ * Represents a location coordinate inside the source. ESLint-style formats
39
+ * have just `line` and `column` while others may have `offset` as well.
40
+ */
41
+ export interface Position {
42
+ line: number;
43
+ column: number;
44
+ }
45
+ /**
46
+ * Represents a location coordinate inside the source with an offset.
47
+ */
48
+ export interface PositionWithOffset extends Position {
49
+ offset: number;
50
+ }
51
+ /**
52
+ * Represents a range of characters in the source.
53
+ */
54
+ export type SourceRange = [number, number];
55
+ /**
56
+ * What the rule is responsible for finding:
57
+ * - `problem` means the rule has noticed a potential error.
58
+ * - `suggestion` means the rule suggests an alternate or better approach.
59
+ * - `layout` means the rule is looking at spacing, indentation, etc.
60
+ */
61
+ export type RuleType = "problem" | "suggestion" | "layout";
62
+ /**
63
+ * The type of fix the rule can provide:
64
+ * - `code` means the rule can fix syntax.
65
+ * - `whitespace` means the rule can fix spacing and indentation.
66
+ */
67
+ export type RuleFixType = "code" | "whitespace";
68
+ /**
69
+ * An object containing visitor information for a rule. Each method is either the
70
+ * name of a node type or a selector, or is a method that will be called at specific
71
+ * times during the traversal.
72
+ */
73
+ export type RuleVisitor = Record<string, ((...args: any[]) => void) | undefined>;
74
+ /**
75
+ * Rule meta information used for documentation.
76
+ */
77
+ export interface RulesMetaDocs {
78
+ /**
79
+ * A short description of the rule.
80
+ */
81
+ description?: string | undefined;
82
+ /**
83
+ * The URL to the documentation for the rule.
84
+ */
85
+ url?: string | undefined;
86
+ /**
87
+ * The category the rule falls under.
88
+ * @deprecated No longer used.
89
+ */
90
+ category?: string | undefined;
91
+ /**
92
+ * Indicates if the rule is generally recommended for all users.
93
+ */
94
+ recommended?: boolean | undefined;
95
+ /**
96
+ * Indicates if the rule is frozen (no longer accepting feature requests).
97
+ */
98
+ frozen?: boolean | undefined;
99
+ }
100
+ /**
101
+ * Meta information about a rule.
102
+ */
103
+ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
104
+ /**
105
+ * Properties that are used when documenting the rule.
106
+ */
107
+ docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
108
+ /**
109
+ * The type of rule.
110
+ */
111
+ type?: RuleType | undefined;
112
+ /**
113
+ * The schema for the rule options. Required if the rule has options.
114
+ */
115
+ schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
116
+ /**
117
+ * Any default options to be recursively merged on top of any user-provided options.
118
+ **/
119
+ defaultOptions?: RuleOptions;
120
+ /**
121
+ * The messages that the rule can report.
122
+ */
123
+ messages?: Record<MessageIds, string>;
124
+ /**
125
+ * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
126
+ */
127
+ deprecated?: boolean | DeprecatedInfo | undefined;
128
+ /**
129
+ * @deprecated Use deprecated.replacedBy instead.
130
+ * The name of the rule(s) this rule was replaced by, if it was deprecated.
131
+ */
132
+ replacedBy?: readonly string[] | undefined;
133
+ /**
134
+ * Indicates if the rule is fixable, and if so, what type of fix it provides.
135
+ */
136
+ fixable?: RuleFixType | undefined;
137
+ /**
138
+ * Indicates if the rule may provide suggestions.
139
+ */
140
+ hasSuggestions?: boolean | undefined;
141
+ /**
142
+ * The language the rule is intended to lint.
143
+ */
144
+ language?: string;
145
+ /**
146
+ * The dialects of `language` that the rule is intended to lint.
147
+ */
148
+ dialects?: string[];
149
+ }
150
+ /**
151
+ * Provides additional metadata about a deprecation.
152
+ */
153
+ export interface DeprecatedInfo {
154
+ /**
155
+ * General message presented to the user, e.g. for the key rule why the rule
156
+ * is deprecated or for info how to replace the rule.
157
+ */
158
+ message?: string;
159
+ /**
160
+ * URL to more information about this deprecation in general.
161
+ */
162
+ url?: string;
163
+ /**
164
+ * An empty array explicitly states that there is no replacement.
165
+ */
166
+ replacedBy?: ReplacedByInfo[];
167
+ /**
168
+ * The package version since when the rule is deprecated (should use full
169
+ * semver without a leading "v").
170
+ */
171
+ deprecatedSince?: string;
172
+ /**
173
+ * The estimated version when the rule is removed (probably the next major
174
+ * version). null means the rule is "frozen" (will be available but will not
175
+ * be changed).
176
+ */
177
+ availableUntil?: string | null;
178
+ }
179
+ /**
180
+ * Provides metadata about a replacement
181
+ */
182
+ export interface ReplacedByInfo {
183
+ /**
184
+ * General message presented to the user, e.g. how to replace the rule
185
+ */
186
+ message?: string;
187
+ /**
188
+ * URL to more information about this replacement in general
189
+ */
190
+ url?: string;
191
+ /**
192
+ * Name should be "eslint" if the replacement is an ESLint core rule. Omit
193
+ * the property if the replacement is in the same plugin.
194
+ */
195
+ plugin?: ExternalSpecifier;
196
+ /**
197
+ * Name and documentation of the replacement rule
198
+ */
199
+ rule?: ExternalSpecifier;
200
+ }
201
+ /**
202
+ * Specifies the name and url of an external resource. At least one property
203
+ * should be set.
204
+ */
205
+ export interface ExternalSpecifier {
206
+ /**
207
+ * Name of the referenced plugin / rule.
208
+ */
209
+ name?: string;
210
+ /**
211
+ * URL pointing to documentation for the plugin / rule.
212
+ */
213
+ url?: string;
214
+ }
215
+ /**
216
+ * Generic type for `RuleContext`.
217
+ */
218
+ export interface RuleContextTypeOptions {
219
+ LangOptions: LanguageOptions;
220
+ Code: SourceCode;
221
+ RuleOptions: unknown[];
222
+ Node: unknown;
223
+ MessageIds: string;
224
+ }
225
+ /**
226
+ * Represents the context object that is passed to a rule. This object contains
227
+ * information about the current state of the linting process and is the rule's
228
+ * view into the outside world.
229
+ */
230
+ export interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
231
+ /**
232
+ * The current working directory for the session.
233
+ */
234
+ cwd: string;
235
+ /**
236
+ * Returns the current working directory for the session.
237
+ * @deprecated Use `cwd` instead.
238
+ */
239
+ getCwd(): string;
240
+ /**
241
+ * The filename of the file being linted.
242
+ */
243
+ filename: string;
244
+ /**
245
+ * Returns the filename of the file being linted.
246
+ * @deprecated Use `filename` instead.
247
+ */
248
+ getFilename(): string;
249
+ /**
250
+ * The physical filename of the file being linted.
251
+ */
252
+ physicalFilename: string;
253
+ /**
254
+ * Returns the physical filename of the file being linted.
255
+ * @deprecated Use `physicalFilename` instead.
256
+ */
257
+ getPhysicalFilename(): string;
258
+ /**
259
+ * The source code object that the rule is running on.
260
+ */
261
+ sourceCode: Options["Code"];
262
+ /**
263
+ * Returns the source code object that the rule is running on.
264
+ * @deprecated Use `sourceCode` instead.
265
+ */
266
+ getSourceCode(): Options["Code"];
267
+ /**
268
+ * Shared settings for the configuration.
269
+ */
270
+ settings: SettingsConfig;
271
+ /**
272
+ * Parser-specific options for the configuration.
273
+ * @deprecated Use `languageOptions.parserOptions` instead.
274
+ */
275
+ parserOptions: Record<string, unknown>;
276
+ /**
277
+ * The language options for the configuration.
278
+ */
279
+ languageOptions: Options["LangOptions"];
280
+ /**
281
+ * The CommonJS path to the parser used while parsing this file.
282
+ * @deprecated No longer used.
283
+ */
284
+ parserPath: string | undefined;
285
+ /**
286
+ * The rule ID.
287
+ */
288
+ id: string;
289
+ /**
290
+ * The rule's configured options.
291
+ */
292
+ options: Options["RuleOptions"];
293
+ /**
294
+ * The report function that the rule should use to report problems.
295
+ * @param violation The violation to report.
296
+ */
297
+ report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
298
+ }
299
+ /**
300
+ * Manager of text edits for a rule fix.
301
+ */
302
+ export interface RuleTextEditor<EditableSyntaxElement = unknown> {
303
+ /**
304
+ * Inserts text after the specified node or token.
305
+ * @param syntaxElement The node or token to insert after.
306
+ * @param text The edit to insert after the node or token.
307
+ */
308
+ insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
309
+ /**
310
+ * Inserts text after the specified range.
311
+ * @param range The range to insert after.
312
+ * @param text The edit to insert after the range.
313
+ */
314
+ insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
315
+ /**
316
+ * Inserts text before the specified node or token.
317
+ * @param syntaxElement A syntax element with location information to insert before.
318
+ * @param text The edit to insert before the node or token.
319
+ */
320
+ insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
321
+ /**
322
+ * Inserts text before the specified range.
323
+ * @param range The range to insert before.
324
+ * @param text The edit to insert before the range.
325
+ */
326
+ insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
327
+ /**
328
+ * Removes the specified node or token.
329
+ * @param syntaxElement A syntax element with location information to remove.
330
+ * @returns The edit to remove the node or token.
331
+ */
332
+ remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
333
+ /**
334
+ * Removes the specified range.
335
+ * @param range The range to remove.
336
+ * @returns The edit to remove the range.
337
+ */
338
+ removeRange(range: SourceRange): RuleTextEdit;
339
+ /**
340
+ * Replaces the specified node or token with the given text.
341
+ * @param syntaxElement A syntax element with location information to replace.
342
+ * @param text The text to replace the node or token with.
343
+ * @returns The edit to replace the node or token.
344
+ */
345
+ replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
346
+ /**
347
+ * Replaces the specified range with the given text.
348
+ * @param range The range to replace.
349
+ * @param text The text to replace the range with.
350
+ * @returns The edit to replace the range.
351
+ */
352
+ replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
353
+ }
354
+ /**
355
+ * Represents a fix for a rule violation implemented as a text edit.
356
+ */
357
+ export interface RuleTextEdit {
358
+ /**
359
+ * The range to replace.
360
+ */
361
+ range: SourceRange;
362
+ /**
363
+ * The text to insert.
364
+ */
365
+ text: string;
366
+ }
367
+ /**
368
+ * Fixes a violation.
369
+ * @param fixer The text editor to apply the fix.
370
+ * @returns The fix(es) for the violation.
371
+ */
372
+ type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
373
+ interface ViolationReportBase {
374
+ /**
375
+ * The type of node that the violation is for.
376
+ * @deprecated May be removed in the future.
377
+ */
378
+ nodeType?: string | undefined;
379
+ /**
380
+ * The data to insert into the message.
381
+ */
382
+ data?: Record<string, string> | undefined;
383
+ /**
384
+ * The fix to be applied for the violation.
385
+ */
386
+ fix?: RuleFixer | null | undefined;
387
+ /**
388
+ * An array of suggested fixes for the problem. These fixes may change the
389
+ * behavior of the code, so they are not applied automatically.
390
+ */
391
+ suggest?: SuggestedEdit[] | null | undefined;
392
+ }
393
+ type ViolationMessage<MessageIds = string> = {
394
+ message: string;
395
+ } | {
396
+ messageId: MessageIds;
397
+ };
398
+ type ViolationLocation<Node> = {
399
+ loc: SourceLocation | Position;
400
+ } | {
401
+ node: Node;
402
+ };
403
+ export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
404
+ interface SuggestedEditBase {
405
+ /**
406
+ * The data to insert into the message.
407
+ */
408
+ data?: Record<string, string> | undefined;
409
+ /**
410
+ * The fix to be applied for the suggestion.
411
+ */
412
+ fix?: RuleFixer | null | undefined;
413
+ }
414
+ type SuggestionMessage = {
415
+ desc: string;
416
+ } | {
417
+ messageId: string;
418
+ };
419
+ /**
420
+ * A suggested edit for a rule violation.
421
+ */
422
+ export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
423
+ /**
424
+ * Generic options for the `RuleDefinition` type.
425
+ */
426
+ export interface RuleDefinitionTypeOptions {
427
+ LangOptions: LanguageOptions;
428
+ Code: SourceCode;
429
+ RuleOptions: unknown[];
430
+ Visitor: RuleVisitor;
431
+ Node: unknown;
432
+ MessageIds: string;
433
+ ExtRuleDocs: unknown;
434
+ }
435
+ /**
436
+ * The definition of an ESLint rule.
437
+ */
438
+ export interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
439
+ /**
440
+ * The meta information for the rule.
441
+ */
442
+ meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
443
+ /**
444
+ * Creates the visitor that ESLint uses to apply the rule during traversal.
445
+ * @param context The rule context.
446
+ * @returns The rule visitor.
447
+ */
448
+ create(context: RuleContext<{
449
+ LangOptions: Options["LangOptions"];
450
+ Code: Options["Code"];
451
+ RuleOptions: Options["RuleOptions"];
452
+ Node: Options["Node"];
453
+ MessageIds: Options["MessageIds"];
454
+ }>): Options["Visitor"];
455
+ }
456
+ /**
457
+ * Defaults for non-language-related `RuleDefinition` options.
458
+ */
459
+ export interface CustomRuleTypeDefinitions {
460
+ RuleOptions: unknown[];
461
+ MessageIds: string;
462
+ ExtRuleDocs: Record<string, unknown>;
463
+ }
464
+ /**
465
+ * A helper type to define language specific specializations of the `RuleDefinition` type.
466
+ *
467
+ * @example
468
+ * ```ts
469
+ * type YourRuleDefinition<
470
+ * Options extends Partial<CustomRuleTypeDefinitions> = {},
471
+ * > = CustomRuleDefinitionType<
472
+ * {
473
+ * LangOptions: YourLanguageOptions;
474
+ * Code: YourSourceCode;
475
+ * Visitor: YourRuleVisitor;
476
+ * Node: YourNode;
477
+ * },
478
+ * Options
479
+ * >;
480
+ * ```
481
+ */
482
+ export type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = RuleDefinition<LanguageSpecificOptions & Required<Options & Omit<CustomRuleTypeDefinitions, keyof Options>>>;
483
+ /**
484
+ * The human readable severity level used in a configuration.
485
+ */
486
+ export type SeverityName = "off" | "warn" | "error";
487
+ /**
488
+ * The numeric severity level for a rule.
489
+ *
490
+ * - `0` means off.
491
+ * - `1` means warn.
492
+ * - `2` means error.
493
+ */
494
+ export type SeverityLevel = 0 | 1 | 2;
495
+ /**
496
+ * The severity of a rule in a configuration.
497
+ */
498
+ export type Severity = SeverityName | SeverityLevel;
499
+ /**
500
+ * Represents the configuration options for the core linter.
501
+ */
502
+ export interface LinterOptionsConfig {
503
+ /**
504
+ * Indicates whether or not inline configuration is evaluated.
505
+ */
506
+ noInlineConfig?: boolean;
507
+ /**
508
+ * Indicates what to do when an unused disable directive is found.
509
+ */
510
+ reportUnusedDisableDirectives?: boolean | Severity;
511
+ /**
512
+ * A severity value indicating if and how unused inline configs should be
513
+ * tracked and reported.
514
+ */
515
+ reportUnusedInlineConfigs?: Severity;
516
+ }
517
+ /**
518
+ * The configuration for a rule.
519
+ */
520
+ export type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
521
+ /**
522
+ * A collection of rules and their configurations.
523
+ */
524
+ export interface RulesConfig {
525
+ [key: string]: RuleConfig;
526
+ }
527
+ /**
528
+ * A collection of settings.
529
+ */
530
+ export interface SettingsConfig {
531
+ [key: string]: unknown;
532
+ }
533
+ /**
534
+ * Generic options for the `Language` type.
535
+ */
536
+ export interface LanguageTypeOptions {
537
+ LangOptions: LanguageOptions;
538
+ Code: SourceCode;
539
+ RootNode: unknown;
540
+ Node: unknown;
541
+ }
542
+ /**
543
+ * Represents a plugin language.
544
+ */
545
+ export interface Language<Options extends LanguageTypeOptions = {
546
+ LangOptions: LanguageOptions;
547
+ Code: SourceCode;
548
+ RootNode: unknown;
549
+ Node: unknown;
550
+ }> {
551
+ /**
552
+ * Indicates how ESLint should read the file.
553
+ */
554
+ fileType: "text";
555
+ /**
556
+ * First line number returned from the parser (text mode only).
557
+ */
558
+ lineStart: 0 | 1;
559
+ /**
560
+ * First column number returned from the parser (text mode only).
561
+ */
562
+ columnStart: 0 | 1;
563
+ /**
564
+ * The property to read the node type from. Used in selector querying.
565
+ */
566
+ nodeTypeKey: string;
567
+ /**
568
+ * The traversal path that tools should take when evaluating the AST
569
+ */
570
+ visitorKeys?: Record<string, string[]>;
571
+ /**
572
+ * Default language options. User-defined options are merged with this object.
573
+ */
574
+ defaultLanguageOptions?: LanguageOptions;
575
+ /**
576
+ * Validates languageOptions for this language.
577
+ */
578
+ validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
579
+ /**
580
+ * Normalizes languageOptions for this language.
581
+ */
582
+ normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
583
+ /**
584
+ * Helper for esquery that allows languages to match nodes against
585
+ * class. esquery currently has classes like `function` that will
586
+ * match all the various function nodes. This method allows languages
587
+ * to implement similar shorthands.
588
+ */
589
+ matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
590
+ /**
591
+ * Parses the given file input into its component parts. This file should not
592
+ * throws errors for parsing errors but rather should return any parsing
593
+ * errors as parse of the ParseResult object.
594
+ */
595
+ parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
596
+ /**
597
+ * Creates SourceCode object that ESLint uses to work with a file.
598
+ */
599
+ createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
600
+ }
601
+ /**
602
+ * Plugin-defined options for the language.
603
+ */
604
+ export type LanguageOptions = Record<string, unknown>;
605
+ /**
606
+ * The context object that is passed to the language plugin methods.
607
+ */
608
+ export interface LanguageContext<LangOptions = LanguageOptions> {
609
+ languageOptions: LangOptions;
610
+ }
611
+ /**
612
+ * Represents a file read by ESLint.
613
+ */
614
+ export interface File {
615
+ /**
616
+ * The path that ESLint uses for this file. May be a virtual path
617
+ * if it was returned by a processor.
618
+ */
619
+ path: string;
620
+ /**
621
+ * The path to the file on disk. This always maps directly to a file
622
+ * regardless of whether it was returned from a processor.
623
+ */
624
+ physicalPath: string;
625
+ /**
626
+ * Indicates if the original source contained a byte-order marker.
627
+ * ESLint strips the BOM from the `body`, but this info is needed
628
+ * to correctly apply autofixing.
629
+ */
630
+ bom: boolean;
631
+ /**
632
+ * The body of the file to parse.
633
+ */
634
+ body: string | Uint8Array;
635
+ }
636
+ /**
637
+ * Represents the successful result of parsing a file.
638
+ */
639
+ export interface OkParseResult<RootNode = unknown> {
640
+ /**
641
+ * Indicates if the parse was successful. If true, the parse was successful
642
+ * and ESLint should continue on to create a SourceCode object and run rules;
643
+ * if false, ESLint should just report the error(s) without doing anything
644
+ * else.
645
+ */
646
+ ok: true;
647
+ /**
648
+ * The abstract syntax tree created by the parser. (only when ok: true)
649
+ */
650
+ ast: RootNode;
651
+ /**
652
+ * Any additional data that the parser wants to provide.
653
+ */
654
+ [key: string]: any;
655
+ }
656
+ /**
657
+ * Represents the unsuccessful result of parsing a file.
658
+ */
659
+ export interface NotOkParseResult {
660
+ /**
661
+ * Indicates if the parse was successful. If true, the parse was successful
662
+ * and ESLint should continue on to create a SourceCode object and run rules;
663
+ * if false, ESLint should just report the error(s) without doing anything
664
+ * else.
665
+ */
666
+ ok: false;
667
+ /**
668
+ * Any parsing errors, whether fatal or not. (only when ok: false)
669
+ */
670
+ errors: FileError[];
671
+ /**
672
+ * Any additional data that the parser wants to provide.
673
+ */
674
+ [key: string]: any;
675
+ }
676
+ export type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
677
+ /**
678
+ * Represents inline configuration found in the source code.
679
+ */
680
+ interface InlineConfigElement {
681
+ /**
682
+ * The location of the inline config element.
683
+ */
684
+ loc: SourceLocation;
685
+ /**
686
+ * The interpreted configuration from the inline config element.
687
+ */
688
+ config: {
689
+ rules: RulesConfig;
690
+ };
691
+ }
692
+ /**
693
+ * Generic options for the `SourceCodeBase` type.
694
+ */
695
+ export interface SourceCodeBaseTypeOptions {
696
+ LangOptions: LanguageOptions;
697
+ RootNode: unknown;
698
+ SyntaxElementWithLoc: unknown;
699
+ ConfigNode: unknown;
700
+ }
701
+ /**
702
+ * Represents the basic interface for a source code object.
703
+ */
704
+ interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
705
+ LangOptions: LanguageOptions;
706
+ RootNode: unknown;
707
+ SyntaxElementWithLoc: unknown;
708
+ ConfigNode: unknown;
709
+ }> {
710
+ /**
711
+ * Root of the AST.
712
+ */
713
+ ast: Options["RootNode"];
714
+ /**
715
+ * The traversal path that tools should take when evaluating the AST.
716
+ * When present, this overrides the `visitorKeys` on the language for
717
+ * just this source code object.
718
+ */
719
+ visitorKeys?: Record<string, string[]>;
720
+ /**
721
+ * Retrieves the equivalent of `loc` for a given node or token.
722
+ * @param syntaxElement The node or token to get the location for.
723
+ * @returns The location of the node or token.
724
+ */
725
+ getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation;
726
+ /**
727
+ * Retrieves the equivalent of `range` for a given node or token.
728
+ * @param syntaxElement The node or token to get the range for.
729
+ * @returns The range of the node or token.
730
+ */
731
+ getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
732
+ /**
733
+ * Traversal of AST.
734
+ */
735
+ traverse(): Iterable<TraversalStep>;
736
+ /**
737
+ * Applies language options passed in from the ESLint core.
738
+ */
739
+ applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
740
+ /**
741
+ * Return all of the inline areas where ESLint should be disabled/enabled
742
+ * along with any problems found in evaluating the directives.
743
+ */
744
+ getDisableDirectives?(): {
745
+ directives: Directive[];
746
+ problems: FileProblem[];
747
+ };
748
+ /**
749
+ * Returns an array of all inline configuration nodes found in the
750
+ * source code.
751
+ */
752
+ getInlineConfigNodes?(): Options["ConfigNode"][];
753
+ /**
754
+ * Applies configuration found inside of the source code. This method is only
755
+ * called when ESLint is running with inline configuration allowed.
756
+ */
757
+ applyInlineConfig?(): {
758
+ configs: InlineConfigElement[];
759
+ problems: FileProblem[];
760
+ };
761
+ /**
762
+ * Called by ESLint core to indicate that it has finished providing
763
+ * information. We now add in all the missing variables and ensure that
764
+ * state-changing methods cannot be called by rules.
765
+ * @returns {void}
766
+ */
767
+ finalize?(): void;
768
+ }
769
+ /**
770
+ * Represents the source of a text file being linted.
771
+ */
772
+ export interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
773
+ LangOptions: LanguageOptions;
774
+ RootNode: unknown;
775
+ SyntaxElementWithLoc: unknown;
776
+ ConfigNode: unknown;
777
+ }> extends SourceCodeBase<Options> {
778
+ /**
779
+ * The body of the file that you'd like rule developers to access.
780
+ */
781
+ text: string;
782
+ }
783
+ /**
784
+ * Represents the source of a binary file being linted.
785
+ */
786
+ export interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
787
+ LangOptions: LanguageOptions;
788
+ RootNode: unknown;
789
+ SyntaxElementWithLoc: unknown;
790
+ ConfigNode: unknown;
791
+ }> extends SourceCodeBase<Options> {
792
+ /**
793
+ * The body of the file that you'd like rule developers to access.
794
+ */
795
+ body: Uint8Array;
796
+ }
797
+ export type SourceCode<Options extends SourceCodeBaseTypeOptions = {
798
+ LangOptions: LanguageOptions;
799
+ RootNode: unknown;
800
+ SyntaxElementWithLoc: unknown;
801
+ ConfigNode: unknown;
802
+ }> = TextSourceCode<Options> | BinarySourceCode<Options>;
803
+ /**
804
+ * Represents a traversal step visiting the AST.
805
+ */
806
+ export interface VisitTraversalStep {
807
+ kind: 1;
808
+ target: unknown;
809
+ phase: 1 | 2;
810
+ args: unknown[];
811
+ }
812
+ /**
813
+ * Represents a traversal step calling a function.
814
+ */
815
+ export interface CallTraversalStep {
816
+ kind: 2;
817
+ target: string;
818
+ phase?: string;
819
+ args: unknown[];
820
+ }
821
+ export type TraversalStep = VisitTraversalStep | CallTraversalStep;
822
+ /**
823
+ * The type of disable directive. This determines how ESLint will disable rules.
824
+ */
825
+ export type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
826
+ /**
827
+ * Represents a disable directive.
828
+ */
829
+ export interface Directive {
830
+ /**
831
+ * The type of directive.
832
+ */
833
+ type: DirectiveType;
834
+ /**
835
+ * The node of the directive. May be in the AST or a comment/token.
836
+ */
837
+ node: unknown;
838
+ /**
839
+ * The value of the directive.
840
+ */
841
+ value: string;
842
+ /**
843
+ * The justification for the directive.
844
+ */
845
+ justification?: string;
846
+ }
847
+ export {};
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/core/package.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@eslint/core",
3
+ "version": "0.15.1",
4
+ "description": "Runtime-agnostic core of ESLint",
5
+ "type": "module",
6
+ "types": "./dist/esm/types.d.ts",
7
+ "exports": {
8
+ "types": {
9
+ "import": "./dist/esm/types.d.ts",
10
+ "require": "./dist/cjs/types.d.cts"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "scripts": {
20
+ "build:cts": "node -e \"fs.cpSync('dist/esm/types.d.ts', 'dist/cjs/types.d.cts')\"",
21
+ "build": "tsc && npm run build:cts",
22
+ "test:jsr": "npx jsr@latest publish --dry-run",
23
+ "test:types": "tsc -p tests/types/tsconfig.json"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/eslint/rewrite.git",
28
+ "directory": "packages/core"
29
+ },
30
+ "keywords": [
31
+ "eslint",
32
+ "core"
33
+ ],
34
+ "author": "Nicholas C. Zakas",
35
+ "license": "Apache-2.0",
36
+ "bugs": {
37
+ "url": "https://github.com/eslint/rewrite/issues"
38
+ },
39
+ "homepage": "https://github.com/eslint/rewrite/tree/main/packages/core#readme",
40
+ "dependencies": {
41
+ "@types/json-schema": "^7.0.15"
42
+ },
43
+ "devDependencies": {
44
+ "json-schema": "^0.4.0"
45
+ },
46
+ "engines": {
47
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
48
+ }
49
+ }
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/README.md ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ESLintRC Library
2
+
3
+ This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
4
+
5
+ **Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.
6
+
7
+ ## Installation
8
+
9
+ You can install the package as follows:
10
+
11
+ ```shell
12
+ npm install @eslint/eslintrc -D
13
+ # or
14
+ yarn add @eslint/eslintrc -D
15
+ # or
16
+ pnpm install @eslint/eslintrc -D
17
+ # or
18
+ bun install @eslint/eslintrc -D
19
+ ```
20
+
21
+ ## Usage (ESM)
22
+
23
+ The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
24
+
25
+ ```js
26
+ import { FlatCompat } from "@eslint/eslintrc";
27
+ import js from "@eslint/js";
28
+ import path from "path";
29
+ import { fileURLToPath } from "url";
30
+
31
+ // mimic CommonJS variables -- not needed if using CommonJS
32
+ const __filename = fileURLToPath(import.meta.url);
33
+ const __dirname = path.dirname(__filename);
34
+
35
+ const compat = new FlatCompat({
36
+ baseDirectory: __dirname, // optional; default: process.cwd()
37
+ resolvePluginsRelativeTo: __dirname, // optional
38
+ recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended"
39
+ allConfig: js.configs.all, // optional unless you're using "eslint:all"
40
+ });
41
+
42
+ export default [
43
+
44
+ // mimic ESLintRC-style extends
45
+ ...compat.extends("standard", "example", "plugin:react/recommended"),
46
+
47
+ // mimic environments
48
+ ...compat.env({
49
+ es2020: true,
50
+ node: true
51
+ }),
52
+
53
+ // mimic plugins
54
+ ...compat.plugins("jsx-a11y", "react"),
55
+
56
+ // translate an entire config
57
+ ...compat.config({
58
+ plugins: ["jsx-a11y", "react"],
59
+ extends: "standard",
60
+ env: {
61
+ es2020: true,
62
+ node: true
63
+ },
64
+ rules: {
65
+ semi: "error"
66
+ }
67
+ })
68
+ ];
69
+ ```
70
+
71
+ ## Usage (CommonJS)
72
+
73
+ Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file:
74
+
75
+ ```js
76
+ const { FlatCompat } = require("@eslint/eslintrc");
77
+ const js = require("@eslint/js");
78
+
79
+ const compat = new FlatCompat({
80
+ baseDirectory: __dirname, // optional; default: process.cwd()
81
+ resolvePluginsRelativeTo: __dirname, // optional
82
+ recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended"
83
+ allConfig: js.configs.all, // optional unless using "eslint:all"
84
+ });
85
+
86
+ module.exports = [
87
+
88
+ // mimic ESLintRC-style extends
89
+ ...compat.extends("standard", "example", "plugin:react/recommended"),
90
+
91
+ // mimic environments
92
+ ...compat.env({
93
+ es2020: true,
94
+ node: true
95
+ }),
96
+
97
+ // mimic plugins
98
+ ...compat.plugins("jsx-a11y", "react"),
99
+
100
+ // translate an entire config
101
+ ...compat.config({
102
+ plugins: ["jsx-a11y", "react"],
103
+ extends: "standard",
104
+ env: {
105
+ es2020: true,
106
+ node: true
107
+ },
108
+ rules: {
109
+ semi: "error"
110
+ }
111
+ })
112
+ ];
113
+ ```
114
+
115
+ ## Troubleshooting
116
+
117
+ **TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor**
118
+
119
+ The `recommendedConfig` option is required when any config uses `eslint:recommended`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:recommended` config.
120
+
121
+ **TypeError: Missing parameter 'allConfig' in FlatCompat constructor**
122
+
123
+ The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config.
124
+
125
+
126
+ ## License
127
+
128
+ MIT License
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/conf/config-schema.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Defines a schema for configs.
3
+ * @author Sylvan Mably
4
+ */
5
+
6
+ const baseConfigProperties = {
7
+ $schema: { type: "string" },
8
+ env: { type: "object" },
9
+ extends: { $ref: "#/definitions/stringOrStrings" },
10
+ globals: { type: "object" },
11
+ overrides: {
12
+ type: "array",
13
+ items: { $ref: "#/definitions/overrideConfig" },
14
+ additionalItems: false
15
+ },
16
+ parser: { type: ["string", "null"] },
17
+ parserOptions: { type: "object" },
18
+ plugins: { type: "array" },
19
+ processor: { type: "string" },
20
+ rules: { type: "object" },
21
+ settings: { type: "object" },
22
+ noInlineConfig: { type: "boolean" },
23
+ reportUnusedDisableDirectives: { type: "boolean" },
24
+
25
+ ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
26
+ };
27
+
28
+ const configSchema = {
29
+ definitions: {
30
+ stringOrStrings: {
31
+ oneOf: [
32
+ { type: "string" },
33
+ {
34
+ type: "array",
35
+ items: { type: "string" },
36
+ additionalItems: false
37
+ }
38
+ ]
39
+ },
40
+ stringOrStringsRequired: {
41
+ oneOf: [
42
+ { type: "string" },
43
+ {
44
+ type: "array",
45
+ items: { type: "string" },
46
+ additionalItems: false,
47
+ minItems: 1
48
+ }
49
+ ]
50
+ },
51
+
52
+ // Config at top-level.
53
+ objectConfig: {
54
+ type: "object",
55
+ properties: {
56
+ root: { type: "boolean" },
57
+ ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
58
+ ...baseConfigProperties
59
+ },
60
+ additionalProperties: false
61
+ },
62
+
63
+ // Config in `overrides`.
64
+ overrideConfig: {
65
+ type: "object",
66
+ properties: {
67
+ excludedFiles: { $ref: "#/definitions/stringOrStrings" },
68
+ files: { $ref: "#/definitions/stringOrStringsRequired" },
69
+ ...baseConfigProperties
70
+ },
71
+ required: ["files"],
72
+ additionalProperties: false
73
+ }
74
+ },
75
+
76
+ $ref: "#/definitions/objectConfig"
77
+ };
78
+
79
+ export default configSchema;
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/conf/environments.js ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @fileoverview Defines environment settings and globals.
3
+ * @author Elan Shanker
4
+ */
5
+
6
+ //------------------------------------------------------------------------------
7
+ // Requirements
8
+ //------------------------------------------------------------------------------
9
+
10
+ import globals from "globals";
11
+
12
+ //------------------------------------------------------------------------------
13
+ // Helpers
14
+ //------------------------------------------------------------------------------
15
+
16
+ /**
17
+ * Get the object that has difference.
18
+ * @param {Record<string,boolean>} current The newer object.
19
+ * @param {Record<string,boolean>} prev The older object.
20
+ * @returns {Record<string,boolean>} The difference object.
21
+ */
22
+ function getDiff(current, prev) {
23
+ const retv = {};
24
+
25
+ for (const [key, value] of Object.entries(current)) {
26
+ if (!Object.hasOwn(prev, key)) {
27
+ retv[key] = value;
28
+ }
29
+ }
30
+
31
+ return retv;
32
+ }
33
+
34
+ const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...
35
+ const newGlobals2017 = {
36
+ Atomics: false,
37
+ SharedArrayBuffer: false
38
+ };
39
+ const newGlobals2020 = {
40
+ BigInt: false,
41
+ BigInt64Array: false,
42
+ BigUint64Array: false,
43
+ globalThis: false
44
+ };
45
+
46
+ const newGlobals2021 = {
47
+ AggregateError: false,
48
+ FinalizationRegistry: false,
49
+ WeakRef: false
50
+ };
51
+
52
+ //------------------------------------------------------------------------------
53
+ // Public Interface
54
+ //------------------------------------------------------------------------------
55
+
56
+ /** @type {Map<string, import("../lib/shared/types").Environment>} */
57
+ export default new Map(Object.entries({
58
+
59
+ // Language
60
+ builtin: {
61
+ globals: globals.es5
62
+ },
63
+ es6: {
64
+ globals: newGlobals2015,
65
+ parserOptions: {
66
+ ecmaVersion: 6
67
+ }
68
+ },
69
+ es2015: {
70
+ globals: newGlobals2015,
71
+ parserOptions: {
72
+ ecmaVersion: 6
73
+ }
74
+ },
75
+ es2016: {
76
+ globals: newGlobals2015,
77
+ parserOptions: {
78
+ ecmaVersion: 7
79
+ }
80
+ },
81
+ es2017: {
82
+ globals: { ...newGlobals2015, ...newGlobals2017 },
83
+ parserOptions: {
84
+ ecmaVersion: 8
85
+ }
86
+ },
87
+ es2018: {
88
+ globals: { ...newGlobals2015, ...newGlobals2017 },
89
+ parserOptions: {
90
+ ecmaVersion: 9
91
+ }
92
+ },
93
+ es2019: {
94
+ globals: { ...newGlobals2015, ...newGlobals2017 },
95
+ parserOptions: {
96
+ ecmaVersion: 10
97
+ }
98
+ },
99
+ es2020: {
100
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
101
+ parserOptions: {
102
+ ecmaVersion: 11
103
+ }
104
+ },
105
+ es2021: {
106
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
107
+ parserOptions: {
108
+ ecmaVersion: 12
109
+ }
110
+ },
111
+ es2022: {
112
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
113
+ parserOptions: {
114
+ ecmaVersion: 13
115
+ }
116
+ },
117
+ es2023: {
118
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
119
+ parserOptions: {
120
+ ecmaVersion: 14
121
+ }
122
+ },
123
+ es2024: {
124
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
125
+ parserOptions: {
126
+ ecmaVersion: 15
127
+ }
128
+ },
129
+
130
+ // Platforms
131
+ browser: {
132
+ globals: globals.browser
133
+ },
134
+ node: {
135
+ globals: globals.node,
136
+ parserOptions: {
137
+ ecmaFeatures: {
138
+ globalReturn: true
139
+ }
140
+ }
141
+ },
142
+ "shared-node-browser": {
143
+ globals: globals["shared-node-browser"]
144
+ },
145
+ worker: {
146
+ globals: globals.worker
147
+ },
148
+ serviceworker: {
149
+ globals: globals.serviceworker
150
+ },
151
+
152
+ // Frameworks
153
+ commonjs: {
154
+ globals: globals.commonjs,
155
+ parserOptions: {
156
+ ecmaFeatures: {
157
+ globalReturn: true
158
+ }
159
+ }
160
+ },
161
+ amd: {
162
+ globals: globals.amd
163
+ },
164
+ mocha: {
165
+ globals: globals.mocha
166
+ },
167
+ jasmine: {
168
+ globals: globals.jasmine
169
+ },
170
+ jest: {
171
+ globals: globals.jest
172
+ },
173
+ phantomjs: {
174
+ globals: globals.phantomjs
175
+ },
176
+ jquery: {
177
+ globals: globals.jquery
178
+ },
179
+ qunit: {
180
+ globals: globals.qunit
181
+ },
182
+ prototypejs: {
183
+ globals: globals.prototypejs
184
+ },
185
+ shelljs: {
186
+ globals: globals.shelljs
187
+ },
188
+ meteor: {
189
+ globals: globals.meteor
190
+ },
191
+ mongo: {
192
+ globals: globals.mongo
193
+ },
194
+ protractor: {
195
+ globals: globals.protractor
196
+ },
197
+ applescript: {
198
+ globals: globals.applescript
199
+ },
200
+ nashorn: {
201
+ globals: globals.nashorn
202
+ },
203
+ atomtest: {
204
+ globals: globals.atomtest
205
+ },
206
+ embertest: {
207
+ globals: globals.embertest
208
+ },
209
+ webextensions: {
210
+ globals: globals.webextensions
211
+ },
212
+ greasemonkey: {
213
+ globals: globals.greasemonkey
214
+ }
215
+ }));
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs ADDED
@@ -0,0 +1,1212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var util = require('node:util');
6
+ var path = require('node:path');
7
+ var Ajv = require('ajv');
8
+ var globals = require('globals');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
13
+ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
14
+ var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);
15
+ var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);
16
+
17
+ /**
18
+ * @fileoverview Config file operations. This file must be usable in the browser,
19
+ * so no Node-specific code can be here.
20
+ * @author Nicholas C. Zakas
21
+ */
22
+
23
+ //------------------------------------------------------------------------------
24
+ // Private
25
+ //------------------------------------------------------------------------------
26
+
27
+ const RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
28
+ RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {
29
+ map[value] = index;
30
+ return map;
31
+ }, {}),
32
+ VALID_SEVERITIES = new Set([0, 1, 2, "off", "warn", "error"]);
33
+
34
+ //------------------------------------------------------------------------------
35
+ // Public Interface
36
+ //------------------------------------------------------------------------------
37
+
38
+ /**
39
+ * Normalizes the severity value of a rule's configuration to a number
40
+ * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
41
+ * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
42
+ * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
43
+ * whose first element is one of the above values. Strings are matched case-insensitively.
44
+ * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
45
+ */
46
+ function getRuleSeverity(ruleConfig) {
47
+ const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
48
+
49
+ if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
50
+ return severityValue;
51
+ }
52
+
53
+ if (typeof severityValue === "string") {
54
+ return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
55
+ }
56
+
57
+ return 0;
58
+ }
59
+
60
+ /**
61
+ * Converts old-style severity settings (0, 1, 2) into new-style
62
+ * severity settings (off, warn, error) for all rules. Assumption is that severity
63
+ * values have already been validated as correct.
64
+ * @param {Object} config The config object to normalize.
65
+ * @returns {void}
66
+ */
67
+ function normalizeToStrings(config) {
68
+
69
+ if (config.rules) {
70
+ Object.keys(config.rules).forEach(ruleId => {
71
+ const ruleConfig = config.rules[ruleId];
72
+
73
+ if (typeof ruleConfig === "number") {
74
+ config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
75
+ } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
76
+ ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
77
+ }
78
+ });
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Determines if the severity for the given rule configuration represents an error.
84
+ * @param {int|string|Array} ruleConfig The configuration for an individual rule.
85
+ * @returns {boolean} True if the rule represents an error, false if not.
86
+ */
87
+ function isErrorSeverity(ruleConfig) {
88
+ return getRuleSeverity(ruleConfig) === 2;
89
+ }
90
+
91
+ /**
92
+ * Checks whether a given config has valid severity or not.
93
+ * @param {number|string|Array} ruleConfig The configuration for an individual rule.
94
+ * @returns {boolean} `true` if the configuration has valid severity.
95
+ */
96
+ function isValidSeverity(ruleConfig) {
97
+ let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
98
+
99
+ if (typeof severity === "string") {
100
+ severity = severity.toLowerCase();
101
+ }
102
+ return VALID_SEVERITIES.has(severity);
103
+ }
104
+
105
+ /**
106
+ * Checks whether every rule of a given config has valid severity or not.
107
+ * @param {Object} config The configuration for rules.
108
+ * @returns {boolean} `true` if the configuration has valid severity.
109
+ */
110
+ function isEverySeverityValid(config) {
111
+ return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));
112
+ }
113
+
114
+ /**
115
+ * Normalizes a value for a global in a config
116
+ * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
117
+ * a global directive comment
118
+ * @returns {("readable"|"writeable"|"off")} The value normalized as a string
119
+ * @throws Error if global value is invalid
120
+ */
121
+ function normalizeConfigGlobal(configuredValue) {
122
+ switch (configuredValue) {
123
+ case "off":
124
+ return "off";
125
+
126
+ case true:
127
+ case "true":
128
+ case "writeable":
129
+ case "writable":
130
+ return "writable";
131
+
132
+ case null:
133
+ case false:
134
+ case "false":
135
+ case "readable":
136
+ case "readonly":
137
+ return "readonly";
138
+
139
+ default:
140
+ throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
141
+ }
142
+ }
143
+
144
+ var ConfigOps = {
145
+ __proto__: null,
146
+ getRuleSeverity: getRuleSeverity,
147
+ normalizeToStrings: normalizeToStrings,
148
+ isErrorSeverity: isErrorSeverity,
149
+ isValidSeverity: isValidSeverity,
150
+ isEverySeverityValid: isEverySeverityValid,
151
+ normalizeConfigGlobal: normalizeConfigGlobal
152
+ };
153
+
154
+ /**
155
+ * @fileoverview Provide the function that emits deprecation warnings.
156
+ * @author Toru Nagashima <http://github.com/mysticatea>
157
+ */
158
+
159
+ //------------------------------------------------------------------------------
160
+ // Private
161
+ //------------------------------------------------------------------------------
162
+
163
+ // Defitions for deprecation warnings.
164
+ const deprecationWarningMessages = {
165
+ ESLINT_LEGACY_ECMAFEATURES:
166
+ "The 'ecmaFeatures' config file property is deprecated and has no effect.",
167
+ ESLINT_PERSONAL_CONFIG_LOAD:
168
+ "'~/.eslintrc.*' config files have been deprecated. " +
169
+ "Please use a config file per project or the '--config' option.",
170
+ ESLINT_PERSONAL_CONFIG_SUPPRESS:
171
+ "'~/.eslintrc.*' config files have been deprecated. " +
172
+ "Please remove it or add 'root:true' to the config files in your " +
173
+ "projects in order to avoid loading '~/.eslintrc.*' accidentally."
174
+ };
175
+
176
+ const sourceFileErrorCache = new Set();
177
+
178
+ /**
179
+ * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
180
+ * for each unique file path, but repeated invocations with the same file path have no effect.
181
+ * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.
182
+ * @param {string} source The name of the configuration source to report the warning for.
183
+ * @param {string} errorCode The warning message to show.
184
+ * @returns {void}
185
+ */
186
+ function emitDeprecationWarning(source, errorCode) {
187
+ const cacheKey = JSON.stringify({ source, errorCode });
188
+
189
+ if (sourceFileErrorCache.has(cacheKey)) {
190
+ return;
191
+ }
192
+ sourceFileErrorCache.add(cacheKey);
193
+
194
+ const rel = path__default["default"].relative(process.cwd(), source);
195
+ const message = deprecationWarningMessages[errorCode];
196
+
197
+ process.emitWarning(
198
+ `${message} (found in "${rel}")`,
199
+ "DeprecationWarning",
200
+ errorCode
201
+ );
202
+ }
203
+
204
+ /**
205
+ * @fileoverview The instance of Ajv validator.
206
+ * @author Evgeny Poberezkin
207
+ */
208
+
209
+ //-----------------------------------------------------------------------------
210
+ // Helpers
211
+ //-----------------------------------------------------------------------------
212
+
213
+ /*
214
+ * Copied from ajv/lib/refs/json-schema-draft-04.json
215
+ * The MIT License (MIT)
216
+ * Copyright (c) 2015-2017 Evgeny Poberezkin
217
+ */
218
+ const metaSchema = {
219
+ id: "http://json-schema.org/draft-04/schema#",
220
+ $schema: "http://json-schema.org/draft-04/schema#",
221
+ description: "Core schema meta-schema",
222
+ definitions: {
223
+ schemaArray: {
224
+ type: "array",
225
+ minItems: 1,
226
+ items: { $ref: "#" }
227
+ },
228
+ positiveInteger: {
229
+ type: "integer",
230
+ minimum: 0
231
+ },
232
+ positiveIntegerDefault0: {
233
+ allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
234
+ },
235
+ simpleTypes: {
236
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
237
+ },
238
+ stringArray: {
239
+ type: "array",
240
+ items: { type: "string" },
241
+ minItems: 1,
242
+ uniqueItems: true
243
+ }
244
+ },
245
+ type: "object",
246
+ properties: {
247
+ id: {
248
+ type: "string"
249
+ },
250
+ $schema: {
251
+ type: "string"
252
+ },
253
+ title: {
254
+ type: "string"
255
+ },
256
+ description: {
257
+ type: "string"
258
+ },
259
+ default: { },
260
+ multipleOf: {
261
+ type: "number",
262
+ minimum: 0,
263
+ exclusiveMinimum: true
264
+ },
265
+ maximum: {
266
+ type: "number"
267
+ },
268
+ exclusiveMaximum: {
269
+ type: "boolean",
270
+ default: false
271
+ },
272
+ minimum: {
273
+ type: "number"
274
+ },
275
+ exclusiveMinimum: {
276
+ type: "boolean",
277
+ default: false
278
+ },
279
+ maxLength: { $ref: "#/definitions/positiveInteger" },
280
+ minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
281
+ pattern: {
282
+ type: "string",
283
+ format: "regex"
284
+ },
285
+ additionalItems: {
286
+ anyOf: [
287
+ { type: "boolean" },
288
+ { $ref: "#" }
289
+ ],
290
+ default: { }
291
+ },
292
+ items: {
293
+ anyOf: [
294
+ { $ref: "#" },
295
+ { $ref: "#/definitions/schemaArray" }
296
+ ],
297
+ default: { }
298
+ },
299
+ maxItems: { $ref: "#/definitions/positiveInteger" },
300
+ minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
301
+ uniqueItems: {
302
+ type: "boolean",
303
+ default: false
304
+ },
305
+ maxProperties: { $ref: "#/definitions/positiveInteger" },
306
+ minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
307
+ required: { $ref: "#/definitions/stringArray" },
308
+ additionalProperties: {
309
+ anyOf: [
310
+ { type: "boolean" },
311
+ { $ref: "#" }
312
+ ],
313
+ default: { }
314
+ },
315
+ definitions: {
316
+ type: "object",
317
+ additionalProperties: { $ref: "#" },
318
+ default: { }
319
+ },
320
+ properties: {
321
+ type: "object",
322
+ additionalProperties: { $ref: "#" },
323
+ default: { }
324
+ },
325
+ patternProperties: {
326
+ type: "object",
327
+ additionalProperties: { $ref: "#" },
328
+ default: { }
329
+ },
330
+ dependencies: {
331
+ type: "object",
332
+ additionalProperties: {
333
+ anyOf: [
334
+ { $ref: "#" },
335
+ { $ref: "#/definitions/stringArray" }
336
+ ]
337
+ }
338
+ },
339
+ enum: {
340
+ type: "array",
341
+ minItems: 1,
342
+ uniqueItems: true
343
+ },
344
+ type: {
345
+ anyOf: [
346
+ { $ref: "#/definitions/simpleTypes" },
347
+ {
348
+ type: "array",
349
+ items: { $ref: "#/definitions/simpleTypes" },
350
+ minItems: 1,
351
+ uniqueItems: true
352
+ }
353
+ ]
354
+ },
355
+ format: { type: "string" },
356
+ allOf: { $ref: "#/definitions/schemaArray" },
357
+ anyOf: { $ref: "#/definitions/schemaArray" },
358
+ oneOf: { $ref: "#/definitions/schemaArray" },
359
+ not: { $ref: "#" }
360
+ },
361
+ dependencies: {
362
+ exclusiveMaximum: ["maximum"],
363
+ exclusiveMinimum: ["minimum"]
364
+ },
365
+ default: { }
366
+ };
367
+
368
+ //------------------------------------------------------------------------------
369
+ // Public Interface
370
+ //------------------------------------------------------------------------------
371
+
372
+ var ajvOrig = (additionalOptions = {}) => {
373
+ const ajv = new Ajv__default["default"]({
374
+ meta: false,
375
+ useDefaults: true,
376
+ validateSchema: false,
377
+ missingRefs: "ignore",
378
+ verbose: true,
379
+ schemaId: "auto",
380
+ ...additionalOptions
381
+ });
382
+
383
+ ajv.addMetaSchema(metaSchema);
384
+ // eslint-disable-next-line no-underscore-dangle -- part of the API
385
+ ajv._opts.defaultMeta = metaSchema.id;
386
+
387
+ return ajv;
388
+ };
389
+
390
+ /**
391
+ * @fileoverview Applies default rule options
392
+ * @author JoshuaKGoldberg
393
+ */
394
+
395
+ /**
396
+ * Check if the variable contains an object strictly rejecting arrays
397
+ * @param {unknown} value an object
398
+ * @returns {boolean} Whether value is an object
399
+ */
400
+ function isObjectNotArray(value) {
401
+ return typeof value === "object" && value !== null && !Array.isArray(value);
402
+ }
403
+
404
+ /**
405
+ * Deeply merges second on top of first, creating a new {} object if needed.
406
+ * @param {T} first Base, default value.
407
+ * @param {U} second User-specified value.
408
+ * @returns {T | U | (T & U)} Merged equivalent of second on top of first.
409
+ */
410
+ function deepMergeObjects(first, second) {
411
+ if (second === void 0) {
412
+ return first;
413
+ }
414
+
415
+ if (!isObjectNotArray(first) || !isObjectNotArray(second)) {
416
+ return second;
417
+ }
418
+
419
+ const result = { ...first, ...second };
420
+
421
+ for (const key of Object.keys(second)) {
422
+ if (Object.prototype.propertyIsEnumerable.call(first, key)) {
423
+ result[key] = deepMergeObjects(first[key], second[key]);
424
+ }
425
+ }
426
+
427
+ return result;
428
+ }
429
+
430
+ /**
431
+ * Deeply merges second on top of first, creating a new [] array if needed.
432
+ * @param {T[] | undefined} first Base, default values.
433
+ * @param {U[] | undefined} second User-specified values.
434
+ * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.
435
+ */
436
+ function deepMergeArrays(first, second) {
437
+ if (!first || !second) {
438
+ return second || first || [];
439
+ }
440
+
441
+ return [
442
+ ...first.map((value, i) => deepMergeObjects(value, second[i])),
443
+ ...second.slice(first.length)
444
+ ];
445
+ }
446
+
447
+ /**
448
+ * @fileoverview Defines a schema for configs.
449
+ * @author Sylvan Mably
450
+ */
451
+
452
+ const baseConfigProperties = {
453
+ $schema: { type: "string" },
454
+ env: { type: "object" },
455
+ extends: { $ref: "#/definitions/stringOrStrings" },
456
+ globals: { type: "object" },
457
+ overrides: {
458
+ type: "array",
459
+ items: { $ref: "#/definitions/overrideConfig" },
460
+ additionalItems: false
461
+ },
462
+ parser: { type: ["string", "null"] },
463
+ parserOptions: { type: "object" },
464
+ plugins: { type: "array" },
465
+ processor: { type: "string" },
466
+ rules: { type: "object" },
467
+ settings: { type: "object" },
468
+ noInlineConfig: { type: "boolean" },
469
+ reportUnusedDisableDirectives: { type: "boolean" },
470
+
471
+ ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
472
+ };
473
+
474
+ const configSchema = {
475
+ definitions: {
476
+ stringOrStrings: {
477
+ oneOf: [
478
+ { type: "string" },
479
+ {
480
+ type: "array",
481
+ items: { type: "string" },
482
+ additionalItems: false
483
+ }
484
+ ]
485
+ },
486
+ stringOrStringsRequired: {
487
+ oneOf: [
488
+ { type: "string" },
489
+ {
490
+ type: "array",
491
+ items: { type: "string" },
492
+ additionalItems: false,
493
+ minItems: 1
494
+ }
495
+ ]
496
+ },
497
+
498
+ // Config at top-level.
499
+ objectConfig: {
500
+ type: "object",
501
+ properties: {
502
+ root: { type: "boolean" },
503
+ ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
504
+ ...baseConfigProperties
505
+ },
506
+ additionalProperties: false
507
+ },
508
+
509
+ // Config in `overrides`.
510
+ overrideConfig: {
511
+ type: "object",
512
+ properties: {
513
+ excludedFiles: { $ref: "#/definitions/stringOrStrings" },
514
+ files: { $ref: "#/definitions/stringOrStringsRequired" },
515
+ ...baseConfigProperties
516
+ },
517
+ required: ["files"],
518
+ additionalProperties: false
519
+ }
520
+ },
521
+
522
+ $ref: "#/definitions/objectConfig"
523
+ };
524
+
525
+ /**
526
+ * @fileoverview Defines environment settings and globals.
527
+ * @author Elan Shanker
528
+ */
529
+
530
+ //------------------------------------------------------------------------------
531
+ // Helpers
532
+ //------------------------------------------------------------------------------
533
+
534
+ /**
535
+ * Get the object that has difference.
536
+ * @param {Record<string,boolean>} current The newer object.
537
+ * @param {Record<string,boolean>} prev The older object.
538
+ * @returns {Record<string,boolean>} The difference object.
539
+ */
540
+ function getDiff(current, prev) {
541
+ const retv = {};
542
+
543
+ for (const [key, value] of Object.entries(current)) {
544
+ if (!Object.hasOwn(prev, key)) {
545
+ retv[key] = value;
546
+ }
547
+ }
548
+
549
+ return retv;
550
+ }
551
+
552
+ const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ...
553
+ const newGlobals2017 = {
554
+ Atomics: false,
555
+ SharedArrayBuffer: false
556
+ };
557
+ const newGlobals2020 = {
558
+ BigInt: false,
559
+ BigInt64Array: false,
560
+ BigUint64Array: false,
561
+ globalThis: false
562
+ };
563
+
564
+ const newGlobals2021 = {
565
+ AggregateError: false,
566
+ FinalizationRegistry: false,
567
+ WeakRef: false
568
+ };
569
+
570
+ //------------------------------------------------------------------------------
571
+ // Public Interface
572
+ //------------------------------------------------------------------------------
573
+
574
+ /** @type {Map<string, import("../lib/shared/types").Environment>} */
575
+ var environments = new Map(Object.entries({
576
+
577
+ // Language
578
+ builtin: {
579
+ globals: globals__default["default"].es5
580
+ },
581
+ es6: {
582
+ globals: newGlobals2015,
583
+ parserOptions: {
584
+ ecmaVersion: 6
585
+ }
586
+ },
587
+ es2015: {
588
+ globals: newGlobals2015,
589
+ parserOptions: {
590
+ ecmaVersion: 6
591
+ }
592
+ },
593
+ es2016: {
594
+ globals: newGlobals2015,
595
+ parserOptions: {
596
+ ecmaVersion: 7
597
+ }
598
+ },
599
+ es2017: {
600
+ globals: { ...newGlobals2015, ...newGlobals2017 },
601
+ parserOptions: {
602
+ ecmaVersion: 8
603
+ }
604
+ },
605
+ es2018: {
606
+ globals: { ...newGlobals2015, ...newGlobals2017 },
607
+ parserOptions: {
608
+ ecmaVersion: 9
609
+ }
610
+ },
611
+ es2019: {
612
+ globals: { ...newGlobals2015, ...newGlobals2017 },
613
+ parserOptions: {
614
+ ecmaVersion: 10
615
+ }
616
+ },
617
+ es2020: {
618
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
619
+ parserOptions: {
620
+ ecmaVersion: 11
621
+ }
622
+ },
623
+ es2021: {
624
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
625
+ parserOptions: {
626
+ ecmaVersion: 12
627
+ }
628
+ },
629
+ es2022: {
630
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
631
+ parserOptions: {
632
+ ecmaVersion: 13
633
+ }
634
+ },
635
+ es2023: {
636
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
637
+ parserOptions: {
638
+ ecmaVersion: 14
639
+ }
640
+ },
641
+ es2024: {
642
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
643
+ parserOptions: {
644
+ ecmaVersion: 15
645
+ }
646
+ },
647
+
648
+ // Platforms
649
+ browser: {
650
+ globals: globals__default["default"].browser
651
+ },
652
+ node: {
653
+ globals: globals__default["default"].node,
654
+ parserOptions: {
655
+ ecmaFeatures: {
656
+ globalReturn: true
657
+ }
658
+ }
659
+ },
660
+ "shared-node-browser": {
661
+ globals: globals__default["default"]["shared-node-browser"]
662
+ },
663
+ worker: {
664
+ globals: globals__default["default"].worker
665
+ },
666
+ serviceworker: {
667
+ globals: globals__default["default"].serviceworker
668
+ },
669
+
670
+ // Frameworks
671
+ commonjs: {
672
+ globals: globals__default["default"].commonjs,
673
+ parserOptions: {
674
+ ecmaFeatures: {
675
+ globalReturn: true
676
+ }
677
+ }
678
+ },
679
+ amd: {
680
+ globals: globals__default["default"].amd
681
+ },
682
+ mocha: {
683
+ globals: globals__default["default"].mocha
684
+ },
685
+ jasmine: {
686
+ globals: globals__default["default"].jasmine
687
+ },
688
+ jest: {
689
+ globals: globals__default["default"].jest
690
+ },
691
+ phantomjs: {
692
+ globals: globals__default["default"].phantomjs
693
+ },
694
+ jquery: {
695
+ globals: globals__default["default"].jquery
696
+ },
697
+ qunit: {
698
+ globals: globals__default["default"].qunit
699
+ },
700
+ prototypejs: {
701
+ globals: globals__default["default"].prototypejs
702
+ },
703
+ shelljs: {
704
+ globals: globals__default["default"].shelljs
705
+ },
706
+ meteor: {
707
+ globals: globals__default["default"].meteor
708
+ },
709
+ mongo: {
710
+ globals: globals__default["default"].mongo
711
+ },
712
+ protractor: {
713
+ globals: globals__default["default"].protractor
714
+ },
715
+ applescript: {
716
+ globals: globals__default["default"].applescript
717
+ },
718
+ nashorn: {
719
+ globals: globals__default["default"].nashorn
720
+ },
721
+ atomtest: {
722
+ globals: globals__default["default"].atomtest
723
+ },
724
+ embertest: {
725
+ globals: globals__default["default"].embertest
726
+ },
727
+ webextensions: {
728
+ globals: globals__default["default"].webextensions
729
+ },
730
+ greasemonkey: {
731
+ globals: globals__default["default"].greasemonkey
732
+ }
733
+ }));
734
+
735
+ /**
736
+ * @fileoverview Validates configs.
737
+ * @author Brandon Mills
738
+ */
739
+
740
+ const ajv = ajvOrig();
741
+
742
+ const ruleValidators = new WeakMap();
743
+ const noop = Function.prototype;
744
+
745
+ //------------------------------------------------------------------------------
746
+ // Private
747
+ //------------------------------------------------------------------------------
748
+ let validateSchema;
749
+ const severityMap = {
750
+ error: 2,
751
+ warn: 1,
752
+ off: 0
753
+ };
754
+
755
+ const validated = new WeakSet();
756
+
757
+ // JSON schema that disallows passing any options
758
+ const noOptionsSchema = Object.freeze({
759
+ type: "array",
760
+ minItems: 0,
761
+ maxItems: 0
762
+ });
763
+
764
+ //-----------------------------------------------------------------------------
765
+ // Exports
766
+ //-----------------------------------------------------------------------------
767
+
768
+ /**
769
+ * Validator for configuration objects.
770
+ */
771
+ class ConfigValidator {
772
+ constructor({ builtInRules = new Map() } = {}) {
773
+ this.builtInRules = builtInRules;
774
+ }
775
+
776
+ /**
777
+ * Gets a complete options schema for a rule.
778
+ * @param {Rule} rule A rule object
779
+ * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
780
+ * @returns {Object|null} JSON Schema for the rule's options.
781
+ * `null` if rule wasn't passed or its `meta.schema` is `false`.
782
+ */
783
+ getRuleOptionsSchema(rule) {
784
+ if (!rule) {
785
+ return null;
786
+ }
787
+
788
+ if (!rule.meta) {
789
+ return { ...noOptionsSchema }; // default if `meta.schema` is not specified
790
+ }
791
+
792
+ const schema = rule.meta.schema;
793
+
794
+ if (typeof schema === "undefined") {
795
+ return { ...noOptionsSchema }; // default if `meta.schema` is not specified
796
+ }
797
+
798
+ // `schema:false` is an allowed explicit opt-out of options validation for the rule
799
+ if (schema === false) {
800
+ return null;
801
+ }
802
+
803
+ if (typeof schema !== "object" || schema === null) {
804
+ throw new TypeError("Rule's `meta.schema` must be an array or object");
805
+ }
806
+
807
+ // ESLint-specific array form needs to be converted into a valid JSON Schema definition
808
+ if (Array.isArray(schema)) {
809
+ if (schema.length) {
810
+ return {
811
+ type: "array",
812
+ items: schema,
813
+ minItems: 0,
814
+ maxItems: schema.length
815
+ };
816
+ }
817
+
818
+ // `schema:[]` is an explicit way to specify that the rule does not accept any options
819
+ return { ...noOptionsSchema };
820
+ }
821
+
822
+ // `schema:<object>` is assumed to be a valid JSON Schema definition
823
+ return schema;
824
+ }
825
+
826
+ /**
827
+ * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.
828
+ * @param {options} options The given options for the rule.
829
+ * @returns {number|string} The rule's severity value
830
+ * @throws {Error} If the severity is invalid.
831
+ */
832
+ validateRuleSeverity(options) {
833
+ const severity = Array.isArray(options) ? options[0] : options;
834
+ const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;
835
+
836
+ if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
837
+ return normSeverity;
838
+ }
839
+
840
+ throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`);
841
+
842
+ }
843
+
844
+ /**
845
+ * Validates the non-severity options passed to a rule, based on its schema.
846
+ * @param {{create: Function}} rule The rule to validate
847
+ * @param {Array} localOptions The options for the rule, excluding severity
848
+ * @returns {void}
849
+ * @throws {Error} If the options are invalid.
850
+ */
851
+ validateRuleSchema(rule, localOptions) {
852
+ if (!ruleValidators.has(rule)) {
853
+ try {
854
+ const schema = this.getRuleOptionsSchema(rule);
855
+
856
+ if (schema) {
857
+ ruleValidators.set(rule, ajv.compile(schema));
858
+ }
859
+ } catch (err) {
860
+ const errorWithCode = new Error(err.message, { cause: err });
861
+
862
+ errorWithCode.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA";
863
+
864
+ throw errorWithCode;
865
+ }
866
+ }
867
+
868
+ const validateRule = ruleValidators.get(rule);
869
+
870
+ if (validateRule) {
871
+ const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions);
872
+
873
+ validateRule(mergedOptions);
874
+
875
+ if (validateRule.errors) {
876
+ throw new Error(validateRule.errors.map(
877
+ error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`
878
+ ).join(""));
879
+ }
880
+ }
881
+ }
882
+
883
+ /**
884
+ * Validates a rule's options against its schema.
885
+ * @param {{create: Function}|null} rule The rule that the config is being validated for
886
+ * @param {string} ruleId The rule's unique name.
887
+ * @param {Array|number} options The given options for the rule.
888
+ * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,
889
+ * no source is prepended to the message.
890
+ * @returns {void}
891
+ * @throws {Error} If the options are invalid.
892
+ */
893
+ validateRuleOptions(rule, ruleId, options, source = null) {
894
+ try {
895
+ const severity = this.validateRuleSeverity(options);
896
+
897
+ if (severity !== 0) {
898
+ this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);
899
+ }
900
+ } catch (err) {
901
+ let enhancedMessage = err.code === "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
902
+ ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}`
903
+ : `Configuration for rule "${ruleId}" is invalid:\n${err.message}`;
904
+
905
+ if (typeof source === "string") {
906
+ enhancedMessage = `${source}:\n\t${enhancedMessage}`;
907
+ }
908
+
909
+ const enhancedError = new Error(enhancedMessage, { cause: err });
910
+
911
+ if (err.code) {
912
+ enhancedError.code = err.code;
913
+ }
914
+
915
+ throw enhancedError;
916
+ }
917
+ }
918
+
919
+ /**
920
+ * Validates an environment object
921
+ * @param {Object} environment The environment config object to validate.
922
+ * @param {string} source The name of the configuration source to report in any errors.
923
+ * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments.
924
+ * @returns {void}
925
+ * @throws {Error} If the environment is invalid.
926
+ */
927
+ validateEnvironment(
928
+ environment,
929
+ source,
930
+ getAdditionalEnv = noop
931
+ ) {
932
+
933
+ // not having an environment is ok
934
+ if (!environment) {
935
+ return;
936
+ }
937
+
938
+ Object.keys(environment).forEach(id => {
939
+ const env = getAdditionalEnv(id) || environments.get(id) || null;
940
+
941
+ if (!env) {
942
+ const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`;
943
+
944
+ throw new Error(message);
945
+ }
946
+ });
947
+ }
948
+
949
+ /**
950
+ * Validates a rules config object
951
+ * @param {Object} rulesConfig The rules config object to validate.
952
+ * @param {string} source The name of the configuration source to report in any errors.
953
+ * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules
954
+ * @returns {void}
955
+ */
956
+ validateRules(
957
+ rulesConfig,
958
+ source,
959
+ getAdditionalRule = noop
960
+ ) {
961
+ if (!rulesConfig) {
962
+ return;
963
+ }
964
+
965
+ Object.keys(rulesConfig).forEach(id => {
966
+ const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;
967
+
968
+ this.validateRuleOptions(rule, id, rulesConfig[id], source);
969
+ });
970
+ }
971
+
972
+ /**
973
+ * Validates a `globals` section of a config file
974
+ * @param {Object} globalsConfig The `globals` section
975
+ * @param {string|null} source The name of the configuration source to report in the event of an error.
976
+ * @returns {void}
977
+ */
978
+ validateGlobals(globalsConfig, source = null) {
979
+ if (!globalsConfig) {
980
+ return;
981
+ }
982
+
983
+ Object.entries(globalsConfig)
984
+ .forEach(([configuredGlobal, configuredValue]) => {
985
+ try {
986
+ normalizeConfigGlobal(configuredValue);
987
+ } catch (err) {
988
+ throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`);
989
+ }
990
+ });
991
+ }
992
+
993
+ /**
994
+ * Validate `processor` configuration.
995
+ * @param {string|undefined} processorName The processor name.
996
+ * @param {string} source The name of config file.
997
+ * @param {(id:string) => Processor} getProcessor The getter of defined processors.
998
+ * @returns {void}
999
+ * @throws {Error} If the processor is invalid.
1000
+ */
1001
+ validateProcessor(processorName, source, getProcessor) {
1002
+ if (processorName && !getProcessor(processorName)) {
1003
+ throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);
1004
+ }
1005
+ }
1006
+
1007
+ /**
1008
+ * Formats an array of schema validation errors.
1009
+ * @param {Array} errors An array of error messages to format.
1010
+ * @returns {string} Formatted error message
1011
+ */
1012
+ formatErrors(errors) {
1013
+ return errors.map(error => {
1014
+ if (error.keyword === "additionalProperties") {
1015
+ const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;
1016
+
1017
+ return `Unexpected top-level property "${formattedPropertyPath}"`;
1018
+ }
1019
+ if (error.keyword === "type") {
1020
+ const formattedField = error.dataPath.slice(1);
1021
+ const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema;
1022
+ const formattedValue = JSON.stringify(error.data);
1023
+
1024
+ return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`;
1025
+ }
1026
+
1027
+ const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
1028
+
1029
+ return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
1030
+ }).map(message => `\t- ${message}.\n`).join("");
1031
+ }
1032
+
1033
+ /**
1034
+ * Validates the top level properties of the config object.
1035
+ * @param {Object} config The config object to validate.
1036
+ * @param {string} source The name of the configuration source to report in any errors.
1037
+ * @returns {void}
1038
+ * @throws {Error} If the config is invalid.
1039
+ */
1040
+ validateConfigSchema(config, source = null) {
1041
+ validateSchema = validateSchema || ajv.compile(configSchema);
1042
+
1043
+ if (!validateSchema(config)) {
1044
+ throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`);
1045
+ }
1046
+
1047
+ if (Object.hasOwn(config, "ecmaFeatures")) {
1048
+ emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
1049
+ }
1050
+ }
1051
+
1052
+ /**
1053
+ * Validates an entire config object.
1054
+ * @param {Object} config The config object to validate.
1055
+ * @param {string} source The name of the configuration source to report in any errors.
1056
+ * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules.
1057
+ * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs.
1058
+ * @returns {void}
1059
+ */
1060
+ validate(config, source, getAdditionalRule, getAdditionalEnv) {
1061
+ this.validateConfigSchema(config, source);
1062
+ this.validateRules(config.rules, source, getAdditionalRule);
1063
+ this.validateEnvironment(config.env, source, getAdditionalEnv);
1064
+ this.validateGlobals(config.globals, source);
1065
+
1066
+ for (const override of config.overrides || []) {
1067
+ this.validateRules(override.rules, source, getAdditionalRule);
1068
+ this.validateEnvironment(override.env, source, getAdditionalEnv);
1069
+ this.validateGlobals(config.globals, source);
1070
+ }
1071
+ }
1072
+
1073
+ /**
1074
+ * Validate config array object.
1075
+ * @param {ConfigArray} configArray The config array to validate.
1076
+ * @returns {void}
1077
+ */
1078
+ validateConfigArray(configArray) {
1079
+ const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);
1080
+ const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);
1081
+ const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);
1082
+
1083
+ // Validate.
1084
+ for (const element of configArray) {
1085
+ if (validated.has(element)) {
1086
+ continue;
1087
+ }
1088
+ validated.add(element);
1089
+
1090
+ this.validateEnvironment(element.env, element.name, getPluginEnv);
1091
+ this.validateGlobals(element.globals, element.name);
1092
+ this.validateProcessor(element.processor, element.name, getPluginProcessor);
1093
+ this.validateRules(element.rules, element.name, getPluginRule);
1094
+ }
1095
+ }
1096
+
1097
+ }
1098
+
1099
+ /**
1100
+ * @fileoverview Common helpers for naming of plugins, formatters and configs
1101
+ */
1102
+
1103
+ const NAMESPACE_REGEX = /^@.*\//iu;
1104
+
1105
+ /**
1106
+ * Brings package name to correct format based on prefix
1107
+ * @param {string} name The name of the package.
1108
+ * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"
1109
+ * @returns {string} Normalized name of the package
1110
+ * @private
1111
+ */
1112
+ function normalizePackageName(name, prefix) {
1113
+ let normalizedName = name;
1114
+
1115
+ /**
1116
+ * On Windows, name can come in with Windows slashes instead of Unix slashes.
1117
+ * Normalize to Unix first to avoid errors later on.
1118
+ * https://github.com/eslint/eslint/issues/5644
1119
+ */
1120
+ if (normalizedName.includes("\\")) {
1121
+ normalizedName = normalizedName.replace(/\\/gu, "/");
1122
+ }
1123
+
1124
+ if (normalizedName.charAt(0) === "@") {
1125
+
1126
+ /**
1127
+ * it's a scoped package
1128
+ * package name is the prefix, or just a username
1129
+ */
1130
+ const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"),
1131
+ scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");
1132
+
1133
+ if (scopedPackageShortcutRegex.test(normalizedName)) {
1134
+ normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);
1135
+ } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {
1136
+
1137
+ /**
1138
+ * for scoped packages, insert the prefix after the first / unless
1139
+ * the path is already @scope/eslint or @scope/eslint-xxx-yyy
1140
+ */
1141
+ normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`);
1142
+ }
1143
+ } else if (!normalizedName.startsWith(`${prefix}-`)) {
1144
+ normalizedName = `${prefix}-${normalizedName}`;
1145
+ }
1146
+
1147
+ return normalizedName;
1148
+ }
1149
+
1150
+ /**
1151
+ * Removes the prefix from a fullname.
1152
+ * @param {string} fullname The term which may have the prefix.
1153
+ * @param {string} prefix The prefix to remove.
1154
+ * @returns {string} The term without prefix.
1155
+ */
1156
+ function getShorthandName(fullname, prefix) {
1157
+ if (fullname[0] === "@") {
1158
+ let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname);
1159
+
1160
+ if (matchResult) {
1161
+ return matchResult[1];
1162
+ }
1163
+
1164
+ matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname);
1165
+ if (matchResult) {
1166
+ return `${matchResult[1]}/${matchResult[2]}`;
1167
+ }
1168
+ } else if (fullname.startsWith(`${prefix}-`)) {
1169
+ return fullname.slice(prefix.length + 1);
1170
+ }
1171
+
1172
+ return fullname;
1173
+ }
1174
+
1175
+ /**
1176
+ * Gets the scope (namespace) of a term.
1177
+ * @param {string} term The term which may have the namespace.
1178
+ * @returns {string} The namespace of the term if it has one.
1179
+ */
1180
+ function getNamespaceFromTerm(term) {
1181
+ const match = term.match(NAMESPACE_REGEX);
1182
+
1183
+ return match ? match[0] : "";
1184
+ }
1185
+
1186
+ var naming = {
1187
+ __proto__: null,
1188
+ normalizePackageName: normalizePackageName,
1189
+ getShorthandName: getShorthandName,
1190
+ getNamespaceFromTerm: getNamespaceFromTerm
1191
+ };
1192
+
1193
+ /**
1194
+ * @fileoverview Package exports for @eslint/eslintrc
1195
+ * @author Nicholas C. Zakas
1196
+ */
1197
+
1198
+ //-----------------------------------------------------------------------------
1199
+ // Exports
1200
+ //-----------------------------------------------------------------------------
1201
+
1202
+ const Legacy = {
1203
+ environments,
1204
+
1205
+ // shared
1206
+ ConfigOps,
1207
+ ConfigValidator,
1208
+ naming
1209
+ };
1210
+
1211
+ exports.Legacy = Legacy;
1212
+ //# sourceMappingURL=eslintrc-universal.cjs.map
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"eslintrc-universal.cjs","sources":["../lib/shared/config-ops.js","../lib/shared/deprecation-warnings.js","../lib/shared/ajv.js","../lib/shared/deep-merge-arrays.js","../conf/config-schema.js","../conf/environments.js","../lib/shared/config-validator.js","../lib/shared/naming.js","../lib/index-universal.js"],"sourcesContent":["/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = [\"off\", \"warn\", \"error\"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = new Set([0, 1, 2, \"off\", \"warn\", \"error\"]);\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule's configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string \"off\" (treated the same as 0),\n * the string \"warn\" (treated the same as 1), the string \"error\" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === \"string\") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === \"number\") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === \"number\") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === \"string\") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.has(severity);\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {(\"readable\"|\"writeable\"|\"off\")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case \"off\":\n return \"off\";\n\n case true:\n case \"true\":\n case \"writeable\":\n case \"writable\":\n return \"writable\";\n\n case null:\n case false:\n case \"false\":\n case \"readable\":\n case \"readonly\":\n return \"readonly\";\n\n default:\n throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);\n }\n}\n\nexport {\n getRuleSeverity,\n normalizeToStrings,\n isErrorSeverity,\n isValidSeverity,\n isEverySeverityValid,\n normalizeConfigGlobal\n};\n","/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima <http://github.com/mysticatea>\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport path from \"node:path\";\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n \"The 'ecmaFeatures' config file property is deprecated and has no effect.\",\n ESLINT_PERSONAL_CONFIG_LOAD:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please use a config file per project or the '--config' option.\",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n \"'~/.eslintrc.*' config files have been deprecated. \" +\n \"Please remove it or add 'root:true' to the config files in your \" +\n \"projects in order to avoid loading '~/.eslintrc.*' accidentally.\"\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path.relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in \"${rel}\")`,\n \"DeprecationWarning\",\n errorCode\n );\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n emitDeprecationWarning\n};\n","/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport Ajv from \"ajv\";\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: \"http://json-schema.org/draft-04/schema#\",\n $schema: \"http://json-schema.org/draft-04/schema#\",\n description: \"Core schema meta-schema\",\n definitions: {\n schemaArray: {\n type: \"array\",\n minItems: 1,\n items: { $ref: \"#\" }\n },\n positiveInteger: {\n type: \"integer\",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: \"#/definitions/positiveInteger\" }, { default: 0 }]\n },\n simpleTypes: {\n enum: [\"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"]\n },\n stringArray: {\n type: \"array\",\n items: { type: \"string\" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: \"object\",\n properties: {\n id: {\n type: \"string\"\n },\n $schema: {\n type: \"string\"\n },\n title: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n default: { },\n multipleOf: {\n type: \"number\",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: \"number\"\n },\n exclusiveMaximum: {\n type: \"boolean\",\n default: false\n },\n minimum: {\n type: \"number\"\n },\n exclusiveMinimum: {\n type: \"boolean\",\n default: false\n },\n maxLength: { $ref: \"#/definitions/positiveInteger\" },\n minLength: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n pattern: {\n type: \"string\",\n format: \"regex\"\n },\n additionalItems: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/schemaArray\" }\n ],\n default: { }\n },\n maxItems: { $ref: \"#/definitions/positiveInteger\" },\n minItems: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n uniqueItems: {\n type: \"boolean\",\n default: false\n },\n maxProperties: { $ref: \"#/definitions/positiveInteger\" },\n minProperties: { $ref: \"#/definitions/positiveIntegerDefault0\" },\n required: { $ref: \"#/definitions/stringArray\" },\n additionalProperties: {\n anyOf: [\n { type: \"boolean\" },\n { $ref: \"#\" }\n ],\n default: { }\n },\n definitions: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n properties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n patternProperties: {\n type: \"object\",\n additionalProperties: { $ref: \"#\" },\n default: { }\n },\n dependencies: {\n type: \"object\",\n additionalProperties: {\n anyOf: [\n { $ref: \"#\" },\n { $ref: \"#/definitions/stringArray\" }\n ]\n }\n },\n enum: {\n type: \"array\",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: \"#/definitions/simpleTypes\" },\n {\n type: \"array\",\n items: { $ref: \"#/definitions/simpleTypes\" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: \"string\" },\n allOf: { $ref: \"#/definitions/schemaArray\" },\n anyOf: { $ref: \"#/definitions/schemaArray\" },\n oneOf: { $ref: \"#/definitions/schemaArray\" },\n not: { $ref: \"#\" }\n },\n dependencies: {\n exclusiveMaximum: [\"maximum\"],\n exclusiveMinimum: [\"minimum\"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport default (additionalOptions = {}) => {\n const ajv = new Ajv({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: \"ignore\",\n verbose: true,\n schemaId: \"auto\",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle -- part of the API\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n","/**\n * @fileoverview Applies default rule options\n * @author JoshuaKGoldberg\n */\n\n/**\n * Check if the variable contains an object strictly rejecting arrays\n * @param {unknown} value an object\n * @returns {boolean} Whether value is an object\n */\nfunction isObjectNotArray(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Deeply merges second on top of first, creating a new {} object if needed.\n * @param {T} first Base, default value.\n * @param {U} second User-specified value.\n * @returns {T | U | (T & U)} Merged equivalent of second on top of first.\n */\nfunction deepMergeObjects(first, second) {\n if (second === void 0) {\n return first;\n }\n\n if (!isObjectNotArray(first) || !isObjectNotArray(second)) {\n return second;\n }\n\n const result = { ...first, ...second };\n\n for (const key of Object.keys(second)) {\n if (Object.prototype.propertyIsEnumerable.call(first, key)) {\n result[key] = deepMergeObjects(first[key], second[key]);\n }\n }\n\n return result;\n}\n\n/**\n * Deeply merges second on top of first, creating a new [] array if needed.\n * @param {T[] | undefined} first Base, default values.\n * @param {U[] | undefined} second User-specified values.\n * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.\n */\nfunction deepMergeArrays(first, second) {\n if (!first || !second) {\n return second || first || [];\n }\n\n return [\n ...first.map((value, i) => deepMergeObjects(value, second[i])),\n ...second.slice(first.length)\n ];\n}\n\nexport { deepMergeArrays };\n","/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: \"string\" },\n env: { type: \"object\" },\n extends: { $ref: \"#/definitions/stringOrStrings\" },\n globals: { type: \"object\" },\n overrides: {\n type: \"array\",\n items: { $ref: \"#/definitions/overrideConfig\" },\n additionalItems: false\n },\n parser: { type: [\"string\", \"null\"] },\n parserOptions: { type: \"object\" },\n plugins: { type: \"array\" },\n processor: { type: \"string\" },\n rules: { type: \"object\" },\n settings: { type: \"object\" },\n noInlineConfig: { type: \"boolean\" },\n reportUnusedDisableDirectives: { type: \"boolean\" },\n\n ecmaFeatures: { type: \"object\" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: \"string\" },\n {\n type: \"array\",\n items: { type: \"string\" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: \"object\",\n properties: {\n root: { type: \"boolean\" },\n ignorePatterns: { $ref: \"#/definitions/stringOrStrings\" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: \"object\",\n properties: {\n excludedFiles: { $ref: \"#/definitions/stringOrStrings\" },\n files: { $ref: \"#/definitions/stringOrStringsRequired\" },\n ...baseConfigProperties\n },\n required: [\"files\"],\n additionalProperties: false\n }\n },\n\n $ref: \"#/definitions/objectConfig\"\n};\n\nexport default configSchema;\n","/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport globals from \"globals\";\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record<string,boolean>} current The newer object.\n * @param {Record<string,boolean>} prev The older object.\n * @returns {Record<string,boolean>} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwn(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map<string, import(\"../lib/shared/types\").Environment>} */\nexport default new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals.es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n es2023: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 14\n }\n },\n es2024: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 15\n }\n },\n\n // Platforms\n browser: {\n globals: globals.browser\n },\n node: {\n globals: globals.node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n \"shared-node-browser\": {\n globals: globals[\"shared-node-browser\"]\n },\n worker: {\n globals: globals.worker\n },\n serviceworker: {\n globals: globals.serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals.commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals.amd\n },\n mocha: {\n globals: globals.mocha\n },\n jasmine: {\n globals: globals.jasmine\n },\n jest: {\n globals: globals.jest\n },\n phantomjs: {\n globals: globals.phantomjs\n },\n jquery: {\n globals: globals.jquery\n },\n qunit: {\n globals: globals.qunit\n },\n prototypejs: {\n globals: globals.prototypejs\n },\n shelljs: {\n globals: globals.shelljs\n },\n meteor: {\n globals: globals.meteor\n },\n mongo: {\n globals: globals.mongo\n },\n protractor: {\n globals: globals.protractor\n },\n applescript: {\n globals: globals.applescript\n },\n nashorn: {\n globals: globals.nashorn\n },\n atomtest: {\n globals: globals.atomtest\n },\n embertest: {\n globals: globals.embertest\n },\n webextensions: {\n globals: globals.webextensions\n },\n greasemonkey: {\n globals: globals.greasemonkey\n }\n}));\n","/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\n/* eslint class-methods-use-this: \"off\" -- not needed in this file */\n\n//------------------------------------------------------------------------------\n// Typedefs\n//------------------------------------------------------------------------------\n\n/** @typedef {import(\"../shared/types\").Rule} Rule */\n\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport util from \"node:util\";\nimport * as ConfigOps from \"./config-ops.js\";\nimport { emitDeprecationWarning } from \"./deprecation-warnings.js\";\nimport ajvOrig from \"./ajv.js\";\nimport { deepMergeArrays } from \"./deep-merge-arrays.js\";\nimport configSchema from \"../../conf/config-schema.js\";\nimport BuiltInEnvironments from \"../../conf/environments.js\";\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n// JSON schema that disallows passing any options\nconst noOptionsSchema = Object.freeze({\n type: \"array\",\n minItems: 0,\n maxItems: 0\n});\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\n/**\n * Validator for configuration objects.\n */\nexport default class ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {Rule} rule A rule object\n * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.\n * @returns {Object|null} JSON Schema for the rule's options.\n * `null` if rule wasn't passed or its `meta.schema` is `false`.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n if (!rule.meta) {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n const schema = rule.meta.schema;\n\n if (typeof schema === \"undefined\") {\n return { ...noOptionsSchema }; // default if `meta.schema` is not specified\n }\n\n // `schema:false` is an allowed explicit opt-out of options validation for the rule\n if (schema === false) {\n return null;\n }\n\n if (typeof schema !== \"object\" || schema === null) {\n throw new TypeError(\"Rule's `meta.schema` must be an array or object\");\n }\n\n // ESLint-specific array form needs to be converted into a valid JSON Schema definition\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: \"array\",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n\n // `schema:[]` is an explicit way to specify that the rule does not accept any options\n return { ...noOptionsSchema };\n }\n\n // `schema:<object>` is assumed to be a valid JSON Schema definition\n return schema;\n }\n\n /**\n * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule's severity value\n * @throws {Error} If the severity is invalid.\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === \"string\" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, \"\\\"\").replace(/\\n/gu, \"\")}').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n try {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n } catch (err) {\n const errorWithCode = new Error(err.message, { cause: err });\n\n errorWithCode.code = \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\";\n\n throw errorWithCode;\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n const mergedOptions = deepMergeArrays(rule.meta?.defaultOptions, localOptions);\n\n validateRule(mergedOptions);\n\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(\"\"));\n }\n }\n }\n\n /**\n * Validates a rule's options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule's unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n * @throws {Error} If the options are invalid.\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n let enhancedMessage = err.code === \"ESLINT_INVALID_RULE_OPTIONS_SCHEMA\"\n ? `Error while processing options validation schema of rule '${ruleId}': ${err.message}`\n : `Configuration for rule \"${ruleId}\" is invalid:\\n${err.message}`;\n\n if (typeof source === \"string\") {\n enhancedMessage = `${source}:\\n\\t${enhancedMessage}`;\n }\n\n const enhancedError = new Error(enhancedMessage, { cause: err });\n\n if (err.code) {\n enhancedError.code = err.code;\n }\n\n throw enhancedError;\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n * @throws {Error} If the environment is invalid.\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key \"${id}\" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n ConfigOps.normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {(id:string) => Processor} getProcessor The getter of defined processors.\n * @returns {void}\n * @throws {Error} If the processor is invalid.\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === \"additionalProperties\") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property \"${formattedPropertyPath}\"`;\n }\n if (error.keyword === \"type\") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join(\"/\") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property \"${formattedField}\" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === \".\" ? error.dataPath.slice(1) : error.dataPath;\n\n return `\"${field}\" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join(\"\");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n * @throws {Error} If the config is invalid.\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwn(config, \"ecmaFeatures\")) {\n emitDeprecationWarning(source, \"ESLINT_LEGACY_ECMAFEATURES\");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {(ruleId:string) => Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {(envId:string) => Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n","/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either \"eslint-plugin\", \"eslint-config\" or \"eslint-formatter\"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes(\"\\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, \"/\");\n }\n\n if (normalizedName.charAt(0) === \"@\") {\n\n /**\n * it's a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, \"u\"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, \"u\");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split(\"/\")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === \"@\") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, \"u\").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, \"u\").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : \"\";\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport {\n normalizePackageName,\n getShorthandName,\n getNamespaceFromTerm\n};\n","/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport * as ConfigOps from \"./shared/config-ops.js\";\nimport ConfigValidator from \"./shared/config-validator.js\";\nimport * as naming from \"./shared/naming.js\";\nimport environments from \"../conf/environments.js\";\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n naming\n};\n\nexport {\n Legacy\n};\n"],"names":["path","Ajv","globals","util","BuiltInEnvironments","ConfigOps.normalizeConfigGlobal"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;AACtD,IA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;AACA;AACA;AACA;AACA;AACK,MAAC,MAAM,GAAG;AACf,IAAI,YAAY;AAChB;AACA;AACA,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,MAAM;AACV;;;;"}
platform/dbops/archive/databases_old/data/home/x/india-h200-1-workspace/claude-code-router/ui/node_modules/@eslint/eslintrc/dist/eslintrc.cjs ADDED
The diff for this file is too large to render. See raw diff