Last active
September 16, 2019 21:03
-
-
Save john-osullivan/f675f2d3f771061d6c4ff5694e2e26f4 to your computer and use it in GitHub Desktop.
Dev Diaries #2 - Types Naming Convention
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface SomeData { | |
foo: string | |
bar: string | |
} | |
export function newSomeData(): SomeData { | |
return { | |
foo: 'example', | |
bar: 'object' | |
} | |
} | |
export function isSomeData(val:any): val is SomeData { | |
const SomeDataKeys = Object.keys(newSomeData()); | |
return keysAreStrings(val, SomeDataKeys); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment