mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
simplify and rethink...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e718df1bea
commit
1cfe064c03
@ -931,18 +931,19 @@ var BaseBrowserPrototype = {
|
|||||||
: {}
|
: {}
|
||||||
|
|
||||||
// normalize the test predicate...
|
// normalize the test predicate...
|
||||||
|
// XXX add support for regex...
|
||||||
var func = (
|
var func = (
|
||||||
// predicate...
|
// predicate...
|
||||||
pattern instanceof Function ?
|
pattern instanceof Function ?
|
||||||
pattern
|
pattern
|
||||||
// path...
|
// path...
|
||||||
// XXX BUG: this for some reason matches ['B', '*'] to ['nested', 'moo']
|
// XXX add support for regex...
|
||||||
: pattern instanceof Array ?
|
: pattern instanceof Array ?
|
||||||
function(elem, i, path){
|
function(elem, i, path){
|
||||||
return path.length > 0
|
return path.length > 0
|
||||||
&& pattern.length == path.length
|
&& pattern.length == path.length
|
||||||
&& (pattern[path.length-1] == '*'
|
&& !pattern.reduce(function(res, e, i){
|
||||||
|| pattern[path.length-1] == path[path.length-1]) }
|
return res || (e != '*' && e != path[i]) }, false) }
|
||||||
// index...
|
// index...
|
||||||
: function(elem, i, path){
|
: function(elem, i, path){
|
||||||
return elem
|
return elem
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user