@dineroregnskab/eslint-plugin-custom-rules 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/eslint-plugin-custom-rules.js +2 -0
  2. package/package.json +1 -1
  3. package/node_modules/@aashutoshrathi/word-wrap/LICENSE +0 -21
  4. package/node_modules/@aashutoshrathi/word-wrap/README.md +0 -182
  5. package/node_modules/@aashutoshrathi/word-wrap/index.d.ts +0 -50
  6. package/node_modules/@aashutoshrathi/word-wrap/index.js +0 -52
  7. package/node_modules/@aashutoshrathi/word-wrap/package.json +0 -81
  8. package/node_modules/@angular-eslint/bundled-angular-compiler/README.md +0 -1
  9. package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.d.ts +0 -5
  10. package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.js +0 -32004
  11. package/node_modules/@angular-eslint/bundled-angular-compiler/package.json +0 -19
  12. package/node_modules/@angular-eslint/template-parser/LICENSE +0 -21
  13. package/node_modules/@angular-eslint/template-parser/README.md +0 -1
  14. package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.d.ts +0 -6
  15. package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.js +0 -69
  16. package/node_modules/@angular-eslint/template-parser/dist/index.d.ts +0 -44
  17. package/node_modules/@angular-eslint/template-parser/dist/index.js +0 -219
  18. package/node_modules/@angular-eslint/template-parser/package.json +0 -28
  19. package/node_modules/@eslint/eslintrc/LICENSE +0 -19
  20. package/node_modules/@eslint/eslintrc/README.md +0 -115
  21. package/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
  22. package/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
  23. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1104
  24. package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  25. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4333
  26. package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  27. package/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
  28. package/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -523
  29. package/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -115
  30. package/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
  31. package/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
  32. package/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
  33. package/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
  34. package/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1149
  35. package/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
  36. package/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
  37. package/node_modules/@eslint/eslintrc/lib/index.js +0 -56
  38. package/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
  39. package/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
  40. package/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -325
  41. package/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
  42. package/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
  43. package/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
  44. package/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
  45. package/node_modules/@eslint/eslintrc/package.json +0 -82
  46. package/node_modules/@eslint/eslintrc/universal.js +0 -9
  47. package/node_modules/@eslint/js/LICENSE +0 -19
  48. package/node_modules/@eslint/js/README.md +0 -57
  49. package/node_modules/@eslint/js/package.json +0 -31
  50. package/node_modules/@eslint/js/src/configs/eslint-all.js +0 -211
  51. package/node_modules/@eslint/js/src/configs/eslint-recommended.js +0 -76
  52. package/node_modules/@eslint/js/src/index.js +0 -17
  53. package/node_modules/@eslint-community/eslint-utils/LICENSE +0 -21
  54. package/node_modules/@eslint-community/eslint-utils/README.md +0 -37
  55. package/node_modules/@eslint-community/eslint-utils/index.js +0 -2068
  56. package/node_modules/@eslint-community/eslint-utils/index.js.map +0 -1
  57. package/node_modules/@eslint-community/eslint-utils/index.mjs +0 -2027
  58. package/node_modules/@eslint-community/eslint-utils/index.mjs.map +0 -1
  59. package/node_modules/@eslint-community/eslint-utils/package.json +0 -73
  60. package/node_modules/@eslint-community/regexpp/LICENSE +0 -21
  61. package/node_modules/@eslint-community/regexpp/README.md +0 -177
  62. package/node_modules/@eslint-community/regexpp/index.d.ts +0 -1065
  63. package/node_modules/@eslint-community/regexpp/index.js +0 -2747
  64. package/node_modules/@eslint-community/regexpp/index.js.map +0 -1
  65. package/node_modules/@eslint-community/regexpp/index.mjs +0 -2737
  66. package/node_modules/@eslint-community/regexpp/index.mjs.map +0 -1
  67. package/node_modules/@eslint-community/regexpp/package.json +0 -93
  68. package/node_modules/@humanwhocodes/config-array/LICENSE +0 -201
  69. package/node_modules/@humanwhocodes/config-array/README.md +0 -342
  70. package/node_modules/@humanwhocodes/config-array/api.js +0 -1061
  71. package/node_modules/@humanwhocodes/config-array/package.json +0 -61
  72. package/node_modules/@humanwhocodes/module-importer/CHANGELOG.md +0 -15
  73. package/node_modules/@humanwhocodes/module-importer/LICENSE +0 -201
  74. package/node_modules/@humanwhocodes/module-importer/README.md +0 -80
  75. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs +0 -22
  76. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts +0 -27
  77. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts +0 -2
  78. package/node_modules/@humanwhocodes/module-importer/dist/module-importer.js +0 -18
  79. package/node_modules/@humanwhocodes/module-importer/package.json +0 -65
  80. package/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs +0 -81
  81. package/node_modules/@humanwhocodes/module-importer/src/module-importer.js +0 -22
  82. package/node_modules/@humanwhocodes/object-schema/.eslintrc.js +0 -29
  83. package/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml +0 -27
  84. package/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml +0 -39
  85. package/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +0 -26
  86. package/node_modules/@humanwhocodes/object-schema/LICENSE +0 -29
  87. package/node_modules/@humanwhocodes/object-schema/README.md +0 -234
  88. package/node_modules/@humanwhocodes/object-schema/package.json +0 -33
  89. package/node_modules/@humanwhocodes/object-schema/src/index.js +0 -7
  90. package/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js +0 -53
  91. package/node_modules/@humanwhocodes/object-schema/src/object-schema.js +0 -301
  92. package/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js +0 -102
  93. package/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +0 -66
  94. package/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +0 -659
  95. package/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +0 -186
  96. package/node_modules/@nodelib/fs.scandir/LICENSE +0 -21
  97. package/node_modules/@nodelib/fs.scandir/README.md +0 -171
  98. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  99. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +0 -19
  100. package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +0 -4
  101. package/node_modules/@nodelib/fs.scandir/out/constants.js +0 -17
  102. package/node_modules/@nodelib/fs.scandir/out/index.d.ts +0 -12
  103. package/node_modules/@nodelib/fs.scandir/out/index.js +0 -26
  104. package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  105. package/node_modules/@nodelib/fs.scandir/out/providers/async.js +0 -104
  106. package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +0 -1
  107. package/node_modules/@nodelib/fs.scandir/out/providers/common.js +0 -13
  108. package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +0 -5
  109. package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +0 -54
  110. package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  111. package/node_modules/@nodelib/fs.scandir/out/settings.js +0 -24
  112. package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  113. package/node_modules/@nodelib/fs.scandir/out/types/index.js +0 -2
  114. package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +0 -2
  115. package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +0 -19
  116. package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +0 -2
  117. package/node_modules/@nodelib/fs.scandir/out/utils/index.js +0 -5
  118. package/node_modules/@nodelib/fs.scandir/package.json +0 -44
  119. package/node_modules/@nodelib/fs.stat/LICENSE +0 -21
  120. package/node_modules/@nodelib/fs.stat/README.md +0 -126
  121. package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  122. package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +0 -17
  123. package/node_modules/@nodelib/fs.stat/out/index.d.ts +0 -12
  124. package/node_modules/@nodelib/fs.stat/out/index.js +0 -26
  125. package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  126. package/node_modules/@nodelib/fs.stat/out/providers/async.js +0 -36
  127. package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +0 -3
  128. package/node_modules/@nodelib/fs.stat/out/providers/sync.js +0 -23
  129. package/node_modules/@nodelib/fs.stat/out/settings.d.ts +0 -16
  130. package/node_modules/@nodelib/fs.stat/out/settings.js +0 -16
  131. package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  132. package/node_modules/@nodelib/fs.stat/out/types/index.js +0 -2
  133. package/node_modules/@nodelib/fs.stat/package.json +0 -37
  134. package/node_modules/@nodelib/fs.walk/LICENSE +0 -21
  135. package/node_modules/@nodelib/fs.walk/README.md +0 -215
  136. package/node_modules/@nodelib/fs.walk/out/index.d.ts +0 -14
  137. package/node_modules/@nodelib/fs.walk/out/index.js +0 -34
  138. package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  139. package/node_modules/@nodelib/fs.walk/out/providers/async.js +0 -30
  140. package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +0 -4
  141. package/node_modules/@nodelib/fs.walk/out/providers/index.js +0 -9
  142. package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +0 -12
  143. package/node_modules/@nodelib/fs.walk/out/providers/stream.js +0 -34
  144. package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +0 -10
  145. package/node_modules/@nodelib/fs.walk/out/providers/sync.js +0 -14
  146. package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  147. package/node_modules/@nodelib/fs.walk/out/readers/async.js +0 -97
  148. package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +0 -7
  149. package/node_modules/@nodelib/fs.walk/out/readers/common.js +0 -31
  150. package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  151. package/node_modules/@nodelib/fs.walk/out/readers/reader.js +0 -11
  152. package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +0 -15
  153. package/node_modules/@nodelib/fs.walk/out/readers/sync.js +0 -59
  154. package/node_modules/@nodelib/fs.walk/out/settings.d.ts +0 -30
  155. package/node_modules/@nodelib/fs.walk/out/settings.js +0 -26
  156. package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  157. package/node_modules/@nodelib/fs.walk/out/types/index.js +0 -2
  158. package/node_modules/@nodelib/fs.walk/package.json +0 -44
  159. package/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +0 -31
  160. package/node_modules/@ungap/structured-clone/LICENSE +0 -15
  161. package/node_modules/@ungap/structured-clone/README.md +0 -95
  162. package/node_modules/@ungap/structured-clone/cjs/deserialize.js +0 -78
  163. package/node_modules/@ungap/structured-clone/cjs/index.js +0 -27
  164. package/node_modules/@ungap/structured-clone/cjs/json.js +0 -24
  165. package/node_modules/@ungap/structured-clone/cjs/package.json +0 -1
  166. package/node_modules/@ungap/structured-clone/cjs/serialize.js +0 -160
  167. package/node_modules/@ungap/structured-clone/cjs/types.js +0 -22
  168. package/node_modules/@ungap/structured-clone/esm/deserialize.js +0 -79
  169. package/node_modules/@ungap/structured-clone/esm/index.js +0 -25
  170. package/node_modules/@ungap/structured-clone/esm/json.js +0 -21
  171. package/node_modules/@ungap/structured-clone/esm/serialize.js +0 -161
  172. package/node_modules/@ungap/structured-clone/esm/types.js +0 -11
  173. package/node_modules/@ungap/structured-clone/package.json +0 -53
  174. package/node_modules/@ungap/structured-clone/structured-json.js +0 -1
