js-beautify 1.13.7 → 1.14.0

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.
@@ -88,98 +88,13 @@
88
88
  (function() {
89
89
 
90
90
  /* GENERATED_BUILD_OUTPUT */
91
- var legacy_beautify_js =
92
- /******/ (function(modules) { // webpackBootstrap
93
- /******/ // The module cache
94
- /******/ var installedModules = {};
95
- /******/
96
- /******/ // The require function
97
- /******/ function __webpack_require__(moduleId) {
98
- /******/
99
- /******/ // Check if module is in cache
100
- /******/ if(installedModules[moduleId]) {
101
- /******/ return installedModules[moduleId].exports;
102
- /******/ }
103
- /******/ // Create a new module (and put it into the cache)
104
- /******/ var module = installedModules[moduleId] = {
105
- /******/ i: moduleId,
106
- /******/ l: false,
107
- /******/ exports: {}
108
- /******/ };
109
- /******/
110
- /******/ // Execute the module function
111
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
112
- /******/
113
- /******/ // Flag the module as loaded
114
- /******/ module.l = true;
115
- /******/
116
- /******/ // Return the exports of the module
117
- /******/ return module.exports;
118
- /******/ }
119
- /******/
120
- /******/
121
- /******/ // expose the modules object (__webpack_modules__)
122
- /******/ __webpack_require__.m = modules;
123
- /******/
124
- /******/ // expose the module cache
125
- /******/ __webpack_require__.c = installedModules;
126
- /******/
127
- /******/ // define getter function for harmony exports
128
- /******/ __webpack_require__.d = function(exports, name, getter) {
129
- /******/ if(!__webpack_require__.o(exports, name)) {
130
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
131
- /******/ }
132
- /******/ };
133
- /******/
134
- /******/ // define __esModule on exports
135
- /******/ __webpack_require__.r = function(exports) {
136
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
137
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
138
- /******/ }
139
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
140
- /******/ };
141
- /******/
142
- /******/ // create a fake namespace object
143
- /******/ // mode & 1: value is a module id, require it
144
- /******/ // mode & 2: merge all properties of value into the ns
145
- /******/ // mode & 4: return value when already ns object
146
- /******/ // mode & 8|1: behave like require
147
- /******/ __webpack_require__.t = function(value, mode) {
148
- /******/ if(mode & 1) value = __webpack_require__(value);
149
- /******/ if(mode & 8) return value;
150
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
151
- /******/ var ns = Object.create(null);
152
- /******/ __webpack_require__.r(ns);
153
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
154
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
155
- /******/ return ns;
156
- /******/ };
157
- /******/
158
- /******/ // getDefaultExport function for compatibility with non-harmony modules
159
- /******/ __webpack_require__.n = function(module) {
160
- /******/ var getter = module && module.__esModule ?
161
- /******/ function getDefault() { return module['default']; } :
162
- /******/ function getModuleExports() { return module; };
163
- /******/ __webpack_require__.d(getter, 'a', getter);
164
- /******/ return getter;
165
- /******/ };
166
- /******/
167
- /******/ // Object.prototype.hasOwnProperty.call
168
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
169
- /******/
170
- /******/ // __webpack_public_path__
171
- /******/ __webpack_require__.p = "";
172
- /******/
173
- /******/
174
- /******/ // Load entry module and return exports
175
- /******/ return __webpack_require__(__webpack_require__.s = 0);
176
- /******/ })
177
- /************************************************************************/
178
- /******/ ([
91
+ var legacy_beautify_js;
92
+ /******/ (function() { // webpackBootstrap
93
+ /******/ "use strict";
94
+ /******/ var __webpack_modules__ = ([
179
95
  /* 0 */
180
- /***/ (function(module, exports, __webpack_require__) {
96
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
181
97
 
182
- "use strict";
183
98
  /*jshint node:true */
184
99
  /*
185
100
 
@@ -226,9 +141,8 @@ module.exports.defaultOptions = function() {
226
141
 
227
142
  /***/ }),
228
143
  /* 1 */
229
- /***/ (function(module, exports, __webpack_require__) {
144
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
230
145
 
231
- "use strict";
232
146
  /*jshint node:true */
233
147
  /*
234
148
 
@@ -1692,9 +1606,8 @@ module.exports.Beautifier = Beautifier;
1692
1606
 
1693
1607
  /***/ }),
1694
1608
  /* 2 */
1695
- /***/ (function(module, exports, __webpack_require__) {
1609
+ /***/ (function(module) {
1696
1610
 
1697
- "use strict";
1698
1611
  /*jshint node:true */
1699
1612
  /*
1700
1613
  The MIT License (MIT)
@@ -2118,9 +2031,8 @@ module.exports.Output = Output;
2118
2031
 
2119
2032
  /***/ }),
2120
2033
  /* 3 */
2121
- /***/ (function(module, exports, __webpack_require__) {
2034
+ /***/ (function(module) {
2122
2035
 
2123
- "use strict";
2124
2036
  /*jshint node:true */
2125
2037
  /*
2126
2038
 
@@ -2179,9 +2091,8 @@ module.exports.Token = Token;
2179
2091
 
2180
2092
  /***/ }),
2181
2093
  /* 4 */
2182
- /***/ (function(module, exports, __webpack_require__) {
2094
+ /***/ (function(__unused_webpack_module, exports) {
2183
2095
 
2184
- "use strict";
2185
2096
  /* jshint node: true, curly: false */
2186
2097
  // Parts of this section of code is taken from acorn.
2187
2098
  //
@@ -2243,9 +2154,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
2243
2154
 
2244
2155
  /***/ }),
2245
2156
  /* 5 */
2246
- /***/ (function(module, exports, __webpack_require__) {
2157
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2247
2158
 
2248
- "use strict";
2249
2159
  /*jshint node:true */
2250
2160
  /*
2251
2161
 
@@ -2343,9 +2253,8 @@ module.exports.Options = Options;
2343
2253
 
2344
2254
  /***/ }),
2345
2255
  /* 6 */
2346
- /***/ (function(module, exports, __webpack_require__) {
2256
+ /***/ (function(module) {
2347
2257
 
2348
- "use strict";
2349
2258
  /*jshint node:true */
2350
2259
  /*
2351
2260
 
@@ -2543,9 +2452,8 @@ module.exports.mergeOpts = _mergeOpts;
2543
2452
 
2544
2453
  /***/ }),
2545
2454
  /* 7 */
2546
- /***/ (function(module, exports, __webpack_require__) {
2455
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2547
2456
 
2548
- "use strict";
2549
2457
  /*jshint node:true */
2550
2458
  /*
2551
2459
 
@@ -2614,7 +2522,7 @@ var TOKEN = {
2614
2522
 
2615
2523
  var directives_core = new Directives(/\/\*/, /\*\//);
2616
2524
 
2617
- var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/;
2525
+ var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
2618
2526
 
2619
2527
  var digit = /[0-9]/;
2620
2528
 
@@ -3116,9 +3024,8 @@ module.exports.line_starters = line_starters.slice();
3116
3024
 
3117
3025
  /***/ }),
3118
3026
  /* 8 */
3119
- /***/ (function(module, exports, __webpack_require__) {
3027
+ /***/ (function(module) {
3120
3028
 
3121
- "use strict";
3122
3029
  /*jshint node:true */
3123
3030
  /*
3124
3031
 
@@ -3315,9 +3222,8 @@ module.exports.InputScanner = InputScanner;
3315
3222
 
3316
3223
  /***/ }),
3317
3224
  /* 9 */
3318
- /***/ (function(module, exports, __webpack_require__) {
3225
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3319
3226
 
3320
- "use strict";
3321
3227
  /*jshint node:true */
3322
3228
  /*
3323
3229
 
@@ -3462,9 +3368,8 @@ module.exports.TOKEN = TOKEN;
3462
3368
 
3463
3369
  /***/ }),
3464
3370
  /* 10 */
3465
- /***/ (function(module, exports, __webpack_require__) {
3371
+ /***/ (function(module) {
3466
3372
 
3467
- "use strict";
3468
3373
  /*jshint node:true */
3469
3374
  /*
3470
3375
 
@@ -3547,9 +3452,8 @@ module.exports.TokenStream = TokenStream;
3547
3452
 
3548
3453
  /***/ }),
3549
3454
  /* 11 */
3550
- /***/ (function(module, exports, __webpack_require__) {
3455
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3551
3456
 
3552
- "use strict";
3553
3457
  /*jshint node:true */
3554
3458
  /*
3555
3459
 
@@ -3659,9 +3563,8 @@ module.exports.WhitespacePattern = WhitespacePattern;
3659
3563
 
3660
3564
  /***/ }),
3661
3565
  /* 12 */
3662
- /***/ (function(module, exports, __webpack_require__) {
3566
+ /***/ (function(module) {
3663
3567
 
3664
- "use strict";
3665
3568
  /*jshint node:true */
3666
3569
  /*
3667
3570
 
@@ -3760,9 +3663,8 @@ module.exports.Pattern = Pattern;
3760
3663
 
3761
3664
  /***/ }),
3762
3665
  /* 13 */
3763
- /***/ (function(module, exports, __webpack_require__) {
3666
+ /***/ (function(module) {
3764
3667
 
3765
- "use strict";
3766
3668
  /*jshint node:true */
3767
3669
  /*
3768
3670
 
@@ -3829,9 +3731,8 @@ module.exports.Directives = Directives;
3829
3731
 
3830
3732
  /***/ }),
3831
3733
  /* 14 */
3832
- /***/ (function(module, exports, __webpack_require__) {
3734
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
3833
3735
 
3834
- "use strict";
3835
3736
  /*jshint node:true */
3836
3737
  /*
3837
3738
 
@@ -4046,7 +3947,42 @@ module.exports.TemplatablePattern = TemplatablePattern;
4046
3947
 
4047
3948
 
4048
3949
  /***/ })
4049
- /******/ ]);
3950
+ /******/ ]);
3951
+ /************************************************************************/
3952
+ /******/ // The module cache
3953
+ /******/ var __webpack_module_cache__ = {};
3954
+ /******/
3955
+ /******/ // The require function
3956
+ /******/ function __webpack_require__(moduleId) {
3957
+ /******/ // Check if module is in cache
3958
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
3959
+ /******/ if (cachedModule !== undefined) {
3960
+ /******/ return cachedModule.exports;
3961
+ /******/ }
3962
+ /******/ // Create a new module (and put it into the cache)
3963
+ /******/ var module = __webpack_module_cache__[moduleId] = {
3964
+ /******/ // no module.id needed
3965
+ /******/ // no module.loaded needed
3966
+ /******/ exports: {}
3967
+ /******/ };
3968
+ /******/
3969
+ /******/ // Execute the module function
3970
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3971
+ /******/
3972
+ /******/ // Return the exports of the module
3973
+ /******/ return module.exports;
3974
+ /******/ }
3975
+ /******/
3976
+ /************************************************************************/
3977
+ /******/
3978
+ /******/ // startup
3979
+ /******/ // Load entry module and return exports
3980
+ /******/ // This entry module is referenced by other modules so it can't be inlined
3981
+ /******/ var __webpack_exports__ = __webpack_require__(0);
3982
+ /******/ legacy_beautify_js = __webpack_exports__;
3983
+ /******/
3984
+ /******/ })()
3985
+ ;
4050
3986
  var js_beautify = legacy_beautify_js;
4051
3987
  /* Footer */
4052
3988
  if (typeof define === "function" && define.amd) {
package/js/lib/cli.js CHANGED
@@ -40,7 +40,6 @@ var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? funct
40
40
  var fs = require('fs'),
41
41
  cc = require('config-chain'),
42
42
  beautify = require('../index'),
43
- mkdirp = require('mkdirp'),
44
43
  nopt = require('nopt'),
45
44
  glob = require('glob');
46
45
 
@@ -485,7 +484,7 @@ function writePretty(err, pretty, outfile, config) {
485
484
  }
486
485
 
487
486
  if (outfile) {
488
- mkdirp.sync(path.dirname(outfile));
487
+ fs.mkdirSync(path.dirname(outfile), { recursive: true });
489
488
 
490
489
  if (isFileDifferent(outfile, pretty)) {
491
490
  try {
package/js/src/cli.js CHANGED
@@ -40,7 +40,6 @@ var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? funct
40
40
  var fs = require('fs'),
41
41
  cc = require('config-chain'),
42
42
  beautify = require('../index'),
43
- mkdirp = require('mkdirp'),
44
43
  nopt = require('nopt'),
45
44
  glob = require('glob');
46
45
 
@@ -485,7 +484,7 @@ function writePretty(err, pretty, outfile, config) {
485
484
  }
486
485
 
487
486
  if (outfile) {
488
- mkdirp.sync(path.dirname(outfile));
487
+ fs.mkdirSync(path.dirname(outfile), { recursive: true });
489
488
 
490
489
  if (isFileDifferent(outfile, pretty)) {
491
490
  try {
@@ -433,7 +433,7 @@ Beautifier.prototype.beautify = function() {
433
433
  } else if (this._ch === ',') {
434
434
  this.print_string(this._ch);
435
435
  this.eatWhitespace(true);
436
- if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) {
436
+ if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) {
437
437
  this._output.add_new_line();
438
438
  } else {
439
439
  this._output.space_before_token = true;
@@ -66,7 +66,7 @@ var TOKEN = {
66
66
 
67
67
  var directives_core = new Directives(/\/\*/, /\*\//);
68
68
 
69
- var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/;
69
+ var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
70
70
 
71
71
  var digit = /[0-9]/;
72
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-beautify",
3
- "version": "1.13.7",
3
+ "version": "1.14.0",
4
4
  "description": "beautifier.io for node",
5
5
  "main": "js/index.js",
6
6
  "bin": {
@@ -47,11 +47,11 @@
47
47
  "engines": {
48
48
  "node": ">=10"
49
49
  },
50
+ "browserslist": "ie 11",
50
51
  "dependencies": {
51
52
  "config-chain": "^1.1.12",
52
53
  "editorconfig": "^0.15.3",
53
54
  "glob": "^7.1.3",
54
- "mkdirp": "^1.0.4",
55
55
  "nopt": "^5.0.0"
56
56
  },
57
57
  "devDependencies": {
@@ -64,7 +64,7 @@
64
64
  "mustache": "^4.0.1",
65
65
  "requirejs": "^2.3.6",
66
66
  "serve": "^11.3.2",
67
- "webpack": "^4.44.1",
68
- "webpack-cli": "^3.3.12"
67
+ "webpack": "^5.32.0",
68
+ "webpack-cli": "^4.6.0"
69
69
  }
70
70
  }