@trops/dash-core 0.1.253 → 0.1.255

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.js CHANGED
@@ -160,7 +160,9 @@ var DashboardPublisher = {
160
160
  if (DashReact.isObject(listeners) === true) {
161
161
  Object.keys(listeners).forEach(function (handlerKey) {
162
162
  if (handlerKey in listeners) {
163
- listeners[handlerKey].forEach(function (event) {
163
+ var events = listeners[handlerKey];
164
+ if (!Array.isArray(events)) return;
165
+ events.forEach(function (event) {
164
166
  // subscribe our listeners
165
167
  DashboardPublisher.sub(event, handlerMap[handlerKey], uuid);
166
168
  });
@@ -33625,10 +33627,18 @@ function evaluateBundle(source, widgetName) {
33625
33627
  }
33626
33628
  throw new Error("[widgetBundleLoader] Widget \"".concat(widgetName, "\" requires unknown module: \"").concat(name, "\""));
33627
33629
  };
33630
+
33631
+ // Provide a process shim so bundles that reference process.env.NODE_ENV
33632
+ // (common in React libraries) don't throw ReferenceError in the sandbox.
33633
+ var process = {
33634
+ env: {
33635
+ NODE_ENV: "production"
33636
+ }
33637
+ };
33628
33638
  try {
33629
33639
  // eslint-disable-next-line no-new-func
33630
- var fn = new Function("module", "exports", "require", source);
33631
- fn(module, exports, require);
33640
+ var fn = new Function("module", "exports", "require", "process", source);
33641
+ fn(module, exports, require, process);
33632
33642
  } catch (error) {
33633
33643
  throw error;
33634
33644
  }