Files
ngx-translate-extract/src/post-processors/key-as-default-value.post-processor.ts
2019-07-17 12:44:21 +02:00

13 lines
471 B
TypeScript

import { TranslationCollection } from '../utils/translation.collection';
import { PostProcessorInterface } from './post-processor.interface';
export class KeyAsDefaultValuePostProcessor implements PostProcessorInterface {
public name: string = 'KeyAsDefaultValue';
public process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection {
return draft.map((key, val) => val === '' ? key : val);
}
}