/* * Toggle a toggle */ updateUserConfig(data = {}) { const Yaml = require('./yaml'); const yaml = new Yaml(); const configFile = path.join(this.defaultConfig().userConfRoot, 'config.yml'); const config = (fs.existsSync(configFile)) ? yaml.load(configFile) : {}; const file = yaml.dump(configFile, _.assign({}, config, data)); return yaml.load(file); }
async item(res, { query = {}, populate = [], files = null } = {}) { return _item(res, this.ctx.model.User, { query: _.assign({ state: '1' }, query), populate: !_.isEmpty(populate) ? populate : [], files: files ? files : '-password', }) }
const dummyContainer = (overrides = {}) => { return _.assign( new Dockerode.Container(), { Id: '8675309', app: 'Death Star', Labels: { 'com.docker.compose.project': 'Death Star', 'com.docker.compose.service': 'Exhaust Port', 'com.docker.compose.container-number': 73, 'com.docker.compose.oneoff': 'no', 'io.lando.container': 'TRUE', 'io.lando.src': '/tmp/.lando.yml', 'io.lando.id': 'lando', 'io.lando.service-container': 'no', }, }, overrides ); }
async list(ctx, app) { try { let payload = ctx.query; let queryObj = {}; let categoryParams = _.assign({}, payload, { isPaging: '0' }) let contentCategoryList = await ctx.service.contentCategory.find(categoryParams, { searchKeys: ['name'], query: queryObj }); ctx.helper.renderSuccess(ctx, { data: contentCategoryList }); } catch (err) { ctx.helper.renderFail(ctx, { message: err }); } }
}); let newTempObj = _.assign({}, tempObj, { using: false, items: [],
const sslOpts = _.assign(_.cloneDeep(options), { name: `${options.name}_ssl`, type: 'nginx',
lando.log.verbose('checking docker version compatibility...'); lando.log.debug('compatibility results', _.keyBy(results, 'name')); lando.cache.set('versions', _.assign(lando.versions, _.keyBy(results, 'name')), {persist: true}); lando.versions = lando.cache.get('versions'); });
async find(payload = {}, { query = {}, searchKeys = [], populate = [], files = null } = {}) { let listdata = _list(this.ctx.model.User, payload, { query: _.assign({ state: '1' }, query), searchKeys: !_.isEmpty(searchKeys) ? searchKeys : ['userName', 'phoneNum', 'email'], populate: !_.isEmpty(populate) ? populate : [{ path: 'category', select: 'name _id' }], files: files ? files : '-password', }); return listdata; }
// After Index middleware for actions. function indexPayload(req, res, next) { res.resource.status = 200; _.each(res.resource.item, (item) => { if (ActionIndex.actions.hasOwnProperty(item.name)) { item = _.assign(item, ActionIndex.actions[item.name].info); } }); next(); }
_.assign({ cwd: undefined, module: undefined, pageFiles: [], map: 'map.json', dest: 'dist', end: function () {} }, opts)
_.assign({ cwd: null, app: null, module: null, isForce: false, common: 'gb', moduleList: [], checkCb: function () {} // 过滤中加入判断回调 }, opts)
_.assign({ cwd: null, app: null, module: null, cacheFolder: null, checkCb: function () {} // 过滤中加入判断回调 }, opts)