Skip to content

Commit

Permalink
refactor: use crypto.randomUUID instead of uuid (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Sep 8, 2023
1 parent 460c3a0 commit 4c05ddd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/temp-directory.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { promisify } from 'util';
import { join } from 'path';
import { promises as fs } from 'fs';
import { randomUUID } from 'crypto';

import rimrafLib from 'rimraf';
import { v4 as uuid } from 'uuid';
import osenv from 'osenv';

const rimraf = promisify(rimrafLib);

export async function create(context) {
if (context.options && context.options.tmpDir) {
context.path = join(context.options.tmpDir, uuid());
context.path = join(context.options.tmpDir, randomUUID());
} else {
context.path = join(osenv.tmpdir(), uuid());
context.path = join(osenv.tmpdir(), randomUUID());
}
context.emit(
'data',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"tar": "^6.1.11",
"uid-number": "0.0.6",
"undici": "^5.5.1",
"uuid": "^8.3.2",
"which": "^2.0.2",
"winston": "^3.3.3",
"xml-sanitizer": "^1.1.11",
Expand Down

0 comments on commit 4c05ddd

Please sign in to comment.