@pnpm/exe 11.0.0-beta.0 → 11.0.0-beta.2

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 (200) hide show
  1. package/dist/node_modules/@gar/promise-retry/lib/index.js +28 -0
  2. package/dist/node_modules/@gar/promise-retry/package.json +48 -0
  3. package/dist/node_modules/@npmcli/agent/package.json +7 -7
  4. package/dist/node_modules/@npmcli/fs/package.json +4 -4
  5. package/dist/node_modules/abbrev/package.json +11 -15
  6. package/dist/node_modules/cacache/package.json +10 -11
  7. package/dist/node_modules/glob/dist/commonjs/glob.js +2 -1
  8. package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
  9. package/dist/node_modules/glob/dist/commonjs/pattern.js +4 -0
  10. package/dist/node_modules/glob/dist/esm/glob.js +2 -1
  11. package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
  12. package/dist/node_modules/glob/dist/esm/pattern.js +4 -0
  13. package/dist/node_modules/glob/package.json +38 -37
  14. package/dist/node_modules/graceful-fs/graceful-fs.js +1 -1
  15. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +460 -525
  16. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +179 -182
  17. package/dist/node_modules/iconv-lite/encodings/index.js +15 -15
  18. package/dist/node_modules/iconv-lite/encodings/internal.js +168 -148
  19. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +55 -52
  20. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +174 -175
  21. package/dist/node_modules/iconv-lite/encodings/utf16.js +121 -131
  22. package/dist/node_modules/iconv-lite/encodings/utf32.js +226 -238
  23. package/dist/node_modules/iconv-lite/encodings/utf7.js +208 -215
  24. package/dist/node_modules/iconv-lite/lib/bom-handling.js +30 -34
  25. package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  26. package/dist/node_modules/iconv-lite/lib/index.js +125 -123
  27. package/dist/node_modules/iconv-lite/lib/streams.js +92 -96
  28. package/dist/node_modules/iconv-lite/package.json +34 -8
  29. package/dist/node_modules/isexe/package.json +65 -18
  30. package/dist/node_modules/lru-cache/dist/commonjs/index.js +134 -85
  31. package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  32. package/dist/node_modules/lru-cache/dist/esm/index.js +134 -85
  33. package/dist/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  34. package/dist/node_modules/lru-cache/package.json +18 -41
  35. package/dist/node_modules/make-fetch-happen/lib/remote.js +1 -1
  36. package/dist/node_modules/make-fetch-happen/package.json +10 -10
  37. package/dist/node_modules/minipass-fetch/lib/body.js +25 -15
  38. package/dist/node_modules/minipass-fetch/package.json +7 -7
  39. package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
  40. package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
  41. package/dist/node_modules/minipass-sized/package.json +39 -9
  42. package/dist/node_modules/node-gyp/.release-please-manifest.json +1 -1
  43. package/dist/node_modules/node-gyp/bin/node-gyp.js +7 -0
  44. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
  45. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +3 -3
  46. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +26 -1
  47. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +1 -1
  48. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +3 -4
  49. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +1 -1
  50. package/dist/node_modules/node-gyp/gyp/pyproject.toml +1 -1
  51. package/dist/node_modules/node-gyp/lib/build.js +2 -2
  52. package/dist/node_modules/node-gyp/lib/find-python.js +2 -8
  53. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +11 -5
  54. package/dist/node_modules/node-gyp/lib/install.js +1 -1
  55. package/dist/node_modules/node-gyp/lib/process-release.js +3 -3
  56. package/dist/node_modules/node-gyp/package.json +13 -13
  57. package/dist/node_modules/nopt/package.json +5 -5
  58. package/dist/node_modules/proc-log/lib/index.js +10 -5
  59. package/dist/node_modules/proc-log/package.json +5 -5
  60. package/dist/node_modules/retry/lib/retry.js +2 -2
  61. package/dist/node_modules/retry/lib/retry_operation.js +10 -6
  62. package/dist/node_modules/retry/package.json +6 -2
  63. package/dist/node_modules/ssri/lib/index.js +33 -63
  64. package/dist/node_modules/ssri/package.json +17 -17
  65. package/dist/node_modules/unique-filename/package.json +5 -5
  66. package/dist/node_modules/unique-slug/package.json +4 -4
  67. package/dist/node_modules/which/package.json +29 -20
  68. package/dist/pnpm.mjs +63969 -54688
  69. package/dist/worker.js +601 -2162
  70. package/package.json +8 -8
  71. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +0 -16
  72. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +0 -170
  73. package/dist/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +0 -307
  74. package/dist/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +0 -7
  75. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.js +0 -322
  76. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +0 -12
  77. package/dist/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +0 -49
  78. package/dist/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +0 -8
  79. package/dist/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +0 -176
  80. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +0 -12
  81. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +0 -167
  82. package/dist/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +0 -299
  83. package/dist/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +0 -3
  84. package/dist/node_modules/@isaacs/cliui/dist/esm/index.js +0 -317
  85. package/dist/node_modules/@isaacs/cliui/dist/esm/index.min.js +0 -12
  86. package/dist/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +0 -46
  87. package/dist/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +0 -4
  88. package/dist/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +0 -172
  89. package/dist/node_modules/@isaacs/cliui/package.json +0 -163
  90. package/dist/node_modules/cross-spawn/LICENSE +0 -21
  91. package/dist/node_modules/cross-spawn/index.js +0 -39
  92. package/dist/node_modules/cross-spawn/lib/enoent.js +0 -59
  93. package/dist/node_modules/cross-spawn/lib/parse.js +0 -91
  94. package/dist/node_modules/cross-spawn/lib/util/escape.js +0 -47
  95. package/dist/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  96. package/dist/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  97. package/dist/node_modules/cross-spawn/package.json +0 -73
  98. package/dist/node_modules/encoding/.prettierrc.js +0 -8
  99. package/dist/node_modules/encoding/LICENSE +0 -16
  100. package/dist/node_modules/encoding/lib/encoding.js +0 -83
  101. package/dist/node_modules/encoding/package.json +0 -18
  102. package/dist/node_modules/err-code/.eslintrc.json +0 -7
  103. package/dist/node_modules/err-code/bower.json +0 -30
  104. package/dist/node_modules/err-code/index.js +0 -47
  105. package/dist/node_modules/err-code/index.umd.js +0 -51
  106. package/dist/node_modules/err-code/package.json +0 -34
  107. package/dist/node_modules/foreground-child/LICENSE +0 -15
  108. package/dist/node_modules/foreground-child/dist/commonjs/all-signals.js +0 -58
  109. package/dist/node_modules/foreground-child/dist/commonjs/index.js +0 -123
  110. package/dist/node_modules/foreground-child/dist/commonjs/proxy-signals.js +0 -38
  111. package/dist/node_modules/foreground-child/dist/commonjs/watchdog.js +0 -50
  112. package/dist/node_modules/foreground-child/dist/esm/all-signals.js +0 -52
  113. package/dist/node_modules/foreground-child/dist/esm/index.js +0 -115
  114. package/dist/node_modules/foreground-child/dist/esm/proxy-signals.js +0 -34
  115. package/dist/node_modules/foreground-child/dist/esm/watchdog.js +0 -46
  116. package/dist/node_modules/foreground-child/package.json +0 -106
  117. package/dist/node_modules/glob/dist/esm/bin.d.mts +0 -3
  118. package/dist/node_modules/glob/dist/esm/bin.mjs +0 -346
  119. package/dist/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  120. package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  121. package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  122. package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  123. package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  124. package/dist/node_modules/iconv-lite/.idea/modules.xml +0 -8
  125. package/dist/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  126. package/dist/node_modules/isexe/LICENSE +0 -15
  127. package/dist/node_modules/isexe/index.js +0 -57
  128. package/dist/node_modules/isexe/mode.js +0 -41
  129. package/dist/node_modules/isexe/windows.js +0 -42
  130. package/dist/node_modules/jackspeak/dist/commonjs/index.js +0 -944
  131. package/dist/node_modules/jackspeak/dist/commonjs/index.min.js +0 -33
  132. package/dist/node_modules/jackspeak/dist/commonjs/package.json +0 -3
  133. package/dist/node_modules/jackspeak/dist/esm/index.js +0 -936
  134. package/dist/node_modules/jackspeak/dist/esm/index.min.js +0 -33
  135. package/dist/node_modules/jackspeak/dist/esm/package.json +0 -3
  136. package/dist/node_modules/jackspeak/package.json +0 -115
  137. package/dist/node_modules/lru-cache/LICENSE +0 -15
  138. package/dist/node_modules/minipass-sized/index.js +0 -67
  139. package/dist/node_modules/minipass-sized/node_modules/minipass/LICENSE +0 -15
  140. package/dist/node_modules/minipass-sized/node_modules/minipass/index.js +0 -649
  141. package/dist/node_modules/minipass-sized/node_modules/minipass/package.json +0 -56
  142. package/dist/node_modules/minipass-sized/package-lock.json +0 -3464
  143. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/package.json +0 -3
  144. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/package.json +0 -3
  145. package/dist/node_modules/node-gyp/node_modules/isexe/package.json +0 -78
  146. package/dist/node_modules/node-gyp/node_modules/which/LICENSE +0 -15
  147. package/dist/node_modules/node-gyp/node_modules/which/package.json +0 -52
  148. package/dist/node_modules/package-json-from-dist/dist/commonjs/index.js +0 -134
  149. package/dist/node_modules/package-json-from-dist/dist/commonjs/package.json +0 -3
  150. package/dist/node_modules/package-json-from-dist/dist/esm/index.js +0 -129
  151. package/dist/node_modules/package-json-from-dist/dist/esm/package.json +0 -3
  152. package/dist/node_modules/package-json-from-dist/package.json +0 -68
  153. package/dist/node_modules/path-key/index.js +0 -16
  154. package/dist/node_modules/path-key/license +0 -9
  155. package/dist/node_modules/path-key/package.json +0 -39
  156. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +0 -1589
  157. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
  158. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  159. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +0 -1585
  160. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +0 -2
  161. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +0 -3
  162. package/dist/node_modules/path-scurry/node_modules/lru-cache/package.json +0 -101
  163. package/dist/node_modules/promise-retry/index.js +0 -52
  164. package/dist/node_modules/promise-retry/package.json +0 -37
  165. package/dist/node_modules/retry/equation.gif +0 -0
  166. package/dist/node_modules/shebang-command/index.js +0 -19
  167. package/dist/node_modules/shebang-command/license +0 -9
  168. package/dist/node_modules/shebang-command/package.json +0 -34
  169. package/dist/node_modules/shebang-regex/index.js +0 -2
  170. package/dist/node_modules/shebang-regex/license +0 -9
  171. package/dist/node_modules/shebang-regex/package.json +0 -35
  172. package/dist/node_modules/signal-exit/LICENSE.txt +0 -16
  173. package/dist/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  174. package/dist/node_modules/signal-exit/dist/cjs/index.js +0 -279
  175. package/dist/node_modules/signal-exit/dist/cjs/package.json +0 -3
  176. package/dist/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  177. package/dist/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  178. package/dist/node_modules/signal-exit/dist/mjs/index.js +0 -275
  179. package/dist/node_modules/signal-exit/dist/mjs/package.json +0 -3
  180. package/dist/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  181. package/dist/node_modules/signal-exit/package.json +0 -106
  182. package/dist/node_modules/which/bin/node-which +0 -52
  183. package/dist/node_modules/which/which.js +0 -125
  184. /package/dist/node_modules/{promise-retry → @gar/promise-retry}/LICENSE +0 -0
  185. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.js +0 -0
  186. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.min.js +0 -0
  187. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/options.js +0 -0
  188. /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/commonjs/package.json +0 -0
  189. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/posix.js +0 -0
  190. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/win32.js +0 -0
  191. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.js +0 -0
  192. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.min.js +0 -0
  193. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/options.js +0 -0
  194. /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/esm/package.json +0 -0
  195. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/posix.js +0 -0
  196. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/win32.js +0 -0
  197. /package/dist/node_modules/{foreground-child → minipass-sized}/dist/commonjs/package.json +0 -0
  198. /package/dist/node_modules/{foreground-child → minipass-sized}/dist/esm/package.json +0 -0
  199. /package/dist/node_modules/{node-gyp/node_modules/which → which}/bin/which.js +0 -0
  200. /package/dist/node_modules/{node-gyp/node_modules/which → which}/lib/index.js +0 -0
@@ -1,134 +1,136 @@
1
- "use strict";
1
+ "use strict"
2
2
 
3
- var Buffer = require("safer-buffer").Buffer;
3
+ var Buffer = require("safer-buffer").Buffer
4
4
 
5
- var bomHandling = require("./bom-handling"),
6
- iconv = module.exports;
5
+ var bomHandling = require("./bom-handling")
6
+ var mergeModules = require("./helpers/merge-exports")
7
7
 
8
8
  // All codecs and aliases are kept here, keyed by encoding name/alias.
9
9
  // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
10
- iconv.encodings = null;
10
+ // Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true
11
+ module.exports.encodings = null
11
12
 
12
13
  // Characters emitted in case of error.
13
- iconv.defaultCharUnicode = '';
14
- iconv.defaultCharSingleByte = '?';
14
+ module.exports.defaultCharUnicode = ""
15
+ module.exports.defaultCharSingleByte = "?"
15
16
 
16
17
  // Public API.
17
- iconv.encode = function encode(str, encoding, options) {
18
- str = "" + (str || ""); // Ensure string.
18
+ module.exports.encode = function encode (str, encoding, options) {
19
+ str = "" + (str || "") // Ensure string.
19
20
 
20
- var encoder = iconv.getEncoder(encoding, options);
21
+ var encoder = module.exports.getEncoder(encoding, options)
21
22
 
22
- var res = encoder.write(str);
23
- var trail = encoder.end();
24
-
25
- return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
26
- }
23
+ var res = encoder.write(str)
24
+ var trail = encoder.end()
27
25
 
28
- iconv.decode = function decode(buf, encoding, options) {
29
- if (typeof buf === 'string') {
30
- if (!iconv.skipDecodeWarning) {
31
- console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
32
- iconv.skipDecodeWarning = true;
33
- }
26
+ return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res
27
+ }
34
28
 
35
- buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
29
+ module.exports.decode = function decode (buf, encoding, options) {
30
+ if (typeof buf === "string") {
31
+ if (!module.exports.skipDecodeWarning) {
32
+ console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding")
33
+ module.exports.skipDecodeWarning = true
36
34
  }
37
35
 
38
- var decoder = iconv.getDecoder(encoding, options);
36
+ buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer.
37
+ }
38
+
39
+ var decoder = module.exports.getDecoder(encoding, options)
39
40
 
40
- var res = decoder.write(buf);
41
- var trail = decoder.end();
41
+ var res = decoder.write(buf)
42
+ var trail = decoder.end()
42
43
 
43
- return trail ? (res + trail) : res;
44
+ return trail ? (res + trail) : res
44
45
  }
45
46
 
46
- iconv.encodingExists = function encodingExists(enc) {
47
- try {
48
- iconv.getCodec(enc);
49
- return true;
50
- } catch (e) {
51
- return false;
52
- }
47
+ module.exports.encodingExists = function encodingExists (enc) {
48
+ try {
49
+ module.exports.getCodec(enc)
50
+ return true
51
+ } catch (e) {
52
+ return false
53
+ }
53
54
  }
54
55
 
55
56
  // Legacy aliases to convert functions
56
- iconv.toEncoding = iconv.encode;
57
- iconv.fromEncoding = iconv.decode;
57
+ module.exports.toEncoding = module.exports.encode
58
+ module.exports.fromEncoding = module.exports.decode
58
59
 
59
60
  // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
60
- iconv._codecDataCache = {};
61
- iconv.getCodec = function getCodec(encoding) {
62
- if (!iconv.encodings)
63
- iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
64
-
65
- // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
66
- var enc = iconv._canonicalizeEncoding(encoding);
67
-
68
- // Traverse iconv.encodings to find actual codec.
69
- var codecOptions = {};
70
- while (true) {
71
- var codec = iconv._codecDataCache[enc];
72
- if (codec)
73
- return codec;
74
-
75
- var codecDef = iconv.encodings[enc];
76
-
77
- switch (typeof codecDef) {
78
- case "string": // Direct alias to other encoding.
79
- enc = codecDef;
80
- break;
81
-
82
- case "object": // Alias with options. Can be layered.
83
- for (var key in codecDef)
84
- codecOptions[key] = codecDef[key];
85
-
86
- if (!codecOptions.encodingName)
87
- codecOptions.encodingName = enc;
88
-
89
- enc = codecDef.type;
90
- break;
91
-
92
- case "function": // Codec itself.
93
- if (!codecOptions.encodingName)
94
- codecOptions.encodingName = enc;
95
-
96
- // The codec function must load all tables and return object with .encoder and .decoder methods.
97
- // It'll be called only once (for each different options object).
98
- codec = new codecDef(codecOptions, iconv);
99
-
100
- iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
101
- return codec;
102
-
103
- default:
104
- throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
105
- }
61
+ module.exports._codecDataCache = { __proto__: null }
62
+
63
+ module.exports.getCodec = function getCodec (encoding) {
64
+ if (!module.exports.encodings) {
65
+ var raw = require("../encodings")
66
+ // TODO: In future versions when old nodejs support is removed can use object.assign
67
+ module.exports.encodings = { __proto__: null } // Initialize as empty object.
68
+ mergeModules(module.exports.encodings, raw)
69
+ }
70
+
71
+ // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
72
+ var enc = module.exports._canonicalizeEncoding(encoding)
73
+
74
+ // Traverse iconv.encodings to find actual codec.
75
+ var codecOptions = {}
76
+ while (true) {
77
+ var codec = module.exports._codecDataCache[enc]
78
+
79
+ if (codec) { return codec }
80
+
81
+ var codecDef = module.exports.encodings[enc]
82
+
83
+ switch (typeof codecDef) {
84
+ case "string": // Direct alias to other encoding.
85
+ enc = codecDef
86
+ break
87
+
88
+ case "object": // Alias with options. Can be layered.
89
+ for (var key in codecDef) { codecOptions[key] = codecDef[key] }
90
+
91
+ if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
92
+
93
+ enc = codecDef.type
94
+ break
95
+
96
+ case "function": // Codec itself.
97
+ if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
98
+
99
+ // The codec function must load all tables and return object with .encoder and .decoder methods.
100
+ // It'll be called only once (for each different options object).
101
+ //
102
+ codec = new codecDef(codecOptions, module.exports)
103
+
104
+ module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later.
105
+ return codec
106
+
107
+ default:
108
+ throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')")
106
109
  }
110
+ }
107
111
  }
108
112
 
109
- iconv._canonicalizeEncoding = function(encoding) {
110
- // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
111
- return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
113
+ module.exports._canonicalizeEncoding = function (encoding) {
114
+ // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
115
+ return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "")
112
116
  }
113
117
 
114
- iconv.getEncoder = function getEncoder(encoding, options) {
115
- var codec = iconv.getCodec(encoding),
116
- encoder = new codec.encoder(options, codec);
118
+ module.exports.getEncoder = function getEncoder (encoding, options) {
119
+ var codec = module.exports.getCodec(encoding)
120
+ var encoder = new codec.encoder(options, codec)
117
121
 
118
- if (codec.bomAware && options && options.addBOM)
119
- encoder = new bomHandling.PrependBOM(encoder, options);
122
+ if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) }
120
123
 
121
- return encoder;
124
+ return encoder
122
125
  }
123
126
 
124
- iconv.getDecoder = function getDecoder(encoding, options) {
125
- var codec = iconv.getCodec(encoding),
126
- decoder = new codec.decoder(options, codec);
127
+ module.exports.getDecoder = function getDecoder (encoding, options) {
128
+ var codec = module.exports.getCodec(encoding)
129
+ var decoder = new codec.decoder(options, codec)
127
130
 
128
- if (codec.bomAware && !(options && options.stripBOM === false))
129
- decoder = new bomHandling.StripBOM(decoder, options);
131
+ if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) }
130
132
 
131
- return decoder;
133
+ return decoder
132
134
  }
133
135
 
134
136
  // Streaming API
@@ -136,45 +138,45 @@ iconv.getDecoder = function getDecoder(encoding, options) {
136
138
  // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
137
139
  // If you would like to enable it explicitly, please add the following code to your app:
138
140
  // > iconv.enableStreamingAPI(require('stream'));
139
- iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) {
140
- if (iconv.supportsStreams)
141
- return;
141
+ module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) {
142
+ if (module.exports.supportsStreams) { return }
142
143
 
143
- // Dependency-inject stream module to create IconvLite stream classes.
144
- var streams = require("./streams")(stream_module);
144
+ // Dependency-inject stream module to create IconvLite stream classes.
145
+ var streams = require("./streams")(streamModule)
145
146
 
146
- // Not public API yet, but expose the stream classes.
147
- iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
148
- iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
147
+ // Not public API yet, but expose the stream classes.
148
+ module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream
149
+ module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream
149
150
 
150
- // Streaming API.
151
- iconv.encodeStream = function encodeStream(encoding, options) {
152
- return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
153
- }
151
+ // Streaming API.
152
+ module.exports.encodeStream = function encodeStream (encoding, options) {
153
+ return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options)
154
+ }
154
155
 
155
- iconv.decodeStream = function decodeStream(encoding, options) {
156
- return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
157
- }
156
+ module.exports.decodeStream = function decodeStream (encoding, options) {
157
+ return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options)
158
+ }
158
159
 
159
- iconv.supportsStreams = true;
160
+ module.exports.supportsStreams = true
160
161
  }
161
162
 
162
163
  // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
163
- var stream_module;
164
+ var streamModule
164
165
  try {
165
- stream_module = require("stream");
166
+ streamModule = require("stream")
166
167
  } catch (e) {}
167
168
 
168
- if (stream_module && stream_module.Transform) {
169
- iconv.enableStreamingAPI(stream_module);
170
-
169
+ if (streamModule && streamModule.Transform) {
170
+ module.exports.enableStreamingAPI(streamModule)
171
171
  } else {
172
- // In rare cases where 'stream' module is not available by default, throw a helpful exception.
173
- iconv.encodeStream = iconv.decodeStream = function() {
174
- throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
175
- };
172
+ // In rare cases where 'stream' module is not available by default, throw a helpful exception.
173
+ module.exports.encodeStream = module.exports.decodeStream = function () {
174
+ throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")
175
+ }
176
176
  }
177
177
 
178
- if ("Ā" != "\u0100") {
179
- console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
178
+ // Some environments, such as browsers, may not load JavaScript files as UTF-8
179
+ // eslint-disable-next-line no-constant-condition
180
+ if ("Ā" !== "\u0100") {
181
+ console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.")
180
182
  }
@@ -1,109 +1,105 @@
1
- "use strict";
1
+ "use strict"
2
2
 
3
- var Buffer = require("safer-buffer").Buffer;
3
+ var Buffer = require("safer-buffer").Buffer
4
4
 
5
- // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
5
+ // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
6
6
  // we opt to dependency-inject it instead of creating a hard dependency.
7
- module.exports = function(stream_module) {
8
- var Transform = stream_module.Transform;
7
+ module.exports = function (streamModule) {
8
+ var Transform = streamModule.Transform
9
9
 
10
- // == Encoder stream =======================================================
10
+ // == Encoder stream =======================================================
11
11
 
12
- function IconvLiteEncoderStream(conv, options) {
13
- this.conv = conv;
14
- options = options || {};
15
- options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
16
- Transform.call(this, options);
17
- }
12
+ function IconvLiteEncoderStream (conv, options) {
13
+ this.conv = conv
14
+ options = options || {}
15
+ options.decodeStrings = false // We accept only strings, so we don't need to decode them.
16
+ Transform.call(this, options)
17
+ }
18
18
 
19
- IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
20
- constructor: { value: IconvLiteEncoderStream }
21
- });
22
-
23
- IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
24
- if (typeof chunk != 'string')
25
- return done(new Error("Iconv encoding stream needs strings as its input."));
26
- try {
27
- var res = this.conv.write(chunk);
28
- if (res && res.length) this.push(res);
29
- done();
30
- }
31
- catch (e) {
32
- done(e);
33
- }
34
- }
19
+ IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
20
+ constructor: { value: IconvLiteEncoderStream }
21
+ })
35
22
 
