Comparing version 0.9.3 to 0.9.4
@@ -86,7 +86,16 @@ /** | ||
// define functions and constant values | ||
if (options.fn && Object.keys(options.fn).length) { | ||
styl.use(function (styl) { | ||
for (var key in options.fn) { | ||
styl.define(key, function() { return options.fn[key]; }); | ||
} | ||
_.each(options.fn, function (fn, name) { | ||
if (_.isFunction(fn)) { | ||
styl.define(name, function (data) { | ||
return fn(data && data.val); | ||
}); | ||
} else { | ||
styl.define(name, function () { | ||
return fn; | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -93,0 +102,0 @@ } |
{ | ||
"name": "beezlib", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -161,3 +161,2 @@ var path = require('path'); | ||
}; | ||
debugger; | ||
var dstpath = index.template.hbs2hbsc2html('test/hbs/local.develop.html', 'index.html.hbs', store); | ||
@@ -172,9 +171,8 @@ dstpath.should.equal('test/hbs/local.develop.html'); | ||
nib: true, | ||
fn : function (styl) { | ||
styl.define('body-padding', function (data) { | ||
var rate = data.val || 1; | ||
var base = 10; | ||
return (rate * base) + 'px'; | ||
}); | ||
fn : { | ||
TEST: 'TEST', | ||
'body-padding': function (value) { | ||
value.should.equal(3); | ||
return value + 'px'; | ||
} | ||
} | ||
@@ -181,0 +179,0 @@ }, function (err, css) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
385587
2886
4