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

deep-storage

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-storage - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

4

lib/index.js

@@ -50,5 +50,3 @@ "use strict";

function isPathMatch(stateChangePath, subscriptionPath) {
if (stateChangePath.length === 0)
return true;
for (var i = 0; i < subscriptionPath.length; i++) {
for (var i = 0; i < Math.min(subscriptionPath.length, stateChangePath.length); i++) {
if (stateChangePath[i] !== subscriptionPath[i])

@@ -55,0 +53,0 @@ return false;

{
"name": "deep-storage",
"version": "0.3.6",
"version": "0.3.7",
"description": "Simple observable state management for reactive applications",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -57,5 +57,8 @@ import deepStorage, { isPathMatch } from '../';

expect(isPathMatch(['test'], ['test', 'something'])).toBeFalsy();
expect(isPathMatch(['test'], ['test', 'something'])).toBeTruthy();
expect(isPathMatch(['notTest'], ['test'])).toBeFalsy();
expect(isPathMatch(['app', 'trello'], ['app', 'trello', 'connections'])).toBeTruthy();
});

@@ -70,4 +73,4 @@

expect(path).toEqual([]);
expect(newState).toEqual({todos: [1]});
expect(oldState).toEqual({todos: []});
expect(newState).toEqual({ todos: [1] });
expect(oldState).toEqual({ todos: [] });
done();

@@ -74,0 +77,0 @@ });

@@ -79,4 +79,3 @@ export type StateUpdateCallback = <DeepState>(path: Path, newState: DeepState, oldState: DeepState) => void;

export function isPathMatch<T>(stateChangePath: T[], subscriptionPath: T[]) {
if(stateChangePath.length === 0) return true;
for (let i = 0; i < subscriptionPath.length; i++) {
for (let i = 0; i < Math.min(subscriptionPath.length, stateChangePath.length); i++) {
if (stateChangePath[i] !== subscriptionPath[i]) return false;

@@ -83,0 +82,0 @@ }

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