pedronauck / micro-router

:station: A tiny and functional router for Zeit's Micro

Home Page:https://www.npmjs.com/microrouter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ES6 named import for `delete` under Standard

jda0 opened this issue · comments

It appears impossible to require the delete method without upsetting Standard JS, either due to conflicting with a reserved word (const { delete } = require('microrouter')) or not defining the function (require('microrouter')). Any suggestions?

Hi @jda0, you can rename the imported method like that:

const { router, delete: del } = require('microrouter');

WebStorm also highlights this differently because of the name, perhaps it would be better to export it as del as well.

That's a good point @lucasbento, I'll make this change