@aiot-toolkit/shared-utils 1.0.18-binary-beta.4 → 1.0.18-binary-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/protobuf/protobuf.js +1 -1
- package/package.json +2 -2
package/lib/protobuf/protobuf.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extractFunctions=extractFunctions,exports.createBin=createBin;const fs=require("fs"),vdom_pb=require("./vdom_pb"),Path=require("path");class AIOT{constructor(t){this.funcArr=[],this.chld=[],this.idCount=-1,this.expCell=new vdom_pb.ExportCell,this.aiotf=t,this.optArr=[]}init(t){this.expCell.setTagname(t)}parseObj(t){let e=new vdom_pb.StyleValueArr;for(let r in t){let
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extractFunctions=extractFunctions,exports.createBin=createBin;const fs=require("fs"),vdom_pb=require("./vdom_pb"),Path=require("path");class AIOT{constructor(t){this.funcArr=[],this.chld=[],this.idCount=-1,this.expCell=new vdom_pb.ExportCell,this.aiotf=t,this.optArr=[]}init(t){this.expCell.setTagname(t)}parseObj(t){let e=new vdom_pb.StyleValueArr;for(let r in t){let i=new vdom_pb.StyleKey,s=new vdom_pb.OneStyleValue;i.setValue(r),s.setKey(i);let n=Object.prototype.toString.call(t[r]);if("[object Number]"===n)s.setDoublevl(t[r]);else if("[object String]"===n)s.setStringvl(t[r]);else if("[object Function]"===n)null==this.aiotf?(this.funcArr.push(t[r]),s.setFuncid(this.funcArr.length-1)):(this.aiotf.funcArr.push(t[r]),s.setFuncid(this.aiotf.funcArr.length-1));else if("[object Object]"===n){let e=new vdom_pb.StyleValueArr;e=this.parseObj(t[r]),s.setStylevlarr(e)}else if("[object Array]"===n){let e=new vdom_pb.StringArr;e.setStringvlarrList(t[r]),s.setStringarr(e)}e.addVlarr(s)}return e}__ce__(t,e,r){let i=new vdom_pb.TemplateOne,s=new vdom_pb.TemplateCE;if(s.setTag(t),Array.isArray(r)&&r.length>0){let t=[];for(let e in r)t.push(r[e].id_);i.setChldsidList(t)}i.setId(++this.idCount);let n=this.parseObj(e.__opts__);return s.setOptsarrList(n.getVlarrList()),i.setCe(s),this.expCell.addTemplatearr(i),{id_:this.idCount,aiot_:this}}__ci__(t,e){let r=new vdom_pb.TemplateOne,i=new vdom_pb.TemplateCI;r.setId(++this.idCount),"[object Function]"===Object.prototype.toString.call(t.__opts__.shown)&&(null==this.aiotf?(this.funcArr.push(t.__opts__.shown),i.setShownid(this.funcArr.length-1)):(this.aiotf.funcArr.push(t.__opts__.shown),i.setShownid(this.aiotf.funcArr.length-1)));let s=new AIOT(this);s.funcArr=this.funcArr;let n=e(s),l=Object.prototype.toString.call(n);if("[object Object]"===l)i.setTemplaterenderList(n.aiot_.expCell.getTemplatearrList());else if("[object Array]"===l)for(let t in n){i.setTemplaterenderList(n[t].aiot_.expCell.getTemplatearrList());break}return this.funcArr=s.aiotf.funcArr,r.setCi(i),this.expCell.addTemplatearr(r),{id_:this.idCount,aiot_:this}}__cf__(t,e){let r=new vdom_pb.TemplateOne,i=new vdom_pb.TemplateCF;r.setId(++this.idCount);for(let e in t.__opts__){if("exp"===e&&"[object Function]"===Object.prototype.toString.call(t.__opts__[e])&&(null==this.aiotf?(this.funcArr.push(t.__opts__[e]),i.setExpid(this.funcArr.length-1)):(this.aiotf.funcArr.push(t.__opts__[e]),i.setExpid(this.aiotf.funcArr.length-1))),"key"===e&&"[object String]"===Object.prototype.toString.call(t.__opts__[e])){let r=new vdom_pb.OneStyleValue;r.setStringvl(t.__opts__[e]),i.setKey(r)}if("value"===e&&"[object String]"===Object.prototype.toString.call(t.__opts__[e])){let r=new vdom_pb.OneStyleValue;r.setStringvl(t.__opts__[e]),i.setValue(r)}}let s=new AIOT,n=e(undefined,undefined,s),l=Object.prototype.toString.call(n);if("[object Object]"===l)i.setTemplaterenderList(n.aiot_.expCell.getTemplatearrList());else if("[object Array]"===l)for(let t in n){i.setTemplaterenderList(n[t].aiot_.expCell.getTemplatearrList());break}if(s.funcArr.length>0){const e=function(t,e){return s.aiotf.funcArr};e.aiotfor=s,e.aiotfor.key=t.__opts__.key,e.aiotfor.value=t.__opts__.value,this.funcArr.push(e),i.setFuncrender(this.funcArr.length-1)}return r.setCf(i),this.expCell.addTemplatearr(r),{id_:this.idCount,aiot_:this}}__cc__(t,e){let r=new vdom_pb.TemplateOne,i=new vdom_pb.TemplateCC;return i.setTag(t),r.setId(++this.idCount),this.optArr.push(e.__opts__),i.setOptsid(this.optArr.length-1),r.setCc(i),this.expCell.addTemplatearr(r),{id_:this.idCount,aiot_:this}}}function translateStyle(t,e){const r=e.expCell;return t.forEach((t=>{const e=t[0][0][0],i=t[0][0][1],s=t[1],n=r.addCssarr();n.setId(e),n.setName(i),Object.keys(s).forEach((t=>{const e=s[t],r=n.addStylearr(),i=new vdom_pb.StyleKey;switch(i.setValue(t),r.setKey(i),typeof e){case"string":r.setStringvl(e);break;case"number":Number.isInteger(e)?r.setInt32vl(e):r.setDoublevl(e)}}))})),r}function translateTemplate(template,aiot){const vm={};template&&eval(`(${template})`)(vm)}function createItem(t,e,r){let i=new AIOT;return i.init(t||"entry"),translateTemplate(r,i),translateStyle(e,i),i}function extractFunctions(t){let e=new AIOT;return e.init("temp"),translateTemplate(t,e),e}function createBin(t,e,r,i){const s=r.map(((t,r)=>createItem(e[r],JSON.parse(t),i[r])));let n=new vdom_pb.ExportArr;n.clearValuearrList(),s.forEach((t=>{n.addValuearr(t.expCell)}));let l=n.serializeBinary();fs.writeFileSync(t,l)}
|
|
2
2
|
//# sourceMappingURL=protobuf.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiot-toolkit/shared-utils",
|
|
3
|
-
"version": "1.0.18-binary-beta.
|
|
3
|
+
"version": "1.0.18-binary-beta.5",
|
|
4
4
|
"description": "aiot shared utils",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=8.0.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"strip-ansi": "^5.2.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "bbcce10c9fe825826a48152d860e67db243a160e"
|
|
35
35
|
}
|