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

hetamvc

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hetamvc - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

core/SocketLoader.js

74

core/AnalyzeFiles.js
const FileLoader = require('./FileLoader.js');
const SocketLoader = require('./SocketLoader.js');
const fs = require('fs');

@@ -10,6 +11,10 @@ const Sequelize = require('sequelize');

*/
function AnalyzeFiles(dir){
function AnalyzeFiles(dir,socketServer){
this.loader = new FileLoader([".html"]); //제외 파일 .html
this.fileList = this.loader.getFiles(dir); //모든 파일 가져오기.
if(socketServer != null){
this.socketLoader = new SocketLoader(socketServer); //서버를 넣어준다.
this.socketOnList = {}; //소켓on 1회만 장착 된다.
}
this.componentList = [];

@@ -46,5 +51,10 @@ this.controllerList = [];

this._analyzeModel(dbConf);
let serviceList = this._analyzeService(); //**미완*/
let serviceList = this._analyzeService(); //**미완 - 1.서비스 끼리 호출이 않된다. 2.Model이 자기이름만 가능 */
this._analyzeComponent(route,serviceList); //배치는 component에 들어감
this._analyzeController(route,serviceList,uploadPath);
//소켓 장착.
if(this.socketLoader != null){
this.socketLoader.initLoader(this.socketOnList);
}
}catch(e){

@@ -258,3 +268,10 @@ console.log(e);

let fn = ()=>{componentObj[methodName]();}; //TODO async어쩐댜.
let fn = ()=>{
//모든 소켓과 fs를 전달
let modules = {'fs':fs};
if(this.socketLoader != null)
modules.socketAll = this.socketLoader.socketAll;
componentObj[methodName](modules);
}; //TODO async어쩐댜.

@@ -268,3 +285,48 @@ //############# 링크 생성. component는 all이다...

}
//Socket은 나중에 on에 역기 위해서 모아두기만 한다.
let soList = this._getAnnoBracket("Socket",str); //[{string, index, values[], methodName(class) }] 쉼표 구분 으로 뱉어 낸다.
if(soList.length > 0){
let classIdx = str.indexOf("class");
let className = this._getClassName(str,classIdx); //클래스 이름 가져오기.
//class위에 있는건 제거 된 상태임.
for(let i in soList){
let sc = soList[i];
// let routeType = 'use';
let socketOnName = sc.values[0]; //.replace(/[\'\"]+/g,""); //'socketOn Name : checkConnect'
// if(rm.values[1] != null ) routeType = rm.values[1];
let methodName = sc.methodName; //this._getMethodName(str,rm.index);
let classObj = require(path)[className]; //TODO 필요한 인자를 넘겨줄수 있다.
let componentObj = new classObj(); //옵젝트 생성하고.
//============================= Inject
//Method List를 가져온다. 컨트롤러 에서 사용할수도 있음. async도 붙여 준다.
this._injectToObject(iList, componentObj,this.models,'model'); //model주입
this._injectToObject(iList, componentObj,services,'service'); //서비스주입
//############# 소켓 생성. component는
if(componentObj[methodName] == undefined) continue;
console.log(componentObj[methodName]);
//socket등록을 위해서 모아 놓는다.
if(this.socketOnList != null){
//this.socketOnList[socketOnName] = componentObj[methodName];
let fn = (data,socket)=>{ componentObj[methodName](data,socket);}; //TODO async어쩐댜.
this.socketOnList[socketOnName] = fn;
}
//############# 링크 생성. component는 all이다...
//route.all(url,fn);
}
}
}//for

@@ -408,3 +470,3 @@ }

let fn = (req,res,next)=>{controllerObj[methodName](req,res,next);}; //TODO async어쩐댜.
let fn = (req,res,next)=>{controllerObj[methodName](req,res,next,fs);}; //TODO async어쩐댜.

@@ -411,0 +473,0 @@

2

core/Scan.js

@@ -9,3 +9,3 @@ var AnalyzeFiles = require('./AnalyzeFiles.js');

function Scan(vo){
var az = new AnalyzeFiles(vo.scanPath);
var az = new AnalyzeFiles(vo.scanPath,vo.socket);
az.analyzing(vo.route,vo.db,vo.uploadPath); //annotation을 설정한다.

@@ -12,0 +12,0 @@ };

{
"name": "hetamvc",
"version": "0.1.7",
"version": "0.1.8",
"author": {

@@ -5,0 +5,0 @@ "name": "hetamvc",

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