postcss-wee-syntax
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -234,12 +234,12 @@ const BaseParser = require('postcss/lib/parser'); | ||
// If key: value is identified, key is at end of ordered array | ||
if (objectArgs && (type === 'string' || type === 'word')) { | ||
namedKey = args.ordered.pop(); | ||
args.named[namedKey] = token[1].replace(/,$/, ''); | ||
namedValue = true; | ||
objectArgs = false; | ||
continue; | ||
} | ||
if (type === 'word') { | ||
// If key: value is identified, key is at end of ordered array | ||
if (objectArgs) { | ||
namedKey = args.ordered.pop(); | ||
args.named[namedKey] = token[1].replace(/,$/, ''); | ||
namedValue = true; | ||
objectArgs = false; | ||
continue; | ||
} | ||
args.ordered.push(token[1].replace(/,$/, '')); | ||
@@ -246,0 +246,0 @@ } |
{ | ||
"name": "postcss-wee-syntax", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Custom syntax used in the minimal front-end framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,4 +5,4 @@ # PostCSS Wee Syntax | ||
[![codecov](https://codecov.io/gh/weepower/postcss-wee-syntax/branch/master/graph/badge.svg)](https://codecov.io/gh/weepower/postcss-wee-syntax) | ||
[![npm version](https://badge.fury.io/js/postcss-wee-syntax.svg)](https://badge.fury.io/js/postcss-wee-syntax) | ||
<img width="135" height="95" src="http://postcss.github.io/postcss/logo-leftp.png" title="Philosopher’s stone, logo of PostCSS"> | ||
@@ -9,0 +9,0 @@ |
@@ -47,2 +47,9 @@ const parse = require('../lib/parse'); | ||
it('should parse key: value pair with string value', () => { | ||
let root = parse(".block { mixin(key: 'value', key2: 4); }"), | ||
node = root.first.first; | ||
expect(JSON.stringify(node.arguments)).to.equal('{"ordered":[],"named":{"key":"\'value\'","key2":"4"}}'); | ||
}); | ||
it('should parse many key: value pairs as arguments', () => { | ||
@@ -49,0 +56,0 @@ let root = parse(".block { mixin(padding: 1, weight: bold, background: url('test.png')); }"), |
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
18845
498