New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hmpo-template-mixins

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmpo-template-mixins - npm Package Compare versions

Comparing version 2.0.0-1 to 2.0.0

3

lib/template-mixins.js

@@ -158,3 +158,4 @@ 'use strict';

label: t(fieldLabel || 'fields.' + key + '.label'),
selected: selected
selected: selected,
className: classNames(key) || 'block-label'
});

@@ -161,0 +162,0 @@ }

{
"name": "hmpo-template-mixins",
"version": "2.0.0-1",
"version": "2.0.0",
"description": "A middleware that exposes a series of Mustache mixins on res.locals to ease usage of forms, translations, and some general needs.",

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

@@ -36,3 +36,3 @@ # passports-template-mixins

By default any function set to `req.translate` will be used for translation if it exists. For example, that generate using [i18n-future](https://npmjs.com/package.i18n-future) middleware.
By default any function set to `req.translate` will be used for translation if it exists. For example, that generated using [i18n-future](https://npmjs.com/package/i18n-future) middleware.

@@ -39,0 +39,0 @@ ## Options

@@ -397,2 +397,23 @@ var mixins = require('../lib/template-mixins');

it('should default className `block-label`', function () {
middleware(req, res, next);
res.locals['checkbox']().call(res.locals, 'field-name');
render.should.have.been.calledWith(sinon.match({
className: 'block-label'
}));
});
it('should override default className if one was specified against the field', function () {
middleware = mixins({
'field-name': {
'className': 'overwritten'
}
});
middleware(req, res, next);
res.locals['checkbox']().call(res.locals, 'field-name');
render.should.have.been.calledWith(sinon.match({
className: 'overwritten'
}));
});
});

@@ -399,0 +420,0 @@

Sorry, the diff of this file is not supported yet

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