mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
271 B
16 lines
271 B
10 years ago
|
'use strict';
|
||
|
|
||
|
var eq = require('./eq')
|
||
|
, some = require('./some');
|
||
|
|
||
|
module.exports = function (obj, searchValue) {
|
||
|
var r;
|
||
|
return some(obj, function (value, name) {
|
||
|
if (eq(value, searchValue)) {
|
||
|
r = name;
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}) ? r : null;
|
||
|
};
|