Skip to content

Commit

Permalink
chore: lodash changed to lodash-es (#2233)
Browse files Browse the repository at this point in the history
Co-authored-by: 潇见 <xiaojian.lj@antgroup.com>
  • Loading branch information
Ali-ovo and crazylxr committed Jun 27, 2023
1 parent bedc734 commit be1e141
Show file tree
Hide file tree
Showing 9 changed files with 3,948 additions and 7,842 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ module.exports = {
'!**/dist/**',
],
transformIgnorePatterns: ['^.+\\.js$'],
moduleNameMapper: {
'lodash-es': 'lodash',
},
};
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dayjs": "^1.9.1",
"intersection-observer": "^0.12.0",
"js-cookie": "^2.x.x",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"resize-observer-polyfill": "^1.5.1",
"screenfull": "^5.0.0",
"tslib": "^2.4.1"
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';
import { useMemo } from 'react';
import type { DebounceOptions } from '../useDebounce/debounceOptions';
import useLatest from '../useLatest';
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useReactive/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from 'react';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash-es';
import useCreation from '../useCreation';
import useUpdate from '../useUpdate';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DebouncedFunc, DebounceSettings } from 'lodash';
import debounce from 'lodash/debounce';
import type { DebouncedFunc, DebounceSettings } from 'lodash-es';
import { debounce } from 'lodash-es';
import { useEffect, useMemo, useRef } from 'react';
import type { Plugin } from '../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DebouncedFunc, ThrottleSettings } from 'lodash';
import throttle from 'lodash/throttle';
import type { DebouncedFunc, ThrottleSettings } from 'lodash-es';
import { throttle } from 'lodash-es';
import { useEffect, useRef } from 'react';
import type { Plugin } from '../types';

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 { useMemo } from 'react';
import useLatest from '../useLatest';
import type { ThrottleOptions } from '../useThrottle/throttleOptions';
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/utils/depsEqual.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DependencyList } from 'react';
import isEqual from 'lodash/isEqual';
import { isEqual } from 'lodash-es';

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

0 comments on commit be1e141

Please sign in to comment.