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

hyperactive

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperactive - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

5

package.json
{
"name": "hyperactive",
"version": "2.1.2",
"version": "2.2.0",
"description": "Creates mocha tests for all hypermedia of your API",

@@ -30,4 +30,5 @@ "author": "Tabcorp Digital Technology Team",

"unirest": "~0.2.7",
"uri-templates": "~0.1.5"
"uri-templates": "~0.1.5",
"async": "~0.9.0"
}
}

57

target/crawler.js
// Generated by CoffeeScript 1.7.1
(function() {
var build, config, createIt, expandUrl, linkFilter, linkFinder, localItFunction, setIt, templates, validate, _;
var async, build, config, createIt, expandUrl, linkFilter, linkFinder, localItFunction, setIt, templates, validate, _;
_ = require('lodash');
async = require('async');
templates = require('uri-templates');

@@ -43,19 +45,48 @@

exports.createItWithResult = function(url, err) {
return localItFunction(url, function(done) {
return done(err);
});
};
exports.processResponse = (function(_this) {
return function(parent, res, templateValues, done) {
var err;
if (!res.ok) {
return done("Bad status " + res.status + " for url " + res.url);
}
if (!validate(parent, res)) {
return done("Not a valid response: " + res.body);
try {
if (!validate(parent, res)) {
return done("Not a valid response: " + res.body);
}
} catch (_error) {
err = _error;
return done(err);
}
describe("" + parent, function() {
return _.forEach(exports.getLinks(res), function(link) {
var expandedLink;
linkFilter.processLink(link);
expandedLink = expandUrl(link, templateValues);
return exports.crawl(expandedLink, templateValues);
return describe("" + parent, function() {
var requests;
requests = _.map(exports.getLinks(res), function(link) {
return function(callback) {
var expandedLink;
linkFilter.processLink(link);
expandedLink = expandUrl(link, templateValues);
return build.request(expandedLink, config.options).end((function(_this) {
return function(res) {
return exports.processResponse(expandedLink, res, templateValues, function(err) {
return callback(null, {
err: err,
link: expandedLink
});
});
};
})(this));
};
});
return async.parallel(requests, function(err, results) {
results.forEach(function(result) {
return exports.createItWithResult(result.link, result.err);
});
return done();
});
});
return done();
};

@@ -79,6 +110,2 @@ })(this);

exports.crawl = function(url, templateValues) {
return createIt(url, templateValues);
};
exports.startCrawl = function(config, it) {

@@ -93,3 +120,3 @@ var expandedUrl;

linkFilter.processLink(expandedUrl);
return exports.crawl(expandedUrl, config.templateValues);
return createIt(expandedUrl, config.templateValues);
};

@@ -96,0 +123,0 @@

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