.map(cred => _.pickBy({ internal_hostname: cred.host, password: cred.password,
function transform (doc, ret, options) { if (this.$visible) { return _.pickBy(ret, (value, key) => this.$visible.indexOf(key) !== -1) } else if (this.$hidden) { return _.omitBy(ret, (value, key) => this.$hidden.indexOf(key) !== -1) } return ret }
static cleanPattern (obj) { if (obj === null) return obj; return _.pickBy(obj, function (val, prop) { return !_.includes(prop, '$') && !_.isObject(val); }); }
validItems.map(item => ({ ref: _.omit(item.target.toReflink(), 'src'), updated: _.pickBy(item.update, (val, key) => !key.startsWith('changes.')), status: 200, }))
constructor (name, schema) { ow(schema, ow.object.partialShape({ fields: ow.object.valuesOfType(ow.any(ow.object.hasKeys('type'), ow.null, ow.undefined)), access: ow.object.nonEmpty, })) // remove null fields (may be overridden) schema.fields = _.pickBy(schema.fields, _.identity) this.name = name this.schema = schema this._type = GQL_LIST_SCHEMA_TYPE this._keystone = null }
// Mount `./plugins` models. _.forEach(strapi.plugins, (plugin, name) => { mountModels(_.pickBy(strapi.plugins[name].models, { connection: connectionName }), plugin.models, name); });
static get listFields () { let fields = _.pickBy(this.fields, v => ['html'].includes(v.type)) fields = _.map(_.keys(fields), v => '-' + v) fields.concat(['deleted_at']) return fields }
async grid({ request, Model }) { await Model.buildOptions() const searchFields = _.pickBy(Model.fields, 'searchable') _.mapValues(searchFields, v => { if (v.selectSize) { v.selectSize = 5 } }) const fields = _.omitBy(Model.fields, (v, k) => v.listable === false) return { searchFields: searchFields, searchModel: _.mapValues(searchFields, v => null), fields: fields } }
async function execute() { const allTasks = _.chain(require('./tasks')(functions)) .mapValues((obj, name) => { if (!target || re.test(name)) { return obj; } return _.pickBy(obj, (obj, name) => re.test(name) || re.test(_.first(name.split(':')))); }) .omitBy(_.isEmpty) .values() .value(); const result = {}; for (const obj of allTasks) { const config = { count: count || _.get(obj.config, ['count'], defaults.count), }; const map = _.omit(obj, 'config'); for (const [name, tasks] of Object.entries(map)) { const res = await executeTasks(config, tasks, name); if (res) { result[name] = res; } } } makeDoc && makeDocs(result); }
static extractSchema (obj) { if (obj === null) return obj; return _.pickBy(obj, function (val, prop) { return _.isObject(val); }); }
merge (data) { const newData = _.pickBy(data, (v, k) => this.constructor.fillable.includes(k)) return super.merge.call(this, newData) }
static cleanFromSpecialVars (obj) { if (obj === null) return obj; return _.pickBy(obj, function (val, prop) { return !_.includes(prop, '$'); }); }
function transform (doc, ret, options) { if (this.$visible) { return _.pickBy(ret, (value, key) => this.$visible.indexOf(key) !== -1) } else if (this.$hidden) { return _.omitBy(ret, (value, key) => this.$hidden.indexOf(key) !== -1) } return ret }
constructor (name, schema) { ow(schema, ow.object.partialShape({ fields: ow.object.valuesOfType(ow.any(ow.object.hasKeys('type'), ow.null, ow.undefined)), access: ow.object.nonEmpty, })) // remove null fields (may be overridden) schema.fields = _.pickBy(schema.fields, _.identity) this.name = name this.schema = schema this._type = GQL_LIST_SCHEMA_TYPE this._keystone = null }
// Mount `./plugins` models. _.forEach(strapi.plugins, (plugin, name) => { mountModels(_.pickBy(strapi.plugins[name].models, { connection: connectionName }), plugin.models, name); });