Comparing version 1.12.1 to 1.13.0
{ | ||
"name": "esnext", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Update your project to the latest ECMAScript syntax.", | ||
@@ -5,0 +5,0 @@ "main": "dist/esnext.umd.js", |
@@ -120,2 +120,3 @@ /* eslint-disable no-console */ | ||
let validate; | ||
let inline = false; | ||
@@ -166,2 +167,7 @@ for (let i = 0; i < args.length; i++) { | ||
case '-I': | ||
case '--inline': | ||
inline = true; | ||
break; | ||
case '--validate': | ||
@@ -184,2 +190,11 @@ case '--no-validate': | ||
if (inline) { | ||
if (!input) { | ||
return { error: `Asked to replace input inline but no input was given` }; | ||
} else if (output) { | ||
return { error: `Asked to replace input inline but output is already set: ${output}` }; | ||
} | ||
output = input; | ||
} | ||
return { input, output, blacklist, whitelist, validate }; | ||
@@ -209,2 +224,3 @@ } | ||
out.write(`${$0} < input.js > output.js # read stdin and write stdout\n`); | ||
out.write(`${$0} -I file.js # rewrite a file inline\n`); | ||
out.write(`${$0} -b modules.commonjs # blacklist plugins\n`); | ||
@@ -217,3 +233,5 @@ out.write(`${$0} -w modules.commonjs # whitelist plugins\n`); | ||
{ out, padding: 2, indent: 2 }, | ||
allPlugins.map(({ name, description }) => [ name, description ]) | ||
allPlugins | ||
.sort((left, right) => left.name.localeCompare(right.name)) | ||
.map(({ name, description }) => [ name, description ]) | ||
); | ||
@@ -220,0 +238,0 @@ out.write('\n'); |
@@ -57,2 +57,12 @@ import type Module from './module'; | ||
unescape(char: string, start: number, end: number): Context { | ||
for (let i = start; i < end; i++) { | ||
if (this.charAt(i) === '\\' && this.charAt(i + 1) === char) { | ||
this.remove(i, i + 1); | ||
i++; | ||
} | ||
} | ||
return this; | ||
} | ||
unindent(): Context { | ||
@@ -59,0 +69,0 @@ // FIXME: This is only capable of unindenting one level. |
@@ -32,2 +32,6 @@ import BaseContext from '../context'; | ||
if (node.loc.start.line !== node.loc.end.line) { | ||
return null; | ||
} | ||
const { left, right } = node; | ||
@@ -92,2 +96,4 @@ | ||
} | ||
const thisPartQuote = this.charAt(parts[i].range[0]); | ||
this.unescape(thisPartQuote, thisPart.range[0] + 1, thisPart.range[1] - 1); | ||
this.escape(quote, thisPart.range[0] + 1, thisPart.range[1] - 1); | ||
@@ -132,2 +138,4 @@ } | ||
this.remove(node.range[1] - 1, node.range[1]); | ||
const thisPartQuote = this.charAt(node.range[0]); | ||
this.unescape(thisPartQuote, node.range[0] + 1, node.range[1] - 1); | ||
this.escape('`', ...node.range); | ||
@@ -134,0 +142,0 @@ } |
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
228341
6837