@interopio/browser-worker 3.5.0 → 4.1.0-beta.0

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.
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- /* global Reflect, Promise, SuppressedError, Symbol */
15
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16
16
 
17
17
 
18
18
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -26,8 +26,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
26
26
  }
27
27
 
28
28
  function __generator(thisArg, body) {
29
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
30
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
30
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
31
31
  function verb(n) { return function (v) { return step([n, v]); }; }
32
32
  function step(op) {
33
33
  if (f) throw new TypeError("Generator is already executing.");
@@ -868,11 +868,12 @@ var webWorkerConfigDecoder = object({
868
868
  }))
869
869
  });
870
870
 
871
+ /* @ts-self-types="./index.d.ts" */
871
872
  let urlAlphabet =
872
873
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
873
874
  let nanoid = (size = 21) => {
874
875
  let id = '';
875
- let i = size;
876
+ let i = size | 0;
876
877
  while (i--) {
877
878
  id += urlAlphabet[(Math.random() * 64) | 0];
878
879
  }
@@ -1261,7 +1262,7 @@ var openBrowserPlatform = function (url) {
1261
1262
  }
1262
1263
  };
1263
1264
  channel.addEventListener("message", openHandler);
1264
- self.clients.openWindow(url)["catch"](reject);
1265
+ self.clients.openWindow(url).catch(reject);
1265
1266
  setTimeout(function () { return reject("Timed out waiting for the platform to open and send a ready signal: ".concat(platformOpenTimeoutMS, " MS")); }, platformOpenTimeoutMS);
1266
1267
  });
1267
1268
  };
@@ -1355,7 +1356,8 @@ var setupCore = function (config) {
1355
1356
  vibrate: event.notification.vibrate
1356
1357
  };
1357
1358
  channel.postMessage({ messageType: messageType, action: action, glueData: glueData, definition: definition });
1358
- })["catch"](function (error) {
1359
+ })
1360
+ .catch(function (error) {
1359
1361
  var stringError = typeof error === "string" ? error : JSON.stringify(error.message);
1360
1362
  channel.postMessage({ messageType: "notificationError", error: stringError });
1361
1363
  });
@@ -1390,7 +1392,8 @@ var setupCore = function (config) {
1390
1392
  vibrate: event.notification.vibrate
1391
1393
  };
1392
1394
  channel.postMessage({ messageType: messageType, action: action, glueData: glueData, definition: definition });
1393
- })["catch"](function (error) {
1395
+ })
1396
+ .catch(function (error) {
1394
1397
  var stringError = typeof error === "string" ? error : JSON.stringify(error.message);
1395
1398
  channel.postMessage({ messageType: "notificationError", error: stringError });
1396
1399
  });