UNPKG
beesbuild
Version:
latest (0.1.3)
0.1.3
0.1.2
0.1.1
0.1.0
0.0.18
构建工具链
beesbuild
/
es
/
boolean-parser.mjs
10 lines
(9 loc)
•
219 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
booleanParser
= (
value
) => {
if
(
typeof
value ===
"string"
&& [
"0"
,
"false"
,
"true"
,
"null"
].
includes
(value)) {
return
Boolean
(
JSON
.
parse
(value)); }
return
Boolean
(value); };
export
{ booleanParser };