simple-odata-server
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /* eslint no-redeclare:0 */ |
@@ -47,2 +47,21 @@ /*! | ||
Node.prototype._prop = function (result, left, rightValue) { | ||
if (left.type === 'property' && left.name.indexOf('/') !== -1) { | ||
var fragments = left.name.split('/') | ||
var obj = result[fragments[0]] || {} | ||
for (var i = 1; i < fragments.length; i++) { | ||
if (i === (fragments.length - 1)) { | ||
obj[fragments[i]] = rightValue | ||
} else { | ||
obj[fragments[i]] = obj[fragments[i]] || {} | ||
} | ||
} | ||
result[fragments[0]] = obj | ||
} else { | ||
result[left.name] = rightValue | ||
} | ||
} | ||
Node.prototype.transform = function () { | ||
@@ -52,11 +71,11 @@ var result = {} | ||
if (this.type === 'eq' && this.right.type === 'literal') { | ||
result[this.left.name] = this.right.value | ||
this._prop(result, this.left, this.right.value) | ||
} | ||
if (this.type === 'lt' && this.right.type === 'literal') { | ||
result[this.left.name] = { '$lt': this.right.value } | ||
this._prop(result, this.left, { '$lt': this.right.value }) | ||
} | ||
if (this.type === 'gt' && this.right.type === 'literal') { | ||
result[this.left.name] = { '$gt': this.right.value } | ||
this._prop(result, this.left, { '$gt': this.right.value }) | ||
} | ||
@@ -63,0 +82,0 @@ |
{ | ||
"name": "simple-odata-server", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "OData server with adapter for mongodb and nedb", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
31901
810