Skip to content

Commit

Permalink
Add number assertions to shutup typescript being unnecessarily zealous
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Feb 23, 2023
1 parent 94ccf75 commit c36226b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/features/initialize_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ export default function initializeFeaturesObject() : void {
}

// Feature switching the Native TextTrack implementation
const HAS_NATIVE_MODE = __FEATURES__.NATIVE_VTT === __FEATURES__.IS_ENABLED ||
__FEATURES__.NATIVE_SAMI === __FEATURES__.IS_ENABLED ||
__FEATURES__.NATIVE_TTML === __FEATURES__.IS_ENABLED ||
__FEATURES__.NATIVE_SRT === __FEATURES__.IS_ENABLED;
const HAS_NATIVE_MODE =
__FEATURES__.NATIVE_VTT === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.NATIVE_SAMI === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.NATIVE_TTML === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.NATIVE_SRT === __FEATURES__.IS_ENABLED as number;

if (__FEATURES__.SMOOTH === __FEATURES__.IS_ENABLED as number) {
features.transports.smooth = require("../transports/smooth/index.ts").default;
Expand Down Expand Up @@ -86,10 +87,11 @@ export default function initializeFeaturesObject() : void {
}

// Feature switching the HTML TextTrack implementation
const HAS_HTML_MODE = __FEATURES__.HTML_VTT === __FEATURES__.IS_ENABLED ||
__FEATURES__.HTML_SAMI === __FEATURES__.IS_ENABLED ||
__FEATURES__.HTML_TTML === __FEATURES__.IS_ENABLED ||
__FEATURES__.HTML_SRT === __FEATURES__.IS_ENABLED;
const HAS_HTML_MODE =
__FEATURES__.HTML_VTT === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.HTML_SAMI === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.HTML_TTML === __FEATURES__.IS_ENABLED as number ||
__FEATURES__.HTML_SRT === __FEATURES__.IS_ENABLED as number;

if (HAS_HTML_MODE) {
features.htmlTextTracksBuffer =
Expand Down

0 comments on commit c36226b

Please sign in to comment.