Initial commit
[yaffs-website] / node_modules / sass-graph / parse-imports.js
1 function parseImports(content) {
2   var importRe = /\@import ([.\s\S]+?);?$/g;
3   var depRe = /["'](.+?)["']/g;
4   var importMatch = {};
5   var depMatch = {};
6   var results = [];
7   // strip comments
8   content = new String(content).replace(/\/\*.+?\*\/|\/\/.*(?=[\n\r])/g, '');
9   while ((importMatch = importRe.exec(content)) !== null) {
10     while ((depMatch = depRe.exec(importMatch[1])) !== null) {
11       results.push(depMatch[1]);
12     }
13   }
14   return results;
15 }
16
17 module.exports = parseImports;