Sha256: 743709b9d98e834573b3be6d5c28843a37b839c53481896bee488549b02f6eda

Contents?: true

Size: 1.04 KB

Versions: 53

Compression:

Stored size: 1.04 KB

Contents

{"version":3,"file":"closest-attribute-value.mjs","sources":["../../../src/govuk/common/closest-attribute-value.mjs"],"sourcesContent":["/**\n * Returns the value of the given attribute closest to the given element (including itself)\n *\n * @internal\n * @param {Element} $element - The element to start walking the DOM tree up\n * @param {string} attributeName - The name of the attribute\n * @returns {string | null} Attribute value\n */\nexport function closestAttributeValue($element, attributeName) {\n  const $closestElementWithAttribute = $element.closest(`[${attributeName}]`)\n  return $closestElementWithAttribute\n    ? $closestElementWithAttribute.getAttribute(attributeName)\n    : null\n}\n"],"names":["closestAttributeValue","$element","attributeName","$closestElementWithAttribute","closest","getAttribute"],"mappings":"AAQO,SAASA,qBAAqBA,CAACC,QAAQ,EAAEC,aAAa,EAAE;EAC7D,MAAMC,4BAA4B,GAAGF,QAAQ,CAACG,OAAO,CAAC,CAAA,CAAA,EAAIF,aAAa,CAAA,CAAA,CAAG,CAAC,CAAA;EAC3E,OAAOC,4BAA4B,GAC/BA,4BAA4B,CAACE,YAAY,CAACH,aAAa,CAAC,GACxD,IAAI,CAAA;AACV;;;;"}

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-51.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-50.0.1 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-50.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-49.1.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-49.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-48.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-47.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.4.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.3.1 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.3.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.2.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.1.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-46.0.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.10.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.9.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.8.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.7.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.6.1 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map
govuk_publishing_components-45.6.0 node_modules/govuk-frontend/dist/govuk/common/closest-attribute-value.mjs.map