@@ -32,29 +32,29 @@ function loadSourceMap(file, state, callback) {
3232
3333 if ( state . map ) {
3434 state . map = state . map . toObject ( ) ;
35- // sources in map are relative to the source file
35+ // Sources in map are relative to the source file
3636 state . path = file . dirname ;
3737 state . content = convert . removeComments ( state . content ) ;
38- // remove source map comment from source
38+ // Remove source map comment from source
3939 file . contents = new Buffer ( state . content , 'utf8' ) ;
4040 return callback ( ) ;
4141 }
4242
43- // look for source map comment referencing a source map file
43+ // Look for source map comment referencing a source map file
4444 var mapComment = convert . mapFileCommentRegex . exec ( state . content ) ;
4545
4646 var mapFile ;
4747 if ( mapComment ) {
4848 mapFile = path . resolve ( file . dirname , mapComment [ 1 ] || mapComment [ 2 ] ) ;
4949 state . content = convert . removeMapFileComments ( state . content ) ;
50- // remove source map comment from source
50+ // Remove source map comment from source
5151 file . contents = new Buffer ( state . content , 'utf8' ) ;
5252 } else {
53- // if no comment try map file with same name as source file
53+ // If no comment try map file with same name as source file
5454 mapFile = file . path + '.map' ;
5555 }
5656
57- // sources in external map are relative to map file
57+ // Sources in external map are relative to map file
5858 state . path = path . dirname ( mapFile ) ;
5959
6060 fs . readFile ( mapFile , 'utf8' , onRead ) ;
@@ -68,7 +68,7 @@ function loadSourceMap(file, state, callback) {
6868 }
6969}
7070
71- // fix source paths and sourceContent for imported source map
71+ // Fix source paths and sourceContent for imported source map
7272function fixImportedSourceMap ( file , state , callback ) {
7373 if ( ! state . map ) {
7474 return callback ( ) ;
@@ -108,11 +108,11 @@ function fixImportedSourceMap(file, state, callback) {
108108 state . map . sources [ idx ] = unixRelPath ;
109109
110110 if ( absPath !== file . path ) {
111- // load content from file async
111+ // Load content from file async
112112 return fs . readFile ( absPath , 'utf8' , onRead ) ;
113113 }
114114
115- // if current file: use content
115+ // If current file: use content
116116 assignSourcesContent ( state . content , idx ) ;
117117 cb ( ) ;
118118
@@ -171,25 +171,25 @@ function createSourceMapFile(opts) {
171171 path : opts . path ,
172172 contents : new Buffer ( JSON . stringify ( opts . content ) ) ,
173173 stat : {
174- isFile : function ( ) {
174+ isFile : function ( ) {
175175 return true ;
176176 } ,
177- isDirectory : function ( ) {
177+ isDirectory : function ( ) {
178178 return false ;
179179 } ,
180- isBlockDevice : function ( ) {
180+ isBlockDevice : function ( ) {
181181 return false ;
182182 } ,
183- isCharacterDevice : function ( ) {
183+ isCharacterDevice : function ( ) {
184184 return false ;
185185 } ,
186- isSymbolicLink : function ( ) {
186+ isSymbolicLink : function ( ) {
187187 return false ;
188188 } ,
189- isFIFO : function ( ) {
189+ isFIFO : function ( ) {
190190 return false ;
191191 } ,
192- isSocket : function ( ) {
192+ isSocket : function ( ) {
193193 return false ;
194194 } ,
195195 } ,
@@ -212,7 +212,7 @@ function writeSourceMaps(file, destPath, callback) {
212212
213213 var comment ;
214214 if ( destPath == null ) {
215- // encode source map into comment
215+ // Encode source map into comment
216216 comment = convert . fromObject ( file . sourceMap ) . toComment ( commentOpts ) ;
217217 } else {
218218 var mapFile = path . join ( destPath , file . relative ) + '.map' ;
@@ -235,7 +235,7 @@ function writeSourceMaps(file, destPath, callback) {
235235 comment = convert . generateMapFileComment ( sourcemapLocation , commentOpts ) ;
236236 }
237237
238- // append source map comment
238+ // Append source map comment
239239 file . contents = appendBuffer ( file . contents , comment ) ;
240240
241241 callback ( null , file , sourceMapFile ) ;
0 commit comments