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

flex-combo

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flex-combo - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

nohup.out

51

flex-combo.js
var http = require('http')
, url = require('url')
, fs = require('fs')

@@ -87,2 +88,6 @@ , path = require('path')

}
if (type == 'Error') {
console.log('%s<=Error : %s%s%s %s',red, reset, yellow, c, reset);
return;
}
console.log(green+'<='+type+': ' + reset + gray + ' ' + c + ' ' + reset);

@@ -119,2 +124,6 @@ return;

fns:[],
// define: '',
// anonymous: true,
define: 'KISSY.add',
anonymous: false,
hosts:{'a.tbcdn.cn':'122.225.67.241', 'g.tbcdn.cn':'115.238.23.250'}

@@ -183,7 +192,7 @@ };

var dirs = map[longestMatchPos].split(',');
for (var i = 0, len = dirs.length; i < len; i++){
for (var i = 0, len = dirs.length; i < len; i++) {
var dir = dirs[i];
var revPath = fullPath.slice(longestMatchPos.length, fullPath.length);
var revPath = path.join('/', fullPath.slice(longestMatchPos.length, fullPath.length));
var absPath = '';
debug('The rev path is %s', revPath);
//如果是绝对路径,直接使用

@@ -204,5 +213,10 @@ if(dir.indexOf('/') === 0 || /^\w{1}:\\.*$/.test(dir)){

var tpl = iconv.decode(buff, charset);
var compiled = juicer(tpl)._render.toString().replace(/^function anonymous[^{]*?{([\s\S]*?)}$/igm, function($, fn_body) {
return 'function(_, _method) {' + method_body + fn_body + '};\n';
});
try {
var compiled = juicer(tpl)._render.toString().replace(/^function anonymous[^{]*?{([\s\S]*?)}$/igm, function($, fn_body) {
return 'function(_, _method) {' + method_body + fn_body + '};\n';
});
} catch(e) {
cosoleResp('Error', 'Compile failed with error '+ e.message);
return '';
}

@@ -214,4 +228,23 @@ //允许为某个url特别指定编码

}
var tempalteFunction = 'window["'+revPath+'"] = ' + compiled;
var tempalteFunction;
param.define = param.define || '';
// 未声明需要哪个定义模块
// 或者声明的错误
// 或者声明的是 `window`
if (
!param.define ||
'string' !== typeof param.define ||
!!~['window', 'global', 'self', 'parent','Window','Global'].indexOf(param.define)
) {
debug('The package define is undefined or not a string');
tempalteFunction = 'window["'+revPath+'"] = ' + compiled;
} else {
if (param.anonymous) {
debug('Define a anonymous module');
tempalteFunction = param.define + '(function(){return ' + compiled + '});';
} else {
debug('Define a module with id');
tempalteFunction = param.define + '("' + revPath + '", function () {return ' + compiled + '});';
}
}
cosoleResp('Local Juicer Compile', htmlName);

@@ -376,3 +409,3 @@ fs.writeFile(absPath, tempalteFunction);

}
var url = req.url.replace(/http:\/\/.+?\//,'/');//兼容windows,windows平台下取得的req.url带http://部分
var url = path.resolve(req.url.replace(/http:\/\/.+?\//,'/'));//兼容windows,windows平台下取得的req.url带http://部分
var prefix = url.indexOf(param.servlet + '?');

@@ -379,0 +412,0 @@

4

package.json
{
"name": "flex-combo",
"version": "0.5.9",
"version": "0.5.10",
"description": "The Flex-combo is combo tool designed for web front-end developer. It support various kinds of combo format by modify configuration(eg. yahoo combo).",

@@ -20,3 +20,3 @@ "main": "flex-combo.js",

"juicer":"0.6.5-stable-p2",
"less":""
"less":"~1.7.3"
},

@@ -23,0 +23,0 @@ "devDependencies": {},

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