Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch committed Mar 9, 2024
1 parent 492f86d commit 66d4df3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type {Component, RefObject, ComponentClass} from 'react';
import {Image, findNodeHandle} from 'react-native';
import {Image, findNodeHandle, type ImageSourcePropType} from 'react-native';
import type {ReactVideoSource, ReactVideoSourceProperties} from './types/video';


// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function generateHeaderForNative(obj?: Record<string, any>) {
if (!obj) {
Expand All @@ -12,8 +11,9 @@ export function generateHeaderForNative(obj?: Record<string, any>) {
}

type Source = ImageSourcePropType | ReactVideoSource;

export function resolveAssetSourceForVideo(
source: ReactVideoSource,
source: Source,
): ReactVideoSourceProperties {
// This is deprecated, but we need to support it for backward compatibility
if (typeof source === 'number') {
Expand All @@ -22,7 +22,7 @@ export function resolveAssetSourceForVideo(
};
}

if (typeof source.uri === 'number') {
if ('uri' in source && typeof source.uri === 'number') {
return {
...source,
uri: Image.resolveAssetSource(source.uri).uri,
Expand Down

0 comments on commit 66d4df3

Please sign in to comment.