js-beautify
Advanced tools
Comparing version 1.14.9 to 1.14.10
@@ -1284,3 +1284,3 @@ /* AUTO-GENERATED. DO NOT MODIFY. */ | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variable = this.eatString(": ").replace(/\s$/, ''); | ||
variable = this.eatString(": ").replace(/\s+$/, ''); | ||
this.print_string(variable); | ||
@@ -1290,4 +1290,2 @@ this._output.space_before_token = true; | ||
variable = variable.replace(/\s$/, ''); | ||
// might be sass variable | ||
@@ -1312,3 +1310,3 @@ if (parenLevel === 0 && variable.indexOf(':') !== -1) { | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variableOrRule = this.eatString(": ").replace(/\s$/, ''); | ||
variableOrRule = this.eatString(": ").replace(/\s+$/, ''); | ||
this.print_string(variableOrRule); | ||
@@ -1318,4 +1316,2 @@ this._output.space_before_token = true; | ||
variableOrRule = variableOrRule.replace(/\s$/, ''); | ||
// might be less variable | ||
@@ -1322,0 +1318,0 @@ if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { |
@@ -35,3 +35,6 @@ #!/usr/bin/env node | ||
/*jshint strict:false */ | ||
/*jshint esversion: 6 */ | ||
const { globSync } = require('glob'); | ||
var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? function() { | ||
@@ -45,3 +48,3 @@ console.error.apply(console, arguments); | ||
nopt = require('nopt'), | ||
glob = require('glob'); | ||
glob = require("glob"); | ||
@@ -639,4 +642,3 @@ nopt.invalidHandler = function(key, val) { | ||
hadGlob = true; | ||
foundFiles = glob(f, { | ||
sync: true, | ||
foundFiles = globSync(f, { | ||
absolute: true, | ||
@@ -643,0 +645,0 @@ ignore: ['**/node_modules/**', '**/.git/**'] |
@@ -35,3 +35,6 @@ #!/usr/bin/env node | ||
/*jshint strict:false */ | ||
/*jshint esversion: 6 */ | ||
const { globSync } = require('glob'); | ||
var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? function() { | ||
@@ -45,3 +48,3 @@ console.error.apply(console, arguments); | ||
nopt = require('nopt'), | ||
glob = require('glob'); | ||
glob = require("glob"); | ||
@@ -639,4 +642,3 @@ nopt.invalidHandler = function(key, val) { | ||
hadGlob = true; | ||
foundFiles = glob(f, { | ||
sync: true, | ||
foundFiles = globSync(f, { | ||
absolute: true, | ||
@@ -643,0 +645,0 @@ ignore: ['**/node_modules/**', '**/.git/**'] |
@@ -261,3 +261,3 @@ /*jshint node:true */ | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variable = this.eatString(": ").replace(/\s$/, ''); | ||
variable = this.eatString(": ").replace(/\s+$/, ''); | ||
this.print_string(variable); | ||
@@ -267,4 +267,2 @@ this._output.space_before_token = true; | ||
variable = variable.replace(/\s$/, ''); | ||
// might be sass variable | ||
@@ -289,3 +287,3 @@ if (parenLevel === 0 && variable.indexOf(':') !== -1) { | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variableOrRule = this.eatString(": ").replace(/\s$/, ''); | ||
variableOrRule = this.eatString(": ").replace(/\s+$/, ''); | ||
this.print_string(variableOrRule); | ||
@@ -295,4 +293,2 @@ this._output.space_before_token = true; | ||
variableOrRule = variableOrRule.replace(/\s$/, ''); | ||
// might be less variable | ||
@@ -299,0 +295,0 @@ if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { |
@@ -38,8 +38,9 @@ /* jshint node: true, curly: false */ | ||
var identifierStart = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; | ||
var identifierChars = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; | ||
var unicodeEscapeOrCodePoint = "\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}"; | ||
var identifierStart = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; | ||
var identifierChars = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; | ||
exports.identifier = new RegExp(identifierStart + identifierChars, 'g'); | ||
exports.identifierStart = new RegExp(identifierStart); | ||
exports.identifierMatch = new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); | ||
exports.identifierMatch = new RegExp("(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); | ||
@@ -46,0 +47,0 @@ var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // jshint ignore:line |
@@ -894,3 +894,5 @@ /*jshint node:true */ | ||
if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { | ||
if (!this.start_of_object_property()) { | ||
if (!this.start_of_object_property() && !( | ||
// start of object property is different for numeric values with +/- prefix operators | ||
in_array(this._flags.last_token.text, ['+', '-']) && this._last_last_text === ':' && this._flags.parent.mode === MODE.ObjectLiteral)) { | ||
this.allow_wrap_or_preserved_newline(current_token); | ||
@@ -1176,2 +1178,8 @@ } | ||
if (in_array(current_token.text, ['-', '+']) && this.start_of_object_property()) { | ||
// numeric value with +/- symbol in front as a property | ||
this.print_token(current_token); | ||
return; | ||
} | ||
// Allow line wrapping between operators when operator_position is | ||
@@ -1178,0 +1186,0 @@ // set to before or preserve |
@@ -487,2 +487,5 @@ /*jshint node:true */ | ||
matched = input_scan.match(/u([0-9A-Fa-f]{4})/g); | ||
if (!matched) { | ||
matched = input_scan.match(/u\{([0-9A-Fa-f]+)\}/g); | ||
} | ||
} else { | ||
@@ -511,3 +514,5 @@ out += '\\'; | ||
out += '\\' + matched[0]; | ||
continue; | ||
} else if (escaped > 0x10FFFF) { | ||
// If the escape sequence is out of bounds, keep the original sequence and continue conversion | ||
out += '\\' + matched[0]; | ||
} else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) { | ||
@@ -514,0 +519,0 @@ // single-quote, apostrophe, backslash - escape these |
{ | ||
"name": "js-beautify", | ||
"version": "1.14.9", | ||
"version": "1.14.10", | ||
"description": "beautifier.io for node", | ||
@@ -48,3 +48,3 @@ "main": "js/index.js", | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=14" | ||
}, | ||
@@ -55,4 +55,4 @@ "browserslist": "ie 11", | ||
"editorconfig": "^1.0.3", | ||
"glob": "^8.1.0", | ||
"nopt": "^6.0.0" | ||
"glob": "^10.3.3", | ||
"nopt": "^7.2.0" | ||
}, | ||
@@ -72,4 +72,4 @@ "devDependencies": { | ||
"webpack": "^5.81.0", | ||
"webpack-cli": "^4.10.0" | ||
"webpack-cli": "^5.1.4" | ||
} | ||
} |
@@ -61,9 +61,9 @@ <p align="center"><img src="https://raw.githubusercontent.com/beautify-web/js-beautify/7db71fc/web/wordmark-light.svg" height="200px" align="center" alt="JS Beautifier"/></p> | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify-css.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify-html.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify-css.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify-html.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify-css.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify-html.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify-css.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify-html.min.js"></script> | ||
``` | ||
@@ -80,3 +80,3 @@ | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.9/beautify.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.10/beautify.min.js"></script> | ||
<script src="script.js"></script> | ||
@@ -439,2 +439,2 @@ </body> | ||
(README.md: js-beautify@1.14.9) | ||
(README.md: js-beautify@1.14.10) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
965266
19972
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedabbrev@2.0.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addednopt@7.2.1(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@8.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedminimatch@5.1.6(transitive)
- Removednopt@6.0.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedglob@^10.3.3
Updatednopt@^7.2.0