Skip to content

Commit e4987c1

Browse files
committed
chore(deps): fix linting related issues
1 parent 8b7a33b commit e4987c1

File tree

7 files changed

+23
-26
lines changed

7 files changed

+23
-26
lines changed

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"@typescript-eslint/explicit-member-accessibility": "off",
1515
"@typescript-eslint/camelcase": "off",
1616
"@typescript-eslint/no-explicit-any": "off",
17-
"@typescript-eslint/array-type": ["error", "array-simple"]
17+
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }]
1818
}
1919
}

lib/components/auth/digest.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class DigestAuth {
7878
return ha1
7979
}
8080

81-
ha2 = (method: string, uri: string, body: string = ''): string => {
81+
ha2 = (method: string, uri: string, body = ''): string => {
8282
let ha2 = new MD5().update(`${method}:${uri}`).digest('hex')
8383
if (this.algorithm === 'md5-sess') {
8484
const hbody = new MD5().update(body).digest('hex')
@@ -87,11 +87,7 @@ export class DigestAuth {
8787
return ha2
8888
}
8989

90-
authorization = (
91-
method: string = 'GET',
92-
uri: string = '',
93-
body?: string,
94-
): string => {
90+
authorization = (method = 'GET', uri = '', body?: string): string => {
9591
// Increase count
9692
const nc = this.nc()
9793
const cnonce = this.cnonce()

lib/components/canvas/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class CanvasSink extends Sink {
9999
let firstTimestamp = 0
100100
let lastTimestamp = 0
101101
let clockrate = 0
102-
let info = {
102+
const info = {
103103
bitrate: 0,
104104
framerate: 0,
105105
renderedFrames: 0,

lib/components/h264depay/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export class H264Depay extends Tube {
1212
// Incoming
1313

1414
let buffer = Buffer.alloc(0)
15-
let parseMessage: (buffer: Buffer, rtp: RtpMessage) => Buffer
15+
let parseMessage: (buffer: Buffer, rtp: RtpMessage) => Buffer = () =>
16+
Buffer.alloc(0)
1617

1718
const incoming = new Transform({
1819
objectMode: true,

lib/components/mp4muxer/helpers/spsparser.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ export class SPSParser {
1616
parse() {
1717
// nalhdr
1818
this.reader.readNext()
19-
let profile = this.reader.readNext()
19+
const profile = this.reader.readNext()
2020
// constraints
2121
this.reader.readNext()
22-
let level = this.reader.readNext()
22+
const level = this.reader.readNext()
2323

2424
// seqParameterSetId
2525
this.reader.readUnsignedExpGolomb()
2626

2727
if ([100, 110, 122, 244, 44, 83, 86, 118].indexOf(profile) >= 0) {
28-
let chromaFormat = this.reader.readUnsignedExpGolomb()
28+
const chromaFormat = this.reader.readUnsignedExpGolomb()
2929
if (chromaFormat === 3) {
3030
// Separate color plane flag
3131
this.reader.readBits(1)
@@ -39,7 +39,7 @@ export class SPSParser {
3939

4040
// qpPrimeYZeroTransformBypassFlag
4141
this.reader.readBits(1)
42-
let seqScalingMatrix = this.reader.readBits(1)
42+
const seqScalingMatrix = this.reader.readBits(1)
4343
if (seqScalingMatrix) {
4444
for (let k = 0; k < (chromaFormat !== 3 ? 8 : 12); k++) {
4545
// seqScalingListPresentFlag
@@ -51,7 +51,7 @@ export class SPSParser {
5151

5252
// log2MaxFrameNumMinus4
5353
this.reader.readUnsignedExpGolomb()
54-
let picOrderCntType = this.reader.readUnsignedExpGolomb()
54+
const picOrderCntType = this.reader.readUnsignedExpGolomb()
5555
if (picOrderCntType === 0) {
5656
// log2MaxPicOrderCntLsbMinus4
5757
this.reader.readUnsignedExpGolomb()
@@ -70,31 +70,31 @@ export class SPSParser {
7070
this.reader.readUnsignedExpGolomb()
7171
// gapsInFrameNumValueAllowedFlag
7272
this.reader.readBits(1)
73-
let picWidthInMbsMinus1 = this.reader.readUnsignedExpGolomb()
74-
let picHeightInMapUnitsMinus1 = this.reader.readUnsignedExpGolomb()
75-
let picFrameMbsOnlyFlag = this.reader.readBits(1)
73+
const picWidthInMbsMinus1 = this.reader.readUnsignedExpGolomb()
74+
const picHeightInMapUnitsMinus1 = this.reader.readUnsignedExpGolomb()
75+
const picFrameMbsOnlyFlag = this.reader.readBits(1)
7676
// direct8x8InferenceFlag
7777
this.reader.readBits(1)
78-
let frameCroppingFlag = this.reader.readBits(1)
78+
const frameCroppingFlag = this.reader.readBits(1)
7979

80-
let frameCropLeftOffset = frameCroppingFlag
80+
const frameCropLeftOffset = frameCroppingFlag
8181
? this.reader.readUnsignedExpGolomb()
8282
: 0
83-
let frameCropRightOffset = frameCroppingFlag
83+
const frameCropRightOffset = frameCroppingFlag
8484
? this.reader.readUnsignedExpGolomb()
8585
: 0
86-
let frameCropTopOffset = frameCroppingFlag
86+
const frameCropTopOffset = frameCroppingFlag
8787
? this.reader.readUnsignedExpGolomb()
8888
: 0
89-
let frameCropBottomOffset = frameCroppingFlag
89+
const frameCropBottomOffset = frameCroppingFlag
9090
? this.reader.readUnsignedExpGolomb()
9191
: 0
9292

93-
let w =
93+
const w =
9494
(picWidthInMbsMinus1 + 1) * 16 -
9595
frameCropLeftOffset * 2 -
9696
frameCropRightOffset * 2
97-
let h =
97+
const h =
9898
(2 - picFrameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 -
9999
frameCropTopOffset * 2 -
100100
frameCropBottomOffset * 2

lib/components/rtsp-parser/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const rtpPacketInfo = (chunks: Buffer[]): RtpPacketInfo => {
6060
*/
6161
export class Parser {
6262
private _chunks: Buffer[] = []
63-
private _length: number = 0
63+
private _length = 0
6464
private _state: STATE = STATE.IDLE
6565
private _packet?: RtpPacketInfo
6666

lib/utils/protocols/rtsp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const sessionTimeout = (buffer: Buffer) => {
4747
if (timeoutPosition !== -1) {
4848
let timeoutVal = val.substring(timeoutPosition + timeoutToken.length)
4949
timeoutVal = timeoutVal.split(';')[0]
50-
let parsedTimeout = parseInt(timeoutVal)
50+
const parsedTimeout = parseInt(timeoutVal)
5151
return isNaN(parsedTimeout) ? null : parsedTimeout
5252
}
5353
return null

0 commit comments

Comments
 (0)