Skip to content

CustomArrayDict<T>

Unofficial

A dictionary from string keys to arrays of unique values.

Adding a value already present under a key does nothing, removing the last value under a key removes the key, and CustomArrayDict.get returns the stored array itself rather than a copy.

Obsidian’s bundle defines this class under a minified name only, so CustomArrayDict is a name given here rather than Obsidian’s own.

Import:

import type { CustomArrayDict } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface CustomArrayDict<T>

Properties

PropertyTypeDescription
dataMap<string, T[]>Internal map storing key-to-array mappings.

Methods

MethodReturnsDescription
add(key, value)voidAdd a value to the array associated with the given key.
clear(key)voidRemove all values for the given key.
clearAll()voidRemove all keys and their values.
contains(key, value)booleanCheck whether the array for the given key contains the specified value.
count()numberGet the total number of values across all keys.
get(key)null | T[]Get the array of values for the given key, or null if not found.
keys()string[]Get all keys in the dictionary.
remove(key, value)voidRemove a specific value from the array associated with the given key.

Links to this page: