Skip to content

Commit 2ff1d97

Browse files
authored
Merge pull request #41 from strongloop-community/upgrade-deps
upgrade deps
2 parents e8fb022 + 2aab6d9 commit 2ff1d97

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

lib/sqlite3.js

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -529,19 +529,6 @@ SQLite3.prototype.toColumnValue = function(property, value) {
529529
return b;
530530
case 'String':
531531
return value;
532-
case 'GeoPoint':
533-
case 'Point':
534-
case 'List':
535-
case 'Object':
536-
case 'ModelConstructor':
537-
return JSON.stringify(value);
538-
case 'JSON':
539-
try {
540-
JSON.parse(value);
541-
} catch (e) {
542-
return new InvalidParam('SQLITE3: Invalid JSON: ' + value);
543-
}
544-
return String(value);
545532
case 'Date':
546533
if (!isNaN(value))
547534
return Number(value);
@@ -552,13 +539,19 @@ SQLite3.prototype.toColumnValue = function(property, value) {
552539
}
553540
return new InvalidParam('SQLITE3: Invalid JSON: ' + value);
554541
case 'Array':
542+
case 'GeoPoint':
543+
case 'Point':
544+
case 'List':
545+
case 'Object':
546+
case 'ModelConstructor':
547+
case 'JSON':
555548
default:
556-
return value;
549+
return JSON.stringify(value);
557550
}
558551
};
559552

560553
SQLite3.prototype.fromColumnValue = function(property, value) {
561-
if (value === null || !property) {
554+
if (value == null || !property) {
562555
return value;
563556
}
564557
switch (property.type.name) {
@@ -572,19 +565,17 @@ SQLite3.prototype.fromColumnValue = function(property, value) {
572565
);
573566
case 'String':
574567
return String(value);
568+
case 'Date':
569+
return new Date(value);
575570
case 'GeoPoint':
576571
case 'Point':
577572
case 'List':
578573
case 'Array':
579574
case 'Object':
580575
case 'ModelConstructor':
581-
return JSON.parse(value);
582576
case 'JSON':
583-
return String(value);
584-
case 'Date':
585-
return new Date(value);
586577
default:
587-
return value;
578+
return JSON.parse(value);
588579
}
589580
};
590581

@@ -593,6 +584,9 @@ SQLite3.prototype.buildInsertDefaultValues = function() {
593584
return 'DEFAULT VALUES';
594585
};
595586

587+
SQLite3.prototype.ping = function(cb) {
588+
if (cb) process.nextTick(cb);
589+
};
596590

597591
//require('./discovery')(SQLite3);
598592
require('./migration')(SQLite3);

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
"test": "mocha -R spec -b --timeout 10000 --require test/init.js test/*.test.js"
2121
},
2222
"dependencies": {
23-
"async": "^0.9.0",
24-
"debug": "^2.1.1",
25-
"loopback-connector": "2.x",
23+
"async": "^2.6.1",
24+
"debug": "^3.1.0",
25+
"loopback-connector": "^4.5.1",
2626
"moment": "^2.10.3",
27-
"sqlite3": "^3.1.0",
28-
"strong-globalize": "^2.6.2"
27+
"sqlite3": "^4.0.2",
28+
"strong-globalize": "^4.1.1"
2929
},
3030
"devDependencies": {
31-
"bluebird": "^2.9.12",
31+
"bluebird": "^3.5.1",
3232
"eslint": "^0.23.0",
3333
"jscs": "^1.13.1",
3434
"loopback-datasource-juggler": "^3.0.0",
3535
"mktmpdir": "^0.1.1",
36-
"mocha": "^2.1.0",
36+
"mocha": "^5.2.0",
3737
"rc": "^1.0.0",
3838
"should": "^8.0.2"
3939
},

0 commit comments

Comments
 (0)