UNPKG

bitmovin-player-react-native-analytics-conviva

Version:
26 lines 775 B
// Simple UUID v4 generator for native ID generation function uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { const r = (Math.random() * 16) | 0; const v = c === 'x' ? r : (r & 0x3) | 0x8; return v.toString(16); }); } export default class NativeInstance { /** * Optionally user-defined string `id` for the native instance, or UUIDv4. */ nativeId; /** * The configuration object used to initialize this instance. */ config; /** * Generate UUID in case the user-defined `nativeId` is empty. */ constructor(config) { this.config = config; this.nativeId = config?.nativeId ?? uuidv4(); } } //# sourceMappingURL=nativeInstance.js.map