less-vars-to-js
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -9,4 +9,5 @@ "use strict"; | ||
var lessVars = {}; | ||
var matches = sheet.match(/@(.*:[^;]*)/g) || []; | ||
sheet.match(/@(.*:[^;]*)/g).forEach(function (variable) { | ||
matches.forEach(function (variable) { | ||
var definition = variable.split(/:\s*/); | ||
@@ -13,0 +14,0 @@ lessVars[definition[0]] = definition[1]; |
{ | ||
"name": "less-vars-to-js", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Read LESS variables from the contents of a file and returning them as a javascript object.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -104,2 +104,13 @@ import lessVarsToJS from '../src'; | ||
} | ||
}, | ||
{ | ||
should: 'should not break in file with no variables', | ||
input: ` | ||
@import (reference) 'theme'; | ||
.element { | ||
color: black; | ||
} | ||
`, | ||
output: {} | ||
} | ||
@@ -106,0 +117,0 @@ ]; |
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
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
11532
9
293