Skip to content

Commit 06c71dd

Browse files
committed
chore: linting
1 parent 7068c4f commit 06c71dd

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/main/ts/native.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const addresses = (kind?: string, family: FamilyAlias = 4): string[] => {
2626
const nic = interfaces[kind]
2727
if (!nic) return []
2828
const match = nic.find(details => normalizeFamily(details.family) === fam)
29-
return [match?.address!]
29+
if (!match) return []
30+
return [match.address]
3031
}
3132

3233
// scan all NICs

src/main/ts/polyfill.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface BufferLike extends Omit<Uint8Array, 'slice'> {
1010
export const FakeBuffer = {
1111
alloc: (size: number, fill: number = 0): BufferLike => {
1212
if (size < 0)
13-
throw new RangeError('The value of \"size\" is out of range.')
13+
throw new RangeError('The value of "size" is out of range.')
1414

1515
const arr = new Uint8Array(size)
1616
if (fill !== 0)

src/scripts/build.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { nodeExternalsPlugin } from 'esbuild-node-externals'
66
import { entryChunksPlugin } from 'esbuild-plugin-entry-chunks'
77
import { transformHookPlugin } from 'esbuild-plugin-transform-hook'
88
import { extractHelpersPlugin } from 'esbuild-plugin-extract-helpers'
9-
import { injectFile } from 'esbuild-plugin-utils'
109
import minimist from 'minimist'
1110
import glob from 'fast-glob'
1211
import path from "node:path";
@@ -59,7 +58,7 @@ const cjsPlugins = [
5958
{
6059
on: 'end',
6160
pattern: entryPointsToRegexp(entryPoints),
62-
transform(contents, p) {
61+
transform(contents) {
6362
return contents
6463
.toString()
6564
.replaceAll('"node:', '"')

target/cjs/index.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ var addresses = (kind, family = 4) => {
6565
const nic = interfaces[kind];
6666
if (!nic) return [];
6767
const match = nic.find((details) => normalizeFamily(details.family) === fam);
68-
return [match == null ? void 0 : match.address];
68+
if (!match) return [];
69+
return [match.address];
6970
}
7071
const all = Object.values(interfaces).reduce((acc, nic) => {
7172
for (const { family: family2, address: address2 } of nic != null ? nic : []) {

target/esm/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ var addresses = (kind, family = 4) => {
3535
const nic = interfaces[kind];
3636
if (!nic) return [];
3737
const match = nic.find((details) => normalizeFamily(details.family) === fam);
38-
return [match == null ? void 0 : match.address];
38+
if (!match) return [];
39+
return [match.address];
3940
}
4041
const all = Object.values(interfaces).reduce((acc, nic) => {
4142
for (const { family: family2, address: address2 } of nic != null ? nic : []) {

0 commit comments

Comments
 (0)