Created
May 3, 2010 20:28
-
-
Save dvv/388547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- resource-query.js.orig 2010-05-03 20:15:43.000000000 +0400 | |
+++ resource-query.js 2010-05-03 23:34:14.000000000 +0400 | |
@@ -13,7 +13,8 @@ | |
} | |
var terms = []; | |
var originalTerms = terms; | |
- if(query.replace(/([&\|,])?(([\+\*\-:\w%\._]+)(=[a-z]*=|=|=?<|=?>|!=)([\+\*\$\-:\w%\._]+)|(([\+\*\\$\-:\w%\._]+)(\(?))|(\))|(.+))/g, | |
+// if(query.replace(/([&\|,])?(([\+\*\-:\w%\._]+)(=[a-z]*=|=|=?<|=?>|!=)([\+\*\$\-:\w%\._]+)|(([\+\*\\$\-:\w%\._]+)(\(?))|(\))|(.+))/g, | |
+ if(query.replace(/([&\|,])?(([\+\*\-:\w%\._]+)(=[a-z]*=|=|=?<|=?>|!=)([\+\*\$\-:\w%\._,]+)|(([\+\*\\$\-:\w%\._]+)(\(?))|(\))|(.+))/g, | |
// <-delim-> <--- name --------- comparator ----- value ---->|<-function/value -- openParan->|<-closedParan->|<-illegalCharacter-> | |
function(t, termDelimiter, expression, name, comparator, value, call, functionOrValue, openParan, closedParan, illegalCharacter){ | |
if(comparator){ | |
@@ -227,6 +228,15 @@ | |
case "false": return false; | |
case "null": return null; | |
default: | |
+ // DVV: handle arrays | |
+ if (string.indexOf(',') > -1) { | |
+ var r = []; | |
+ string.split(',').forEach(function(x){ | |
+ r.push(stringToValue(x, parameters)); | |
+ }); | |
+ return r; | |
+ } | |
+ // handle scalars | |
var number = parseFloat(string, 10); | |
if(isNaN(number)){ | |
if(string.indexOf(":") > -1){ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment