Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4974607

Browse files
liitfrmichael-ciniawsky
authored andcommittedJun 14, 2017
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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
}
Lines changed: 1 addition & 1 deletion
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
})

‎yarn.lock

Lines changed: 538 additions & 17 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.