MCPcopy Index your code
hub / github.com/directus/directus / validateBoolean

Function validateBoolean

api/src/utils/validate-query.ts:159–167  ·  view source on GitHub ↗
(value: any, key: string)

Source from the content-addressed store, hash-verified

157}
158
159export function validateBoolean(value: any, key: string) {
160 if (value === null || value === '') return true;
161
162 if (typeof value !== 'boolean') {
163 throw new InvalidQueryError({ reason: `"${key}" has to be a boolean` });
164 }
165
166 return true;
167}
168
169export function validateGeometry(value: any, key: string) {
170 if (value === null || value === '') return true;

Callers 2

validateFilterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected