From 9a4ec79b8cd6752b5b4725a50284cdec279270fc Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Sat, 28 Dec 2024 22:13:04 +0100 Subject: [PATCH] replace uuid with node:crypto (#4369) --- lib/support/messageMaker.js | 4 ++-- npm-shrinkwrap.json | 13 ------------- package.json | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/support/messageMaker.js b/lib/support/messageMaker.js index 09c386c215..03e2656d45 100644 --- a/lib/support/messageMaker.js +++ b/lib/support/messageMaker.js @@ -1,12 +1,12 @@ import dayjs from 'dayjs'; import merge from 'lodash.merge'; -import { v4 as makeUuid } from 'uuid'; +import { randomUUID } from 'node:crypto'; export function messageMaker(source) { return { make(type, data, extras) { const timestamp = dayjs().format(); - const uuid = makeUuid(); + const uuid = randomUUID(); return merge({ uuid, type, timestamp, source, data }, extras); } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9f16419072..dfcf269853 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -54,7 +54,6 @@ "simplecrawler": "1.1.9", "tape": "5.8.1", "text-table": "0.2.0", - "uuid": "10.0.0", "yargs": "17.7.2" }, "bin": { @@ -11297,18 +11296,6 @@ "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", "dev": true }, - "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", diff --git a/package.json b/package.json index c97232f5ed..6feaf6dede 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,6 @@ "@sitespeed.io/plugin": "0.0.6", "tape": "5.8.1", "text-table": "0.2.0", - "uuid": "10.0.0", "yargs": "17.7.2" }, "overrides": {