MCPcopy Create free account
hub / github.com/LionC/express-basic-auth / ensureFunction

Function ensureFunction

index.js:19–27  ·  view source on GitHub ↗
(option, defaultValue)

Source from the content-addressed store, hash-verified

17}
18
19function ensureFunction(option, defaultValue) {
20 if(option == undefined)
21 return function() { return defaultValue }
22
23 if(typeof option != 'function')
24 return function() { return option }
25
26 return option
27}
28
29function buildMiddleware(options) {
30 var challenge = options.challenge != undefined ? !!options.challenge : false

Callers 1

buildMiddlewareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…