Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
1f88c5ad
Commit
1f88c5ad
authored
Dec 31, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jio.js and complex_queries.js updated
parent
a935229f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
177 additions
and
23 deletions
+177
-23
complex_queries.js
complex_queries.js
+168
-23
jio.js
jio.js
+9
-0
No files found.
complex_queries.js
View file @
1f88c5ad
...
@@ -97,17 +97,18 @@ function __NODEJS_lex( info )
...
@@ -97,17 +97,18 @@ function __NODEJS_lex( info )
switch
(
state
)
switch
(
state
)
{
{
case
0
:
case
0
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
8
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
10
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
info
.
src
.
charCodeAt
(
pos
)
==
59
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
63
&&
info
.
src
.
charCodeAt
(
pos
)
<=
64
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
66
&&
info
.
src
.
charCodeAt
(
pos
)
<=
77
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
80
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
8
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
10
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
info
.
src
.
charCodeAt
(
pos
)
==
59
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
63
&&
info
.
src
.
charCodeAt
(
pos
)
<=
64
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
66
&&
info
.
src
.
charCodeAt
(
pos
)
<=
77
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
80
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
9
)
state
=
2
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
9
)
state
=
2
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
40
)
state
=
3
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
40
)
state
=
3
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
41
)
state
=
4
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
41
)
state
=
4
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
60
||
info
.
src
.
charCodeAt
(
pos
)
==
62
)
state
=
5
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
60
||
info
.
src
.
charCodeAt
(
pos
)
==
62
)
state
=
5
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
3
4
)
state
=
11
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
3
3
)
state
=
11
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
79
)
state
=
12
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
79
)
state
=
12
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
32
)
state
=
13
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
32
)
state
=
13
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
61
)
state
=
14
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
61
)
state
=
14
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
65
)
state
=
18
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
34
)
state
=
15
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
78
)
state
=
19
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
65
)
state
=
19
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
78
)
state
=
20
;
else
state
=
-
1
;
else
state
=
-
1
;
break
;
break
;
...
@@ -183,9 +184,7 @@ switch( state )
...
@@ -183,9 +184,7 @@ switch( state )
break
;
break
;
case
11
:
case
11
:
if
(
info
.
src
.
charCodeAt
(
pos
)
==
34
)
state
=
7
;
if
(
info
.
src
.
charCodeAt
(
pos
)
==
61
)
state
=
14
;
else
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
33
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
91
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
93
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
11
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
92
)
state
=
15
;
else
state
=
-
1
;
else
state
=
-
1
;
break
;
break
;
...
@@ -211,7 +210,9 @@ switch( state )
...
@@ -211,7 +210,9 @@ switch( state )
break
;
break
;
case
15
:
case
15
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
11
;
if
(
info
.
src
.
charCodeAt
(
pos
)
==
34
)
state
=
7
;
else
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
33
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
91
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
93
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
15
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
92
)
state
=
17
;
else
state
=
-
1
;
else
state
=
-
1
;
break
;
break
;
...
@@ -225,6 +226,11 @@ switch( state )
...
@@ -225,6 +226,11 @@ switch( state )
break
;
break
;
case
17
:
case
17
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
15
;
else
state
=
-
1
;
break
;
case
18
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
83
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
85
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
83
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
85
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
84
)
state
=
10
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
84
)
state
=
10
;
...
@@ -233,7 +239,7 @@ switch( state )
...
@@ -233,7 +239,7 @@ switch( state )
match_pos
=
pos
;
match_pos
=
pos
;
break
;
break
;
case
1
8
:
case
1
9
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
77
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
79
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
77
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
79
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
78
)
state
=
16
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
78
)
state
=
16
;
...
@@ -242,10 +248,10 @@ switch( state )
...
@@ -242,10 +248,10 @@ switch( state )
match_pos
=
pos
;
match_pos
=
pos
;
break
;
break
;
case
19
:
case
20
:
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
78
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
80
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
if
(
(
info
.
src
.
charCodeAt
(
pos
)
>=
0
&&
info
.
src
.
charCodeAt
(
pos
)
<=
31
)
||
info
.
src
.
charCodeAt
(
pos
)
==
33
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
35
&&
info
.
src
.
charCodeAt
(
pos
)
<=
39
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
42
&&
info
.
src
.
charCodeAt
(
pos
)
<=
57
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
59
&&
info
.
src
.
charCodeAt
(
pos
)
<=
78
)
||
(
info
.
src
.
charCodeAt
(
pos
)
>=
80
&&
info
.
src
.
charCodeAt
(
pos
)
<=
254
)
)
state
=
1
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
58
)
state
=
6
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
79
)
state
=
1
7
;
else
if
(
info
.
src
.
charCodeAt
(
pos
)
==
79
)
state
=
1
8
;
else
state
=
-
1
;
else
state
=
-
1
;
match
=
10
;
match
=
10
;
match_pos
=
pos
;
match_pos
=
pos
;
...
@@ -755,7 +761,7 @@ var query_class_dict = {};
...
@@ -755,7 +761,7 @@ var query_class_dict = {};
* @param {String} spec.key The metadata key
* @param {String} spec.key The metadata key
* @param {String} spec.value The value of the metadata to compare
* @param {String} spec.value The value of the metadata to compare
*/
*/
function
ComplexQuery
(
spec
)
{
function
ComplexQuery
(
spec
,
key_schema
)
{
Query
.
call
(
this
);
Query
.
call
(
this
);
/**
/**
...
@@ -777,7 +783,12 @@ function ComplexQuery(spec) {
...
@@ -777,7 +783,12 @@ function ComplexQuery(spec) {
* @optional
* @optional
*/
*/
this
.
query_list
=
spec
.
query_list
||
[];
this
.
query_list
=
spec
.
query_list
||
[];
this
.
query_list
=
this
.
query_list
.
map
(
QueryFactory
.
create
);
/*jslint unparam: true*/
this
.
query_list
=
this
.
query_list
.
map
(
// decorate the map to avoid sending the index as key_schema argument
function
(
o
,
i
)
{
return
QueryFactory
.
create
(
o
,
key_schema
);
}
);
/*jslint unparam: false*/
}
}
inherits
(
ComplexQuery
,
Query
);
inherits
(
ComplexQuery
,
Query
);
...
@@ -1070,7 +1081,7 @@ function QueryFactory() {
...
@@ -1070,7 +1081,7 @@ function QueryFactory() {
* of a Query
* of a Query
* @return {Query} A Query object
* @return {Query} A Query object
*/
*/
QueryFactory
.
create
=
function
(
object
)
{
QueryFactory
.
create
=
function
(
object
,
key_schema
)
{
if
(
object
===
""
)
{
if
(
object
===
""
)
{
return
new
Query
();
return
new
Query
();
}
}
...
@@ -1079,7 +1090,7 @@ QueryFactory.create = function (object) {
...
@@ -1079,7 +1090,7 @@ QueryFactory.create = function (object) {
}
}
if
(
typeof
(
object
||
{}).
type
===
"
string
"
&&
if
(
typeof
(
object
||
{}).
type
===
"
string
"
&&
query_class_dict
[
object
.
type
])
{
query_class_dict
[
object
.
type
])
{
return
new
query_class_dict
[
object
.
type
](
object
);
return
new
query_class_dict
[
object
.
type
](
object
,
key_schema
);
}
}
throw
new
TypeError
(
"
QueryFactory.create():
"
+
throw
new
TypeError
(
"
QueryFactory.create():
"
+
"
Argument 1 is not a search text or a parsable object
"
);
"
Argument 1 is not a search text or a parsable object
"
);
...
@@ -1114,6 +1125,36 @@ _export("objectToSearchText", objectToSearchText);
...
@@ -1114,6 +1125,36 @@ _export("objectToSearchText", objectToSearchText);
/*global Query: true, inherits: true, query_class_dict: true, _export: true,
/*global Query: true, inherits: true, query_class_dict: true, _export: true,
convertStringToRegExp: true */
convertStringToRegExp: true */
var
checkKeySchema
=
function
(
key_schema
)
{
var
prop
;
if
(
key_schema
!==
undefined
)
{
if
(
typeof
key_schema
!==
'
object
'
)
{
throw
new
TypeError
(
"
SimpleQuery().create():
"
+
"
key_schema is not of type 'object'
"
);
}
// key_set is mandatory
if
(
key_schema
.
key_set
===
undefined
)
{
throw
new
TypeError
(
"
SimpleQuery().create():
"
+
"
key_schema has no 'key_set' property
"
);
}
for
(
prop
in
key_schema
)
{
if
(
key_schema
.
hasOwnProperty
(
prop
))
{
switch
(
prop
)
{
case
'
key_set
'
:
case
'
cast_lookup
'
:
case
'
match_lookup
'
:
break
;
default
:
throw
new
TypeError
(
"
SimpleQuery().create():
"
+
"
key_schema has unknown property '
"
+
prop
+
"
'
"
);
}
}
}
}
};
/**
/**
* The SimpleQuery inherits from Query, and compares one metadata value
* The SimpleQuery inherits from Query, and compares one metadata value
*
*
...
@@ -1124,9 +1165,13 @@ _export("objectToSearchText", objectToSearchText);
...
@@ -1124,9 +1165,13 @@ _export("objectToSearchText", objectToSearchText);
* @param {String} spec.key The metadata key
* @param {String} spec.key The metadata key
* @param {String} spec.value The value of the metadata to compare
* @param {String} spec.value The value of the metadata to compare
*/
*/
function
SimpleQuery
(
spec
)
{
function
SimpleQuery
(
spec
,
key_schema
)
{
Query
.
call
(
this
);
Query
.
call
(
this
);
checkKeySchema
(
key_schema
);
this
.
_key_schema
=
key_schema
||
{};
/**
/**
* Operator to use to compare object values
* Operator to use to compare object values
*
*
...
@@ -1156,11 +1201,81 @@ function SimpleQuery(spec) {
...
@@ -1156,11 +1201,81 @@ function SimpleQuery(spec) {
}
}
inherits
(
SimpleQuery
,
Query
);
inherits
(
SimpleQuery
,
Query
);
var
checkKey
=
function
(
key
)
{
var
prop
;
if
(
key
.
read_from
===
undefined
)
{
throw
new
TypeError
(
"
Custom key is missing the read_from property
"
);
}
for
(
prop
in
key
)
{
if
(
key
.
hasOwnProperty
(
prop
))
{
switch
(
prop
)
{
case
'
read_from
'
:
case
'
cast_to
'
:
case
'
equal_match
'
:
break
;
default
:
throw
new
TypeError
(
"
Custom key has unknown property '
"
+
prop
+
"
'
"
);
}
}
}
};
/**
/**
* #crossLink "Query/match:method"
* #crossLink "Query/match:method"
*/
*/
SimpleQuery
.
prototype
.
match
=
function
(
item
,
wildcard_character
)
{
SimpleQuery
.
prototype
.
match
=
function
(
item
,
wildcard_character
)
{
return
this
[
this
.
operator
](
item
[
this
.
key
],
this
.
value
,
wildcard_character
);
var
object_value
=
null
,
equal_match
=
null
,
cast_to
=
null
,
matchMethod
=
null
,
value
=
null
,
key
=
this
.
key
;
matchMethod
=
this
[
this
.
operator
];
if
(
this
.
_key_schema
.
key_set
&&
this
.
_key_schema
.
key_set
[
key
]
!==
undefined
)
{
key
=
this
.
_key_schema
.
key_set
[
key
];
}
if
(
typeof
key
===
'
object
'
)
{
checkKey
(
key
);
object_value
=
item
[
key
.
read_from
];
equal_match
=
key
.
equal_match
;
// equal_match can be a string
if
(
typeof
equal_match
===
'
string
'
)
{
// XXX raise error if equal_match not in match_lookup
equal_match
=
this
.
_key_schema
.
match_lookup
[
equal_match
];
}
// equal_match overrides the default '=' operator
if
(
equal_match
!==
undefined
)
{
matchMethod
=
(
this
.
operator
===
'
=
'
)
?
equal_match
:
matchMethod
;
}
value
=
this
.
value
;
cast_to
=
key
.
cast_to
;
if
(
cast_to
)
{
// cast_to can be a string
if
(
typeof
cast_to
===
'
string
'
)
{
// XXX raise error if cast_to not in cast_lookup
cast_to
=
this
.
_key_schema
.
cast_lookup
[
cast_to
];
}
value
=
cast_to
(
value
);
object_value
=
cast_to
(
object_value
);
}
}
else
{
object_value
=
item
[
key
];
value
=
this
.
value
;
}
return
matchMethod
(
object_value
,
value
,
wildcard_character
);
};
};
/**
/**
...
@@ -1200,7 +1315,7 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
...
@@ -1200,7 +1315,7 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
}
}
for
(
i
=
0
;
i
<
object_value
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
object_value
.
length
;
i
+=
1
)
{
value
=
object_value
[
i
];
value
=
object_value
[
i
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
comparison_value
===
undefined
)
{
if
(
comparison_value
===
undefined
)
{
...
@@ -1212,6 +1327,9 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
...
@@ -1212,6 +1327,9 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
if
(
value
===
undefined
)
{
if
(
value
===
undefined
)
{
return
false
;
return
false
;
}
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
===
0
;
}
if
(
if
(
convertStringToRegExp
(
convertStringToRegExp
(
comparison_value
.
toString
(),
comparison_value
.
toString
(),
...
@@ -1241,7 +1359,7 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
...
@@ -1241,7 +1359,7 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
}
}
for
(
i
=
0
;
i
<
object_value
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
object_value
.
length
;
i
+=
1
)
{
value
=
object_value
[
i
];
value
=
object_value
[
i
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
comparison_value
===
undefined
)
{
if
(
comparison_value
===
undefined
)
{
...
@@ -1253,6 +1371,9 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
...
@@ -1253,6 +1371,9 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
if
(
value
===
undefined
)
{
if
(
value
===
undefined
)
{
return
true
;
return
true
;
}
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
!==
0
;
}
if
(
if
(
convertStringToRegExp
(
convertStringToRegExp
(
comparison_value
.
toString
(),
comparison_value
.
toString
(),
...
@@ -1279,9 +1400,15 @@ SimpleQuery.prototype["<"] = function (object_value, comparison_value) {
...
@@ -1279,9 +1400,15 @@ SimpleQuery.prototype["<"] = function (object_value, comparison_value) {
object_value
=
[
object_value
];
object_value
=
[
object_value
];
}
}
value
=
object_value
[
0
];
value
=
object_value
[
0
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
false
;
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
<
0
;
}
return
value
<
comparison_value
;
return
value
<
comparison_value
;
};
};
...
@@ -1300,9 +1427,15 @@ SimpleQuery.prototype["<="] = function (object_value, comparison_value) {
...
@@ -1300,9 +1427,15 @@ SimpleQuery.prototype["<="] = function (object_value, comparison_value) {
object_value
=
[
object_value
];
object_value
=
[
object_value
];
}
}
value
=
object_value
[
0
];
value
=
object_value
[
0
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
false
;
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
<=
0
;
}
return
value
<=
comparison_value
;
return
value
<=
comparison_value
;
};
};
...
@@ -1321,9 +1454,15 @@ SimpleQuery.prototype[">"] = function (object_value, comparison_value) {
...
@@ -1321,9 +1454,15 @@ SimpleQuery.prototype[">"] = function (object_value, comparison_value) {
object_value
=
[
object_value
];
object_value
=
[
object_value
];
}
}
value
=
object_value
[
0
];
value
=
object_value
[
0
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
false
;
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
>
0
;
}
return
value
>
comparison_value
;
return
value
>
comparison_value
;
};
};
...
@@ -1342,9 +1481,15 @@ SimpleQuery.prototype[">="] = function (object_value, comparison_value) {
...
@@ -1342,9 +1481,15 @@ SimpleQuery.prototype[">="] = function (object_value, comparison_value) {
object_value
=
[
object_value
];
object_value
=
[
object_value
];
}
}
value
=
object_value
[
0
];
value
=
object_value
[
0
];
if
(
typeof
value
===
'
object
'
)
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
)
)
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
false
;
}
if
(
value
.
cmp
!==
undefined
)
{
return
value
.
cmp
(
comparison_value
)
>=
0
;
}
return
value
>=
comparison_value
;
return
value
>=
comparison_value
;
};
};
...
...
jio.js
View file @
1f88c5ad
...
@@ -50,6 +50,7 @@ constants.http_status_text = {
...
@@ -50,6 +50,7 @@ constants.http_status_text = {
"
204
"
:
"
No Content
"
,
"
204
"
:
"
No Content
"
,
"
205
"
:
"
Reset Content
"
,
"
205
"
:
"
Reset Content
"
,
"
206
"
:
"
Partial Content
"
,
"
206
"
:
"
Partial Content
"
,
"
304
"
:
"
Not Modified
"
,
"
400
"
:
"
Bad Request
"
,
"
400
"
:
"
Bad Request
"
,
"
401
"
:
"
Unauthorized
"
,
"
401
"
:
"
Unauthorized
"
,
"
402
"
:
"
Payment Required
"
,
"
402
"
:
"
Payment Required
"
,
...
@@ -83,6 +84,7 @@ constants.http_status_text = {
...
@@ -83,6 +84,7 @@ constants.http_status_text = {
"
No Content
"
:
"
No Content
"
,
"
No Content
"
:
"
No Content
"
,
"
Reset Content
"
:
"
Reset Content
"
,
"
Reset Content
"
:
"
Reset Content
"
,
"
Partial Content
"
:
"
Partial Content
"
,
"
Partial Content
"
:
"
Partial Content
"
,
"
Not Modified
"
:
"
Not Modified
"
,
"
Bad Request
"
:
"
Bad Request
"
,
"
Bad Request
"
:
"
Bad Request
"
,
"
Unauthorized
"
:
"
Unauthorized
"
,
"
Unauthorized
"
:
"
Unauthorized
"
,
"
Payment Required
"
:
"
Payment Required
"
,
"
Payment Required
"
:
"
Payment Required
"
,
...
@@ -115,6 +117,7 @@ constants.http_status_text = {
...
@@ -115,6 +117,7 @@ constants.http_status_text = {
"
no_content
"
:
"
No Content
"
,
"
no_content
"
:
"
No Content
"
,
"
reset_content
"
:
"
Reset Content
"
,
"
reset_content
"
:
"
Reset Content
"
,
"
partial_content
"
:
"
Partial Content
"
,
"
partial_content
"
:
"
Partial Content
"
,
"
not_modified
"
:
"
Not Modified
"
,
"
bad_request
"
:
"
Bad Request
"
,
"
bad_request
"
:
"
Bad Request
"
,
"
unauthorized
"
:
"
Unauthorized
"
,
"
unauthorized
"
:
"
Unauthorized
"
,
"
payment_required
"
:
"
Payment Required
"
,
"
payment_required
"
:
"
Payment Required
"
,
...
@@ -159,6 +162,7 @@ constants.http_status = {
...
@@ -159,6 +162,7 @@ constants.http_status = {
"
204
"
:
204
,
"
204
"
:
204
,
"
205
"
:
205
,
"
205
"
:
205
,
"
206
"
:
206
,
"
206
"
:
206
,
"
304
"
:
304
,
"
400
"
:
400
,
"
400
"
:
400
,
"
401
"
:
401
,
"
401
"
:
401
,
"
402
"
:
402
,
"
402
"
:
402
,
...
@@ -192,6 +196,7 @@ constants.http_status = {
...
@@ -192,6 +196,7 @@ constants.http_status = {
"
No Content
"
:
204
,
"
No Content
"
:
204
,
"
Reset Content
"
:
205
,
"
Reset Content
"
:
205
,
"
Partial Content
"
:
206
,
"
Partial Content
"
:
206
,
"
Not Modified
"
:
304
,
"
Bad Request
"
:
400
,
"
Bad Request
"
:
400
,
"
Unauthorized
"
:
401
,
"
Unauthorized
"
:
401
,
"
Payment Required
"
:
402
,
"
Payment Required
"
:
402
,
...
@@ -224,6 +229,7 @@ constants.http_status = {
...
@@ -224,6 +229,7 @@ constants.http_status = {
"
no_content
"
:
204
,
"
no_content
"
:
204
,
"
reset_content
"
:
205
,
"
reset_content
"
:
205
,
"
partial_content
"
:
206
,
"
partial_content
"
:
206
,
"
not_modified
"
:
304
,
"
bad_request
"
:
400
,
"
bad_request
"
:
400
,
"
unauthorized
"
:
401
,
"
unauthorized
"
:
401
,
"
payment_required
"
:
402
,
"
payment_required
"
:
402
,
...
@@ -268,6 +274,7 @@ constants.http_action = {
...
@@ -268,6 +274,7 @@ constants.http_action = {
"
204
"
:
"
success
"
,
"
204
"
:
"
success
"
,
"
205
"
:
"
success
"
,
"
205
"
:
"
success
"
,
"
206
"
:
"
success
"
,
"
206
"
:
"
success
"
,
"
304
"
:
"
success
"
,
"
400
"
:
"
error
"
,
"
400
"
:
"
error
"
,
"
401
"
:
"
error
"
,
"
401
"
:
"
error
"
,
"
402
"
:
"
error
"
,
"
402
"
:
"
error
"
,
...
@@ -301,6 +308,7 @@ constants.http_action = {
...
@@ -301,6 +308,7 @@ constants.http_action = {
"
No Content
"
:
"
success
"
,
"
No Content
"
:
"
success
"
,
"
Reset Content
"
:
"
success
"
,
"
Reset Content
"
:
"
success
"
,
"
Partial Content
"
:
"
success
"
,
"
Partial Content
"
:
"
success
"
,
"
Not Modified
"
:
"
success
"
,
"
Bad Request
"
:
"
error
"
,
"
Bad Request
"
:
"
error
"
,
"
Unauthorized
"
:
"
error
"
,
"
Unauthorized
"
:
"
error
"
,
"
Payment Required
"
:
"
error
"
,
"
Payment Required
"
:
"
error
"
,
...
@@ -333,6 +341,7 @@ constants.http_action = {
...
@@ -333,6 +341,7 @@ constants.http_action = {
"
no_content
"
:
"
success
"
,
"
no_content
"
:
"
success
"
,
"
reset_content
"
:
"
success
"
,
"
reset_content
"
:
"
success
"
,
"
partial_content
"
:
"
success
"
,
"
partial_content
"
:
"
success
"
,
"
not_modified
"
:
"
success
"
,
"
bad_request
"
:
"
error
"
,
"
bad_request
"
:
"
error
"
,
"
unauthorized
"
:
"
error
"
,
"
unauthorized
"
:
"
error
"
,
"
payment_required
"
:
"
error
"
,
"
payment_required
"
:
"
error
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment