polymerx-cli
Version:
Unlock the power of Polymer 3, Web Components and modern web tools.
32 lines (24 loc) • 673 B
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
var _gittar = require("gittar");
const RGX = /\.(woff2?|ttf|eot|jpe?g|ico|png|gif|mp4|mov|ogg|webm)(\?.*)?$/i;
const isMedia = str => RGX.test(str);
var _default = (archive, target) => new Promise(async resolve => {
const keeps = [];
await (0, _gittar.extract)(archive, target, {
filter(path, obj) {
if (path.includes('/.github')) {
return false;
}
obj.on('end', () => {
if (obj.type === 'File' && !isMedia(obj.path)) {
keeps.push(obj.absolute);
}
});
return true;
}
});
resolve(keeps);
});
exports.default = _default;