MCPcopy
hub / github.com/logto-io/logto / assertThat

Function assertThat

packages/core/src/utils/assert-that.ts:11–17  ·  view source on GitHub ↗
(
  value: unknown,
  error: E | LogtoErrorCode,
  status?: number
)

Source from the content-addressed store, hash-verified

9};
10
11const assertThat: AssertThatFunction = <E extends Error>(
12 value: unknown,
13 error: E | LogtoErrorCode,
14 status?: number
15): asserts value => {
16 assert(value, error instanceof Error ? error : new RequestError({ code: error, status }));
17};
18
19export default assertThat;

Callers 15

syncDomainStatusFunction · 0.85
addDomainFunction · 0.85
deleteDomainFunction · 0.85
cleanupDomainsFunction · 0.85
updateOneTimeTokenStatusFunction · 0.85
checkOneTimeTokenFunction · 0.85
refreshTokenSetSecretFunction · 0.85
QuotaLibraryClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected