docs: Do not document utils. They are not exposed externally.

This commit is contained in:
Hayden Young
2023-06-24 16:18:46 +01:00
parent 24a2e1ae5f
commit e6f86fa203
4 changed files with 0 additions and 42 deletions

View File

@@ -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 = ''

View File

@@ -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'

View File

@@ -1,8 +1,3 @@
/**
* Various utility functions.
* @module Utils
*/
import createId from './create-id.js'
export {

View File

@@ -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