import { Flattened } from "https://deno.land/x/localekit@0.9.0/util/flatten.ts";
Constructors
new
Flattened(flattened?: FlattenedObject | Flattened)Methods
getKey<T = unknown>(key: string): T
Retrieves the value associated with the specified key from the data object.
mergeFlattened(flattened: Flattened): Flattened
Merges the provided flattened
object into the current Flattened
object.
mergeObject(obj: Record<string, unknown>): Flattened
Merges the provided object into a flattened structure.
toObject<T = Record<string, unknown>>(): T
Converts the Flattened object to a nested object that should match the original object.
Static Properties
private
flatten: { encodeKeyPart(part: string,
val_type: ValueType,
secondary_val_type?: ValueType,
key: string,
value: unknown,
manual_value_type?: ValueType,
Utility class for flattening objects.
private
unflatten: { decodeKeyPart(part: string): { key: string; value_type: ValueType; secondary_value_type?: ValueType; }; setProperty(unnamed 0: { obj: Record<string, unknown> | unknown[]; key: string; value: unknown; value_type: ValueType; raw_key: string; }): void; unflattenObject(unnamed 0: { flattened: Flattened; }): Record<string, unknown>; }Utility class for unflattening data.
Static Methods
fromFlattened(flattened: Flattened | FlattenedObject): Flattened
Creates a new Flattened instance from a flattened object.
toFlattened(obj: Record<string, unknown>): Flattened
Converts an object into a flattened representation.