sass-graph
Advanced tools
+7
-3
@@ -11,13 +11,17 @@ # Change Log | ||
| ## [1.3.0] | ||
| ### Features | ||
| - Add support for indented syntax - [@vegetableman](https://github.com/vegetableman) | ||
| ## [1.2.0] | ||
| ### Features | ||
| - Add support for custom imports | ||
| - Add support for custom imports - [@kevin-smets](https://github.com/kevin-smets) | ||
| ## [1.1.0] - 2015-03-18 | ||
| ### Fixed | ||
| - Only strip extension for css, scss, sass files | ||
| - Only strip extension for css, scss, sass files - [@nervo](https://github.com/nervo) | ||
| ## [1.0.4] - 2015-03-03 | ||
| ### Tests | ||
| - Added a test for nested imports | ||
| - Added a test for nested imports - [@kevin-smets](https://github.com/kevin-smets) | ||
@@ -24,0 +28,0 @@ ## [1.0.3] - 2015-02-02 |
+1
-1
| { | ||
| "name": "sass-graph", | ||
| "version": "1.2.0", | ||
| "version": "1.3.0", | ||
| "description": "Parse sass files and extract a graph of imports", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+1
-1
| function parseImports(content) { | ||
| var importRe = /\@import ([.\s\S]+?);/g; | ||
| var importRe = /\@import ([.\s\S]+?);?$/g; | ||
| var depRe = /["'](.+?)["']/g; | ||
@@ -4,0 +4,0 @@ var importMatch = {}; |
+18
-8
@@ -14,12 +14,22 @@ 'use strict'; | ||
| // check all load paths | ||
| var i, length = loadPaths.length; | ||
| var i, length = loadPaths.length, extensions = [".css", ".sass", ".scss"]; | ||
| for(i = 0; i < length; i++) { | ||
| var scssPath = path.normalize(loadPaths[i] + "/" + sassPathName + ".scss"); | ||
| if (fs.existsSync(scssPath)) { | ||
| return scssPath; | ||
| var scssPath; | ||
| for (var j = 0; j < extensions.length; j++) { | ||
| scssPath = path.normalize(loadPaths[i] + "/" + sassPathName + extensions[j]); | ||
| if (fs.existsSync(scssPath)) { | ||
| return scssPath; | ||
| } | ||
| } | ||
| var partialPath; | ||
| // special case for _partials | ||
| var partialPath = path.join(path.dirname(scssPath), "_" + path.basename(scssPath)); | ||
| if (fs.existsSync(partialPath)) { | ||
| return partialPath | ||
| for (var j = 0; j < extensions.length; j++) { | ||
| scssPath = path.normalize(loadPaths[i] + "/" + sassPathName + extensions[j]); | ||
| partialPath = path.join(path.dirname(scssPath), "_" + path.basename(scssPath)); | ||
| if (fs.existsSync(partialPath)) { | ||
| return partialPath; | ||
| } | ||
| } | ||
@@ -39,3 +49,3 @@ } | ||
| var graph = this; | ||
| _(glob.sync(dir+"/**/*.scss", {})).forEach(function(file) { | ||
| _(glob.sync(dir+"/**/*.s[ca]ss", {})).forEach(function(file) { | ||
| graph.addFile(path.resolve(file)); | ||
@@ -42,0 +52,0 @@ }); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
17192
3.27%304
2.36%