New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fis-postprocessor-jswrapper

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis-postprocessor-jswrapper - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

17

index.js

@@ -7,6 +7,6 @@ /*

'use strict';
module.exports = function(content, file, conf){
module.exports = function (content, file, conf) {
var options = file.jswrapper;
if(file.isMod || conf.wrapAll || options) {
if (file.isMod || conf.wrapAll || options) {

@@ -17,12 +17,13 @@ var template = getConfig('template', options, conf);

// wrap
if(template){
if (template) {
content = String(template)
.split('${content}').join(content)
.split('${id}').join(file.getId());
} else if(type === 'amd') {
if(!/(^|[^.])\bdefine\s*\(/.test(content)){
content = 'define(\'' + file.getId() + '\', function(require, exports, module){ ' + content + ' \r\n});';
} else if (type === 'amd') {
if (!/^\s*define\s*\(/.test(content)) {
content = 'define(\'' + file.getId() + '\', function(require, exports, module){ ' + content +
' \r\n});';
}
} else {
if(!/^\s*(?:[!(]\s*|void\s+)function\(/.test(content)){
if (!/^\s*(?:[!(]\s*|void\s+)function\(/.test(content)) {
content = '!function(){try{ ' + content + ' \r\n}catch(e){}}();';

@@ -37,2 +38,2 @@ }

return local && typeof local[key] !== 'undefined' ? local[key] : global[key];
}
}
{
"name" : "fis-postprocessor-jswrapper",
"description" : "A postprocessor plugin for fis to wrap javascript with closure or amd define.",
"version" : "0.0.11",
"author" : "FIS Team <fis@baidu.com>",
"homepage" : "http://fis.baidu.com/",
"keywords": [ "fis" ],
"main" : "index.js",
"name": "fis-postprocessor-jswrapper",
"description": "A postprocessor plugin for fis to wrap javascript with closure or amd define.",
"version": "0.0.12",
"author": "FIS Team <fis@baidu.com>",
"homepage": "http://fis.baidu.com/",
"keywords": ["fis"],
"main": "index.js",
"repository": {

@@ -13,8 +13,8 @@ "type": "git",

},
"engines" : {
"node" : ">= 0.8.0"
"engines": {
"node": ">= 0.8.0"
},
"scripts" : {
"test" : "mocha test/ut --recursive"
"scripts": {
"test": "mocha test/ut --recursive"
}
}
}
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