Merge branch 'main' into metadata

This commit is contained in:
Vanilagy
2025-09-03 21:12:16 +02:00
73 changed files with 10138 additions and 3072 deletions
+8
View File
@@ -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;
};