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

nanostores

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanostores - npm Package Compare versions

Comparing version 0.10.2 to 0.10.3

4

computed/index.d.ts

@@ -56,3 +56,3 @@ import type { ReadableAtom } from '../atom/index.js'

stores: OriginStore,
cb: (value: StoreValue<OriginStore>) => Value
cb: (value: StoreValue<OriginStore>) => Task<Value> | Value
): ReadableAtom<Value>

@@ -75,3 +75,3 @@ /**

stores: [...OriginStores],
cb: (...values: StoreValues<OriginStores>) => Value
cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value
): ReadableAtom<Value>

@@ -78,0 +78,0 @@ }

@@ -9,3 +9,8 @@ import { atom } from '../atom/index.js'

$deepMap.setKey = (key, value) => {
let oldValue = { ...$deepMap.value }
let oldValue
try {
oldValue = structuredClone($deepMap.value)
} catch {
oldValue = { ...$deepMap.value }
}
if (getPath($deepMap.value, key) !== value) {

@@ -12,0 +17,0 @@ $deepMap.value = { ...setPath($deepMap.value, key, value) }

@@ -52,2 +52,3 @@ export function getPath(obj, path) {

const IS_NUMBER = /^\d+$/
function ensureKey(obj, key, nextKey) {

@@ -57,10 +58,10 @@ if (key in obj) {

}
let nextKeyAsInt = parseInt(
nextKey !== null && nextKey !== undefined ? nextKey : ''
)
if (Number.isNaN(nextKeyAsInt)) {
let isNum = IS_NUMBER.test(nextKey)
if (isNum) {
obj[key] = Array(parseInt(nextKey, 10) + 1).fill(undefined)
} else {
obj[key] = {}
} else {
obj[key] = Array(nextKeyAsInt + 1).fill(undefined)
}
}
{
"name": "nanostores",
"version": "0.10.2",
"version": "0.10.3",
"description": "A tiny (286 bytes) state manager for React/Preact/Vue/Svelte with many atomic tree-shakable stores",

@@ -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