Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // from this
  2.  
  3. type SavedPlaylistItem = {
  4. id: string,
  5. checksum: number,
  6. };
  7.  
  8. // generate this
  9.  
  10. function getSavedPlaylistItem(payload: Object): ?SavedPlaylistItem {
  11. if (
  12. typeof payload.id === 'string' &&
  13. typeof payload.checksum === 'number'
  14. ) {
  15. return {
  16. id: payload.id,
  17. checksum: payload.checksum,
  18. };
  19. }
  20. return null;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement