@lwrjs/shared-utils 0.23.7 → 0.23.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/serialize.cjs +7 -7
- package/build/es/serialize.js +8 -7
- package/package.json +4 -4
package/build/cjs/serialize.cjs
CHANGED
|
@@ -100,11 +100,11 @@ function shortestTtl(newTtl, oldTtl, maxTtl) {
|
|
|
100
100
|
return shortest;
|
|
101
101
|
}
|
|
102
102
|
function createMetaTags(meta) {
|
|
103
|
-
return meta.reduce((metaStr, {name, content, httpEquiv}) => {
|
|
104
|
-
if (!name && !content && !httpEquiv)
|
|
103
|
+
return meta.reduce((metaStr, {name, content, httpEquiv, property, itemprop}) => {
|
|
104
|
+
if (!name && !content && !httpEquiv && !property && !itemprop)
|
|
105
105
|
return metaStr;
|
|
106
|
-
const nameStr = name ? ` name="${name}"` : "", httpEquivStr = httpEquiv ? ` http-equiv="${httpEquiv}"` : "", contentStr = content ? ` content="${content}"` : "";
|
|
107
|
-
return metaStr + `<meta${nameStr}${httpEquivStr}${contentStr}>
|
|
106
|
+
const nameStr = name ? ` name="${name}"` : "", httpEquivStr = httpEquiv ? ` http-equiv="${httpEquiv}"` : "", propertyStr = property ? ` property="${property}"` : "", itempropStr = itemprop ? ` itemprop="${itemprop}"` : "", contentStr = content ? ` content="${content}"` : "";
|
|
107
|
+
return metaStr + `<meta${nameStr}${httpEquivStr}${propertyStr}${itempropStr}${contentStr}>
|
|
108
108
|
`;
|
|
109
109
|
}, "");
|
|
110
110
|
}
|
|
@@ -113,9 +113,9 @@ function createScriptTags(scripts) {
|
|
|
113
113
|
`, "");
|
|
114
114
|
}
|
|
115
115
|
function createLinkTags(links) {
|
|
116
|
-
return links.reduce((linkStr, {href, rel, as, fetchpriority}) => {
|
|
117
|
-
const relStr = rel ? ` rel="${rel}"` : "", asStr = as ? ` as="${as}"` : "", fetchStr = fetchpriority ? ` fetchpriority="${fetchpriority}"` : "";
|
|
118
|
-
return linkStr + `<link href="${href}"${relStr}${asStr}${fetchStr}>
|
|
116
|
+
return links.reduce((linkStr, {href, rel, as, fetchpriority, type, sizes, hreflang, media, crossorigin}) => {
|
|
117
|
+
const relStr = rel ? ` rel="${rel}"` : "", asStr = as ? ` as="${as}"` : "", fetchStr = fetchpriority ? ` fetchpriority="${fetchpriority}"` : "", typeStr = type ? ` type="${type}"` : "", sizesStr = sizes ? ` sizes="${sizes}"` : "", hreflangStr = hreflang ? ` hreflang="${hreflang}"` : "", mediaStr = media ? ` media="${media}"` : "", crossoriginStr = crossorigin ? ` crossorigin="${crossorigin}"` : "";
|
|
118
|
+
return linkStr + `<link href="${href}"${relStr}${asStr}${fetchStr}${typeStr}${sizesStr}${hreflangStr}${mediaStr}${crossoriginStr}>
|
|
119
119
|
`;
|
|
120
120
|
}, "");
|
|
121
121
|
}
|
package/build/es/serialize.js
CHANGED
|
@@ -110,20 +110,21 @@ export function shortestTtl(newTtl, oldTtl, maxTtl) {
|
|
|
110
110
|
}
|
|
111
111
|
/** HEAD MARKUP UTILS */
|
|
112
112
|
function createMetaTags(meta) {
|
|
113
|
-
return meta.reduce((metaStr, { name, content, httpEquiv }) => {
|
|
114
|
-
if (!name && !content && !httpEquiv)
|
|
113
|
+
return meta.reduce((metaStr, { name, content, httpEquiv, property, itemprop }) => {
|
|
114
|
+
if (!name && !content && !httpEquiv && !property && !itemprop)
|
|
115
115
|
return metaStr; // do not create empty <meta> tags
|
|
116
|
-
const nameStr = name ? ` name="${name}"` : '', httpEquivStr = httpEquiv ? ` http-equiv="${httpEquiv}"` : '', contentStr = content ? ` content="${content}"` : '';
|
|
117
|
-
return metaStr + `<meta${nameStr}${httpEquivStr}${contentStr}>\n`;
|
|
116
|
+
const nameStr = name ? ` name="${name}"` : '', httpEquivStr = httpEquiv ? ` http-equiv="${httpEquiv}"` : '', propertyStr = property ? ` property="${property}"` : '', itempropStr = itemprop ? ` itemprop="${itemprop}"` : '', contentStr = content ? ` content="${content}"` : '';
|
|
117
|
+
return metaStr + `<meta${nameStr}${httpEquivStr}${propertyStr}${itempropStr}${contentStr}>\n`;
|
|
118
118
|
}, '');
|
|
119
119
|
}
|
|
120
120
|
function createScriptTags(scripts) {
|
|
121
121
|
return scripts.reduce((scriptStr, { body }) => scriptStr + `<script type="application/ld+json">${body}</script>\n`, '');
|
|
122
122
|
}
|
|
123
123
|
function createLinkTags(links) {
|
|
124
|
-
return links.reduce((linkStr, { href, rel, as, fetchpriority }) => {
|
|
125
|
-
const relStr = rel ? ` rel="${rel}"` : '', asStr = as ? ` as="${as}"` : '', fetchStr = fetchpriority ? ` fetchpriority="${fetchpriority}"` : '';
|
|
126
|
-
return linkStr +
|
|
124
|
+
return links.reduce((linkStr, { href, rel, as, fetchpriority, type, sizes, hreflang, media, crossorigin }) => {
|
|
125
|
+
const relStr = rel ? ` rel="${rel}"` : '', asStr = as ? ` as="${as}"` : '', fetchStr = fetchpriority ? ` fetchpriority="${fetchpriority}"` : '', typeStr = type ? ` type="${type}"` : '', sizesStr = sizes ? ` sizes="${sizes}"` : '', hreflangStr = hreflang ? ` hreflang="${hreflang}"` : '', mediaStr = media ? ` media="${media}"` : '', crossoriginStr = crossorigin ? ` crossorigin="${crossorigin}"` : '';
|
|
126
|
+
return (linkStr +
|
|
127
|
+
`<link href="${href}"${relStr}${asStr}${fetchStr}${typeStr}${sizesStr}${hreflangStr}${mediaStr}${crossoriginStr}>\n`);
|
|
127
128
|
}, '');
|
|
128
129
|
}
|
|
129
130
|
function createStyleTags(styles) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.23.
|
|
7
|
+
"version": "0.23.12",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build/**/*.d.ts"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lwrjs/diagnostics": "0.23.
|
|
40
|
+
"@lwrjs/diagnostics": "0.23.12",
|
|
41
41
|
"es-module-lexer": "^1.5.4",
|
|
42
42
|
"fast-json-stable-stringify": "^2.1.0",
|
|
43
43
|
"magic-string": "^0.30.9",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"slugify": "^1.4.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@lwrjs/types": "0.23.
|
|
53
|
+
"@lwrjs/types": "0.23.12",
|
|
54
54
|
"@types/mime-types": "2.1.4",
|
|
55
55
|
"@types/path-to-regexp": "^1.7.0",
|
|
56
56
|
"memfs": "^4.13.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=22.0.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "2fecd6399343d99872e9ab93e2ec362788c10dae"
|
|
62
62
|
}
|