wishthis/node_modules/es5-ext/object/key-of.js
2022-01-21 09:28:41 +01:00

17 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;
};