@socketsecurity/lib 5.2.1 → 5.3.0
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.
- package/CHANGELOG.md +14 -0
- package/dist/bin.d.ts +0 -9
- package/dist/bin.js +70 -48
- package/dist/constants/agents.js +2 -2
- package/dist/constants/platform.d.ts +21 -0
- package/dist/constants/platform.js +30 -6
- package/dist/cover/code.js +1 -1
- package/dist/debug.js +1 -1
- package/dist/dlx/binary.d.ts +1 -1
- package/dist/dlx/binary.js +49 -39
- package/dist/dlx/dir.js +1 -1
- package/dist/dlx/manifest.d.ts +2 -1
- package/dist/dlx/package.js +39 -19
- package/dist/dlx/packages.js +1 -1
- package/dist/dlx/paths.js +1 -1
- package/dist/fs.js +3 -3
- package/dist/git.js +41 -38
- package/dist/http-request.js +2 -2
- package/dist/json/edit.js +1 -1
- package/dist/json/format.js +1 -1
- package/dist/logger.js +1 -1
- package/dist/packages/edit.js +3 -3
- package/dist/paths/normalize.js +3 -3
- package/dist/paths/packages.js +1 -1
- package/dist/promises.js +1 -1
- package/dist/releases/github.d.ts +54 -135
- package/dist/releases/github.js +107 -106
- package/dist/releases/socket-btm.d.ts +54 -175
- package/dist/releases/socket-btm.js +70 -48
- package/dist/signal-exit.js +1 -1
- package/dist/spawn.js +1 -1
- package/package.json +2 -2
package/dist/dlx/dir.js
CHANGED
package/dist/dlx/manifest.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface PackageDetails {
|
|
|
15
15
|
*/
|
|
16
16
|
export interface BinaryDetails {
|
|
17
17
|
checksum: string;
|
|
18
|
-
checksum_algorithm:
|
|
18
|
+
checksum_algorithm: ChecksumAlgorithm;
|
|
19
19
|
platform: string;
|
|
20
20
|
arch: string;
|
|
21
21
|
size: number;
|
|
@@ -24,6 +24,7 @@ export interface BinaryDetails {
|
|
|
24
24
|
url: string;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
export type ChecksumAlgorithm = 'sha256' | 'sha512';
|
|
27
28
|
/**
|
|
28
29
|
* Unified manifest entry for all cached items (packages and binaries).
|
|
29
30
|
* Shared fields at root, type-specific fields in details.
|
package/dist/dlx/package.js
CHANGED
|
@@ -34,8 +34,6 @@ __export(package_exports, {
|
|
|
34
34
|
executePackage: () => executePackage
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(package_exports);
|
|
37
|
-
var import_node_fs = __toESM(require("node:fs"));
|
|
38
|
-
var import_path = __toESM(require("path"));
|
|
39
37
|
var import_platform = require("../constants/platform");
|
|
40
38
|
var import_packages = require("../constants/packages");
|
|
41
39
|
var import_cache = require("./cache");
|
|
@@ -48,6 +46,22 @@ var import_normalize = require("../paths/normalize");
|
|
|
48
46
|
var import_socket = require("../paths/socket");
|
|
49
47
|
var import_process_lock = require("../process-lock");
|
|
50
48
|
var import_spawn = require("../spawn");
|
|
49
|
+
let _fs;
|
|
50
|
+
// @__NO_SIDE_EFFECTS__
|
|
51
|
+
function getFs() {
|
|
52
|
+
if (_fs === void 0) {
|
|
53
|
+
_fs = require("fs");
|
|
54
|
+
}
|
|
55
|
+
return _fs;
|
|
56
|
+
}
|
|
57
|
+
let _path;
|
|
58
|
+
// @__NO_SIDE_EFFECTS__
|
|
59
|
+
function getPath() {
|
|
60
|
+
if (_path === void 0) {
|
|
61
|
+
_path = require("path");
|
|
62
|
+
}
|
|
63
|
+
return _path;
|
|
64
|
+
}
|
|
51
65
|
const rangeOperatorsRegExp = /[~^><=xX* ]|\|\|/;
|
|
52
66
|
function parsePackageSpec(spec) {
|
|
53
67
|
try {
|
|
@@ -69,10 +83,12 @@ function parsePackageSpec(spec) {
|
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
85
|
async function ensurePackageInstalled(packageName, packageSpec, force) {
|
|
86
|
+
const fs = /* @__PURE__ */ getFs();
|
|
87
|
+
const path = /* @__PURE__ */ getPath();
|
|
72
88
|
const cacheKey = (0, import_cache.generateCacheKey)(packageSpec);
|
|
73
|
-
const packageDir = (0, import_normalize.normalizePath)(
|
|
89
|
+
const packageDir = (0, import_normalize.normalizePath)(path.join((0, import_socket.getSocketDlxDir)(), cacheKey));
|
|
74
90
|
const installedDir = (0, import_normalize.normalizePath)(
|
|
75
|
-
|
|
91
|
+
path.join(packageDir, "node_modules", packageName)
|
|
76
92
|
);
|
|
77
93
|
try {
|
|
78
94
|
await (0, import_fs.safeMkdir)(packageDir);
|
|
@@ -96,13 +112,13 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
|
|
|
96
112
|
cause: e
|
|
97
113
|
});
|
|
98
114
|
}
|
|
99
|
-
const lockPath =
|
|
115
|
+
const lockPath = path.join(packageDir, "concurrency.lock");
|
|
100
116
|
return await import_process_lock.processLock.withLock(
|
|
101
117
|
lockPath,
|
|
102
118
|
async () => {
|
|
103
|
-
if (!force &&
|
|
104
|
-
const pkgJsonPath =
|
|
105
|
-
if (
|
|
119
|
+
if (!force && fs.existsSync(installedDir)) {
|
|
120
|
+
const pkgJsonPath = path.join(installedDir, "package.json");
|
|
121
|
+
if (fs.existsSync(pkgJsonPath)) {
|
|
106
122
|
return { installed: false, packageDir };
|
|
107
123
|
}
|
|
108
124
|
}
|
|
@@ -110,11 +126,11 @@ Ensure the filesystem is writable or set SOCKET_DLX_DIR to a writable location.`
|
|
|
110
126
|
try {
|
|
111
127
|
await import_pacote.default.extract(packageSpec, installedDir, {
|
|
112
128
|
// Use consistent pacote cache path (respects npm cache locations when available).
|
|
113
|
-
cache: pacoteCachePath ||
|
|
129
|
+
cache: pacoteCachePath || path.join(packageDir, ".cache")
|
|
114
130
|
});
|
|
115
131
|
const arb = new import_arborist.default({
|
|
116
132
|
path: installedDir,
|
|
117
|
-
cache: pacoteCachePath ||
|
|
133
|
+
cache: pacoteCachePath || path.join(packageDir, ".cache"),
|
|
118
134
|
// Skip devDependencies (production-only like npx).
|
|
119
135
|
omit: ["dev"],
|
|
120
136
|
// Security: Skip install/preinstall/postinstall scripts to prevent arbitrary code execution.
|
|
@@ -167,20 +183,22 @@ function resolveBinaryPath(basePath) {
|
|
|
167
183
|
if (!import_platform.WIN32) {
|
|
168
184
|
return basePath;
|
|
169
185
|
}
|
|
186
|
+
const fs = /* @__PURE__ */ getFs();
|
|
170
187
|
const extensions = [".cmd", ".bat", ".ps1", ".exe", ""];
|
|
171
188
|
for (const ext of extensions) {
|
|
172
189
|
const testPath = basePath + ext;
|
|
173
|
-
if (
|
|
190
|
+
if (fs.existsSync(testPath)) {
|
|
174
191
|
return testPath;
|
|
175
192
|
}
|
|
176
193
|
}
|
|
177
194
|
return basePath;
|
|
178
195
|
}
|
|
179
196
|
function findBinaryPath(packageDir, packageName, binaryName) {
|
|
197
|
+
const path = /* @__PURE__ */ getPath();
|
|
180
198
|
const installedDir = (0, import_normalize.normalizePath)(
|
|
181
|
-
|
|
199
|
+
path.join(packageDir, "node_modules", packageName)
|
|
182
200
|
);
|
|
183
|
-
const pkgJsonPath =
|
|
201
|
+
const pkgJsonPath = path.join(installedDir, "package.json");
|
|
184
202
|
const pkgJson = (0, import_fs.readJsonSync)(pkgJsonPath);
|
|
185
203
|
const bin = pkgJson["bin"];
|
|
186
204
|
let binName;
|
|
@@ -226,7 +244,7 @@ function findBinaryPath(packageDir, packageName, binaryName) {
|
|
|
226
244
|
if (!binPath) {
|
|
227
245
|
throw new Error(`No binary found for package "${packageName}"`);
|
|
228
246
|
}
|
|
229
|
-
const rawPath = (0, import_normalize.normalizePath)(
|
|
247
|
+
const rawPath = (0, import_normalize.normalizePath)(path.join(installedDir, binPath));
|
|
230
248
|
return resolveBinaryPath(rawPath);
|
|
231
249
|
}
|
|
232
250
|
async function dlxPackage(args, options, spawnExtra) {
|
|
@@ -246,10 +264,12 @@ function makePackageBinsExecutable(packageDir, packageName) {
|
|
|
246
264
|
if (import_platform.WIN32) {
|
|
247
265
|
return;
|
|
248
266
|
}
|
|
267
|
+
const fs = /* @__PURE__ */ getFs();
|
|
268
|
+
const path = /* @__PURE__ */ getPath();
|
|
249
269
|
const installedDir = (0, import_normalize.normalizePath)(
|
|
250
|
-
|
|
270
|
+
path.join(packageDir, "node_modules", packageName)
|
|
251
271
|
);
|
|
252
|
-
const pkgJsonPath =
|
|
272
|
+
const pkgJsonPath = path.join(installedDir, "package.json");
|
|
253
273
|
try {
|
|
254
274
|
const pkgJson = (0, import_fs.readJsonSync)(pkgJsonPath);
|
|
255
275
|
const bin = pkgJson["bin"];
|
|
@@ -264,10 +284,10 @@ function makePackageBinsExecutable(packageDir, packageName) {
|
|
|
264
284
|
binPaths.push(...Object.values(binObj));
|
|
265
285
|
}
|
|
266
286
|
for (const binPath of binPaths) {
|
|
267
|
-
const fullPath = (0, import_normalize.normalizePath)(
|
|
268
|
-
if (
|
|
287
|
+
const fullPath = (0, import_normalize.normalizePath)(path.join(installedDir, binPath));
|
|
288
|
+
if (fs.existsSync(fullPath)) {
|
|
269
289
|
try {
|
|
270
|
-
|
|
290
|
+
fs.chmodSync(fullPath, 493);
|
|
271
291
|
} catch {
|
|
272
292
|
}
|
|
273
293
|
}
|
package/dist/dlx/packages.js
CHANGED
package/dist/dlx/paths.js
CHANGED
package/dist/fs.js
CHANGED
|
@@ -84,7 +84,7 @@ let _buffer;
|
|
|
84
84
|
// @__NO_SIDE_EFFECTS__
|
|
85
85
|
function getBuffer() {
|
|
86
86
|
if (_buffer === void 0) {
|
|
87
|
-
_buffer = require("
|
|
87
|
+
_buffer = require("buffer");
|
|
88
88
|
}
|
|
89
89
|
return _buffer;
|
|
90
90
|
}
|
|
@@ -92,7 +92,7 @@ let _fs;
|
|
|
92
92
|
// @__NO_SIDE_EFFECTS__
|
|
93
93
|
function getFs() {
|
|
94
94
|
if (_fs === void 0) {
|
|
95
|
-
_fs = require("
|
|
95
|
+
_fs = require("fs");
|
|
96
96
|
}
|
|
97
97
|
return _fs;
|
|
98
98
|
}
|
|
@@ -100,7 +100,7 @@ let _path;
|
|
|
100
100
|
// @__NO_SIDE_EFFECTS__
|
|
101
101
|
function getPath() {
|
|
102
102
|
if (_path === void 0) {
|
|
103
|
-
_path = require("
|
|
103
|
+
_path = require("path");
|
|
104
104
|
}
|
|
105
105
|
return _path;
|
|
106
106
|
}
|
package/dist/git.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with esbuild */
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
var git_exports = {};
|
|
31
21
|
__export(git_exports, {
|
|
@@ -44,18 +34,16 @@ __export(git_exports, {
|
|
|
44
34
|
isUnstagedSync: () => isUnstagedSync
|
|
45
35
|
});
|
|
46
36
|
module.exports = __toCommonJS(git_exports);
|
|
47
|
-
var import_path = __toESM(require("path"));
|
|
48
37
|
var import_debug = require("./debug");
|
|
49
38
|
var import_globs = require("./globs");
|
|
50
39
|
var import_normalize = require("./paths/normalize");
|
|
51
40
|
var import_spawn = require("./spawn");
|
|
52
41
|
var import_strings = require("./strings");
|
|
53
|
-
const gitDiffCache = /* @__PURE__ */ new Map();
|
|
54
42
|
let _fs;
|
|
55
43
|
// @__NO_SIDE_EFFECTS__
|
|
56
44
|
function getFs() {
|
|
57
45
|
if (_fs === void 0) {
|
|
58
|
-
_fs = require("
|
|
46
|
+
_fs = require("fs");
|
|
59
47
|
}
|
|
60
48
|
return _fs;
|
|
61
49
|
}
|
|
@@ -63,10 +51,11 @@ let _path;
|
|
|
63
51
|
// @__NO_SIDE_EFFECTS__
|
|
64
52
|
function getPath() {
|
|
65
53
|
if (_path === void 0) {
|
|
66
|
-
_path = require("
|
|
54
|
+
_path = require("path");
|
|
67
55
|
}
|
|
68
56
|
return _path;
|
|
69
57
|
}
|
|
58
|
+
const gitDiffCache = /* @__PURE__ */ new Map();
|
|
70
59
|
function getGitPath() {
|
|
71
60
|
return "git";
|
|
72
61
|
}
|
|
@@ -161,17 +150,17 @@ function innerDiffSync(args, options) {
|
|
|
161
150
|
}
|
|
162
151
|
function findGitRoot(startPath) {
|
|
163
152
|
const fs = /* @__PURE__ */ getFs();
|
|
164
|
-
const
|
|
153
|
+
const path = /* @__PURE__ */ getPath();
|
|
165
154
|
let currentPath = startPath;
|
|
166
155
|
while (true) {
|
|
167
156
|
try {
|
|
168
|
-
const gitPath =
|
|
157
|
+
const gitPath = path.join(currentPath, ".git");
|
|
169
158
|
if (fs.existsSync(gitPath)) {
|
|
170
159
|
return currentPath;
|
|
171
160
|
}
|
|
172
161
|
} catch {
|
|
173
162
|
}
|
|
174
|
-
const parentPath =
|
|
163
|
+
const parentPath = path.dirname(currentPath);
|
|
175
164
|
if (parentPath === currentPath) {
|
|
176
165
|
return startPath;
|
|
177
166
|
}
|
|
@@ -186,7 +175,9 @@ function parseGitDiffStdout(stdout, options, spawnCwd) {
|
|
|
186
175
|
porcelain = false,
|
|
187
176
|
...matcherOptions
|
|
188
177
|
} = { __proto__: null, ...options };
|
|
189
|
-
const
|
|
178
|
+
const fs = /* @__PURE__ */ getFs();
|
|
179
|
+
const path = /* @__PURE__ */ getPath();
|
|
180
|
+
const cwd = cwdOption === defaultRoot ? defaultRoot : fs.realpathSync(cwdOption);
|
|
190
181
|
const rootPath = defaultRoot;
|
|
191
182
|
let rawFiles = stdout ? (0, import_strings.stripAnsi)(stdout).split("\n").map((line) => line.trimEnd()).filter((line) => line) : [];
|
|
192
183
|
if (porcelain) {
|
|
@@ -194,11 +185,11 @@ function parseGitDiffStdout(stdout, options, spawnCwd) {
|
|
|
194
185
|
return line.length > 3 ? line.substring(3) : line;
|
|
195
186
|
});
|
|
196
187
|
}
|
|
197
|
-
const files = absolute ? rawFiles.map((relPath2) => (0, import_normalize.normalizePath)(
|
|
188
|
+
const files = absolute ? rawFiles.map((relPath2) => (0, import_normalize.normalizePath)(path.join(rootPath, relPath2))) : rawFiles.map((relPath2) => (0, import_normalize.normalizePath)(relPath2));
|
|
198
189
|
if (cwd === rootPath) {
|
|
199
190
|
return files;
|
|
200
191
|
}
|
|
201
|
-
const relPath = (0, import_normalize.normalizePath)(
|
|
192
|
+
const relPath = (0, import_normalize.normalizePath)(path.relative(rootPath, cwd));
|
|
202
193
|
const matcher = (0, import_globs.getGlobMatcher)([`${relPath}/**`], {
|
|
203
194
|
...matcherOptions,
|
|
204
195
|
absolute,
|
|
@@ -250,9 +241,11 @@ async function isChanged(pathname, options) {
|
|
|
250
241
|
...options,
|
|
251
242
|
absolute: false
|
|
252
243
|
});
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
244
|
+
const fs = /* @__PURE__ */ getFs();
|
|
245
|
+
const path = /* @__PURE__ */ getPath();
|
|
246
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
247
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
248
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
256
249
|
return files.includes(relativePath);
|
|
257
250
|
}
|
|
258
251
|
function isChangedSync(pathname, options) {
|
|
@@ -261,9 +254,11 @@ function isChangedSync(pathname, options) {
|
|
|
261
254
|
...options,
|
|
262
255
|
absolute: false
|
|
263
256
|
});
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
const
|
|
257
|
+
const fs = /* @__PURE__ */ getFs();
|
|
258
|
+
const path = /* @__PURE__ */ getPath();
|
|
259
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
260
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
261
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
267
262
|
return files.includes(relativePath);
|
|
268
263
|
}
|
|
269
264
|
async function isUnstaged(pathname, options) {
|
|
@@ -272,9 +267,11 @@ async function isUnstaged(pathname, options) {
|
|
|
272
267
|
...options,
|
|
273
268
|
absolute: false
|
|
274
269
|
});
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const
|
|
270
|
+
const fs = /* @__PURE__ */ getFs();
|
|
271
|
+
const path = /* @__PURE__ */ getPath();
|
|
272
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
273
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
274
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
278
275
|
return files.includes(relativePath);
|
|
279
276
|
}
|
|
280
277
|
function isUnstagedSync(pathname, options) {
|
|
@@ -283,9 +280,11 @@ function isUnstagedSync(pathname, options) {
|
|
|
283
280
|
...options,
|
|
284
281
|
absolute: false
|
|
285
282
|
});
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
const
|
|
283
|
+
const fs = /* @__PURE__ */ getFs();
|
|
284
|
+
const path = /* @__PURE__ */ getPath();
|
|
285
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
286
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
287
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
289
288
|
return files.includes(relativePath);
|
|
290
289
|
}
|
|
291
290
|
async function isStaged(pathname, options) {
|
|
@@ -294,9 +293,11 @@ async function isStaged(pathname, options) {
|
|
|
294
293
|
...options,
|
|
295
294
|
absolute: false
|
|
296
295
|
});
|
|
297
|
-
const
|
|
298
|
-
const
|
|
299
|
-
const
|
|
296
|
+
const fs = /* @__PURE__ */ getFs();
|
|
297
|
+
const path = /* @__PURE__ */ getPath();
|
|
298
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
299
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
300
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
300
301
|
return files.includes(relativePath);
|
|
301
302
|
}
|
|
302
303
|
function isStagedSync(pathname, options) {
|
|
@@ -305,9 +306,11 @@ function isStagedSync(pathname, options) {
|
|
|
305
306
|
...options,
|
|
306
307
|
absolute: false
|
|
307
308
|
});
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
309
|
+
const fs = /* @__PURE__ */ getFs();
|
|
310
|
+
const path = /* @__PURE__ */ getPath();
|
|
311
|
+
const resolvedPathname = fs.realpathSync(pathname);
|
|
312
|
+
const baseCwd = options?.cwd ? fs.realpathSync(options["cwd"]) : getCwd();
|
|
313
|
+
const relativePath = (0, import_normalize.normalizePath)(path.relative(baseCwd, resolvedPathname));
|
|
311
314
|
return files.includes(relativePath);
|
|
312
315
|
}
|
|
313
316
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/http-request.js
CHANGED
|
@@ -31,14 +31,14 @@ let _https;
|
|
|
31
31
|
// @__NO_SIDE_EFFECTS__
|
|
32
32
|
function getHttp() {
|
|
33
33
|
if (_http === void 0) {
|
|
34
|
-
_http = require("
|
|
34
|
+
_http = require("http");
|
|
35
35
|
}
|
|
36
36
|
return _http;
|
|
37
37
|
}
|
|
38
38
|
// @__NO_SIDE_EFFECTS__
|
|
39
39
|
function getHttps() {
|
|
40
40
|
if (_https === void 0) {
|
|
41
|
-
_https = require("
|
|
41
|
+
_https = require("https");
|
|
42
42
|
}
|
|
43
43
|
return _https;
|
|
44
44
|
}
|
package/dist/json/edit.js
CHANGED
package/dist/json/format.js
CHANGED
|
@@ -98,7 +98,7 @@ function shouldSave(currentContent, originalContent, originalFileContent, option
|
|
|
98
98
|
const sortedContent = sortFn ? sortFn(content) : sort ? sortKeys(content) : content;
|
|
99
99
|
const origContent = originalContent ? stripFormattingSymbols(originalContent) : {};
|
|
100
100
|
if (ignoreWhitespace) {
|
|
101
|
-
const util = require("
|
|
101
|
+
const util = require("util");
|
|
102
102
|
return !util.isDeepStrictEqual(sortedContent, origContent);
|
|
103
103
|
}
|
|
104
104
|
const formatting = getFormattingFromContent(currentContent);
|
package/dist/logger.js
CHANGED
|
@@ -48,7 +48,7 @@ let _Console;
|
|
|
48
48
|
// @__NO_SIDE_EFFECTS__
|
|
49
49
|
function constructConsole(...args) {
|
|
50
50
|
if (_Console === void 0) {
|
|
51
|
-
const nodeConsole = require("
|
|
51
|
+
const nodeConsole = require("console");
|
|
52
52
|
_Console = nodeConsole.Console;
|
|
53
53
|
}
|
|
54
54
|
return ReflectConstruct(
|
package/dist/packages/edit.js
CHANGED
|
@@ -47,7 +47,7 @@ let _fs;
|
|
|
47
47
|
// @__NO_SIDE_EFFECTS__
|
|
48
48
|
function getFs() {
|
|
49
49
|
if (_fs === void 0) {
|
|
50
|
-
_fs = require("
|
|
50
|
+
_fs = require("fs");
|
|
51
51
|
}
|
|
52
52
|
return _fs;
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ let _path;
|
|
|
55
55
|
// @__NO_SIDE_EFFECTS__
|
|
56
56
|
function getPath() {
|
|
57
57
|
if (_path === void 0) {
|
|
58
|
-
_path = require("
|
|
58
|
+
_path = require("path");
|
|
59
59
|
}
|
|
60
60
|
return _path;
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ let _util;
|
|
|
63
63
|
// @__NO_SIDE_EFFECTS__
|
|
64
64
|
function getUtil() {
|
|
65
65
|
if (_util === void 0) {
|
|
66
|
-
_util = require("
|
|
66
|
+
_util = require("util");
|
|
67
67
|
}
|
|
68
68
|
return _util;
|
|
69
69
|
}
|
package/dist/paths/normalize.js
CHANGED
|
@@ -54,7 +54,7 @@ let _buffer;
|
|
|
54
54
|
// @__NO_SIDE_EFFECTS__
|
|
55
55
|
function getBuffer() {
|
|
56
56
|
if (_buffer === void 0) {
|
|
57
|
-
_buffer = require("
|
|
57
|
+
_buffer = require("buffer");
|
|
58
58
|
}
|
|
59
59
|
return _buffer;
|
|
60
60
|
}
|
|
@@ -62,7 +62,7 @@ let _url;
|
|
|
62
62
|
// @__NO_SIDE_EFFECTS__
|
|
63
63
|
function getUrl() {
|
|
64
64
|
if (_url === void 0) {
|
|
65
|
-
_url = require("
|
|
65
|
+
_url = require("url");
|
|
66
66
|
}
|
|
67
67
|
return _url;
|
|
68
68
|
}
|
|
@@ -351,7 +351,7 @@ function resolve(...segments) {
|
|
|
351
351
|
resolvedAbsolute = /* @__PURE__ */ isAbsolute(segment);
|
|
352
352
|
}
|
|
353
353
|
if (!resolvedAbsolute) {
|
|
354
|
-
const cwd = /* @__PURE__ */ require("
|
|
354
|
+
const cwd = /* @__PURE__ */ require("process").cwd();
|
|
355
355
|
resolvedPath = cwd + (resolvedPath.length === 0 ? "" : `/${resolvedPath}`);
|
|
356
356
|
}
|
|
357
357
|
return /* @__PURE__ */ normalizePath(resolvedPath);
|
package/dist/paths/packages.js
CHANGED