UNPKG

@diplodoc/transform

Version:

A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML

14 lines 393 B
"use strict"; module.exports = function getObject(path, obj, fallback) { const queue = path.split('.'); let box = obj; while (queue.length) { const step = queue.shift(); if (!Object.prototype.hasOwnProperty.call(box, step)) { return fallback || undefined; } box = box[step]; } return box; }; //# sourceMappingURL=getObject.js.map