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

dac

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dac - npm Package Compare versions

Comparing version 0.7.10 to 0.8.0

engines/xmd.js

44

lib/util.js
var fsLib = require("fs");
var isUtf8 = require("is-utf8");
var iconv = require("iconv-lite");
var minimatch = require("minimatch");

@@ -36,29 +37,30 @@ /* 读取文件并返回Unicode编码的字符串,以便在Node.js环境下进行文本处理 */

exports.wrapper = function (compiled, _url, param) {
var result = '';
var wrapper = param.define;
var anonymous = param.anonymous;
var packageName = '"' + exports.filteredUrl(_url, param.filter) + '"';
exports.matchPath = function (path, rules) {
var ret = false;
if (wrapper) {
result = wrapper + '(';
if (rules && rules.length) {
var positive = [], negative = [];
if (!anonymous) {
result += packageName + ',';
}
rules.forEach(function (rule) {
if (/^\!/.test(rule)) {
negative.push(rule);
}
else {
positive.push(rule);
}
});
if (wrapper == "define") {
result += "function(require,exports,module){module.exports=";
if (positive.length) {
ret = positive.some(function (rule) {
return minimatch(path, rule);
});
}
else {
result += "function(){return ";
if (negative.length) {
ret &= negative.every(function (rule) {
return minimatch(path, rule);
});
}
result += compiled + "});";
}
else {
result = "window[" + packageName + "]=" + compiled;
}
return result;
}
return ret;
};
{
"name": "dac",
"version": "0.7.10",
"version": "0.8.0",
"description": "Dynamic Assets Compiler",

@@ -5,0 +5,0 @@ "main": "index.js",

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