File tree Expand file tree Collapse file tree 4 files changed +31
-4
lines changed
Expand file tree Collapse file tree 4 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ function newCompileRequest(
7171 importers : importers . importers ,
7272 globalFunctions : Object . keys ( options ?. functions ?? { } ) ,
7373 sourceMap : ! ! options ?. sourceMap ,
74- sourceMapIncludeSources : ! ! options ?. sourceMapIncludeSources ,
74+ sourceMapIncludeSources : utils . protofySourceMapIncludeSources (
75+ options ?. sourceMapIncludeSources ?? 'auto' ,
76+ ) ,
7577 alertColor : options ?. alertColor ?? ! ! supportsColor . stdout ,
7678 alertAscii : ! ! options ?. alertAscii ,
7779 quietDeps : ! ! options ?. quietDeps ,
Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ function newLegacyResult(
303303 return pathToUrlString (
304304 p . relative ( sourceMapDir , fileUrlToPathCrossPlatform ( source ) ) ,
305305 ) ;
306- } else if ( source . startsWith ( 'data:' ) ) {
306+ } else if ( source === '' ) {
307307 return 'stdin' ;
308308 } else {
309309 return source ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import * as p from 'path';
77import * as url from 'url' ;
88
99import * as proto from './vendor/embedded_sass_pb' ;
10- import { Syntax } from './vendor/sass' ;
10+ import { SourceMapIncludeSources , Syntax } from './vendor/sass' ;
1111
1212export type PromiseOr <
1313 T ,
@@ -147,6 +147,31 @@ export function protofySyntax(syntax: Syntax): proto.Syntax {
147147 }
148148}
149149
150+ /** Converts a JS sourceMapIncludeSources value into a protobuf
151+ * sourceMapIncludeSources enum.
152+ */
153+ export function protofySourceMapIncludeSources (
154+ sourceMapIncludeSources : SourceMapIncludeSources | boolean ,
155+ ) : proto . SourceMapIncludeSources {
156+ switch ( sourceMapIncludeSources ) {
157+ case 'auto' :
158+ return proto . SourceMapIncludeSources . AUTO ;
159+
160+ case 'always' :
161+ case true :
162+ return proto . SourceMapIncludeSources . ALWAYS ;
163+
164+ case 'never' :
165+ case false :
166+ return proto . SourceMapIncludeSources . NEVER ;
167+
168+ default :
169+ throw new Error (
170+ `Unknown sourceMapIncludeSources: "${ sourceMapIncludeSources } "` ,
171+ ) ;
172+ }
173+ }
174+
150175/** Returns whether `error` is a NodeJS-style exception with an error code. */
151176export function isErrnoException (
152177 error : unknown ,
Original file line number Diff line number Diff line change 11{
22 "name" : " sass-embedded" ,
33 "version" : " 1.97.2" ,
4- "protocol-version" : " 3.2 .0" ,
4+ "protocol-version" : " 3.3 .0" ,
55 "compiler-version" : " 1.97.2" ,
66 "description" : " Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol" ,
77 "repository" : " sass/embedded-host-node" ,
You can’t perform that action at this time.
0 commit comments