to-single-quotes
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "to-single-quotes", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Convert matching double-quotes to single-quotes: I \"love\" unicorns => I 'love' unicorns", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
# to-single-quotes [![Build Status](https://travis-ci.org/sindresorhus/to-single-quotes.png?branch=master)](http://travis-ci.org/sindresorhus/to-single-quotes) | ||
# to-single-quotes [![Build Status](https://travis-ci.org/sindresorhus/to-single-quotes.svg?branch=master)](https://travis-ci.org/sindresorhus/to-single-quotes) | ||
@@ -72,9 +72,5 @@ > Convert matching double-quotes to single-quotes: `I "love" unicorns` => `I 'love' unicorns` | ||
Or using the command line | ||
``` | ||
to-single-quotes path/to/*.js | ||
``` | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) |
@@ -11,3 +11,3 @@ /*! | ||
var toSingleQuotes = function (str) { | ||
return str.replace(/(?:\\*)?"[^"]*"/g, function (match) { | ||
return str.replace(/(?:\\*)?"([^"\\]*\\")*[^"]*"/g, function (match) { | ||
return match | ||
@@ -14,0 +14,0 @@ .replace(/\\"/g, '"') // unescape double-quotes |
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
4021
76