File: jsmin-noop.py

package info (click to toggle)
openjfx 11.0.2%2B1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 259,996 kB
  • sloc: cpp: 1,553,792; java: 770,301; ansic: 577,227; xml: 78,166; perl: 19,857; objc: 17,740; python: 11,421; ruby: 10,137; asm: 7,588; sh: 3,470; makefile: 3,023; yacc: 405
file content (29 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python

# This is a reimplementation of the JavaScript minifier included in OpenJFX
# which was derived from the non-free jsmin code by Douglas Crockford. This
# version simply copies the input file unchanged.
#
# -- Emmanuel Bourg <ebourg@apache.org>

try:
    from StringIO import StringIO
except ImportError:
    from io import StringIO

def jsmin(js):
    ins = StringIO(js)
    outs = StringIO()
    JavascriptMinify().minify(ins, outs)
    return outs.getvalue()

class JavascriptMinify(object):

    def minify(self, instream, outstream):
        outstream.write(instream.read())
        instream.close()

if __name__ == '__main__':
    import sys
    jsm = JavascriptMinify()
    jsm.minify(sys.stdin, sys.stdout)