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

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 +63952 -54674
  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,122 +1,122 @@
1
- "use strict";
2
- var Buffer = require("safer-buffer").Buffer;
1
+ "use strict"
2
+ var Buffer = require("safer-buffer").Buffer
3
3
 
4
4
  // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
5
5
  // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
6
6
 
7
- exports.utf7 = Utf7Codec;
8
- exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
9
- function Utf7Codec(codecOptions, iconv) {
10
- this.iconv = iconv;
7
+ exports.utf7 = Utf7Codec
8
+ exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7
9
+ function Utf7Codec (codecOptions, iconv) {
10
+ this.iconv = iconv
11
11
  };
12
12
 
13
- Utf7Codec.prototype.encoder = Utf7Encoder;
14
- Utf7Codec.prototype.decoder = Utf7Decoder;
15
- Utf7Codec.prototype.bomAware = true;
16
-
13
+ Utf7Codec.prototype.encoder = Utf7Encoder
14
+ Utf7Codec.prototype.decoder = Utf7Decoder
15
+ Utf7Codec.prototype.bomAware = true
17
16
 
18
17
  // -- Encoding
19
18
 
20
- var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
19
+ // Why scape ()?./?
20
+ // eslint-disable-next-line no-useless-escape
21
+ var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g
21
22
 
22
- function Utf7Encoder(options, codec) {
23
- this.iconv = codec.iconv;
23
+ function Utf7Encoder (options, codec) {
24
+ this.iconv = codec.iconv
24
25
  }
25
26
 
26
- Utf7Encoder.prototype.write = function(str) {
27
- // Naive implementation.
28
- // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
29
- return Buffer.from(str.replace(nonDirectChars, function(chunk) {
30
- return "+" + (chunk === '+' ? '' :
31
- this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
32
- + "-";
33
- }.bind(this)));
27
+ Utf7Encoder.prototype.write = function (str) {
28
+ // Naive implementation.
29
+ // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
30
+ return Buffer.from(str.replace(nonDirectChars, function (chunk) {
31
+ return "+" + (chunk === "+"
32
+ ? ""
33
+ : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) +
34
+ "-"
35
+ }.bind(this)))
34
36
  }
35
37
 
36
- Utf7Encoder.prototype.end = function() {
38
+ Utf7Encoder.prototype.end = function () {
37
39
  }
38
40
 
39
-
40
41
  // -- Decoding
41
42
 
42
- function Utf7Decoder(options, codec) {
43
- this.iconv = codec.iconv;
44
- this.inBase64 = false;
45
- this.base64Accum = '';
43
+ function Utf7Decoder (options, codec) {
44
+ this.iconv = codec.iconv
45
+ this.inBase64 = false
46
+ this.base64Accum = ""
46
47
  }
47
48
 
48
- var base64Regex = /[A-Za-z0-9\/+]/;
49
- var base64Chars = [];
50
- for (var i = 0; i < 256; i++)
51
- base64Chars[i] = base64Regex.test(String.fromCharCode(i));
52
-
53
- var plusChar = '+'.charCodeAt(0),
54
- minusChar = '-'.charCodeAt(0),
55
- andChar = '&'.charCodeAt(0);
56
-
57
- Utf7Decoder.prototype.write = function(buf) {
58
- var res = "", lastI = 0,
59
- inBase64 = this.inBase64,
60
- base64Accum = this.base64Accum;
61
-
62
- // The decoder is more involved as we must handle chunks in stream.
63
-
64
- for (var i = 0; i < buf.length; i++) {
65
- if (!inBase64) { // We're in direct mode.
66
- // Write direct chars until '+'
67
- if (buf[i] == plusChar) {
68
- res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
69
- lastI = i+1;
70
- inBase64 = true;
71
- }
72
- } else { // We decode base64.
73
- if (!base64Chars[buf[i]]) { // Base64 ended.
74
- if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
75
- res += "+";
76
- } else {
77
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii");
78
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
79
- }
80
-
81
- if (buf[i] != minusChar) // Minus is absorbed after base64.
82
- i--;
83
-
84
- lastI = i+1;
85
- inBase64 = false;
86
- base64Accum = '';
87
- }
49
+ // Why scape /?
50
+ // eslint-disable-next-line no-useless-escape
51
+ var base64Regex = /[A-Za-z0-9\/+]/
52
+ var base64Chars = []
53
+ for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) }
54
+
55
+ var plusChar = "+".charCodeAt(0)
56
+ var minusChar = "-".charCodeAt(0)
57
+ var andChar = "&".charCodeAt(0)
58
+
59
+ Utf7Decoder.prototype.write = function (buf) {
60
+ var res = ""; var lastI = 0
61
+ var inBase64 = this.inBase64
62
+ var base64Accum = this.base64Accum
63
+
64
+ // The decoder is more involved as we must handle chunks in stream.
65
+
66
+ for (var i = 0; i < buf.length; i++) {
67
+ if (!inBase64) { // We're in direct mode.
68
+ // Write direct chars until '+'
69
+ if (buf[i] == plusChar) {
70
+ res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars.
71
+ lastI = i + 1
72
+ inBase64 = true
73
+ }
74
+ } else { // We decode base64.
75
+ if (!base64Chars[buf[i]]) { // Base64 ended.
76
+ if (i == lastI && buf[i] == minusChar) { // "+-" -> "+"
77
+ res += "+"
78
+ } else {
79
+ var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii")
80
+ res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
88
81
  }
82
+
83
+ if (buf[i] != minusChar) // Minus is absorbed after base64.
84
+ { i-- }
85
+
86
+ lastI = i + 1
87
+ inBase64 = false
88
+ base64Accum = ""
89
+ }
89
90
  }
91
+ }
90
92
 
91
- if (!inBase64) {
92
- res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
93
- } else {
94
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii");
93
+ if (!inBase64) {
94
+ res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars.
95
+ } else {
96
+ var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii")
95
97
 
96
- var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
97
- base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
98
- b64str = b64str.slice(0, canBeDecoded);
98
+ var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
99
+ base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future.
100
+ b64str = b64str.slice(0, canBeDecoded)
99
101
 
100
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
101
- }
102
+ res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
103
+ }
102
104
 
103
- this.inBase64 = inBase64;
104
- this.base64Accum = base64Accum;
105
+ this.inBase64 = inBase64
106
+ this.base64Accum = base64Accum
105
107
 
106
- return res;
108
+ return res
107
109
  }
108
110
 
109
- Utf7Decoder.prototype.end = function() {
110
- var res = "";
111
- if (this.inBase64 && this.base64Accum.length > 0)
112
- res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
111
+ Utf7Decoder.prototype.end = function () {
112
+ var res = ""
113
+ if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") }
113
114
 
114
- this.inBase64 = false;
115
- this.base64Accum = '';
116
- return res;
115
+ this.inBase64 = false
116
+ this.base64Accum = ""
117
+ return res
117
118
  }
118
119
 
119
-
120
120
  // UTF-7-IMAP codec.
121
121
  // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
122
122
  // Differences:
@@ -128,163 +128,156 @@ Utf7Decoder.prototype.end = function() {
128
128
  // * String must end in non-shifted position.
129
129
  // * "-&" while in base64 is not allowed.
130
130
 
131
-
132
- exports.utf7imap = Utf7IMAPCodec;
133
- function Utf7IMAPCodec(codecOptions, iconv) {
134
- this.iconv = iconv;
131
+ exports.utf7imap = Utf7IMAPCodec
132
+ function Utf7IMAPCodec (codecOptions, iconv) {
133
+ this.iconv = iconv
135
134
  };
136
135
 
137
- Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
138
- Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
139
- Utf7IMAPCodec.prototype.bomAware = true;
140
-
136
+ Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder
137
+ Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder
138
+ Utf7IMAPCodec.prototype.bomAware = true
141
139
 
142
140
  // -- Encoding
143
141
 
144
- function Utf7IMAPEncoder(options, codec) {
145
- this.iconv = codec.iconv;
146
- this.inBase64 = false;
147
- this.base64Accum = Buffer.alloc(6);
148
- this.base64AccumIdx = 0;
142
+ function Utf7IMAPEncoder (options, codec) {
143
+ this.iconv = codec.iconv
144
+ this.inBase64 = false
145
+ this.base64Accum = Buffer.alloc(6)
146
+ this.base64AccumIdx = 0
149
147
  }
150
148
 
151
- Utf7IMAPEncoder.prototype.write = function(str) {
152
- var inBase64 = this.inBase64,
153
- base64Accum = this.base64Accum,
154
- base64AccumIdx = this.base64AccumIdx,
155
- buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
156
-
157
- for (var i = 0; i < str.length; i++) {
158
- var uChar = str.charCodeAt(i);
159
- if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
160
- if (inBase64) {
161
- if (base64AccumIdx > 0) {
162
- bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
163
- base64AccumIdx = 0;
164
- }
165
-
166
- buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
167
- inBase64 = false;
168
- }
169
-
170
- if (!inBase64) {
171
- buf[bufIdx++] = uChar; // Write direct character
172
-
173
- if (uChar === andChar) // Ampersand -> '&-'
174
- buf[bufIdx++] = minusChar;
175
- }
176
-
177
- } else { // Non-direct character
178
- if (!inBase64) {
179
- buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
180
- inBase64 = true;
181
- }
182
- if (inBase64) {
183
- base64Accum[base64AccumIdx++] = uChar >> 8;
184
- base64Accum[base64AccumIdx++] = uChar & 0xFF;
185
-
186
- if (base64AccumIdx == base64Accum.length) {
187
- bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
188
- base64AccumIdx = 0;
189
- }
190
- }
149
+ Utf7IMAPEncoder.prototype.write = function (str) {
150
+ var inBase64 = this.inBase64
151
+ var base64Accum = this.base64Accum
152
+ var base64AccumIdx = this.base64AccumIdx
153
+ var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0
154
+
155
+ for (var i = 0; i < str.length; i++) {
156
+ var uChar = str.charCodeAt(i)
157
+ if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'.
158
+ if (inBase64) {
159
+ if (base64AccumIdx > 0) {
160
+ bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx)
161
+ base64AccumIdx = 0
162
+ }
163
+
164
+ buf[bufIdx++] = minusChar // Write '-', then go to direct mode.
165
+ inBase64 = false
166
+ }
167
+
168
+ if (!inBase64) {
169
+ buf[bufIdx++] = uChar // Write direct character
170
+
171
+ if (uChar === andChar) // Ampersand -> '&-'
172
+ { buf[bufIdx++] = minusChar }
173
+ }
174
+ } else { // Non-direct character
175
+ if (!inBase64) {
176
+ buf[bufIdx++] = andChar // Write '&', then go to base64 mode.
177
+ inBase64 = true
178
+ }
179
+ if (inBase64) {
180
+ base64Accum[base64AccumIdx++] = uChar >> 8
181
+ base64Accum[base64AccumIdx++] = uChar & 0xFF
182
+
183
+ if (base64AccumIdx == base64Accum.length) {
184
+ bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx)
185
+ base64AccumIdx = 0
191
186
  }
187
+ }
192
188
  }
189
+ }
193
190
 
194
- this.inBase64 = inBase64;
195
- this.base64AccumIdx = base64AccumIdx;
191
+ this.inBase64 = inBase64
192
+ this.base64AccumIdx = base64AccumIdx
196
193
 
197
- return buf.slice(0, bufIdx);
194
+ return buf.slice(0, bufIdx)
198
195
  }
199
196
 
200
- Utf7IMAPEncoder.prototype.end = function() {
201
- var buf = Buffer.alloc(10), bufIdx = 0;
202
- if (this.inBase64) {
203
- if (this.base64AccumIdx > 0) {
204
- bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
205
- this.base64AccumIdx = 0;
206
- }
207
-
208
- buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
209
- this.inBase64 = false;
197
+ Utf7IMAPEncoder.prototype.end = function () {
198
+ var buf = Buffer.alloc(10); var bufIdx = 0
199
+ if (this.inBase64) {
200
+ if (this.base64AccumIdx > 0) {
201
+ bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx)
202
+ this.base64AccumIdx = 0
210
203
  }
211
204
 
212
- return buf.slice(0, bufIdx);
213
- }
205
+ buf[bufIdx++] = minusChar // Write '-', then go to direct mode.
206
+ this.inBase64 = false
207
+ }
214
208
 
209
+ return buf.slice(0, bufIdx)
210
+ }
215
211
 
216
212
  // -- Decoding
217
213
 
218
- function Utf7IMAPDecoder(options, codec) {
219
- this.iconv = codec.iconv;
220
- this.inBase64 = false;
221
- this.base64Accum = '';
214
+ function Utf7IMAPDecoder (options, codec) {
215
+ this.iconv = codec.iconv
216
+ this.inBase64 = false
217
+ this.base64Accum = ""
222
218
  }
223
219
 
224
- var base64IMAPChars = base64Chars.slice();
225
- base64IMAPChars[','.charCodeAt(0)] = true;
226
-
227
- Utf7IMAPDecoder.prototype.write = function(buf) {
228
- var res = "", lastI = 0,
229
- inBase64 = this.inBase64,
230
- base64Accum = this.base64Accum;
231
-
232
- // The decoder is more involved as we must handle chunks in stream.
233
- // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
234
-
235
- for (var i = 0; i < buf.length; i++) {
236
- if (!inBase64) { // We're in direct mode.
237
- // Write direct chars until '&'
238
- if (buf[i] == andChar) {
239
- res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
240
- lastI = i+1;
241
- inBase64 = true;
242
- }
243
- } else { // We decode base64.
244
- if (!base64IMAPChars[buf[i]]) { // Base64 ended.
245
- if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
246
- res += "&";
247
- } else {
248
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/');
249
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
250
- }
251
-
252
- if (buf[i] != minusChar) // Minus may be absorbed after base64.
253
- i--;
254
-
255
- lastI = i+1;
256
- inBase64 = false;
257
- base64Accum = '';
258
- }
220
+ var base64IMAPChars = base64Chars.slice()
221
+ base64IMAPChars[",".charCodeAt(0)] = true
222
+
223
+ Utf7IMAPDecoder.prototype.write = function (buf) {
224
+ var res = ""; var lastI = 0
225
+ var inBase64 = this.inBase64
226
+ var base64Accum = this.base64Accum
227
+
228
+ // The decoder is more involved as we must handle chunks in stream.
229
+ // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
230
+
231
+ for (var i = 0; i < buf.length; i++) {
232
+ if (!inBase64) { // We're in direct mode.
233
+ // Write direct chars until '&'
234
+ if (buf[i] == andChar) {
235
+ res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars.
236
+ lastI = i + 1
237
+ inBase64 = true
238
+ }
239
+ } else { // We decode base64.
240
+ if (!base64IMAPChars[buf[i]]) { // Base64 ended.
241
+ if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
242
+ res += "&"
243
+ } else {
244
+ var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/")
245
+ res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
259
246
  }
260
- }
261
247
 
262
- if (!inBase64) {
263
- res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
264
- } else {
265
- var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/');
248
+ if (buf[i] != minusChar) // Minus may be absorbed after base64.
249
+ { i-- }
266
250
 
267
- var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
268
- base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
269
- b64str = b64str.slice(0, canBeDecoded);
270
-
271
- res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
251
+ lastI = i + 1
252
+ inBase64 = false
253
+ base64Accum = ""
254
+ }
272
255
  }
256
+ }
273
257
 
274
- this.inBase64 = inBase64;
275
- this.base64Accum = base64Accum;
258
+ if (!inBase64) {
259
+ res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars.
260
+ } else {
261
+ var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/")
276
262
 
277
- return res;
278
- }
263
+ var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
264
+ base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future.
265
+ b64str = b64str.slice(0, canBeDecoded)
279
266
 
280
- Utf7IMAPDecoder.prototype.end = function() {
281
- var res = "";
282
- if (this.inBase64 && this.base64Accum.length > 0)
283
- res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
267
+ res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
268
+ }
284
269
 
285
- this.inBase64 = false;
286
- this.base64Accum = '';
287
- return res;
270
+ this.inBase64 = inBase64
271
+ this.base64Accum = base64Accum
272
+
273
+ return res
288
274
  }
289
275
 
276
+ Utf7IMAPDecoder.prototype.end = function () {
277
+ var res = ""
278
+ if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") }
290
279
 
280
+ this.inBase64 = false
281
+ this.base64Accum = ""
282
+ return res
283
+ }
@@ -1,52 +1,48 @@
1
- "use strict";
1
+ "use strict"
2
2
 
3
- var BOMChar = '\uFEFF';
3
+ var BOMChar = "\uFEFF"
4
4
 
5
5
  exports.PrependBOM = PrependBOMWrapper
6
- function PrependBOMWrapper(encoder, options) {
7
- this.encoder = encoder;
8
- this.addBOM = true;
6
+ function PrependBOMWrapper (encoder, options) {
7
+ this.encoder = encoder
8
+ this.addBOM = true
9
9
  }
10
10
 
11
- PrependBOMWrapper.prototype.write = function(str) {
12
- if (this.addBOM) {
13
- str = BOMChar + str;
14
- this.addBOM = false;
15
- }
11
+ PrependBOMWrapper.prototype.write = function (str) {
12
+ if (this.addBOM) {
13
+ str = BOMChar + str
14
+ this.addBOM = false
15
+ }
16
16
 
17
- return this.encoder.write(str);
17
+ return this.encoder.write(str)
18
18
  }
19
19
 
20
- PrependBOMWrapper.prototype.end = function() {
21
- return this.encoder.end();
20
+ PrependBOMWrapper.prototype.end = function () {
21
+ return this.encoder.end()
22
22
  }
23
23
 
24
+ // ------------------------------------------------------------------------------
24
25
 
25
- //------------------------------------------------------------------------------
26
-
27
- exports.StripBOM = StripBOMWrapper;
28
- function StripBOMWrapper(decoder, options) {
29
- this.decoder = decoder;
30
- this.pass = false;
31
- this.options = options || {};
26
+ exports.StripBOM = StripBOMWrapper
27
+ function StripBOMWrapper (decoder, options) {
28
+ this.decoder = decoder
29
+ this.pass = false
30
+ this.options = options || {}
32
31
  }
33
32
 
34
- StripBOMWrapper.prototype.write = function(buf) {
35
- var res = this.decoder.write(buf);
36
- if (this.pass || !res)
37
- return res;
33
+ StripBOMWrapper.prototype.write = function (buf) {
34
+ var res = this.decoder.write(buf)
35
+ if (this.pass || !res) { return res }
38
36
 
39
- if (res[0] === BOMChar) {
40
- res = res.slice(1);
41
- if (typeof this.options.stripBOM === 'function')
42
- this.options.stripBOM();
43
- }
37
+ if (res[0] === BOMChar) {
38
+ res = res.slice(1)
39
+ if (typeof this.options.stripBOM === "function") { this.options.stripBOM() }
40
+ }
44
41
 
45
- this.pass = true;
46
- return res;
42
+ this.pass = true
43
+ return res
47
44
  }
48
45
 
49
- StripBOMWrapper.prototype.end = function() {
50
- return this.decoder.end();
46
+ StripBOMWrapper.prototype.end = function () {
47
+ return this.decoder.end()
51
48
  }
52
-
@@ -0,0 +1,13 @@
1
+ "use strict"
2
+
3
+ var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn
4
+
5
+ function mergeModules (target, module) {
6
+ for (var key in module) {
7
+ if (hasOwn(module, key)) {
8
+ target[key] = module[key]
9
+ }
10
+ }
11
+ }
12
+
13
+ module.exports = mergeModules