Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getAllSettings = () => {
const settingsObject = {};
let rootSettings = _.clone(Meteor.settings);
delete rootSettings.public;
delete rootSettings.private;
// root settings & private settings are both private
rootSettings = flatten(rootSettings, {safe: true});
const privateSettings = flatten(Meteor.settings.private || {}, {safe: true});
// public settings
const publicSettings = flatten(Meteor.settings.public || {}, {safe: true});
// registered default values
const registeredSettings = Settings;
const allSettingKeys = _.union(_.keys(rootSettings), _.keys(publicSettings), _.keys(privateSettings), _.keys(registeredSettings));
allSettingKeys.sort().forEach(key => {
settingsObject[key] = {};
if (typeof rootSettings[key] !== 'undefined') {
settingsObject[key].value = rootSettings[key];
} else if (typeof privateSettings[key] !== 'undefined') {
settingsObject[key].value = privateSettings[key];
} else if (typeof publicSettings[key] !== 'undefined') {
settingsObject[key].value = publicSettings[key];
export function flatten(obj: Translation): Translation {
return flat(obj, { safe: true });
}
},
],
downloadable: Boolean,
});
const selector = {
meetingId,
id: presentation.id,
};
const modifier = {
$set: Object.assign({
meetingId,
'conversion.done': true,
'conversion.error': false,
}, flat(presentation, { safe: true })),
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Adding presentation2x to collection: ${err}`);
}
addSlides(meetingId, presentation.id, presentation.pages);
const { insertedId } = numChanged;
if (insertedId) {
if (presentation.current) {
setCurrentPresentation(meetingId, presentation.id);
}
return Logger.info(`Added presentation2x id=${presentation.id} meeting=${meetingId}`);
export function defineOptions(options, context) {
const flattened = flat(Object.assign({}, options))
const define = {}
Object.keys(flattened).forEach(key => {
define[`process.env.__NUXT_BLOG__.${key}`] = JSON.stringify(flattened[key])
})
context.options.build.plugins.push(new DefinePlugin(define))
}
guards: function(chart) {
return Object.entries(flat(chart)).filter(([key]) => key.endsWith('.cond'));
},
});
reportNaiveValidity() {
let isValid = true
const state = { ...this.validationState }
delete state['sanitizers']
const flat = flatten(state, { maxDepth: 2 })
const rejects = Object.values(flat).filter(item => item.isValid === false)
isValid = rejects.length > 0 ? false : true
this.setState({ isValid: isValid })
}
const renderWithLegend = (legend: any) => (f: any) => (props: any) =>
f(
unflatten(
mapValues(
(p: any) => legend[p != null ? p.toString() : 'null'] || p,
flatten(props)
)
)
)
getGeneral(result) {
const fields = getGeneralFields();
const picked = pick(result, fields);
const flattened = flatten(picked);
const map = {
'my_team_result.key': 'my_team_result',
'other_team_result.key': 'other_team_result',
'game_mode.key': 'game_mode',
'rule.key': 'rule'
};
const mapped = mapKeys(flattened, (value, key) => {
return map[key] || key;
});
return mapped;
}
name: 'Name',
phone: 'Phone',
email: 'Email',
address: 'Address',
consignees: 'Consignees',
filter: {
name: {
label: 'Search Customer Name',
},
phone: {
label: 'Search Customer Phone',
}
}
}
}),
zh: flatten({
share: {
logo: '商標',
title: '標題'
},
dashboard: {
title: '總覽',
products: '總產品數',
orders: '總訂單數',
customers: '總顧客數'
},
home: {
title: '首頁設定',
description: '在這裡設定你的首頁。',
entry: {
layoutTitle: '進場頁面',
title: '網站標題',
const namespaceVariables = function (namespace, variables) {
if (variables && Object.keys(variables).length >= 1) {
return flat({ ['--' + namespace]: variables }, { delimiter: '-' })
} else {
return {}
}
}