Socket
Socket
Sign inDemoInstall

sql-formatter

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-formatter - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

4

lib/core/Tokenizer.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc