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

cst

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cst - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

43

lib/elements/Element.js

@@ -288,2 +288,45 @@ 'use strict';

/**
* Removes children from `firstRefChild` to `lastRefChild` with specified element.
*
* @param {Element} firstRefChild
* @param {Element} lastRefChild
*/
}, {
key: 'removeChildren',
value: function removeChildren(firstRefChild, lastRefChild) {
if (!firstRefChild || firstRefChild._parentElement !== this) {
throw new Error('Invalid first reference child');
}
if (!lastRefChild || lastRefChild._parentElement !== this) {
throw new Error('Invalid last reference child');
}
var firstIndex = this._childElements.indexOf(firstRefChild);
var lastIndex = this._childElements.indexOf(lastRefChild);
if (firstIndex > lastIndex) {
throw new Error('Invalid reference children order');
}
var children = this._childElements.slice(0, firstIndex).concat(this._childElements.slice(lastIndex + 1));
var removedChildren = this._childElements.slice(firstIndex, lastIndex + 1);
this._setChildren(children);
var ownerProgram = this.ownerProgram;
if (ownerProgram) {
ownerProgram._removeElementsFromProgram(removedChildren);
}
for (var i = 0; i < removedChildren.length; i++) {
var removedChild = removedChildren[i];
removedChild._parentElement = null;
removedChild._previousSibling = null;
removedChild._nextSibling = null;
}
}
/**
* Replaces child with specified element.

@@ -290,0 +333,0 @@ * Accepts multiple replacement nodes using `Fragment`.

2

package.json
{
"name": "cst",
"version": "0.0.20",
"version": "0.0.21",
"description": "JavaScript CST Implementation",

@@ -5,0 +5,0 @@ "author": "Marat Dulin",

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