@epegzz/sass-vars-loader
Advanced tools
Comparing version 4.3.0 to 4.3.1
{ | ||
"name": "@epegzz/sass-vars-loader", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"author": "Daniel Schäfer <epegzz@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "A SASS vars loader for Webpack. Load global SASS vars from JS/JSON/Typescript files or from Webpack config.", |
@@ -13,5 +13,6 @@ function convertJsToSass(obj, syntax) { | ||
function withQuotes(value) { | ||
function withQuotesIfNecessary(value) { | ||
const hasQuotes = /^['"](\n|.)*['"]$/gm.test(value) | ||
return hasQuotes ? value : `"${value}"` | ||
const requiresQuotes = /^[0 ]/.test(value) | ||
return hasQuotes || !requiresQuotes ? value : `"${value}"` | ||
} | ||
@@ -29,3 +30,3 @@ | ||
if (typeof value === 'string') { | ||
return withQuotes(value) | ||
return withQuotesIfNecessary(value) | ||
} | ||
@@ -32,0 +33,0 @@ |
@@ -5,2 +5,4 @@ const convertJsToSass = require('./convertJsToSass') | ||
{ name: 'converts string', input: { it: 'value' } }, | ||
{ name: 'converts string and adds quotes for leading zero', input: { it: '012345' } }, | ||
{ name: 'converts string and adds quotes for leading spaces', input: { it: ' value' } }, | ||
{ name: 'converts multi line string', input: { it: 'line1\nline2' } }, | ||
@@ -7,0 +9,0 @@ { name: 'converts string with single quotes', input: { it: '"value"' } }, |
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
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
23902
327