()
| 311 | const keysIterator = this.parentNsps.keys(); |
| 312 | |
| 313 | const run = () => { |
| 314 | const nextFn = keysIterator.next(); |
| 315 | if (nextFn.done) { |
| 316 | return fn(false); |
| 317 | } |
| 318 | nextFn.value(name, auth, (err, allow) => { |
| 319 | if (err || !allow) { |
| 320 | return run(); |
| 321 | } |
| 322 | if (this._nsps.has(name)) { |
| 323 | // the namespace was created in the meantime |
| 324 | debug("dynamic namespace %s already exists", name); |
| 325 | return fn(this._nsps.get(name) as Namespace); |
| 326 | } |
| 327 | const namespace = this.parentNsps.get(nextFn.value)!.createChild(name); |
| 328 | debug("dynamic namespace %s was created", name); |
| 329 | fn(namespace); |
| 330 | }); |
| 331 | }; |
| 332 | |
| 333 | run(); |
| 334 | } |
nothing calls this directly
no test coverage detected