@flowblade/sql-tag-format 1.1.1 → 1.1.2
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/index.cjs +10 -31
- package/dist/index.js +10 -31
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let sql_formatter = require("sql-formatter");
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
|
|
4
4
|
function _typeof(o) {
|
|
5
5
|
"@babel/helpers - typeof";
|
|
6
6
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -10,7 +10,7 @@ function _typeof(o) {
|
|
|
10
10
|
}, _typeof(o);
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region \0@oxc-project+runtime@0.
|
|
13
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
|
|
14
14
|
function toPrimitive(t, r) {
|
|
15
15
|
if ("object" != _typeof(t) || !t) return t;
|
|
16
16
|
var e = t[Symbol.toPrimitive];
|
|
@@ -22,13 +22,13 @@ function toPrimitive(t, r) {
|
|
|
22
22
|
return ("string" === r ? String : Number)(t);
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region \0@oxc-project+runtime@0.
|
|
25
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
|
|
26
26
|
function toPropertyKey(t) {
|
|
27
27
|
var i = toPrimitive(t, "string");
|
|
28
28
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region \0@oxc-project+runtime@0.
|
|
31
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
|
|
32
32
|
function _defineProperty(e, r, t) {
|
|
33
33
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
34
34
|
value: t,
|
|
@@ -38,29 +38,6 @@ function _defineProperty(e, r, t) {
|
|
|
38
38
|
}) : e[r] = t, e;
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/objectSpread2.js
|
|
42
|
-
function ownKeys(e, r) {
|
|
43
|
-
var t = Object.keys(e);
|
|
44
|
-
if (Object.getOwnPropertySymbols) {
|
|
45
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
46
|
-
r && (o = o.filter(function(r) {
|
|
47
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
48
|
-
})), t.push.apply(t, o);
|
|
49
|
-
}
|
|
50
|
-
return t;
|
|
51
|
-
}
|
|
52
|
-
function _objectSpread2(e) {
|
|
53
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
54
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
55
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
56
|
-
_defineProperty(e, r, t[r]);
|
|
57
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
58
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return e;
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
41
|
//#region src/sql-formatter.ts
|
|
65
42
|
var SqlFormatter = class {
|
|
66
43
|
/**
|
|
@@ -120,7 +97,7 @@ var SqlFormatter = class {
|
|
|
120
97
|
(sql, params) => {
|
|
121
98
|
try {
|
|
122
99
|
return this.formatOrThrow(sql, params);
|
|
123
|
-
} catch
|
|
100
|
+
} catch {
|
|
124
101
|
return null;
|
|
125
102
|
}
|
|
126
103
|
}
|
|
@@ -148,9 +125,11 @@ var SqlFormatter = class {
|
|
|
148
125
|
*/
|
|
149
126
|
"formatOrThrow",
|
|
150
127
|
(sql, params) => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
128
|
+
const options = params?.options ?? this.formatterOptions;
|
|
129
|
+
return (0, sql_formatter.format)(typeof sql === "string" ? sql : sql.sql, {
|
|
130
|
+
language: params?.dialect ?? this.dialect,
|
|
131
|
+
...options
|
|
132
|
+
});
|
|
154
133
|
}
|
|
155
134
|
);
|
|
156
135
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { format } from "sql-formatter";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
|
|
3
3
|
function _typeof(o) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
5
5
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -9,7 +9,7 @@ function _typeof(o) {
|
|
|
9
9
|
}, _typeof(o);
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.
|
|
12
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
|
|
13
13
|
function toPrimitive(t, r) {
|
|
14
14
|
if ("object" != _typeof(t) || !t) return t;
|
|
15
15
|
var e = t[Symbol.toPrimitive];
|
|
@@ -21,13 +21,13 @@ function toPrimitive(t, r) {
|
|
|
21
21
|
return ("string" === r ? String : Number)(t);
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
//#region \0@oxc-project+runtime@0.
|
|
24
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
|
|
25
25
|
function toPropertyKey(t) {
|
|
26
26
|
var i = toPrimitive(t, "string");
|
|
27
27
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region \0@oxc-project+runtime@0.
|
|
30
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
|
|
31
31
|
function _defineProperty(e, r, t) {
|
|
32
32
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
33
33
|
value: t,
|
|
@@ -37,29 +37,6 @@ function _defineProperty(e, r, t) {
|
|
|
37
37
|
}) : e[r] = t, e;
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region \0@oxc-project+runtime@0.115.0/helpers/objectSpread2.js
|
|
41
|
-
function ownKeys(e, r) {
|
|
42
|
-
var t = Object.keys(e);
|
|
43
|
-
if (Object.getOwnPropertySymbols) {
|
|
44
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
45
|
-
r && (o = o.filter(function(r) {
|
|
46
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
47
|
-
})), t.push.apply(t, o);
|
|
48
|
-
}
|
|
49
|
-
return t;
|
|
50
|
-
}
|
|
51
|
-
function _objectSpread2(e) {
|
|
52
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
53
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
54
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
55
|
-
_defineProperty(e, r, t[r]);
|
|
56
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
57
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return e;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
40
|
//#region src/sql-formatter.ts
|
|
64
41
|
var SqlFormatter = class {
|
|
65
42
|
/**
|
|
@@ -119,7 +96,7 @@ var SqlFormatter = class {
|
|
|
119
96
|
(sql, params) => {
|
|
120
97
|
try {
|
|
121
98
|
return this.formatOrThrow(sql, params);
|
|
122
|
-
} catch
|
|
99
|
+
} catch {
|
|
123
100
|
return null;
|
|
124
101
|
}
|
|
125
102
|
}
|
|
@@ -147,9 +124,11 @@ var SqlFormatter = class {
|
|
|
147
124
|
*/
|
|
148
125
|
"formatOrThrow",
|
|
149
126
|
(sql, params) => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
127
|
+
const options = params?.options ?? this.formatterOptions;
|
|
128
|
+
return format(typeof sql === "string" ? sql : sql.sql, {
|
|
129
|
+
language: params?.dialect ?? this.dialect,
|
|
130
|
+
...options
|
|
131
|
+
});
|
|
153
132
|
}
|
|
154
133
|
);
|
|
155
134
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowblade/sql-tag-format",
|
|
3
3
|
"description": "Formatter utilities for @flowblade/sql-tag",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Vanvelthem Sébastien",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"test-unit-coverage": "vitest run --coverage",
|
|
63
63
|
"test-unit-edge": "vitest run --environment edge-runtime",
|
|
64
64
|
"test-unit-watch": "vitest --ui --api 4515",
|
|
65
|
-
"typecheck": "
|
|
66
|
-
"typecheck-build": "
|
|
65
|
+
"typecheck": "tsgo --project tsconfig.json --noEmit",
|
|
66
|
+
"typecheck-build": "tsgo --project tsconfig.build.json --noEmit",
|
|
67
67
|
"ci-coverage-upload": "../../.github/scripts/download/codecov -F flowblade-sql-tag-format --dir ./coverage"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@flowblade/sql-tag": "^0.3.2",
|
|
71
|
-
"sql-formatter": "^15.7.
|
|
71
|
+
"sql-formatter": "^15.7.3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@arethetypeswrong/cli": "0.18.2",
|
|
@@ -77,13 +77,14 @@
|
|
|
77
77
|
"@edge-runtime/vm": "5.0.0",
|
|
78
78
|
"@size-limit/esbuild": "12.0.1",
|
|
79
79
|
"@size-limit/file": "12.0.1",
|
|
80
|
-
"@
|
|
81
|
-
"@vitest/
|
|
80
|
+
"@typescript/native-preview": "7.0.0-dev.20260324.1",
|
|
81
|
+
"@vitest/coverage-istanbul": "4.1.2",
|
|
82
|
+
"@vitest/ui": "4.1.2",
|
|
82
83
|
"browserslist": "4.28.1",
|
|
83
84
|
"browserslist-to-esbuild": "2.1.1",
|
|
84
85
|
"cross-env": "10.1.0",
|
|
85
|
-
"es-check": "9.6.
|
|
86
|
-
"esbuild": "0.27.
|
|
86
|
+
"es-check": "9.6.3",
|
|
87
|
+
"esbuild": "0.27.4",
|
|
87
88
|
"eslint": "8.57.1",
|
|
88
89
|
"execa": "9.6.1",
|
|
89
90
|
"npm-run-all2": "8.0.4",
|
|
@@ -91,13 +92,12 @@
|
|
|
91
92
|
"publint": "0.3.18",
|
|
92
93
|
"rimraf": "6.1.3",
|
|
93
94
|
"size-limit": "12.0.1",
|
|
94
|
-
"tsdown": "0.21.
|
|
95
|
+
"tsdown": "0.21.7",
|
|
95
96
|
"tsx": "4.21.0",
|
|
96
|
-
"typedoc": "0.28.
|
|
97
|
-
"typedoc-plugin-markdown": "4.
|
|
98
|
-
"typescript": "
|
|
99
|
-
"
|
|
100
|
-
"vitest": "4.0.18"
|
|
97
|
+
"typedoc": "0.28.18",
|
|
98
|
+
"typedoc-plugin-markdown": "4.11.0",
|
|
99
|
+
"typescript": "6.0.2",
|
|
100
|
+
"vitest": "4.1.2"
|
|
101
101
|
},
|
|
102
102
|
"engines": {
|
|
103
103
|
"node": ">=20.9.0"
|