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.2.2 to 2.3.0

23

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

@@ -9,6 +9,6 @@ "author": "Tabcorp Digital Technology Team",

"type": "git",
"url": "https://github.com/TabDigital/hyperactive.git"
"url": "https://github.com/Tabcorp/hyperactive.git"
},
"bugs": {
"url": "https://github.com/TabDigital/hyperactive/issues"
"url": "https://github.com/Tabcorp/hyperactive/issues"
},

@@ -20,16 +20,15 @@ "main": "target/index.js",

"devDependencies": {
"coffee-script": "~1.7.1",
"mocha": "~1.20.1",
"require-lint": "~1.0.0",
"sinon": "~1.10.3",
"coffeescript": "~2.3.2",
"mocha": "~5.2.0",
"require-lint": "^1.3.0",
"should": "~4.0.4",
"irish-pub": "~0.1.0"
"sinon": "~1.10.3"
},
"dependencies": {
"lodash": "~2.4.1",
"async": "~2.0.1",
"js-match": "~1.0.6",
"unirest": "~0.2.7",
"uri-templates": "~0.1.5",
"async": "~0.9.0"
"lodash": "^4.17.11",
"unirest": "^0.5.1",
"uri-templates": "~0.1.5"
}
}

@@ -5,6 +5,6 @@ # hyperactive

![Logo](https://raw.githubusercontent.com/TabDigital/hyperactive/master/logo.png)
![Logo](https://raw.githubusercontent.com/Tabcorp/hyperactive/master/logo.png)
[![Build Status](https://travis-ci.org/TabDigital/hyperactive.svg?branch=master)](https://travis-ci.org/TabDigital/hyperactive)
[![Dependency Status](https://david-dm.org/TabDigital/hyperactive.png?theme=shields.io)](https://david-dm.org/TabDigital/hyperactive) [![devDependency Status](https://david-dm.org/TabDigital/hyperactive/dev-status.png?theme=shields.io)](https://david-dm.org/TabDigital/hyperactive#info=devDependencies)
[![Build Status](https://travis-ci.org/Tabcorp/hyperactive.svg?branch=master)](https://travis-ci.org/Tabcorp/hyperactive)
[![Dependency Status](https://david-dm.org/Tabcorp/hyperactive.png?theme=shields.io)](https://david-dm.org/Tabcorp/hyperactive) [![devDependency Status](https://david-dm.org/Tabcorp/hyperactive/dev-status.png?theme=shields.io)](https://david-dm.org/Tabcorp/hyperactive#info=devDependencies)

@@ -11,0 +11,0 @@ [![npm install](https://nodei.co/npm/hyperactive.png?mini=true)](https://nodei.co/npm/hyperactive/)

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {
var DEFAULT_CONFIG, async, build, config, createIt, expandUrl, linkFilter, linkFinder, localItFunction, setIt, templates, validate, _;
var DEFAULT_CONFIG, _, async, build, config, createIt, expandUrl, linkFilter, linkFinder, localItFunction, setIt, templates, validate;

@@ -49,11 +49,9 @@ _ = require('lodash');

createIt = (function(_this) {
return function(url, templateValues) {
return localItFunction(url, function(done) {
return build.request(url, config.options).end(function(res) {
return exports.processResponse(url, res, templateValues, done);
});
createIt = (url, templateValues) => {
return localItFunction(url, (done) => {
return build.request(url, config.options).end((res) => {
return exports.processResponse(url, res, templateValues, done);
});
};
})(this);
});
};

@@ -66,48 +64,44 @@ exports.createItWithResult = function(url, err) {

exports.processResponse = (function(_this) {
return function(parent, res, templateValues, done) {
var err;
if (!res.ok) {
if (!config.recover(res)) {
err = "Bad status " + res.status + " for url " + res.url;
exports.processResponse = (parent, res, templateValues, done) => {
var err;
if (!res.ok) {
if (!config.recover(res)) {
err = `Bad status ${res.status} for url ${res.url}`;
}
return done(err);
} else {
try {
if (!validate(parent, res)) {
return done(`Not a valid response: ${res.body}`);
}
} catch (error) {
err = error;
return done(err);
} else {
try {
if (!validate(parent, res)) {
return done("Not a valid response: " + res.body);
}
} catch (_error) {
err = _error;
return done(err);
}
}
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 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((res) => {
return exports.processResponse(expandedLink, res, templateValues, function(err) {
return callback(null, {
err,
link: expandedLink
});
});
});
return done();
};
});
return async.parallel(requests, function(err, results) {
results.forEach(function(result) {
return exports.createItWithResult(result.link, result.err);
});
return done();
});
};
})(this);
});
};

@@ -114,0 +108,0 @@ expandUrl = function(url, values) {

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {

@@ -3,0 +3,0 @@ var crawler, jsmatch, schema;

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {
var processedLinks, _;
var _, processedLinks;

@@ -18,3 +18,3 @@ _ = require('lodash');

exports.unprocessedLinks = function(links) {
return _.filter(_.unique(links), function(link) {
return _.filter(_.uniq(links), function(link) {
return link !== void 0 && processedLinks[link] === void 0;

@@ -34,3 +34,3 @@ });

} else {
return _.sample(unprocessedLinks, exports.linksToSample(unprocessedLinks.length, samplePercentage));
return _.sampleSize(unprocessedLinks, exports.linksToSample(unprocessedLinks.length, samplePercentage));
}

@@ -37,0 +37,0 @@ };

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {
var linksForKey, _;
var _, linksForKey;

@@ -9,3 +9,3 @@ _ = require('lodash');

if (key === '_links') {
return _.pluck(_.values(val), 'href');
return _.map(_.values(val), 'href');
} else if (typeof val === 'object') {

@@ -19,5 +19,5 @@ return _.map(val, linksForKey);

exports.getLinks = function(responseBody) {
return _.flatten(linksForKey(responseBody, ''));
return _.flattenDeep(linksForKey(responseBody, ''));
};
}).call(this);

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {

@@ -3,0 +3,0 @@ var request;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 2.3.2
(function() {

@@ -3,0 +3,0 @@ module.exports = {

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