MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / uniq

Function uniq

src/shared/utils.ts:11–13  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

9export type PromiseOr<T> = Promise<T> | T;
10
11export function uniq<T>(array: T[]): T[] {
12 return [...new Set(array)];
13}
14
15export function flatMap<T1, T2>(input: readonly T1[], f: (input: T1) => readonly T2[]): T2[] {
16 return input.reduce((acc, x) => acc.concat(f(x)), [] as T2[]);

Callers 8

getAllGroupsMethod · 0.90
getAllTestsMethod · 0.90
getPickableDevicesMethod · 0.90
fetchPackagesOrPromptMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected