@schukai/monster 3.25.0 → 3.26.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.
package/package.json
CHANGED
@@ -969,5 +969,14 @@ function initShadowRoot() {
|
|
969
969
|
*/
|
970
970
|
function registerCustomElement(element) {
|
971
971
|
validateFunction(element);
|
972
|
-
getGlobalObject("customElements")
|
972
|
+
const customElements = getGlobalObject("customElements")
|
973
|
+
if (customElements === undefined) {
|
974
|
+
throw new Error("customElements is not supported.");
|
975
|
+
}
|
976
|
+
|
977
|
+
if (customElements.get(element.getTag()) !== undefined) {
|
978
|
+
return;
|
979
|
+
}
|
980
|
+
|
981
|
+
customElements.define(element.getTag(), element);
|
973
982
|
}
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED