enhanced-key-value-object
v1.2.7
Published
Enhanced key value object that supports safe access and modification.
Downloads
3
Readme
enhanced-key-value-object
Enhanced key-value object with safe property access and immutable modications.
To use this object:
import {EKVObject} from 'enhanced-key-value-object';
/// Note that we only expose the object interface for better encapsulation.
let object: EKVObject.Type = EKVObject.empty();
To access the value at any node, use:
object.valueAtNode(string);
The parameter of this function should be a String whose components are joined with the specified pathSeparator (which is by default '.'). For example:
object.valueAtNode('a.b.c.d.e');
In order to update the value at some node, call:
object.updatingValue(string, Never<any>);
The object will update the value at that node, and if necessary create new objects along the way.