enhanced-key-value-object
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

enhanced-key-value-object

License: MIT npm version Build Status Coverage Status code style: prettier

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.

Readme

Keywords

Package Sidebar

Install

npm i enhanced-key-value-object

Weekly Downloads

6

Version

1.2.7

License

MIT

Unpacked Size

58.9 kB

Total Files

44

Last publish

Collaborators

  • haipham