import type PageOptions from '../types/PageOptions'; import getPage from './getPage'; /** * Check if a selector exists now in the DOM * @param {string} selector The selector to check. * @param {PageOptions} options * @returns {Promise} If the selector exists in the DOM. */ export default async function existsNow(selector: string, options?: PageOptions) { const page = getPage(options); return (await page.$(selector)) !== null; }