36
- IconvLiteEncoderStream.prototype._flush = function(done) {
37
- try {
38
- var res = this.conv.end();
39
- if (res && res.length) this.push(res);
40
- done();
41
- }
42
- catch (e) {
43
- done(e);
44
- }
23
+ IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) {
24
+ if (typeof chunk !== "string") {
25
+ return done(new Error("Iconv encoding stream needs strings as its input."))
45
26
  }
46
27
 
47
- IconvLiteEncoderStream.prototype.collect = function(cb) {
48
- var chunks = [];
49
- this.on('error', cb);
50
- this.on('data', function(chunk) { chunks.push(chunk); });
51
- this.on('end', function() {
52
- cb(null, Buffer.concat(chunks));
53
- });
54
- return this;
55
- }
56
-
57
-
58
- // == Decoder stream =======================================================
59
-
60
- function IconvLiteDecoderStream(conv, options) {
61
- this.conv = conv;
62
- options = options || {};
63
- options.encoding = this.encoding = 'utf8'; // We output strings.
64
- Transform.call(this, options);
28
+ try {
29
+ var res = this.conv.write(chunk)
30
+ if (res && res.length) this.push(res)
31
+ done()
32
+ } catch (e) {
33
+ done(e)
65
34
  }
66
-
67
- IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
68
- constructor: { value: IconvLiteDecoderStream }
69
- });
70
-
71
- IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
72
- if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array))
73
- return done(new Error("Iconv decoding stream needs buffers as its input."));
74
- try {
75
- var res = this.conv.write(chunk);
76
- if (res && res.length) this.push(res, this.encoding);
77
- done();
78
- }
79
- catch (e) {
80
- done(e);
81
- }
35
+ }
36
+
37
+ IconvLiteEncoderStream.prototype._flush = function (done) {
38
+ try {
39
+ var res = this.conv.end()
40
+ if (res && res.length) this.push(res)
41
+ done()
42
+ } catch (e) {
43
+ done(e)
82
44
  }
83
-
84
- IconvLiteDecoderStream.prototype._flush = function(done) {
85
- try {
86
- var res = this.conv.end();
87
- if (res && res.length) this.push(res, this.encoding);
88
- done();
89
- }
90
- catch (e) {
91
- done(e);
92
- }
45
+ }
46
+
47
+ IconvLiteEncoderStream.prototype.collect = function (cb) {
48
+ var chunks = []
49
+ this.on("error", cb)
50
+ this.on("data", function (chunk) { chunks.push(chunk) })
51
+ this.on("end", function () {
52
+ cb(null, Buffer.concat(chunks))
53
+ })
54
+ return this
55
+ }
56
+
57
+ // == Decoder stream =======================================================
58
+
59
+ function IconvLiteDecoderStream (conv, options) {
60
+ this.conv = conv
61
+ options = options || {}
62
+ options.encoding = this.encoding = "utf8" // We output strings.
63
+ Transform.call(this, options)
64
+ }
65
+
66
+ IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
67
+ constructor: { value: IconvLiteDecoderStream }
68
+ })
69
+
70
+ IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) {
71
+ if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) }
72
+ try {
73
+ var res = this.conv.write(chunk)
74
+ if (res && res.length) this.push(res, this.encoding)
75
+ done()
76
+ } catch (e) {
77
+ done(e)
93
78
  }
