mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
18 lines
290 B
JavaScript
18 lines
290 B
JavaScript
|
"use strict";
|
||
|
|
||
|
var eq = require("./eq")
|
||
|
, some = require("./some");
|
||
|
|
||
|
module.exports = function (obj, searchValue) {
|
||
|
var result;
|
||
|
return some(obj, function (value, name) {
|
||
|
if (eq(value, searchValue)) {
|
||
|
result = name;
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
})
|
||
|
? result
|
||
|
: null;
|
||
|
};
|