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

flex-combo

Package Overview
Dependencies
Maintainers
4
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.12.1 to 0.12.2

lib/sourcemap.js

56

api.js

@@ -30,4 +30,3 @@ var urlLib = require("url");

this.param = require("./lib/param");
delete require.cache["./lib/param"];
this.param = merge(true, require("./lib/param"));
param = param || {};

@@ -60,3 +59,10 @@

this.param.rootdir = pathLib.normalize(pathLib.join(process.cwd(), this.param.rootdir || "src"));
var rootdir = this.param.rootdir || "src";
if (rootdir.indexOf('/') == 0 || /^\w{1}:[\\/].*$/.test(rootdir)) {
this.param.rootdir = rootdir;
}
else {
this.param.rootdir = pathLib.normalize(pathLib.join(process.cwd(), rootdir));
}
if (!this.param.urls['/']) {

@@ -69,3 +75,3 @@ this.param.urls['/'] = this.param.rootdir;

if (this.param.cache && !fsLib.existsSync(this.cacheDir)) {
mkdirp(this.cacheDir, function(e, dir) {
mkdirp(this.cacheDir, function (e, dir) {
fsLib.chmod(dir, 0777);

@@ -88,3 +94,3 @@ });

return filelist.map(function (i) {
return pathLib.join(base, i).replace(/\\/g, '/');
return urlLib.resolve(base, i);
});

@@ -157,3 +163,5 @@ }

// 不用.pathname的原因是由于??combo形式的url,parse方法解析有问题
this.URL = urlLib.parse(req.url).path.replace(/([^\?])\?[^\?].*$/, "$1");
this.URL = urlLib.parse(req.url).path
.replace(/([^\?])\?[^\?].*$/, "$1")
.replace(/\?{1,}$/, '');
this.MIME = mime.lookup(this.URL);

@@ -280,3 +288,3 @@

Helper.Log.error(tips);
next(500);
next(null, 500);
}

@@ -293,3 +301,3 @@ else {

Helper.Log.error(tips);
next(404);
next(null, 404);
}

@@ -310,3 +318,3 @@ else {

Helper.Log.error(_url + " Not Found!");
next(404);
next(null, 404);
}

@@ -356,4 +364,8 @@ }

async.series(Q, function (statusCode) {
this.res.writeHead(statusCode || 200, {
async.series(Q, function (e, responseData) {
responseData = responseData.filter(function (elem, pos) {
return elem && responseData.indexOf(elem) == pos;
});
res.writeHead(responseData[0] || 200, {
"Access-Control-Allow-Origin": '*',

@@ -364,7 +376,20 @@ "Content-Type": this.MIME + (Helper.isBinFile(this.URL) ? '' : ";charset=" + this.param.charset),

var buff;
var fileURI, fileBuff;
for (var i = 0; i < FLen; i++) {
buff = this.result[files[i]];
res.write(buff ? buff : new Buffer("/* " + files[i] + " Empty!*/"));
fileURI = files[i];
fileBuff = this.result[fileURI];
res.write(fileBuff ? fileBuff : new Buffer("/* " + fileURI + " Empty!*/"));
res.write("\n");
}
if (
/[\?&]sourcemap\b/.test(req.url) &&
(this.MIME == "application/javascript" || this.MIME == "text/css")
) {
var fileType = (this.MIME == "application/javascript" ? "js" : "css");
res.write(require("./lib/sourcemap")(this.result, files, fileType));
}
res.end();
var resurl = this.HOST + req.url;

@@ -374,3 +399,2 @@ if (this.param.traceRule && this.param.traceRule.test("Response " + resurl)) {

}
res.end();
}.bind(this));

@@ -412,3 +436,3 @@ }

if (absPath && !/[<>\*\?]+/g.test(absPath)) {
fsLib.writeFile(absPath, buff, function(e) {
fsLib.writeFile(absPath, buff, function (e) {
if (!e) {

@@ -415,0 +439,0 @@ fsLib.chmod(absPath, 0777);

@@ -35,3 +35,3 @@ /**

function transfer(dir, key, except) {
function init_config(dir, key, except) {
var mkdirp = require("mkdirp");

@@ -93,3 +93,3 @@

exports = module.exports = function (param, dir) {
var confFile = transfer(dir, "dac/tpl", ["filter"]);
var confFile = init_config(dir, "dac/tpl", ["filter"]);

@@ -135,3 +135,3 @@ return function () {

fcInst = new API(param, transfer(dir, "dac/tpl", ["filter"]));
fcInst = new API(param, init_config(dir, "dac/tpl", ["filter"]));
fcInst.param.traceRule = false;

@@ -138,0 +138,0 @@

@@ -7,5 +7,4 @@ module.exports = {

hosts: {
"a.tbcdn.cn": "115.238.23.240",
"g.tbcdn.cn": "115.238.23.250",
"s.tbcdn.cn": "115.238.23.198"
"g.alicdn.com": "115.238.23.250"
},

@@ -12,0 +11,0 @@ cache: true,

{
"name": "flex-combo",
"version": "0.12.1",
"version": "0.12.2",
"description": "A combo tool designed for web front-end developer, which support various kinds of combo format by modify configuration(eg. yahoo combo).",

@@ -15,2 +15,3 @@ "main": "index.js",

"fetch-agent": "~0.2.3",
"inline-source-map-comment": "~1.0.5",
"mace": "~2.0.0",

@@ -20,2 +21,4 @@ "merge": "~1.2.0",

"mkdirp": "~0.5.0",
"source-map-concat": "~1.0.0",
"source-map-dummy": "~1.0.0",
"through2": "~0.6.5"

@@ -22,0 +25,0 @@ },

@@ -96,2 +96,7 @@ # Flex Combo 介绍

### 支持SourceMap
在URL的query中添加`sourcemap`以启用SourceMap功能
## 命令参数

@@ -98,0 +103,0 @@

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