94
-
95
- IconvLiteDecoderStream.prototype.collect = function(cb) {
96
- var res = '';
97
- this.on('error', cb);
98
- this.on('data', function(chunk) { res += chunk; });
99
- this.on('end', function() {
100
- cb(null, res);
101
- });
102
- return this;
79
+ }
80
+
81
+ IconvLiteDecoderStream.prototype._flush = function (done) {
82
+ try {
83
+ var res = this.conv.end()
84
+ if (res && res.length) this.push(res, this.encoding)
85
+ done()
86
+ } catch (e) {
87
+ done(e)
103
88
  }
104
-
105
- return {
106
- IconvLiteEncoderStream: IconvLiteEncoderStream,
107
- IconvLiteDecoderStream: IconvLiteDecoderStream,
108
- };
109
- };
89
+ }
90
+
91
+ IconvLiteDecoderStream.prototype.collect = function (cb) {
92
+ var res = ""
93
+ this.on("error", cb)
94
+ this.on("data", function (chunk) { res += chunk })
95
+ this.on("end", function () {
96
+ cb(null, res)
97
+ })
98
+ return this
99
+ }
100
+
101
+ return {
102
+ IconvLiteEncoderStream: IconvLiteEncoderStream,
103
+ IconvLiteDecoderStream: IconvLiteDecoderStream
104
+ }
105
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "iconv-lite",
3
3
  "description": "Convert character encodings in pure javascript.",
4
- "version": "0.6.3",
4
+ "version": "0.7.2",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "iconv",
@@ -12,30 +12,56 @@
12
12
  "author": "Alexander Shtuchkin <ashtuchkin@gmail.com>",
13
13
  "main": "./lib/index.js",
14
14
  "typings": "./lib/index.d.ts",
15
- "homepage": "https://github.com/ashtuchkin/iconv-lite",
16
- "bugs": "https://github.com/ashtuchkin/iconv-lite/issues",
15
+ "homepage": "https://github.com/pillarjs/iconv-lite",
16
+ "bugs": "https://github.com/pillarjs/iconv-lite/issues",
17
+ "files": [
18
+ "lib/",
19
+ "encodings/",
20
+ "types/"
21
+ ],
22
+ "funding": {
23
+ "type": "opencollective",
24
+ "url": "https://opencollective.com/express"
25
+ },
17
26
  "repository": {
18
27
  "type": "git",
19
- "url": "git://github.com/ashtuchkin/iconv-lite.git"
28
+ "url": "https://github.com/pillarjs/iconv-lite.git"
20
29
  },
21
30
  "engines": {
22
31
  "node": ">=0.10.0"
23
32
  },
24
33
  "scripts": {
25
- "coverage": "c8 _mocha --grep .",
26
- "test": "mocha --reporter spec --grep ."
34
+ "lint": "eslint",
35
+ "lint:fix": "eslint --fix",
36
+ "test": "mocha --reporter spec --check-leaks --grep .",
37
+ "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test",
38
+ "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test",
39
+ "test:performance": "node --allow-natives-syntax performance/index.js",
40
+ "test:tap": "mocha --reporter tap --check-leaks --grep .",
41
+ "test:typescript": "tsc && attw --pack",
42
+ "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz",
43
+ "typegen": "node generation/gen-typings.js"
27
44
  },
28
45
  "browser": {
29
46
  "stream": false
30
47
  },
31
48
  "devDependencies": {
49
+ "@arethetypeswrong/cli": "^0.17.4",
50
+ "@stylistic/eslint-plugin": "^5.1.0",
51
+ "@stylistic/eslint-plugin-js": "^4.1.0",
52
+ "@types/node": "^24.0.12",
32
53
  "async": "^3.2.0",
33
- "c8": "^7.2.0",
54
+ "bench-node": "^0.10.0",
55
+ "eslint": "^9.0.0",
34
56
  "errto": "^0.2.1",
57
+ "expect-type": "^1.2.0",
35
58
  "iconv": "^2.3.5",
36
- "mocha": "^3.5.3",
59
+ "mocha": "^6.2.2",
60
+ "neostandard": "^0.12.0",
61
+ "nyc": "^14.1.1",
37
62
  "request": "^2.88.2",
38
63
  "semver": "^6.3.0",
64
+ "typescript": "~5.9.2",
39
65
  "unorm": "^1.6.0"
40
66
  },
41
67
  "dependencies": {