MCPcopy
hub / github.com/web-infra-dev/garfish / assert

Function assert

packages/utils/src/utils.ts:182–189  ·  view source on GitHub ↗
(
  condition: any,
  msg?: string | Error,
)

Source from the content-addressed store, hash-verified

180}
181
182export function assert(
183 condition: any,
184 msg?: string | Error,
185): asserts condition {
186 if (!condition) {
187 error(msg || 'unknow reason');
188 }
189}
190
191export function toBoolean(val: any) {
192 if (val === '') return true;

Callers 15

preloadFunction · 0.90
loadModuleFunction · 0.90
setAliasFunction · 0.90
setModuleConfigFunction · 0.90
processAliasFunction · 0.90
getValueInObjectFunction · 0.90
loadModuleSyncFunction · 0.90
getRenderNodeFunction · 0.90
setOptionsMethod · 0.90
usePluginMethod · 0.90
registerAppMethod · 0.90

Calls 1

errorFunction · 0.70

Tested by 2

vueAppInDocumentFunction · 0.40
reactAppInDocumentFunction · 0.40