UNPKG
milliparsec
Version:
latest (5.1.1)
5.1.1
5.1.0
5.0.2
5.0.1
5.0.0
4.0.0
3.0.0
2.3.0
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
tiniest body parser in the universe
github.com/tinyhttp/milliparsec
tinyhttp/milliparsec
milliparsec
/
dist
/
utils.js
4 lines
(3 loc)
•
212 B
JavaScript
View Raw
1
2
3
4
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
;