hapijs - route config 'id' attribute - won't accept string value -


i'm not sure if bug or not, i'm asking here, rather submitting bug report.

in documentation latest version of hapijs (16.1.1)

https://hapijs.com/api#serverlookupid

for server.lookup, indicates 'id' property can string.

const route = server.lookup('root'); 

however strings expressively forbidden actual implementation code.

https://github.com/hapijs/hapi/blob/master/lib/connection.js#l340

hoek.assert(id && typeof id === 'string', 'invalid route id:', id); 

am missing here? bug, or error in documentation, or misunderstanding something?

it seems strange limitation impose. strings lot more logical route id.

the other issue, in index.d.ts, forces use of string parameter.

this functionality seems broken. how supposed use it, if when creating route need use numeric id, , when trying retrieve i'm forced use string?

you reading assert backwards. error message displays if assertion fails. if id provided can of type string.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -