Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
43
Frontend-Learner/node_modules/clipboardy/lib/termux.js
generated
vendored
Normal file
43
Frontend-Learner/node_modules/clipboardy/lib/termux.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import {execa, execaSync} from 'execa';
|
||||
|
||||
const handler = error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
throw new Error('Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api');
|
||||
}
|
||||
|
||||
throw error;
|
||||
};
|
||||
|
||||
const clipboard = {
|
||||
async copy(options) {
|
||||
try {
|
||||
await execa('termux-clipboard-set', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
async paste(options) {
|
||||
try {
|
||||
const {stdout} = await execa('termux-clipboard-get', options);
|
||||
return stdout;
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
copySync(options) {
|
||||
try {
|
||||
execaSync('termux-clipboard-set', options);
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
pasteSync(options) {
|
||||
try {
|
||||
return execaSync('termux-clipboard-get', options).stdout;
|
||||
} catch (error) {
|
||||
handler(error);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default clipboard;
|
||||
Loading…
Add table
Add a link
Reference in a new issue