@@ -1,61 +0,0 @@
1
- {
2
- "name": "@humanwhocodes/config-array",
3
- "version": "0.11.13",
4
- "description": "Glob-based configuration matching.",
5
- "author": "Nicholas C. Zakas",
6
- "main": "api.js",
7
- "files": [
8
- "api.js"
9
- ],
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/humanwhocodes/config-array.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/humanwhocodes/config-array/issues"
16
- },
17
- "homepage": "https://github.com/humanwhocodes/config-array#readme",
18
- "scripts": {
19
- "build": "rollup -c",
20
- "format": "nitpik",
21
- "lint": "eslint *.config.js src/*.js tests/*.js",
22
- "lint:fix": "eslint --fix *.config.js src/*.js tests/*.js",
23
- "prepublish": "npm run build",
24
- "test:coverage": "nyc --include src/*.js npm run test",
25
- "test": "mocha -r esm tests/ --recursive"
26
- },
27
- "gitHooks": {
28
- "pre-commit": "lint-staged"
29
- },
30
- "lint-staged": {
31
- "*.js": [
32
- "eslint --fix --ignore-pattern '!.eslintrc.js'"
33
- ]
34
- },
35
- "keywords": [
36
- "configuration",
37
- "configarray",
38
- "config file"
39
- ],
40
- "license": "Apache-2.0",
41
- "engines": {
42
- "node": ">=10.10.0"
43
- },
44
- "dependencies": {
45
- "@humanwhocodes/object-schema": "^2.0.1",
46
- "debug": "^4.1.1",
47
- "minimatch": "^3.0.5"
48
- },
49
- "devDependencies": {
50
- "@nitpik/javascript": "0.4.0",
51
- "@nitpik/node": "0.0.5",
52
- "chai": "4.3.10",
53
- "eslint": "8.51.0",
54
- "esm": "3.2.25",
55
- "lint-staged": "15.0.2",
56
- "mocha": "6.2.3",
57
- "nyc": "15.1.0",
58
- "rollup": "3.28.1",
59
- "yorkie": "2.0.0"
60
- }
61
- }
@@ -1,15 +0,0 @@
1
- # Changelog
2
-
3
- ## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18)
4
-
5
-
6
- ### Bug Fixes
7
-
8
- * Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6)
9
-
10
- ## 1.0.0 (2022-08-17)
11
-
12
-
13
- ### Features
14
-
15
- * Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563))
@@ -1,201 +0,0 @@
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.
@@ -1,80 +0,0 @@
1
- # ModuleImporter
2
-
3
- by [Nicholas C. Zakas](https://humanwhocodes.com)
4
-
5
- If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).
6
-
7
- ## Description
8
-
9
- A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues.
10
-
11
- The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory.
12
-
13
- ## Usage
14
-
15
- ### Node.js
16
-
17
- Install using [npm][npm] or [yarn][yarn]:
18
-
19
- ```
20
- npm install @humanwhocodes/module-importer
21
-
22
- # or
23
-
24
- yarn add @humanwhocodes/module-importer
25
- ```
26
-
27
- Import into your Node.js project:
28
-
29
- ```js
30
- // CommonJS
31
- const { ModuleImporter } = require("@humanwhocodes/module-importer");
32
-
33
- // ESM
34
- import { ModuleImporter } from "@humanwhocodes/module-importer";
35
- ```
36
-
37
- ### Bun
38
-
39
- Install using this command:
40
-
41
- ```
42
- bun add @humanwhocodes/module-importer
43
- ```
44
-
45
- Import into your Bun project:
46
-
47
- ```js
48
- import { ModuleImporter } from "@humanwhocodes/module-importer";
49
- ```
50
-
51
- ## API
52
-
53
- After importing, create a new instance of `ModuleImporter` to start emitting events:
54
-
55
- ```js
56
- // cwd can be omitted to use process.cwd()
57
- const importer = new ModuleImporter(cwd);
58
-
59
- // you can resolve the location of any package
60
- const location = importer.resolve("./some-file.cjs");
61
-
62
- // you can also import directly
63
- const module = importer.import("./some-file.cjs");
64
- ```
65
-
66
- For both `resolve()` and `import()`, you can pass in package names and filenames.
67
-
68
- ## Developer Setup
69
-
70
- 1. Fork the repository
71
- 2. Clone your fork
72
- 3. Run `npm install` to setup dependencies
73
- 4. Run `npm test` to run tests
74
-
75
- ## License
76
-
77
- Apache 2.0
78
-
79
- [npm]: https://npmjs.com/
80
- [yarn]: https://yarnpkg.com/
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var module$1 = require('module');
6
- var url = require('url');
7
- var path = require('path');
8
-
9
- /**
10
- * @fileoverview Universal module importer
11
- */
12
-
13
- //-----------------------------------------------------------------------------
14
- // Helpers
15
- //-----------------------------------------------------------------------------
16
-
17
- const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('module-importer.cjs', document.baseURI).href)));
18
- const __dirname$1 = path.dirname(__filename$1);
19
- const require$1 = module$1.createRequire(__dirname$1 + "/");
20
- const { ModuleImporter } = require$1("./module-importer.cjs");
21
-
22
- exports.ModuleImporter = ModuleImporter;
@@ -1,27 +0,0 @@
1
- export class ModuleImporter {
2
- /**
3
- * Creates a new instance.
4
- * @param {string} [cwd] The current working directory to resolve from.
5
- */
6
- constructor(cwd?: string);
7
- /**
8
- * The base directory from which paths should be resolved.
9
- * @type {string}
10
- */
11
- cwd: string;
12
- /**
13
- * Resolves a module based on its name or location.
14
- * @param {string} specifier Either an npm package name or
15
- * relative file path.
16
- * @returns {string|undefined} The location of the import.
17
- * @throws {Error} If specifier cannot be located.
18
- */
19
- resolve(specifier: string): string | undefined;
20
- /**
21
- * Imports a module based on its name or location.
22
- * @param {string} specifier Either an npm package name or
23
- * relative file path.
24
- * @returns {Promise<object>} The module's object.
25
- */
26
- import(specifier: string): Promise<object>;
27
- }
@@ -1,2 +0,0 @@
1
- export { ModuleImporter };
2
- import { ModuleImporter } from "./module-importer.cjs";
@@ -1,18 +0,0 @@
1
- import { createRequire } from 'module';
2
- import { fileURLToPath } from 'url';
3
- import { dirname } from 'path';
4
-
5
- /**
6
- * @fileoverview Universal module importer
7
- */
8
-
9
- //-----------------------------------------------------------------------------
10
- // Helpers
11
- //-----------------------------------------------------------------------------
12
-
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = dirname(__filename);
15
- const require = createRequire(__dirname + "/");
16
- const { ModuleImporter } = require("./module-importer.cjs");
17
-
18
- export { ModuleImporter };
@@ -1,65 +0,0 @@
1
- {
2
- "name": "@humanwhocodes/module-importer",
3
- "version": "1.0.1",
4
- "description": "Universal module importer for Node.js",
5
- "main": "src/module-importer.cjs",
6
- "module": "src/module-importer.js",
7
- "type": "module",
8
- "types": "dist/module-importer.d.ts",
9
- "exports": {
10
- "require": "./src/module-importer.cjs",
11
- "import": "./src/module-importer.js"
12
- },
13
- "files": [
14
- "dist",
15
- "src"
16
- ],
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "gitHooks": {
21
- "pre-commit": "lint-staged"
22
- },
23
- "lint-staged": {
24
- "*.js": [
25
- "eslint --fix"
26
- ]
27
- },
28
- "funding": {
29
- "type": "github",
30
- "url": "https://github.com/sponsors/nzakas"
31
- },
32
- "scripts": {
33
- "build": "rollup -c && tsc",
34
- "prepare": "npm run build",
35
- "lint": "eslint src/ tests/",
36
- "test:unit": "c8 mocha tests/module-importer.test.js",
37
- "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
38
- "test": "npm run test:unit && npm run test:build"
39
- },
40
- "repository": {
41
- "type": "git",
42
- "url": "git+https://github.com/humanwhocodes/module-importer.git"
43
- },
44
- "keywords": [
45
- "modules",
46
- "esm",
47
- "commonjs"
48
- ],
49
- "engines": {
50
- "node": ">=12.22"
51
- },
52
- "author": "Nicholas C. Zaks",
53
- "license": "Apache-2.0",
54
- "devDependencies": {
55
- "@types/node": "^18.7.6",
56
- "c8": "7.12.0",
57
- "chai": "4.3.6",
58
- "eslint": "8.22.0",
59
- "lint-staged": "13.0.3",
60
- "mocha": "9.2.2",
61
- "rollup": "2.78.0",
62
- "typescript": "4.7.4",
63
- "yorkie": "2.0.0"
64
- }
65
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * @fileoverview Universal module importer
3
- */
4
-
5
- //-----------------------------------------------------------------------------
6
- // Imports
7
- //-----------------------------------------------------------------------------
8
-
9
- const { createRequire } = require("module");
10
- const { pathToFileURL } = require("url");
11
-
12
- //-----------------------------------------------------------------------------
13
- // Helpers
14
- //-----------------------------------------------------------------------------
15
-
16
- const SLASHES = new Set(["/", "\\"]);
17
-
18
- /**
19
- * Normalizes directories to have a trailing slash.
20
- * Resolve is pretty finicky -- if the directory name doesn't have
21
- * a trailing slash then it tries to look in the parent directory.
22
- * i.e., if the directory is "/usr/nzakas/foo" it will start the
23
- * search in /usr/nzakas. However, if the directory is "/user/nzakas/foo/",
24
- * then it will start the search in /user/nzakas/foo.
25
- * @param {string} directory The directory to check.
26
- * @returns {string} The normalized directory.
27
- */
28
- function normalizeDirectory(directory) {
29
- if (!SLASHES.has(directory[directory.length-1])) {
30
- return directory + "/";
31
- }
32
-
33
- return directory;
34
- }
35
-
36
- //-----------------------------------------------------------------------------
37
- // Exports
38
- //-----------------------------------------------------------------------------
39
-
40
- /**
41
- * Class for importing both CommonJS and ESM modules in Node.js.
42
- */
43
- exports.ModuleImporter = class ModuleImporter {
44
-
45
- /**
46
- * Creates a new instance.
47
- * @param {string} [cwd] The current working directory to resolve from.
48
- */
49
- constructor(cwd = process.cwd()) {
50
-
51
- /**
52
- * The base directory from which paths should be resolved.
53
- * @type {string}
54
- */
55
- this.cwd = normalizeDirectory(cwd);
56
- }
57
-
58
- /**
59
- * Resolves a module based on its name or location.
60
- * @param {string} specifier Either an npm package name or
61
- * relative file path.
62
- * @returns {string|undefined} The location of the import.
63
- * @throws {Error} If specifier cannot be located.
64
- */
65
- resolve(specifier) {
66
- const require = createRequire(this.cwd);
67
- return require.resolve(specifier);
68
- }
69
-
70
- /**
71
- * Imports a module based on its name or location.
72
- * @param {string} specifier Either an npm package name or
73
- * relative file path.
74
- * @returns {Promise<object>} The module's object.
75
- */
76
- import(specifier) {
77
- const location = this.resolve(specifier);
78
- return import(pathToFileURL(location).href);
79
- }
80
-
81
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * @fileoverview Universal module importer
3
- */
4
-
5
- //-----------------------------------------------------------------------------
6
- // Imports
7
- //-----------------------------------------------------------------------------
8
-
9
- import { createRequire } from "module";
10
- import { fileURLToPath } from "url";
11
- import { dirname } from "path";
12
-
13
- //-----------------------------------------------------------------------------
14
- // Helpers
15
- //-----------------------------------------------------------------------------
16
-
17
- const __filename = fileURLToPath(import.meta.url);
18
- const __dirname = dirname(__filename);
19
- const require = createRequire(__dirname + "/");
20
- const { ModuleImporter } = require("./module-importer.cjs");
21
-
22
- export { ModuleImporter };
@@ -1,29 +0,0 @@
1
- module.exports = {
2
- "env": {
3
- "commonjs": true,
4
- "es6": true,
5
- "node": true
6
- },
7
- "extends": "eslint:recommended",
8
- "parserOptions": {
9
- "ecmaVersion": 2018
10
- },
11
- "rules": {
12
- "indent": [
13
- "error",
14
- 4
15
- ],
16
- "linebreak-style": [
17
- "error",
18
- "unix"
19
- ],
20
- "quotes": [
21
- "error",
22
- "double"
23
- ],
24
- "semi": [
25
- "error",
26
- "always"
27
- ]
28
- }
29
- };
@@ -1,27 +0,0 @@
1
- name: Node CI
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- build:
7
-
8
- runs-on: ${{ matrix.os }}
9
-
10
- strategy:
11
- matrix:
12
- os: [windows-latest, macOS-latest, ubuntu-latest]
13
- node: [18.x, 19.x, 20.x]
14
-
15
- steps:
16
- - uses: actions/checkout@v4
17
- - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v3
19
- with:
20
- node-version: ${{ matrix.node-version }}
21
- - name: npm install, build, and test
22
- run: |
23
- npm install
24
- npm run build --if-present
25
- npm test
26
- env:
27
- CI: true