/* * Helper to get passthru options */ const handlePassthruOpts = (options = {}, answers = {}) => _(options) .map((value, key) => _.merge({}, {name: key}, value)) .filter(value => value.passthrough === true && !_.isNil(answers[value.name])) .map(value => `--${value.name}=${answers[value.name]}`) .value()
_(options) .map((option, name) => _.merge({}, {name}, {option})) .filter(option => !_.isEmpty(_.get(option, 'option.interactive', {}))) .map(option => _.merge({}, {name: option.name, weight: 0}, option.option.interactive)) .map(option => { if (_.isNil(argv[option.name]) || argv[option.name] === false) return option; else { return _.merge({}, option, {when: answers => { answers[option.name] = argv[option.name]; return false; }}); } }) .value()
if (_.isNil(lando.cache.get('report_errors'))) { const inquirer = require('inquirer'); console.error(this.makeArt('crash'));
response.pic = _.get(raw, 'data.avatar_url', 'https://docs.lando.dev/images/hero-pink.png'); if (!_.isNil(response.email)) return response;
requiredScenarios.forEach(scenarioType => { if (lodash.isNil(test[scenarioType])) { scenarioErrors.push(`Could not find any ${scenarioType} test scenarios`); } });
/** * Returns the function for an app event. * * @param {Function} funcProvider The function provider. * * @return {ego_contracts.AppEventFunction} The function (if available). */ protected getEventFunction(funcProvider: (m: ego_contracts.AppModule) => ego_contracts.AppEventFunction): ego_contracts.AppEventFunction { const FUNC = funcProvider(this.module); return _.isNil(FUNC) ? this.module.onEvent : FUNC; }
/** * Gets if the proxy is running or not. */ public get isRunning(): boolean { return !_.isNil(this._server); }
const checkEnv = (req, res, next) => { if (_.startsWith(req.url, '/error')) return next(); if (_.isNil(process.env.HUBSPOT_API_KEY)) return res.redirect('/error?msg=Please set HUBSPOT_API_KEY env variable to proceed'); next(); }
const checkEnv = (req, res, next) => { if (_.startsWith(req.url, '/error')) return next() if (_.isNil(CLIENT_ID)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_ID env variable to proceed') if (_.isNil(CLIENT_SECRET)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_SECRET env variable to proceed') if (_.isNil(PUBLIC_FILE_LINK_PROPERTY)) return res.redirect('/error?msg=Please set PUBLIC_FILE_LINK_PROPERTY env variable to proceed') if (_.isNil(PROTECTED_FILE_LINK_PROPERTY)) return res.redirect('/error?msg=Please set PROTECTED_FILE_LINK_PROPERTY env variable to proceed') next() }
function clearNilValue(data) { const result = {}; _.forEach(data, (v, k) => { if (!_.isNil(v)) { result[k] = v; } }); return result; }
const checkEnv = (req, res, next) => { if (_.startsWith(req.url, '/error')) return next() if (_.isNil(CLIENT_ID)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_ID env variable to proceed') if (_.isNil(CLIENT_SECRET)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_SECRET env variable to proceed') next() }
response.pic = _.get(raw, 'data.avatar_url', 'https://docs.lando.dev/images/hero-pink.png'); if (!_.isNil(response.email)) return response;
const checkEnv = (req, res, next) => { if (_.startsWith(req.url, '/error')) return next(); if (_.isNil(CLIENT_ID)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_ID env variable to proceed'); if (_.isNil(CLIENT_SECRET)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_SECRET env variable to proceed'); next(); }
const checkEnv = (req, res, next) => { if (_.startsWith(req.url, '/error')) return next(); if (_.isNil(CLIENT_ID)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_ID env variable to proceed'); if (_.isNil(CLIENT_SECRET)) return res.redirect('/error?msg=Please set HUBSPOT_CLIENT_SECRET env variable to proceed'); next(); }