UNPKG
@jsenv/plugin-minification
Version:
latest (1.7.0)
1.7.0
1.6.3
1.6.2
1.6.0
1.5.13
1.5.12
1.5.11
1.5.10
1.5.9
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.0.2
1.0.1
1.0.0
github.com/jsenv/core
jsenv/core
@jsenv/plugin-minification
/
src
/
json
/
json_minification.js
9 lines
(8 loc)
•
244 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
export
const
minifyJson
= (
jsonUrlInfo
) => {
const
{ content } = jsonUrlInfo;
if
(content.
startsWith
(
"{\n"
)) {
const
jsonWithoutWhitespaces =
JSON
.
stringify
(
JSON
.
parse
(content));
return
jsonWithoutWhitespaces; }
return
null
; };