Skip to content

Commit

Permalink
Minor: use @internal JSDoc tag where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Mar 29, 2024
1 parent c843604 commit a5622d2
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion humanize-duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

/**
* @internal
* @typedef {[string, string, string, string, string, string, string, string, string, string]} DigitReplacements
*/

Expand Down Expand Up @@ -61,6 +62,7 @@
*/

/**
* @internal
* @typedef {Required<Options>} NormalizedOptions
*/

Expand Down Expand Up @@ -97,7 +99,10 @@
","
);

/** @type {Record<string, Language>} */
/**
* @internal
* @type {Record<string, Language>}
*/
var LANGUAGES = {
af: language(
"jaar",
Expand Down Expand Up @@ -1422,6 +1427,7 @@
/**
* Helper function for creating language definitions.
*
* @internal
* @param {Unit} y
* @param {Unit} mo
* @param {Unit} w
Expand All @@ -1445,6 +1451,7 @@
/**
* Helper function for Arabic.
*
* @internal
* @param {number} c
* @returns {0 | 1 | 2}
*/
Expand All @@ -1461,6 +1468,7 @@
/**
* Helper function for Polish.
*
* @internal
* @param {number} c
* @returns {0 | 1 | 2 | 3}
*/
Expand All @@ -1480,6 +1488,7 @@
/**
* Helper function for Slavic languages.
*
* @internal
* @param {number} c
* @returns {0 | 1 | 2 | 3}
*/
Expand All @@ -1506,6 +1515,7 @@
/**
* Helper function for Czech or Slovak.
*
* @internal
* @param {number} c
* @returns {0 | 1 | 2 | 3}
*/
Expand All @@ -1525,6 +1535,7 @@
/**
* Helper function for Lithuanian.
*
* @internal
* @param {number} c
* @returns {0 | 1 | 2}
*/
Expand All @@ -1545,6 +1556,7 @@
/**
* Helper function for Latvian.
*
* @internal
* @param {number} c
* @returns {boolean}
*/
Expand All @@ -1555,6 +1567,7 @@
/**
* `Object.assign` for legacy environments. Difficult to make type-check.
*
* @internal
* @param {...any} destination
*/
function assign(destination) {
Expand All @@ -1580,6 +1593,7 @@
};

/**
* @internal
* @template T
* @param {T} obj
* @param {keyof T} key
Expand All @@ -1590,6 +1604,7 @@
}

/**
* @internal
* @param {Pick<Required<Options>, "language" | "fallbacks" | "languages">} options
* @throws {Error} Throws an error if language is not found.
* @returns {Language}
Expand Down Expand Up @@ -1619,6 +1634,7 @@
}

/**
* @internal
* @param {Piece} piece
* @param {Language} language
* @param {Pick<Required<Options>, "decimal" | "spacer" | "maxDecimalPoints" | "digitReplacements">} options
Expand Down Expand Up @@ -1686,12 +1702,14 @@
}

/**
* @internal
* @typedef {Object} Piece
* @prop {UnitName} unitName
* @prop {number} unitCount
*/

/**
* @internal
* @param {number} ms
* @param {Pick<Required<Options>, "units" | "unitMeasures" | "largest" | "round">} options
* @returns {Piece[]}
Expand Down Expand Up @@ -1804,6 +1822,7 @@
}

/**
* @internal
* @param {Piece[]} pieces
* @param {Pick<Required<Options>, "units" | "language" | "languages" | "fallbacks" | "delimiter" | "spacer" | "decimal" | "conjunction" | "maxDecimalPoints" | "serialComma" | "digitReplacements">} options
* @returns {string}
Expand Down

0 comments on commit a5622d2

Please sign in to comment.