MCPcopy
hub / github.com/zxlie/FeHelper / checkManifestField

Function checkManifestField

gulpfile.js:272–283  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

270 if (fs.existsSync(manifestPath)) {
271 const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
272 const checkManifestField = (obj) => {
273 if (typeof obj === 'string' && /\.(js|css|png|jpg|jpeg|gif|svg)$/i.test(obj)) {
274 const normalizedPath = obj.startsWith('/') ? obj.slice(1) : obj;
275 if (!shouldExcludeFile(normalizedPath)) {
276 referencedFiles.add(normalizedPath);
277 }
278 } else if (Array.isArray(obj)) {
279 obj.forEach(item => checkManifestField(item));
280 } else if (typeof obj === 'object' && obj !== null) {
281 Object.values(obj).forEach(value => checkManifestField(value));
282 }
283 };
284 if (manifest.content_scripts) {
285 manifest.content_scripts.forEach(script => {
286 if (script.js) {

Callers 1

processManifestFunction · 0.85

Calls 2

shouldExcludeFileFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected