From f0286b0101b31d313c271fa3c4dc381625f9f379 Mon Sep 17 00:00:00 2001 From: vrknetha Date: Sun, 8 Dec 2024 14:56:07 +0530 Subject: [PATCH] fixes lint issues --- src/clipboard.ts | 4 ++-- src/utils.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/clipboard.ts b/src/clipboard.ts index d028859..32a66c9 100644 --- a/src/clipboard.ts +++ b/src/clipboard.ts @@ -8,7 +8,7 @@ import { pasteRichText, cutRichText, getClipboardContent, - setClipboardContent + setClipboardContent, } from './utils'; export class PlaywrightClipboard { @@ -253,4 +253,4 @@ export class PlaywrightClipboard { throw new Error(ClipboardError.WORD_BOUNDARY_ERROR); } } -} \ No newline at end of file +} diff --git a/src/utils.ts b/src/utils.ts index 693ee3e..fe1f563 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -167,19 +167,19 @@ export async function getClipboardContent(page: Page): Promise { temp.style.opacity = '0'; document.body.appendChild(temp); }); - + const modifierKey = process.platform === 'darwin' ? 'Meta' : 'Control'; await page.focus(tempSelector); await page.keyboard.press(`${modifierKey}+V`); await page.waitForTimeout(100); - + const text = await page.inputValue(tempSelector); - + await page.evaluate(() => { const temp = document.querySelector('#__clipboard_temp__'); if (temp) temp.remove(); }); - + return text; } } catch (error) { @@ -205,14 +205,14 @@ export async function setClipboardContent(page: Page, text: string): Promise { const temp = document.querySelector('#__clipboard_temp__'); if (temp) temp.remove(); @@ -221,4 +221,4 @@ export async function setClipboardContent(page: Page, text: string): Promise