mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
f9871103bf
Reenable eslint `prefer-const` rule GitOrigin-RevId: 4f3825be8b8dff381095209085a36eaab76260d5
22 lines
532 B
JavaScript
22 lines
532 B
JavaScript
import _ from 'lodash'
|
|
import App from '../../../base'
|
|
|
|
export default App.factory('files', function (ide) {
|
|
const Files = {
|
|
getTeXFiles() {
|
|
const texFiles = []
|
|
ide.fileTreeManager.forEachEntity(function (entity, _folder, path) {
|
|
if (
|
|
entity.type === 'doc' &&
|
|
/.*\.(tex|md|txt|tikz)/.test(entity.name)
|
|
) {
|
|
const cloned = _.clone(entity)
|
|
cloned.path = path
|
|
texFiles.push(cloned)
|
|
}
|
|
})
|
|
return texFiles
|
|
},
|
|
}
|
|
return Files
|
|
})
|