Skip to content

Commit bbb512c

Browse files
committed
Support extensions with multiple parts (i.e. en.md)
1 parent 5bb459c commit bbb512c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/backends/github/implementation.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import trimStart from 'lodash/trimStart';
22
import semaphore from "semaphore";
3-
import { fileExtension } from 'Lib/pathHelper'
43
import AuthenticationPage from "./AuthenticationPage";
54
import API from "./API";
65

@@ -53,7 +52,7 @@ export default class GitHub {
5352

5453
entriesByFolder(collection, extension) {
5554
return this.api.listFiles(collection.get("folder"))
56-
.then(files => files.filter(file => fileExtension(file.name) === extension))
55+
.then(files => files.filter(file => file.name.endsWith('.' + extension)))
5756
.then(this.fetchFiles);
5857
}
5958

src/backends/test-repo/implementation.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { remove, attempt, isError } from 'lodash';
22
import uuid from 'uuid/v4';
3-
import { fileExtension } from 'Lib/pathHelper'
43
import AuthenticationPage from './AuthenticationPage';
54

65
window.repoFiles = window.repoFiles || {};
@@ -45,7 +44,7 @@ export default class TestRepo {
4544
const folder = collection.get('folder');
4645
if (folder) {
4746
for (const path in window.repoFiles[folder]) {
48-
if (fileExtension(path) !== extension) {
47+
if (!path.endsWith('.' + extension)) {
4948
continue;
5049
}
5150

0 commit comments

Comments
 (0)