Files
confluence-mcp/node_modules/wrappy/wrappy.js
Christian Gick 2768650b42 feat: Initial confluence-mcp server for realtime collaboration
Provides 8 MCP tools for Confluence Cloud:
- confluence_list_spaces, confluence_create_space
- confluence_search, confluence_get_page
- confluence_create_page, confluence_update_page
- confluence_get_comments, confluence_add_comment

Uses Confluence REST API v2 with basic auth.
Registered in Claude Code and mcp-proxy.

Refs: CF-935

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 18:09:30 +02:00

34 lines
905 B
JavaScript

// Returns a wrapper function that returns a wrapped callback
// The wrapper function should do some stuff, and return a
// presumably different callback function.
// This makes sure that own properties are retained, so that
// decorations and such are not lost along the way.
module.exports = wrappy
function wrappy (fn, cb) {
if (fn && cb) return wrappy(fn)(cb)
if (typeof fn !== 'function')
throw new TypeError('need wrapper function')
Object.keys(fn).forEach(function (k) {
wrapper[k] = fn[k]
})
return wrapper
function wrapper() {
var args = new Array(arguments.length)
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i]
}
var ret = fn.apply(this, args)
var cb = args[args.length-1]
if (typeof ret === 'function' && ret !== cb) {
Object.keys(cb).forEach(function (k) {
ret[k] = cb[k]
})
}
return ret
}
}