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

openrosa-xpath-evaluator

Package Overview
Dependencies
Maintainers
1
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 1.2.1 to 1.2.2

2

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

@@ -5,0 +5,0 @@ "main": "src/openrosa-xpath.js",

@@ -108,3 +108,3 @@ /*

case '%': return lhs.v % rhs.v;
case '=': return lhs.v === rhs.v;
case '=': return lhs.v == rhs.v;
case '<': return lhs.v < rhs.v;

@@ -111,0 +111,0 @@ case '>': return lhs.v > rhs.v;

@@ -28,2 +28,49 @@ define(['src/openrosa-xpath-extensions', 'src/extended-xpath', 'chai', 'lodash'], function(openRosaXpathExtensions, ExtendedXpathEvaluator, chai, _) {

describe('basic xpath', function() {
describe('comparing node values', function() {
describe('to integer values', function() {
it('should support equality operator', function() {
// given
simpleValueIs(1);
// expect
assert.isTrue(xEval('/simple/xpath/to/node = 1').booleanValue);
});
it('should support inequality operator', function() {
// given
simpleValueIs(1);
// expect
assert.isFalse(xEval('/simple/xpath/to/node != 1').booleanValue);
});
it('should support comparators', function() {
// given
simpleValueIs(1);
// expect
assert.isFalse(xEval('/simple/xpath/to/node < 1').booleanValue);
assert.isFalse(xEval('/simple/xpath/to/node > 1').booleanValue);
assert.isTrue(xEval('/simple/xpath/to/node <= 1').booleanValue);
assert.isTrue(xEval('/simple/xpath/to/node >= 1').booleanValue);
});
});
describe('to string values', function() {
it('should support equality operator', function() {
// given
simpleValueIs(1);
// expect
assert.isTrue(xEval('/simple/xpath/to/node = "1"').booleanValue);
});
it('should support inequality operator', function() {
// given
simpleValueIs(1);
// expect
assert.isFalse(xEval('/simple/xpath/to/node != "1"').booleanValue);
});
});
});
});
describe('openrosa-xpath', function() {

@@ -30,0 +77,0 @@ it('should process simple xpaths', function() {

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