mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10: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...
|
||||
// XXX add support for regex...
|
||||
var func = (
|
||||
// predicate...
|
||||
pattern instanceof Function ?
|
||||
pattern
|
||||
// path...
|
||||
// XXX BUG: this for some reason matches ['B', '*'] to ['nested', 'moo']
|
||||
// XXX add support for regex...
|
||||
: pattern instanceof Array ?
|
||||
function(elem, i, path){
|
||||
return path.length > 0
|
||||
&& pattern.length == path.length
|
||||
&& (pattern[path.length-1] == '*'
|
||||
|| pattern[path.length-1] == path[path.length-1]) }
|
||||
&& !pattern.reduce(function(res, e, i){
|
||||
return res || (e != '*' && e != path[i]) }, false) }
|
||||
// index...
|
||||
: function(elem, i, path){
|
||||
return elem
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user