Skip to content

Commit ede739e

Browse files
committed
fix: remove lodash-es from deps
1 parent 694058b commit ede739e

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
lines changed

core/router.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { mapValues } from 'lodash-es'
21
import { Signal, signal, computed, effect } from '@preact/signals-core'
32

4-
import { buildURL } from '$utility/url'
3+
import { mapValues, buildURL } from '$utility'
54

65
import {
76
RouteName,

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@commitlint/cli": "^17.4.4",
5454
"@commitlint/config-conventional": "^17.4.4",
5555
"@commitlint/types": "^17.4.4",
56-
"@types/lodash-es": "^4.17.6",
56+
"@types/lodash-es": "^4.17.7",
5757
"@types/react": "^18.0.28",
5858
"@types/react-dom": "^18.0.11",
5959
"@typescript-eslint/eslint-plugin": "^5.55.0",
@@ -65,6 +65,7 @@
6565
"eslint-plugin-react": "^7.32.2",
6666
"eslint-plugin-react-hooks": "^4.6.0",
6767
"eslint-plugin-unused-imports": "^2.0.0",
68+
"lodash-es": "^4.17.21",
6869
"prettier": "^2.8.4",
6970
"pretty-quick": "^3.1.3",
7071
"publint": "^0.1.11",
@@ -80,7 +81,6 @@
8081
"zod": "^3.21.4"
8182
},
8283
"dependencies": {
83-
"@preact/signals-core": "^1.2.3",
84-
"lodash-es": "^4.17.21"
84+
"@preact/signals-core": "^1.2.3"
8585
}
8686
}

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utility/functions.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const mapValues = <Value extends object, Result extends object>(
2+
original: Value,
3+
iteratee: (
4+
value: Value[keyof Value],
5+
key: keyof Value,
6+
original: Value
7+
) => Result
8+
) => {
9+
type Key = keyof Value
10+
type NewValues = Record<Key, Result>
11+
12+
const values = Object(original)
13+
const newValues = {} as NewValues
14+
15+
Object.keys(values).forEach(key => {
16+
newValues[key as Key] = iteratee(values[key], key as Key, values)
17+
})
18+
19+
return newValues
20+
}

utility/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './url'
2+
export * from './functions'

0 commit comments

Comments
 (0)