Skip to content

Commit

Permalink
doc: update example
Browse files Browse the repository at this point in the history
  • Loading branch information
som-sm committed Jan 2, 2025
1 parent b7441e9 commit 723173f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/internal/array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ An if-else-like type that resolves depending on whether the given array is reado
@example
```
type ShouldBeTrue = IfArrayReadonly<readonly unknown[]>;
//=> true
type ShouldBeBar = IfArrayReadonly<unknown[], 'foo', 'bar'>;
//=> 'bar'
import type {ArrayTail} from 'type-fest';
type ReadonlyPreservingArrayTail<TArray extends readonly unknown[]> =
Expand All @@ -118,6 +112,12 @@ type ReadonlyTail = ReadonlyPreservingArrayTail<readonly [string, number, boolea
type NonReadonlyTail = ReadonlyPreservingArrayTail<[string, number, boolean]>;
//=> [number, boolean]
type ShouldBeTrue = IfArrayReadonly<readonly unknown[]>;
//=> true
type ShouldBeBar = IfArrayReadonly<unknown[], 'foo', 'bar'>;
//=> 'bar'
```
*/
export type IfArrayReadonly<T extends UnknownArray, TypeIfArrayReadonly = true, TypeIfNotArrayReadonly = false> =
Expand Down

0 comments on commit 723173f

Please sign in to comment.