From 80c40aab11eb9bff31c310c2784c3be9ef0e5cb8 Mon Sep 17 00:00:00 2001 From: yifanwww Date: Sun, 13 Aug 2023 03:20:36 +0800 Subject: [PATCH] refactor: use lodash noop --- packages/app-common/src/utils/function.ts | 3 --- packages/app-common/src/utils/index.ts | 2 +- packages/app-renderer/package.json | 3 ++- .../src/hooks/__tests__/usePersistFn.test.tsx | 2 +- pnpm-lock.yaml | 19 ++++++++++--------- 5 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 packages/app-common/src/utils/function.ts diff --git a/packages/app-common/src/utils/function.ts b/packages/app-common/src/utils/function.ts deleted file mode 100644 index 019b501f..00000000 --- a/packages/app-common/src/utils/function.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function noop(): void { - // No operation performed. -} diff --git a/packages/app-common/src/utils/index.ts b/packages/app-common/src/utils/index.ts index 2653adb2..cb0ff5c3 100644 --- a/packages/app-common/src/utils/index.ts +++ b/packages/app-common/src/utils/index.ts @@ -1 +1 @@ -export * from './function'; +export {}; diff --git a/packages/app-renderer/package.json b/packages/app-renderer/package.json index dab1e5b3..b94f56fa 100644 --- a/packages/app-renderer/package.json +++ b/packages/app-renderer/package.json @@ -33,7 +33,7 @@ "@ter/app-common": "workspace:*", "clsx": "^1.2.1", "immer": "^9.0.21", - "radash": "^11.0.0", + "lodash": "^4.17.21", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "^8.1.0", @@ -50,6 +50,7 @@ "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", "@types/jest": "^29.5.2", + "@types/lodash": "^4.14.197", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@types/react-test-renderer": "^18.0.0", diff --git a/packages/app-renderer/src/hooks/__tests__/usePersistFn.test.tsx b/packages/app-renderer/src/hooks/__tests__/usePersistFn.test.tsx index 54535d9b..2fe39775 100644 --- a/packages/app-renderer/src/hooks/__tests__/usePersistFn.test.tsx +++ b/packages/app-renderer/src/hooks/__tests__/usePersistFn.test.tsx @@ -1,6 +1,6 @@ import type { Nullable } from '@ter/app-common/types'; -import { noop } from '@ter/app-common/utils'; import { act, render } from '@testing-library/react'; +import { noop } from 'lodash'; import { useState } from 'react'; import { validateHookValueNotChanged } from 'src/__tests__/hook'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3792a07a..0fc3308b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -138,9 +138,9 @@ importers: immer: specifier: ^9.0.21 version: 9.0.21 - radash: - specifier: ^11.0.0 - version: 11.0.0 + lodash: + specifier: ^4.17.21 + version: 4.17.21 react: specifier: ^18.2.0 version: 18.2.0 @@ -184,6 +184,9 @@ importers: '@types/jest': specifier: ^29.5.2 version: 29.5.2 + '@types/lodash': + specifier: ^4.14.197 + version: 4.14.197 '@types/react': specifier: ^18.2.15 version: 18.2.15 @@ -2768,6 +2771,10 @@ packages: '@types/node': 18.16.18 dev: true + /@types/lodash@4.14.197: + resolution: {integrity: sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==} + dev: true + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -6922,7 +6929,6 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: true /log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} @@ -7929,11 +7935,6 @@ packages: engines: {node: '>=10'} dev: true - /radash@11.0.0: - resolution: {integrity: sha512-CRWxTFTDff0IELGJ/zz58yY4BDgyI14qSM5OLNKbCItJrff7m7dXbVF0kWYVCXQtPb3SXIVhXvAImH6eT7VLSg==} - engines: {node: '>=14.18.0'} - dev: false - /raf@3.4.1: resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==} dependencies: