Skip to content

Commit

Permalink
version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
helloyou2012 committed Mar 26, 2020
1 parent a336303 commit 02809ee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions lib/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,9 @@ module.exports = function(Target) {
return this.then().catch(onReject);
};

Object.defineProperty(Target.prototype, Symbol.toStringTag, {
get: () => 'object',
});

finallyMixin(Target.prototype);
};
2 changes: 1 addition & 1 deletion lib/query/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function escapeString(val, finalEscape, ctx) {
return "'" + escapedVal + "'";
}

function dateToString(date, finalEscape, ctx) {
function dateToString(date, finalEscape, ctx = {}) {
const timeZone = ctx.timeZone || 'local';

const dt = new Date(date);
Expand Down
2 changes: 1 addition & 1 deletion lib/util/parse-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const isWindows = process && process.platform && process.platform === 'win32';
module.exports = function parseConnectionString(str) {
const parsed = url.parse(str, true);
let { protocol } = parsed;
const isDriveLetter = isWindows && protocol.length === 2;
const isDriveLetter = isWindows && protocol && protocol.length === 2;
if (protocol === null || isDriveLetter) {
return {
client: 'sqlite3',
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sk2",
"version": "1.0.3",
"version": "1.0.4",
"description": "knex with sequelize query",
"main": "index.js",
"types": "types/index.d.ts",
Expand Down Expand Up @@ -34,22 +34,22 @@
},
"homepage": "https://github.com/d-band/sk2#readme",
"devDependencies": {
"@babel/parser": "^7.8.8",
"@babel/traverse": "^7.8.6",
"@babel/parser": "^7.9.4",
"@babel/traverse": "^7.9.0",
"chai": "^4.2.0",
"coveralls": "^3.0.11",
"fs-extra": "^9.0.0",
"glob": "^7.1.6",
"knex": "^0.20.12",
"mariadb": "^2.2.0",
"knex": "^0.20.13",
"mariadb": "^2.3.1",
"mocha": "^7.1.1",
"mysql2": "^2.1.0",
"nyc": "^15.0.0",
"pg": "^7.18.2",
"pg-hstore": "^2.3.3",
"sequelize": "^5.21.5",
"sqlite3": "^4.1.1",
"tedious": "^8.0.1"
"tedious": "^8.2.0"
},
"engines": {
"node": ">=8.10.0"
Expand Down
5 changes: 4 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,10 @@ declare namespace Knex {
| "catch"
| "finally";

interface ChainableInterface<T = any> extends Pick<Promise<T>, keyof Promise<T> & ExposedPromiseKeys> {
interface StringTagSupport {
readonly [Symbol.toStringTag]: string;
}
interface ChainableInterface<T = any> extends Pick<Promise<T>, keyof Promise<T> & ExposedPromiseKeys>, StringTagSupport {
toQuery(): string;
options(options: Readonly<{ [key: string]: any }>): this;
connection(connection: any): this;
Expand Down

0 comments on commit 02809ee

Please sign in to comment.