Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve) => {
const slide: HTMLElement = this.el.querySelector('.deckgo-slide-container:nth-child(' + (index + 1) + ')');
const definition: DeckdeckgoSlideDefinition | null = await getSlideDefinition(slide);
resolve(definition);
});
}
return new Promise(async (resolve) => {
if (!slide) {
resolve();
return;
}
const deck: HTMLElement = self.el.querySelector('deckgo-deck');
if (!deck || !deck.hasChildNodes()) {
resolve();
return;
}
const index = Array.prototype.indexOf.call(deck.children, slide);
const slideDefinition: DeckdeckgoSlideDefinition | null = await getSlideDefinition(slide);
await self.updateSlideDefinition(self, slideDefinition, index);
resolve();
});
}