Refactor the custom helpers into their own files

This commit is contained in:
Oliver-Akins 2023-12-26 19:39:56 -07:00
parent af2df4f7c5
commit 0392d339db
7 changed files with 69 additions and 62 deletions

View file

@ -0,0 +1,11 @@
export function objectValue(obj, keypath) {
function helper(o, k) {
let v = o[k[0]];
if (typeof v === "object") {
return helper(v, k.slice(1));
};
return v;
};
let resp = helper(obj, keypath.string.split(`.`));
return resp;
};