MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / extractFile

Function extractFile

scripts/i18n.js:160–172  ·  view source on GitHub ↗
(data, types)

Source from the content-addressed store, hash-verified

158 const locales = new Locales(options);
159
160 function extractFile(data, types) {
161 if (!Array.isArray(types)) types = [types];
162 data = String(data);
163 types.forEach(function (type) {
164 const patternData = patterns[type];
165 const pattern = new RegExp(patternData[0], 'g');
166 const groupId = patternData[1];
167 let groups;
168 while ((groups = pattern.exec(data))) {
169 keys.add(groups[groupId]);
170 }
171 });
172 }
173
174 function bufferContents(file, enc, cb) {
175 if (file.isNull()) return cb();

Callers 2

bufferContentsFunction · 0.85
extractFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected