@everymatrix/player-bonus-history 1.22.8 → 1.22.9

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-bonus-history",
3
- "version": "1.22.8",
3
+ "version": "1.22.9",
4
4
  "main": "dist/player-bonus-history",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "3950da5f5790b1e4270c8674a930025443f50ff5"
38
+ "gitHead": "a02c1965e69c8e94cbd3ab9a0dc6a4f9a42ed3fc"
39
39
  }
package/src/index.ts CHANGED
@@ -1,4 +1,22 @@
1
1
  import PlayerBonusHistory from './PlayerBonusHistory.svelte';
2
-
2
+
3
+ function safeDecorator(fn) {
4
+ // eslint-disable-next-line func-names
5
+ return function(...args) {
6
+ try {
7
+ return fn.apply(this, args);
8
+ } catch (error) {
9
+ if (
10
+ error instanceof DOMException &&
11
+ error.message.includes('has already been used with this registry') || error.message.includes('Cannot define multiple custom elements with the same tag name')
12
+ ) {
13
+ return false;
14
+ }
15
+ throw error;
16
+ }
17
+ };
18
+ }
19
+
20
+ customElements.define = safeDecorator(customElements.define);
3
21
  !customElements.get('player-bonus-history') && customElements.define('player-bonus-history', PlayerBonusHistory);
4
22
  export default PlayerBonusHistory;