Return string representation of the key
Returns the "base" namespace of this key.
Cleanup the current key
Returns an "instance" of this type key (appends value to namespace).
The string to append.
Returns whether this key is a prefix of other
The other key to test against
Returns whether this key is a contains another as prefix.
The other Key to test against
Checks if this key has only one namespace.
Check if the given key is sorted lower than ourself.
The other Key to check against
Returns the list
representation of this key.
Returns the "name" of this key (field of last namespace).
Returns the namespaces
making up this Key.
Returns the parent
Key of this Key.
Returns the "path" of this key (parent + type).
Returns the key with all parts in reversed order.
Convert to the string representation
Returns the "type" of this key (value of last namespace).
Return the Uint8Array representation of the key
Check if value is a Key instance
Value to check
Returns a randomly (uuid) generated key.
Constructs a key out of a namespace array.
The array of namespaces
A Key represents the unique identifier of an object. Our Key scheme is inspired by file systems and Google App Engine key model. Keys are meant to be unique across a system. Keys are hierarchical, incorporating more and more specific namespaces. Thus keys can be deemed 'children' or 'ancestors' of other keys:
new Key('/Comedy')
new Key('/Comedy/MontyPython')
Also, every namespace can be parametrized to embed relevant object information. For example, the Keyname
(most specific namespace) could include the object type:new Key('/Comedy/MontyPython/Actor:JohnCleese')
new Key('/Comedy/MontyPython/Sketch:CheeseShop')
new Key('/Comedy/MontyPython/Sketch:CheeseShop/Character:Mousebender')