queckezz/koa-views

some options will cause recursive throws

magicdawn opened this issue · 1 comments

options = {
  map: {
    '.njk': 'nunjucks'
  },
  extension: '.njk'
}

will cause recursive throw here
https://github.com/queckezz/koa-views/blob/v6.0.0/src/index.js#L73
And ctx.render will neither resolve nor reject

I know remove . from .njk is good, but as a 200 star+ package, this should tolerate this. 😂

Thanks for your friendly advice.

IMO, the options is usually a static configuration but not input from users, and the example in README is explicit. It's may not worth to consider this edge case.

Anyway, thanks again :-)