MCPcopy Create free account
hub / github.com/NobyDa/Script / formatHeaders

Function formatHeaders

Bilibili-DailyBonus/Manga.js:135–137  ·  view source on GitHub ↗
(h)

Source from the content-addressed store, hash-verified

133}
134
135function formatHeaders(h) {
136 return Object.keys(h).reduce((t, i) => (t[i.toLowerCase()] = h[i], t), {})
137}
138
139//Bark APP notify
140async function BarkNotify(c, k, t, b) { for (let i = 0; i < 3; i++) { c.log(`🔷Bark notify >> Start push (${i + 1})`); const s = await new Promise((n) => { c.post({ url: 'https://api.day.app/push', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ title: t, body: b, device_key: k, ext_params: { group: t } }) }, (e, r, d) => r && r.status == 200 ? n(1) : n(d || e)) }); if (s === 1) { c.log('✅Push success!'); break } else { c.log(`❌Push failed! >> ${s.message || s}`) } } };

Callers 1

GetAuthFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected