Created
August 17, 2020 03:44
-
-
Save bibhuticoder/cced3aa6ea35dafed82b7ddb96e192fc to your computer and use it in GitHub Desktop.
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
import { v1 as uuidv1 } from 'uuid'; | |
function uuid(identifier){ | |
return identifier + '-' + uuidv1(); | |
} | |
uuid('user'); // ⇨ 'user-9k1teb4d-5b7d-7b2d-9bdd-2b0d7b3dcb6d' | |
uuid('product'); // ⇨ 'product-6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment