This repository was archived by the owner on Jan 23, 2021. It is now read-only.
File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,33 +30,33 @@ function newErr (err, opts) {
30
30
}
31
31
32
32
// for now, source is only a single directory or a single file
33
- // TODO: implement glob source
34
33
module . exports = function ( source , options ) {
35
34
var stream = new Readable ( { objectMode : true } ) ;
36
35
var cwd = process . cwd ( ) ;
36
+ var defaults = {
37
+ container : 'gulp-ruby-sass' ,
38
+ verbose : false ,
39
+ sourcemap : false
40
+ } ;
37
41
var command ;
38
42
var args ;
39
43
var base ;
40
44
var destDir ;
41
45
var destFile ;
42
46
var compileMappings ;
43
- var defaults = {
44
- container : 'gulp-ruby-sass' ,
45
- verbose : false
46
- } ;
47
47
48
48
// redundant but necessary
49
49
stream . _read = function ( ) { } ;
50
50
51
51
options = assign ( defaults , options ) ;
52
52
53
53
// sourcemap can only be true or false; warn those trying to pass a Sass string option
54
- if ( typeof options . sourcemap === 'string ') {
54
+ if ( typeof options . sourcemap !== 'boolean ') {
55
55
throw newErr ( 'The sourcemap option must be true or false. See the readme for instructions on using Sass sourcemaps with gulp.' ) ;
56
56
}
57
57
58
- // reassign options.sourcemap boolean to our two acceptable Sass arguments
59
- options . sourcemap = options . sourcemap ? 'file' : 'none' ;
58
+ // reassign options.sourcemap boolean to one of our two acceptable Sass arguments
59
+ options . sourcemap = options . sourcemap === true ? 'file' : 'none' ;
60
60
61
61
// sass options need unix style slashes
62
62
destDir = slash ( path . join ( osTempDir , options . container ) ) ;
You can’t perform that action at this time.
0 commit comments