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

respec

Package Overview
Dependencies
Maintainers
6
Versions
637
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

respec - npm Package Compare versions

Comparing version 4.4.5 to 5.0.0

4

js/core/highlight.js

@@ -17,3 +17,3 @@ // Module core/highlight

var swapStyleOwner = utils.makeOwnerSwapper(codeStyle);
swapStyleOwner(document, document.head);
swapStyleOwner(document.head);
return {

@@ -27,3 +27,3 @@ run: function(conf, doc, cb) {

if (codeStyle.ownerDocument !== doc) {
swapStyleOwner(doc, doc.head);
swapStyleOwner(doc.head);
}

@@ -30,0 +30,0 @@

@@ -23,3 +23,3 @@ // Module core/style

var swapStyleOwner = utils.makeOwnerSwapper(styleElement);
swapStyleOwner(document, document.head);
swapStyleOwner(document.head);
return {

@@ -30,3 +30,3 @@ run: function(conf, doc, cb) {

} else if (styleElement.ownerDocument !== doc) {
swapStyleOwner(doc, doc.head);
swapStyleOwner(doc.head);
}

@@ -33,0 +33,0 @@ cb();

@@ -42,6 +42,6 @@ /*jshint browser: true */

* @param {Node} node The node to be swapped.
* @return {Function} A function that takes a document and a new
* insertion point (element). When called,
* @return {Function} A function that takes a new
* insertion point (Node). When called,
* node gets inserted into doc at before a given
* insertion point (node) - or just appended, if
* insertion point (Node) - or just appended, if
* the element has no children.

@@ -51,36 +51,13 @@ */

if (!(node instanceof Node)) {
throw TypeError();
throw new TypeError("Expected instance of Node.");
}
return function(doc, insertionPoint) {
return function(insertionPoint) {
node.remove();
doc.adoptNode(node);
var firstElementChild = this.findFirstElementChild(insertionPoint);
if (firstElementChild) {
insertionPoint.insertBefore(node, firstElementChild);
return;
insertionPoint.ownerDocument.adoptNode(node);
if (insertionPoint.firstElementChild) {
return insertionPoint.insertBefore(node, insertionPoint.firstElementChild);
}
insertionPoint.appendChild(node);
}.bind(this);
};
},
/**
* Finds the first Element child, given a node. Provides support for
* Microsoft Edge's missing support of .firstElementChild.
*
* @param {Node} node The node to be traversed.
* @return {Element} The first Element in the child list.
*/
findFirstElementChild: function(node) {
if (!node.hasChildNodes()) {
return null;
}
// We have native support
if (node.firstElementChild) {
return node.firstElementChild;
}
return Array
.from(node.childNodes)
.find(function(node) {
return node.nodeType === Node.ELEMENT_NODE;
});
},
calculateLeftPad: function(text) {

@@ -87,0 +64,0 @@ if (typeof text !== "string") {

{
"name": "respec",
"version": "4.4.5",
"version": "5.0.0",
"license": "W3C",

@@ -5,0 +5,0 @@ "description": "A technical specification pre-processor.",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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