Comparing version 0.1.3 to 0.1.4
@@ -7,3 +7,3 @@ 'use strict'; | ||
unclosedQI: 3, // Unclosed quoted identifier. | ||
multiLineQI: 4 // Multi-line quoted identifier not supported. | ||
multiLineQI: 4 // Multi-line quoted identifiers are not supported. | ||
}; | ||
@@ -10,0 +10,0 @@ |
@@ -63,3 +63,3 @@ 'use strict'; | ||
if (text.indexOf(EOL) > 0) { | ||
throwError(PEC.multiLineQI, "Multi-line quoted identifier not supported."); | ||
throwError(PEC.multiLineQI, "Multi-line quoted identifiers are not supported."); | ||
} | ||
@@ -91,3 +91,10 @@ addSpace(); | ||
var text = sql.substr(idx, closeIdx - idx + 1); | ||
if (text.indexOf(EOL) > 0) { | ||
var hasLB = text.indexOf(EOL) > 0; | ||
if (hasLB) { | ||
text = text.split(EOL).map(function (m) { | ||
return m.replace(/^\s+|\s+$/g, ''); | ||
}).join('\\n'); | ||
} | ||
var hasTabs = text.indexOf('\t') > 0; | ||
if (hasLB || hasTabs) { | ||
var prev = idx ? sql[idx - 1] : ''; | ||
@@ -97,6 +104,7 @@ if (prev !== 'E' && prev !== 'e') { | ||
} | ||
text = text.split(EOL).map(function (m) { | ||
return m.replace(/^\s+|\s+$/g, ''); | ||
}).join('\\n'); | ||
if (hasTabs) { | ||
text = text.replace(/\t/g, '\\t'); | ||
} | ||
} | ||
result += text; | ||
@@ -103,0 +111,0 @@ idx = closeIdx; |
{ | ||
"name": "pg-minify", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Minifies PostgreSQL scripts.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -64,2 +64,2 @@ pg-minify | ||
[SQLParsingError]:https://github.com/vitaly-t/pg-minify/blob/master/lib/error.js#L10 | ||
[SQLParsingError]:https://github.com/vitaly-t/pg-minify/blob/master/lib/error.js |
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
9103
198