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

stump-cycle-dom

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stump-cycle-dom - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

shrinkwrap.yaml

21

lib/cjs/EventDelegator.js

@@ -23,3 +23,2 @@ "use strict";

var fromEvent_1 = require("./fromEvent");
var non_bubbling_id = 0;
exports.eventTypesThatDontBubble = [

@@ -106,7 +105,9 @@ "blur",

else {
var input_1 = Array.from(this.nonBubblingListenersToAdd).find(function (x) {
var setArray_1 = [];
this.nonBubblingListenersToAdd.forEach(function (v) { return setArray_1.push(v); });
var input_1 = setArray_1.find(function (x) {
var _sub = x[0], et = x[1], ef = x[2], _ = x[3];
return eventType === et && utils_1.isEqualNamespace(ef.namespace, namespace);
});
var non_bubble_subject = void 0;
var nonBubbleSubject = void 0;
if (!input_1) {

@@ -116,10 +117,10 @@ var finder = new ElementFinder_1.ElementFinder(namespace, this.isolateModule);

input_1 = [subject, eventType, finder, dest];
non_bubble_subject = subject;
nonBubbleSubject = subject;
}
else {
var sub = input_1[0];
non_bubble_subject = sub;
nonBubbleSubject = sub;
}
var self_1 = this;
return non_bubble_subject
return nonBubbleSubject
.compose(uponStart_1.default(function () {

@@ -225,3 +226,3 @@ self_1.nonBubblingListenersToAdd.add(input_1);

EventDelegator.prototype.setupNonBubblingListener = function (input) {
var sub = input[0], eventType = input[1], elementFinder = input[2], destination = input[3];
var _ = input[0], eventType = input[1], elementFinder = input[2], destination = input[3];
if (!this.origin) {

@@ -237,3 +238,3 @@ return;

if (!subs || !subs[eventType]) {
var sub_1 = fromEvent_1.fromEvent(element, eventType, false, false, destination.passive).subscribe({
var sub = fromEvent_1.fromEvent(element, eventType, false, false, destination.passive).subscribe({
next: function (ev) {

@@ -252,4 +253,4 @@ return self_2.onEvent(eventType, ev, !!destination.passive, false);

}
map.set(element, { sub: sub_1, destination: destination });
element.subs = __assign({}, subs, (_a = {}, _a[eventType] = sub_1, _a));
map.set(element, { sub: sub, destination: destination });
element.subs = __assign({}, subs, (_a = {}, _a[eventType] = sub, _a));
}

@@ -256,0 +257,0 @@ });

@@ -21,3 +21,2 @@ var __assign = (this && this.__assign) || function () {

import { fromEvent, preventDefaultConditional, } from './fromEvent';
var non_bubbling_id = 0;
export var eventTypesThatDontBubble = [

@@ -104,7 +103,9 @@ "blur",

else {
var input_1 = Array.from(this.nonBubblingListenersToAdd).find(function (x) {
var setArray_1 = [];
this.nonBubblingListenersToAdd.forEach(function (v) { return setArray_1.push(v); });
var input_1 = setArray_1.find(function (x) {
var _sub = x[0], et = x[1], ef = x[2], _ = x[3];
return eventType === et && isEqualNamespace(ef.namespace, namespace);
});
var non_bubble_subject = void 0;
var nonBubbleSubject = void 0;
if (!input_1) {

@@ -114,10 +115,10 @@ var finder = new ElementFinder(namespace, this.isolateModule);

input_1 = [subject, eventType, finder, dest];
non_bubble_subject = subject;
nonBubbleSubject = subject;
}
else {
var sub = input_1[0];
non_bubble_subject = sub;
nonBubbleSubject = sub;
}
var self_1 = this;
return non_bubble_subject
return nonBubbleSubject
.compose(uponStart(function () {

@@ -223,3 +224,3 @@ self_1.nonBubblingListenersToAdd.add(input_1);

EventDelegator.prototype.setupNonBubblingListener = function (input) {
var sub = input[0], eventType = input[1], elementFinder = input[2], destination = input[3];
var _ = input[0], eventType = input[1], elementFinder = input[2], destination = input[3];
if (!this.origin) {

@@ -235,3 +236,3 @@ return;

if (!subs || !subs[eventType]) {
var sub_1 = fromEvent(element, eventType, false, false, destination.passive).subscribe({
var sub = fromEvent(element, eventType, false, false, destination.passive).subscribe({
next: function (ev) {

@@ -250,4 +251,4 @@ return self_2.onEvent(eventType, ev, !!destination.passive, false);

}
map.set(element, { sub: sub_1, destination: destination });
element.subs = __assign({}, subs, (_a = {}, _a[eventType] = sub_1, _a));
map.set(element, { sub: sub, destination: destination });
element.subs = __assign({}, subs, (_a = {}, _a[eventType] = sub, _a));
}

@@ -254,0 +255,0 @@ });

{
"name": "stump-cycle-dom",
"version": "0.0.17",
"version": "0.0.18",
"description": "The standard DOM Driver for Cycle.js, based on Snabbdom",

@@ -54,3 +54,3 @@ "license": "MIT",

"snabbdom": "^0.7.2",
"snabbdom-selector": "^4.1.0",
"snabbdom-selector": "^4.2.0",
"xstream": "*"

@@ -61,15 +61,15 @@ },

"@cycle/rxjs-run": "^10.2.0",
"@types/mocha": "^5.2.5",
"@types/mocha": "~5.2.7",
"@types/node": "^10.12.11",
"@types/sinon": "^5.0.7",
"deepmerge": "^2.2.1",
"deepmerge": "~4.0.0",
"es6-map": "^0.1.5",
"es6-set": "^0.1.5",
"karma": "^3.1.3",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-typescript": "^3.0.13",
"mocha": "^5.2.0",
"karma": "~4.2.0",
"karma-browserstack-launcher": "~1.5.1",
"karma-chrome-launcher": "~3.0.0",
"karma-firefox-launcher": "~1.1.0",
"karma-mocha": "~1.3.0",
"karma-typescript": "~4.1.1",
"mocha": "~6.2.0",
"most": "^1.7.3",

@@ -76,0 +76,0 @@ "mutation-observer": "1.0.3",

@@ -10,4 +10,4 @@ import xs, {Stream, Subscription} from 'xstream';

import PriorityQueue from './PriorityQueue';
import uponStart from './uponStart'
import uponStop from './uponStop'
import uponStart from './uponStart';
import uponStop from './uponStop';
import {

@@ -18,2 +18,3 @@ fromEvent,

} from './fromEvent';
declare var requestIdleCallback: any;

@@ -30,3 +31,2 @@

const non_bubbling_id = 0
export interface CycleDOMEvent extends Event {

@@ -137,6 +137,5 @@ propagationHasBeenStopped: boolean;

): Stream<Event> {
const subject = xs.never();
let dest;
let subject = xs.never();
let dest
const scopeChecker = new ScopeChecker(namespace, this.isolateModule);

@@ -155,10 +154,13 @@

dest = this.insertListener(subject, scopeChecker, eventType, options);
return subject
return subject;
} else {
let input = Array.from(this.nonBubblingListenersToAdd).find(x => {
const [_sub, et, ef, _] = x
return eventType === et && isEqualNamespace(ef.namespace, namespace)
})
let setArray: any[] = [];
this.nonBubblingListenersToAdd.forEach(v => setArray.push(v))
let non_bubble_subject: Stream<Event>
let input = setArray.find(x => {
const [_sub, et, ef, _] = x;
return eventType === et && isEqualNamespace(ef.namespace, namespace);
});
let nonBubbleSubject: Stream<Event>;
if (!input) {

@@ -168,28 +170,32 @@ const finder = new ElementFinder(namespace, this.isolateModule);

input = [subject, eventType, finder, dest];
non_bubble_subject = subject
nonBubbleSubject = subject;
} else {
const [sub] = input
non_bubble_subject = sub
const [sub] = input;
nonBubbleSubject = sub;
}
const self = this
return non_bubble_subject
.compose(uponStart(() => {
self.nonBubblingListenersToAdd.add(input as any);
self.setupNonBubblingListener(input as any);
}))
.compose(uponStop(() => {
const [_s, et, ef, _d] = input as any
var elements = ef.call();
const self = this;
return nonBubbleSubject
.compose(
uponStart(() => {
self.nonBubblingListenersToAdd.add(input as any);
self.setupNonBubblingListener(input as any);
})
)
.compose(
uponStop(() => {
const [_s, et, ef, _d] = input as any;
const elements = ef.call();
elements.forEach(function (element: any) {
var subs = element.subs;
elements.forEach(function(element: any) {
const subs = element.subs;
if (subs && subs[et]) {
subs[et].unsubscribe();
delete subs[et]
subs[et].unsubscribe();
delete subs[et];
}
});
});
self.nonBubblingListenersToAdd.delete(input as any);
}))
self.nonBubblingListenersToAdd.delete(input as any);
})
);
}

@@ -314,3 +320,3 @@ }

): void {
const [sub, eventType, elementFinder, destination] = input;
const [_, eventType, elementFinder, destination] = input;
if (!this.origin) {

@@ -317,0 +323,0 @@ return;

@@ -7,7 +7,5 @@ import {Operator, Stream} from 'xstream';

constructor(public op: () => void,
public ins: Stream<T>) {
}
constructor(public op: () => void, public ins: Stream<T>) {}
_start(out: Stream<T>): void {
public _start(out: Stream<T>): void {
this.op();

@@ -18,3 +16,3 @@ this.out = out;

_stop(): void {
public _stop(): void {
this.ins._remove(this);

@@ -24,11 +22,11 @@ this.out = null as any;

_n(t: T) {
public _n(t: T) {
this.out._n(t);
}
_e(err: any) {
public _e(err: any) {
this.out._e(err);
}
_c() {
public _c() {
this.out._c();

@@ -80,6 +78,8 @@ }

*/
export default function uponStart<T>(op: () => void): (ins: Stream<T>) => Stream<T> {
export default function uponStart<T>(
op: () => void
): (ins: Stream<T>) => Stream<T> {
return function uponStartOperator(ins: Stream<T>): Stream<T> {
return new Stream<T>(new UponStartOperator(op, ins));
};
}
}

@@ -7,7 +7,5 @@ import {Operator, Stream} from 'xstream';

constructor(public op: () => void,
public ins: Stream<T>) {
}
constructor(public op: () => void, public ins: Stream<T>) {}
_start(out: Stream<T>): void {
public _start(out: Stream<T>): void {
this.out = out;

@@ -17,3 +15,3 @@ this.ins._add(this);

_stop(): void {
public _stop(): void {
this.op();

@@ -24,11 +22,11 @@ this.ins._remove(this);

_n(t: T) {
public _n(t: T) {
this.out._n(t);
}
_e(err: any) {
public _e(err: any) {
this.out._e(err);
}
_c() {
public _c() {
this.out._c();

@@ -80,6 +78,8 @@ }

*/
export default function uponStop<T>(op: () => void): (ins: Stream<T>) => Stream<T> {
export default function uponStop<T>(
op: () => void
): (ins: Stream<T>) => Stream<T> {
return function uponStopOperator(ins: Stream<T>): Stream<T> {
return new Stream<T>(new UponStopOperator(op, ins));
};
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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