Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node: Add RouterDump and DirectTransportDump types #1195

Merged
merged 6 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions node/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const eslintConfig =
}
],
'space-in-parens' : [ 2, 'never' ],
'space-infix-ops' : [ 2, { 'int32Hint': false } ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I'm adding it in other projects.

'spaced-comment' : [ 2, 'always' ],
'strict' : 2,
'valid-typeof' : 2,
Expand Down
6 changes: 3 additions & 3 deletions node/src/RtpParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export function serializeRtpParameters(

const rtcpFeedback: number[] = [];

for (const rtcp of codec.rtcpFeedback?? [])
for (const rtcp of codec.rtcpFeedback ?? [])
{
const typeOffset = builder.createString(rtcp.type);
const rtcpParametersOffset = builder.createString(rtcp.parameter);
Expand Down Expand Up @@ -575,7 +575,7 @@ export function serializeParameters(
if (typeof value === 'boolean')
{
parameterOffset = FbsParameter.createParameter(
builder, keyOffset, FbsValue.Boolean, value === true ? 1:0
builder, keyOffset, FbsValue.Boolean, value === true ? 1 : 0
);
}
else if (typeof value === 'number')
Expand Down Expand Up @@ -638,7 +638,7 @@ export function parseParameters(data: any): any
{
const parameters: any = {};

for (let i=0; i<data.parametersLength(); i++)
for (let i = 0; i < data.parametersLength(); i++)
{
const fbsParameter = data.parameters(i)!;

Expand Down
4 changes: 2 additions & 2 deletions node/src/WebRtcTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ function parseDtlsParameters(binary: FbsWebRtcTransport.DtlsParameters): DtlsPar
{
const fingerprints: DtlsFingerprint[] = [];

for (let i=0; i<binary.fingerprintsLength(); ++i)
for (let i = 0; i < binary.fingerprintsLength(); ++i)
{
const fbsFingerprint = binary.fingerprints(i)!;
const fingerPrint : DtlsFingerprint =
Expand All @@ -878,7 +878,7 @@ function parseDtlsParameters(binary: FbsWebRtcTransport.DtlsParameters): DtlsPar

return {
fingerprints : fingerprints,
role : binary.role() === null? undefined : dtlsRoleFromFbs(binary.role()!)
role : binary.role() === null ? undefined : dtlsRoleFromFbs(binary.role()!)
};
}

Expand Down
2 changes: 1 addition & 1 deletion node/src/ortc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ export function getConsumerRtpParameters(
}

// Must sanitize the list of matched codecs by removing useless RTX codecs.
for (let idx = consumerParams.codecs.length -1; idx >= 0; --idx)
for (let idx = consumerParams.codecs.length - 1; idx >= 0; --idx)
{
const codec = consumerParams.codecs[idx];

Expand Down
14 changes: 7 additions & 7 deletions node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function parseVector<Type>(
{
const array: Type[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
if (parseFn)
{
Expand All @@ -100,7 +100,7 @@ export function parseStringStringVector(
{
const array: { key: string; value: string }[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
const kv = binary[methodName](i)!;

Expand All @@ -119,7 +119,7 @@ export function parseStringUint8Vector(
{
const array: {key: string; value: number}[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
const kv = binary[methodName](i)!;

Expand All @@ -138,7 +138,7 @@ export function parseUint16StringVector(
{
const array: { key: number; value: string }[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
const kv = binary[methodName](i)!;

Expand All @@ -157,7 +157,7 @@ export function parseUint32StringVector(
{
const array: { key: number; value: string }[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
const kv = binary[methodName](i)!;

Expand All @@ -176,12 +176,12 @@ export function parseStringStringArrayVector(
{
const array: { key: string; values: string[] }[] = [];

for (let i=0; i<binary[`${methodName}Length`](); ++i)
for (let i = 0; i < binary[`${methodName}Length`](); ++i)
{
const kv = binary[methodName](i)!;
const values: string[] = [];

for (let i2=0; i2<kv.valuesLength(); ++ i2)
for (let i2 = 0; i2 < kv.valuesLength(); ++i2)
{
values.push(kv.values(i2)!);
}
Expand Down
Loading