Skip to content

Commit be1e141

Browse files
Ali-ovocrazylxr
andauthored
chore: lodash changed to lodash-es (#2233)
Co-authored-by: 潇见 <[email protected]>
1 parent bedc734 commit be1e141

File tree

9 files changed

+3948
-7842
lines changed

9 files changed

+3948
-7842
lines changed

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ module.exports = {
1919
'!**/dist/**',
2020
],
2121
transformIgnorePatterns: ['^.+\\.js$'],
22+
moduleNameMapper: {
23+
'lodash-es': 'lodash',
24+
},
2225
};

packages/hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"dayjs": "^1.9.1",
4040
"intersection-observer": "^0.12.0",
4141
"js-cookie": "^2.x.x",
42-
"lodash": "^4.17.21",
42+
"lodash-es": "^4.17.21",
4343
"resize-observer-polyfill": "^1.5.1",
4444
"screenfull": "^5.0.0",
4545
"tslib": "^2.4.1"

packages/hooks/src/useDebounceFn/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import debounce from 'lodash/debounce';
1+
import { debounce } from 'lodash-es';
22
import { useMemo } from 'react';
33
import type { DebounceOptions } from '../useDebounce/debounceOptions';
44
import useLatest from '../useLatest';

packages/hooks/src/useReactive/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef } from 'react';
2-
import isPlainObject from 'lodash/isPlainObject';
2+
import { isPlainObject } from 'lodash-es';
33
import useCreation from '../useCreation';
44
import useUpdate from '../useUpdate';
55

packages/hooks/src/useRequest/src/plugins/useDebouncePlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { DebouncedFunc, DebounceSettings } from 'lodash';
2-
import debounce from 'lodash/debounce';
1+
import type { DebouncedFunc, DebounceSettings } from 'lodash-es';
2+
import { debounce } from 'lodash-es';
33
import { useEffect, useMemo, useRef } from 'react';
44
import type { Plugin } from '../types';
55

packages/hooks/src/useRequest/src/plugins/useThrottlePlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { DebouncedFunc, ThrottleSettings } from 'lodash';
2-
import throttle from 'lodash/throttle';
1+
import type { DebouncedFunc, ThrottleSettings } from 'lodash-es';
2+
import { throttle } from 'lodash-es';
33
import { useEffect, useRef } from 'react';
44
import type { Plugin } from '../types';
55

packages/hooks/src/useThrottleFn/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import throttle from 'lodash/throttle';
1+
import { throttle } from 'lodash-es';
22
import { useMemo } from 'react';
33
import useLatest from '../useLatest';
44
import type { ThrottleOptions } from '../useThrottle/throttleOptions';

packages/hooks/src/utils/depsEqual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { DependencyList } from 'react';
2-
import isEqual from 'lodash/isEqual';
2+
import { isEqual } from 'lodash-es';
33

44
export const depsEqual = (aDeps: DependencyList = [], bDeps: DependencyList = []) =>
55
isEqual(aDeps, bDeps);

0 commit comments

Comments
 (0)