提交 8ef90099 authored 作者: 钟是志's avatar 钟是志

拆分代码

上级 ae872145
...@@ -44,9 +44,8 @@ export function getBase64(value) { ...@@ -44,9 +44,8 @@ export function getBase64(value) {
return value ? base64.encode(new Buffer(value)) : null; return value ? base64.encode(new Buffer(value)) : null;
} }
const excludeKeys = ['defaultValues', ''];
const equal = (obj1, obj2, json, sqlContent, depth, props) => { const equal = (obj1, obj2, json, sqlContent, depth, props, excludeKeys) => {
if (obj1 == null && obj2 != null) { if (obj1 == null && obj2 != null) {
return false; return false;
} }
...@@ -135,7 +134,7 @@ const equal = (obj1, obj2, json, sqlContent, depth, props) => { ...@@ -135,7 +134,7 @@ const equal = (obj1, obj2, json, sqlContent, depth, props) => {
var xx = true; var xx = true;
for (var i = 0; i < obj1[key].length; i++) { for (var i = 0; i < obj1[key].length; i++) {
if (!equal(obj1[key][i], obj2[key][i], json, sqlContent, depth + 1)) { if (!equal(obj1[key][i], obj2[key][i], json, sqlContent, depth + 1, props, excludeKeys)) {
xx = false; xx = false;
break; break;
} }
...@@ -147,7 +146,7 @@ const equal = (obj1, obj2, json, sqlContent, depth, props) => { ...@@ -147,7 +146,7 @@ const equal = (obj1, obj2, json, sqlContent, depth, props) => {
} }
} }
} else if (obj1[key] instanceof Object) { } else if (obj1[key] instanceof Object) {
const x = equal(obj1[key], obj2[key], json, sqlContent, depth + 1); const x = equal(obj1[key], obj2[key], json, sqlContent, depth + 1, props, excludeKeys);
if (!x) { if (!x) {
res = false; res = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论