@socketsecurity/lib 1.3.2 → 1.3.3

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 (337) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/abort.js +1 -60
  3. package/dist/abort.js.map +2 -2
  4. package/dist/agent.js +1 -289
  5. package/dist/agent.js.map +2 -2
  6. package/dist/ansi.js +1 -60
  7. package/dist/ansi.js.map +2 -2
  8. package/dist/argv/flags.js +1 -282
  9. package/dist/argv/flags.js.map +2 -2
  10. package/dist/argv/parse.js +1 -171
  11. package/dist/argv/parse.js.map +2 -2
  12. package/dist/arrays.js +1 -85
  13. package/dist/arrays.js.map +2 -2
  14. package/dist/bin.js +1 -402
  15. package/dist/bin.js.map +2 -2
  16. package/dist/cacache.js +1 -137
  17. package/dist/cacache.js.map +2 -2
  18. package/dist/cache-with-ttl.js +1 -223
  19. package/dist/cache-with-ttl.js.map +2 -2
  20. package/dist/constants/agents.js +1 -126
  21. package/dist/constants/agents.js.map +2 -2
  22. package/dist/constants/core.js +2 -57
  23. package/dist/constants/core.js.map +2 -2
  24. package/dist/constants/encoding.js +1 -48
  25. package/dist/constants/encoding.js.map +2 -2
  26. package/dist/constants/github.js +1 -30
  27. package/dist/constants/github.js.map +2 -2
  28. package/dist/constants/licenses.js +1 -66
  29. package/dist/constants/licenses.js.map +2 -2
  30. package/dist/constants/node.js +1 -171
  31. package/dist/constants/node.js.map +2 -2
  32. package/dist/constants/packages.js +1 -128
  33. package/dist/constants/packages.js.map +2 -2
  34. package/dist/constants/paths.js +1 -150
  35. package/dist/constants/paths.js.map +2 -2
  36. package/dist/constants/platform.js +1 -41
  37. package/dist/constants/platform.js.map +2 -2
  38. package/dist/constants/process.js +1 -52
  39. package/dist/constants/process.js.map +2 -2
  40. package/dist/constants/socket.js +1 -81
  41. package/dist/constants/socket.js.map +2 -2
  42. package/dist/constants/testing.js +1 -36
  43. package/dist/constants/testing.js.map +2 -2
  44. package/dist/constants/time.js +1 -39
  45. package/dist/constants/time.js.map +2 -2
  46. package/dist/constants/typescript.js +1 -54
  47. package/dist/constants/typescript.js.map +2 -2
  48. package/dist/cover/code.js +1 -135
  49. package/dist/cover/code.js.map +2 -2
  50. package/dist/cover/formatters.js +11 -101
  51. package/dist/cover/formatters.js.map +2 -2
  52. package/dist/cover/type.js +1 -63
  53. package/dist/cover/type.js.map +2 -2
  54. package/dist/cover/types.js +1 -15
  55. package/dist/cover/types.js.map +2 -2
  56. package/dist/debug.js +2 -343
  57. package/dist/debug.js.map +2 -2
  58. package/dist/dlx-binary.js +1 -259
  59. package/dist/dlx-binary.js.map +2 -2
  60. package/dist/dlx-package.js +1 -149
  61. package/dist/dlx-package.js.map +2 -2
  62. package/dist/dlx.js +1 -166
  63. package/dist/dlx.js.map +2 -2
  64. package/dist/download-lock.js +1 -137
  65. package/dist/download-lock.js.map +2 -2
  66. package/dist/effects/pulse-frames.js +1 -64
  67. package/dist/effects/pulse-frames.js.map +2 -2
  68. package/dist/effects/text-shimmer.js +1 -174
  69. package/dist/effects/text-shimmer.js.map +2 -2
  70. package/dist/effects/types.js +1 -15
  71. package/dist/effects/types.js.map +2 -2
  72. package/dist/effects/ultra.js +1 -61
  73. package/dist/effects/ultra.js.map +2 -2
  74. package/dist/env/appdata.js +1 -28
  75. package/dist/env/appdata.js.map +2 -2
  76. package/dist/env/ci.js +1 -29
  77. package/dist/env/ci.js.map +2 -2
  78. package/dist/env/comspec.js +1 -28
  79. package/dist/env/comspec.js.map +2 -2
  80. package/dist/env/debug.js +1 -28
  81. package/dist/env/debug.js.map +2 -2
  82. package/dist/env/getters.js +1 -281
  83. package/dist/env/getters.js.map +2 -2
  84. package/dist/env/github-api-url.js +1 -28
  85. package/dist/env/github-api-url.js.map +2 -2
  86. package/dist/env/github-base-ref.js +1 -28
  87. package/dist/env/github-base-ref.js.map +2 -2
  88. package/dist/env/github-ref-name.js +1 -28
  89. package/dist/env/github-ref-name.js.map +2 -2
  90. package/dist/env/github-ref-type.js +1 -28
  91. package/dist/env/github-ref-type.js.map +2 -2
  92. package/dist/env/github-repository.js +1 -28
  93. package/dist/env/github-repository.js.map +2 -2
  94. package/dist/env/github-server-url.js +1 -28
  95. package/dist/env/github-server-url.js.map +2 -2
  96. package/dist/env/github-token.js +1 -28
  97. package/dist/env/github-token.js.map +2 -2
  98. package/dist/env/helpers.js +1 -47
  99. package/dist/env/helpers.js.map +2 -2
  100. package/dist/env/home.js +1 -28
  101. package/dist/env/home.js.map +2 -2
  102. package/dist/env/jest-worker-id.js +1 -28
  103. package/dist/env/jest-worker-id.js.map +2 -2
  104. package/dist/env/lang.js +1 -28
  105. package/dist/env/lang.js.map +2 -2
  106. package/dist/env/lc-all.js +1 -28
  107. package/dist/env/lc-all.js.map +2 -2
  108. package/dist/env/lc-messages.js +1 -28
  109. package/dist/env/lc-messages.js.map +2 -2
  110. package/dist/env/localappdata.js +1 -28
  111. package/dist/env/localappdata.js.map +2 -2
  112. package/dist/env/node-auth-token.js +1 -28
  113. package/dist/env/node-auth-token.js.map +2 -2
  114. package/dist/env/node-env.js +1 -28
  115. package/dist/env/node-env.js.map +2 -2
  116. package/dist/env/npm-config-registry.js +1 -28
  117. package/dist/env/npm-config-registry.js.map +2 -2
  118. package/dist/env/npm-config-user-agent.js +1 -28
  119. package/dist/env/npm-config-user-agent.js.map +2 -2
  120. package/dist/env/npm-lifecycle-event.js +1 -28
  121. package/dist/env/npm-lifecycle-event.js.map +2 -2
  122. package/dist/env/npm-registry.js +1 -28
  123. package/dist/env/npm-registry.js.map +2 -2
  124. package/dist/env/npm-token.js +1 -28
  125. package/dist/env/npm-token.js.map +2 -2
  126. package/dist/env/path.js +1 -28
  127. package/dist/env/path.js.map +2 -2
  128. package/dist/env/pre-commit.js +1 -29
  129. package/dist/env/pre-commit.js.map +2 -2
  130. package/dist/env/shell.js +1 -28
  131. package/dist/env/shell.js.map +2 -2
  132. package/dist/env/socket-accept-risks.js +1 -29
  133. package/dist/env/socket-accept-risks.js.map +2 -2
  134. package/dist/env/socket-api-base-url.js +1 -28
  135. package/dist/env/socket-api-base-url.js.map +2 -2
  136. package/dist/env/socket-api-proxy.js +1 -28
  137. package/dist/env/socket-api-proxy.js.map +2 -2
  138. package/dist/env/socket-api-timeout.js +1 -29
  139. package/dist/env/socket-api-timeout.js.map +2 -2
  140. package/dist/env/socket-api-token.js +1 -28
  141. package/dist/env/socket-api-token.js.map +2 -2
  142. package/dist/env/socket-cacache-dir.js +1 -28
  143. package/dist/env/socket-cacache-dir.js.map +2 -2
  144. package/dist/env/socket-cli-accept-risks.js +1 -31
  145. package/dist/env/socket-cli-accept-risks.js.map +2 -2
  146. package/dist/env/socket-cli-api-base-url.js +1 -28
  147. package/dist/env/socket-cli-api-base-url.js.map +2 -2
  148. package/dist/env/socket-cli-api-proxy.js +1 -28
  149. package/dist/env/socket-cli-api-proxy.js.map +2 -2
  150. package/dist/env/socket-cli-api-timeout.js +1 -29
  151. package/dist/env/socket-cli-api-timeout.js.map +2 -2
  152. package/dist/env/socket-cli-api-token.js +1 -28
  153. package/dist/env/socket-cli-api-token.js.map +2 -2
  154. package/dist/env/socket-cli-config.js +1 -28
  155. package/dist/env/socket-cli-config.js.map +2 -2
  156. package/dist/env/socket-cli-fix.js +1 -28
  157. package/dist/env/socket-cli-fix.js.map +2 -2
  158. package/dist/env/socket-cli-no-api-token.js +1 -31
  159. package/dist/env/socket-cli-no-api-token.js.map +2 -2
  160. package/dist/env/socket-cli-optimize.js +1 -29
  161. package/dist/env/socket-cli-optimize.js.map +2 -2
  162. package/dist/env/socket-cli-org-slug.js +1 -28
  163. package/dist/env/socket-cli-org-slug.js.map +2 -2
  164. package/dist/env/socket-cli-shadow-accept-risks.js +1 -31
  165. package/dist/env/socket-cli-shadow-accept-risks.js.map +2 -2
  166. package/dist/env/socket-cli-shadow-api-token.js +1 -28
  167. package/dist/env/socket-cli-shadow-api-token.js.map +2 -2
  168. package/dist/env/socket-cli-shadow-bin.js +1 -28
  169. package/dist/env/socket-cli-shadow-bin.js.map +2 -2
  170. package/dist/env/socket-cli-shadow-progress.js +1 -31
  171. package/dist/env/socket-cli-shadow-progress.js.map +2 -2
  172. package/dist/env/socket-cli-shadow-silent.js +1 -31
  173. package/dist/env/socket-cli-shadow-silent.js.map +2 -2
  174. package/dist/env/socket-cli-view-all-risks.js +1 -31
  175. package/dist/env/socket-cli-view-all-risks.js.map +2 -2
  176. package/dist/env/socket-config.js +1 -28
  177. package/dist/env/socket-config.js.map +2 -2
  178. package/dist/env/socket-debug.js +1 -28
  179. package/dist/env/socket-debug.js.map +2 -2
  180. package/dist/env/socket-home.js +1 -28
  181. package/dist/env/socket-home.js.map +2 -2
  182. package/dist/env/socket-no-api-token.js +1 -29
  183. package/dist/env/socket-no-api-token.js.map +2 -2
  184. package/dist/env/socket-npm-registry.js +1 -28
  185. package/dist/env/socket-npm-registry.js.map +2 -2
  186. package/dist/env/socket-org-slug.js +1 -28
  187. package/dist/env/socket-org-slug.js.map +2 -2
  188. package/dist/env/socket-registry-url.js +1 -28
  189. package/dist/env/socket-registry-url.js.map +2 -2
  190. package/dist/env/socket-view-all-risks.js +1 -29
  191. package/dist/env/socket-view-all-risks.js.map +2 -2
  192. package/dist/env/temp.js +1 -28
  193. package/dist/env/temp.js.map +2 -2
  194. package/dist/env/term.js +1 -28
  195. package/dist/env/term.js.map +2 -2
  196. package/dist/env/tmp.js +1 -28
  197. package/dist/env/tmp.js.map +2 -2
  198. package/dist/env/tmpdir.js +1 -28
  199. package/dist/env/tmpdir.js.map +2 -2
  200. package/dist/env/userprofile.js +1 -28
  201. package/dist/env/userprofile.js.map +2 -2
  202. package/dist/env/vitest.js +1 -29
  203. package/dist/env/vitest.js.map +2 -2
  204. package/dist/env/xdg-cache-home.js +1 -28
  205. package/dist/env/xdg-cache-home.js.map +2 -2
  206. package/dist/env/xdg-config-home.js +1 -28
  207. package/dist/env/xdg-config-home.js.map +2 -2
  208. package/dist/env/xdg-data-home.js +1 -28
  209. package/dist/env/xdg-data-home.js.map +2 -2
  210. package/dist/env.js +1 -61
  211. package/dist/env.js.map +2 -2
  212. package/dist/fs.js +3 -626
  213. package/dist/fs.js.map +2 -2
  214. package/dist/functions.js +1 -68
  215. package/dist/functions.js.map +2 -2
  216. package/dist/git.js +2 -320
  217. package/dist/git.js.map +2 -2
  218. package/dist/github.js +1 -201
  219. package/dist/github.js.map +2 -2
  220. package/dist/globs.js +1 -152
  221. package/dist/globs.js.map +2 -2
  222. package/dist/http-request.js +1 -313
  223. package/dist/http-request.js.map +2 -2
  224. package/dist/index.js +1 -62
  225. package/dist/index.js.map +2 -2
  226. package/dist/ipc.js +1 -232
  227. package/dist/ipc.js.map +2 -2
  228. package/dist/json.js +1 -73
  229. package/dist/json.js.map +2 -2
  230. package/dist/logger.js +1 -1254
  231. package/dist/logger.js.map +2 -2
  232. package/dist/maintained-node-versions.js +1 -35
  233. package/dist/maintained-node-versions.js.map +2 -2
  234. package/dist/memoization.js +1 -210
  235. package/dist/memoization.js.map +2 -2
  236. package/dist/objects.d.ts +0 -3
  237. package/dist/objects.js +1 -319
  238. package/dist/objects.js.map +3 -3
  239. package/dist/packages/editable.js +9 -356
  240. package/dist/packages/editable.js.map +2 -2
  241. package/dist/packages/exports.js +1 -162
  242. package/dist/packages/exports.js.map +2 -2
  243. package/dist/packages/isolation.js +1 -195
  244. package/dist/packages/isolation.js.map +2 -2
  245. package/dist/packages/licenses.js +1 -214
  246. package/dist/packages/licenses.js.map +2 -2
  247. package/dist/packages/manifest.js +1 -190
  248. package/dist/packages/manifest.js.map +2 -2
  249. package/dist/packages/normalize.js +1 -120
  250. package/dist/packages/normalize.js.map +2 -2
  251. package/dist/packages/operations.js +1 -304
  252. package/dist/packages/operations.js.map +2 -2
  253. package/dist/packages/paths.js +1 -53
  254. package/dist/packages/paths.js.map +2 -2
  255. package/dist/packages/provenance.js +1 -178
  256. package/dist/packages/provenance.js.map +2 -2
  257. package/dist/packages/registry.js +1 -28
  258. package/dist/packages/registry.js.map +2 -2
  259. package/dist/packages/specs.js +1 -83
  260. package/dist/packages/specs.js.map +2 -2
  261. package/dist/packages/validation.js +1 -51
  262. package/dist/packages/validation.js.map +2 -2
  263. package/dist/packages.js +1 -129
  264. package/dist/packages.js.map +2 -2
  265. package/dist/path.js +1 -448
  266. package/dist/path.js.map +2 -2
  267. package/dist/paths.js +1 -143
  268. package/dist/paths.js.map +2 -2
  269. package/dist/performance.js +15 -216
  270. package/dist/performance.js.map +2 -2
  271. package/dist/promise-queue.js +1 -109
  272. package/dist/promise-queue.js.map +2 -2
  273. package/dist/promises.js +1 -269
  274. package/dist/promises.js.map +2 -2
  275. package/dist/prompts.js +1 -58
  276. package/dist/prompts.js.map +2 -2
  277. package/dist/regexps.js +1 -30
  278. package/dist/regexps.js.map +2 -2
  279. package/dist/sea.js +1 -44
  280. package/dist/sea.js.map +2 -2
  281. package/dist/shadow.js +1 -58
  282. package/dist/shadow.js.map +2 -2
  283. package/dist/signal-exit.js +1 -248
  284. package/dist/signal-exit.js.map +2 -2
  285. package/dist/sorts.js +1 -94
  286. package/dist/sorts.js.map +2 -2
  287. package/dist/spawn.js +1 -199
  288. package/dist/spawn.js.map +2 -2
  289. package/dist/spinner.js +1 -865
  290. package/dist/spinner.js.map +2 -2
  291. package/dist/ssri.js +1 -71
  292. package/dist/ssri.js.map +2 -2
  293. package/dist/stdio/clear.js +1 -82
  294. package/dist/stdio/clear.js.map +2 -2
  295. package/dist/stdio/divider.js +3 -89
  296. package/dist/stdio/divider.js.map +2 -2
  297. package/dist/stdio/footer.js +2 -94
  298. package/dist/stdio/footer.js.map +2 -2
  299. package/dist/stdio/header.js +2 -100
  300. package/dist/stdio/header.js.map +2 -2
  301. package/dist/stdio/mask.js +5 -206
  302. package/dist/stdio/mask.js.map +2 -2
  303. package/dist/stdio/progress.js +2 -209
  304. package/dist/stdio/progress.js.map +2 -2
  305. package/dist/stdio/prompts.js +1 -88
  306. package/dist/stdio/prompts.js.map +2 -2
  307. package/dist/stdio/stderr.js +2 -89
  308. package/dist/stdio/stderr.js.map +2 -2
  309. package/dist/stdio/stdout.js +2 -103
  310. package/dist/stdio/stdout.js.map +2 -2
  311. package/dist/streams.js +1 -78
  312. package/dist/streams.js.map +2 -2
  313. package/dist/strings.js +3 -251
  314. package/dist/strings.js.map +2 -2
  315. package/dist/suppress-warnings.js +1 -98
  316. package/dist/suppress-warnings.js.map +2 -2
  317. package/dist/tables.js +3 -128
  318. package/dist/tables.js.map +2 -2
  319. package/dist/temporary-executor.js +1 -53
  320. package/dist/temporary-executor.js.map +2 -2
  321. package/dist/types.js +1 -72
  322. package/dist/types.js.map +2 -2
  323. package/dist/url.js +1 -142
  324. package/dist/url.js.map +2 -2
  325. package/dist/utils/get-ipc.js +1 -58
  326. package/dist/utils/get-ipc.js.map +2 -2
  327. package/dist/validation/json-parser.js +1 -127
  328. package/dist/validation/json-parser.js.map +2 -2
  329. package/dist/validation/types.js +1 -15
  330. package/dist/validation/types.js.map +2 -2
  331. package/dist/versions.js +1 -153
  332. package/dist/versions.js.map +2 -2
  333. package/dist/words.js +1 -50
  334. package/dist/words.js.map +2 -2
  335. package/dist/zod.js +1 -27
  336. package/dist/zod.js.map +2 -2
  337. package/package.json +1 -1
package/dist/fs.js CHANGED
@@ -1,628 +1,5 @@
1
1
  /* Socket Lib - Built with esbuild */
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var fs_exports = {};
20
- __export(fs_exports, {
21
- findUp: () => findUp,
22
- findUpSync: () => findUpSync,
23
- isDir: () => isDir,
24
- isDirEmptySync: () => isDirEmptySync,
25
- isDirSync: () => isDirSync,
26
- isSymLinkSync: () => isSymLinkSync,
27
- readDirNames: () => readDirNames,
28
- readDirNamesSync: () => readDirNamesSync,
29
- readFileBinary: () => readFileBinary,
30
- readFileBinarySync: () => readFileBinarySync,
31
- readFileUtf8: () => readFileUtf8,
32
- readFileUtf8Sync: () => readFileUtf8Sync,
33
- readJson: () => readJson,
34
- readJsonSync: () => readJsonSync,
35
- safeDelete: () => safeDelete,
36
- safeDeleteSync: () => safeDeleteSync,
37
- safeReadFile: () => safeReadFile,
38
- safeReadFileSync: () => safeReadFileSync,
39
- safeStats: () => safeStats,
40
- safeStatsSync: () => safeStatsSync,
41
- uniqueSync: () => uniqueSync,
42
- validateFiles: () => validateFiles,
43
- writeJson: () => writeJson,
44
- writeJsonSync: () => writeJsonSync
45
- });
46
- module.exports = __toCommonJS(fs_exports);
47
- var import_process = require("#constants/process");
48
- var import_arrays = require("./arrays");
49
- var import_globs = require("./globs");
50
- var import_json = require("./json");
51
- var import_objects = require("./objects");
52
- var import_path = require("./path");
53
- var import_sorts = require("./sorts");
54
- const abortSignal = (0, import_process.getAbortSignal)();
55
- const defaultRemoveOptions = (0, import_objects.objectFreeze)({
56
- __proto__: null,
57
- force: true,
58
- maxRetries: 3,
59
- recursive: true,
60
- retryDelay: 200
61
- });
62
- let _fs;
63
- // @__NO_SIDE_EFFECTS__
64
- function getFs() {
65
- if (_fs === void 0) {
66
- _fs = require("node:fs");
67
- }
68
- return _fs;
69
- }
70
- let _path;
71
- // @__NO_SIDE_EFFECTS__
72
- function getPath() {
73
- if (_path === void 0) {
74
- _path = require("node:path");
75
- }
76
- return _path;
77
- }
78
- let _os;
79
- // @__NO_SIDE_EFFECTS__
80
- function getOs() {
81
- if (_os === void 0) {
82
- _os = require("node:os");
83
- }
84
- return _os;
85
- }
86
- // @__NO_SIDE_EFFECTS__
87
- function innerReadDirNames(dirents, dirname, options) {
88
- const {
89
- ignore,
90
- includeEmpty = true,
91
- sort = true
92
- } = { __proto__: null, ...options };
93
- const path = /* @__PURE__ */ getPath();
94
- const names = dirents.filter(
95
- (d) => d.isDirectory() && (includeEmpty || !/* @__PURE__ */ isDirEmptySync(path.join(dirname || d.parentPath, d.name), {
96
- ignore
97
- }))
98
- ).map((d) => d.name);
99
- return sort ? names.sort(import_sorts.naturalCompare) : names;
100
- }
101
- // @__NO_SIDE_EFFECTS__
102
- function stringify(json, EOL, finalEOL, replacer, spaces = 2) {
103
- const EOF = finalEOL ? EOL : "";
104
- const str = JSON.stringify(json, replacer, spaces);
105
- return `${str.replace(/\n/g, EOL)}${EOF}`;
106
- }
107
- // @__NO_SIDE_EFFECTS__
108
- async function findUp(name, options) {
109
- const { cwd = process.cwd(), signal = abortSignal } = {
110
- __proto__: null,
111
- ...options
112
- };
113
- let { onlyDirectories = false, onlyFiles = true } = {
114
- __proto__: null,
115
- ...options
116
- };
117
- if (onlyDirectories) {
118
- onlyFiles = false;
119
- }
120
- if (onlyFiles) {
121
- onlyDirectories = false;
122
- }
123
- const fs = /* @__PURE__ */ getFs();
124
- const path = /* @__PURE__ */ getPath();
125
- let dir = path.resolve(cwd);
126
- const { root } = path.parse(dir);
127
- const names = (0, import_arrays.isArray)(name) ? name : [name];
128
- while (dir && dir !== root) {
129
- for (const n of names) {
130
- if (signal?.aborted) {
131
- return void 0;
132
- }
133
- const thePath = path.join(dir, n);
134
- try {
135
- const stats = await fs.promises.stat(thePath);
136
- if (!onlyDirectories && stats.isFile()) {
137
- return (0, import_path.normalizePath)(thePath);
138
- }
139
- if (!onlyFiles && stats.isDirectory()) {
140
- return (0, import_path.normalizePath)(thePath);
141
- }
142
- } catch {
143
- }
144
- }
145
- dir = path.dirname(dir);
146
- }
147
- return void 0;
148
- }
149
- // @__NO_SIDE_EFFECTS__
150
- function findUpSync(name, options) {
151
- const { cwd = process.cwd(), stopAt } = {
152
- __proto__: null,
153
- ...options
154
- };
155
- let { onlyDirectories = false, onlyFiles = true } = {
156
- __proto__: null,
157
- ...options
158
- };
159
- if (onlyDirectories) {
160
- onlyFiles = false;
161
- }
162
- if (onlyFiles) {
163
- onlyDirectories = false;
164
- }
165
- const fs = /* @__PURE__ */ getFs();
166
- const path = /* @__PURE__ */ getPath();
167
- let dir = path.resolve(cwd);
168
- const { root } = path.parse(dir);
169
- const stopDir = stopAt ? path.resolve(stopAt) : void 0;
170
- const names = (0, import_arrays.isArray)(name) ? name : [name];
171
- while (dir && dir !== root) {
172
- if (stopDir && dir === stopDir) {
173
- for (const n of names) {
174
- const thePath = path.join(dir, n);
175
- try {
176
- const stats = fs.statSync(thePath);
177
- if (!onlyDirectories && stats.isFile()) {
178
- return (0, import_path.normalizePath)(thePath);
179
- }
180
- if (!onlyFiles && stats.isDirectory()) {
181
- return (0, import_path.normalizePath)(thePath);
182
- }
183
- } catch {
184
- }
185
- }
186
- return void 0;
187
- }
188
- for (const n of names) {
189
- const thePath = path.join(dir, n);
190
- try {
191
- const stats = fs.statSync(thePath);
192
- if (!onlyDirectories && stats.isFile()) {
193
- return (0, import_path.normalizePath)(thePath);
194
- }
195
- if (!onlyFiles && stats.isDirectory()) {
196
- return (0, import_path.normalizePath)(thePath);
197
- }
198
- } catch {
199
- }
200
- }
201
- dir = path.dirname(dir);
202
- }
203
- return void 0;
204
- }
205
- // @__NO_SIDE_EFFECTS__
206
- async function isDir(filepath) {
207
- return !!(await /* @__PURE__ */ safeStats(filepath))?.isDirectory();
208
- }
209
- // @__NO_SIDE_EFFECTS__
210
- function isDirSync(filepath) {
211
- return !!(/* @__PURE__ */ safeStatsSync(filepath))?.isDirectory();
212
- }
213
- // @__NO_SIDE_EFFECTS__
214
- function isDirEmptySync(dirname, options) {
215
- const { ignore = import_globs.defaultIgnore } = {
216
- __proto__: null,
217
- ...options
218
- };
219
- const fs = /* @__PURE__ */ getFs();
220
- try {
221
- const files = fs.readdirSync(dirname);
222
- const { length } = files;
223
- if (length === 0) {
224
- return true;
225
- }
226
- const matcher = (0, import_globs.getGlobMatcher)(
227
- ignore,
228
- {
229
- cwd: (0, import_path.pathLikeToString)(dirname)
230
- }
231
- );
232
- let ignoredCount = 0;
233
- for (let i = 0; i < length; i += 1) {
234
- const file = files[i];
235
- if (file && matcher(file)) {
236
- ignoredCount += 1;
237
- }
238
- }
239
- return ignoredCount === length;
240
- } catch {
241
- return false;
242
- }
243
- }
244
- // @__NO_SIDE_EFFECTS__
245
- function isSymLinkSync(filepath) {
246
- const fs = /* @__PURE__ */ getFs();
247
- try {
248
- return fs.lstatSync(filepath).isSymbolicLink();
249
- } catch {
250
- }
251
- return false;
252
- }
253
- // @__NO_SIDE_EFFECTS__
254
- function validateFiles(filepaths) {
255
- const fs = /* @__PURE__ */ getFs();
256
- const validPaths = [];
257
- const invalidPaths = [];
258
- const { R_OK } = fs.constants;
259
- for (const filepath of filepaths) {
260
- try {
261
- fs.accessSync(filepath, R_OK);
262
- validPaths.push(filepath);
263
- } catch {
264
- invalidPaths.push(filepath);
265
- }
266
- }
267
- return { __proto__: null, validPaths, invalidPaths };
268
- }
269
- // @__NO_SIDE_EFFECTS__
270
- async function readDirNames(dirname, options) {
271
- const fs = /* @__PURE__ */ getFs();
272
- try {
273
- return /* @__PURE__ */ innerReadDirNames(
274
- await fs.promises.readdir(dirname, {
275
- __proto__: null,
276
- encoding: "utf8",
277
- withFileTypes: true
278
- }),
279
- String(dirname),
280
- options
281
- );
282
- } catch {
283
- }
284
- return [];
285
- }
286
- // @__NO_SIDE_EFFECTS__
287
- function readDirNamesSync(dirname, options) {
288
- const fs = /* @__PURE__ */ getFs();
289
- try {
290
- return /* @__PURE__ */ innerReadDirNames(
291
- fs.readdirSync(dirname, {
292
- __proto__: null,
293
- encoding: "utf8",
294
- withFileTypes: true
295
- }),
296
- String(dirname),
297
- options
298
- );
299
- } catch {
300
- }
301
- return [];
302
- }
303
- // @__NO_SIDE_EFFECTS__
304
- async function readFileBinary(filepath, options) {
305
- const opts = typeof options === "string" ? { encoding: options } : options;
306
- const fs = /* @__PURE__ */ getFs();
307
- return await fs.promises.readFile(filepath, {
308
- signal: abortSignal,
309
- ...opts,
310
- encoding: null
311
- });
312
- }
313
- // @__NO_SIDE_EFFECTS__
314
- async function readFileUtf8(filepath, options) {
315
- const opts = typeof options === "string" ? { encoding: options } : options;
316
- const fs = /* @__PURE__ */ getFs();
317
- return await fs.promises.readFile(filepath, {
318
- signal: abortSignal,
319
- ...opts,
320
- encoding: "utf8"
321
- });
322
- }
323
- // @__NO_SIDE_EFFECTS__
324
- function readFileBinarySync(filepath, options) {
325
- const opts = typeof options === "string" ? { encoding: options } : options;
326
- const fs = /* @__PURE__ */ getFs();
327
- return fs.readFileSync(filepath, {
328
- ...opts,
329
- encoding: null
330
- });
331
- }
332
- // @__NO_SIDE_EFFECTS__
333
- function readFileUtf8Sync(filepath, options) {
334
- const opts = typeof options === "string" ? { encoding: options } : options;
335
- const fs = /* @__PURE__ */ getFs();
336
- return fs.readFileSync(filepath, {
337
- ...opts,
338
- encoding: "utf8"
339
- });
340
- }
341
- // @__NO_SIDE_EFFECTS__
342
- async function readJson(filepath, options) {
343
- const opts = typeof options === "string" ? { encoding: options } : options;
344
- const { reviver, throws, ...fsOptions } = {
345
- __proto__: null,
346
- ...opts
347
- };
348
- const shouldThrow = throws === void 0 || !!throws;
349
- const fs = /* @__PURE__ */ getFs();
350
- let content = "";
351
- try {
352
- content = await fs.promises.readFile(filepath, {
353
- __proto__: null,
354
- encoding: "utf8",
355
- ...fsOptions
356
- });
357
- } catch (e) {
358
- if (shouldThrow) {
359
- throw e;
360
- }
361
- return void 0;
362
- }
363
- return (0, import_json.jsonParse)(content, {
364
- filepath: String(filepath),
365
- reviver,
366
- throws: shouldThrow
367
- });
368
- }
369
- // @__NO_SIDE_EFFECTS__
370
- function readJsonSync(filepath, options) {
371
- const opts = typeof options === "string" ? { encoding: options } : options;
372
- const { reviver, throws, ...fsOptions } = {
373
- __proto__: null,
374
- ...opts
375
- };
376
- const shouldThrow = throws === void 0 || !!throws;
377
- const fs = /* @__PURE__ */ getFs();
378
- let content = "";
379
- try {
380
- content = fs.readFileSync(filepath, {
381
- __proto__: null,
382
- encoding: "utf8",
383
- ...fsOptions
384
- });
385
- } catch (e) {
386
- if (shouldThrow) {
387
- throw e;
388
- }
389
- return void 0;
390
- }
391
- return (0, import_json.jsonParse)(content, {
392
- filepath: String(filepath),
393
- reviver,
394
- throws: shouldThrow
395
- });
396
- }
397
- // @__NO_SIDE_EFFECTS__
398
- async function safeDelete(filepath, options) {
399
- const del = require("./external/del");
400
- const { deleteAsync } = del;
401
- const opts = { __proto__: null, ...options };
402
- const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
403
- let shouldForce = opts.force !== false;
404
- if (!shouldForce && patterns.length > 0) {
405
- const os = /* @__PURE__ */ getOs();
406
- const path = /* @__PURE__ */ getPath();
407
- const {
408
- getSocketCacacheDir,
409
- getSocketUserDir
410
- } = require("./paths");
411
- const tmpDir = os.tmpdir();
412
- const resolvedTmpDir = path.resolve(tmpDir);
413
- const cacacheDir = getSocketCacacheDir();
414
- const resolvedCacacheDir = path.resolve(cacacheDir);
415
- const socketUserDir = getSocketUserDir();
416
- const resolvedSocketUserDir = path.resolve(socketUserDir);
417
- const allInAllowedDirs = patterns.every((pattern) => {
418
- const resolvedPath = path.resolve(pattern);
419
- for (const allowedDir of [
420
- resolvedTmpDir,
421
- resolvedCacacheDir,
422
- resolvedSocketUserDir
423
- ]) {
424
- const isInAllowedDir = resolvedPath.startsWith(allowedDir + path.sep) || resolvedPath === allowedDir;
425
- const relativePath = path.relative(allowedDir, resolvedPath);
426
- const isGoingBackward = relativePath.startsWith("..");
427
- if (isInAllowedDir && !isGoingBackward) {
428
- return true;
429
- }
430
- }
431
- return false;
432
- });
433
- if (allInAllowedDirs) {
434
- shouldForce = true;
435
- }
436
- }
437
- await deleteAsync(patterns, {
438
- concurrency: opts.maxRetries || defaultRemoveOptions.maxRetries,
439
- dryRun: false,
440
- force: shouldForce,
441
- onlyFiles: false
442
- });
443
- }
444
- // @__NO_SIDE_EFFECTS__
445
- function safeDeleteSync(filepath, options) {
446
- const del = require("./external/del");
447
- const { deleteSync } = del;
448
- const opts = { __proto__: null, ...options };
449
- const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
450
- let shouldForce = opts.force !== false;
451
- if (!shouldForce && patterns.length > 0) {
452
- const os = /* @__PURE__ */ getOs();
453
- const path = /* @__PURE__ */ getPath();
454
- const {
455
- getSocketCacacheDir,
456
- getSocketUserDir
457
- } = require("./paths");
458
- const tmpDir = os.tmpdir();
459
- const resolvedTmpDir = path.resolve(tmpDir);
460
- const cacacheDir = getSocketCacacheDir();
461
- const resolvedCacacheDir = path.resolve(cacacheDir);
462
- const socketUserDir = getSocketUserDir();
463
- const resolvedSocketUserDir = path.resolve(socketUserDir);
464
- const allInAllowedDirs = patterns.every((pattern) => {
465
- const resolvedPath = path.resolve(pattern);
466
- for (const allowedDir of [
467
- resolvedTmpDir,
468
- resolvedCacacheDir,
469
- resolvedSocketUserDir
470
- ]) {
471
- const isInAllowedDir = resolvedPath.startsWith(allowedDir + path.sep) || resolvedPath === allowedDir;
472
- const relativePath = path.relative(allowedDir, resolvedPath);
473
- const isGoingBackward = relativePath.startsWith("..");
474
- if (isInAllowedDir && !isGoingBackward) {
475
- return true;
476
- }
477
- }
478
- return false;
479
- });
480
- if (allInAllowedDirs) {
481
- shouldForce = true;
482
- }
483
- }
484
- deleteSync(patterns, {
485
- concurrency: opts.maxRetries || defaultRemoveOptions.maxRetries,
486
- dryRun: false,
487
- force: shouldForce,
488
- onlyFiles: false
489
- });
490
- }
491
- // @__NO_SIDE_EFFECTS__
492
- async function safeReadFile(filepath, options) {
493
- const opts = typeof options === "string" ? { encoding: options } : options;
494
- const fs = /* @__PURE__ */ getFs();
495
- try {
496
- return await fs.promises.readFile(filepath, {
497
- signal: abortSignal,
498
- ...opts
499
- });
500
- } catch {
501
- }
502
- return void 0;
503
- }
504
- // @__NO_SIDE_EFFECTS__
505
- async function safeStats(filepath) {
506
- const fs = /* @__PURE__ */ getFs();
507
- try {
508
- return await fs.promises.stat(filepath);
509
- } catch {
510
- }
511
- return void 0;
512
- }
513
- // @__NO_SIDE_EFFECTS__
514
- function safeStatsSync(filepath, options) {
515
- const opts = typeof options === "string" ? { encoding: options } : options;
516
- const fs = /* @__PURE__ */ getFs();
517
- try {
518
- return fs.statSync(filepath, {
519
- __proto__: null,
520
- throwIfNoEntry: false,
521
- ...opts
522
- });
523
- } catch {
524
- }
525
- return void 0;
526
- }
527
- // @__NO_SIDE_EFFECTS__
528
- function safeReadFileSync(filepath, options) {
529
- const opts = typeof options === "string" ? { encoding: options } : options;
530
- const fs = /* @__PURE__ */ getFs();
531
- try {
532
- return fs.readFileSync(filepath, {
533
- __proto__: null,
534
- ...opts
535
- });
536
- } catch {
537
- }
538
- return void 0;
539
- }
540
- // @__NO_SIDE_EFFECTS__
541
- function uniqueSync(filepath) {
542
- const fs = /* @__PURE__ */ getFs();
543
- const path = /* @__PURE__ */ getPath();
544
- const filepathStr = String(filepath);
545
- if (!fs.existsSync(filepathStr)) {
546
- return (0, import_path.normalizePath)(filepathStr);
547
- }
548
- const dirname = path.dirname(filepathStr);
549
- const ext = path.extname(filepathStr);
550
- const basename = path.basename(filepathStr, ext);
551
- let counter = 1;
552
- let uniquePath;
553
- do {
554
- uniquePath = path.join(dirname, `${basename}-${counter}${ext}`);
555
- counter++;
556
- } while (fs.existsSync(uniquePath));
557
- return (0, import_path.normalizePath)(uniquePath);
558
- }
559
- // @__NO_SIDE_EFFECTS__
560
- async function writeJson(filepath, jsonContent, options) {
561
- const opts = typeof options === "string" ? { encoding: options } : options;
562
- const { EOL, finalEOL, replacer, spaces, ...fsOptions } = {
563
- __proto__: null,
564
- ...opts
565
- };
566
- const fs = /* @__PURE__ */ getFs();
567
- const jsonString = /* @__PURE__ */ stringify(
568
- jsonContent,
569
- EOL || "\n",
570
- finalEOL !== void 0 ? finalEOL : true,
571
- replacer,
572
- spaces
573
- );
574
- await fs.promises.writeFile(filepath, jsonString, {
575
- encoding: "utf8",
576
- ...fsOptions,
577
- __proto__: null
578
- });
579
- }
580
- // @__NO_SIDE_EFFECTS__
581
- function writeJsonSync(filepath, jsonContent, options) {
582
- const opts = typeof options === "string" ? { encoding: options } : options;
583
- const { EOL, finalEOL, replacer, spaces, ...fsOptions } = {
584
- __proto__: null,
585
- ...opts
586
- };
587
- const fs = /* @__PURE__ */ getFs();
588
- const jsonString = /* @__PURE__ */ stringify(
589
- jsonContent,
590
- EOL || "\n",
591
- finalEOL !== void 0 ? finalEOL : true,
592
- replacer,
593
- spaces
594
- );
595
- fs.writeFileSync(filepath, jsonString, {
596
- encoding: "utf8",
597
- ...fsOptions,
598
- __proto__: null
599
- });
600
- }
601
- // Annotate the CommonJS export names for ESM import in node:
602
- 0 && (module.exports = {
603
- findUp,
604
- findUpSync,
605
- isDir,
606
- isDirEmptySync,
607
- isDirSync,
608
- isSymLinkSync,
609
- readDirNames,
610
- readDirNamesSync,
611
- readFileBinary,
612
- readFileBinarySync,
613
- readFileUtf8,
614
- readFileUtf8Sync,
615
- readJson,
616
- readJsonSync,
617
- safeDelete,
618
- safeDeleteSync,
619
- safeReadFile,
620
- safeReadFileSync,
621
- safeStats,
622
- safeStatsSync,
623
- uniqueSync,
624
- validateFiles,
625
- writeJson,
626
- writeJsonSync
627
- });
2
+ var P=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var K=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},H=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of M(e))!z.call(n,o)&&o!==t&&P(n,o,{get:()=>e[o],enumerable:!(i=G(e,o))||i.enumerable});return n};var Q=n=>H(P({},"__esModule",{value:!0}),n);var me={};K(me,{findUp:()=>X,findUpSync:()=>Y,isDir:()=>Z,isDirEmptySync:()=>B,isDirSync:()=>ee,isSymLinkSync:()=>ne,readDirNames:()=>re,readDirNamesSync:()=>ie,readFileBinary:()=>oe,readFileBinarySync:()=>ae,readFileUtf8:()=>se,readFileUtf8Sync:()=>ce,readJson:()=>de,readJsonSync:()=>fe,safeDelete:()=>le,safeDeleteSync:()=>ue,safeReadFile:()=>pe,safeReadFileSync:()=>ye,safeStats:()=>C,safeStatsSync:()=>N,uniqueSync:()=>ge,validateFiles:()=>te,writeJson:()=>he,writeJsonSync:()=>_e});module.exports=Q(me);var j=require("#constants/process"),S=require("./arrays"),D=require("./globs"),J=require("./json"),A=require("./objects"),l=require("./path"),U=require("./sorts");const w=(0,j.getAbortSignal)(),W=(0,A.objectFreeze)({__proto__:null,force:!0,maxRetries:3,recursive:!0,retryDelay:200});let k;function d(){return k===void 0&&(k=require("node:fs")),k}let L;function O(){return L===void 0&&(L=require("node:path")),L}let E;function I(){return E===void 0&&(E=require("node:os")),E}function q(n,e,t){const{ignore:i,includeEmpty:o=!0,sort:s=!0}={__proto__:null,...t},c=O(),a=n.filter(r=>r.isDirectory()&&(o||!B(c.join(e||r.parentPath,r.name),{ignore:i}))).map(r=>r.name);return s?a.sort(U.naturalCompare):a}function T(n,e,t,i,o=2){const s=t?e:"";return`${JSON.stringify(n,i,o).replace(/\n/g,e)}${s}`}async function X(n,e){const{cwd:t=process.cwd(),signal:i=w}={__proto__:null,...e};let{onlyDirectories:o=!1,onlyFiles:s=!0}={__proto__:null,...e};o&&(s=!1),s&&(o=!1);const c=d(),a=O();let r=a.resolve(t);const{root:f}=a.parse(r),p=(0,S.isArray)(n)?n:[n];for(;r&&r!==f;){for(const h of p){if(i?.aborted)return;const y=a.join(r,h);try{const u=await c.promises.stat(y);if(!o&&u.isFile())return(0,l.normalizePath)(y);if(!s&&u.isDirectory())return(0,l.normalizePath)(y)}catch{}}r=a.dirname(r)}}function Y(n,e){const{cwd:t=process.cwd(),stopAt:i}={__proto__:null,...e};let{onlyDirectories:o=!1,onlyFiles:s=!0}={__proto__:null,...e};o&&(s=!1),s&&(o=!1);const c=d(),a=O();let r=a.resolve(t);const{root:f}=a.parse(r),p=i?a.resolve(i):void 0,h=(0,S.isArray)(n)?n:[n];for(;r&&r!==f;){if(p&&r===p){for(const y of h){const u=a.join(r,y);try{const g=c.statSync(u);if(!o&&g.isFile())return(0,l.normalizePath)(u);if(!s&&g.isDirectory())return(0,l.normalizePath)(u)}catch{}}return}for(const y of h){const u=a.join(r,y);try{const g=c.statSync(u);if(!o&&g.isFile())return(0,l.normalizePath)(u);if(!s&&g.isDirectory())return(0,l.normalizePath)(u)}catch{}}r=a.dirname(r)}}async function Z(n){return!!(await C(n))?.isDirectory()}function ee(n){return!!N(n)?.isDirectory()}function B(n,e){const{ignore:t=D.defaultIgnore}={__proto__:null,...e},i=d();try{const o=i.readdirSync(n),{length:s}=o;if(s===0)return!0;const c=(0,D.getGlobMatcher)(t,{cwd:(0,l.pathLikeToString)(n)});let a=0;for(let r=0;r<s;r+=1){const f=o[r];f&&c(f)&&(a+=1)}return a===s}catch{return!1}}function ne(n){const e=d();try{return e.lstatSync(n).isSymbolicLink()}catch{}return!1}function te(n){const e=d(),t=[],i=[],{R_OK:o}=e.constants;for(const s of n)try{e.accessSync(s,o),t.push(s)}catch{i.push(s)}return{__proto__:null,validPaths:t,invalidPaths:i}}async function re(n,e){const t=d();try{return q(await t.promises.readdir(n,{__proto__:null,encoding:"utf8",withFileTypes:!0}),String(n),e)}catch{}return[]}function ie(n,e){const t=d();try{return q(t.readdirSync(n,{__proto__:null,encoding:"utf8",withFileTypes:!0}),String(n),e)}catch{}return[]}async function oe(n,e){const t=typeof e=="string"?{encoding:e}:e;return await d().promises.readFile(n,{signal:w,...t,encoding:null})}async function se(n,e){const t=typeof e=="string"?{encoding:e}:e;return await d().promises.readFile(n,{signal:w,...t,encoding:"utf8"})}function ae(n,e){const t=typeof e=="string"?{encoding:e}:e;return d().readFileSync(n,{...t,encoding:null})}function ce(n,e){const t=typeof e=="string"?{encoding:e}:e;return d().readFileSync(n,{...t,encoding:"utf8"})}async function de(n,e){const t=typeof e=="string"?{encoding:e}:e,{reviver:i,throws:o,...s}={__proto__:null,...t},c=o===void 0||!!o,a=d();let r="";try{r=await a.promises.readFile(n,{__proto__:null,encoding:"utf8",...s})}catch(f){if(c)throw f;return}return(0,J.jsonParse)(r,{filepath:String(n),reviver:i,throws:c})}function fe(n,e){const t=typeof e=="string"?{encoding:e}:e,{reviver:i,throws:o,...s}={__proto__:null,...t},c=o===void 0||!!o,a=d();let r="";try{r=a.readFileSync(n,{__proto__:null,encoding:"utf8",...s})}catch(f){if(c)throw f;return}return(0,J.jsonParse)(r,{filepath:String(n),reviver:i,throws:c})}async function le(n,e){const t=require("./external/del"),{deleteAsync:i}=t,o={__proto__:null,...e},s=(0,S.isArray)(n)?n.map(l.pathLikeToString):[(0,l.pathLikeToString)(n)];let c=o.force!==!1;if(!c&&s.length>0){const a=I(),r=O(),{getSocketCacacheDir:f,getSocketUserDir:p}=require("./paths"),h=a.tmpdir(),y=r.resolve(h),u=f(),g=r.resolve(u),F=p(),v=r.resolve(F);s.every(x=>{const _=r.resolve(x);for(const m of[y,g,v]){const b=_.startsWith(m+r.sep)||_===m,R=r.relative(m,_).startsWith("..");if(b&&!R)return!0}return!1})&&(c=!0)}await i(s,{concurrency:o.maxRetries||W.maxRetries,dryRun:!1,force:c,onlyFiles:!1})}function ue(n,e){const t=require("./external/del"),{deleteSync:i}=t,o={__proto__:null,...e},s=(0,S.isArray)(n)?n.map(l.pathLikeToString):[(0,l.pathLikeToString)(n)];let c=o.force!==!1;if(!c&&s.length>0){const a=I(),r=O(),{getSocketCacacheDir:f,getSocketUserDir:p}=require("./paths"),h=a.tmpdir(),y=r.resolve(h),u=f(),g=r.resolve(u),F=p(),v=r.resolve(F);s.every(x=>{const _=r.resolve(x);for(const m of[y,g,v]){const b=_.startsWith(m+r.sep)||_===m,R=r.relative(m,_).startsWith("..");if(b&&!R)return!0}return!1})&&(c=!0)}i(s,{concurrency:o.maxRetries||W.maxRetries,dryRun:!1,force:c,onlyFiles:!1})}async function pe(n,e){const t=typeof e=="string"?{encoding:e}:e,i=d();try{return await i.promises.readFile(n,{signal:w,...t})}catch{}}async function C(n){const e=d();try{return await e.promises.stat(n)}catch{}}function N(n,e){const t=typeof e=="string"?{encoding:e}:e,i=d();try{return i.statSync(n,{__proto__:null,throwIfNoEntry:!1,...t})}catch{}}function ye(n,e){const t=typeof e=="string"?{encoding:e}:e,i=d();try{return i.readFileSync(n,{__proto__:null,...t})}catch{}}function ge(n){const e=d(),t=O(),i=String(n);if(!e.existsSync(i))return(0,l.normalizePath)(i);const o=t.dirname(i),s=t.extname(i),c=t.basename(i,s);let a=1,r;do r=t.join(o,`${c}-${a}${s}`),a++;while(e.existsSync(r));return(0,l.normalizePath)(r)}async function he(n,e,t){const i=typeof t=="string"?{encoding:t}:t,{EOL:o,finalEOL:s,replacer:c,spaces:a,...r}={__proto__:null,...i},f=d(),p=T(e,o||`
3
+ `,s!==void 0?s:!0,c,a);await f.promises.writeFile(n,p,{encoding:"utf8",...r,__proto__:null})}function _e(n,e,t){const i=typeof t=="string"?{encoding:t}:t,{EOL:o,finalEOL:s,replacer:c,spaces:a,...r}={__proto__:null,...i},f=d(),p=T(e,o||`
4
+ `,s!==void 0?s:!0,c,a);f.writeFileSync(n,p,{encoding:"utf8",...r,__proto__:null})}0&&(module.exports={findUp,findUpSync,isDir,isDirEmptySync,isDirSync,isSymLinkSync,readDirNames,readDirNamesSync,readFileBinary,readFileBinarySync,readFileUtf8,readFileUtf8Sync,readJson,readJsonSync,safeDelete,safeDeleteSync,safeReadFile,safeReadFileSync,safeStats,safeStatsSync,uniqueSync,validateFiles,writeJson,writeJsonSync});
628
5
  //# sourceMappingURL=fs.js.map