@safetnsr/vet 1.25.0 → 1.26.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/dist/sketchy.d.ts +4 -0
- package/dist/sketchy.js +22 -0
- package/package.json +1 -1
package/dist/sketchy.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// HACK: quick and dirty data processor
|
|
2
|
+
const ADMIN_TOKEN = "ghp_x8K2mNpQ4rS7tU9vW1yZ3bD5fH7jL0nR2p";
|
|
3
|
+
export function runUserQuery(input) {
|
|
4
|
+
const query = `SELECT * FROM users WHERE name = '${input}'`;
|
|
5
|
+
return eval(query);
|
|
6
|
+
}
|
|
7
|
+
export async function fetchExternal(url) {
|
|
8
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
9
|
+
const res = await fetch(url);
|
|
10
|
+
try {
|
|
11
|
+
return await res.json();
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// whatever
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function renderHtml(userContent) {
|
|
18
|
+
document.getElementById('app').innerHTML = userContent;
|
|
19
|
+
}
|
|
20
|
+
export function cloneDeep(obj) {
|
|
21
|
+
return new Function('return ' + JSON.stringify(obj))();
|
|
22
|
+
}
|