- KEY_SYMBOL
- base64ParentUIDFor
- base64UidFor
- keyToUid
- mapToBase64ParentUIDs
- mapToBase64UIDs
- mapToIDs
- mapToIdentifiers
- mapToKeys
- mapToNames
- mapToParentIDs
- mapToParentIdentifiers
- mapToParentKeys
- mapToParentNames
- mapToParentUIDs
- mapToUIDs
- parentUidFor
- uidFor
- allocateKeys
- base64UidToKey
- buildKey
- buildMixedKey
- buildNamedKey
- coerceKeylikeToKey
- extractKey
- extractParentKey
- hasId
- hasName
- haveSameKey
- idOf
- identifierOf
- indexById
- nameOf
- parentIdOf
- parentIdentifierOf
- parentNameOf
- setKey
- uidToKey
⊕ new KeyUtil(datastore: Datastore
, options?: Partial
.<KeyUtilOptions
>): KeyUtil
Defined in KeyUtil.ts:20
Parameters:
Param | Type | Description |
---|---|---|
datastore | Datastore |
- |
options | Partial .<KeyUtilOptions > |
- |
Returns: KeyUtil
● KEY_SYMBOL: symbol
= this.datastore.KEY
Defined in KeyUtil.ts:16
● base64ParentUIDFor: function
= base64ify(this.parentUidFor)
Defined in KeyUtil.ts:178
►(entity: E
): string
Parameters:
Param | Type | Description |
---|---|---|
entity | E |
- |
Returns: string
● base64UidFor: function
= base64ify(this.uidFor)
Defined in KeyUtil.ts:176
Base64 UIDs for passing around in URLs
►(entity: E
): string
Parameters:
Param | Type | Description |
---|---|---|
entity | E |
- |
Returns: string
● keyToUid: keyToUID
= keyToUID
Defined in KeyUtil.ts:171
● mapToBase64ParentUIDs: function
= pluralize(this.base64ParentUIDFor)
Defined in KeyUtil.ts:179
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToBase64UIDs: function
= pluralize(this.base64UidFor)
Defined in KeyUtil.ts:177
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToIDs: function
= pluralize(this.idOf)
Defined in KeyUtil.ts:133
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToIdentifiers: function
= pluralize(this.identifierOf)
Defined in KeyUtil.ts:154
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToKeys: function
= pluralize(this.extractKey)
Defined in KeyUtil.ts:122
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToNames: function
= pluralize(this.nameOf)
Defined in KeyUtil.ts:143
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToParentIDs: function
= pluralize(this.parentIdOf)
Defined in KeyUtil.ts:136
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToParentIdentifiers: function
= pluralize(this.identifierOf)
Defined in KeyUtil.ts:158
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToParentKeys: function
= pluralize(this.extractParentKey)
Defined in KeyUtil.ts:126
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToParentNames: function
= pluralize(this.nameOf)
Defined in KeyUtil.ts:147
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToParentUIDs: function
= pluralize(this.parentUidFor)
Defined in KeyUtil.ts:168
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● mapToUIDs: function
= pluralize(this.uidFor)
Defined in KeyUtil.ts:165
►(es: E
[]): U
[]
Parameters:
Param | Type | Description |
---|---|---|
es | E [] |
- |
Returns: U
[]
● parentUidFor: function
= uidify(this.extractParentKey)
Defined in KeyUtil.ts:167
►(entity: E
): string
Parameters:
Param | Type | Description |
---|---|---|
entity | E |
- |
Returns: string
● uidFor: function
= uidify(this.extractKey)
Defined in KeyUtil.ts:164
UIDs for string representations of keys
►(entity: E
): string
Parameters:
Param | Type | Description |
---|---|---|
entity | E |
- |
Returns: string
► allocateKeys(keyPath: Entity.DatastoreKeyPath
⎮DatastoreKeylike
, count?: number
): Promise
.<Entity.DatastoreKey
⎮Entity.DatastoreKey
[]>
Defined in KeyUtil.ts:98
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
keyPath | Entity.DatastoreKeyPath ⎮DatastoreKeylike |
- | - |
count | number |
1 | - |
Returns: Promise
.<Entity.DatastoreKey
⎮Entity.DatastoreKey
[]>
► base64UidToKey(base64UID: string
): DatastoreKey
Defined in KeyUtil.ts:181
Parameters:
Param | Type | Description |
---|---|---|
base64UID | string |
- |
Returns: DatastoreKey
► buildKey(keyPath: Entity.DatastoreKeyPath
): DatastoreKey
Defined in KeyUtil.ts:70
Builds NUMERIC keys (keys with IDs, not names). Named keys should be created with buildNamedKey.
Parameters:
Param | Type | Description |
---|---|---|
keyPath | Entity.DatastoreKeyPath |
Has form [ Kind, ID, Kind, ID, ... ] |
Returns: DatastoreKey
► buildMixedKey(keyPath: Entity.DatastoreKeyPath
): DatastoreKey
Defined in KeyUtil.ts:56
Builds MIXED keys (keys with IDs OR names).
Parameters:
Param | Type | Description |
---|---|---|
keyPath | Entity.DatastoreKeyPath |
Has form [ Kind, Identifier, Kind, Identifier, ... ] |
Returns: DatastoreKey
► buildNamedKey(keyPath: Entity.DatastoreKeyPath
): DatastoreKey
Defined in KeyUtil.ts:83
Builds NAMED keys (keys with names, not IDs). Numeric keys should be created with buildKey
Parameters:
Param | Type | Description |
---|---|---|
keyPath | Entity.DatastoreKeyPath |
Has form [ Kind, Name, Kind, Name, ... ] |
Returns: DatastoreKey
► coerceKeylikeToKey(keylike: DatastoreKeylike
): DatastoreKey
Defined in KeyUtil.ts:95
Coerces any object (e.g. deserialized from Key JSON) to actual instance of {@link DatastoreKey}. REQUIRES that the object have a valid 'path' property.
Parameters:
Param | Type | Description |
---|---|---|
keylike | DatastoreKeylike |
- |
Returns: DatastoreKey
► extractKey(entity: DatastoreKeyExtractable
): DatastoreKey
Defined in KeyUtil.ts:121
On GCDS entities, the key is hidden away as a symbol property. The symbol itself is non-global, and only available on the datastore object.
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: DatastoreKey
► extractParentKey(entity: DatastoreKeyExtractable
): DatastoreKey
Defined in KeyUtil.ts:125
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: DatastoreKey
► hasId(entity: DatastoreKeyExtractable
, id: string
): boolean
Defined in KeyUtil.ts:191
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
id | string |
- |
Returns: boolean
► hasName(entity: DatastoreKeyExtractable
, name: string
): boolean
Defined in KeyUtil.ts:192
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
name | string |
- |
Returns: boolean
► haveSameKey(entity: DatastoreKeyExtractable
, other: DatastoreKeyExtractable
): boolean
Defined in KeyUtil.ts:186
Key predicates
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
other | DatastoreKeyExtractable |
- |
Returns: boolean
► idOf(entity: DatastoreKeyExtractable
): string
Defined in KeyUtil.ts:129
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: string
► identifierOf(entity: DatastoreKeyExtractable
): undefined
⎮string
Defined in KeyUtil.ts:150
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: undefined
⎮string
► indexByIdE(entity: E
⎮E
[]): [string
,E
]⎮Array
.<[string
,E
]>
Defined in KeyUtil.ts:195
Type parameters:
Parameters:
Param | Type | Description |
---|---|---|
entity | E ⎮E [] |
- |
Returns: [string
,E
]⎮Array
.<[string
,E
]>
► nameOf(entity: DatastoreKeyExtractable
): string
Defined in KeyUtil.ts:139
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: string
► parentIdOf(entity: DatastoreKeyExtractable
): string
Defined in KeyUtil.ts:135
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: string
► parentIdentifierOf(entity: DatastoreKeyExtractable
): undefined
⎮string
Defined in KeyUtil.ts:157
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: undefined
⎮string
► parentNameOf(entity: DatastoreKeyExtractable
): string
Defined in KeyUtil.ts:146
Parameters:
Param | Type | Description |
---|---|---|
entity | DatastoreKeyExtractable |
- |
Returns: string
► setKeyT(entity: T
, key: Entity.DatastoreKey
): T
Defined in KeyUtil.ts:38
Type parameters:
Parameters:
Param | Type | Description |
---|---|---|
entity | T |
- |
key | Entity.DatastoreKey |
- |
Returns: T
► uidToKey(uid: string
): DatastoreKey
Defined in KeyUtil.ts:170
Parameters:
Param | Type | Description |
---|---|---|
uid | string |
- |
Returns: DatastoreKey