New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 1.0.3 to 1.0.4

4

lib/index.js

@@ -123,4 +123,6 @@ "use strict";

var currentState = typeof _this.state === 'undefined' ? _this.initialStates[''] : _this.state;
var pathSoFar = [];
for (var _a = 0, path_1 = path; _a < path_1.length; _a++) {
var p = path_1[_a];
pathSoFar.push(p);
if (!(p in currentState)) {

@@ -130,3 +132,3 @@ // todo: consider looking ahead to see if the next

// instead of an object
var init = _this.initialStates[path.join('.')];
var init = _this.initialStates[pathSoFar.join('.')];
currentState[p] = typeof init === 'undefined' ? {} : init;

@@ -133,0 +135,0 @@ }

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

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

@@ -22,3 +22,3 @@ import deepStorage, { isPathMatch } from '../';

test('init', () => {
test('deepInit', () => {
const storage = deepStorage({

@@ -30,2 +30,12 @@ });

test('init', () => {
const storage = deepStorage({
});
let loginStorage = storage.deep('app', 'login');
loginStorage = loginStorage.init({
lastLoginFailed: false
});
expect(loginStorage.deep('lastLoginFailed').state).toEqual(false);
});
test('deep', () => {

@@ -32,0 +42,0 @@ const storage = deepStorage({

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

let currentState: any = typeof this.state === 'undefined' ? this.initialStates[''] : this.state;
let pathSoFar = [];
for (let p of path) {
pathSoFar.push(p);
if (!(p in currentState)) {

@@ -162,3 +164,3 @@ // todo: consider looking ahead to see if the next

// instead of an object
const init = this.initialStates[path.join('.')];
const init = this.initialStates[pathSoFar.join('.')];
currentState[p] = typeof init === 'undefined' ? {} : init;

@@ -165,0 +167,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