diff --git a/src/govuk/common/closest-attribute-value.mjs b/src/govuk/common/closest-attribute-value.mjs index 3896784b25..36b57367bf 100644 --- a/src/govuk/common/closest-attribute-value.mjs +++ b/src/govuk/common/closest-attribute-value.mjs @@ -3,6 +3,7 @@ import '../vendor/polyfills/Element/prototype/closest.mjs' /** * Returns the value of the given attribute closest to the given element (including itself) * + * @deprecated Will be made private in v5.0 * @param {Element} $element - The element to start walking the DOM tree up * @param {string} attributeName - The name of the attribute * @returns {string | null} Attribute value diff --git a/src/govuk/common/index.mjs b/src/govuk/common/index.mjs index 0b5c59ea84..c4dfd3e61f 100644 --- a/src/govuk/common/index.mjs +++ b/src/govuk/common/index.mjs @@ -13,6 +13,7 @@ * This seems to fail in IE8, requires more investigation. * See: https://github.com/imagitama/nodelist-foreach-polyfill * + * @deprecated Will be made private in v5.0 * @template {Node} ElementType * @param {NodeListOf} nodes - NodeList from querySelectorAll() * @param {nodeListIterator} callback - Callback function to run for each node @@ -32,6 +33,7 @@ export function nodeListForEach (nodes, callback) { * without them conflicting with each other. * https://stackoverflow.com/a/8809472 * + * @deprecated Will be made private in v5.0 * @returns {string} Unique ID */ export function generateUniqueID () { @@ -53,6 +55,7 @@ export function generateUniqueID () { * (e.g. {'i18n.showSection': 'Show section'}) and combines them together, with * greatest priority on the LAST item passed in. * + * @deprecated Will be made private in v5.0 * @returns {Object} A flattened object of key-value pairs. */ export function mergeConfigs (/* configObject1, configObject2, ...configObjects */) { @@ -126,6 +129,7 @@ export function mergeConfigs (/* configObject1, configObject2, ...configObjects * Extracts keys starting with a particular namespace from a flattened config * object, removing the namespace in the process. * + * @deprecated Will be made private in v5.0 * @param {Object} configObject - The object to extract key-value pairs from. * @param {string} namespace - The namespace to filter keys with. * @returns {Object} Flattened object with dot-separated key namespace removed diff --git a/src/govuk/common/normalise-dataset.mjs b/src/govuk/common/normalise-dataset.mjs index ebbf121235..d648fb5465 100644 --- a/src/govuk/common/normalise-dataset.mjs +++ b/src/govuk/common/normalise-dataset.mjs @@ -14,6 +14,7 @@ import '../vendor/polyfills/String/prototype/trim.mjs' * Designed to be used to convert config passed via data attributes (which are * always strings) into something sensible. * + * @deprecated Will be made private in v5.0 * @param {string} value - The value to normalise * @returns {string | boolean | number | undefined} Normalised data */ @@ -46,6 +47,7 @@ export function normaliseString (value) { * * Loop over an object and normalise each value using normaliseData function * + * @deprecated Will be made private in v5.0 * @param {DOMStringMap} dataset - HTML element dataset * @returns {Object} Normalised dataset */