updeep-remeda/esm/is.js
2023-01-03 13:51:35 -05:00

16 lines
462 B
JavaScript

import splitPath from "./util/splitPath.js";
import wrap from "./wrap.js";
function _is(object, path, predicate) {
const parts = splitPath(path);
for (const part of parts) {
if (typeof object === "undefined")
return false;
object = object[part];
}
if (typeof predicate === "function") {
return predicate(object);
}
return predicate === object;
}
export default wrap(_is);
//# sourceMappingURL=is.js.map