All files / fuse-ui-shared/i18n/sample index.ts

100% Statements 13/13
100% Branches 0/0
100% Functions 2/2
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x 1x     10x 10x 4x 6x   4x         1x 1x    
import { isLocalized, Localized, LocalizedStrings } from '../index';
import * as Strings from './res/strings';
 
function* dumpStrings(map: LocalizedStrings): IterableIterator<string> {
  for (const key of Object.keys(map)) {
    const value = map[key];
    if (isLocalized(value)) {
      yield `${key} = ${value.value}`;
    } else {
      yield* dumpStrings(value);
    }
  }
}
 
export function* checkStrings() {
  yield* dumpStrings(Strings);
}