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

can-dom-mutate

Package Overview
Dependencies
Maintainers
8
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-dom-mutate - npm Package Compare versions

Comparing version 1.3.8 to 1.3.9

24

events/events-test.js

@@ -50,14 +50,16 @@ var unit = require('steal-qunit');

var onNodeInsertionCount = 0;
removeOnInsertionHandler = domMutate.onInsertion(document.documentElement, function () {
switch(onNodeInsertionCount) {
case 0:
assert.equal(insertedEventCount, 1, 'inserted event should trigger for event.currentTarget');
node.appendChild.call(parent, child);
break;
case 1:
assert.equal(insertedEventCount, 1, 'inserted event should NOT trigger for child of event.currentTarget');
setTimeout(cleanup, 50);
break;
removeOnInsertionHandler = domMutate.onInsertion(document.documentElement, function (mutation) {
if(mutation.target === parent) {
assert.equal(insertedEventCount, 1, 'inserted event should trigger for event.currentTarget');
assert.equal(onNodeInsertionCount, 0, 'parent insertion called at right time');
onNodeInsertionCount++;
node.appendChild.call(parent, child);
} else if(mutation.target === child) {
assert.equal(insertedEventCount, 1, 'inserted event should NOT trigger for child of event.currentTarget');
assert.equal(onNodeInsertionCount, 1, 'child insertion called at right time');
onNodeInsertionCount++;
setTimeout(cleanup, 50);
} else {
console.log("dom-events test: mutation fired for non-test element", mutation);
}
onNodeInsertionCount++;
});

@@ -64,0 +66,0 @@

{
"name": "can-dom-mutate",
"description": "Dispatch and listen for DOM mutations",
"version": "1.3.8",
"version": "1.3.9",
"author": {

@@ -6,0 +6,0 @@ "name": "DoneJS Team",

@@ -71,6 +71,8 @@ var unit = require('steal-qunit');

var undo = domMutate.onInsertion(document.documentElement, function (mutation) {
assert.equal(mutation.target, child, 'Node should be the inserted child');
if(mutation.target === child) {
assert.ok(true, 'Node should be the inserted child');
undo();
done();
undo();
done();
}
});

@@ -127,6 +129,8 @@

var undo = domMutate.onRemoval(document.documentElement, function (mutation) {
assert.equal(mutation.target, child, 'Node should be the removed child');
if(mutation.target === child) {
assert.ok(true, 'Node should be the removed child');
undo();
done();
undo();
done();
}
});

@@ -133,0 +137,0 @@

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