initial commit

This commit is contained in:
Zoe
2023-01-03 09:29:04 -06:00
commit 7851137d88
12889 changed files with 2557443 additions and 0 deletions

63
node_modules/clipboardy/lib/linux.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import execa from 'execa';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const xsel = 'xsel';
const xselFallback = path.join(__dirname, '../fallbacks/linux/xsel');
const copyArguments = ['--clipboard', '--input'];
const pasteArguments = ['--clipboard', '--output'];
const makeError = (xselError, fallbackError) => {
let error;
if (xselError.code === 'ENOENT') {
error = new Error('Couldn\'t find the `xsel` binary and fallback didn\'t work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel');
} else {
error = new Error('Both xsel and fallback failed');
error.xselError = xselError;
}
error.fallbackError = fallbackError;
return error;
};
const xselWithFallback = async (argumentList, options) => {
try {
const {stdout} = await execa(xsel, argumentList, options);
return stdout;
} catch (xselError) {
try {
const {stdout} = await execa(xselFallback, argumentList, options);
return stdout;
} catch (fallbackError) {
throw makeError(xselError, fallbackError);
}
}
};
const xselWithFallbackSync = (argumentList, options) => {
try {
return execa.sync(xsel, argumentList, options).stdout;
} catch (xselError) {
try {
return execa.sync(xselFallback, argumentList, options).stdout;
} catch (fallbackError) {
throw makeError(xselError, fallbackError);
}
}
};
const clipboard = {
copy: async options => {
await xselWithFallback(copyArguments, options);
},
copySync: options => {
xselWithFallbackSync(copyArguments, options);
},
paste: options => xselWithFallback(pasteArguments, options),
pasteSync: options => xselWithFallbackSync(pasteArguments, options),
};
export default clipboard;

17
node_modules/clipboardy/lib/macos.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import execa from 'execa';
const env = {
LC_CTYPE: 'UTF-8',
};
const clipboard = {
copy: async options => execa('pbcopy', {...options, env}),
paste: async options => {
const {stdout} = await execa('pbpaste', {...options, env});
return stdout;
},
copySync: options => execa.sync('pbcopy', {...options, env}),
pasteSync: options => execa.sync('pbpaste', {...options, env}).stdout,
};
export default clipboard;

43
node_modules/clipboardy/lib/termux.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
import execa 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 = {
copy: async options => {
try {
await execa('termux-clipboard-set', options);
} catch (error) {
handler(error);
}
},
paste: async options => {
try {
const {stdout} = await execa('termux-clipboard-get', options);
return stdout;
} catch (error) {
handler(error);
}
},
copySync: options => {
try {
execa.sync('termux-clipboard-set', options);
} catch (error) {
handler(error);
}
},
pasteSync: options => {
try {
return execa.sync('termux-clipboard-get', options).stdout;
} catch (error) {
handler(error);
}
},
};
export default clipboard;

23
node_modules/clipboardy/lib/windows.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import execa from 'execa';
import arch from 'arch';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const binarySuffix = arch() === 'x64' ? 'x86_64' : 'i686';
// Binaries from: https://github.com/sindresorhus/win-clipboard
const windowBinaryPath = path.join(__dirname, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
const clipboard = {
copy: async options => execa(windowBinaryPath, ['--copy'], options),
paste: async options => {
const {stdout} = await execa(windowBinaryPath, ['--paste'], options);
return stdout;
},
copySync: options => execa.sync(windowBinaryPath, ['--copy'], options),
pasteSync: options => execa.sync(windowBinaryPath, ['--paste'], options).stdout,
};
export default clipboard;