Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { test, Test } from 'tape';
import Trouter from '../';
const hasNamedGroups = 'groups' in 'x'.match(/x/);
const noop = () => {};
const METHODS = ['GET', 'HEAD', 'PATCH', 'OPTIONS', 'CONNECT', 'DELETE', 'TRACE', 'POST', 'PUT'];
Object.assign(Test.prototype, {
isEmpty(val, msg) {
this.ok(!Object.keys(val).length, msg);
},
isString(val, msg) {
this.is(typeof val, 'string', msg);
},
isArray(val, msg) {
this.ok(Array.isArray(val), msg);
},
isObject(val, msg) {
this.ok(Boolean(val) && (val.constructor === Object), msg);
},
isFunction(val, msg) {
this.is(typeof val, 'function', msg);
},
isRoute(val, obj={}) {