UNPKG

ts-json-schema-generator

Version:

Generate JSON schema from your Typescript sources

10 lines (8 loc) 230 B
export function uniqueArray<T>(array: readonly T[]): T[] { return array.reduce((result: T[], item: T) => { if (result.indexOf(item) < 0) { result.push(item); } return result; }, []); }