import { normalizeObject } from "https://dotland.deno.dev/x/obsidian@v8.0.0/src/normalize.ts";
Recursively flattens an arbitrarily nested object into an objects with hash key and hashable object pairs
For each key in object (typeof === 'object', meaning it can be array):
-
If current object contains hashable object and if it hasn't printed already, it prints a hashable object and makes its associated hash. If hash doesn't exist in normalizedHashableObjects, it adds hash key and hashable object pair.
-
If the value at the current key is an object (typeof === 'object', meaning it can be array), it recursively calls normalizeObject with the value passed in. This recursive calls goes inside arbitrary nesting.
-
Return normalizedHashableObjects. In the outer most execution context, this will return the output of the function. In inner execution contexts, this will return that execution context's normalizedHashableObjects.