@tunnel-cast/nestjs
Version:
## About This is a Tunnel-Cast - NestJS integration package, wrap the `cast` application into the `NestJS` building blocks.
19 lines • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractValue = void 0;
function extractValue(obj, path) {
if (obj == undefined || typeof obj != "object") {
return undefined;
}
const pathParts = path.split(".");
let extractionObject = obj;
for (let pathPart of pathParts) {
if (extractionObject[pathPart] == undefined) {
return extractionObject[pathPart];
}
extractionObject = extractionObject[pathPart];
}
return extractionObject;
}
exports.extractValue = extractValue;
//# sourceMappingURL=extract-value.js.map