zod-server-actions
Version:
Simple utility library to create server actions in Next.js
13 lines (12 loc) • 311 B
JavaScript
export function isResponseError(res) {
return res.error !== null;
}
export function isRequestQuery(method) {
return method === "GET";
}
export function isRequestMutation(method) {
return method === "POST";
}
export function isRequestFormData(type) {
return type && type.includes("form-data");
}