@rg-dev/stdlib 1.0.39 → 1.0.40
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/lib/node-env.cjs +6 -2
- package/lib/node-env.js +6 -2
- package/package.json +1 -1
package/lib/node-env.cjs
CHANGED
|
@@ -360,8 +360,12 @@ function createTempDir() {
|
|
|
360
360
|
return tempDirPath;
|
|
361
361
|
}
|
|
362
362
|
function createTempFilePath(ext) {
|
|
363
|
-
if (ext
|
|
364
|
-
|
|
363
|
+
if (typeof ext == "string") {
|
|
364
|
+
if (ext.startsWith(".")) {
|
|
365
|
+
ext = ext.slice(1);
|
|
366
|
+
}
|
|
367
|
+
} else {
|
|
368
|
+
ext = void 0;
|
|
365
369
|
}
|
|
366
370
|
const name = `temp_file_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2)}${ext ? `.${ext}` : ""}`;
|
|
367
371
|
const fullPath = import_path.default.join(import_os.default.tmpdir(), name);
|
package/lib/node-env.js
CHANGED
|
@@ -347,8 +347,12 @@ function createTempDir() {
|
|
|
347
347
|
return tempDirPath;
|
|
348
348
|
}
|
|
349
349
|
function createTempFilePath(ext) {
|
|
350
|
-
if (ext
|
|
351
|
-
|
|
350
|
+
if (typeof ext == "string") {
|
|
351
|
+
if (ext.startsWith(".")) {
|
|
352
|
+
ext = ext.slice(1);
|
|
353
|
+
}
|
|
354
|
+
} else {
|
|
355
|
+
ext = void 0;
|
|
352
356
|
}
|
|
353
357
|
const name = `temp_file_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2)}${ext ? `.${ext}` : ""}`;
|
|
354
358
|
const fullPath = path.join(os.tmpdir(), name);
|