@next-core/brick-utils 2.37.11 → 2.37.14

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [2.37.11](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.10...@next-core/brick-utils@2.37.11) (2022-04-26)
6
+ ## [2.37.14](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.13...@next-core/brick-utils@2.37.14) (2022-05-09)
7
7
 
8
8
  **Note:** Version bump only for package @next-core/brick-utils
9
9
 
@@ -11,138 +11,88 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [2.37.10](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.9...@next-core/brick-utils@2.37.10) (2022-04-22)
15
-
16
- **Note:** Version bump only for package @next-core/brick-utils
14
+ ## [2.37.13](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.12...@next-core/brick-utils@2.37.13) (2022-05-07)
17
15
 
16
+ ### Bug Fixes
18
17
 
18
+ - ignore screenshot in builder nodes ([1e59600](https://github.com/easyops-cn/next-core/commit/1e59600e13bb95ffdf8d3440b60d77b39efa075b))
19
19
 
20
+ ## [2.37.12](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.11...@next-core/brick-utils@2.37.12) (2022-05-06)
20
21
 
22
+ **Note:** Version bump only for package @next-core/brick-utils
21
23
 
22
- ## [2.37.9](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.8...@next-core/brick-utils@2.37.9) (2022-04-21)
24
+ ## [2.37.11](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.10...@next-core/brick-utils@2.37.11) (2022-04-26)
23
25
 
24
26
  **Note:** Version bump only for package @next-core/brick-utils
25
27
 
28
+ ## [2.37.10](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.9...@next-core/brick-utils@2.37.10) (2022-04-22)
26
29
 
30
+ **Note:** Version bump only for package @next-core/brick-utils
27
31
 
32
+ ## [2.37.9](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.8...@next-core/brick-utils@2.37.9) (2022-04-21)
28
33
 
34
+ **Note:** Version bump only for package @next-core/brick-utils
29
35
 
30
36
  ## [2.37.8](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.7...@next-core/brick-utils@2.37.8) (2022-04-19)
31
37
 
32
38
  **Note:** Version bump only for package @next-core/brick-utils
33
39
 
34
-
35
-
36
-
37
-
38
40
  ## [2.37.7](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.6...@next-core/brick-utils@2.37.7) (2022-04-14)
39
41
 
40
42
  **Note:** Version bump only for package @next-core/brick-utils
41
43
 
42
-
43
-
44
-
45
-
46
44
  ## [2.37.6](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.5...@next-core/brick-utils@2.37.6) (2022-04-07)
47
45
 
48
46
  **Note:** Version bump only for package @next-core/brick-utils
49
47
 
50
-
51
-
52
-
53
-
54
48
  ## [2.37.5](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.4...@next-core/brick-utils@2.37.5) (2022-04-06)
55
49
 
56
50
  **Note:** Version bump only for package @next-core/brick-utils
57
51
 
58
-
59
-
60
-
61
-
62
52
  ## [2.37.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.3...@next-core/brick-utils@2.37.4) (2022-03-29)
63
53
 
64
54
  **Note:** Version bump only for package @next-core/brick-utils
65
55
 
66
-
67
-
68
-
69
-
70
56
  ## [2.37.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.2...@next-core/brick-utils@2.37.3) (2022-03-29)
71
57
 
72
58
  **Note:** Version bump only for package @next-core/brick-utils
73
59
 
74
-
75
-
76
-
77
-
78
60
  ## [2.37.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.1...@next-core/brick-utils@2.37.2) (2022-03-28)
79
61
 
80
62
  **Note:** Version bump only for package @next-core/brick-utils
81
63
 
82
-
83
-
84
-
85
-
86
64
  ## [2.37.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.37.0...@next-core/brick-utils@2.37.1) (2022-03-24)
87
65
 
88
-
89
66
  ### Bug Fixes
90
67
 
91
- * ignore `previewSettings` when building route node ([8cffb40](https://github.com/easyops-cn/next-core/commit/8cffb40b0c583a989c29518a1ed3ef2c8b24ad62))
92
-
93
-
94
-
95
-
68
+ - ignore `previewSettings` when building route node ([8cffb40](https://github.com/easyops-cn/next-core/commit/8cffb40b0c583a989c29518a1ed3ef2c8b24ad62))
96
69
 
97
70
  # [2.37.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.36.0...@next-core/brick-utils@2.37.0) (2022-03-24)
98
71
 
99
-
100
72
  ### Features
101
73
 
102
- * support APP.getMenu ([#1651](https://github.com/easyops-cn/next-core/issues/1651)) ([5b9f53a](https://github.com/easyops-cn/next-core/commit/5b9f53a3367087a062f415dd68070f15b98bf966))
103
-
104
-
105
-
106
-
74
+ - support APP.getMenu ([#1651](https://github.com/easyops-cn/next-core/issues/1651)) ([5b9f53a](https://github.com/easyops-cn/next-core/commit/5b9f53a3367087a062f415dd68070f15b98bf966))
107
75
 
108
76
  # [2.36.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.35.3...@next-core/brick-utils@2.36.0) (2022-03-18)
109
77
 
110
-
111
78
  ### Features
112
79
 
113
- * new util function: debounceByAnimationFrame ([d47d032](https://github.com/easyops-cn/next-core/commit/d47d032dea4f9a55e8b642b0d2af926e808c716f))
114
-
115
-
116
-
117
-
80
+ - new util function: debounceByAnimationFrame ([d47d032](https://github.com/easyops-cn/next-core/commit/d47d032dea4f9a55e8b642b0d2af926e808c716f))
118
81
 
119
82
  ## [2.35.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.35.2...@next-core/brick-utils@2.35.3) (2022-03-15)
120
83
 
121
84
  **Note:** Version bump only for package @next-core/brick-utils
122
85
 
123
-
124
-
125
-
126
-
127
86
  ## [2.35.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.35.1...@next-core/brick-utils@2.35.2) (2022-03-07)
128
87
 
129
-
130
88
  ### Bug Fixes
131
89
 
132
- * fix get deps when brick package has no editors ([833739d](https://github.com/easyops-cn/next-core/commit/833739de875706666a8555d1becb35043f88efc6))
133
-
134
-
135
-
136
-
90
+ - fix get deps when brick package has no editors ([833739d](https://github.com/easyops-cn/next-core/commit/833739de875706666a8555d1becb35043f88efc6))
137
91
 
138
92
  ## [2.35.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.35.0...@next-core/brick-utils@2.35.1) (2022-02-28)
139
93
 
140
94
  **Note:** Version bump only for package @next-core/brick-utils
141
95
 
142
-
143
-
144
-
145
-
146
96
  # [2.35.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.34.2...@next-core/brick-utils@2.35.0) (2022-02-21)
147
97
 
148
98
  ### Features
@@ -1,16 +1,16 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@babel/runtime/helpers/defineProperty'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/taggedTemplateLiteral'), require('@next-core/pipes'), require('js-yaml')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/taggedTemplateLiteral', '@next-core/pipes', 'js-yaml'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickUtils = {}, global._asyncToGenerator, global.lodash, global._defineProperty, global._objectSpread, global._objectWithoutProperties, global._taggedTemplateLiteral, global.pipes, global.yaml));
5
- })(this, (function (exports, _asyncToGenerator, lodash, _defineProperty, _objectSpread, _objectWithoutProperties, _taggedTemplateLiteral, pipes, yaml) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/asyncToGenerator'), require('lodash'), require('@babel/runtime/helpers/defineProperty'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/taggedTemplateLiteral'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@next-core/pipes'), require('js-yaml')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/asyncToGenerator', 'lodash', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/taggedTemplateLiteral', '@babel/runtime/helpers/objectWithoutProperties', '@next-core/pipes', 'js-yaml'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickUtils = {}, global._asyncToGenerator, global.lodash, global._defineProperty, global._objectSpread, global._taggedTemplateLiteral, global._objectWithoutProperties, global.pipes, global.yaml));
5
+ })(this, (function (exports, _asyncToGenerator, lodash, _defineProperty, _objectSpread, _taggedTemplateLiteral, _objectWithoutProperties, pipes, yaml) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
9
  var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
10
10
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
11
11
  var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
12
- var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
13
12
  var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
13
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
14
14
  var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
15
15
 
16
16
  var cache$1 = new Map();
@@ -21027,7 +21027,7 @@
21027
21027
  break;
21028
21028
  }
21029
21029
 
21030
- if (!name) throw new TypeError("Missing parameter name at " + i);
21030
+ if (!name) throw new TypeError("Missing parameter name at ".concat(i));
21031
21031
  tokens.push({
21032
21032
  type: "NAME",
21033
21033
  index: i,
@@ -21043,7 +21043,7 @@
21043
21043
  var j = i + 1;
21044
21044
 
21045
21045
  if (str[j] === "?") {
21046
- throw new TypeError("Pattern cannot start with \"?\" at " + j);
21046
+ throw new TypeError("Pattern cannot start with \"?\" at ".concat(j));
21047
21047
  }
21048
21048
 
21049
21049
  while (j < str.length) {
@@ -21063,15 +21063,15 @@
21063
21063
  count++;
21064
21064
 
21065
21065
  if (str[j + 1] !== "?") {
21066
- throw new TypeError("Capturing groups are not allowed at " + j);
21066
+ throw new TypeError("Capturing groups are not allowed at ".concat(j));
21067
21067
  }
21068
21068
  }
21069
21069
 
21070
21070
  pattern += str[j++];
21071
21071
  }
21072
21072
 
21073
- if (count) throw new TypeError("Unbalanced pattern at " + i);
21074
- if (!pattern) throw new TypeError("Missing pattern at " + i);
21073
+ if (count) throw new TypeError("Unbalanced pattern at ".concat(i));
21074
+ if (!pattern) throw new TypeError("Missing pattern at ".concat(i));
21075
21075
  tokens.push({
21076
21076
  type: "PATTERN",
21077
21077
  index: i,
@@ -21108,7 +21108,7 @@
21108
21108
  var tokens = lexer(str);
21109
21109
  var _a = options.prefixes,
21110
21110
  prefixes = _a === void 0 ? "./" : _a;
21111
- var defaultPattern = "[^" + escapeString(options.delimiter || "/#?") + "]+?";
21111
+ var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?");
21112
21112
  var result = [];
21113
21113
  var key = 0;
21114
21114
  var i = 0;
@@ -21124,12 +21124,12 @@
21124
21124
  var _a = tokens[i],
21125
21125
  nextType = _a.type,
21126
21126
  index = _a.index;
21127
- throw new TypeError("Unexpected " + nextType + " at " + index + ", expected " + type);
21127
+ throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type));
21128
21128
  };
21129
21129
 
21130
21130
  var consumeText = function () {
21131
21131
  var result = "";
21132
- var value; // tslint:disable-next-line
21132
+ var value;
21133
21133
 
21134
21134
  while (value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) {
21135
21135
  result += value;
@@ -21227,7 +21227,7 @@
21227
21227
 
21228
21228
  var matches = tokens.map(function (token) {
21229
21229
  if (typeof token === "object") {
21230
- return new RegExp("^(?:" + token.pattern + ")$", reFlags);
21230
+ return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags);
21231
21231
  }
21232
21232
  });
21233
21233
  return function (data) {
@@ -21247,19 +21247,19 @@
21247
21247
 
21248
21248
  if (Array.isArray(value)) {
21249
21249
  if (!repeat) {
21250
- throw new TypeError("Expected \"" + token.name + "\" to not repeat, but got an array");
21250
+ throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array"));
21251
21251
  }
21252
21252
 
21253
21253
  if (value.length === 0) {
21254
21254
  if (optional) continue;
21255
- throw new TypeError("Expected \"" + token.name + "\" to not be empty");
21255
+ throw new TypeError("Expected \"".concat(token.name, "\" to not be empty"));
21256
21256
  }
21257
21257
 
21258
21258
  for (var j = 0; j < value.length; j++) {
21259
21259
  var segment = encode(value[j], token);
21260
21260
 
21261
21261
  if (validate && !matches[i].test(segment)) {
21262
- throw new TypeError("Expected all \"" + token.name + "\" to match \"" + token.pattern + "\", but got \"" + segment + "\"");
21262
+ throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
21263
21263
  }
21264
21264
 
21265
21265
  path += token.prefix + segment + token.suffix;
@@ -21272,7 +21272,7 @@
21272
21272
  var segment = encode(String(value), token);
21273
21273
 
21274
21274
  if (validate && !matches[i].test(segment)) {
21275
- throw new TypeError("Expected \"" + token.name + "\" to match \"" + token.pattern + "\", but got \"" + segment + "\"");
21275
+ throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\""));
21276
21276
  }
21277
21277
 
21278
21278
  path += token.prefix + segment + token.suffix;
@@ -21281,7 +21281,7 @@
21281
21281
 
21282
21282
  if (optional) continue;
21283
21283
  var typeOfMessage = repeat ? "an array" : "a string";
21284
- throw new TypeError("Expected \"" + token.name + "\" to be " + typeOfMessage);
21284
+ throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage));
21285
21285
  }
21286
21286
 
21287
21287
  return path;
@@ -21336,7 +21336,7 @@
21336
21336
  var parts = paths.map(function (path) {
21337
21337
  return pathToRegexp(path, keys, options).source;
21338
21338
  });
21339
- return new RegExp("(?:" + parts.join("|") + ")", flags(options));
21339
+ return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
21340
21340
  }
21341
21341
  /**
21342
21342
  * Create a path regexp from string input.
@@ -21365,9 +21365,13 @@
21365
21365
  _d = options.encode,
21366
21366
  encode = _d === void 0 ? function (x) {
21367
21367
  return x;
21368
- } : _d;
21369
- var endsWith = "[" + escapeString(options.endsWith || "") + "]|$";
21370
- var delimiter = "[" + escapeString(options.delimiter || "/#?") + "]";
21368
+ } : _d,
21369
+ _e = options.delimiter,
21370
+ delimiter = _e === void 0 ? "/#?" : _e,
21371
+ _f = options.endsWith,
21372
+ endsWith = _f === void 0 ? "" : _f;
21373
+ var endsWithRe = "[".concat(escapeString(endsWith), "]|$");
21374
+ var delimiterRe = "[".concat(escapeString(delimiter), "]");
21371
21375
  var route = start ? "^" : ""; // Iterate over the tokens and create our regexp string.
21372
21376
 
21373
21377
  for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
@@ -21385,33 +21389,36 @@
21385
21389
  if (prefix || suffix) {
21386
21390
  if (token.modifier === "+" || token.modifier === "*") {
21387
21391
  var mod = token.modifier === "*" ? "?" : "";
21388
- route += "(?:" + prefix + "((?:" + token.pattern + ")(?:" + suffix + prefix + "(?:" + token.pattern + "))*)" + suffix + ")" + mod;
21392
+ route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod);
21389
21393
  } else {
21390
- route += "(?:" + prefix + "(" + token.pattern + ")" + suffix + ")" + token.modifier;
21394
+ route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier);
21391
21395
  }
21392
21396
  } else {
21393
- route += "(" + token.pattern + ")" + token.modifier;
21397
+ if (token.modifier === "+" || token.modifier === "*") {
21398
+ route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")");
21399
+ } else {
21400
+ route += "(".concat(token.pattern, ")").concat(token.modifier);
21401
+ }
21394
21402
  }
21395
21403
  } else {
21396
- route += "(?:" + prefix + suffix + ")" + token.modifier;
21404
+ route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier);
21397
21405
  }
21398
21406
  }
21399
21407
  }
21400
21408
 
21401
21409
  if (end) {
21402
- if (!strict) route += delimiter + "?";
21403
- route += !options.endsWith ? "$" : "(?=" + endsWith + ")";
21410
+ if (!strict) route += "".concat(delimiterRe, "?");
21411
+ route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")");
21404
21412
  } else {
21405
21413
  var endToken = tokens[tokens.length - 1];
21406
- var isEndDelimited = typeof endToken === "string" ? delimiter.indexOf(endToken[endToken.length - 1]) > -1 : // tslint:disable-next-line
21407
- endToken === undefined;
21414
+ var isEndDelimited = typeof endToken === "string" ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 : endToken === undefined;
21408
21415
 
21409
21416
  if (!strict) {
21410
- route += "(?:" + delimiter + "(?=" + endsWith + "))?";
21417
+ route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?");
21411
21418
  }
21412
21419
 
21413
21420
  if (!isEndDelimited) {
21414
- route += "(?=" + delimiter + "|" + endsWith + ")";
21421
+ route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")");
21415
21422
  }
21416
21423
  }
21417
21424
 
@@ -22660,7 +22667,7 @@
22660
22667
 
22661
22668
  var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
22662
22669
 
22663
- var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
22670
+ var baseFieldsToRemove = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
22664
22671
  var fieldsToRemoveInRoute = baseFieldsToRemove.concat("instanceId");
22665
22672
  var fieldsToRemoveInBrick = baseFieldsToRemove.concat("type", "alias"); // Those fields can be disposed if value is null.
22666
22673