Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We often have to use a tuple of things as indexes in deepscatter. This creates a class that allows accessing things by string (or object) indexes so that you can do things like: ```js const a = new TupleMap(); a.set(["foo", "bar"], 2) a.get(["foo", "bar"]) // == 3 ``` Even though the objects don't match. <!-- ELLIPSIS_HIDDEN --> ---- | 🚀 | This description was created by cd93751 | |--------|--------| feat: add `TupleMap` class for tuple-based indexing in `src/utilityFunctions.ts` ### Summary: Introduces `TupleMap` class for efficient tuple-based indexing with string or object keys, supporting various methods and cleaning up empty maps. **Key points**: - Introduces `TupleMap` class in `src/utilityFunctions.ts` for tuple-based indexing. - Supports `set`, `get`, `has`, and `delete` methods. - Allows string or object keys in tuples. - Handles non-matching object keys gracefully. - Cleans up empty nested maps after deletion. - Example usage: `a.set(["foo", "bar"], 2); a.get(["foo", "bar"])`. ---- Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev) <!-- ELLIPSIS_HIDDEN -->
- Loading branch information