Exemple #1
0
        public static string CompressJS(Stream stream)
        {
            var jsMin = new JSMin();

            if (!stream.CanRead)
            {
                throw new InvalidOperationException("Cannot read input stream");
            }
            if (stream.CanSeek)
            {
                stream.Position = 0;
            }
            return(jsMin.Minify(new StreamReader(stream)));
        }
Exemple #2
0
        public static string Minify(TextSource js)
        {
            var min = new JSMin();

            return(min.Minify(js));
        }