# [设计]Async-Validator
- @by https://github.com/yiminghe (opens new window)
- @code https://github.com/yiminghe/async-validator (opens new window)
# 构建工具
- pikapkg
# 项目结构
rule/*
validator/*
index.js
messages.js
util.js
# 核心解读
# 工具类
- isNativeStringType
- isEmptyValue
- isEmptyObject
- complementError
- convertFieldsError
- flattenObjArr
- format
- deepMerge
export function deepMerge(target, source) {
if (source) {
for (const s in source) {
if (source.hasOwnProperty(s)) {
const value = source[s];
if (typeof value === 'object' && typeof target[s] === 'object') {
target[s] = {
...target[s],
...value,
};
} else {
target[s] = value;
}
}
}
}
return target;
}
- asyncParallelArray
- asyncParallelArray
- asyncMap