UNPKG

barracuda-client-api

Version:

API Client to connect to Barracuda Enterprise Service Bus

20 lines (17 loc) 534 B
import { v4 } from "uuid"; import { v4 as rn_uuid } from "react-native-uuid"; import { logDebug } from "../logging/index"; let custom_uuid: number = 0; export function uuid4(): string { try { return v4(); } catch (e) { logDebug("Error while generating uuid using uuid/v4. Trying react-native-uuid", e); try { return rn_uuid(); } catch (e) { logDebug("Error while generating uuid using react-native-uuid. Trying react-native-uuid", e); return `BCjs-i${++custom_uuid}-${Date.now()}`; } } }