@ibiz-template/model-helper 0.7.41-alpha.24 → 0.7.41-alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -20132,9 +20132,11 @@ HistoryItem.Undefined = new HistoryItem(void 0);
20132
20132
  // ../core/out/utils/recursive/find-recursive-child.js
20133
20133
  var IterateOpts = {
20134
20134
  /** 子集合属性数组 */
20135
- childrenFields: ["children"]
20135
+ childrenFields: ["children"],
20136
+ /** 是否跳出当前操作 */
20137
+ isBreak: false
20136
20138
  };
20137
- var BreakError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
20139
+ var ReturnError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
20138
20140
  function getChildField(parent, fields) {
20139
20141
  var _a;
20140
20142
  for (const field of fields) {
@@ -20147,10 +20149,14 @@ function _recursiveIterate(parent, callback, opts) {
20147
20149
  const { childrenFields } = mergeDeepRight_default(IterateOpts, opts || {});
20148
20150
  const children = getChildField(parent, childrenFields);
20149
20151
  if (children === null || children === void 0 ? void 0 : children.length) {
20150
- for (const child of children) {
20151
- const isBreak = callback(child, parent);
20152
- if (isBreak) {
20153
- throw BreakError;
20152
+ for (let i = 0; i < children.length; i++) {
20153
+ const child = children[i];
20154
+ const result = callback(child, parent);
20155
+ if (result) {
20156
+ if (opts === null || opts === void 0 ? void 0 : opts.isBreak) {
20157
+ break;
20158
+ }
20159
+ throw ReturnError;
20154
20160
  }
20155
20161
  recursiveIterate(child, callback, opts);
20156
20162
  }
@@ -20160,7 +20166,7 @@ function recursiveIterate(parent, callback, opts) {
20160
20166
  try {
20161
20167
  _recursiveIterate(parent, callback, opts);
20162
20168
  } catch (error) {
20163
- if (error !== BreakError) {
20169
+ if (error !== ReturnError) {
20164
20170
  throw error;
20165
20171
  }
20166
20172
  }