@vueuse/head
Advanced tools
Comparing version 1.0.0-rc.10 to 1.0.0-rc.11
@@ -57,26 +57,2 @@ "use strict"; | ||
// src/encoding/index.ts | ||
var escapeHtml = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">"); | ||
var escapeJS = (s) => s.replace(/["'\\\n\r\u2028\u2029]/g, (character) => { | ||
switch (character) { | ||
case '"': | ||
case "'": | ||
case "\\": | ||
return `\\${character}`; | ||
case "\n": | ||
return "\\n"; | ||
case "\r": | ||
return "\\r"; | ||
case "\u2028": | ||
return "\\u2028"; | ||
case "\u2029": | ||
return "\\u2029"; | ||
} | ||
return character; | ||
}); | ||
var sanitiseAttrName = (str) => str.replace(/[\s"'><\/=]/g, "").replace(/[^a-zA-Z0-9_-]/g, ""); | ||
var sanitiseAttrValue = (str) => escapeJS( | ||
str.replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">") | ||
); | ||
// src/ssr/index.ts | ||
@@ -122,13 +98,10 @@ var propsToString = (props) => { | ||
tag.options.beforeTagRender(tag); | ||
if (tag.tag === "title") { | ||
if (tag.tag === "title") | ||
titleHtml = tagToString(tag); | ||
} else if (tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs") { | ||
for (const k in tag.props) { | ||
attrs[tag.tag][sanitiseAttrName(k)] = sanitiseAttrValue(tag.props[k]); | ||
} | ||
} else if ((_b = tag.options) == null ? void 0 : _b.body) { | ||
else if (tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs") | ||
attrs[tag.tag] = { ...attrs[tag.tag], ...tag.props }; | ||
else if ((_b = tag.options) == null ? void 0 : _b.body) | ||
bodyHtml.push(tagToString(tag)); | ||
} else { | ||
else | ||
headHtml.push(tagToString(tag)); | ||
} | ||
} | ||
@@ -374,4 +347,5 @@ headHtml.push(`<meta name="${HEAD_COUNT_KEY}" content="${headHtml.length}">`); | ||
Object.entries(tag.props).forEach(([k, v]) => { | ||
if (v !== false) | ||
$el.setAttribute(k, v); | ||
if (v !== false) { | ||
$el.setAttribute(k, v === true ? "" : String(v)); | ||
} | ||
}); | ||
@@ -502,2 +476,26 @@ if (tag.children) { | ||
// src/encoding/index.ts | ||
var escapeHtml = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">"); | ||
var escapeJS = (s) => s.replace(/["'\\\n\r\u2028\u2029]/g, (character) => { | ||
switch (character) { | ||
case '"': | ||
case "'": | ||
case "\\": | ||
return `\\${character}`; | ||
case "\n": | ||
return "\\n"; | ||
case "\r": | ||
return "\\r"; | ||
case "\u2028": | ||
return "\\u2028"; | ||
case "\u2029": | ||
return "\\u2029"; | ||
} | ||
return character; | ||
}); | ||
var sanitiseAttrName = (str) => str.replace(/[\s"'><\/=]/g, "").replace(/[^a-zA-Z0-9_-]/g, ""); | ||
var sanitiseAttrValue = (str) => escapeJS( | ||
str.replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">") | ||
); | ||
// src/components.ts | ||
@@ -504,0 +502,0 @@ var import_vue2 = require("vue"); |
{ | ||
"name": "@vueuse/head", | ||
"version": "1.0.0-rc.10", | ||
"version": "1.0.0-rc.11", | ||
"packageManager": "pnpm@7.5.0", | ||
@@ -51,4 +51,4 @@ "description": "Document head manager for Vue 3. SSR ready.", | ||
"@antfu/eslint-config": "^0.27.0", | ||
"@nuxt/kit": "3.0.0-rc.11", | ||
"@nuxt/test-utils": "3.0.0-rc.11", | ||
"@nuxt/kit": "3.0.0-rc.12", | ||
"@nuxt/test-utils": "3.0.0-rc.12", | ||
"@vitejs/plugin-vue": "^3.1.2", | ||
@@ -66,10 +66,10 @@ "@vitejs/plugin-vue-jsx": "^2.0.1", | ||
"mlly": "^0.5.16", | ||
"nuxt": "3.0.0-rc.11", | ||
"nuxt": "^3.0.0-rc.12", | ||
"pathe": "^0.3.9", | ||
"playwright": "^1.27.1", | ||
"simple-git-hooks": "^2.8.0", | ||
"tsup": "^6.2.3", | ||
"simple-git-hooks": "^2.8.1", | ||
"tsup": "^6.3.0", | ||
"typescript": "^4.8.4", | ||
"vite": "^3.1.8", | ||
"vitest": "^0.24.2", | ||
"vitest": "^0.24.3", | ||
"vue": "^3.2.41", | ||
@@ -76,0 +76,0 @@ "vue-router": "^4.1.5" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59987
1549