@mintjamsinc/ichigojs 0.1.52 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ichigo.cjs +16 -10
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +16 -10
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +16 -10
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/ichigo.cjs
CHANGED
|
@@ -7891,7 +7891,7 @@
|
|
|
7891
7891
|
}
|
|
7892
7892
|
// Create the proxy with path captured in closure
|
|
7893
7893
|
const proxy = new Proxy(target, {
|
|
7894
|
-
get(obj, key) {
|
|
7894
|
+
get(obj, key, receiver) {
|
|
7895
7895
|
const value = Reflect.get(obj, key);
|
|
7896
7896
|
// If the value is an object or array, make it reactive too
|
|
7897
7897
|
if (typeof value === 'object' && value !== null) {
|
|
@@ -7910,16 +7910,22 @@
|
|
|
7910
7910
|
const nestedPath = path ? (Array.isArray(obj) ? `${path}[${keyStr}]` : `${path}.${keyStr}`) : keyStr;
|
|
7911
7911
|
return ReactiveProxy.create(value, onChange, nestedPath);
|
|
7912
7912
|
}
|
|
7913
|
-
// For arrays, intercept mutation methods
|
|
7914
|
-
if (
|
|
7915
|
-
|
|
7916
|
-
if (
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
};
|
|
7913
|
+
// For arrays and Maps, intercept mutation methods
|
|
7914
|
+
if (typeof value === 'function') {
|
|
7915
|
+
let mutationMethods = [];
|
|
7916
|
+
if (Array.isArray(obj)) {
|
|
7917
|
+
mutationMethods.push('push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse');
|
|
7918
|
+
}
|
|
7919
|
+
else if (obj.constructor.name === 'Map') {
|
|
7920
|
+
mutationMethods.push('set', 'delete', 'clear');
|
|
7922
7921
|
}
|
|
7922
|
+
return function (...args) {
|
|
7923
|
+
const result = value.apply(this === receiver ? obj : this, args);
|
|
7924
|
+
if (mutationMethods.includes(key)) {
|
|
7925
|
+
onChange(path || undefined);
|
|
7926
|
+
}
|
|
7927
|
+
return result;
|
|
7928
|
+
};
|
|
7923
7929
|
}
|
|
7924
7930
|
return value;
|
|
7925
7931
|
},
|