Members
CastAs
Types.
Methods
explode(id, options) → {array}
Explode an ID into parts and valid flag,
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
id |
any | An ID to explode and validate. | ||||||
options |
object | Options, optional.
Properties
|
Returns:
Tuple of unix timestamp, node ID,
sequence ID, and valid. If invalid the numbers will be undefined.
- Type
- array
explodeId(id, options) → {array}
Explode an ID into parts and valid flag,
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
id |
bigint | number | string | An ID to explode and validate. | ||||||
options |
object | Options, optional.
Properties
|
Returns:
Tuple of unix timestamp, node ID,
sequence ID, and valid. If invalid the numbers will be undefined.
- Type
- array
(generator) idSequence(options) → {bigint}
ID Sequence generator.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Options, optional.
Properties
|
Yields:
The resulting ID.
- Type
- bigint
(generator) idStringSequence(options) → {string}
ID Sequence generator yielding strings instead of bigints.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Options, optional.
Properties
|
Yields:
The resulting ID as a string.
- Type
- string