From e6f86fa203edb399d688285338440c952addaa8a Mon Sep 17 00:00:00 2001 From: Hayden Young Date: Sat, 24 Jun 2023 16:18:46 +0100 Subject: [PATCH] docs: Do not document utils. They are not exposed externally. --- src/utils/create-id.js | 7 ------- src/utils/ensure-ac-address.js | 7 ------- src/utils/index.js | 5 ----- src/utils/path-join.js | 23 ----------------------- 4 files changed, 42 deletions(-) diff --git a/src/utils/create-id.js b/src/utils/create-id.js index a1e2bed..b48b296 100644 --- a/src/utils/create-id.js +++ b/src/utils/create-id.js @@ -1,10 +1,3 @@ -/** - * Creates an id from an alphanumeric character list. - * @param {number} [length=32] The length of the id. - * @return {string} An id. - * @see {@link https://stackoverflow.com/questions/1349404/generate-random-string-characters-in-javascript} - * @memberof module:Utils - */ const createId = async (length = 32) => { const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' let result = '' diff --git a/src/utils/ensure-ac-address.js b/src/utils/ensure-ac-address.js index fe39bf1..6602a48 100644 --- a/src/utils/ensure-ac-address.js +++ b/src/utils/ensure-ac-address.js @@ -1,12 +1,5 @@ import pathJoin from './path-join.js' -/** - * Checks that the given address has '/_access' as the last part. - * @function - * @param {string} address The address to check. - * @return {string} The address appended with /_access. - * @memberof module:Utils - */ export default address => { const suffix = address.toString().split('/').pop() return suffix === '_access' diff --git a/src/utils/index.js b/src/utils/index.js index 6bf4cb5..a6ac16f 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,8 +1,3 @@ -/** - * Various utility functions. - * @module Utils - */ - import createId from './create-id.js' export { diff --git a/src/utils/path-join.js b/src/utils/path-join.js index 704b696..880cc21 100644 --- a/src/utils/path-join.js +++ b/src/utils/path-join.js @@ -1,35 +1,12 @@ -/** - * A posix-compatible verions of join. - * @function posixJoin - * @param {...string} paths or more strings to join. - * @return {string} The joined strings. - * @memberof module:Utils - */ export const posixJoin = (...paths) => paths .join('/') .replace(/((?<=\/)\/+)|(^\.\/)|((?<=\/)\.\/)/g, '') || '.' -/** - * A windows-compatible verions of join. - * @function win32Join - * @param {...string} One or more strings to join. - * @return {string} The joined strings. - * @memberof module:Utils - */ export const win32Join = (...paths) => paths .join('\\') .replace(/\//g, '\\') .replace(/((?<=\\)\\+)|(^\.\\)|((?<=\\)\.\\)/g, '') || '.' -/** - * An alias for posixJoin. - * @function join - * @alias posixJoin - * @param {...string} paths or more strings to join. - * @return {string} The joined strings. - * @memberof module:Utils - * @static - */ export const join = posixJoin export default posixJoin