MCPcopy Create free account
hub / github.com/webpro-nl/knip / arrayify

Function arrayify

packages/knip/src/util/array.ts:7–12  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

5 Array.from(new Set(collection)).filter((value): value is T => Boolean(value));
6
7export const arrayify = (value: unknown): string[] =>
8 Array.isArray(value)
9 ? value.filter((item): item is string => typeof item === 'string')
10 : typeof value === 'string'
11 ? [value]
12 : [];
13
14export const partition = <T>(collection: Collection<T>, predicate: (item: T) => unknown) => {
15 const results: [T[], T[]] = [[], []];

Callers 12

getConfigurationHintsMethod · 0.90
normalizeMethod · 0.90
getConfigForWorkspaceMethod · 0.90
resolveConfigFunction · 0.90
resolveConfigFunction · 0.90
getLoadPathsFunction · 0.90
index.tsFile · 0.90
resolveConfigFunction · 0.90
resolveConfigFunction · 0.90
getInjectEntriesFunction · 0.90
normalizePluginConfigFunction · 0.90
createOptionsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected