Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module 'unique-objects' {
type Obj = Record<string, unknown>;
type ObjectType = Record<string, unknown>;

export default function (arrayInput: Obj[], keys: (keyof Obj)[]): Obj[];
export default function (arrayInput: ObjectType[], keys: Array<keyof ObjectType>): ObjectType[];
}
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
function uniqueObjects(arrayInput = [], keys = []) {
if (!Array.isArray(arrayInput)) {
throw new TypeError(
`Expected an array for arrayInput, got ${typeof arrayInput}`,
);
throw new TypeError(`Expected an array for arrayInput, got ${typeof arrayInput}`);
}

if (!Array.isArray(keys)) {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
"xo": "0.61.1"
},
"type": "module",
"eslintIgnore": [
"index.d.ts"
]
"xo": {
"ignores": [
"*.d.ts"
]
}
}