sql-formatter
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -25,3 +25,3 @@ "use strict"; | ||
* @param {String[]} cfg.reservedNewlineWords Words that are set to newline | ||
* @param {String[]} cfg.stringTypes String types to enable: "", '', ``, [] | ||
* @param {String[]} cfg.stringTypes String types to enable: "", '', ``, [], N'' | ||
* @param {String[]} cfg.openParens Opening parentheses to enable, like (, [ | ||
@@ -70,2 +70,3 @@ * @param {String[]} cfg.closeParens Closing parentheses to enable, like ), ] | ||
// 4. single quoted string using '' or \' to escape | ||
// 5. national character quoted string using N'' or N\' to escape | ||
@@ -77,2 +78,3 @@ | ||
"''": "(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)", | ||
"N''": "((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)", | ||
"``": "((`[^`]*($|`))+)", | ||
@@ -79,0 +81,0 @@ "[]": "((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)" |
@@ -51,3 +51,3 @@ "use strict"; | ||
reservedNewlineWords: reservedNewlineWords, | ||
stringTypes: ["\"\"", "''", "``", "[]"], | ||
stringTypes: ["\"\"", "N''", "''", "``", "[]"], | ||
openParens: ["("], | ||
@@ -54,0 +54,0 @@ closeParens: [")"], |
{ | ||
"name": "sql-formatter", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Formats whitespaces in a SQL query to make it more readable", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -10,3 +10,3 @@ import _ from "lodash"; | ||
* @param {String[]} cfg.reservedNewlineWords Words that are set to newline | ||
* @param {String[]} cfg.stringTypes String types to enable: "", '', ``, [] | ||
* @param {String[]} cfg.stringTypes String types to enable: "", '', ``, [], N'' | ||
* @param {String[]} cfg.openParens Opening parentheses to enable, like (, [ | ||
@@ -58,2 +58,3 @@ * @param {String[]} cfg.closeParens Closing parentheses to enable, like ), ] | ||
// 4. single quoted string using '' or \' to escape | ||
// 5. national character quoted string using N'' or N\' to escape | ||
createStringPattern(stringTypes) { | ||
@@ -63,2 +64,3 @@ const patterns = { | ||
"''": "(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)", | ||
"N''": "((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)", | ||
"``": "((`[^`]*($|`))+)", | ||
@@ -65,0 +67,0 @@ "[]": "((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)", |
@@ -76,3 +76,3 @@ import Formatter from "../core/Formatter"; | ||
reservedNewlineWords, | ||
stringTypes: [`""`, "''", "``", "[]"], | ||
stringTypes: [`""`, "N''", "''", "``", "[]"], | ||
openParens: ["("], | ||
@@ -79,0 +79,0 @@ closeParens: [")"], |
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
761849
18677