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

hmpo-form-controller

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmpo-form-controller - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

8

lib/form.js

@@ -17,3 +17,3 @@ /*eslint no-unused-vars: [2, {"vars": "all", "args": "none"}]*/

if (!options.template) {
throw new Error('A template must be provided');
debug('No template provided');
}

@@ -101,3 +101,7 @@ options.defaultFormatters = options.defaultFormatters || ['trim', 'singlespaces', 'hyphens'];

render: function (req, res, callback) {
res.render(this.options.template);
if (!this.options.template) {
callback(new Error('A template must be provided'));
} else {
res.render(this.options.template);
}
},

@@ -104,0 +108,0 @@ _getErrors: function (req, res, callback) {

{
"name": "hmpo-form-controller",
"version": "0.10.0",
"version": "0.11.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,7 +24,7 @@ var Form = require('../../');

it('throws if template is undefined', function () {
it('doesn\'t throw if template is undefined', function () {
var fn = function () {
return new Form({});
};
fn.should.throw();
fn.should.not.throw();
});

@@ -551,2 +551,9 @@

it('throws an error if no template provided', function () {
var err = new Error('A template must be provided');
form.options.template = undefined;
form.render(req, res, cb);
cb.should.have.been.calledOnce.and.calledWithExactly(err);
});
});

@@ -553,0 +560,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