spoint 0.1.20 → 0.1.21
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/client/app.js +5 -2
- package/package.json +1 -1
package/client/app.js
CHANGED
|
@@ -813,11 +813,14 @@ function removePlayerMesh(id) {
|
|
|
813
813
|
|
|
814
814
|
function evaluateAppModule(code) {
|
|
815
815
|
try {
|
|
816
|
-
// Strip imports and import.meta usage
|
|
817
816
|
let stripped = code.replace(/^import\s+.*$/gm, '')
|
|
818
817
|
stripped = stripped.replace(/const\s+__dirname\s*=.*import\.meta\.url.*$/gm, 'const __dirname = "/"')
|
|
819
818
|
const wrapped = stripped.replace(/export\s+default\s*/, 'return ').replace(/export\s+/g, '')
|
|
820
|
-
|
|
819
|
+
const join = (...parts) => parts.filter(Boolean).join('/')
|
|
820
|
+
const readdirSync = () => []
|
|
821
|
+
const statSync = () => ({ isDirectory: () => false })
|
|
822
|
+
const fileURLToPath = (url) => '/'
|
|
823
|
+
return new Function('join', 'readdirSync', 'statSync', 'fileURLToPath', wrapped)(join, readdirSync, statSync, fileURLToPath)
|
|
821
824
|
} catch (e) { console.error('[app-eval]', e.message, e.stack); return null }
|
|
822
825
|
}
|
|
823
826
|
|