editorconfig
Advanced tools
Comparing version 0.11.0 to 0.11.1
@@ -83,3 +83,3 @@ var fs = require('fs'); | ||
configurations.push([path.dirname(configFilePath), parsedOutput]); | ||
if (parsedOutput.root == "true") break; | ||
if ((parsedOutput[0][1].root || "").toLowerCase() == "true") break; | ||
} | ||
@@ -91,4 +91,6 @@ } | ||
var config = configurations[j][1]; | ||
for (var glob in config) { | ||
for (var k in config) { | ||
var glob = config[k][0]; | ||
var fullGlob; | ||
if (!glob) continue; | ||
if (glob.indexOf('/') === -1) { | ||
@@ -102,5 +104,5 @@ fullGlob = path.join(pathPrefix, "**/" + glob); | ||
if (fnmatch(filepath, fullGlob)) { | ||
for (var k in config[glob]) { | ||
var value = config[glob][k]; | ||
if (knownOptions.indexOf(k) !== -1) { | ||
for (var m in config[k][1]) { | ||
var value = config[k][1][m]; | ||
if (knownOptions.indexOf(m) !== -1) { | ||
value = value.toLowerCase(); | ||
@@ -111,3 +113,3 @@ } | ||
} catch(e){} | ||
matches[k.toLowerCase()] = value; | ||
matches[m.toLowerCase()] = value; | ||
} | ||
@@ -114,0 +116,0 @@ } |
@@ -0,0 +0,0 @@ // Based on minimatch.js by isaacs <https://npmjs.org/package/minimatch> |
@@ -16,3 +16,3 @@ // Based on iniparser by shockie <https://npmjs.org/package/iniparser> | ||
section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/, | ||
param: /^\s*([\w\.\-\_]+)\s*=\s*(.*?)\s*([#;].*)?$/, | ||
param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/, | ||
comment: /^\s*[#;].*$/ | ||
@@ -45,7 +45,8 @@ }; | ||
function parse(data){ | ||
var value = {}; | ||
var sectionBody = {}; | ||
var sectionName = null; | ||
var value = [[sectionName, sectionBody]]; | ||
var lines = data.split(/\r\n|\r|\n/); | ||
var section = null; | ||
lines.forEach(function(line){ | ||
var match; | ||
var match; | ||
if(regex.comment.test(line)){ | ||
@@ -55,11 +56,8 @@ return; | ||
match = line.match(regex.param); | ||
if(section){ | ||
value[section][match[1]] = match[2]; | ||
}else{ | ||
value[match[1]] = match[2]; | ||
} | ||
sectionBody[match[1]] = match[2]; | ||
}else if(regex.section.test(line)){ | ||
match = line.match(regex.section); | ||
value[match[1]] = {}; | ||
section = match[1]; | ||
sectionName = match[1]; | ||
sectionBody = {}; | ||
value.push([sectionName, sectionBody]); | ||
} | ||
@@ -66,0 +64,0 @@ }); |
@@ -0,0 +0,0 @@ function Version(version) { |
{ | ||
"name": "editorconfig", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "EditorConfig File Locator and Interpreter for Node.js", | ||
"keywords": ["editorconfig", "core"], | ||
"main": "editorconfig.js", | ||
"contributors": [ | ||
"Hong Xu (topbug.net)", | ||
"Jed Hunsaker <jed.hunsaker[at]gmail.com>", | ||
"Trey Hunner (http://treyhunner.com)" | ||
], | ||
"directories" : { | ||
@@ -8,0 +13,0 @@ "bin": "./bin", |
@@ -0,0 +0,0 @@ # EditorConfig JavaScript Core |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44298
14
1121
1