is-express-router
v1.0.1
Published
Checking if an argument is an express Router function from express.Router() (like router.get(), router.post(), ..)
Downloads
4
Maintainers
Readme
is-express-router
Checking if an argument is an express Router function from express.Router()
Install
npm install --save is-express-router
or with yarn:
yarn add is-express-router
Usage
True
import express from 'express'
import isExpressRouter from 'is-express-router'
console.log(isExpressRouter(express.Router()))
False
import isExpressRouter from 'is-express-router'
console.log(isExpressRouter(() => {})))
console.log(isExpressRouter(null)))
console.log(isExpressRouter({})))
console.log(isExpressRouter([])))
// ...