Socket
Socket
Sign inDemoInstall

zpin-templates

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zpin-templates - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

36

dist/reactTemplates.js

@@ -24,3 +24,3 @@ 'use strict';

var classExclude = require("./classExclude");
var classExclude = require("./classExclude"); //

@@ -184,20 +184,20 @@ var propsMergeFunction = 'function mergeProps(inline,external) {\n var res = _.assign({},inline,external)\n if (inline.hasOwnProperty(\'style\')) {\n res.style = _.defaults(res.style, inline.style);\n }\n if (inline.hasOwnProperty(\'className\') && external.hasOwnProperty(\'className\')) {\n res.className = external.className + \' \' + inline.className;\n }\n return res;\n}\n';

//多class问题
val = val.trim();
if (val.indexOf("{this.styles.") < 0) {
var arr = val.split(" ");
var result = "{[";
arr.forEach(function (v, i) {
if (classExclude.indexOf(v.trim()) < 0) {
result += "this.styles['" + v.trim() + "']";
} else {
result += "'" + v.trim() + "'";
}
if (i != arr.length - 1) {
result += ",";
}
});
result += "].join(' ')}";
}
// val=val.trim();
// if(val.indexOf("{this.styles.")<0){
// var arr=val.split(" ");
// var result="{[";
// arr.forEach(function (v,i) {
// if(classExclude.indexOf(v.trim())<0){
// result+="this.styles['"+v.trim()+"']";
// }else{
// result+="'"+v.trim()+"'";
// }
// if(i!=arr.length-1){
// result+=","
// }
// })
// result+="].join(' ')}"
// }
// console.log(result);
props[propKey] = existing + utils.convertText(node, context, result);
props[propKey] = existing + utils.convertText(node, context, val.trim());
}

@@ -204,0 +204,0 @@ } else if (!_.startsWith(key, 'rt-')) {

{
"name": "zpin-templates",
"version": "0.0.9",
"version": "0.0.10",
"description": "Light weight templates for react -> write html get valid react code",

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

@@ -21,3 +21,3 @@ 'use strict';

const classExclude=require("./classExclude");
const classExclude=require("./classExclude");//

@@ -198,20 +198,20 @@ const propsMergeFunction = `function mergeProps(inline,external) {

//多class问题
val=val.trim();
if(val.indexOf("{this.styles.")<0){
var arr=val.split(" ");
var result="{[";
arr.forEach(function (v,i) {
if(classExclude.indexOf(v.trim())<0){
result+="this.styles['"+v.trim()+"']";
}else{
result+="'"+v.trim()+"'";
}
if(i!=arr.length-1){
result+=","
}
})
result+="].join(' ')}"
}
// val=val.trim();
// if(val.indexOf("{this.styles.")<0){
// var arr=val.split(" ");
// var result="{[";
// arr.forEach(function (v,i) {
// if(classExclude.indexOf(v.trim())<0){
// result+="this.styles['"+v.trim()+"']";
// }else{
// result+="'"+v.trim()+"'";
// }
// if(i!=arr.length-1){
// result+=","
// }
// })
// result+="].join(' ')}"
// }
// console.log(result);
props[propKey] = existing + utils.convertText(node, context,result);
props[propKey] = existing + utils.convertText(node, context,val.trim());
}

@@ -218,0 +218,0 @@ } else if (!_.startsWith(key, 'rt-')) {

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