Skip to content

Commit

Permalink
feat: lodash -> lodash-es
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonYong committed Jul 13, 2024
1 parent 5302c1a commit 6846007
Show file tree
Hide file tree
Showing 17 changed files with 933 additions and 923 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@vitest/ui": "^0.25.3",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.0.0",
"@types/lodash": "^4.14.178",
"@types/lodash-es": "^4.17.12",
"@types/marked": "^4.0.3",
"@types/node": "^17.0.21",
"@types/qs": "^6.9.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@vue/devtools-api": "^6.5.0",
"@types/js-cookie": "^3.0.1",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"qs": "^6.11.0",
"query-string": "^7.1.1",
"screenfull": "^5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useDebounceFn/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import debounce from 'lodash/debounce'
import { debounce } from 'lodash-es'

export interface DebounceOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useEventEmitter/event.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cloneDeep from 'lodash/cloneDeep'
import { cloneDeep } from 'lodash-es'
import { ref, watchEffect } from 'vue'

type SubscriptionParams<T = any> = {
Expand Down
1 change: 0 additions & 1 deletion packages/hooks/src/useKeyPress/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ref } from 'vue'
// import { isFunction, isNumber, isString } from 'lodash'
import { BasicTarget, getTargetElement } from '../utils/domTarget'
import useDeepCompareEffectWithTarget from '../utils/useDeepCompareWithTarget'
import { isNumber, isFunction, isString } from '../utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/hooks/src/useRequest/plugins/useDebouncePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ref, computed, watchEffect, unref } from "vue";
import type { DebouncedFunc, DebounceSettings } from "lodash";
import debounce from "lodash/debounce";
import type { DebouncedFunc, DebounceSettings } from "lodash-es";
import { debounce } from "lodash-es";
import type { UseRequestPlugin } from "../types";

const useDebouncePlugin: UseRequestPlugin<unknown, unknown[]> = (
Expand Down
4 changes: 2 additions & 2 deletions packages/hooks/src/useRequest/plugins/useThrottlePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed, unref, watchEffect } from 'vue'
import { DebouncedFunc, ThrottleSettings } from 'lodash'
import throttle from 'lodash/throttle'
import { DebouncedFunc, ThrottleSettings } from 'lodash-es'
import { throttle } from 'lodash-es'
import { UseRequestPlugin } from '../types'

const useThrottlePlugin: UseRequestPlugin<unknown, unknown[]> = (
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useSetState/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref, Ref, unref, UnwrapRef, readonly, DeepReadonly, UnwrapNestedRefs } from 'vue'
import merge from 'lodash/merge'
import { merge } from 'lodash-es'

type UseSetStateType<S> = S | (() => S) | Ref<S> | (() => Ref<S>)

Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useThrottleFn/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import throttle from 'lodash/throttle'
import { throttle } from 'lodash-es'
import { onUnmounted, ref, computed } from 'vue'
import { UseThrottleOptions } from '../useThrottle'

Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/utils/useDeepCompareWithTarget.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue'
import isEqual from 'lodash/isEqual'
import { isEqual } from 'lodash-es'
import { EffectCallback } from './createEffectWithTarget'
import { DependencyList } from './depsAreSame'
import { BasicTarget } from './domTarget'
Expand Down
Loading

0 comments on commit 6846007

Please sign in to comment.