barracuda-client-api
Version:
API Client to connect to Barracuda Enterprise Service Bus
24 lines (23 loc) • 739 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.uuid4 = void 0;
const uuid_1 = require("uuid");
const react_native_uuid_1 = require("react-native-uuid");
const index_1 = require("../logging/index");
let custom_uuid = 0;
function uuid4() {
try {
return uuid_1.v4();
}
catch (e) {
index_1.logDebug("Error while generating uuid using uuid/v4. Trying react-native-uuid", e);
try {
return react_native_uuid_1.v4();
}
catch (e) {
index_1.logDebug("Error while generating uuid using react-native-uuid. Trying react-native-uuid", e);
return `BCjs-i${++custom_uuid}-${Date.now()}`;
}
}
}
exports.uuid4 = uuid4;