Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lark-router

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-router - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

18

index.js

@@ -20,2 +20,3 @@ var rd = require('rd');

var bootstrap = function (options) {
var app = this
if (used) return function*(next) {

@@ -49,4 +50,3 @@ yield next

var router = new Router();
//require(file.dirname)(router);
addRouter(file.dirname, router);
addRouter.call(app, file.dirname, router);
routers.push(mount(route, router.middleware()));

@@ -64,3 +64,3 @@ });

if ('object' !== typeof controller) {
return addRoutePath(router, controller);
return addRoutePath.call(this, router, controller);
}

@@ -78,3 +78,3 @@ if (Array.isArray(controller)) {

var handler = paths[routePath];
addRoutePath(router, method, routePath, handler);
addRoutePath.call(this, router, method, routePath, handler);
}

@@ -85,6 +85,6 @@ }

function addRoutePath (router, _method, _routePath, _handler) {
handler = _handler || _routePath || _method;
routePath = !!_handler ? _routePath : '/';
method = !!_routePath ? _method.toLowerCase() : 'get';
function addRoutePath (router, method, routePath, handler) {
var handler = handler || routePath || method;
var routePath = !!handler ? routePath : '/';
var method = !!routePath ? method.toLowerCase() : 'get';

@@ -98,3 +98,3 @@ if ('function' === typeof handler && 'GeneratorFunction' === handler.constructor.name) {

if ('function' === typeof handler) {
return handler(router);
return handler.call(this, router);
}

@@ -101,0 +101,0 @@ throw new Error((typeof handler) + ' can not be set as a router');

{
"name": "lark-router",
"version": "0.4.1",
"version": "0.4.2",
"description": "An koa route initialization and configuration module.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc