Compare commits

...

2 Commits

Author SHA1 Message Date
Peter White 21a28d6fec changeset 2026-10-12 08:38:11 +02:00
Peter White 4097c49a8d Upgrade object-identity and cover cache value types 2026-10-12 08:38:08 +02:00
4 changed files with 19 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"gitbook": patch
---
Upgrade object-identity to preserve value types when caching object arguments.
+2 -2
View File
@@ -164,7 +164,7 @@
"next-themes": "^0.4.6",
"nuqs": "^2.2.3",
"object-hash": "^3.0.0",
"object-identity": "^0.1.2",
"object-identity": "^0.2.1",
"openapi-types": "^12.1.3",
"p-map": "^7.0.3",
"p-retry": "^8.0.0",
@@ -2677,7 +2677,7 @@
"object-hash": ["object-hash@3.0.0", "", {}, "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw=="],
"object-identity": ["object-identity@0.1.2", "", {}, "sha512-Px5puVllX5L2aBjbcfXpiG5xXeq6OE8RckryTeP2Zq+0PgYrCGJXmC6LblWgknKSJs11Je2W4U2NOWFj3t/QXQ=="],
"object-identity": ["object-identity@0.2.1", "", {}, "sha512-itX2N4m0IvaLhFZMi9YkW4nFML6FshKCCpnn6iKJZVIkCNM/ZRaG4t1bzD2ncaW4r6cHJa59XY+7oZAH7tg8tA=="],
"object-inspect": ["object-inspect@1.13.2", "", {}, "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g=="],
+1 -1
View File
@@ -55,7 +55,7 @@
"next-themes": "^0.4.6",
"nuqs": "^2.2.3",
"object-hash": "^3.0.0",
"object-identity": "^0.1.2",
"object-identity": "^0.2.1",
"openapi-types": "^12.1.3",
"p-map": "^7.0.3",
"p-retry": "^8.0.0",
+11
View File
@@ -67,6 +67,17 @@ describe('withStableRef', () => {
expect(ref1).not.toBe(ref2);
});
it('should preserve value types in object references', () => {
const toStableRef = withStableRef();
const numeric = { id: 1 };
const textual = { id: '1' };
expect(toStableRef(numeric)).toBe(numeric);
expect(toStableRef(textual)).toBe(textual);
expect(toStableRef({ id: 1 })).toBe(numeric);
expect(toStableRef({ id: '1' })).toBe(textual);
});
it('should maintain reference stability across multiple calls', () => {
const toStableRef = withStableRef();