make filterObjectsByStringEntries return a Set<T> instead of T[]
This commit is contained in:
@@ -34,8 +34,8 @@ export function filterObjectsByStringEntries<T>(
|
|||||||
reference: StringEntryObject,
|
reference: StringEntryObject,
|
||||||
converter: (T) => StringEntryObject,
|
converter: (T) => StringEntryObject,
|
||||||
objects: T[]
|
objects: T[]
|
||||||
): T[] {
|
): Set<T> {
|
||||||
const matches: any[] = [];
|
const matches: Set<T> = new Set()
|
||||||
|
|
||||||
object_loop: for (const object of objects) {
|
object_loop: for (const object of objects) {
|
||||||
reference_entry_loop: for (const referenceEntry of Object.entries(
|
reference_entry_loop: for (const referenceEntry of Object.entries(
|
||||||
@@ -77,7 +77,7 @@ export function filterObjectsByStringEntries<T>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
matches.push(object);
|
matches.add(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches;
|
return matches;
|
||||||
|
|||||||
Reference in New Issue
Block a user