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

delta-listener

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delta-listener - npm Package Compare versions

Comparing version 1.0.0-alpha.0 to 1.0.0-alpha.1

lib/compare.d.ts

20

lib/index.js

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

":string": /(\w+)/,
"*": /(.*)/,
};

@@ -30,6 +31,11 @@ var DeltaContainer = (function () {

rules: segments.map(function (segment) {
// replace placeholder matchers
return (typeof (segment) === "string")
? matcherPlaceholders[segment] || new RegExp(segment)
: segment;
if (typeof (segment) === "string") {
// replace placeholder matchers
return (segment.indexOf(":") === 0)
? matcherPlaceholders[segment] || matcherPlaceholders["*"]
: new RegExp(segment);
}
else {
return segment;
}
})

@@ -59,6 +65,8 @@ };

var matches = patch.path[i].match(rule.rules[i]);
pathVars = pathVars.concat(matches.slice(1));
if (matches.length === 0 || matches.length > 2) {
if (!matches || matches.length === 0 || matches.length > 2) {
return false;
}
else {
pathVars = pathVars.concat(matches.slice(1));
}
}

@@ -65,0 +73,0 @@ return pathVars;

{
"name": "delta-listener",
"version": "1.0.0-alpha.0",
"version": "1.0.0-alpha.1",
"description": "Deeply compare JavaScript objects and listen to changes.",

@@ -8,3 +8,4 @@ "main": "lib/index.js",

"scripts": {
"test": "mocha test/**.ts --require ts-node/register"
"test": "mocha test/**.ts --require ts-node/register",
"prepublish": "tsc"
},

@@ -11,0 +12,0 @@ "keywords": [

@@ -23,3 +23,4 @@ delta-listener

container.listen("entities/:id", "replace", (, ) => {
container.listen("entities/:id", "add", (entityId: string, value: any) => {
console.log("new entity", entityId, value);
})

@@ -26,0 +27,0 @@

@@ -6,2 +6,3 @@ {

"module": "commonjs",
"declaration": true,
"noImplicitAny": true

@@ -8,0 +9,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