quito IIFE
This commit is contained in:
10
sigpro2.js
10
sigpro2.js
@@ -1,7 +1,4 @@
|
||||
/**
|
||||
* SigPro
|
||||
*/
|
||||
const SigPro = (() => {
|
||||
// sigpro
|
||||
const doc = typeof document !== "undefined" ? document : null;
|
||||
const isArr = Array.isArray, assign = Object.assign, isFunc = (f) => typeof f === "function", isObj = (o) => typeof o === "object" && o !== null;
|
||||
const ensureNode = (n) => n?._isRuntime ? n.container : (n instanceof Node ? n : doc.createTextNode(String(n ?? "")));
|
||||
@@ -243,12 +240,13 @@ const SigPro = (() => {
|
||||
t.replaceChildren(inst.container); MOUNTED_NODES.set(t, inst); return inst;
|
||||
};
|
||||
|
||||
return { $, $$, Share, Use, Watch, Tag, Render, If, For, Router, Mount, ignore, onUnmount };
|
||||
})();
|
||||
const SigPro = Object.freeze({ $, $$, Share, Use, Watch, Tag, Render, If, For, Router, Mount, ignore, onUnmount });
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
Object.assign(window, SigPro);
|
||||
"div span p h1 h2 h3 h4 h5 h6 br hr section article aside nav main header footer ul ol li a em strong pre code form label input textarea select button img svg"
|
||||
.split(" ").forEach(t => window[t[0].toUpperCase() + t.slice(1)] = (p, c) => SigPro.Tag(t, p, c));
|
||||
}
|
||||
|
||||
export { $, $$, Share, Use, Watch, Tag, Render, If, For, Router, Mount, ignore, onUnmount };
|
||||
export default SigPro;
|
||||
Reference in New Issue
Block a user