MCPcopy
hub / github.com/directus/directus / isTypeIn

Function isTypeIn

packages/utils/node/array-helpers.ts:5–12  ·  view source on GitHub ↗
(
	object: T,
	array: readonly E[],
)

Source from the content-addressed store, hash-verified

3}
4
5export function isTypeIn<T extends { type?: string }, E extends string>(
6 object: T,
7 array: readonly E[],
8): object is Extract<T, { type?: E }> {
9 if (!object.type) return false;
10
11 return (array as readonly string[]).includes(object.type);
12}

Callers 10

addFunction · 0.90
getLanguageFromEntriesFunction · 0.90
buildFunction · 0.90
generateBundleEntrypointFunction · 0.90
getExtensionDefinitionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected