(bugfix) order of keys was not preserved when using namespaced-json format. Closes #131
This commit is contained in:
parent
3cbc20e0a0
commit
a5b8f6e6c6
7
package-lock.json
generated
7
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@biesbjerg/ngx-translate-extract",
|
"name": "@biesbjerg/ngx-translate-extract",
|
||||||
"version": "2.3.4",
|
"version": "3.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -512,9 +512,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flat": {
|
"flat": {
|
||||||
"version": "4.1.0",
|
"version": "git://github.com/lenchvolodymyr/flat.git#ffe77efe8c33bc80ffb2f7a465537610dea4f611",
|
||||||
"resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz",
|
"from": "git://github.com/lenchvolodymyr/flat.git#ffe77ef",
|
||||||
"integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==",
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-buffer": "~2.0.3"
|
"is-buffer": "~2.0.3"
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
"@angular/compiler": "^8.1.3",
|
"@angular/compiler": "^8.1.3",
|
||||||
"boxen": "^4.1.0",
|
"boxen": "^4.1.0",
|
||||||
"colorette": "^1.1.0",
|
"colorette": "^1.1.0",
|
||||||
"flat": "^4.1.0",
|
"flat": "git://github.com/lenchvolodymyr/flat.git#ffe77ef",
|
||||||
"gettext-parser": "^4.0.1",
|
"gettext-parser": "^4.0.1",
|
||||||
"glob": "^7.1.4",
|
"glob": "^7.1.4",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
|
@ -57,4 +57,13 @@ describe('NamespacedJsonCompiler', () => {
|
|||||||
expect(result).to.equal('{\n "NAMESPACE": {\n "KEY": {\n "FIRST_KEY": "",\n "SECOND_KEY": "VALUE"\n }\n }\n}');
|
expect(result).to.equal('{\n "NAMESPACE": {\n "KEY": {\n "FIRST_KEY": "",\n "SECOND_KEY": "VALUE"\n }\n }\n}');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not reorder keys when compiled', () => {
|
||||||
|
const collection = new TranslationCollection({
|
||||||
|
'BROWSE': '',
|
||||||
|
'LOGIN': ''
|
||||||
|
});
|
||||||
|
const result: string = compiler.compile(collection);
|
||||||
|
expect(result).to.equal('{\n\t"BROWSE": "",\n\t"LOGIN": ""\n}');
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user