@yongdall/web 0.5.5 → 0.5.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yongdall/web",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "type": "module",
5
5
  "main": "./index.mjs",
6
6
  "exports": {
package/require.mjs CHANGED
@@ -1,2 +1,2 @@
1
- const e=new URL(import.meta.url).search.substring(1).split(`&`),t=decodeURIComponent(e.find(e=>e.startsWith(`path=`)&&e.length>5)?.substring(5)||``),n=decodeURIComponent(e.find(e=>e.startsWith(`name=`)&&e.length>5)?.substring(5)||``),r=decodeURIComponent(e.find(e=>e.startsWith(`type=`)&&e.length>5)?.substring(5)||``);let i;switch(r.toLowerCase()){default:await import(t),i=globalThis;for(let e of n.split(`.`)){if(!i||typeof i!=`object`)break;i=i[e]}}var a=i;export{a as default,n as name,t as path,r as type};
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":["const url = new URL(import.meta.url);\nconst pathKey = `path=`;\nconst nameKey = `name=`;\nconst typeKey = `type=`;\n\nconst query = url.search.substring(1).split('&');\nexport const path = decodeURIComponent(query\n\t.find(v => v.startsWith(pathKey) && v.length > pathKey.length)\n\t?.substring(pathKey.length) || '');\nexport const name = decodeURIComponent(query\n\t.find(v => v.startsWith(nameKey) && v.length > nameKey.length)\n\t?.substring(nameKey.length) || '');\nexport const type = decodeURIComponent(query\n\t.find(v => v.startsWith(typeKey) && v.length > typeKey.length)\n\t?.substring(typeKey.length) || '');\n\nlet exports: any;\nswitch (type.toLowerCase()) {\n\tcase 'umd':\n\tcase 'iife':\n\tdefault: {\n\t\tawait import(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":"AAAA,MAKM,EALM,IAAI,IAAI,OAAO,KAAK,IAAI,CAKlB,OAAO,UAAU,EAAE,CAAC,MAAM,IAAI,CACnC,EAAO,mBAAmB,EACrC,KAAK,GAAK,EAAE,WAAW,QAAQ,EAAI,EAAE,OAAS,EAAe,EAC5D,UAAU,EAAe,EAAI,GAAG,CACtB,EAAO,mBAAmB,EACrC,KAAK,GAAK,EAAE,WAAW,QAAQ,EAAI,EAAE,OAAS,EAAe,EAC5D,UAAU,EAAe,EAAI,GAAG,CACtB,EAAO,mBAAmB,EACrC,KAAK,GAAK,EAAE,WAAW,QAAQ,EAAI,EAAE,OAAS,EAAe,EAC5D,UAAU,EAAe,EAAI,GAAG,CAEnC,IAAI,EACJ,OAAQ,EAAK,aAAa,CAA1B,CAGC,QACC,MAAM,OAAO,GACb,EAAU,WACV,IAAK,IAAM,KAAK,EAAK,MAAM,IAAI,CAAE,CAChC,GAAI,CAAC,GAAW,OAAO,GAAY,SAAY,MAC/C,EAAU,EAAQ,IAKrB,IAAA,EAAe"}
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"}