Skip to content

Commit

Permalink
编译新包
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjian committed Sep 27, 2021
1 parent 82e14fe commit 992f743
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/rollup.bundle.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const baseConfig = require("./rollup.config");
module.exports = {
...baseConfig,
output: {
file: util.resolve("dist/h-tools.js"),
file: util.resolve("dist/h-mysql.js"),
format: "cjs"
}
};
19 changes: 16 additions & 3 deletions dist/h-mysql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* h-mysql v1.0.10
* h-mysql v1.0.13
* (c) 2018-2021 haizlin https://github.com/haizlin/h-mysql
* Licensed MIT
* Released on: February 1, 2018
Expand Down Expand Up @@ -272,7 +272,15 @@ function sortArray(data) {

function insertData(data) {
if (!data) return '';
if (Array.isArray(data) && data.length === 1) data = data[0];

if (Array.isArray(data) && data.length === 0) {
return '';
}

if (Array.isArray(data) && data.length === 1) {
data = data[0];
}

let keys = '';
let values = '';
let datastr = '';
Expand Down Expand Up @@ -665,7 +673,12 @@ class Base {
opt = opt.join(',');
}

this.sqlObj.order = `${orderby} ${opt}`;
if (opt === '' || opt.length === 0 || opt === undefined) {
this.sqlObj.order = '';
} else {
this.sqlObj.order = `${orderby} ${opt}`;
}

return this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class Base {
let orderby: string = 'ORDER BY'

if (typeof (opt) === 'object') {
opt = opt.join(',')
opt = opt.join(',')
}

if (opt === '' || opt.length === 0 || opt === undefined) {
Expand Down

0 comments on commit 992f743

Please sign in to comment.