projects
/
limn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
43fc9c9
)
Adds _.isMember, a generic test for whether a collection contains a value.
author
David Schoonover
<dsc@wikimedia.org>
Tue, 3 Jul 2012 05:48:43 +0000 (22:48 -0700)
committer
David Schoonover
<dsc@wikimedia.org>
Tue, 3 Jul 2012 05:48:43 +0000 (22:48 -0700)
lib/util/underscore/object.co
patch
|
blob
|
history
diff --git
a/lib/util/underscore/object.co
b/lib/util/underscore/object.co
index
6f07576
..
9bc6e23
100644
(file)
--- a/
lib/util/underscore/object.co
+++ b/
lib/util/underscore/object.co
@@
-90,6
+90,11
@@
_obj = do
### Delegating Accessors
+ isMember: (obj, v) ->
+ values = _.unique [].slice.call arguments, 1
+ common = _.intersection _.values(obj), values
+ _.isEqual values, common
+
get: (obj, key, def, opts) ->
return unless obj?
getter = opts?.getter or 'get'