Socket
Socket
Sign inDemoInstall

stc-js-tpl-replace

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

13

lib/index.js

@@ -109,7 +109,3 @@ "use strict";

var content = token.ext.content;
if (_this2.file.path.match(/a\.tpl/)) {
console.log(_this2.file.path, token.type === _this2.TokenType.HTML_TAG_SCRIPT, start.ext.isTpl, !start.ext.isExternal);
}
if (token.type === _this2.TokenType.HTML_TAG_SCRIPT && start.ext.isTpl && !start.ext.isExternal) {
// console.log(start.value, this.file.path);
var val = start.value;

@@ -217,2 +213,10 @@ var matchResult = val.match(REG.ID);

/**
* default include
*/
jsTplReplace.include = function include() {
return [/\.js$/, { type: 'tpl' }];
};
/**
* after handling templates files,

@@ -258,3 +262,2 @@ * we need to replace strings like `$('#myTplId').html` in js with content collected before,

tplObj = tplMap.get(id);
// console.log(id, tplMap);

@@ -261,0 +264,0 @@ if (tplMap.has(id)) {

{
"name": "stc-js-tpl-replace",
"description": "Replace references to templates by their contents in js files",
"version": "1.0.0",
"version": "1.0.1",
"author": {

@@ -6,0 +6,0 @@ "name": "huangxiaolu",

@@ -10,3 +10,3 @@ # stc-js-tpl-replace

stc.workflow({
jsTplReplace: {plugin: jsTplReplace, include: [/resource\/js/, /tpls\//]}
jsTplReplace: {plugin: jsTplReplace}
});

@@ -13,0 +13,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc