Post

marais
marais@slightlycode·
A few years ago, I released a tiny utility for object canon's in JavaScript. I recently picked it back up and, well, got a little carried away. 😅 Reintroducing `object-identity` v0.2 🎉 → 535B → zero dependencies → ~2× faster than v0.1 → the fastest canon I've benchmarked github.com/maraisr/object…
English
1
2
9
1.3K
marais
marais@slightlycode·
Working with TanStack Query, SWR, GraphQL Dataloaders, or any cache keyed by strings? `object-identity` turns rich JavaScript values into stable keys. Structurally equal values produce the same identity! Perfect for query keys, cache keys, memoization, and deduplication.
marais tweet mediamarais tweet media
English
1
0
0
128
marais
marais@slightlycode·
It handles more than plain JSON: → Arrays, Sets, and Maps → Dates and RegExps → ArrayBuffer → deeply nested structures → circular references → and more! And still comes in ~1.5× faster than the fastest alternative, at ~4.5× smaller. 🚀
English
1
0
1
154
marais
marais@slightlycode·
Available on npm and jsr. Feedback, and weird objects are very welcome! ❤️
marais tweet media
English
0
0
0
107
Paylaş