bililive-cli 3.8.1 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chunked-exec-wqkoyRnJ.cjs +53 -0
- package/lib/fonts-DxTEygXH.cjs +35 -0
- package/lib/index-Ba32bNTL.cjs +247081 -0
- package/lib/index-DTf_Oo8U.cjs +81188 -0
- package/lib/index-Dkt7D2TB.cjs +47 -0
- package/lib/index.cjs +3839 -0
- package/lib/linux-v9dbfGoh.cjs +3362 -0
- package/lib/macos-Dd90ykMt.cjs +23 -0
- package/lib/windows-CJCw0QtL.cjs +16 -0
- package/package.json +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_util = require('node:util');
|
|
4
|
+
var require$$1 = require('node:child_process');
|
|
5
|
+
var require$$0 = require('node:url');
|
|
6
|
+
|
|
7
|
+
function chunkify(iterable, chunkSize) {
|
|
8
|
+
if (typeof iterable[Symbol.iterator] !== 'function') {
|
|
9
|
+
throw new TypeError('Expected an `Iterable` in the first argument');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (!(Number.isSafeInteger(chunkSize) && chunkSize > 0)) {
|
|
13
|
+
throw new TypeError(`Expected \`chunkSize\` to be an integer from 1 and up, got \`${chunkSize}\``);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
* [Symbol.iterator]() {
|
|
18
|
+
if (Array.isArray(iterable)) {
|
|
19
|
+
for (let index = 0; index < iterable.length; index += chunkSize) {
|
|
20
|
+
yield iterable.slice(index, index + chunkSize);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let chunk = [];
|
|
27
|
+
|
|
28
|
+
for (const value of iterable) {
|
|
29
|
+
chunk.push(value);
|
|
30
|
+
|
|
31
|
+
if (chunk.length === chunkSize) {
|
|
32
|
+
yield chunk;
|
|
33
|
+
chunk = [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (chunk.length > 0) {
|
|
38
|
+
yield chunk;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const pExecFile = node_util.promisify(require$$1.execFile);
|
|
45
|
+
|
|
46
|
+
async function chunkedExec(binary, paths, maxPaths) {
|
|
47
|
+
for (const chunk of chunkify(paths, maxPaths)) {
|
|
48
|
+
// eslint-disable-next-line no-await-in-loop
|
|
49
|
+
await pExecFile(require$$0.fileURLToPath(binary).replace("app.asar", "app.asar.unpacked"), chunk);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.chunkedExec = chunkedExec;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var font = require('font-ls');
|
|
4
|
+
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
/**
|
|
7
|
+
* 判断字符串是否全部为 ASCII 字符
|
|
8
|
+
* @param str 要检查的字符串
|
|
9
|
+
* @returns 如果字符串全部为 ASCII 字符,则返回 true;否则返回 false
|
|
10
|
+
*/
|
|
11
|
+
function isAscii(str) {
|
|
12
|
+
// eslint-disable-next-line no-control-regex
|
|
13
|
+
return /^[\x00-\x7F]*$/.test(str);
|
|
14
|
+
}
|
|
15
|
+
async function getFontsList() {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
const fonts = await font.getAvailableFonts();
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
return fonts.map((font) => {
|
|
20
|
+
if (isAscii(font.postscriptName)) {
|
|
21
|
+
return {
|
|
22
|
+
postscriptName: font.postscriptName,
|
|
23
|
+
fullName: font.localizedName,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return {
|
|
28
|
+
postscriptName: font.enName,
|
|
29
|
+
fullName: font.localizedName,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.getFontsList = getFontsList;
|