bridge-odata
Advanced tools
Comparing version 0.0.8 to 0.0.9
{ | ||
"name": "bridge-odata", | ||
"version": "0.0.8", | ||
"description": "Retsly OData JS SDK", | ||
"version": "0.0.9", | ||
"description": "Bridge API OData JS SDK", | ||
"main": "src/index.js", | ||
@@ -19,3 +19,3 @@ "scripts": { | ||
"author": "Joe joetho@zillowgroup.com", | ||
"license": "MIT", | ||
"license": "GPLv3", | ||
"dependencies": { | ||
@@ -22,0 +22,0 @@ "acorn": "^5.7.1", |
@@ -116,8 +116,18 @@ /* jshint esversion: 6 */ | ||
if (!COMPARATOR_MAP.hasOwnProperty(operation)) { | ||
throw new Error(`'${operation}', is not a valid operation`) | ||
} | ||
if (typeof operation === 'function') { | ||
acorn.parse(operation); | ||
let names = acorn.parse(operation).body[0].expression.params.map(param => param.name); | ||
// The parameters must be left or right | ||
if ((!names.includes('left') || !names.includes('right')) || names.length > 2) { | ||
throw new Error(`custom operation must only include parameters left and right ${names} is an invalid set.`) | ||
} | ||
// Either parameters are (left,right) or (right,left) | ||
if (names[0] === 'left') { | ||
this.str = operation(left, right) | ||
} else { | ||
this.str = operation(right, left) | ||
} | ||
} else { | ||
if (!COMPARATOR_MAP.hasOwnProperty(operation)) { | ||
throw new Error(`'${operation}', is not a valid operation`) | ||
} | ||
// Create the actual query string. | ||
@@ -124,0 +134,0 @@ this.str = COMPARATOR_MAP[operation](left, right) |
@@ -1,2 +0,2 @@ | ||
let filter = require('../src/lib/filter') | ||
const filter = require('../src/lib/filter') | ||
const assert = require('assert') | ||
@@ -3,0 +3,0 @@ |
@@ -1,3 +0,3 @@ | ||
let sdk = require('../src/index') | ||
let filter = require('../src/lib/filter') | ||
const sdk = require('../src/index') | ||
const filter = require('../src/lib/filter') | ||
const assert = require('assert') | ||
@@ -4,0 +4,0 @@ |
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
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
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
22441
545
3
70