prettier-plugin-sql-cst 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_utils.d.ts +2 -0
- package/dist/node_utils.js +3 -1
- package/dist/syntax/expr.js +3 -1
- package/package.json +6 -3
package/dist/node_utils.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const isStringLiteral: (node: any) => node is import("sql-parser-
|
|
|
12
12
|
export declare const isArraySubscript: (node: any) => node is import("sql-parser-cst").ArraySubscript;
|
|
13
13
|
export declare const isAsClause: (node: any) => node is import("sql-parser-cst").AsClause<Node>;
|
|
14
14
|
export declare const isParenExpr: (node: any) => node is import("sql-parser-cst").ParenExpr<Node>;
|
|
15
|
+
export declare const isSelectStmt: (node: any) => node is import("sql-parser-cst").SelectStmt;
|
|
16
|
+
export declare const isCompoundSelectStmt: (node: any) => node is import("sql-parser-cst").CompoundSelectStmt;
|
|
15
17
|
export declare const isListExpr: (node: any) => node is import("sql-parser-cst").ListExpr<Node>;
|
|
16
18
|
export declare const isCreateFunctionStmt: (node: any) => node is import("sql-parser-cst").CreateFunctionStmt;
|
|
17
19
|
export declare const isLanguageClause: (node: any) => node is import("sql-parser-cst").LanguageClause;
|
package/dist/node_utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDynamicallyLoadedFunction = exports.isLanguageClause = exports.isCreateFunctionStmt = exports.isListExpr = exports.isParenExpr = exports.isAsClause = exports.isArraySubscript = exports.isStringLiteral = exports.isJsonbLiteral = exports.isJsonLiteral = exports.isEmpty = exports.isKeyword = exports.isCreateTableStmt = exports.isFuncArgs = exports.isFuncCall = exports.isValuesClause = exports.isProgram = void 0;
|
|
3
|
+
exports.isDynamicallyLoadedFunction = exports.isLanguageClause = exports.isCreateFunctionStmt = exports.isListExpr = exports.isCompoundSelectStmt = exports.isSelectStmt = exports.isParenExpr = exports.isAsClause = exports.isArraySubscript = exports.isStringLiteral = exports.isJsonbLiteral = exports.isJsonLiteral = exports.isEmpty = exports.isKeyword = exports.isCreateTableStmt = exports.isFuncArgs = exports.isFuncCall = exports.isValuesClause = exports.isProgram = void 0;
|
|
4
4
|
var utils_1 = require("./utils");
|
|
5
5
|
var is = function (type) {
|
|
6
6
|
return function (node) {
|
|
@@ -20,6 +20,8 @@ exports.isStringLiteral = is("string_literal");
|
|
|
20
20
|
exports.isArraySubscript = is("array_subscript");
|
|
21
21
|
exports.isAsClause = is("as_clause");
|
|
22
22
|
exports.isParenExpr = is("paren_expr");
|
|
23
|
+
exports.isSelectStmt = is("select_stmt");
|
|
24
|
+
exports.isCompoundSelectStmt = is("compound_select_stmt");
|
|
23
25
|
exports.isListExpr = is("list_expr");
|
|
24
26
|
exports.isCreateFunctionStmt = is("create_function_stmt");
|
|
25
27
|
exports.isLanguageClause = is("language_clause");
|
package/dist/syntax/expr.js
CHANGED
|
@@ -39,7 +39,9 @@ exports.exprMap = {
|
|
|
39
39
|
}
|
|
40
40
|
// Discard unnecessary parenthesis around function arguments
|
|
41
41
|
if ((0, node_utils_1.isListExpr)(path.getParentNode(0)) &&
|
|
42
|
-
(0, node_utils_1.isFuncArgs)(path.getParentNode(1))
|
|
42
|
+
(0, node_utils_1.isFuncArgs)(path.getParentNode(1)) &&
|
|
43
|
+
!(0, node_utils_1.isSelectStmt)(node.expr) &&
|
|
44
|
+
!(0, node_utils_1.isCompoundSelectStmt)(node.expr)) {
|
|
43
45
|
return print("expr");
|
|
44
46
|
}
|
|
45
47
|
var parent = path.getParentNode();
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier-plugin-sql-cst",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"description": "Prettier plugin for SQL",
|
|
5
|
-
"
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Bowen Parnell <bparnell@4tel.com.au>",
|
|
7
|
+
"Rene Saarsoo <nene@triin.net>"
|
|
8
|
+
],
|
|
6
9
|
"license": "GPL-3.0-or-later",
|
|
7
10
|
"main": "dist/index.js",
|
|
8
11
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +36,7 @@
|
|
|
33
36
|
],
|
|
34
37
|
"dependencies": {
|
|
35
38
|
"prettier": "^3.0.3",
|
|
36
|
-
"sql-parser-cst": "^0.28.
|
|
39
|
+
"sql-parser-cst": "^0.28.1"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@types/jest": "^29.2.5",
|