Socket
Socket
Sign inDemoInstall

atomically

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

5

dist/utils/temp.js
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const crypto = require("crypto");
const path = require("path");

@@ -13,5 +12,5 @@ const consts_1 = require("../consts");

create: (filePath) => {
const hash = crypto.randomBytes(3).toString('hex'), // 6 random hex characters
const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6), // 6 random-enough hex characters
timestamp = Date.now().toString().slice(-10), // 10 precise timestamp digits
prefix = 'tmp-', suffix = `.${prefix}${timestamp}${hash}`, tempPath = `${filePath}${suffix}`;
prefix = 'tmp-', suffix = `.${prefix}${timestamp}${randomness}`, tempPath = `${filePath}${suffix}`;
return tempPath;

@@ -18,0 +17,0 @@ },

2

package.json
{
"name": "atomically",
"description": "Read and write files atomically and reliably.",
"version": "1.3.0",
"version": "1.3.1",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "types": "dist/index.d.ts",

/* IMPORT */
import * as crypto from 'crypto';
import * as path from 'path';

@@ -20,6 +19,6 @@ import {LIMIT_BASENAME_LENGTH} from '../consts';

const hash = crypto.randomBytes ( 3 ).toString ( 'hex' ), // 6 random hex characters
const randomness = `000000${Math.floor ( Math.random () * 16777215 ).toString ( 16 )}`.slice ( -6 ), // 6 random-enough hex characters
timestamp = Date.now ().toString ().slice ( -10 ), // 10 precise timestamp digits
prefix = 'tmp-',
suffix = `.${prefix}${timestamp}${hash}`,
suffix = `.${prefix}${timestamp}${randomness}`,
tempPath = `${filePath}${suffix}`;

@@ -26,0 +25,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc