From edf7423da2adb4b8c59f5a1c8c4cd69a4ed7c941 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Fri, 23 Jun 2023 11:57:42 +0200 Subject: [PATCH] [random] explicitly state uuidv4 return type - fixes #68 --- random.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/random.js b/random.js index ed8e2c4..1df672f 100644 --- a/random.js +++ b/random.js @@ -29,6 +29,10 @@ export const oneOf = arr => arr[math.floor(rand() * arr.length)] // @ts-ignore const uuidv4Template = [1e7] + -1e3 + -4e3 + -8e3 + -1e11 + +/** + * @return {string} + */ export const uuidv4 = () => uuidv4Template.replace(/[018]/g, /** @param {number} c */ c => (c ^ uint32() & 15 >> c / 4).toString(16) )