silverwolf-x/project / packages /next /src /shared /lib /deep-readonly.ts
silverwolf-x's picture
download
raw
409 Bytes
/**
* A type that represents a deeply readonly object. This is similar to
* TypeScript's `Readonly` type, but it recursively applies the `readonly`
* modifier to all properties of an object and all elements of arrays.
*/
export type DeepReadonly<T> = T extends (infer R)[]
? ReadonlyArray<DeepReadonly<R>>
: T extends object
? {
readonly [K in keyof T]: DeepReadonly<T[K]>
}
: T

Xet Storage Details

Size:
409 Bytes
·
Xet hash:
701fdb209110b89bdf038fea0e1c9894584ed2e2526c8beab8f3a1675de239d7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.