Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getCopyrightCoverageData(): Promise {
if (this.m_cachedCopyrightResponse !== undefined) {
return this.m_cachedCopyrightResponse;
}
const hrn = HRN.fromString(this.m_params.hrn);
const context = new DataStoreContext({
getToken: this.m_params.getToken,
environment: hrn.data.partition
});
const catalogClient = new CatalogClient({
context,
hrn: this.m_params.hrn
});
this.m_cachedCopyrightResponse = catalogClient
.getVolatileOrVersionedLayer(this.m_params.layer || DEFAULT_LAYER)
.then()
.then(layer => layer.getPartition(this.m_params.partition || DEFAULT_PARTITION))
.then(response => response.json())
.then(json => json[this.m_params.baseScheme || "normal"])
.catch(error => {
this.logger.error(error);