MCPcopy
hub / github.com/hapijs/hapi / add

Method add

lib/methods.js:25–38  ·  view source on GitHub ↗
(name, method, options, realm)

Source from the content-addressed store, hash-verified

23 }
24
25 add(name, method, options, realm) {
26
27 if (typeof name !== 'object') {
28 return this._add(name, method, options, realm);
29 }
30
31 // {} or [{}, {}]
32
33 const items = [].concat(name);
34 for (let item of items) {
35 item = Config.apply('methodObject', item);
36 this._add(item.name, item.method, item.options ?? {}, realm);
37 }
38 }
39
40 _add(name, method, options, realm) {
41

Callers

nothing calls this directly

Calls 1

_addMethod · 0.80

Tested by

no test coverage detected