UNPKG

jest-metadata

Version:

🦸‍♂️ Superhero power for your Jest reporters! 🦸‍♀️

19 lines 498 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.get = void 0; function get(obj, path, defaultValue) { if (obj == null) { return defaultValue; } const pathArray = typeof path === 'string' ? path.split('.') : path; let it = obj; for (const key of pathArray) { if (it[key] === undefined) { return defaultValue; } it = it[key]; } return it; } exports.get = get; //# sourceMappingURL=get.js.map