MCPcopy Index your code
hub / github.com/MALSync/MALSync / getDiff

Function getDiff

webpackConfig/missingPermissions.js:52–78  ·  view source on GitHub ↗
(oldUrls, oldDiff)

Source from the content-addressed store, hash-verified

50}
51
52function getDiff(oldUrls, oldDiff) {
53 res = {};
54
55 const oldPages = fs.readdirSync(path.join(__dirname, '../dist/lastExtension/content'))
56 .filter(el => el.startsWith('page_') && el.endsWith('.js'))
57 .map(el => el.replace('page_', '').replace('.js', ''))
58
59 // Page urls
60 oldPages.forEach(page => {
61 try {
62 const urls = pagesUtils.urls(page);
63 const diffUrls = urls.match.filter(el => !oldUrls.includes(el));
64 if (diffUrls.length) {
65 res[page] = diffUrls;
66 }
67 } catch (err) {
68 return
69 }
70 });
71
72 // Iframe urls
73 res['iframe'] = pagesUtils
74 .generateMatchExcludes(playerUrls)
75 .match.filter(el => !oldUrls.includes(el));
76
77 return res;
78}
79
80function getUrls(manifest) {
81 const urls = [];

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected