replace uuid with node:crypto (#4369)
This commit is contained in:
parent
af99bda161
commit
9a4ec79b8c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue