@based/server
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -135,2 +135,17 @@ "use strict"; | ||
} | ||
const getRoute = (path, name, specs) => { | ||
let rootFn; | ||
if (path) { | ||
for (const name in specs) { | ||
const fnPath = specs[name].path; | ||
if (fnPath === path) { | ||
return specs[name]; | ||
} | ||
if (!rootFn && fnPath === '/') { | ||
rootFn = specs[name]; | ||
} | ||
} | ||
} | ||
return specs[name] || rootFn || null; | ||
}; | ||
const properProps = { | ||
@@ -154,17 +169,5 @@ ...props, | ||
}), | ||
route: ({ path, name }) => { | ||
// TODO fix typez | ||
let rootFn; | ||
if (path) { | ||
for (const name in functionStore) { | ||
const fnPath = functionStore[name].path; | ||
if (fnPath === path) { | ||
return functionStore[name]; | ||
} | ||
if (!rootFn && fnPath === '/') { | ||
rootFn = functionStore[name]; | ||
} | ||
} | ||
} | ||
return functionStore[name] || rootFn || null; | ||
route: ({ server, path, name }) => { | ||
return (getRoute(path, name, functionStore) || | ||
getRoute(path, name, server.functions.specs)); | ||
}, | ||
@@ -171,0 +174,0 @@ }, |
@@ -45,2 +45,6 @@ "use strict"; | ||
const s = specs[key]; | ||
if (!s.uninstallAfterIdleTime) { | ||
// When this is used you prob dont want to uninstall anything... | ||
s.uninstallAfterIdleTime = -1; | ||
} | ||
this.updateInternal(s); | ||
@@ -47,0 +51,0 @@ } |
{ | ||
"name": "@based/server", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
397860
6051