···1717 if (!is_arr) {
1818 if (input instanceof Date) return 'd' + +input;
1919 if (input instanceof RegExp) return 'r' + input.source + input.flags;
2020+ if (typeof input.toJSON === 'function' && !ArrayBuffer.isView(input)) {
2121+ input = input.toJSON();
2222+ if (typeof input !== 'object' || input === null) return walk(input, seen);
2323+ is_arr = Array.isArray(input);
2424+ }
2025 }
21262227 let ref: any = seen.indexOf(input);
+1-1
readme.md
···2828- 🧬 **Canonical.** The same shape always produces the same id.
2929- 🌀 **Deep and cycle-safe.** Handles nested objects, arrays, sets, maps, and circular references.
3030- 🏎 **Fast.** See the [benchmarks](#-benchmark).
3131-- 🪶 **Tiny.** Around 529B minified and gzipped, with zero
3131+- 🪶 **Tiny.** Around 571B minified and gzipped, with zero
3232 [dependencies](https://npm.anvaka.com/#/view/2d/object-identity/).
33333434## ⚙️ Install