odata-query
Advanced tools
Comparing version 5.6.1 to 5.7.0
@@ -137,2 +137,3 @@ 'use strict'; | ||
var FUNCTION_REGEX = /\((.*)\)/; | ||
var INDEXOF_REGEX = /(?!indexof)\((\w+)\)/; | ||
@@ -163,3 +164,14 @@ function buildFilter() { | ||
var value = filters[filterKey]; | ||
var propName = propPrefix ? FUNCTION_REGEX.test(filterKey) ? filterKey.replace(FUNCTION_REGEX, '(' + propPrefix + '/$1)') : propPrefix + '/' + filterKey : filterKey; | ||
var propName = ''; | ||
if (propPrefix) { | ||
if (INDEXOF_REGEX.test(filterKey)) { | ||
propName = filterKey.replace(INDEXOF_REGEX, '(' + propPrefix + '/$1)'); | ||
} else if (FUNCTION_REGEX.test(filterKey)) { | ||
propName = filterKey.replace(FUNCTION_REGEX, '(' + propPrefix + '/$1)'); | ||
} else { | ||
propName = propPrefix + '/' + filterKey; | ||
} | ||
} else { | ||
propName = filterKey; | ||
} | ||
@@ -296,2 +308,4 @@ if (['number', 'string', 'boolean'].indexOf(typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== -1 || value instanceof Date || value === null) { | ||
return value.value; | ||
case 'binary': | ||
return 'binary\'' + value.value + '\''; | ||
} | ||
@@ -298,0 +312,0 @@ return value; |
{ | ||
"name": "odata-query", | ||
"version": "5.6.1", | ||
"version": "5.7.0", | ||
"author": "Sean Lynch <techniq35@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
29817
412