UNPKG

milliparsec

Version:

tiniest body parser in the universe

4 lines (3 loc) 212 B
const bodyMethods = new Set(['POST', 'PUT', 'PATCH', 'DELETE']); export const hasBody = (method) => bodyMethods.has(method); export const checkType = (req, type) => typeof type === 'function' ? type(req) : true;