summaryrefslogtreecommitdiffstats
path: root/lib/parse/listAssets.js
blob: 6159eda0cdc3a39be81a58787bf24f285a443b69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

/**
    List all assets in a book
    Assets are file not ignored and not a page

    @param {Book} book
    @param {List<String>} pages
    @param
*/
function listAssets(book, pages) {
    var fs = book.getContentFS();

    return fs.listAllFiles()
    .then(function(files) {
        return files.filterNot(function(file) {
            return (
                book.isContentFileIgnored(file) ||
                pages.has(file)
            );
        });
    });
}

module.exports = listAssets;