mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
25 lines
498 B
JavaScript
25 lines
498 B
JavaScript
|
|
/**
|
|
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;
|