New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lark-mvc

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-mvc - npm Package Compare versions

Comparing version 3.1.3 to 3.1.4

example/index.js

2

example/koa.js
'use strict';
const Koa = require('koa');
const LarkMVC = require('..');
const LarkMVC = require('lark-mvc');

@@ -6,0 +6,0 @@ class ShowIntroduction extends LarkMVC.Controller {

@@ -7,2 +7,3 @@ /**

const assert = require('assert');
const debug = require('debug')('lark-mvc.MVC');
const Config = require('lark-config');

@@ -16,2 +17,3 @@

constructor() {
debug('construct');
this.controllers = new Config();

@@ -23,8 +25,11 @@ this.models = new Config();

controller(path) {
debug(`get controller ${path || '<default>'}`);
return path ? this.controllers.get(path) : this.controllers.config;
}
model(path) {
debug(`get model ${path || '<default>'}`);
return path ? this.models.get(path) : this.models.config;
}
view(path) {
debug(`get view ${path || '<default>'}`);
const viewKeys = Object.keys(this.views.config);

@@ -36,2 +41,3 @@ assert(Object.keys(viewKeys).length > 0, 'No views found');

use(component, options = {}) {
debug('using component');
const maps = {

@@ -42,3 +48,3 @@ [Controller.MVC_TYPE]: this.controllers,

};
assert(component instanceof Function, 'Componennt must be a class');
assert(component instanceof Function, 'Component must be a class');
assert('string' === typeof component.name, 'Invalid component name, should be a string');

@@ -62,2 +68,3 @@ assert(options instanceof Object, 'Options must be an object');

_inject(component) {
debug('inject');
let mvc = this;

@@ -105,2 +112,3 @@ let result = null;

dispatch(controller, ...args) {
debug('dispatch');
assert(controller, 'Invalid controller');

@@ -107,0 +115,0 @@ if ('string' === typeof controller) {

{
"name": "lark-mvc",
"version": "3.1.3",
"version": "3.1.4",
"description": "MVC for building web service",
"main": "./lib/MVC",
"scripts": {
"test": "./node_modules/.bin/eslint index.js example/** lib/** && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should --recursive test",
"debug": "node --inspect-brk=9229 example/app.js"
"lint": "./node_modules/.bin/eslint index.js example/** lib/**",
"pretest": "npm run lint && npm link && npm link lark-mvc",
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --require should --recursive test",
"posttest": "npm unlink",
"debug": "node --inspect-brk=9229 example/index.js"
},

@@ -28,3 +31,4 @@ "repository": {

"dependencies": {
"lark-config": "^2.4.0"
"debug": "^2.6.8",
"lark-config": "^2.6.0"
},

@@ -34,2 +38,3 @@ "devDependencies": {

"eslint": "^3.19.0",
"eslint-plugin-spellcheck": "0.0.8",
"istanbul": "^1.1.0-alpha.1",

@@ -36,0 +41,0 @@ "koa": "^2.0.0-alpha.8",

@@ -6,3 +6,3 @@ /**

const mvc = require('../example/app');
const mvc = require('lark-mvc/example');

@@ -9,0 +9,0 @@ describe('mvc', () => {

Sorry, the diff of this file is not supported yet

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