Opal-Estate-Pro/node_modules/es5-ext/object/key-of.js

18 lines
290 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
"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;
};