mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Merge branch 'main' into metadata
This commit is contained in:
@@ -14,6 +14,7 @@ export function assert(x: unknown): asserts x {
|
||||
|
||||
/**
|
||||
* Represents a clockwise rotation in degrees.
|
||||
* @group Miscellaneous
|
||||
* @public
|
||||
*/
|
||||
export type Rotation = 0 | 90 | 180 | 270;
|
||||
@@ -366,6 +367,7 @@ export const findLastIndex = <T>(arr: T[], predicate: (x: T) => boolean) => {
|
||||
|
||||
/**
|
||||
* Sync or async iterable.
|
||||
* @group Miscellaneous
|
||||
* @public
|
||||
*/
|
||||
export type AnyIterable<T> =
|
||||
@@ -512,6 +514,7 @@ export const SECOND_TO_MICROSECOND_FACTOR = 1e6 * (1 + Number.EPSILON);
|
||||
|
||||
/**
|
||||
* Sets all keys K of T to be required.
|
||||
* @group Miscellaneous
|
||||
* @public
|
||||
*/
|
||||
export type SetRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
||||
@@ -641,6 +644,7 @@ export const isSafari = () => {
|
||||
|
||||
/**
|
||||
* T or a promise that resolves to T.
|
||||
* @group Miscellaneous
|
||||
* @public
|
||||
*/
|
||||
export type MaybePromise<T> = T | Promise<T>;
|
||||
@@ -649,3 +653,7 @@ export type MaybePromise<T> = T | Promise<T>;
|
||||
export const coalesceIndex = (a: number, b: number) => {
|
||||
return a !== -1 ? a : b;
|
||||
};
|
||||
|
||||
export const closedIntervalsOverlap = (startA: number, endA: number, startB: number, endB: number) => {
|
||||
return startA <= endB && startB <= endA;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user