MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / CSV

Function CSV

public/iframe/lib/js/commonFun.js:647–665  ·  view source on GitHub ↗
(csvString)

Source from the content-addressed store, hash-verified

645 })
646 },
647 CSV(csvString) {
648 const data = [];
649 const relArr = csvString.split(/\s+/); // '\r'
650 if (relArr.length > 1) {
651 const title = relArr[0].split(',');
652 let title_arr = title.keys();
653 for (let key = 1, len = relArr.length - 1; key < len; key++) {
654 const values = relArr[key];
655 const objArr = values.split(",");
656 const obj = {};
657 for (let i = 0; i < title.length; i++) {
658 obj[title[title_arr.next().value]] = objArr[i];
659 }
660 data.push(obj);
661 title_arr = title.keys();
662 }
663 }
664 return data;
665 },
666 objectUrlEval(data, type, isEdit, result = '') {
667 // 此方法的用法:
668 // 若存在 此数据结构的数据 ps: a: { b: c: { d: { name: 'xx'}} }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected