Creates a wrapper for working with 'pathed' trees.
An example is a filesystem.
constt = create(); // Store a value. Path implies a structure of // c -> users -> admin // ...which is autoatically created t.add({x:10}, `c.users.admin`);
t.add({x:20}, `c.users.guest`); // Tree will now be: // c-> users -> admin // -> guest
t.getValue(`c.users.guest`); // { x:20 }
By default only a single value can be stored at a path.
Set options to allow this:
constt = create({ duplicates:`allow` }); t.add({x:10}, `c.users.admin`); t.add({x:20}, `c.users.admin`); t.getValue(`c.users.admin`); // Throws an error because there are multiple values t.getValues(`c.users.admin`); // [ {x:10}, {x:20 } ]
Creates a wrapper for working with 'pathed' trees. An example is a filesystem.
By default only a single value can be stored at a path. Set options to allow this: