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

dot-event

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-event - npm Package Compare versions

Comparing version 3.0.26 to 3.0.27

2

dot.js

@@ -235,3 +235,3 @@ /*global Map Promise Set*/

if (isStr || Array.isArray(arg)) {
k.arr = k.arr.concat(isStr ? arg.split(period) : arg)
k.arr = k.arr.concat(isStr ? [arg] : arg)
} else if (i === args.length - 1) {

@@ -238,0 +238,0 @@ a = arg

@@ -30,3 +30,3 @@ /*global Promise*/

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).toBe(true)

@@ -43,3 +43,3 @@ })

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).toBe(true)

@@ -52,15 +52,17 @@ })

dot.on("a.b", "c", function() {
dot.on(["a", "b"], "c", function() {
args = Array.prototype.slice.call(arguments)
})
return dot("a.b.c", { test: true }).then(function() {
expect(args).toEqual([
["b", "c"],
{ test: true },
dot,
"a",
{},
])
})
return dot("a", "b", "c", { test: true }).then(
function() {
expect(args).toEqual([
["b", "c"],
{ test: true },
dot,
"a",
{},
])
}
)
})

@@ -79,7 +81,7 @@

dot.beforeOn("a.b", "c", function() {
dot.beforeOn(["a", "b"], "c", function() {
order.push(1)
})
return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(order).toEqual([1, 2, 3])

@@ -92,3 +94,9 @@ })

dot.beforeOn("a.b", "c", function(p, a, d, e, sig) {
dot.beforeOn(["a", "b"], "c", function(
p,
a,
d,
e,
sig
) {
sig.cancel = true

@@ -101,3 +109,3 @@ })

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).not.toBe(true)

@@ -108,19 +116,31 @@ })

test("on value", function() {
dot.beforeOn("a.b", "c", function(p, a, d, e, sig) {
dot.beforeOn(["a", "b"], "c", function(
p,
a,
d,
e,
sig
) {
sig.value = true
})
expect(dot("a.b.c")).toBe(true)
expect(dot("a", "b", "c")).toBe(true)
})
test("on value (from return)", function() {
dot.beforeOn("a.b", "c", function() {
dot.beforeOn(["a", "b"], "c", function() {
return true
})
expect(dot("a.b.c")).toBe(true)
expect(dot("a", "b", "c")).toBe(true)
})
test("on value (from promise)", function(done) {
dot.on("a.b", "c", function(prop, arg, dot, e, sig) {
dot.on(["a", "b"], "c", function(
prop,
arg,
dot,
e,
sig
) {
return new Promise(function(resolve) {

@@ -132,3 +152,3 @@ sig.value = "hi"

dot("a.b.c").then(function(arg) {
dot("a", "b", "c").then(function(arg) {
expect(arg).toBe("hi")

@@ -146,3 +166,3 @@ done()

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).toBe(true)

@@ -159,3 +179,3 @@ })

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).toBe(true)

@@ -168,3 +188,3 @@ })

dot.afterAny("a.b", function() {
dot.afterAny(["a", "b"], function() {
order.push(3)

@@ -181,3 +201,3 @@ })

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(order).toEqual([1, 2, 3])

@@ -196,3 +216,3 @@ })

return dot("a.b.c").then(function() {
return dot("a", "b", "c").then(function() {
expect(called).not.toBe(true)

@@ -205,3 +225,3 @@ })

dot.on("a.b.c", function() {
dot.on("a", "b", "c", function() {
called = true

@@ -208,0 +228,0 @@ })

@@ -13,7 +13,7 @@ /* eslint-env jest */

dot.on("a.b", "c", function() {
dot.on("a", "b", "c", function() {
args = Array.prototype.slice.call(arguments)
})
return dot("a.b", "c").then(function() {
return dot("a", "b", "c").then(function() {
expect(args).toEqual([

@@ -20,0 +20,0 @@ ["b", "c"],

{
"name": "dot-event",
"version": "3.0.26",
"version": "3.0.27",
"description": "Powerful event emitter",

@@ -5,0 +5,0 @@ "keywords": [

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