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

can-dom-mutate

Package Overview
Dependencies
Maintainers
4
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.0.1 to 1.0.2

test/can-dom-mutate-test.js

10

-util.js

@@ -0,1 +1,3 @@

var getDocument = require("can-globals/document/document");
var push = Array.prototype.push;

@@ -11,3 +13,3 @@

function isInDocument (node) {
var root = node.ownerDocument.documentElement;
var root = getDocument().documentElement;
if (root === node) {

@@ -19,8 +21,4 @@ return true;

function getDocument(target) {
return target.ownerDocument || target.document || target;
}
function isDocumentElement (node) {
return getDocument(node).documentElement === node;
return getDocument().documentElement === node;
}

@@ -27,0 +25,0 @@

12

can-dom-mutate.js

@@ -85,3 +85,3 @@ 'use strict';

function getDocumentListeners (target, key) {
var doc = getDocument(target);
var doc = getDocument();
var data = getRelatedData(doc, key);

@@ -94,3 +94,3 @@ if (data) {

function getTargetListeners (target, key) {
var doc = getDocument(target);
var doc = getDocument();
var targetListenersMap = getRelatedData(doc, key);

@@ -105,3 +105,3 @@ if (!targetListenersMap) {

function addTargetListener (target, key, listener) {
var doc = getDocument(target);
var doc = getDocument();
var targetListenersMap = getRelatedData(doc, key);

@@ -121,3 +121,3 @@ if (!targetListenersMap) {

function removeTargetListener (target, key, listener) {
var doc = getDocument(target);
var doc = getDocument();
var targetListenersMap = getRelatedData(doc, key);

@@ -267,3 +267,3 @@ if (!targetListenersMap) {

} else {
stopObserving = observeMutations(getDocument(target), observerKey, treeMutationConfig, handleTreeMutations);
stopObserving = observeMutations(getDocument(), observerKey, treeMutationConfig, handleTreeMutations);
}

@@ -285,3 +285,3 @@

var doc = getDocument(documentElement);
var doc = getDocument();
var documentData = getRelatedData(doc, globalDataKey);

@@ -288,0 +288,0 @@ if (!documentData) {

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

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

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