Open jbistis opened 2 years ago
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
Yes, thanks. The update was to set "noImplicitReturns": false per https://stackoverflow.com/questions/51446242/how-to-fix-the-issue-not-all-the-code-paths-return-value
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 ); } } }