mysql2-core 0.3.2 → 0.3.3

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/lib/index.js CHANGED
@@ -1071,7 +1071,7 @@ var MySQLStreamWriter = (function () {
1071
1071
  else {
1072
1072
  var total_1 = this.list.length;
1073
1073
  var stmt = build_1.buildToSaveBatch(this.list, this.table, this.attributes, this.version, this.param);
1074
- if (stmt) {
1074
+ if (stmt.length > 0) {
1075
1075
  if (this.executeBatch) {
1076
1076
  return this.executeBatch(stmt).then(function (r) {
1077
1077
  _this.list = [];
@@ -1126,7 +1126,7 @@ var MySQLBatchWriter = (function () {
1126
1126
  }
1127
1127
  }
1128
1128
  var stmts = build_1.buildToSaveBatch(list, this.table, this.attributes, this.version, this.param);
1129
- if (stmts && stmts.length > 0) {
1129
+ if (stmts.length > 0) {
1130
1130
  if (this.execute) {
1131
1131
  if (this.oneIfSuccess) {
1132
1132
  return this.execute(stmts).then(function (ct) { return stmts.length; });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2-core",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "mysql2-core",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -902,7 +902,7 @@ export class MySQLStreamWriter<T> {
902
902
  } else {
903
903
  const total = this.list.length
904
904
  const stmt = buildToSaveBatch(this.list, this.table, this.attributes, this.version, this.param)
905
- if (stmt) {
905
+ if (stmt.length > 0) {
906
906
  if (this.executeBatch) {
907
907
  return this.executeBatch(stmt).then((r) => {
908
908
  this.list = []
@@ -961,7 +961,7 @@ export class MySQLBatchWriter<T> {
961
961
  }
962
962
  }
963
963
  const stmts = buildToSaveBatch(list, this.table, this.attributes, this.version, this.param)
964
- if (stmts && stmts.length > 0) {
964
+ if (stmts.length > 0) {
965
965
  if (this.execute) {
966
966
  if (this.oneIfSuccess) {
967
967
  return this.execute(stmts).then((ct) => stmts.length)