Comparing version 0.0.4444 to 0.1.1
@@ -5,5 +5,5 @@ 'use strict'; | ||
var _whatwgFetch = require('whatwg-fetch'); | ||
var _isomorphicFetch = require('isomorphic-fetch'); | ||
var _whatwgFetch2 = _interopRequireDefault(_whatwgFetch); | ||
var _isomorphicFetch2 = _interopRequireDefault(_isomorphicFetch); | ||
@@ -43,3 +43,3 @@ var _lodash = require('lodash'); | ||
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(endpoint, extra_options) { | ||
var options, url, response, text; | ||
var options, url, response, text, json; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -50,9 +50,11 @@ while (1) { | ||
options = _lodash2.default.merge({}, { | ||
'X-Crunch-API-Key': this.token, | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json; charset=UTF-8' | ||
headers: { | ||
'X-Crunch-API-Key': this.token, | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json; charset=UTF-8' | ||
} | ||
}, extra_options); | ||
url = '' + CRUNCHABLE_URL + endpoint; | ||
_context.next = 4; | ||
return (0, _whatwgFetch2.default)(url, options); | ||
return (0, _isomorphicFetch2.default)(url, options); | ||
@@ -75,5 +77,10 @@ case 4: | ||
case 10: | ||
return _context.abrupt('return', response.json()); | ||
_context.next = 12; | ||
return response.json(); | ||
case 11: | ||
case 12: | ||
json = _context.sent; | ||
return _context.abrupt('return', json); | ||
case 14: | ||
case 'end': | ||
@@ -80,0 +87,0 @@ return _context.stop(); |
{ | ||
"name": "crunchable", | ||
"version": "0.0.4444", | ||
"version": "0.1.1", | ||
"description": "A thin wrapper around the crunchable human-intelligence api", | ||
@@ -44,5 +44,5 @@ "main": "./lib/index.js", | ||
"babel-polyfill": "^6.20.0", | ||
"lodash": "^4.17.2", | ||
"whatwg-fetch": "^2.0.1" | ||
"isomorphic-fetch": "^2.2.1", | ||
"lodash": "^4.17.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10993
182
+ Addedisomorphic-fetch@^2.2.1
+ Addedencoding@0.1.13(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisomorphic-fetch@2.2.1(transitive)
+ Addednode-fetch@1.7.3(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedwhatwg-fetch@3.6.20(transitive)
- Removedwhatwg-fetch@^2.0.1
- Removedwhatwg-fetch@2.0.4(transitive)