UNPKG

rumble-charts

Version:

Truly declarative React charts components

38 lines (33 loc) 1.2 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var tslib_es6 = require('../external/tslib/tslib.es6.js'); var index = require('./transforms/index.js'); var isString = require('./isString.js'); var isFunction = require('./isFunction.js'); var isObject = require('./isObject.js'); function transform(props, method, options) { if (options === void 0) { options = undefined; } if (!Array.isArray(method)) { method = [method]; } return method.reduce(function (props, method) { if (isString.isString(method)) { if (isFunction.isFunction(index[method])) { return tslib_es6.__assign(tslib_es6.__assign({}, props), index[method](props, options)); } else { return props; } } else if (isFunction.isFunction(method)) { return tslib_es6.__assign(tslib_es6.__assign({}, props), method(props, options)); } else if (isObject.isObject(method)) { return transform(props, method.method, method.options); } else { return props; } }, props); } exports.transform = transform;