Skip to content

Commit 4974607

Browse files
liitfrmichael-ciniawsky
authored andcommitted
fix: allow to pass an {Object} (options.parser) (#257)
1 parent adcbb2e commit 4974607

File tree

6 files changed

+553
-20
lines changed

6 files changed

+553
-20
lines changed

lib/options.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"type": "boolean"
1818
},
1919
"parser": {
20-
"type": "string"
20+
"type": [ "string", "object" ]
2121
},
2222
"syntax": {
2323
"type": "string"

test/configs/parser-object.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const sugarss = require('sugarss')
2+
3+
module.exports = {
4+
file: 'parser-object',
5+
options: {
6+
parser: sugarss
7+
}
8+
}

test/configs/parser-object.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test('Parser as an object', () => {
2+
const css = require('../fixtures/style.sss')
3+
expect(css).toEqual('a {\n color: black\n}\n')
4+
})

test/configs/parser.config.js renamed to test/configs/parser-string.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
file: 'parser',
2+
file: 'parser-string',
33
options: {
44
parser: 'sugarss'
55
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test('Parser', () => {
1+
test('Parser as a string', () => {
22
const css = require('../fixtures/style.sss')
33
expect(css).toEqual('a {\n color: black\n}\n')
44
})

0 commit comments

Comments
 (0)