Skip to content

Commit 57e9747

Browse files
eslint
1 parent 5294fe9 commit 57e9747

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
coverage
33
node_modules
44
lib
5+
tests

src/array-of-objects.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
export function getUniqueValues(arrayOfObjects: Record<string, any>[], propertyName: string): Array<any> {
1+
export function getUniqueValues(
2+
arrayOfObjects: Record<string, any>[],
3+
propertyName: string
4+
): Array<any> {
25
const output: Array<any> = []
36

47
arrayOfObjects.map(obj => {
58
if (obj[propertyName] !== undefined) {
6-
if (output.find(val => JSON.stringify(obj[propertyName]) === JSON.stringify(val)) === undefined) {
9+
if (
10+
output.find(val => JSON.stringify(obj[propertyName]) === JSON.stringify(val)) === undefined
11+
) {
712
output.push(obj[propertyName])
813
}
914
}

0 commit comments

Comments
 (0)