Socket
Socket
Sign inDemoInstall

dust-usecontent-helper

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 4.0.0-0

.travis.yml

5

index.js

@@ -6,3 +6,3 @@ "use strict";

if (typeof lookup !== 'function' || lookup.length !== 3) {
throw new TypeError("lookup function must be in the form function(locale, bundle, callback) { ... }");
throw new TypeError("lookup function must be in the form function(context, bundle, callback) { ... }");
}

@@ -24,4 +24,3 @@

return chunk.map(function (chunk) {
/* Accept either simply-named "locale" or paypal "locality" */
lookup(ctx.get('contextLocale') || ctx.get('contentLocality') || ctx.get('locale') || ctx.get('locality') || {}, params.bundle, function (err, content) {
lookup(ctx, params.bundle, function (err, content) {
if (err) {

@@ -28,0 +27,0 @@ chunk.setError(err);

4

package.json
{
"name": "dust-usecontent-helper",
"version": "3.0.0",
"version": "4.0.0-0",
"description": "A dust helper to load i18n content at render time",

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

"dust-message-helper": "^3.0.0",
"dustjs-linkedin": "^2.4.2",
"dustjs-linkedin": "~2.7.1",
"tape": "^3.0.0"
}
}

@@ -16,3 +16,4 @@ "use strict";

test('Does loader get called?', function (t) {
require('../index')(function(locality, bundle, cont) {
require('../index')(function(context, bundle, cont) {
t.same(context.options.option, true);
t.pass('loader got called');

@@ -25,3 +26,3 @@ cont(null, {"hello": "world"});

dustjs.loadSource(dustjs.compile('{@useContent bundle="test"}{@message key="hello" /}{/useContent}', 'test'));
dustjs.render('test', {}, function (err, out) {
dustjs.render('test', dustjs.context({}, { option: true }), function (err, out) {
t.equal(out, "world");

@@ -28,0 +29,0 @@ t.pass("loader is called");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc