This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/**
* @param {string} route_id
* @param {any} config
* @param {string} feature
* @param {import('@sveltejs/kit').Adapter | undefined} adapter
*/
export function check_feature(route_id, config, feature, adapter) {
if (!adapter) return;
switch (feature) {
case '$app/server:read': {
const supported = adapter.supports?.read?.({
route: { id: route_id },
config
});
if (!supported) {
throw new Error(
`Cannot use \`read\` from \`$app/server\` in ${route_id} when using ${adapter.name}. Please ensure that your adapter is up to date and supports this feature.`
);
}
}
}
}