Skip to content

Instantly share code, notes, and snippets.

@john-osullivan
Last active September 16, 2019 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john-osullivan/f675f2d3f771061d6c4ff5694e2e26f4 to your computer and use it in GitHub Desktop.
Save john-osullivan/f675f2d3f771061d6c4ff5694e2e26f4 to your computer and use it in GitHub Desktop.
Dev Diaries #2 - Types Naming Convention
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