jean
02/04/2023, 10:42 PMuuid
npm package but I get the error TypeError: v4 is not a function
This is my code :
@JsModule("uuid")
@JsNonModule
@JsName("v4")
external fun jsUuid(): String
actual fun uuid() = Id(v4())
This is the npm doc
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
What should I change to make it work? I did read this https://kotlinlang.slack.com/archives/C0B8L3U69/p1646004687047799 but didn’t get it to work still.turansky
02/04/2023, 10:58 PM@file:JsModule("uuid")
@file:JsNonModule
@JsName("v4")
external fun uuidv4(): String
jean
02/05/2023, 6:23 AMArjan van Wieringen
02/05/2023, 9:13 AM