forked from bartholomej/ngx-translate-extract
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix regression with --null-as-default-value
Fixes #18
- Loading branch information
1 parent
1a4cc60
commit 58bb22a
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { TranslationCollection } from '../utils/translation.collection.js'; | ||
import {TranslationCollection, TranslationInterface} from '../utils/translation.collection.js'; | ||
import { PostProcessorInterface } from './post-processor.interface.js'; | ||
|
||
export class NullAsDefaultValuePostProcessor implements PostProcessorInterface { | ||
public name: string = 'NullAsDefaultValue'; | ||
|
||
public process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection { | ||
return draft.map((key, val) => (existing.get(key) === undefined ? null : val)); | ||
return draft.map((key, val) => (existing.get(key) === undefined ? <TranslationInterface>{value: null, sourceFiles: []} : val)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters