有这种工具吗?
n=3
'':{ '':{ '':{ } } }
n=2
'':{ '':{ } }
function getJson(n) { const json = {}; let curr = json; for (let i = 0; i < n; i++) { curr[''] = {}; curr = curr['']; } return JSON.stringify(json, null, 2); }
@dislido 函数调用输出字符,可以用作snippet,可以在编辑器输出?
@chapgaga 我写过,不过是基于文本正则递归替换。你可以参考下我的库:https://github.com/wujianqi/shai
m.make({ makerOption:[2, 3, 'childrens'], // 对象嵌套3次,每次循环2次 prop: { } });
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
@dislido 函数调用输出字符,可以用作snippet,可以在编辑器输出?
@chapgaga 我写过,不过是基于文本正则递归替换。你可以参考下我的库:https://github.com/wujianqi/shai