isite 1.14.77 → 1.14.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -0
- package/lib/collection.js +1 -1
- package/lib/sessions.js +228 -228
- package/lib/storage.js +89 -89
- package/lib/ws.js +199 -178
- package/object-options/index.js +3 -2
- package/object-options/lib/prototype.js +142 -100
- package/package.json +1 -1
|
@@ -1,112 +1,154 @@
|
|
|
1
1
|
exports = module.exports = function init(____0) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
function escape(s) {
|
|
3
|
+
if (!s) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
if (typeof s !== 'string') {
|
|
7
|
+
s = s.toString();
|
|
8
|
+
}
|
|
9
|
+
return s.replace(/[\/\\^$*+?.()\[\]{}]/g, '\\$&');
|
|
8
10
|
}
|
|
9
|
-
return s.replace(/[\/\\^$*+?.()\[\]{}]/g, '\\$&');
|
|
10
|
-
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
if (____0.options.proto.object) {
|
|
13
|
+
if (!Object.prototype.test) {
|
|
14
|
+
Object.defineProperty(Object.prototype, 'test', {
|
|
15
|
+
value: function (reg, flag = 'gium') {
|
|
16
|
+
if (this === undefined || this === null) {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
let txt = '';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
if (this.endsWith) {
|
|
22
|
+
txt = this.toString();
|
|
23
|
+
} else if (this.endsWith) {
|
|
24
|
+
txt = this.toISOString;
|
|
25
|
+
} else {
|
|
26
|
+
txt = JSON.stringify(this);
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (!Object.prototype.like) {
|
|
38
|
-
Object.defineProperty(Object.prototype, 'like', {
|
|
39
|
-
value: function (name) {
|
|
40
|
-
if (!name) {
|
|
41
|
-
return !1;
|
|
42
|
-
}
|
|
43
|
-
if (name.indexOf('*') !== -1) {
|
|
44
|
-
name = name.split('*');
|
|
45
|
-
name.forEach((n, i) => {
|
|
46
|
-
name[i] = escape(n);
|
|
29
|
+
try {
|
|
30
|
+
return new RegExp(reg, flag).test(txt);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
return !1;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
47
35
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
36
|
+
}
|
|
37
|
+
if (!Object.prototype.like) {
|
|
38
|
+
Object.defineProperty(Object.prototype, 'like', {
|
|
39
|
+
value: function (name) {
|
|
40
|
+
if (!name) {
|
|
41
|
+
return !1;
|
|
42
|
+
}
|
|
43
|
+
if (name.indexOf('*') !== -1) {
|
|
44
|
+
name = name.split('*');
|
|
45
|
+
name.forEach((n, i) => {
|
|
46
|
+
name[i] = escape(n);
|
|
47
|
+
});
|
|
48
|
+
name = name.join('.*');
|
|
49
|
+
} else {
|
|
50
|
+
name = escape(name);
|
|
51
|
+
}
|
|
52
|
+
return this.test('^' + name + '$', 'gium');
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!Object.prototype.contains) {
|
|
57
|
+
Object.defineProperty(Object.prototype, 'contains', {
|
|
58
|
+
value: function (name) {
|
|
59
|
+
if (!name) {
|
|
60
|
+
return !1;
|
|
61
|
+
}
|
|
62
|
+
return this.test('^.*' + escape(name) + '.*$', 'gium');
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
65
66
|
}
|
|
66
|
-
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
68
|
+
if (____0.options.proto.array) {
|
|
69
|
+
if (!Array.prototype.test) {
|
|
70
|
+
Array.prototype.test = function (reg, flag = 'gium') {
|
|
71
|
+
if (this === undefined || this === null) {
|
|
72
|
+
return !1;
|
|
73
|
+
}
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
n = n.split('*');
|
|
86
|
-
n.forEach((w, i) => {
|
|
87
|
-
n[i] = escape(w);
|
|
88
|
-
});
|
|
89
|
-
n = n.join('.*');
|
|
90
|
-
if (this.test('^' + n + '$', 'gium')) {
|
|
91
|
-
r = !0;
|
|
75
|
+
try {
|
|
76
|
+
let txt = JSON.stringify(this);
|
|
77
|
+
return new RegExp(reg, flag).test(txt);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
return !1;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
92
82
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
if (!Array.prototype.like) {
|
|
84
|
+
Array.prototype.like = function (name) {
|
|
85
|
+
if (!name) {
|
|
86
|
+
return !1;
|
|
87
|
+
}
|
|
88
|
+
if (name.indexOf('*') !== -1) {
|
|
89
|
+
name = name.split('*');
|
|
90
|
+
name.forEach((n, i) => {
|
|
91
|
+
name[i] = escape(n);
|
|
92
|
+
});
|
|
93
|
+
name = name.join('.*');
|
|
94
|
+
} else {
|
|
95
|
+
name = escape(name);
|
|
96
|
+
}
|
|
97
|
+
return this.test('^' + name + '$', 'gium');
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (!Array.prototype.contains) {
|
|
101
|
+
Array.prototype.contains = function (name) {
|
|
102
|
+
if (!name) {
|
|
103
|
+
return !1;
|
|
104
|
+
}
|
|
105
|
+
return this.test('^.*' + escape(name) + '.*$', 'gium');
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (!String.prototype.test) {
|
|
111
|
+
String.prototype.test = function (reg, flag = 'gium') {
|
|
112
|
+
try {
|
|
113
|
+
return new RegExp(reg, flag).test(this);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return !1;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
97
119
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
if (!String.prototype.like) {
|
|
121
|
+
String.prototype.like = function (name) {
|
|
122
|
+
if (!name) {
|
|
123
|
+
return !1;
|
|
124
|
+
}
|
|
125
|
+
let r = !1;
|
|
126
|
+
name.split('|').forEach((n) => {
|
|
127
|
+
n = n.split('*');
|
|
128
|
+
n.forEach((w, i) => {
|
|
129
|
+
n[i] = escape(w);
|
|
130
|
+
});
|
|
131
|
+
n = n.join('.*');
|
|
132
|
+
if (this.test('^' + n + '$', 'gium')) {
|
|
133
|
+
r = !0;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return r;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (!String.prototype.contains) {
|
|
141
|
+
String.prototype.contains = function (name) {
|
|
142
|
+
let r = !1;
|
|
143
|
+
if (!name) {
|
|
144
|
+
return r;
|
|
145
|
+
}
|
|
146
|
+
name.split('|').forEach((n) => {
|
|
147
|
+
if (n && this.test('^.*' + escape(n) + '.*$', 'gium')) {
|
|
148
|
+
r = !0;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return r;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
112
154
|
};
|