@cpelements/pfe-navigation
Advanced tools
Comparing version 1.0.55 to 1.0.56
@@ -7,31 +7,26 @@ /** | ||
*/ | ||
(function(elem) { | ||
// Check if element is a node | ||
// https://github.com/Financial-Times/polyfill-service | ||
var isNode = function(object) { | ||
// DOM, Level2 | ||
if (typeof Node === "function") { | ||
return object instanceof Node; | ||
(function (arr) { | ||
arr.forEach(function (item) { | ||
if (item.hasOwnProperty("prepend")) { | ||
return; | ||
} | ||
Object.defineProperty(item, "prepend", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: function prepend() { | ||
var argArr = Array.prototype.slice.call(arguments), | ||
docFrag = document.createDocumentFragment(); | ||
// Older browsers, check if it looks like a Node instance) | ||
return object && typeof object === "object" && object.nodeName && object.nodeType >= 1 && object.nodeType <= 12; | ||
}; | ||
argArr.forEach(function (argItem) { | ||
var isNode = argItem instanceof Node; | ||
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); | ||
}); | ||
// Add append() method to prototype | ||
for (var i = 0; i < elem.length; i++) { | ||
if (!window[elem[i]] || "append" in window[elem[i]].prototype) continue; | ||
window[elem[i]].prototype.append = function() { | ||
var argArr = Array.prototype.slice.call(arguments); | ||
var docFrag = document.createDocumentFragment(); | ||
this.insertBefore(docFrag, this.firstChild); | ||
}, | ||
}); | ||
}); | ||
})([Element.prototype, Document.prototype, DocumentFragment.prototype]); | ||
for (var n = 0; n < argArr.length; n++) { | ||
docFrag.appendChild(isNode(argArr[n]) ? argArr[n] : document.createTextNode(String(argArr[n]))); | ||
} | ||
this.appendChild(docFrag); | ||
}; | ||
} | ||
})(["Element", "CharacterData", "DocumentType"]); | ||
/** | ||
@@ -43,4 +38,4 @@ * Prepend Polyfill | ||
*/ | ||
(function(arr) { | ||
arr.forEach(function(item) { | ||
(function (arr) { | ||
arr.forEach(function (item) { | ||
if (item.hasOwnProperty("prepend")) { | ||
@@ -57,3 +52,3 @@ return; | ||
argArr.forEach(function(argItem) { | ||
argArr.forEach(function (argItem) { | ||
var isNode = argItem instanceof Node; | ||
@@ -64,3 +59,3 @@ docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); | ||
this.insertBefore(docFrag, this.firstChild); | ||
} | ||
}, | ||
}); | ||
@@ -75,3 +70,3 @@ }); | ||
if (!String.prototype.includes) { | ||
String.prototype.includes = function(search, start) { | ||
String.prototype.includes = function (search, start) { | ||
"use strict"; | ||
@@ -95,6 +90,6 @@ | ||
Object.defineProperty(String.prototype, "startsWith", { | ||
value: function(search, rawPos) { | ||
value: function (search, rawPos) { | ||
var pos = rawPos > 0 ? rawPos | 0 : 0; | ||
return this.substring(pos, pos + search.length) === search; | ||
} | ||
}, | ||
}); | ||
@@ -111,3 +106,3 @@ } | ||
if (!Element.prototype.closest) { | ||
Element.prototype.closest = function(s) { | ||
Element.prototype.closest = function (s) { | ||
var el = this; | ||
@@ -127,3 +122,3 @@ | ||
if (Element.prototype.getAttributeNames == undefined) { | ||
Element.prototype.getAttributeNames = function() { | ||
Element.prototype.getAttributeNames = function () { | ||
var attributes = this.attributes; | ||
@@ -130,0 +125,0 @@ var length = attributes.length; |
@@ -14,6 +14,6 @@ { | ||
"pfe-navigation--lightdom.*css", | ||
"ie-polyfill.js" | ||
"ie-polyfills.js" | ||
] | ||
}, | ||
"version": "1.0.55", | ||
"version": "1.0.56", | ||
"publishConfig": { | ||
@@ -38,7 +38,6 @@ "access": "public" | ||
"scripts": { | ||
"spandx": "spandx", | ||
"build": "../../node_modules/.bin/gulp && ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --write '**/*.{js,json}' && cp _temp/ie-polyfills.js dist/", | ||
"dev": "../../node_modules/.bin/gulp dev", | ||
"watch": "../../node_modules/.bin/gulp watch", | ||
"test": "../../node_modules/.bin/wct --configFile ../../wct.conf.json elements/pfe-navigation/test/" | ||
"test": "echo \"👉 Run tests from the project root with 'npm run test:watch --element=pfe-navigation'\"" | ||
}, | ||
@@ -52,11 +51,10 @@ "contributors": [ | ||
"dependencies": { | ||
"@patternfly/pfe-icon": "1.3.0", | ||
"@patternfly/pfe-avatar": "1.3.0", | ||
"@patternfly/pfelement": "1.3.0" | ||
"@patternfly/pfe-icon": "1.9.2", | ||
"@patternfly/pfe-avatar": "1.9.2", | ||
"@patternfly/pfelement": "1.9.2" | ||
}, | ||
"devDependencies": { | ||
"@patternfly/pfe-sass": "1.3.0", | ||
"spandx": "^2.1.2" | ||
"@patternfly/pfe-sass": "1.9.2" | ||
}, | ||
"generator-pfelement-version": "1.1.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2306117
1
9127
+ Added@patternfly/pfe-avatar@1.9.2(transitive)
+ Added@patternfly/pfe-icon@1.9.2(transitive)
+ Added@patternfly/pfelement@1.9.2(transitive)
- Removed@patternfly/pfe-avatar@1.3.0(transitive)
- Removed@patternfly/pfe-icon@1.3.0(transitive)
- Removed@patternfly/pfelement@1.3.0(transitive)
Updated@patternfly/pfe-avatar@1.9.2
Updated@patternfly/pfe-icon@1.9.2
Updated@patternfly/pfelement@1.9.2