@ibiz-template/core 0.7.41-alpha.23 → 0.7.41-alpha.33

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
@@ -6131,9 +6131,11 @@ async function setRemoteStyle(url) {
6131
6131
  import { mergeDeepRight as mergeDeepRight2 } from "ramda";
6132
6132
  var IterateOpts = {
6133
6133
  /** 子集合属性数组 */
6134
- childrenFields: ["children"]
6134
+ childrenFields: ["children"],
6135
+ /** 是否跳出当前操作 */
6136
+ isBreak: false
6135
6137
  };
6136
- var BreakError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6138
+ var ReturnError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6137
6139
  function getChildField(parent, fields) {
6138
6140
  var _a;
6139
6141
  for (const field of fields) {
@@ -6153,10 +6155,14 @@ function _recursiveIterate(parent, callback, opts) {
6153
6155
  const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6154
6156
  const children = getChildField(parent, childrenFields);
6155
6157
  if (children == null ? void 0 : children.length) {
6156
- for (const child of children) {
6157
- const isBreak = callback(child, parent);
6158
- if (isBreak) {
6159
- throw BreakError;
6158
+ for (let i = 0; i < children.length; i++) {
6159
+ const child = children[i];
6160
+ const result = callback(child, parent);
6161
+ if (result) {
6162
+ if (opts == null ? void 0 : opts.isBreak) {
6163
+ break;
6164
+ }
6165
+ throw ReturnError;
6160
6166
  }
6161
6167
  recursiveIterate(child, callback, opts);
6162
6168
  }
@@ -6166,7 +6172,7 @@ function recursiveIterate(parent, callback, opts) {
6166
6172
  try {
6167
6173
  _recursiveIterate(parent, callback, opts);
6168
6174
  } catch (error) {
6169
- if (error !== BreakError) {
6175
+ if (error !== ReturnError) {
6170
6176
  throw error;
6171
6177
  }
6172
6178
  }
@@ -6175,10 +6181,14 @@ function _recursiveExecute(parent, callback, opts) {
6175
6181
  const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6176
6182
  const children = getChildFieldObj(parent, childrenFields);
6177
6183
  if (children) {
6178
- for (const child of Object.values(children)) {
6179
- const isBreak = callback(child, parent);
6180
- if (isBreak) {
6181
- throw BreakError;
6184
+ for (let i = 0; i < Object.values(children).length; i++) {
6185
+ const child = Object.values(children)[i];
6186
+ const result = callback(child, parent);
6187
+ if (result) {
6188
+ if (opts == null ? void 0 : opts.isBreak) {
6189
+ break;
6190
+ }
6191
+ throw ReturnError;
6182
6192
  }
6183
6193
  _recursiveExecute(child, callback, opts);
6184
6194
  }
@@ -6188,7 +6198,7 @@ function recursiveExecute(parent, callback, opts) {
6188
6198
  try {
6189
6199
  _recursiveExecute(parent, callback, opts);
6190
6200
  } catch (error) {
6191
- if (error !== BreakError) {
6201
+ if (error !== ReturnError) {
6192
6202
  throw error;
6193
6203
  }
6194
6204
  }