File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,14 +367,14 @@ export const complexArrays = {
367367// }
368368
369369// Type Assertions and Guards
370- // export function isUser(value: unknown): value is User {
371- // return (
372- // typeof value === 'object'
373- // && value !== null
374- // && 'id' in value
375- // && 'email' in value
376- // )
377- // }
370+ export function isUser ( value : unknown ) : value is User {
371+ return (
372+ typeof value === 'object'
373+ && value !== null
374+ && 'id' in value
375+ && 'email' in value
376+ )
377+ }
378378
379379// Branded Types
380380export type UserId = string & { readonly __brand : unique symbol }
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ export declare const complexArrays: {
133133 matrix : Array < Array < 1 | 2 | Array < 3 | 4 | Array < 5 | 6 > > > | Array < 'a' | 'b' | Array < 'c' | 'd' > > | Array < true | Array < false | Array < true > > > > ;
134134 tuples : Array < Array < 1 | 'string' | true > | Array < 'literal' | 42 | false > > ;
135135} ;
136+ export declare function isUser ( value : unknown ) : value is User ;
136137export declare type UserId = string & { readonly __brand : unique symbol } ;
137138export declare type ProductId = number & {
138139 readonly __brand : unique symbol
You can’t perform that action at this time.
0 commit comments