UNPKG

@baqhub/sdk

Version:

The official JavaScript SDK for the BAQ federated app platform.

23 lines (22 loc) 684 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RecordKey = void 0; function tryParseKey(key) { const separatorIndex = key.lastIndexOf("+"); if (separatorIndex < 0) { return undefined; } const entity = key.slice(0, separatorIndex); const recordId = key.slice(separatorIndex + 1); return { entity, recordId }; } function keyToComponents(key) { const separatorIndex = key.lastIndexOf("+"); const entity = key.slice(0, separatorIndex); const recordId = key.slice(separatorIndex + 1); return { entity, recordId }; } exports.RecordKey = { tryParse: tryParseKey, toComponents: keyToComponents, };