-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.js
More file actions
32 lines (27 loc) · 708 Bytes
/
config.js
File metadata and controls
32 lines (27 loc) · 708 Bytes
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
26
27
28
29
30
31
32
.pragma library
.import "interceptor_base.js" as INTERCEPTOR
let interceptors = [];
function intercept(incomming_interceptors)
{
if (Array.isArray(incomming_interceptors))
{
for (let item of incomming_interceptors)
{
if (!item instanceof INTERCEPTOR.InterceptorBase)
{
throw "Invalid interceptor";
}
interceptors.push(item);
}
}
if (!incomming_interceptors instanceof INTERCEPTOR.InterceptorBase)
{
throw "Invalid interceptor";
}
interceptors.push(incomming_interceptors);
}
function reset(config={"interceptor": true})
{
if (config.interceptor)
interceptors = [];
}