/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
script/lib/expand-glob-paths.js
21 строка
436 B
Rafael Oleza
Reformat all JS files using prettier
31 май 2019, 19:33
31 май 2019, 19:33
7f3f040
Код
Авторство
О чём код?
'use strict'; const glob = require('glob'); module.exports = function(globPaths) { return Promise.all(globPaths.map(g => expandGlobPath(g))).then(paths => paths.reduce((a, b) => a.concat(b), []) ); }; function expandGlobPath(globPath) { return new Promise((resolve, reject) => { glob(globPath, (error, paths) => { if (error) { reject(error); } else { resolve(paths); } }); }); }