Remove dependency on lodash

This commit is contained in:
Tristan Edwards 2022-12-20 06:47:32 +00:00
parent 7c13a5d2bc
commit c34a02589b
4 changed files with 4096 additions and 4022 deletions

View File

@ -53,7 +53,6 @@
"@size-limit/preset-small-lib": "^8.1.0",
"@tsconfig/create-react-app": "^1.0.3",
"@tsconfig/recommended": "^1.0.1",
"@types/lodash.uniqby": "^4.7.7",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"dts-cli": "^1.6.0",
@ -65,6 +64,6 @@
"typescript": "^4.9.4"
},
"dependencies": {
"lodash.uniqby": "^4.7.0"
"@nostrgg/client": "^0.1.0"
}
}

View File

@ -7,7 +7,7 @@ import {
useRef,
} from 'react';
import { uniqBy } from 'lodash';
import { uniqBy } from './utils';
import {
OnConnectFunc,

11
src/utils.ts Normal file
View File

@ -0,0 +1,11 @@
export const uniqBy = <T>(arr: T[], key: keyof T): T[] => {
return Object.values(
arr.reduce(
(map, item) => ({
...map,
[`${item[key]}`]: item,
}),
{}
)
);
};

8102
yarn.lock

File diff suppressed because it is too large Load Diff