@yongdall/web 0.5.5 → 0.5.6
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/index.d.mts +7 -1
- package/index.mjs +13 -13
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/require.mjs +1 -1
- package/require.mjs.map +1 -1
package/package.json
CHANGED
package/require.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{importScript as e}from"@yongdall/web";const t=new URL(import.meta.url).searchParams,n=t.getAll(`path`).find(Boolean)||`/`,r=t.getAll(`name`).find(Boolean)||``,i=t.getAll(`type`).find(Boolean)||``;let a;switch(i.toLowerCase()){default:await e(n),a=globalThis;for(let e of r.split(`.`)){if(!a||typeof a!=`object`)break;a=a[e]}}var o=a;export{o as default,r as name,n as path,i as type};
|
|
2
2
|
//# sourceMappingURL=require.mjs.map
|
package/require.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require.mjs","names":[],"sources":["../../packages/web/require.mts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"require.mjs","names":[],"sources":["../../packages/web/require.mts"],"sourcesContent":["import { importScript } from '@yongdall/web';\nconst searchParams = new URL(import.meta.url).searchParams;\nexport const path = searchParams.getAll('path').find(Boolean) || '/';\nexport const name = searchParams.getAll('name').find(Boolean) || '';\nexport const type = searchParams.getAll('type').find(Boolean) || '';\n\nlet exports: any;\nswitch (type.toLowerCase()) {\n\tcase 'umd':\n\tcase 'iife':\n\tdefault: {\n\t\tawait importScript(path);\n\t\texports = globalThis;\n\t\tfor (const k of name.split('.')) {\n\t\t\tif (!exports || typeof exports !== 'object') { break; }\n\t\t\texports = exports[k];\n\t\t}\n\t}\n\n}\nexport default exports;\n"],"mappings":"6CACA,MAAM,EAAe,IAAI,IAAI,OAAO,KAAK,IAAI,CAAC,aACjC,EAAO,EAAa,OAAO,OAAO,CAAC,KAAK,QAAQ,EAAI,IACpD,EAAO,EAAa,OAAO,OAAO,CAAC,KAAK,QAAQ,EAAI,GACpD,EAAO,EAAa,OAAO,OAAO,CAAC,KAAK,QAAQ,EAAI,GAEjE,IAAI,EACJ,OAAQ,EAAK,aAAa,CAA1B,CAGC,QACC,MAAM,EAAa,EAAK,CACxB,EAAU,WACV,IAAK,IAAM,KAAK,EAAK,MAAM,IAAI,CAAE,CAChC,GAAI,CAAC,GAAW,OAAO,GAAY,SAAY,MAC/C,EAAU,EAAQ,IAKrB,IAAA,EAAe"}
|