@maiyunnet/kebab 5.0.3 → 5.0.4

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/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "5.0.3";
8
+ export declare const VER = "5.0.4";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  export declare const LIB_PATH: string;
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '5.0.3';
9
+ export const VER = '5.0.4';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/sql.js CHANGED
@@ -113,7 +113,7 @@ export class Sql {
113
113
  else {
114
114
  // --- v1: json ---
115
115
  sql += this.placeholder() + ', ';
116
- this._data.push(lText.stringifyJson(v1));
116
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v1) : v1);
117
117
  }
118
118
  }
119
119
  else if (v1.x !== undefined) {
@@ -133,7 +133,7 @@ export class Sql {
133
133
  else {
134
134
  // --- v1: json ---
135
135
  sql += this.placeholder() + ', ';
136
- this._data.push(lText.stringifyJson(v1));
136
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v1) : v1);
137
137
  }
138
138
  }
139
139
  else if (v1 instanceof Buffer) {
@@ -148,7 +148,7 @@ export class Sql {
148
148
  else {
149
149
  // --- json ---
150
150
  sql += this.placeholder() + ', ';
151
- this._data.push(lText.stringifyJson(v1));
151
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v1) : v1);
152
152
  }
153
153
  }
154
154
  sql = sql.slice(0, -2) + '), ';
@@ -203,7 +203,7 @@ export class Sql {
203
203
  else {
204
204
  // --- v: json ---
205
205
  values += this.placeholder() + ', ';
206
- this._data.push(lText.stringifyJson(v));
206
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
207
207
  }
208
208
  }
209
209
  else if (v.x !== undefined) {
@@ -223,7 +223,7 @@ export class Sql {
223
223
  else {
224
224
  // --- v: json ---
225
225
  values += this.placeholder() + ', ';
226
- this._data.push(lText.stringifyJson(v));
226
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
227
227
  }
228
228
  }
229
229
  else if (v instanceof Buffer) {
@@ -238,7 +238,7 @@ export class Sql {
238
238
  else {
239
239
  // --- json ---
240
240
  values += this.placeholder() + ', ';
241
- this._data.push(lText.stringifyJson(v));
241
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
242
242
  }
243
243
  }
244
244
  sql = sql.slice(0, -2) + ') VALUES (' + values.slice(0, -2) + ')';
@@ -385,7 +385,7 @@ export class Sql {
385
385
  else {
386
386
  // --- v: json ---
387
387
  sql += this.placeholder() + ', ';
388
- this._data.push(lText.stringifyJson(v));
388
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
389
389
  }
390
390
  }
391
391
  else if (v.x !== undefined) {
@@ -411,7 +411,7 @@ export class Sql {
411
411
  else {
412
412
  // --- 8 ---
413
413
  sql += this.placeholder() + ', ';
414
- this._data.push(lText.stringifyJson(v));
414
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
415
415
  }
416
416
  }
417
417
  }
@@ -427,7 +427,7 @@ export class Sql {
427
427
  else {
428
428
  // --- json ---
429
429
  sql += this.placeholder() + ', ';
430
- this._data.push(lText.stringifyJson(v));
430
+ this._data.push(this._service === ESERVICE.MYSQL ? lText.stringifyJson(v) : v);
431
431
  }
432
432
  }
433
433
  }
@@ -1084,7 +1084,7 @@ export function format(sql, data, service = ESERVICE.MYSQL) {
1084
1084
  if (val instanceof Buffer) {
1085
1085
  return `'\\x${val.toString('hex')}'`;
1086
1086
  }
1087
- return `'${JSON.stringify(val).replace(/'/g, "''")}'`;
1087
+ return `'${lText.stringifyJson(val).replace(/'/g, "''")}'`;
1088
1088
  });
1089
1089
  }
1090
1090
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [