@fluent-windows/styles
Version:
Fluent-Windows React styles.
17 lines (14 loc) • 494 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.themeGet = void 0;
var themeGet = function themeGet(path, defaultValue) {
return function (theme) {
var result = String.prototype.split.call(path, /[,[\].]+?/).filter(Boolean).reduce(function (res, key) {
return res !== null && res !== undefined ? res[key] : res;
}, theme);
return result === undefined || result === theme ? defaultValue : result;
};
};
exports.themeGet = themeGet;