Removed optional chaining operators to support Node v12

Set the version on .nvmrc to 12
This commit is contained in:
sercan 2021-04-30 19:27:40 +03:00
parent e3821da077
commit 0ac967a945
3 changed files with 9 additions and 5 deletions

2
.nvmrc
View File

@ -1 +1 @@
14
12

View File

@ -72,13 +72,17 @@ function generateThemesObject(themes)
return _.map(_.cloneDeep(themes), (value, key) =>
{
const theme = normalizeTheme(value);
const primary = (theme && theme.primary && theme.primary.DEFAULT) ? theme.primary.DEFAULT : normalizedDefaultTheme.primary.DEFAULT;
const accent = (theme && theme.accent && theme.accent.DEFAULT) ? theme.accent.DEFAULT : normalizedDefaultTheme.accent.DEFAULT;
const warn = (theme && theme.warn && theme.warn.DEFAULT) ? theme.warn.DEFAULT : normalizedDefaultTheme.warn.DEFAULT;
return _.fromPairs([
[
key,
{
primary: theme?.primary?.DEFAULT ?? normalizedDefaultTheme.primary.DEFAULT,
accent : theme?.accent?.DEFAULT ?? normalizedDefaultTheme.accent.DEFAULT,
warn : theme?.warn?.DEFAULT ?? normalizedDefaultTheme.warn.DEFAULT
primary,
accent,
warn
}
]
]);

View File

@ -78,7 +78,7 @@ const config = {
// development and production, we will decide whether to purge or not
// by looking at the process arguments. If there is a "build" argument
// with the "ng" command then we will enable the purge.
enabled: process?.argv?.find(arg => arg.includes('ng')) && process?.argv?.indexOf('build') !== -1,
enabled: process && process.argv && process.argv.find(arg => arg.includes('ng')) && process.argv.indexOf('build') !== -1,
content: ['./src/**/*.{html,scss,ts}'],
options: {
safelist: {