Skip to content

Commit 157f848

Browse files
committed
Update objectify options
1 parent efff27e commit 157f848

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ postcss().process(obj, { parser: postcssJs })
121121
```
122122

123123

124-
### `objectify(root, stringifyImportant): object`
124+
### `objectify(root): object`
125125

126126
Convert PostCSS `Root` instance to CSS-in-JS style object.
127127

objectifier.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ function atRule(node) {
3333
}
3434
}
3535

36-
function process(node, stringifyImportant) {
36+
function process(node, options = {}) {
3737
let name
3838
let result = {}
39+
let { stringifyImportant } = options;
3940

4041
node.each(child => {
4142
if (child.type === 'atrule') {

test/objectifier.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ test('keeps last important in merge', () => {
168168

169169
test('prioritizes important in merge', () => {
170170
let root = parse('a { height: 1px !important; };a { height: 2px }')
171-
equal(postcssJS.objectify(root, true), {
171+
equal(postcssJS.objectify(root, { stringifyImportant: true }), {
172172
a: {
173173
height: "1px !important"
174174
}
@@ -177,7 +177,7 @@ test('prioritizes important in merge', () => {
177177

178178
test('keeps last important with priority', () => {
179179
let root = parse('a { height: 1px !important; };a { height: 2px !important; }')
180-
equal(postcssJS.objectify(root, true), {
180+
equal(postcssJS.objectify(root, { stringifyImportant: true }), {
181181
a: {
182182
height: "2px !important"
183183
}

0 commit comments

Comments
 (0)