Skip to content

Commit 6633716

Browse files
committed
Make order of like-file concatenation deterministic
1 parent ff3b557 commit 6633716

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/reducers/projects.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import filter from 'lodash/filter';
44
import find from 'lodash/find';
55
import get from 'lodash/get';
66
import map from 'lodash/map';
7+
import sortBy from 'lodash/sortBy';
78
import values from 'lodash/values';
89

910
import {Project} from '../records';
@@ -29,7 +30,10 @@ function unhideComponent(state, projectKey, component, timestamp) {
2930
}
3031

3132
function contentForLanguage(files, language) {
32-
return map(filter(files, {language}), 'content').join('\n\n');
33+
const filesForLanguage = sortBy(
34+
filter(files, {language}),
35+
file => file.filename);
36+
return map(filesForLanguage, 'content').join('\n\n');
3337
}
3438

3539
function importGist(state, projectKey, gistData) {

0 commit comments

Comments
 (0)