Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Oct 28, 2024
1 parent 4f09533 commit 04012b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fixtures/input/example-0001.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ export const complexArrays = {
// }

// Type Assertions and Guards
// export function isUser(value: unknown): value is User {
// return (
// typeof value === 'object'
// && value !== null
// && 'id' in value
// && 'email' in value
// )
// }
export function isUser(value: unknown): value is User {
return (
typeof value === 'object'
&& value !== null
&& 'id' in value
&& 'email' in value
)
}

// Branded Types
export type UserId = string & { readonly __brand: unique symbol }
Expand Down
1 change: 1 addition & 0 deletions fixtures/output/example-0001.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export declare const complexArrays: {
matrix: Array<Array<1 | 2 | Array<3 | 4 | Array<5 | 6>>> | Array<'a' | 'b' | Array<'c' | 'd'>> | Array<true | Array<false | Array<true>>>>;
tuples: Array<Array<1 | 'string' | true> | Array<'literal' | 42 | false>>;
};
export declare function isUser(value: unknown): value is User;
export declare type UserId = string & { readonly __brand: unique symbol };
export declare type ProductId = number & {
readonly __brand: unique symbol
Expand Down

0 comments on commit 04012b7

Please sign in to comment.