diff --git a/api/components/_.mjs b/api/components/_.mjs index a12c864..33cccb5 100644 --- a/api/components/_.mjs +++ b/api/components/_.mjs @@ -28,7 +28,7 @@ export { feather } from './feather.mjs'; /** * adds a view to the enhancer's side panel - * @param {object} panel- information used to construct and render the panel + * @param {object} panel - information used to construct and render the panel * @param {string} panel.id - a uuid, used to restore the last open view on reload * @param {string} panel.icon - an svg string * @param {string} panel.title - the name of the view diff --git a/api/components/panel.mjs b/api/components/panel.mjs index 6b9b745..e90c5ab 100644 --- a/api/components/panel.mjs +++ b/api/components/panel.mjs @@ -222,7 +222,7 @@ web.loadStylesheet('api/components/panel.css'); /** * adds a view to the enhancer's side panel - * @param {object} panel- information used to construct and render the panel + * @param {object} panel - information used to construct and render the panel * @param {string} panel.id - a uuid, used to restore the last open view on reload * @param {string} panel.icon - an svg string * @param {string} panel.title - the name of the view diff --git a/api/fmt.mjs b/api/fmt.mjs index 1d6204a..8d8b193 100644 --- a/api/fmt.mjs +++ b/api/fmt.mjs @@ -86,12 +86,12 @@ export const slugger = (heading, slugs = new Set()) => { * (from https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid) * @returns {string} a uuidv4 */ -export const uuidv4 = () => - crypto?.randomUUID - ? crypto.randomUUID() - : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => - (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16) - ); +export const uuidv4 = () => { + if (crypto?.randomUUID) return crypto.randomUUID(); + return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => + (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16) + ); +}; const patterns = { alphanumeric: /^[\w\.-]+$/,