Skip to content

Commit 028c20b

Browse files
committed
refactor: replace lodash.debounce with ts-debounce
1 parent a5c48b6 commit 028c20b

File tree

5 files changed

+9
-26
lines changed

5 files changed

+9
-26
lines changed

packages/@vuepress/plugin-active-header-links/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,10 @@
3232
"@vuepress/client": "2.0.0-alpha.20",
3333
"@vuepress/core": "2.0.0-alpha.20",
3434
"@vuepress/utils": "2.0.0-alpha.20",
35-
"lodash.debounce": "^4.0.8",
35+
"ts-debounce": "^2.3.0",
3636
"vue": "^3.0.5",
3737
"vue-router": "^4.0.3"
3838
},
39-
"devDependencies": {
40-
"@types/lodash.debounce": "^4.0.6"
41-
},
4239
"publishConfig": {
4340
"access": "public"
4441
}

packages/@vuepress/plugin-active-header-links/src/composables/useActiveHeaderLinks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { debounce } from 'ts-debounce'
12
import { onMounted, onBeforeUnmount, watch } from 'vue'
23
import { useRouter } from 'vue-router'
34
import type { Router } from 'vue-router'
45
import { usePageData } from '@vuepress/client'
5-
// @ts-ignore
6-
import * as debounce from 'lodash.debounce'
76

87
export interface UseActiveHeaderLinksOptions {
98
headerLinkSelector: string

packages/@vuepress/plugin-back-to-top/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"dependencies": {
3232
"@vuepress/core": "2.0.0-alpha.20",
3333
"@vuepress/utils": "2.0.0-alpha.20",
34-
"lodash.debounce": "^4.0.8",
34+
"ts-debounce": "^2.3.0",
3535
"vue": "^3.0.5"
3636
},
3737
"publishConfig": {

packages/@vuepress/plugin-back-to-top/src/components/BackToTop.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828
</template>
2929

3030
<script lang="ts">
31+
import { debounce } from 'ts-debounce'
3132
import { computed, defineComponent, onMounted, ref } from 'vue'
32-
// @ts-ignore
33-
import * as debounce from 'lodash.debounce'
3433
3534
const getScrollTop = (): number =>
3635
window.pageYOffset ||

yarn.lock

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,18 +2515,6 @@
25152515
resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.0.tgz#c0ca4c253664492dbf47a646f31cfd483a6bbc95"
25162516
integrity sha512-x9OaQQTb1N2hPZ/LWJsqushexDvz7NgzuZxiRmZio44WPuolTZNHDBCrOxCzRVOMwamJRO2dWax5NbygOf1OTQ==
25172517

2518-
"@types/lodash.debounce@^4.0.6":
2519-
version "4.0.6"
2520-
resolved "https://registry.yarnpkg.com/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz#c5a2326cd3efc46566c47e4c0aa248dc0ee57d60"
2521-
integrity sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ==
2522-
dependencies:
2523-
"@types/lodash" "*"
2524-
2525-
"@types/lodash@*":
2526-
version "4.14.168"
2527-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
2528-
integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==
2529-
25302518
"@types/markdown-it@^12.0.1":
25312519
version "12.0.1"
25322520
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.0.1.tgz#8391e19fea4796ff863edda55800c7e669beb358"
@@ -7895,11 +7883,6 @@ lodash.clonedeep@^4.5.0:
78957883
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
78967884
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
78977885

7898-
lodash.debounce@^4.0.8:
7899-
version "4.0.8"
7900-
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
7901-
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
7902-
79037886
lodash.get@^4.4.2:
79047887
version "4.4.2"
79057888
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
@@ -11369,6 +11352,11 @@ trim-off-newlines@^1.0.0:
1136911352
resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3"
1137011353
integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM=
1137111354

11355+
ts-debounce@^2.3.0:
11356+
version "2.3.0"
11357+
resolved "https://registry.yarnpkg.com/ts-debounce/-/ts-debounce-2.3.0.tgz#a360a8bd29402ce0ea9970f7cfc0df44dfae7139"
11358+
integrity sha512-j63IP7/unAzovrhVHE7U+fNkvDKwIaLH11dCO9TcRbYOZw1chPL054poqq3ZloyRJ5KwJMeB8csN/vGPPpQJjw==
11359+
1137211360
ts-jest@^26.4.4:
1137311361
version "26.4.4"
1137411362
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.4.tgz#61f13fb21ab400853c532270e52cc0ed7e502c49"

0 commit comments

Comments
 (0)