This commit is contained in:
tatianamac
2019-11-26 14:50:43 -08:00
parent 8a55660ed0
commit 6d5445ecc5
13894 changed files with 2233957 additions and 0 deletions

26
node_modules/detective-stylus/index.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* Extract the @import/@require statements from a given stylus file's content
*
* @param {String} fileContent
* @return {String[]}
*/
module.exports = function(fileContent) {
if (typeof fileContent === 'undefined') { throw new Error('content not given'); }
if (typeof fileContent !== 'string') { throw new Error('content is not a string'); }
var dependencies = [];
var importRegex = /\@(import|require)\s['"](.*)['"](\.styl)?/g;
var matches;
do {
matches = importRegex.exec(fileContent);
if (matches) {
dependencies.push(matches[2]);
}
} while (matches);
return dependencies;
};