File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11import { DOMParser } from '@xmldom/xmldom' ;
2- import { Transform , type TransformCallback , } from 'node:stream' ;
2+ import { Transform , type TransformCallback } from 'node:stream' ;
33import kleur from 'kleur' ;
44import PluginError from 'plugin-error' ;
55
@@ -15,7 +15,7 @@ export function xmlValidator(): Transform {
1515 return new Transform ( {
1616 objectMode : true ,
1717
18- /**
18+ /**
1919 * Transform function for the Gulp plugin.
2020 * @param {Vinyl } file - The vinyl file being processed.
2121 * @param {BufferEncoding } _encoding - The encoding of the file.
@@ -32,7 +32,7 @@ export function xmlValidator(): Transform {
3232 return ;
3333 }
3434
35- if ( ! file . contents ?. toString ( ) ) {
35+ if ( ! file . contents ) {
3636 callback ( new PluginError ( packageName , 'Empty file' ) ) ;
3737 return ;
3838 }
@@ -47,8 +47,8 @@ export function xmlValidator(): Transform {
4747 errorList . push ( `${ kleur . underline ( file . relative ) } : <${ level } > ${ message } ` ) ;
4848 }
4949 } ) . parseFromString ( file . contents . toString ( ) , 'text/xml' ) ;
50- } catch ( err ) {
51- this . emit ( 'error' , new PluginError ( packageName , err , {
50+ } catch ( error ) {
51+ this . emit ( 'error' , new PluginError ( packageName , error as Error , {
5252 fileName : file . path
5353 } ) ) ;
5454 }
You can’t perform that action at this time.
0 commit comments