You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @jbistis,
this sounds like an issue caused by your linter. Can you share what linter you're using (e.g. ESLint) and if you have applied any specific rules (e.g. 'consistent-return')?
Thanks
angular/cli 13.1.2 / typescript 4.5.4 / ngx-webcam 0.4.1
Getting 2 errors:
webcam.component.ts:151:6 - error TS7030: Not all code paths return a value.
private static getDeviceIdFromMediaStreamTrack( mediaStreamTrack: MediaStreamTrack ): string { if ( mediaStreamTrack.getSettings && mediaStreamTrack.getSettings() && mediaStreamTrack.getSettings().deviceId ) { return mediaStreamTrack.getSettings().deviceId; } else if ( mediaStreamTrack.getConstraints && mediaStreamTrack.getConstraints() && mediaStreamTrack.getConstraints().deviceId ) { const deviceIdObj: ConstrainDOMString = mediaStreamTrack.getConstraints().deviceId; return WebcamComponent.getValueFromConstrainDOMString(deviceIdObj); } }
webcam.component.ts:178:6 - error TS7030: Not all code paths return a value.
private static getFacingModeFromMediaStreamTrack(
mediaStreamTrack: MediaStreamTrack
): string {
if (mediaStreamTrack) {
if (
mediaStreamTrack.getSettings &&
mediaStreamTrack.getSettings() &&
mediaStreamTrack.getSettings().facingMode
) {
return mediaStreamTrack.getSettings().facingMode;
} else if (
mediaStreamTrack.getConstraints &&
mediaStreamTrack.getConstraints() &&
mediaStreamTrack.getConstraints().facingMode
) {
const facingModeConstraint: ConstrainDOMString =
mediaStreamTrack.getConstraints().facingMode;
return WebcamComponent.getValueFromConstrainDOMString(
facingModeConstraint
);
}
}
}
The text was updated successfully, but these errors were encountered: