@next-core/brick-kit 2.117.14 → 2.117.15

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,6 +3,17 @@
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.117.15](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.14...@next-core/brick-kit@2.117.15) (2022-04-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * mock _.uniqueId in storyboard functions ([f6d5eb2](https://github.com/easyops-cn/next-core/commit/f6d5eb2a6e00d7c5bd32e60a238b67c14641b840))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.117.14](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.13...@next-core/brick-kit@2.117.14) (2022-04-21)
7
18
 
8
19
  **Note:** Version bump only for package @next-core/brick-kit
@@ -582,7 +582,7 @@
582
582
  };
583
583
  }();
584
584
 
585
- function supply(attemptToVisitGlobals, providedGlobalVariables) {
585
+ function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {
586
586
  var globalVariables = _objectSpread__default["default"]({}, providedGlobalVariables); // Allow limited browser builtin values.
587
587
 
588
588
 
@@ -590,7 +590,7 @@
590
590
 
591
591
  for (var variableName of attemptToVisitGlobals) {
592
592
  if (!Object.prototype.hasOwnProperty.call(globalVariables, variableName)) {
593
- var variable = supplyIndividual(variableName);
593
+ var variable = supplyIndividual(variableName, mock);
594
594
 
595
595
  if (variable !== undefined) {
596
596
  globalVariables[variableName] = variable;
@@ -618,14 +618,14 @@
618
618
  var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
619
619
  var allowedGlobalObjects = new Set(["Array", "Boolean", "Date", "Infinity", "JSON", "Math", "NaN", "Number", "String", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "isFinite", "isNaN", "parseFloat", "parseInt", "Map", "Set", "URLSearchParams", "WeakMap", "WeakSet", "atob", "btoa"]);
620
620
 
621
- function supplyIndividual(variableName) {
621
+ function supplyIndividual(variableName, mock) {
622
622
  switch (variableName) {
623
623
  case "Object":
624
624
  // Do not allow mutable methods like `Object.assign`.
625
625
  return delegateMethods(Object, ["entries", "fromEntries", "keys", "values"]);
626
626
 
627
627
  case "_":
628
- return Object.fromEntries(Object.entries(lodash__default["default"]).filter(entry => !shouldOmitInLodash.has(entry[0])));
628
+ return Object.fromEntries(Object.entries(lodash__default["default"]).filter(entry => !shouldOmitInLodash.has(entry[0])).concat(mock ? [["uniqueId", prefix => "".concat(prefix !== null && prefix !== void 0 ? prefix : "", "42")]] : []));
629
629
 
630
630
  case "moment":
631
631
  return Object.assign(function () {
@@ -1687,7 +1687,7 @@
1687
1687
  app: currentApp,
1688
1688
  storyboardFunctions,
1689
1689
  isStoryboardFunction: true
1690
- })),
1690
+ }), !!collectCoverage),
1691
1691
  hooks: collector && {
1692
1692
  beforeEvaluate: collector.beforeEvaluate,
1693
1693
  beforeCall: collector.beforeCall,