mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-05 04:09:31 +08:00
6 lines
340 B
Text
6 lines
340 B
Text
const getExport = name => import('../dist/index.mjs').then(r => r[name])
|
|
const createCaller = name => (input, init) => getExport(name).then(fn => fn(input, init))
|
|
|
|
exports.fetch = createCaller('fetch')
|
|
exports.$fetch = createCaller('$fetch')
|
|
exports.$fetch.raw = (input, init) => getExport('$fetch').then($fetch => $fetch.raw(input, init))
|