From c7e6b401623ef47fd8590b29b55661f3e2682b19 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 30 Sep 2023 12:54:29 +0300 Subject: [PATCH] squash! --- Documentation/_worker.js | 2 +- Documentation/assets/search.js | 2 +- Documentation/modules/Build.html | 2 +- Documentation/modules/Exec.html | 2 +- Documentation/modules/File.html | 2 +- Documentation/modules/JSON.html | 2 +- Source/Function/Worker.ts | 7 +++++-- Target/Function/Worker.js | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Documentation/_worker.js b/Documentation/_worker.js index 101245f5..66454ba6 100644 --- a/Documentation/_worker.js +++ b/Documentation/_worker.js @@ -1 +1 @@ -var a={fetch:async(e,t)=>{const n=new URL(e.url);if(n.pathname.startsWith("/functions/")){const r=await import(n.pathname);return console.log(r),new Response(n.pathname)}return t.ASSETS.fetch(e)}};export{a as default}; +var r={fetch:async(n,t)=>{const e=new URL(n.url);return e.pathname.startsWith("/functions/")?(console.log(process.cwd()),console.log((await import("fs/promises")).readFile(e.pathname)),new Response(e.pathname)):t.ASSETS.fetch(n)}};export{r as default}; diff --git a/Documentation/assets/search.js b/Documentation/assets/search.js index 641f90cf..b9d6e7d3 100644 --- a/Documentation/assets/search.js +++ b/Documentation/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACqVXTW/bMAz9LzobriV/59ihA7bDNqDDdgiCIo2VzatjB7LTDwT575NkOxIdsUnbSwxZj0+PpEg6eyKap5bM5nvyUNYFmTGP1MsNJzPy82XLb1ei3HY3t9e7siqIR3aikjubpthVvL06Qfh/u00lYatq2bZc0hJy8Ebm8BLqx6Uol/du8kuO88h2KXjdOQ8xWowUt2fnvWFxAtw5UpR1x8V6uTqyqN3XleLqbp756kScevlhbZrkvDQtwKXsc1nxE2Xq5YeVaZLzyrQAl7Kvt9+/nShTLz+sTJOcV6YFGOYkcqdzvatXXdnU4z1B0vrKPbGYC863Gy7+cJT+iHj3GYK3TfWInzDsv43f6go/SivsphH05Grz3cyfdkKDMPJh/92RgU1kGpcLetUr3Mid0bfl/JWZ1K/FCwrY8OrqQ+oYrz6LF5Sf4dW1g1QhXjtWvxmYrn434oGL09Yz7N/1+5dOogmbuRhTPpTWDspEo7OjI7P0jRMUn5sj0UUz8jgZF55sdAV/JrM9eeSilV7IbeaHfi7x65JXhfpK6I+XbM1moxgWw94vvuoaoRA95Cog3jzwGPMTmi0W3ny00Bv6hYZRDEYBjMkVdcEYgIVyxTya+GkEUCFARXIVejT3WRwCWARgMUIWA1QiV5FLWQJgKUKWAlQmV7GLLAOwHCHLYWgDzE86yYGKdeKx1E9ZAoEwC1RFO3UCYR6oCnjmBMJUUBXy3AmEyaAxdgMozAdNUK9hRmiKZY7CpFA0KxSmhar408DpDUwNUwmg1IVkMDdMZYAy59WflAjDkX12dInL2u548aUvdVms930X2ZO7ofzp2GL2hMmfg0dkhOXzYIperTT/OFWNdW6sZQbdZtanijFMLEOKGPL2VC2z5NJeL2OYvZ6kxjg0ttHgajA8E4RirYemoYgMRTKYppjpOByehpFjeRFY3ueI/b9WtmTLKDY22XB0hphu9YeVMc2s40LE5vixZ8xSywyLcfcCj7LyE/Yq4/6R9g/MW8XT6j9vjqxb4RoThtA4Ym1f8MBlJutEBawqawmaLw6H/5qTpPQkDwAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACp1X246bMBD9Fz8jwph7HlttpfahrbRV+xBFq2xwWroEIiB7UZR/r20utomnIfsSZOac48PM+JITqauXhixXJ/KUlxlZUoeUmz0jS/Lj7cDut3V+aO/uPxzzIiMOOdYFj+yr7FiwZnGBcP+0+4LDtsWmaRiXJeTsDMr+HOnnTZ1vHu3ic6ZzyGFTs7K1TqK8KCv2L7v+NVEwSty9su2osDuW2zavykFDBP/vc+pNU84YO+xZ/Zuh8iPi3XPUrKmKZ3yGPn6bvlbr7/mBWcrbiYvgu5U/HmsJwsT7+LszY7bGNC8zOhDvOqNlhqZDWuWWnpMS11tOsm2+PuUFu/AlXs71ZQgoX1IC0dF8SbbN15f7b18vfImXc30ZAsqXlEB0NF+Sbc1Xr7T4VdVPrL5MXR9/6OJz98eJmmrsqR4qqyd14lH7jjAytuRxwrxsWb3bbMelJKI39voMbdmo16Wn3TpDWbbadeVpv81Qls1yXRntGOwsvfEExc/NQWjWGTmejGuHf2TGXsnyRJ5Z3fB+4WHq+m7K8bucFZm4JXTTc7VqvxcK6z72k23bqhaIDrLwiLPyHErdCJL12lkNDBmQLyQMMBgYMMpHYINRA+bzEXUgdWnoGzDfgAV85Ds0dmMaGbDAgIV8FNhgoQGL+Ci0wSIDFvNRZIPFBizBvjQxYCn2pamZXg/DwaQOIt+xtRBmJYCiQLMWIHKeWIFmNSBAgWY9QOQ9taUQzIqAyDx4VqRZFBDJB3AgcuPABJplgQQFmoWBFAWapaEeBqRmaagoAFBr909WCcWRXXHkKufLu2XZ52618/X62G0kJ/LQ7wAw7DInQvnP2SGJeJzVshcjKT/cwBQ5UuQYYWm3WsXzFS9AeKy5tEo1r9CZpRTjyzuTImtcv6Om3YMvDrvCTt5ulEKsFKCfHbDZh0vH4qU/3JVMqsmECP1vw3dkjZNonN49YIk7yCu44oaKGyGU8V+BYgWKhZls38yJQGsliHuXSf/sk02xZAuxRv5/sxTeU8Jer4fIXKYbNDJYE8DXichZkZcctFqfz/8A2IWYECcPAAA="; \ No newline at end of file diff --git a/Documentation/modules/Build.html b/Documentation/modules/Build.html index 9d72c3b5..711cef60 100644 --- a/Documentation/modules/Build.html +++ b/Documentation/modules/Build.html @@ -16,7 +16,7 @@
  • Build
  • Module Build

    +
  • Defined in Application/NikolaRHristov/NPM/TypeScriptESBuild/Source/Function/Build.ts:1
  • Index

    diff --git a/Documentation/modules/Exec.html b/Documentation/modules/Exec.html index a7692365..2f812700 100644 --- a/Documentation/modules/Exec.html +++ b/Documentation/modules/Exec.html @@ -16,7 +16,7 @@
  • Exec
  • Module Exec

    +
  • Defined in Application/NikolaRHristov/NPM/TypeScriptESBuild/Source/Function/Exec.ts:1
  • Index

    diff --git a/Documentation/modules/File.html b/Documentation/modules/File.html index 8821477f..3bac93e3 100644 --- a/Documentation/modules/File.html +++ b/Documentation/modules/File.html @@ -16,7 +16,7 @@
  • File
  • Module File

    +
  • Defined in Application/NikolaRHristov/NPM/TypeScriptESBuild/Source/Function/File.ts:1
  • Index

    diff --git a/Documentation/modules/JSON.html b/Documentation/modules/JSON.html index 479350c5..2cdc0e63 100644 --- a/Documentation/modules/JSON.html +++ b/Documentation/modules/JSON.html @@ -16,7 +16,7 @@
  • JSON
  • Module JSON

    +
  • Defined in Application/NikolaRHristov/NPM/TypeScriptESBuild/Source/Function/JSON.ts:1
  • Index

    diff --git a/Source/Function/Worker.ts b/Source/Function/Worker.ts index b024e52f..8e7df315 100644 --- a/Source/Function/Worker.ts +++ b/Source/Function/Worker.ts @@ -7,8 +7,11 @@ export default >{ const url = new URL(request.url); if (url.pathname.startsWith("/functions/")) { - const File = await import(url.pathname); - console.log(File); + // const File = await import(url.pathname); + console.log(process.cwd()); + + console.log((await import("fs/promises")).readFile(url.pathname)); + return new Response(url.pathname); } diff --git a/Target/Function/Worker.js b/Target/Function/Worker.js index 101245f5..66454ba6 100644 --- a/Target/Function/Worker.js +++ b/Target/Function/Worker.js @@ -1 +1 @@ -var a={fetch:async(e,t)=>{const n=new URL(e.url);if(n.pathname.startsWith("/functions/")){const r=await import(n.pathname);return console.log(r),new Response(n.pathname)}return t.ASSETS.fetch(e)}};export{a as default}; +var r={fetch:async(n,t)=>{const e=new URL(n.url);return e.pathname.startsWith("/functions/")?(console.log(process.cwd()),console.log((await import("fs/promises")).readFile(e.pathname)),new Response(e.pathname)):t.ASSETS.fetch(n)}};export{r as default};