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

heroku-client

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-client - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

13

lib/resourceBuilder.js

@@ -14,2 +14,10 @@ var Heroku = require('./heroku'),

function ParamError (message) {
this.name = 'ParamError';
this.message = message || '';
}
ParamError.prototype = Object.create(Error.prototype);
ParamError.prototype.constructor = ParamError;
function buildResource (resource) {

@@ -27,4 +35,9 @@ _.each(resource.actions, function (action, actionName) {

var requestPath = action.path,
pathParams = action.path.match(/{[a-z_]+}/g) || [],
callback;
if (this.params.length !== pathParams.length) {
throw new ParamError('Invalid number of params in path (expected ' + pathParams.length + ', got ' + this.params.length + ').');
}
this.params.forEach(function (param) {

@@ -31,0 +44,0 @@ requestPath = requestPath.replace(/{[a-z_]+}/, param);

2

package.json
{
"name": "heroku-client",
"version": "0.5.0",
"version": "0.5.1",
"description": "A wrapper for the Heroku v3 API",

@@ -5,0 +5,0 @@ "main": "./lib/heroku.js",

@@ -116,2 +116,4 @@ # heroku-client [![Build Status](https://travis-ci.org/heroku/node-heroku-client.png?branch=master)](https://travis-ci.org/heroku/node-heroku-client)

Generating docs also runs a cursory test, ensuring that every documented function *is* a function that can be called.
### Running tests

@@ -118,0 +120,0 @@

@@ -13,3 +13,3 @@ var Heroku = require('../../lib/heroku'),

it('passes its method into the request', function(done) {
heroku.apps('my-app').create({}, function() {
heroku.apps().create({}, function() {
expect(Request.request.mostRecentCall.args[0].method).toEqual('POST');

@@ -27,2 +27,10 @@ done();

describe('requests with the wrong number of parameters', function() {
it('throws an error', function() {
expect(function () {
heroku.apps('my-app').list();
}).toThrow(new Error('Invalid number of params in path (expected 0, got 1).'));
});
});
describe('requests with no body', function() {

@@ -29,0 +37,0 @@ it('can perform a request with no parameters', function(done) {

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