Skip to content

Commit

Permalink
fix: info format should be string
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Jan 2, 2024
1 parent f2fa36e commit 2fe7529
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/connection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.mock('net')
const SocketMock = OrgSocket as any as typeof MockSocket
const PARSED_INFO_CHANNEL_720p50 = {
channel: 1,
format: 720,
format: '720p5000',
frameRate: 50,
channelRate: 50,
interlaced: false,
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/deserializers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('deserializers', () => {
expect(output[0]).toMatchObject(
literal<InfoEntry>({
channel: 1,
format: 720,
format: '720p5000',
channelRate: 50,
frameRate: 50,
interlaced: false,
Expand All @@ -116,7 +116,7 @@ describe('deserializers', () => {
expect(output[1]).toMatchObject(
literal<InfoEntry>({
channel: 2,
format: 1080,
format: '1080i5000',
channelRate: 50,
frameRate: 50,
interlaced: true,
Expand Down
2 changes: 1 addition & 1 deletion src/deserializers/deserializeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const deserializeInfo = (line: string): InfoEntry | undefined => {
if (info && info.groups) {
return {
channel: parseInt(info.groups.ChannelNo, 10),
format: parseInt(info.groups.Format, 10),
format: info.groups.Format,
channelRate: parseInt(info.groups.Channelrate || '', 10) / 100,
frameRate: parseInt(info.groups.Channelrate || '', 10) / 100,
interlaced: info.groups.Interlaced === 'i',
Expand Down
2 changes: 1 addition & 1 deletion src/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export interface VersionInfo {
export type InfoParameters = Empty
export interface InfoEntry {
channel: number
format: number
format: string
channelRate: number
frameRate: number
interlaced: boolean
Expand Down

0 comments on commit 2fe7529

Please sign in to comment.