{"version":3,"sources":["../../src/functions/assert/assert.ts"],"names":[],"mappings":";AAMO,SAAS,OACd,WACA,SACmB;AACnB,MAAI,UAAU,WAAW,GAAG;AAC1B;AAAA,EACF;AAEA,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,eAAe,OAAO;AAAA,EAClC;AACF;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACxC,YAAY,SAAkB;AAC5B,UAAM,4BAA4B,UAAU,MAAM,aAAa,IAAI;AAAA,EACrE;AACF","sourcesContent":["/**\n * Asserts that a condition is true, throwing an Error if it is not.\n *\n * @param condition A condition that should be true\n * @param message A message to use in the Error that will be thrown if the condition is falsy\n */\nexport function assert(\n  condition?: unknown,\n  message?: string\n): asserts condition {\n  if (arguments.length === 0) {\n    return;\n  }\n\n  if (!condition) {\n    throw new AssertionError(message);\n  }\n}\n\nexport class AssertionError extends Error {\n  constructor(message?: string) {\n    super(`Assertion not satisfied: ${message ? `: \"${message}\"` : ''}`);\n  }\n}\n"]}