(name, method, options, realm)
| 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 |