1. {
    2. "features": {
    3. "code": "key_14z65m53jry",
    4. "explain": "json 转 markdown",
    5. "cmds": [
    6. {
    7. "label": " json 转 markdown",
    8. "type": "regex",
    9. "match": "/^(\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/",
    10. "minNum": 1
    11. }
    12. ],
    13. "icon": "logo/javascript.png",
    14. "platform": [
    15. "win32",
    16. "darwin",
    17. "linux"
    18. ]
    19. },
    20. "program": "javascript",
    21. "cmd": "var jjj = {{ClipText}}\n// jjj = jjj.parseJSON()\n\n\nfunction vtypeof(p){\n if (p == null) {\n return \" \"\n } else {\n switch(p.constructor){\n case Array:return \"array\";break;\n case Object:return \"object\";break;\n default: return typeof(p);\n }\n }\n}\n\nfunction j2m(j, tier) {\n let textArr = []\n symbol = '- - '\n if (j.constructor == Array && j.length > 0) {\n textArr = textArr.concat(j2m(j[0], tier))\n return textArr\n }\n if (j.constructor == Object) {\n for (let key in j) {\n \n var theType = vtypeof (j[key])\n s = \"| \" + symbol.repeat(tier) + key + \" | \" + theType + \" | 无 |\"\n textArr.push(s)\n if (j[key] != null && (j[key].constructor == Array || j[key].constructor == Object)) {\n textArr = textArr.concat(j2m(j[key], tier + 1))\n }\n }\n return textArr\n }\n return textArr\n}\n\nvar t = j2m(jjj, 0)\n\nret = \"|参数|类型|描述|\\n|:-------|:-------|:-------|\\n\"\n\nfor (let key in t) {\n ret += t[key] + \"\\n\"\n}\n\nconsole.log(ret)\n",
    22. "output": "send",
    23. "hasSubInput": false,
    24. "scptarg": "",
    25. "charset": {
    26. "scriptCode": "",
    27. "outputCode": ""
    28. },
    29. "tags": [
    30. "string"
    31. ]
    32. }