Fix namespaced-json compiler not preserving numeric values. Fixes #28

This commit is contained in:
Kim Biesbjerg
2017-03-29 12:52:14 +02:00
parent 7654397bb3
commit ff1c91010e
3 changed files with 14 additions and 2 deletions

View File

@@ -35,4 +35,14 @@ describe('NamespacedJsonCompiler', () => {
expect(result).to.equal('{\n\t"NAMESPACE": {\n\t\t"KEY": {\n\t\t\t"FIRST_KEY": "",\n\t\t\t"SECOND_KEY": "VALUE"\n\t\t}\n\t}\n}');
});
it('should preserve numeric values on compile', () => {
const collection = new TranslationCollection({
"option.0": '',
"option.1": '',
"option.2": ''
});
const result: string = compiler.compile(collection);
expect(result).to.equal('{\n\t"option": {\n\t\t"0": "",\n\t\t"1": "",\n\t\t"2": ""\n\t}\n}');
});
});