MCPcopy Create free account
hub / github.com/Toulu-debug/enen / Env

Function Env

sendNotify.js:818–1104  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

816
817// prettier-ignore
818function Env(t, e) {
819 "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
820
821 class s {
822 constructor(t) {
823 this.env = t
824 }
825
826 send(t, e = "GET") {
827 t = "string" == typeof t ? {url: t} : t;
828 let s = this.get;
829 return "POST" === e && (s = this.post), new Promise((e, i) => {
830 s.call(this, t, (t, s, r) => {
831 t ? i(t) : e(s)
832 })
833 })
834 }
835
836 get(t) {
837 return this.send.call(this.env, t)
838 }
839
840 post(t) {
841 return this.send.call(this.env, t, "POST")
842 }
843 }
844
845 return new class {
846 constructor(t, e) {
847 this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e)
848 }
849
850 isNode() {
851 return "undefined" != typeof module && !!module.exports
852 }
853
854 isQuanX() {
855 return "undefined" != typeof $task
856 }
857
858 isSurge() {
859 return "undefined" != typeof $httpClient && "undefined" == typeof $loon
860 }
861
862 isLoon() {
863 return "undefined" != typeof $loon
864 }
865
866 toObj(t, e = null) {
867 try {
868 return JSON.parse(t)
869 } catch {
870 return e
871 }
872 }
873
874 toStr(t, e = null) {
875 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected