utilitas 1998.2.52 → 1998.2.54
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/README.md +1 -2
- package/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/manifest.mjs +1 -2
- package/lib/tape.mjs +6 -5
- package/lib/web.mjs +1 -10
- package/package.json +1 -2
package/lib/manifest.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const manifest = {
|
|
2
2
|
"name": "utilitas",
|
|
3
3
|
"description": "Just another common utility for JavaScript.",
|
|
4
|
-
"version": "1998.2.
|
|
4
|
+
"version": "1998.2.54",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -34,7 +34,6 @@ const manifest = {
|
|
|
34
34
|
"@google-cloud/vision": "^4.3.3",
|
|
35
35
|
"@google/generative-ai": "^0.24.0",
|
|
36
36
|
"@mozilla/readability": "github:mozilla/readability",
|
|
37
|
-
"@ngrok/ngrok": "^1.4.1",
|
|
38
37
|
"@sentry/node": "^9.5.0",
|
|
39
38
|
"@sentry/profiling-node": "^9.5.0",
|
|
40
39
|
"acme-client": "^5.4.0",
|
package/lib/tape.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
log as _log,
|
|
3
|
+
ensureArray, ensureInt, ensureString, insensitiveCompare,
|
|
3
4
|
renderCode,
|
|
4
5
|
} from './utilitas.mjs';
|
|
5
6
|
|
|
7
|
+
import { MESSAGE_SOFT_LIMIT, sendMd } from './bot.mjs';
|
|
8
|
+
import { isPrimary, on, report } from './callosum.mjs';
|
|
6
9
|
import { default as color } from './color.mjs';
|
|
7
10
|
import { end as _end, loop } from './event.mjs';
|
|
8
|
-
import { isPrimary, on, report } from './callosum.mjs';
|
|
9
|
-
import { MESSAGE_SOFT_LIMIT, sendMd } from './bot.mjs';
|
|
10
11
|
|
|
11
12
|
const consoleMap = ['log', 'info', 'debug', 'warn', 'error'];
|
|
12
13
|
const trace = { trace: true };
|
|
@@ -18,7 +19,7 @@ const getSndSize = arr => getSendTxt(arr).length;
|
|
|
18
19
|
const getBufSize = () => MESSAGE_SOFT_LIMIT * bufferCycle;
|
|
19
20
|
const nextEvent = () => botBuffer?.[0];
|
|
20
21
|
const stringify = any => ensureString(any, trace);
|
|
21
|
-
const packLine = text => `\`\`\`Log\n${text || ''}\n\`\`\``;
|
|
22
|
+
const packLine = text => `\`\`\`Log\n${(text || '').replaceAll('```', '\\`\\`\\`')}\n\`\`\``;
|
|
22
23
|
const AVAILABLE_LENGTH = MESSAGE_SOFT_LIMIT - (packLine('') + '000 | ').length;
|
|
23
24
|
|
|
24
25
|
let botBuffer, bufferCycle, chatIds, extLog, tarLevel;
|
|
@@ -130,5 +131,5 @@ export {
|
|
|
130
131
|
addChatId,
|
|
131
132
|
end,
|
|
132
133
|
init,
|
|
133
|
-
removeChatId
|
|
134
|
+
removeChatId
|
|
134
135
|
};
|
package/lib/web.mjs
CHANGED
|
@@ -2,9 +2,7 @@ import { getJson, getParsedHtml } from './shot.mjs';
|
|
|
2
2
|
import { convert } from './storage.mjs';
|
|
3
3
|
import { assembleUrl, ignoreErrFunc, need, throwError } from './utilitas.mjs';
|
|
4
4
|
|
|
5
|
-
const _NEED = [
|
|
6
|
-
'jsdom', 'youtube-transcript', '@mozilla/readability', '@ngrok/ngrok'
|
|
7
|
-
];
|
|
5
|
+
const _NEED = ['jsdom', 'youtube-transcript', '@mozilla/readability'];
|
|
8
6
|
|
|
9
7
|
// https://stackoverflow.com/questions/19377262/regex-for-youtube-url
|
|
10
8
|
const YT_REGEXP = /^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube(-nocookie)?\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$/i;
|
|
@@ -107,12 +105,6 @@ const distill = async url => {
|
|
|
107
105
|
};
|
|
108
106
|
};
|
|
109
107
|
|
|
110
|
-
const forward = async (options) => {
|
|
111
|
-
const { forward } = await need('@ngrok/ngrok');
|
|
112
|
-
// https://ngrok.github.io/ngrok-javascript/
|
|
113
|
-
return await forward(options);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
108
|
export {
|
|
117
109
|
_NEED,
|
|
118
110
|
assertYoutubeUrl,
|
|
@@ -120,7 +112,6 @@ export {
|
|
|
120
112
|
distillHtml,
|
|
121
113
|
distillPage,
|
|
122
114
|
distillYoutube,
|
|
123
|
-
forward,
|
|
124
115
|
getYoutubeMetadata,
|
|
125
116
|
getYoutubeTranscript,
|
|
126
117
|
isYoutubeUrl
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "utilitas",
|
|
3
3
|
"description": "Just another common utility for JavaScript.",
|
|
4
|
-
"version": "1998.2.
|
|
4
|
+
"version": "1998.2.54",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/utilitas",
|
|
7
7
|
"main": "index.mjs",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"@google-cloud/vision": "^4.3.3",
|
|
46
46
|
"@google/generative-ai": "^0.24.0",
|
|
47
47
|
"@mozilla/readability": "github:mozilla/readability",
|
|
48
|
-
"@ngrok/ngrok": "^1.4.1",
|
|
49
48
|
"@sentry/node": "^9.5.0",
|
|
50
49
|
"@sentry/profiling-node": "^9.5.0",
|
|
51
50
|
"acme-client": "^5.4.0",
|