Skip to content

Commit

Permalink
chore: hasCodec
Browse files Browse the repository at this point in the history
  • Loading branch information
tsi committed Mar 20, 2024
1 parent f011cb8 commit ec6d674
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function normalizeFormat(format) {
return res;
}

const isContainCodec = value =>
const hasCodec = value =>
value && some(Object.values(VIDEO_CODEC), codec => value.includes(codec));

const hasCodecSrcTrans = transformations =>
Expand All @@ -44,12 +44,12 @@ export const isCodecAlreadyExist = (transformations, rawTransformation) => {
}

if (isString(rawTransformation)) {
return isContainCodec(rawTransformation);
return hasCodec(rawTransformation);
}

return some(transformations, transformation => {
return some(transformation, item =>
isContainCodec(isPlainObject(item) ? item.video_codec : item)
hasCodec(isPlainObject(item) ? item.video_codec : item)
);
});
};

0 comments on commit ec6d674

Please sign in to comment.