Skip to content

Commit

Permalink
Update JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
romaricpascal committed Sep 29, 2022
1 parent 9217683 commit fe227d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/govuk/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ export function normaliseDataset (dataset) {
}

/**
* Returns the value of the `lang` attribute closest to the given element (including itself)
* Returns the value of the given attribute closest to the given element (including itself)
*
* @param {HTMLElement} $element - The element to start walking the DOM tree up
* @param {String} attributeName - The name of the attribute
* @returns {String|undefined}
*/
export function closestAttributeValue ($element, attributeName) {
Expand Down
21 changes: 21 additions & 0 deletions src/govuk/components/character-count/character-count.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,27 @@ import I18n from '../../i18n.mjs'
* @param {Number} [config.threshold=0] - The percentage value of the limit at
* which point the count message is displayed. If this attribute is set, the
* count message will be hidden by default.
* @param {Object} [config.i18n]
* @param {String} [config.i18n.charactersUnderLimitOne="You have %{count} character remaining"]
* Message notifying users they're 1 character under the limit
* @param {String} [config.i18n.charactersUnderLimitOther="You have %{count} characters remaining"]
* Message notifying users they're any number of characters under the limit
* @param {String} [config.i18n.charactersAtLimit="You have no characters remaining"]
* Message notifying users they've reached the limit number of characters
* @param {String} [config.i18n.charactersOverLimitOne="You have %{count} character too many"]
* Message notifying users they're 1 character over the limit
* @param {String} [config.i18n.charactersOverLimitOther="You have %{count} characters too many"]
* Message notifying users they're any number of characters over the limit
* @param {String} [config.i18n.wordsUnderLimitOne="You have %{count} word remaining"]
* Message notifying users they're 1 word under the limit
* @param {String} [config.i18n.wordsUnderLimitOther="You have %{count} words remaining"]
* Message notifying users they're any number of words under the limit
* @param {String} [config.i18n.wordsAtLimit="You have no words remaining"]
* Message notifying users they've reached the limit number of words
* @param {String} [config.i18n.wordsOverLimitOne="You have %{count} word too many"]
* Message notifying users they're 1 word over the limit
* @param {String} [config.i18n.wordsOverLimitOther="You have %{count} words too many"]
* Message notifying users they're any number of words over the limit
*/
function CharacterCount ($module, config) {
if (!$module) {
Expand Down

0 comments on commit fe227d8

Please sign in to comment.