{"version":3,"file":"requireContext.mjs","names":[],"sources":["../../../src/context/requireContext.ts"],"sourcesContent":["/**\n * Guard for context hooks whose provider is mandatory: returns the value, or throws an error naming\n * the hook and the missing provider. Only `undefined` counts as missing, so `null`, `0` and `''`\n * pass.\n */\nexport const requireContext = <T>(\n  value: T | undefined,\n  hookName: string,\n  providerName: string,\n): T => {\n  if (value === undefined) {\n    throw new Error(\n      `${hookName} was called outside of ${providerName}. Make sure the component calling ` +\n        `${hookName} is rendered within <${providerName}>.`,\n    );\n  }\n\n  return value;\n};\n"],"mappings":";;;;;;AAKA,IAAa,kBACX,OACA,UACA,iBACM;CACN,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,MACR,GAAG,SAAS,yBAAyB,aAAa,oCAC7C,SAAS,uBAAuB,aAAa,GACpD;CAGF,OAAO;AACT"}