Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crunchable

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crunchable - npm Package Compare versions

Comparing version 0.0.4444 to 0.1.1

25

lib/index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc