Skip to content

Commit

Permalink
chore(release): 1.3.0 [skip ci]
Browse files Browse the repository at this point in the history
# [1.3.0](v1.2.1...v1.3.0) (2023-09-27)

### Features

* enable getMetadata to query any document ([#17](#17)) ([a7a5111](a7a5111))
  • Loading branch information
semantic-release-bot committed Sep 27, 2023
1 parent a7a5111 commit cc08a79
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [1.3.0](https://github.com/adobe/aem-lib/compare/v1.2.1...v1.3.0) (2023-09-27)


### Features

* enable getMetadata to query any document ([#17](https://github.com/adobe/aem-lib/issues/17)) ([a7a5111](https://github.com/adobe/aem-lib/commit/a7a511137178eecf2e56a942f0d022cef8b1314e))

## [1.2.1](https://github.com/adobe/aem-lib/compare/v1.2.0...v1.2.1) (2023-09-27)


Expand Down
5 changes: 3 additions & 2 deletions dist/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,12 @@ async function loadScript(src, attrs) {
/**
* Retrieves the content of metadata tags.
* @param {string} name The metadata name (or property)
* @param {Document} doc Document object to query for metadata. Defaults to the window's document
* @returns {string} The metadata value(s)
*/
function getMetadata(name) {
function getMetadata(name, doc = document) {
const attr = name && name.includes(':') ? 'property' : 'name';
const meta = [...document.head.querySelectorAll(`meta[${attr}="${name}"]`)]
const meta = [...doc.head.querySelectorAll(`meta[${attr}="${name}"]`)]
.map((m) => m.content)
.join(', ');
return meta || '';
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@adobe/aem-lib",
"private": true,
"version": "1.2.1",
"version": "1.3.0",
"description": "AEM Library",
"type": "module",
"scripts": {
Expand Down

0 comments on commit cc08a79

Please sign in to comment.