@solid-primitives/destructure
Advanced tools
+2
-5
@@ -6,5 +6,4 @@ 'use strict'; | ||
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| var isReactiveObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null, "isReactiveObject"); | ||
| // src/index.ts | ||
| var isReactiveObject = (value) => typeof value === "object" && value !== null; | ||
| function createProxyCache(obj, get) { | ||
@@ -28,3 +27,2 @@ return new Proxy( | ||
| } | ||
| __name(createProxyCache, "createProxyCache"); | ||
| function destructure(source, options) { | ||
@@ -54,4 +52,3 @@ const config = options ?? {}; | ||
| } | ||
| __name(destructure, "destructure"); | ||
| exports.destructure = destructure; |
+3
-6
@@ -1,7 +0,6 @@ | ||
| import { getOwner, runWithOwner, createMemo } from 'solid-js'; | ||
| import { getOwner, createMemo, runWithOwner } from 'solid-js'; | ||
| import { access } from '@solid-primitives/utils'; | ||
| var __defProp = Object.defineProperty; | ||
| var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
| var isReactiveObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null, "isReactiveObject"); | ||
| // src/index.ts | ||
| var isReactiveObject = (value) => typeof value === "object" && value !== null; | ||
| function createProxyCache(obj, get) { | ||
@@ -25,3 +24,2 @@ return new Proxy( | ||
| } | ||
| __name(createProxyCache, "createProxyCache"); | ||
| function destructure(source, options) { | ||
@@ -51,4 +49,3 @@ const config = options ?? {}; | ||
| } | ||
| __name(destructure, "destructure"); | ||
| export { destructure }; |
+2
-2
| { | ||
| "name": "@solid-primitives/destructure", | ||
| "version": "0.1.7", | ||
| "version": "0.1.8", | ||
| "description": "Primitives for destructuring reactive objects – like props or stores – or signals of them into a separate accessors updated individually.", | ||
@@ -47,3 +47,3 @@ "author": "Damian Tarnawski @thetarnav <gthetarnav@gmail.com>", | ||
| "dependencies": { | ||
| "@solid-primitives/utils": "^5.1.1" | ||
| "@solid-primitives/utils": "^5.2.1" | ||
| }, | ||
@@ -50,0 +50,0 @@ "peerDependencies": { |
+8
-8
@@ -71,4 +71,4 @@ <p> | ||
| lastName: "Brown", | ||
| age: 25 | ||
| } | ||
| age: 25, | ||
| }, | ||
| }); | ||
@@ -88,8 +88,8 @@ // disable memo (for accessors is enabled by default) | ||
| lastName: "Bravo", | ||
| age: 19 | ||
| } | ||
| age: 19, | ||
| }, | ||
| }); | ||
| const { | ||
| user: { name, lastName, age } | ||
| user: { name, lastName, age }, | ||
| } = destructure(store, { deep: true }); | ||
@@ -111,3 +111,3 @@ | ||
| name: "John", | ||
| lastName: "Brown" | ||
| lastName: "Brown", | ||
| }); | ||
@@ -119,3 +119,3 @@ const { age } = destructure(user, { lazy: true }); | ||
| ...p, | ||
| age: 34 | ||
| age: 34, | ||
| })); | ||
@@ -133,3 +133,3 @@ age(); // => 34 | ||
| lastName: "Brown", | ||
| age: 25 | ||
| age: 25, | ||
| }); | ||
@@ -136,0 +136,0 @@ // only the `age` key will be cached |
13394
-3.39%138
-4.17%