Skip to content

Commit cbc2bc6

Browse files
authored
chore: disable validate waring log (#563)
* chore: Improve DX revert: ec3a5bc#diff-1f7e42a89a341b70a9a47c7cab68b92d5cbf8448be6179a7ae5f1887da340bdeL28-L93 close: ant-design/ant-design#40497 * test: add case * chore: update * chore: remove redundant logic * Revert "chore: remove redundant logic" This reverts commit 32b061d. * Revert "chore: update" This reverts commit d7b7ffa. * Revert "test: add case" This reverts commit 4b69a0b. * Revert "chore: Improve DX" This reverts commit 104043c. * chore: update logic * Revert "Revert "chore: remove redundant logic"" This reverts commit 9f2a1f2. * chore: update
1 parent 5969e7f commit cbc2bc6

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/utils/validateUtil.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ async function validateRule(
4141
// https://github.com/react-component/field-form/issues/313
4242
delete (cloneRule as any).ruleIndex;
4343

44+
// https://github.com/ant-design/ant-design/issues/40497#issuecomment-1422282378
45+
AsyncValidator.warning = () => void 0;
46+
4447
if (cloneRule.validator) {
4548
const originValidator = cloneRule.validator;
4649
cloneRule.validator = (...args) => {

src/utils/valueUtil.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import get from 'rc-util/lib/utils/get';
2-
import set from 'rc-util/lib/utils/set';
1+
import getValue from 'rc-util/lib/utils/get';
2+
import setValue from 'rc-util/lib/utils/set';
33
import type { InternalNamePath, NamePath, Store, StoreValue, EventArgs } from '../interface';
44
import { toArray } from './typeUtil';
55
import cloneDeep from '../utils/cloneDeep';
66

7+
export { getValue, setValue };
8+
79
/**
810
* Convert name to internal supported format.
911
* This function should keep since we still thinking if need support like `a.b.c` format.
@@ -15,21 +17,6 @@ export function getNamePath(path: NamePath | null): InternalNamePath {
1517
return toArray(path);
1618
}
1719

18-
export function getValue(store: Store, namePath: InternalNamePath) {
19-
const value = get(store, namePath);
20-
return value;
21-
}
22-
23-
export function setValue(
24-
store: Store,
25-
namePath: InternalNamePath,
26-
value: StoreValue,
27-
removeIfUndefined = false,
28-
): Store {
29-
const newStore = set(store, namePath, value, removeIfUndefined);
30-
return newStore;
31-
}
32-
3320
export function cloneByNamePathList(store: Store, namePathList: InternalNamePath[]): Store {
3421
let newStore = {};
3522
namePathList.forEach(namePath => {

0 commit comments

Comments
 (0)