mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-26 22:20:56 +00:00
defaultOptions as a function
This commit is contained in:
parent
7ed4a773be
commit
5e5280010a
@ -37,4 +37,6 @@ function css_beautify(source_text, options) {
|
||||
}
|
||||
|
||||
module.exports = css_beautify;
|
||||
module.exports.defaultOptions = new Options();
|
||||
module.exports.defaultOptions = function() {
|
||||
return new Options();
|
||||
};
|
||||
|
@ -37,4 +37,6 @@ function style_html(html_source, options, js_beautify, css_beautify) {
|
||||
}
|
||||
|
||||
module.exports = style_html;
|
||||
module.exports.defaultOptions = new Options();
|
||||
module.exports.defaultOptions = function() {
|
||||
return new Options();
|
||||
};
|
||||
|
@ -37,4 +37,6 @@ function js_beautify(js_source_text, options) {
|
||||
}
|
||||
|
||||
module.exports = js_beautify;
|
||||
module.exports.defaultOptions = new Options();
|
||||
module.exports.defaultOptions = function() {
|
||||
return new Options();
|
||||
};
|
||||
|
@ -19,14 +19,17 @@ function test_legacy_names() {
|
||||
results.expect(typeof beautify.html, 'function');
|
||||
|
||||
console.log('Ensure defaultOptions are defined');
|
||||
results.expect(typeof beautify.js.defaultOptions, 'object');
|
||||
results.expect(typeof beautify.css.defaultOptions, 'object');
|
||||
results.expect(typeof beautify.html.defaultOptions, 'object');
|
||||
results.expect(typeof beautify.js.defaultOptions, 'function');
|
||||
results.expect(typeof beautify.css.defaultOptions, 'function');
|
||||
results.expect(typeof beautify.html.defaultOptions, 'function');
|
||||
|
||||
console.log('Ensure that legacy import names equal the new ones');
|
||||
results.expect(beautify.js, beautify.js_beautify);
|
||||
results.expect(beautify.css, beautify.css_beautify);
|
||||
results.expect(beautify.html, beautify.html_beautify);
|
||||
results.expect(beautify.js.defaultOptions, beautify.js_beautify.defaultOptions);
|
||||
results.expect(beautify.css.defaultOptions, beautify.css_beautify.defaultOptions);
|
||||
results.expect(beautify.html.defaultOptions, beautify.html_beautify.defaultOptions);
|
||||
|
||||
console.log(results.results_raw());
|
||||
return results.get_exitcode();
|
||||
|
Loading…
Reference in New Issue
Block a user