bpms_site/.svn/pristine/fc/fc50944b9e244ba37f3da1594ea5a6919d63ab33.svn-base
2025-11-02 16:38:49 +03:30

22 lines
739 B
Plaintext

const NON_STATIC_METHODS = [
"OPTIONS",
"POST",
"PUT",
"DELETE",
"PATCH"
];
/**
* Gets all the method names for handlers that are not considered static.
*
* @param handlers the handlers from the userland module
* @returns the method names that are not considered static or false if all
* methods are static
*/ export function getNonStaticMethods(handlers) {
// We can currently only statically optimize if only GET/HEAD are used as
// prerender can't be used conditionally based on the method currently.
const methods = NON_STATIC_METHODS.filter((method)=>handlers[method]);
if (methods.length === 0) return false;
return methods;
}
//# sourceMappingURL=get-non-static-methods.js.map