Skip to content

Commit d1cd563

Browse files
committed
perf: replace node module uuid in favor of internal library crypto
Using the external library `uuid` means that the file `stringify` cannot be included is electron based releases that use the toasted notifier package. Use built in node crypto module as to bypass the need for `stringigy.js`
1 parent a9eec31 commit d1cd563

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

notifiers/toaster.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
const path = require('path');
55
const notifier = path.resolve(__dirname, '../vendor/ntfyToast/ntfytoast');
66
const utils = require('../lib/utils');
7+
const crypto = require('crypto');
78
const Balloon = require('./balloon');
89
// const os = require('os');
910

@@ -50,7 +51,8 @@ function parseResult(data) {
5051

5152
function getPipeName() {
5253
const pathPrefix = utils.isWSL() ? PIPE_PATH_PREFIX_WSL : PIPE_PATH_PREFIX;
53-
return `${pathPrefix}${PIPE_NAME}-${uuid()}`;
54+
const uuid = crypto.randomUUID();
55+
return `${pathPrefix}${PIPE_NAME}-${uuid}`;
5456
}
5557

5658
function notifyRaw(options, callback) {

0 commit comments

Comments
 (0)