{"version":3,"file":"assert.cjs","names":[],"sources":["../../src/common/assert.ts"],"sourcesContent":["import { getGlobalLoggerIfExists } from './log/log'\n\n/** Always throws. */\nexport function fatal(...messages: any[]): never {\n  getGlobalLoggerIfExists()?.('assert')?.fatal(...messages)\n  throw new Error(`${messages.map(String).join(' ')}`)\n}\n\n/** Throws if condition is not truthy. */\nexport function assert(condition: unknown, ...messages: any[]): asserts condition {\n  if (condition == null || (typeof condition === 'number' && Number.isNaN(condition)) || !condition)\n    fatal(...messages)\n}\n\n/** Alias for `assert` for better differentiation to unit test's assert function. */\nexport function assertCondition(condition: unknown, ...messages: any[]): asserts condition {\n  assert(condition, ...messages)\n}\n"],"mappings":";;;;;AAGA,SAAgB,MAAM,GAAG,UAAwB;AAC/C,iDAAyB,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS;AACzD,OAAM,IAAI,MAAM,GAAG,SAAS,IAAI,OAAO,CAAC,KAAK,IAAI,GAAG;;;AAItD,SAAgB,OAAO,WAAoB,GAAG,UAAoC;AAChF,KAAI,aAAa,QAAS,OAAO,cAAc,YAAY,OAAO,MAAM,UAAU,IAAK,CAAC,UACtF,OAAM,GAAG,SAAS;;;AAItB,SAAgB,gBAAgB,WAAoB,GAAG,UAAoC;AACzF,QAAO,WAAW,GAAG,SAAS"}