Skip to content

Commit

Permalink
refact: remove uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
frytg committed Dec 27, 2023
1 parent 4ff2610 commit 4ec9e72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"aws-sdk": "2.1520.0",
"luxon": "3.4.4",
"node-crc": "swrlab/node-crc#v2.1.0",
"undici": "6.0.1",
"uuid": "9.0.1"
"undici": "6.0.1"
},
"devDependencies": {
"@swrlab/eslint-plugin-swr": "^0.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/storage-wrapper/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// load node utils
const os = require('os')
const pathUtil = require('path')
const { v4: uuidv4 } = require('uuid')
const { randomUUID } = require('crypto')

const saveLocalFile = (that, uri, buffer) =>
new Promise((resolve, reject) => {
Expand Down Expand Up @@ -59,7 +59,7 @@ module.exports = async function (uri, buffer, logPrefix, resumable) {
path = structure.join('/')

// save to local file
const tempFilePath = pathUtil.resolve(os.tmpdir(), uuidv4())
const tempFilePath = pathUtil.resolve(os.tmpdir(), randomUUID())
await saveLocalFile(this, tempFilePath, buffer)

// log progress
Expand Down
17 changes: 8 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ __metadata:
node-crc: "swrlab/node-crc#v2.1.0"
prettier: "npm:^3.1.1"
undici: "npm:6.0.1"
uuid: "npm:9.0.1"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -4406,21 +4405,21 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:9.0.1, uuid@npm:^9.0.0":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
"uuid@npm:^8.0.0":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
bin:
uuid: dist/bin/uuid
checksum: 1607dd32ac7fc22f2d8f77051e6a64845c9bce5cd3dd8aa0070c074ec73e666a1f63c7b4e0f4bf2bc8b9d59dc85a15e17807446d9d2b17c8485fbc2147b27f9b
checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
languageName: node
linkType: hard

"uuid@npm:^8.0.0":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
"uuid@npm:^9.0.0":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
bin:
uuid: dist/bin/uuid
checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
checksum: 1607dd32ac7fc22f2d8f77051e6a64845c9bce5cd3dd8aa0070c074ec73e666a1f63c7b4e0f4bf2bc8b9d59dc85a15e17807446d9d2b17c8485fbc2147b27f9b
languageName: node
linkType: hard

Expand Down

0 comments on commit 4ec9e72

Please sign in to comment.