diff --git a/js/src/css/index.js b/js/src/css/index.js index 5b640297..19c3d541 100644 --- a/js/src/css/index.js +++ b/js/src/css/index.js @@ -28,11 +28,13 @@ 'use strict'; -var Beautifier = require('./beautifier').Beautifier; +var Beautifier = require('./beautifier').Beautifier, + Options = require('./options').Options; function css_beautify(source_text, options) { var beautifier = new Beautifier(source_text, options); return beautifier.beautify(); } -module.exports = css_beautify; \ No newline at end of file +module.exports = css_beautify; +module.exports.defaultOptions = new Options(); \ No newline at end of file diff --git a/js/src/html/index.js b/js/src/html/index.js index 0d299691..e32a6307 100644 --- a/js/src/html/index.js +++ b/js/src/html/index.js @@ -28,11 +28,13 @@ 'use strict'; -var Beautifier = require('./beautifier').Beautifier; +var Beautifier = require('./beautifier').Beautifier, + Options = require('./options').Options; function style_html(html_source, options, js_beautify, css_beautify) { var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify); return beautifier.beautify(); } -module.exports = style_html; \ No newline at end of file +module.exports = style_html; +module.exports.defaultOptions = new Options(); \ No newline at end of file diff --git a/js/src/index.js b/js/src/index.js index 2cba1a63..d0ba8ce2 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -37,6 +37,7 @@ function style_html(html_source, options, js, css) { css = css || css_beautify; return html_beautify(html_source, options, js, css); } +style_html.defaultOptions = html_beautify.defaultOptions; module.exports.js = js_beautify; module.exports.css = css_beautify; diff --git a/js/src/javascript/index.js b/js/src/javascript/index.js index 835dc5cf..8f837ded 100644 --- a/js/src/javascript/index.js +++ b/js/src/javascript/index.js @@ -28,11 +28,13 @@ 'use strict'; -var Beautifier = require('./beautifier').Beautifier; +var Beautifier = require('./beautifier').Beautifier, + Options = require('./options').Options; function js_beautify(js_source_text, options) { var beautifier = new Beautifier(js_source_text, options); return beautifier.beautify(); } -module.exports = js_beautify; \ No newline at end of file +module.exports = js_beautify; +module.exports.defaultOptions = new Options(); \ No newline at end of file diff --git a/js/test/node-beautify-tests.js b/js/test/node-beautify-tests.js index f28f7e0c..fc8c9999 100755 --- a/js/test/node-beautify-tests.js +++ b/js/test/node-beautify-tests.js @@ -18,6 +18,11 @@ function test_legacy_names() { results.expect(typeof beautify.css, 'function'); 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'); + 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);