flex-combo
Advanced tools
Comparing version 0.3.6 to 0.3.7
var http = require('http') | ||
, fs = require('fs') | ||
, path = require('path') | ||
, isUtf8 = require('is-utf8') | ||
, iconv = require('iconv-lite') | ||
, joinbuffers = require('joinbuffers') | ||
, mkdirp = require('mkdirp') | ||
, crypto = require('crypto') | ||
, beautify = require('./beautify.js').js_beautify | ||
, mime = require('mime'); | ||
, fs = require('fs') | ||
, path = require('path') | ||
, isUtf8 = require('is-utf8') | ||
, iconv = require('iconv-lite') | ||
, joinbuffers = require('joinbuffers') | ||
, mkdirp = require('mkdirp') | ||
, crypto = require('crypto') | ||
, beautify = require('./beautify.js').js_beautify | ||
, mime = require('mime'); | ||
@@ -16,14 +16,14 @@ var debug = require('debug')('flex-combo:debug'); | ||
/** | ||
Yahoo Combo: | ||
<script src="http://yui.yahooapis.com/combo | ||
?2.5.2/build/editor/editor-beta-min.js | ||
&2.5.2/build/yahoo-dom-event/yahoo-dom-event.js | ||
&2.5.2/build/container/container_core-min.js | ||
&2.5.2/build/menu/menu-min.js | ||
&2.5.2/build/element/element-beta-min.js | ||
&2.5.2/build/button/button-min.js"> | ||
</script> | ||
Yahoo Combo: | ||
<script src="http://yui.yahooapis.com/combo | ||
?2.5.2/build/editor/editor-beta-min.js | ||
&2.5.2/build/yahoo-dom-event/yahoo-dom-event.js | ||
&2.5.2/build/container/container_core-min.js | ||
&2.5.2/build/menu/menu-min.js | ||
&2.5.2/build/element/element-beta-min.js | ||
&2.5.2/build/button/button-min.js"> | ||
</script> | ||
//淘宝combo server规则a.tbcdn.cn/apps?? | ||
*/ | ||
//淘宝combo server规则a.tbcdn.cn/apps?? | ||
*/ | ||
var param = { | ||
@@ -42,4 +42,5 @@ urls: {}, | ||
prjDir: '', | ||
urlBasedCharset:{} | ||
}; | ||
urlBasedCharset:{}, | ||
fns:[] | ||
}; | ||
@@ -51,3 +52,3 @@ function adaptCharset(buff, outCharset, charset){ | ||
return iconv.encode(iconv.decode(buff, charset), outCharset); | ||
return iconv.encode(iconv.decode(buff, charset), outCharset); | ||
} | ||
@@ -61,2 +62,12 @@ | ||
} | ||
if(param.fns){ | ||
param.fns.forEach(function(fn){ | ||
try{ | ||
filtered = fn(filtered); | ||
} | ||
catch(e){ | ||
} | ||
}); | ||
} | ||
return filtered; | ||
@@ -217,3 +228,5 @@ } | ||
var url = req.url.replace(/http:\/\/.+?\//,'/');//兼容windows,windows平台下取得的req.url带http://部分 | ||
debugInfo('Request: %s', url); | ||
var prefix = url.indexOf(param.servlet + '?'); | ||
@@ -258,3 +271,3 @@ | ||
var buff = joinbuffers(buffs); | ||
//fix 80% situation bom problem.quick and dirty | ||
@@ -289,4 +302,4 @@ if(buff[0] === 239 && buff[1] === 187 && buff[2] === 191) { | ||
debugInfo('Networking error:' + e.message); | ||
return; | ||
}); | ||
return; | ||
}); | ||
return; | ||
@@ -307,3 +320,3 @@ } | ||
var file = files[i]; | ||
//combo URL有时候会多一个逗号 | ||
@@ -351,3 +364,3 @@ if(file === "") continue; | ||
} | ||
(function(id) { | ||
@@ -389,4 +402,4 @@ http.get({host: param.host, port: 80, path: reqPath + reqArray[id].file}, function(resp) { | ||
}).on('error',function(e){ | ||
debug('Networking error:' + e.message); | ||
}); | ||
debug('Networking error:' + e.message); | ||
}); | ||
})(i); | ||
@@ -406,3 +419,3 @@ } | ||
} | ||
//如果全部都在本地可以获取到,就立即返回内容给客户端 | ||
@@ -412,1 +425,2 @@ sendData(); | ||
} | ||
{ | ||
"name": "flex-combo", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"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).", | ||
@@ -5,0 +5,0 @@ "main": "flex-combo.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67219
1497