1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 12:20:04 +02:00

update node modules

This commit is contained in:
s2
2019-03-29 15:56:41 +01:00
parent f114871153
commit 89c32fb4e6
8347 changed files with 390123 additions and 159877 deletions

49
node_modules/parse5/lib/index.js generated vendored
View File

@@ -1,12 +1,11 @@
'use strict';
var Parser = require('./parser'),
Serializer = require('./serializer');
const Parser = require('./parser');
const Serializer = require('./serializer');
// Shorthands
exports.parse = function parse(html, options) {
var parser = new Parser(options);
const parser = new Parser(options);
return parser.parse(html);
};
@@ -18,49 +17,13 @@ exports.parseFragment = function parseFragment(fragmentContext, html, options) {
fragmentContext = null;
}
var parser = new Parser(options);
const parser = new Parser(options);
return parser.parseFragment(html, fragmentContext);
};
exports.serialize = function (node, options) {
var serializer = new Serializer(node, options);
exports.serialize = function(node, options) {
const serializer = new Serializer(node, options);
return serializer.serialize();
};
// Tree adapters
exports.treeAdapters = {
default: require('./tree_adapters/default'),
htmlparser2: require('./tree_adapters/htmlparser2')
};
// Streaming
// NOTE: streaming API is lazy loadable to enable bundling for platforms
// that are different from Node.js.
// See https://github.com/inikulin/parse5/issues/235.
var streamingAPI = {
ParserStream: './parser/parser_stream',
PlainTextConversionStream: './parser/plain_text_conversion_stream',
SerializerStream: './serializer/serializer_stream',
SAXParser: './sax'
};
Object.keys(streamingAPI).forEach(function (cls) {
Object.defineProperty(exports, cls, {
get: function () {
try {
return require(streamingAPI[cls]);
}
catch (e) {
throw new Error(
cls + ' is supported only for Node.js.' +
'See https://github.com/inikulin/parse5/issues/235 for the details.'
);
}
}
});
});