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.10.8 to 0.11.0

35

api.js

@@ -6,7 +6,8 @@ var urlLib = require("url");

var async = require("async");
var mkdirp = require("mkdirp");
var merge = require("merge");
var Helper = require("./lib/util");
var DAC = require("dac");
var isUtf8 = DAC.isUtf8;
var iconv = DAC.iconv;
var Helper = require("./lib/util");
var ALProtocol = {

@@ -17,2 +18,4 @@ "http:": require("http"),

var ENGINES = [];
function FlexCombo(param, confFile) {

@@ -24,6 +27,6 @@ this.HOST = null;

this.res = null;
this.engines = FlexCombo.prototype.engines.map(function(i) {
this.engines = ENGINES.map(function(i) {
return i;
});
this.param = Helper.clone(require("./lib/param"));
this.param = merge(true, require("./lib/param"));
this.query = {};

@@ -42,10 +45,10 @@ this.cacheDir = pathLib.join(process.cwd(), ".cache");

}
this.param = Helper.merge(true, this.param, confJSON, param || {});
this.param = merge.recursive(true, this.param, confJSON, param || {});
if (confJSON.filter || param.filter) {
this.param.filter = Helper.merge(confJSON.filter || {}, param.filter || {});
this.param.filter = merge(confJSON.filter || {}, param.filter || {});
}
}
else {
this.param = Helper.merge(true, this.param, param || {});
this.param = merge.recursive(true, this.param, param || {});
}

@@ -58,3 +61,3 @@

if (this.param.cache && !fsLib.existsSync(this.cacheDir)) {
Helper.mkdirPSync(this.cacheDir);
mkdirp.sync(this.cacheDir);
fsLib.chmod(this.cacheDir, 0777);

@@ -88,6 +91,5 @@ }

},
engines: [],
addEngine: function (rule, func, p, inner) {
if (rule && typeof func == "function") {
(inner ? this.engines : FlexCombo.prototype.engines).push({
(inner ? this.engines : ENGINES).push({
rule: rule,

@@ -103,3 +105,3 @@ func: func,

this.query = Helper.merge(true, this.query, req.query || {});
this.query = merge.recursive(true, this.query, req.query || {});

@@ -182,3 +184,3 @@ this.HOST = (req.protocol || "http") + "://" + (req.hostname || req.host || req.headers.host);

var protocol = (this.req.protocol || "https") + ':';
var protocol = (this.req.protocol || "http") + ':';
var H = this.req.headers.host.split(':');

@@ -204,6 +206,7 @@ var reqPort = H[1] || (protocol == "https:" ? 443 : 80);

"x-broker": "flex-combo",
host: reqHostName
host: reqHostName,
cookie: this.req.headers.cookie
}
};
requestOption.headers = Helper.merge(true, this.param.headers, requestOption.headers);
requestOption.headers = merge.recursive(true, this.param.headers || {}, requestOption.headers);

@@ -227,5 +230,5 @@ return requestOption;

var engine = this.engines[matchedIndex];
this.query = Helper.merge(true, this.query, this.param[engine.path] || {});
this.query = merge.recursive(true, this.query, this.param[engine.path] || {});
engine.func(absPath, filteredURL, this.query, function (e, result, realPath, MIME) {
engine.func(absPath, this.buildRequestOption(filteredURL), this.query, function (e, result, realPath, MIME) {
if (!e) {

@@ -232,0 +235,0 @@ this.MIME = MIME;

@@ -9,8 +9,16 @@ /**

var fsLib = require("fs");
var Helper = require("./lib/util");
var mkdirp = require("mkdirp");
try {
var updateNotifier = require("update-notifier");
var pkg = require(__dirname + "/package.json");
updateNotifier({pkg: pkg}).notify();
require("check-update")({
packageName: pkg.name,
packageVersion: pkg.version,
isCLI: process.title == "node"
}, function (err, latestVersion, defaultMessage) {
if (!err && pkg.version < latestVersion) {
console.log(defaultMessage);
}
});
}

@@ -23,4 +31,4 @@ catch (e) {

fcInst.addEngine("\\.tpl\\.js$", DAC.tpl, "dac/tpl");
fcInst.addEngine("\\.html\\.js$", function (htmlfile, _url, param, cb) {
DAC.tpl(htmlfile, _url, param, function (err, result, filepath, MIME) {
fcInst.addEngine("\\.html\\.js$", function (htmlfile, reqOpt, param, cb) {
DAC.tpl(htmlfile, reqOpt, param, function (err, result, filepath, MIME) {
if (typeof result != "undefined") {

@@ -48,3 +56,3 @@ var fs = require("fs");

if (!fsLib.existsSync(confDir)) {
Helper.mkdirPSync(confDir);
mkdirp.sync(confDir);
fsLib.chmod(confDir, 0777);

@@ -51,0 +59,0 @@ }

var fsLib = require("fs");
var pathLib = require("path");
var crypto = require("crypto");
var utilLib = require("mace")(module);
var DAC = require("dac");

@@ -9,2 +8,5 @@ var isUtf8 = DAC.isUtf8;

var utilLib = require("mace")(module);
var merge = require("merge");
/* 读取文件并返回Unicode编码的字符串,以便在Node.js环境下进行文本处理 */

@@ -73,7 +75,4 @@ exports.getUnicode = function (filePath) {

exports.merge = utilLib.merge;
exports.mkdirPSync = utilLib.mkdirPSync;
exports.clone = utilLib.clone;
exports.MD5 = function (str) {
return crypto.createHash("md5").update(str).digest('hex');
return crypto.createHash("md5").update(str).digest("hex");
};

@@ -154,3 +153,3 @@

remote: function (url, opt) {
opt = utilLib.merge(true, {
opt = merge.recursive(true, {
protocol: "http:",

@@ -157,0 +156,0 @@ host: "127.0.0.1",

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

@@ -11,8 +11,10 @@ "main": "index.js",

"async": "~0.9.0",
"check-update": "~0.0.7",
"commander": "~2.5.0",
"dac": "~0.4.1",
"dac": "~0.5.1",
"mace": "~2.0.0",
"merge": "~1.2.0",
"mime": "~1.3.4",
"through2": "~0.6.3",
"update-notifier": "~0.3.1"
"mkdirp": "~0.5.0",
"through2": "~0.6.5"
},

@@ -19,0 +21,0 @@ "repository": {

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