// https://github.com/lodash/lodash/issues/1845#issuecomment-339773840 const inferTypeOfObject = (obj) => { try { if (_.isArray(obj)) return 'Array'; const matches = Object.prototype.toString.call(obj).match(/\s([a-zA-Z]+)/); if (matches === null) return matches; const inferedType = matches[1]; const isUnknownObject = ['Date', 'Function'].indexOf(inferedType) === -1 && _.isObjectLike(obj); return isUnknownObject ? 'Object' : inferedType; } catch (e) { console.error(e); return null; } }
strapi.app.use(async (ctx, next) => { // Execute next middleware. await next(); // Recursive to mask the private properties. const mask = (payload) => { if (_.isArray(payload)) { return payload.map(mask); } else if (_.isPlainObject(payload)) { return this.mask( ctx, Object.keys(payload).reduce((acc, current) => { acc[current] = _.isObjectLike(payload[current]) ? mask(payload[current]) : payload[current]; return acc; }, {}) ); } return payload; }; // Only pick successful JSON requests. if ([200, 201, 202].includes(ctx.status) && ctx.type === 'application/json' && !ctx.request.admin) { ctx.body = mask(ctx.body); } });
if (_.isObjectLike(ctx.message)) { msg = JSON.stringify(ctx.message, null, 2); } else {
if (_.isObjectLike(v)) { data.depth.push(k); processObj(v, data);
}).join(` |\n${ START_SPACES }`); type += `\n${ END_SPACES }]`; } else if (_.isObjectLike(val)) { if (_.isPlainObject(val)) { const PROPERTY_LIST = ego_helpers.from(
if (!_.isObjectLike(CURRENT_CONTENT)) { storageContent = {};
for (const S of STARTUPS) { try { let entry: ego_contracts.StartupItem;
if (!_.isObjectLike(storage)) { storage = {};
if (!_.isObjectLike(S)) { continue;
let filteredStorage: any = {}; for (const S of STORAGES) { if (!_.isObjectLike(S)) { continue;
let commandAction: Function;
let commandAction: Function;
if (_.isObjectLike(item.action)) { jobAction = <ego_contracts.JobItemAction>item.action; } else {
ego_helpers.tryDispose(newAppBtnCommand); };
if (_.isObjectLike(item.action)) { jobAction = <ego_contracts.JobItemAction>item.action; } else {