Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openrosa-xpath-evaluator

Package Overview
Dependencies
Maintainers
5
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openrosa-xpath-evaluator - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

test/integration/openrosa-xpath/geo.spec.js

4

CHANGELOG.md

@@ -6,2 +6,6 @@ # Change Log

## [3.1.0] - 2024-07-12
- Add multi-argument support to distance function (#1328)
## [3.0.0] - 2023-10-30

@@ -8,0 +12,0 @@

13

package.json
{
"name": "openrosa-xpath-evaluator",
"version": "3.0.0",
"version": "3.1.0",
"description": "Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.",

@@ -22,7 +22,6 @@ "homepage": "https://enketo.org",

"type": "git",
"url": "https://github.com/enketo/openrosa-xpath-evaluator"
"url": "https://github.com/enketo/enketo"
},
"author": "Alex",
"license": "Apache-2.0",
"bugs": "https://github.com/enketo/openrosa-xpath-evaluator/issues",
"bugs": "https://github.com/enketo/enketo/issues",
"devDependencies": {

@@ -38,8 +37,8 @@ "lodash": "^4.17.21",

"npm": "please-use-yarn",
"yarn": ">= 1.22.19 <2"
"yarn": ">= 1.22.22 <2"
},
"volta": {
"node": "20.5.1",
"yarn": "1.22.19"
"node": "20.15.1",
"yarn": "1.22.22"
}
}

@@ -127,7 +127,12 @@ const EARTH_EQUATORIAL_RADIUS_METERS = 6378100;

function asGeopoints(r) {
if (r.t === 'arr' && r.v.length > 1) {
return r.v.map(asString);
function asGeopoints(...r) {
if (r.length > 1) {
return r.map(asString);
}
return asString(r).split(';');
if (r[0].t === 'arr' && r[0].v.length > 1) {
return r[0].v.map(asString);
}
return asString(r[0]).split(';');
}

@@ -253,5 +253,5 @@ const { BlankDate, getTimezoneOffsetAsTime } = require('./date-extensions');

},
distance(r) {
distance(...r) {
if (arguments.length === 0) throw TOO_FEW_ARGS;
return XPR.number(distance(asGeopoints(r)));
return XPR.number(distance(asGeopoints(...r)));
},

@@ -258,0 +258,0 @@ exp(r) {

@@ -17,3 +17,4 @@ const {

'date("not a date")',
'date("opv_3")',
'date("opv3")',
// TODO 'date("opv_3")' once https://bugzilla.mozilla.org/show_bug.cgi?id=1881930 is addressed
'date(true())',

@@ -20,0 +21,0 @@ // TODO "date(convertible())"

@@ -26,3 +26,10 @@ const { assert } = require('chai');

});
it(`should handle multiple arguments`, () => {
assert.deepEqual(
asGeopoints(wrapVal('1'), wrapVal('2'), wrapVal('3')),
['1', '2', '3']
);
});
});
});
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