type-plus
Version:
Provides additional types for TypeScript.
14 lines • 402 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONTypes = void 0;
exports.JSONTypes = { get };
function get(obj, ...props) {
if (props.length === 0)
return obj;
if (typeof obj !== 'object' || obj === null)
return undefined;
const p = props.shift();
// @ts-ignore
return get(obj[p], ...props);
}
//# sourceMappingURL=json.js.map