Skip to main content

Function: splitClassKey()

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / index / splitClassKey

Function: splitClassKey()

splitClassKey(key, delimiter): GalaChainTokenClassKey | undefined

Defined in: packages/gala-core-sdk/dist/index.d.ts:2190

Splits collection<d>category<d>type<d>additionalKey from the right, or undefined when there are fewer than four segments or any of the four is empty. The one place the split is written; the strict parseTokenClassKey calls it too.

The LAST three segments are always category, type and additionalKey; everything before them is the collection. Parsing from the right is required because real collections contain the $ delimiter themselves (for example $GMUSIC), so a plain left-to-right split('$') shifts every field.

Parameters​

key​

string

delimiter​

"|" | "$"

Returns​

GalaChainTokenClassKey | undefined