Skip to content

Commit c5bf1fa

Browse files
committed
Fix promise for node 10
1 parent f0f2e2e commit c5bf1fa

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/postgresql.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ var ParameterizedSQL = SqlConnector.ParameterizedSQL;
1515
var util = require('util');
1616
var debug = require('debug')('loopback:connector:postgresql');
1717

18+
// Add support for node 0.10.x
19+
if (typeof Promise == 'undefined') {
20+
global.Promise = require('promise-polyfill');
21+
}
22+
1823
/**
1924
*
2025
* Initialize the PostgreSQL connector against the given data source

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"debug": "^2.1.1",
2222
"loopback-connector": "^2.1.0",
2323
"pg": "^6.0.0",
24+
"promise-polyfill": "^6.0.2",
2425
"strong-globalize": "^2.6.2"
2526
},
2627
"devDependencies": {

0 commit comments

Comments
 (0)