js-beautify 1.14.5 → 1.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,13 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries
58
58
 
59
59
  To pull the latest version from one of these services include one set of the script tags below in your document:
60
60
  ```html
61
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify.js"></script>
62
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-css.js"></script>
63
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-html.js"></script>
61
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify.js"></script>
62
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-css.js"></script>
63
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-html.js"></script>
64
64
 
65
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify.min.js"></script>
66
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-css.min.js"></script>
67
- <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.5/beautify-html.min.js"></script>
65
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify.min.js"></script>
66
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-css.min.js"></script>
67
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.6/beautify-html.min.js"></script>
68
68
  ```
69
69
 
70
70
  Older versions are available by changing the version number.
@@ -397,4 +397,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D
397
397
  Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull,
398
398
  Mathias Bynens, Vittorio Gambaletta and others.
399
399
 
400
- (README.md: js-beautify@1.14.5)
400
+ (README.md: js-beautify@1.14.6)
package/js/lib/cli.js CHANGED
@@ -63,6 +63,19 @@ nopt.typeDefs.brace_style = {
63
63
  return true;
64
64
  }
65
65
  };
66
+ nopt.typeDefs.glob = {
67
+ type: "glob",
68
+ validate: function(data, key, val) {
69
+ if (typeof val === 'string' && glob.hasMagic(val)) {
70
+ // Preserve value if it contains glob magic
71
+ data[key] = val;
72
+ return true;
73
+ } else {
74
+ // Otherwise validate it as regular path
75
+ return nopt.typeDefs.path.validate(data, key, val);
76
+ }
77
+ }
78
+ };
66
79
  var path = require('path'),
67
80
  editorconfig = require('editorconfig'),
68
81
  knownOpts = {
@@ -112,7 +125,7 @@ var path = require('path'),
112
125
  // CLI
113
126
  "version": Boolean,
114
127
  "help": Boolean,
115
- "files": [path, Array],
128
+ "files": ["glob", Array],
116
129
  "outfile": path,
117
130
  "replace": Boolean,
118
131
  "quiet": Boolean,
package/js/src/cli.js CHANGED
@@ -63,6 +63,19 @@ nopt.typeDefs.brace_style = {
63
63
  return true;
64
64
  }
65
65
  };
66
+ nopt.typeDefs.glob = {
67
+ type: "glob",
68
+ validate: function(data, key, val) {
69
+ if (typeof val === 'string' && glob.hasMagic(val)) {
70
+ // Preserve value if it contains glob magic
71
+ data[key] = val;
72
+ return true;
73
+ } else {
74
+ // Otherwise validate it as regular path
75
+ return nopt.typeDefs.path.validate(data, key, val);
76
+ }
77
+ }
78
+ };
66
79
  var path = require('path'),
67
80
  editorconfig = require('editorconfig'),
68
81
  knownOpts = {
@@ -112,7 +125,7 @@ var path = require('path'),
112
125
  // CLI
113
126
  "version": Boolean,
114
127
  "help": Boolean,
115
- "files": [path, Array],
128
+ "files": ["glob", Array],
116
129
  "outfile": path,
117
130
  "replace": Boolean,
118
131
  "quiet": Boolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-beautify",
3
- "version": "1.14.5",
3
+ "version": "1.14.6",
4
4
  "description": "beautifier.io for node",
5
5
  "main": "js/index.js",
6
6
  "bin": {