Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async _getEndpointId(cacheKey) {
// try to get from cache
let endpointId = await Cache.getItem(cacheKey);
logger.debug(
'endpointId from cache',
endpointId,
'type',
typeof endpointId
);
if (!endpointId) {
endpointId = uuid();
Cache.setItem(cacheKey, endpointId);
}
return endpointId;
}