From f4e6cb76c19cc2da1c683fd3623d97f351701b2b Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 22 Feb 2021 15:34:42 -0400 Subject: [PATCH] gun uuid utility --- utils/index.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/utils/index.js b/utils/index.js index 90e80eee..516d762a 100644 --- a/utils/index.js +++ b/utils/index.js @@ -1,9 +1,21 @@ /** * @format */ +const Gun = require('gun') const { asyncFilter } = require('./helpers') -module.exports = { - asyncFilter +/** + * @returns {string} + */ +const gunUUID = () => { + // @ts-expect-error Not typed + const uuid = Gun.Text.random() + + return uuid +} + +module.exports = { + asyncFilter, + gunUUID }