Comparing version 0.5.20 to 0.5.21
@@ -126,11 +126,18 @@ var xjst = require('../../xjst'), | ||
return templates.map(function(template) { | ||
var filter = options.scoreFilter; | ||
return [ | ||
template[0].slice().sort(function(a, b) { | ||
var rateA = chart[a[0]].count / | ||
Math.log(Math.E * (1 + chart[a[0]].variance)), | ||
rateB = chart[b[0]].count / | ||
Math.log(Math.E * (1 + chart[b[0]].variance)), | ||
var ca = chart[a[0]]; | ||
var cb = chart[b[0]]; | ||
var rateA = ca.count / Math.log(Math.E * (1 + ca.variance)), | ||
rateB = cb.count / Math.log(Math.E * (1 + cb.variance)), | ||
strA = utils.stringify(a[1]), | ||
strB = utils.stringify(b[1]); | ||
if (options.scoreFilter) { | ||
rateA += options.scoreFilter(a[1], strA, rateA); | ||
rateB += options.scoreFilter(b[1], strB, rateB); | ||
} | ||
return rateA > rateB ? | ||
@@ -137,0 +144,0 @@ -1 |
{ | ||
"name": "xjst", | ||
"description": "XSLT inspired JavaScript templates (with spices)", | ||
"version": "0.5.20", | ||
"version": "0.5.21", | ||
"homepage": "http://github.com/veged/xjst", | ||
@@ -6,0 +6,0 @@ "author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)", |
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
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
115476
2126