postcss-variables
Advanced tools
Comparing version 1.0.1 to 1.1.0
module.exports = { | ||
/** | ||
* Delay the calculation of a variable until later | ||
* | ||
* @param {Function} fn | ||
* @param {Array} args | ||
* @returns {{type: string, fn: *, args: *}} | ||
*/ | ||
defer(fn, args) { | ||
@@ -8,3 +15,13 @@ return { | ||
}; | ||
}, | ||
/** | ||
* Auto-escape icon to prep for browser | ||
* | ||
* @param {string} icon | ||
* @returns {string} | ||
*/ | ||
icon(icon) { | ||
return `'\\${icon}'`; | ||
} | ||
}; |
{ | ||
"name": "postcss-variables", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "PostCSS plugin that converts variables into CSS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ const expect = require('chai').expect; | ||
const register = require('./lib/register'); | ||
const { defer } = require('./lib/helpers'); | ||
const { defer, icon } = require('./lib/helpers'); | ||
@@ -421,2 +421,9 @@ function process(input, expected, opts = {}) { | ||
}); | ||
}); | ||
describe('Helpers: icon', () => { | ||
it('should escape and wrap icon in quotes', () => { | ||
expect(icon('e803')).to.equal("'\\e803'"); | ||
expect(icon("e803")).to.equal("'\\e803'"); | ||
}); | ||
}); |
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
19754
649