Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vueuse/head

Package Overview
Dependencies
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vueuse/head - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

40

dist/index.js

@@ -95,2 +95,16 @@ var __create = Object.create;

// src/utils.ts
function isEqualNode(oldTag, newTag) {
if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
const nonce = newTag.getAttribute("nonce");
if (nonce && !oldTag.getAttribute("nonce")) {
const cloneTag = newTag.cloneNode(true);
cloneTag.setAttribute("nonce", "");
cloneTag.nonce = nonce;
return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
}
}
return oldTag.isEqualNode(newTag);
}
// src/index.ts

@@ -179,2 +193,3 @@ var getTagKey = (props) => {

const headCount = headCountEl ? Number(headCountEl.getAttribute("content")) : 0;
const uncontrolledElements = [];
const oldElements = [];

@@ -193,3 +208,3 @@ if (headCountEl) {

}
const newElements = [];
let newElements = [];
let title;

@@ -219,3 +234,3 @@ let htmlAttrs = {};

if (!oldElements.includes(el)) {
oldElements.push(el);
uncontrolledElements.push(el);
}

@@ -227,2 +242,15 @@ }

}
newElements = newElements.filter((newEl) => {
for (let k = 0, len = oldElements.length; k < len; k++) {
const oldEl = oldElements[k];
if (isEqualNode(oldEl, newEl)) {
oldElements.splice(k, 1);
return false;
}
}
return true;
});
uncontrolledElements.forEach((el) => {
el.remove();
});
oldElements.forEach((el) => {

@@ -234,2 +262,5 @@ if (el.nextSibling && el.nextSibling.nodeType === Node.TEXT_NODE) {

});
newElements.forEach((el) => {
head.insertBefore(el, headCountEl);
});
if (title !== void 0) {

@@ -240,6 +271,3 @@ document.title = title;

setAttrs(document.body, bodyAttrs);
newElements.forEach((el) => {
head.insertBefore(el, headCountEl);
});
headCountEl.setAttribute("content", "" + newElements.length);
headCountEl.setAttribute("content", "" + (headCount - oldElements.length + newElements.length));
};

@@ -246,0 +274,0 @@ var createHead = () => {

2

package.json
{
"name": "@vueuse/head",
"version": "0.7.0",
"version": "0.7.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Document head manager for Vue 3. SSR ready.",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc