Created
May 6, 2020 20:02
-
-
Save aloverso/a54dd3c534bd0cbaa22c25a1d85fb47d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 User { | |
| name: String, | |
| password: String | |
| } | |
| const random = (): number => { | |
| return Math.floor(Math.random() * Math.floor(10000000)); | |
| }; | |
| export const buildDefaultUser = (partial: Partial<User>): User => { | |
| return { | |
| name: 'some-username-' + random(), | |
| password: 'some-password-' + random(), | |
| ...partial | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment