Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await driver.findElement(By.css('.export-private-key__button')).click()
await delay(300)
await captureLanguageScreenShots('metamask account detail export private key screen - done')
// get eth from Ganache
// const viewAddressButton = await driver.findElement(By.css('.wallet-view__address'))
// await driver.actions({ bridge: true }).move({ origin: viewAddressButton }).perform()
// console.log('driver.actions', driver.actions({ bridge: true }))
// await delay(300)
// await captureLanguageScreenShots('metamask home - hover copy address')
await driver.findElement(By.css('.wallet-view__address')).click()
await delay(100)
await captureLanguageScreenShots('metamask home - hover copy address')
const primaryAddress = clipboardy.readSync()
await requestEther(primaryAddress)
// wait for block polling
await delay(10000)
await captureLanguageScreenShots('metamask home - has ether')
}
fs.statSync(this.memodir);
} catch(err) {
// console.log(err);
vscode.window.showErrorMessage(localize('memodirAccessCheck', 'The directory set in memodir does not exist'));
return;
}
// vscode 上選択されているテキストを取得
if (this.memoNewFilenameFromSelection == true) {
selectString = editor.document.getText(editor.selection);
}
// vscde 上で何も選択されていない (= 0) 場合は、clipboard を参照する
if (this.memoNewFilenameFromClipboard == true) {
if (selectString.length == 0) {
selectString = clipboardy.readSync();
}
}
// console.log('selectString =', selectString);
let fileNameDateFormat: string = dateFns.format(new Date(), 'YYYY-MM-DD');
let filNameDateSuffix: string = "";
if (this.memoNewFilNameDateSuffix !== "") {
filNameDateSuffix = dateFns.format(new Date(), this.memoNewFilNameDateSuffix);
}
vscode.window.showInputBox({
placeHolder: localize('enterFilename', 'Please Enter a Filename (default: {0}.md)', fileNameDateFormat + filNameDateSuffix),
// prompt: "",
value: `${selectString.substr(0,49)}`,
prepareButton.click()
await page.waitForAngular()
await page.takeScreenshot(`interaction-${account.symbol}`)
const offlineButton = element(by.css('#offline'))
offlineButton.click()
await page.waitForAngular()
await page.takeScreenshot(`qr-${account.symbol}`)
const qrCode = element(by.css('#qr'))
qrCode.click()
await page.waitForAngular()
const preparedTxClipboard = clipboardy.readSync()
// expect(preparedTxClipboard).toEqual(account.preparedTx)
const doneButton = element(by.css('#done'))
doneButton.click()
await page.waitForAngular()
await mainWallet.click()
await page.waitForAngular()
const buttonPopover = element(by.css('#edit-popover'))
await buttonPopover.click()
await page.waitForAngular()
await page.takeScreenshot(`tx-detail-popover-${account.symbol}`)
const buttonDelete = element(by.css('#delete'))
async getText(): Promise {
const workbench = new Workbench();
await workbench.executeCommand('terminal select all');
await workbench.getDriver().sleep(500);
await workbench.executeCommand('terminal copy selection');
await workbench.getDriver().sleep(500);
const text = clipboard.readSync();
clipboard.writeSync('');
return text;
}
async getText(): Promise {
const textarea = await this.findElement(ChannelView.locators.BottomBarViews.textArea);
await textarea.sendKeys(Key.chord(TextView.ctlKey, 'a'));
await textarea.sendKeys(Key.chord(TextView.ctlKey, 'c'));
const text = clipboard.readSync();
await textarea.click();
clipboard.writeSync('');
return text;
}
import * as clipboardy from 'clipboardy'
const rows = clipboardy.readSync();
const transformed = rows.split('\n')
.map(row => {
const cells = row.split('\t').map(cell => (cell || '').replace(/\n/g, ' ').trim());
return ` /** ${cells[1]} */\n ${cells[0].replace(/^.*\./g, '')}`;
})
.join('\n');
clipboardy.writeSync(transformed);
console.log(transformed);
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const getStdin = require('get-stdin');
const clipboardy = require('clipboardy');
meow(`
Example
$ echo 🦄 | clipboard
$ clipboard
🦄
`);
if (process.stdin.isTTY || process.env.STDIN === '0') {
console.log(clipboardy.readSync());
} else {
(async () => {
clipboardy.writeSync(await getStdin());
})();
}
execute() {
let text = clip.readSync().trim();
if (!text) return;
let tableText = convertToMarkdownTable(text);
if (!tableText) return;
let editor = vscode.window.activeTextEditor;
return editTextDocument(
editor.document, [{
range: editor.selection,
replace: tableText
}]
);
}
constructor() {
const events = niceTry(() => {
const clipboardContents = clipboardy.readSync()
const parsedJson = JSON.parse(clipboardContents)
if (Array.isArray(parsedJson) && parsedJson.every(i => typeof i === 'object')) {
return parsedJson
}
})
if (!events) {
return new Promise(async (resolve, reject) => {
if (FILE) {
resolve(await readFileAsync(FILE, 'utf8'));
} else if (FROM_CLIPBOARD) {
resolve(clipboardy.readSync());
} else {
const STDIN = await getStdin();
if (STDIN) {
resolve(STDIN);
} else {
reject(new Error('No file or stdin given.'));
}
}
});
};