UNPKG

@mbc-cqrs-serverless/cli

Version:

a CLI to get started with MBC CQRS serverless framework

13 lines (11 loc) 315 B
import { KEY_SEPARATOR } from '@mbc-cqrs-serverless/core' export function parsePk(pk: string): { type: string; tenantCode: string } { if (pk.split(KEY_SEPARATOR).length !== 2) { throw new Error('Invalid PK') } const [type, tenantCode] = pk.split(KEY_SEPARATOR) return { type, tenantCode, } }