mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Implement function callbacks for item matching.
This commit is contained in:
parent
4fb6a5d949
commit
1a645a1adb
1 changed files with 3 additions and 0 deletions
|
@ -1273,6 +1273,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
if (compare instanceof RegExp) {
|
||||
if (!compare.test(value))
|
||||
return false;
|
||||
} else if (typeof compare === 'function') {
|
||||
if (!compare(value))
|
||||
return false;
|
||||
} else if (Base.isPlainObject(compare)) {
|
||||
if (!matchObject(compare, value))
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue