Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await client.setMessengerProfile(omit(_profile, 'whitelistedDomains'));
} else {
await client.setMessengerProfile(_profile);
}
print(`Successfully set ${bold('messenger_profile')} settings`);
} else {
const [_existedProfile] = await client.getMessengerProfile(FIELDS);
const profile = trimDomain(_profile);
const existedProfile = trimDomain(_existedProfile);
const diffResult = diff(existedProfile, profile);
if (Object.keys(diffResult).length !== 0) {
const shouldDeleteFields = Object.keys(
deletedDiff(existedProfile, profile)
);
const shouldSetFields = [
...Object.keys(addedDiff(existedProfile, profile)),
...Object.keys(updatedDiff(existedProfile, profile)),
];
if (shouldDeleteFields.length > 0) {
await client.deleteMessengerProfile(
shouldDeleteFields.map(field => snakecase(field))
);
const deleteFileds = shouldDeleteFields.join(', ');
print(`Successfully delete ${bold(deleteFileds)} settings`);
}
if (shouldSetFields.length > 0) {
export const ensure = (input: ThemeVars): Theme => {
if (!input) {
return convert(light);
}
const missing = deletedDiff(light, input);
if (Object.keys(missing).length) {
logger.warn(
dedent`
Your theme is missing properties, you should update your theme!
theme-data missing:
`,
missing
);
}
return convert(input);
};