openrosa-xpath-evaluator
Advanced tools
Comparing version 1.3.2 to 1.4.0
{ | ||
"name": "openrosa-xpath-evaluator", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.", | ||
@@ -5,0 +5,0 @@ "main": "src/openrosa-xpath.js", |
@@ -1,6 +0,4 @@ | ||
var openrosa_xpath_extensions = (function() { | ||
var openrosa_xpath_extensions = function(translate) { | ||
var | ||
MILLIS_PER_DAY = 1000 * 60 * 60 * 24, | ||
MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], | ||
DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], | ||
RAW_NUMBER = /^(-?[0-9]+)(\.[0-9]+)?$/, | ||
@@ -99,3 +97,3 @@ DATE_STRING = /^\d\d\d\d-\d\d-\d\d(?:T\d\d:\d\d:\d\d(?:Z|[+-]\d\d:\d\d))?$/, | ||
} else if (c === 'b') { //short text month | ||
sb += MONTHS[f.month - 1]; | ||
sb += translate('date.month.' + f.month); | ||
} else if (c === 'd') { //0-padded day of month | ||
@@ -116,3 +114,3 @@ sb += _zeroPad(f.day, 2); | ||
} else if (c === 'a') { //Three letter short text day | ||
sb += DAYS[f.dow - 1]; | ||
sb += translate('date.dayofweek.' + f.dow); | ||
} else if (c === 'Z' || c === 'A' || c === 'B') { | ||
@@ -262,3 +260,3 @@ throw new Error('unsupported escape in date format string [%' + c + ']'); | ||
}; | ||
}()); | ||
}; | ||
@@ -265,0 +263,0 @@ if(typeof define === 'function') { |
@@ -1,2 +0,3 @@ | ||
define(['src/openrosa-xpath-extensions', 'src/extended-xpath', 'chai', 'lodash'], function(openRosaXpathExtensions, ExtendedXpathEvaluator, chai, _) { | ||
define(['src/openrosa-xpath-extensions', 'src/extended-xpath', 'src/translate', 'chai', 'lodash'], | ||
function(openRosaXpathExtensions, ExtendedXpathEvaluator, translate, chai, _) { | ||
var TODO = function() { if(false) assert.notOk('TODO'); }, | ||
@@ -12,3 +13,3 @@ SIMPLE_DATE_MATCH = /^\d{4}-\d\d-\d\d$/, | ||
}, | ||
openRosaXpathExtensions), | ||
openRosaXpathExtensions(translate)), | ||
simpleValueIs = function(textValue) { | ||
@@ -15,0 +16,0 @@ var xml = '<simple><xpath><to><node>' + textValue + |
@@ -1,3 +0,4 @@ | ||
define(['src/openrosa-xpath-extensions', 'chai', 'lodash'], function(or, chai, _) { | ||
var f = or.func; | ||
define(['src/openrosa-xpath-extensions', 'src/translate', 'chai', 'lodash'], | ||
function(or, translate, chai, _) { | ||
var f = or(translate).func; | ||
@@ -4,0 +5,0 @@ function zeroPad(n) { |
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
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
150516
15
2481
0