MCPcopy Create free account
hub / github.com/BruceDevices/firmware / minify_js

Function minify_js

patch.py:103–109  ·  view source on GitHub ↗
(js)

Source from the content-addressed store, hash-verified

101
102
103def minify_js(js):
104 minify_req = requests.post(
105 'https://www.toptal.com/developers/javascript-minifier/api/raw',
106 {'input': js.read().decode('utf-8')},
107 timeout=10
108 )
109 return js if minify_req is False else minify_req.text.encode('utf-8')
110
111
112def minify_html(html):

Callers 1

prepare_www_filesFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected