@symbo.ls/scratch
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -5,3 +5,3 @@ { | ||
"author": "Symbols", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"files": [ | ||
@@ -8,0 +8,0 @@ "src" |
@@ -18,2 +18,4 @@ 'use strict' | ||
const ENV = process.env.NODE_ENV | ||
const setColor = (val, key) => { | ||
@@ -43,3 +45,6 @@ const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val) | ||
export const getColor = value => { | ||
if (!isString(value)) return console.warn(value, '- type for color is not valid') | ||
if (!isString(value)) { | ||
if (ENV === 'test' || ENV === 'development') console.warn(value, '- type for color is not valid') | ||
return | ||
} | ||
@@ -51,3 +56,3 @@ const [name, alpha, tone] = isArray(value) ? value : value.split(' ') | ||
if (!val) { | ||
console.warn('Can\'t find color', name) | ||
if (ENV === 'test' || ENV === 'development') console.warn('Can\'t find color', name) | ||
return value | ||
@@ -103,3 +108,4 @@ } | ||
else if (isString(value) && THEME[value]) return getThemeValue(THEME[value]) | ||
console.warn('Can\'t find theme', value) | ||
if (ENV === 'test' || ENV === 'development') console.warn('Can\'t find theme', value) | ||
} | ||
@@ -106,0 +112,0 @@ |
@@ -5,2 +5,4 @@ 'use strict' | ||
const ENV = process.env.NODE_ENV | ||
export const isString = arg => typeof arg === 'string' | ||
@@ -157,3 +159,6 @@ | ||
const arr = colorStringToRgbaArray(color) | ||
if (!arr) return console.warn(color + 'color is not rgba') | ||
if (!arr) { | ||
if (ENV === 'test' || ENV === 'development') console.warn(color + 'color is not rgba') | ||
return | ||
} | ||
arr[3] = opacity | ||
@@ -160,0 +165,0 @@ return `rgba(${arr})` |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
24671
772
3