Skip to content

Commit 606f8d5

Browse files
committed
add $js for t3
1 parent 85b5899 commit 606f8d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/renderer/src/utils/drpy/drpy3.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const pre = () => {
9292
let rule = {};
9393
// @ts-ignore
9494
let vercode = typeof pdfl === 'function' ? 'drpy3.1' : 'drpy3';
95-
const VERSION = `${vercode} 3.9.50beta5 202400502`;
95+
const VERSION = `${vercode} 3.9.50beta6 202400504`;
9696
/** 已知问题记录
9797
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
9898
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
@@ -150,6 +150,14 @@ const URLJOIN_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/; // 需
150150
const SELECT_REGEX = /:eq|:lt|:gt|#/g;
151151
const SELECT_REGEX_A = /:eq|:lt|:gt/g;
152152

153+
// 增加$js工具,支持$js.toString(()=>{});
154+
const $js = {
155+
toString(func) {
156+
let strfun = func.toString();
157+
return strfun.replace(/^\(\)(\s+)?=>(\s+)?\{/, "js:").replace(/\}$/,'');
158+
}
159+
};
160+
153161
function window_b64() {
154162
let b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
155163
let base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
@@ -2847,6 +2855,7 @@ const keepUnUse = {
28472855
fixAdM3u8, fixAdM3u8Ai, // ad
28482856
base64Encode, md5, decodeStr, RSA, // encryption and decryption
28492857
clearItem, // cache
2858+
$js, // $工具
28502859
};
28512860
let temp = _;
28522861
temp.stringify({});

0 commit comments

Comments
 (0)