@rg-dev/stdlib 1.0.36 → 1.0.37

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 CHANGED
@@ -360,14 +360,13 @@ function createTempDir() {
360
360
  return tempDirPath;
361
361
  }
362
362
  function createTempFilePath() {
363
- const tmpDir = import_os.default.tmpdir();
364
- const timestamp = Date.now();
365
- const p = import_path.default.join(tmpDir, `temp_file_${timestamp}`);
363
+ const name = `temp_file_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2)}`;
364
+ const fullPath = import_path.default.join(import_os.default.tmpdir(), name);
366
365
  return {
367
- getName: () => p,
366
+ getName: () => fullPath,
368
367
  cleanUp: () => {
369
368
  try {
370
- fs.unlinkSync(p);
369
+ fs.unlinkSync(fullPath);
371
370
  } catch (e) {
372
371
  }
373
372
  }
package/lib/node-env.js CHANGED
@@ -347,14 +347,13 @@ function createTempDir() {
347
347
  return tempDirPath;
348
348
  }
349
349
  function createTempFilePath() {
350
- const tmpDir = os.tmpdir();
351
- const timestamp = Date.now();
352
- const p = path.join(tmpDir, `temp_file_${timestamp}`);
350
+ const name = `temp_file_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2)}`;
351
+ const fullPath = path.join(os.tmpdir(), name);
353
352
  return {
354
- getName: () => p,
353
+ getName: () => fullPath,
355
354
  cleanUp: () => {
356
355
  try {
357
- fs.unlinkSync(p);
356
+ fs.unlinkSync(fullPath);
358
357
  } catch (e) {
359
358
  }
360
359
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rg-dev/stdlib",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",