UNPKG

440 BJavaScriptView Raw
1import npath from 'path';
2
3import _ from 'underscore';
4
5const normalize = path => npath.normalize(path);
6
7const clean = paths => _.unique(_.map(paths, normalize));
8
9export default file => {
10 let { builds, links, requires } = file;
11 requires = clean(requires);
12 builds = _.difference(clean(builds), requires);
13 links = _.difference(clean(links), [].concat(builds, requires));
14 return _.extend({}, file, { builds, links, requires });
15};