New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dom-ot

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-ot - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

60

lib/adapter-mutationSummary.js

@@ -63,9 +63,2 @@ var Manipulate = require('./ops/manipulate')

if (Array.isArray(summary.added)) {
summary.added
//.reverse()// traverse added elements in reverse order, because MutationSummary puts children first for some reason
.forEach(function(node) {
oplist.push(new Move(null, pathTo(node, rootNode), serialize(node)))
})
}

@@ -117,2 +110,36 @@ if (Array.isArray(summary.removed)) {

}
if (Array.isArray(summary.reordered)) {
summary.reordered.forEach(function(node) {
var oldSibling = summary.getOldPreviousSibling(node)
, newPath = pathTo(node, rootNode)
, oldPath
if(oldSibling) {
// My older brother
oldPath = pathTo(oldSibling, rootNode)
oldPath[oldPath.length-1]++
}else {
// I was the oldest
oldPath = pathTo(summary.getOldParentNode(node), rootNode)
oldPath.push(0)
}
oplist.push(new Move(oldPath, newPath))
})
}
// transform old paths against each other in the order of operations
oplist.forEach(function(op, i) {
oplist.slice(i+1).forEach(function(op2) {
op2.transformAgainst(op)
})
})
if (Array.isArray(summary.added)) {
summary.added
//.reverse()// traverse added elements in reverse order, because MutationSummary puts children first for some reason
.forEach(function(node) {
oplist.push(new Move(null, pathTo(node, rootNode), serialize(node)))
})
}

@@ -138,21 +165,2 @@ // Convergence over intention preservation

if (Array.isArray(summary.reordered)) {
summary.reordered.forEach(function(node) {
var oldSibling = summary.getOldPreviousSibling(node)
, newPath = pathTo(node, rootNode)
, oldPath
if(oldSibling) {
// My older brother
oldPath = pathTo(oldSibling, rootNode)
oldPath[oldPath.length-1]++
}else {
// I was the oldest
oldPath = pathTo(summary.getOldParentNode(node), rootNode)
oldPath.push(0)
}
oplist.push(new Move(oldPath, newPath))
})
}
if(summary.attributeChanged) {

@@ -159,0 +167,0 @@ for(var attr in summary.attributeChanged) {

{
"name": "dom-ot",
"version": "1.1.5",
"version": "1.1.6",
"description": "Operational transform library for DOM operations (conforms to shareJS' spec)",

@@ -5,0 +5,0 @@ "main": "index.js",

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