Skip to content

Commit 606bf2d

Browse files
committed
update types
1 parent aa31873 commit 606bf2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DOMParser } from '@xmldom/xmldom';
2-
import { Transform, type TransformCallback, } from 'node:stream';
2+
import { Transform, type TransformCallback } from 'node:stream';
33
import kleur from 'kleur';
44
import 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
}

0 commit comments

Comments
 (0)