Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configFilePath = path.resolve(configFilePath);
log.info('Loading config %s', configFilePath);
try {
configModule = require(configFilePath);
} catch(e) {
if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf(configFilePath) !== -1) {
throw new Error('File "'+ configFilePath + '" does not exist!');
} else {
throw new Error('Invalid config file!\n ' + e.stack);
}
}
if (!_.isFunction(configModule)) {
throw new Error('Config file must export a function!\n' + CONFIG_SYNTAX_HELP);
}
// Provide a default basePath
config.basePath = path.dirname(configFilePath);
try {
config = configModule(config);
if ( ! (config instanceof Config) ) {
throw new Error('Config file export function must return an instance of Config.\n' +
'Instead it returned an object of type ' + config.constructor.name);
}
log.cli();
log.level = config.get('logging.level', 'info');
data,
scales,
xScale: _xScale,
yScale: _yScale,
width,
height,
color,
x,
y,
} = this.props
const xScale = scales[_xScale]
const yScale = scales[_yScale]
const getX = _.isFunction(x) ? x : d => d[x]
const getY = _.isFunction(y) ? y : d => d[y]
const rects = []
data.forEach((d, i) => {
let x
let y
let barWidth
let barHeight
if (xScale.bandwidth) {
barWidth = xScale.bandwidth() // / series.length
x = xScale(getX(d)) // + barWidth * serieIndex
} else {
x = 0
barWidth = xScale(getX(d))
}
if (v !== void 0) {
var exportname = fullname + '/' + k
seneca.private$.exports[exportname] = v
exports.push(exportname)
}
})
}
// Specific Seneca extension points
if (_.isObject(meta.extend)) {
if (_.isFunction(meta.extend.action_modifier)) {
seneca.private$.action_modifiers.push(meta.extend.action_modifier)
}
// FIX: needs to use logging.load_logger
if (_.isFunction(meta.extend.logger)) {
if (
!meta.extend.logger.replace &&
_.isFunction(seneca.private$.logger.add)
) {
seneca.private$.logger.add(meta.extend.logger)
} else {
seneca.private$.logger = meta.extend.logger
}
}
}
return exports
}
NodeHost = function (sandbox, options, callback) {
// account for polymorphic nature of options and callback
if ((callback === undefined) && _.isFunction(options)) {
callback = options;
options = null;
}
if (!_.isFunction(callback)) { // be strict with the callback
throw new Error('uvm.constructor() callback parameter missing.');
}
options = _.isObject(options) ? _.clone(options) : {};
_.extend(this, {
/**
* @private
* @type {Object.}
*/
on: _.isObject(options.on) ? _.clone(options.on) : {},
Mailchimp.prototype.get = function (options, query, done) {
options = _.clone(options) || {};
if (_.isString(options)) {
options = {
path : options,
}
}
options.method = 'get';
if (!done && _.isFunction(query)) {
done = query;
query = null;
}
if (query && options.query) {
console.warn('query set on request options overwritten by argument query');
}
if (query) {
options.query = query;
}
return this.request(options, done);
}
.then(() => {
if (_.isFunction(this.options.stopped))
return this.options.stopped(this);
})
.catch(err => {
() => (isFunction(callback) ? callback() : this.onChange(inputName))
);
);
}).values()]
}
}>
{
<button style="{{">{ propertyValue }</button>
}
}
:
<span>
{
_.isFunction(to)
?
<a href="#">{propertyValue}</a>
:
{propertyValue}
}
</span>
}
);
};
getRoute() {
return _.isFunction(this.props.route)
? this.props.route(this.props.data)
: this.props.route;
}
renderTouchableOverlay() {
const {overlayBackgroundColor, onBackgroundPress} = this.props;
if (_.isFunction(onBackgroundPress) || !!overlayBackgroundColor) {
return (
);
}
}