feat(core): set preserveWhitespaces to false by default (#22046)
Fixes #22027 PR Close #22046
This commit is contained in:

committed by
Victor Berchet

parent
d241532488
commit
f1a063298e
@ -46,6 +46,6 @@ export class CompilerConfig {
|
||||
}
|
||||
|
||||
export function preserveWhitespacesDefault(
|
||||
preserveWhitespacesOption: boolean | null, defaultSetting = true): boolean {
|
||||
preserveWhitespacesOption: boolean | null, defaultSetting = false): boolean {
|
||||
return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {MissingTranslationStrategy} from '@angular/core';
|
||||
import {CompilerConfig} from '../src/config';
|
||||
import {CompilerConfig, preserveWhitespacesDefault} from '../src/config';
|
||||
|
||||
{
|
||||
describe('compiler config', () => {
|
||||
@ -16,4 +16,13 @@ import {CompilerConfig} from '../src/config';
|
||||
expect(config.missingTranslation).toEqual(MissingTranslationStrategy.Error);
|
||||
});
|
||||
});
|
||||
|
||||
describe('preserveWhitespacesDefault', () => {
|
||||
it('should return the default `false` setting when no preserveWhitespacesOption are provided',
|
||||
() => { expect(preserveWhitespacesDefault(null)).toEqual(false); });
|
||||
it('should return the preserveWhitespacesOption when provided as a parameter', () => {
|
||||
expect(preserveWhitespacesDefault(true)).toEqual(true);
|
||||
expect(preserveWhitespacesDefault(false)).toEqual(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user