Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
polyfills as peer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Feb 8, 2017
1 parent ffd960c commit de56706
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 42 deletions.
14 changes: 0 additions & 14 deletions js/npm/etherscan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

// require('babel-polyfill/dist/polyfill.js');
require('es6-promise').polyfill();

const isNode = typeof global !== 'undefined' && typeof global !== 'undefined';
const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined';

if (isBrowser) {
require('whatwg-fetch');
}

if (isNode) {
global.fetch = require('node-fetch');
}

module.exports = require('./dist');
5 changes: 5 additions & 0 deletions js/npm/etherscan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"scripts": {
"test": "node test/smoke.spec.js"
},
"peerDependencies": {
"es6-promise": "^4.0.5",
"isomorphic-fetch": "^2.2.1",
"babel-polyfill": "^6.22.0"
},
"devDependencies": {
},
"dependencies": {
Expand Down
5 changes: 5 additions & 0 deletions js/npm/jsonrpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"scripts": {
"test": "node test/smoke.spec.js"
},
"peerDependencies": {
"es6-promise": "^4.0.5",
"isomorphic-fetch": "^2.2.1",
"babel-polyfill": "^6.22.0"
},
"devDependencies": {
},
"dependencies": {
Expand Down
14 changes: 0 additions & 14 deletions js/npm/parity/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

// require('babel-polyfill/dist/polyfill.js');
require('es6-promise').polyfill();

const isNode = typeof global !== 'undefined' && typeof global !== 'undefined';
const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined';

if (isBrowser) {
require('whatwg-fetch');
}

if (isNode) {
global.fetch = require('node-fetch');
}

const Abi = require('./dist/abi');
const Api = require('./dist/api');

Expand Down
5 changes: 5 additions & 0 deletions js/npm/parity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"scripts": {
"test": "node test/smoke.spec.js"
},
"peerDependencies": {
"es6-promise": "^4.0.5",
"isomorphic-fetch": "^2.2.1",
"babel-polyfill": "^6.22.0"
},
"devDependencies": {
},
"dependencies": {
Expand Down
14 changes: 0 additions & 14 deletions js/npm/shapeshift/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,4 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

// require('babel-polyfill/dist/polyfill.js');
require('es6-promise').polyfill();

const isNode = typeof global !== 'undefined' && typeof global !== 'undefined';
const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined';

if (isBrowser) {
require('whatwg-fetch');
}

if (isNode) {
global.fetch = require('node-fetch');
}

module.exports = require('./dist');
5 changes: 5 additions & 0 deletions js/npm/shapeshift/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"scripts": {
"test": "node test/smoke.spec.js"
},
"peerDependencies": {
"es6-promise": "^4.0.5",
"isomorphic-fetch": "^2.2.1",
"babel-polyfill": "^6.22.0"
},
"devDependencies": {
},
"dependencies": {
Expand Down

0 comments on commit de56706

Please sign in to comment.