Merge pull request #11160 from overleaf/msm-replace-uuid-crypto

Replace `uuid`/`node-uuid` with `node:crypto`

GitOrigin-RevId: 1be4f09c4681edac7e8bc58af3b5726d0d5ee322
This commit is contained in:
Miguel Serrano
2023-01-18 15:07:58 +00:00
committed by Copybot
parent ed9bd54836
commit 8b723c5363
11 changed files with 31 additions and 89 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const fs = require('fs')
const uuid = require('node-uuid')
const crypto = require('crypto')
const path = require('path')
const Stream = require('stream')
const { callbackify, promisify } = require('util')
@@ -49,7 +49,7 @@ async function deleteFile(fsPath) {
function _getPath(key) {
if (key == null) {
key = uuid.v1()
key = crypto.randomUUID()
}
key = key.replace(/\//g, '-')
return path.join(Settings.path.uploadFolder, key)