MCPcopy Index your code
hub / github.com/XIU2/UserScript / customStringify

Function customStringify

Autopage.user.js:2796–2801  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

2794
2795 // 自定义的 stringify 函数,将 [ ] 内的元素从默认的 换行显示 格式化为 一行显示,用于显示自定义翻页规则等给用户看的场景
2796 function customStringify(obj) {
2797 return JSON.stringify(obj, null, 4)
2798 .replace(/(: \[)([\s\S]*?)(\],?\n)/g, (match, p1, p2, p3) => {
2799 return p1 + p2.replace(/\n/g, '').replace(/\s{4}/g, '') + p3;
2800 });
2801 }
2802
2803 // 显示页码
2804 function pageNumber(type) {

Callers 1

customRulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected