isite 2024.12.6 → 2025.1.2
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/apps/client-side/app.js +9 -9
- package/apps/client-side/site_files/js/base64.js +373 -311
- package/index.js +0 -1
- package/lib/mongodb.js +8 -4
- package/object-options/index.js +1 -1
- package/package.json +1 -1
package/apps/client-side/app.js
CHANGED
|
@@ -38,11 +38,11 @@ module.exports = function (site) {
|
|
|
38
38
|
__dirname + '/site_files/js/first.js',
|
|
39
39
|
__dirname + '/site_files/js/jquery.js',
|
|
40
40
|
__dirname + '/site_files/js/mustache.js',
|
|
41
|
-
__dirname + '/site_files/js/base64.js',
|
|
41
|
+
__dirname + '/site_files/js/base64.min.js',
|
|
42
42
|
__dirname + '/site_files/js/site.js',
|
|
43
|
-
__dirname + '/site_files/js/dom-to-image.js',
|
|
43
|
+
__dirname + '/site_files/js/dom-to-image.min.js',
|
|
44
44
|
__dirname + '/site_files/js/barcode.js',
|
|
45
|
-
__dirname + '/site_files/js/qrcode.js',
|
|
45
|
+
__dirname + '/site_files/js/qrcode.min.js',
|
|
46
46
|
__dirname + '/site_files/js/angular.min.js',
|
|
47
47
|
__dirname + '/site_files/js/app.js',
|
|
48
48
|
__dirname + '/site_files/js/directive-core.js',
|
|
@@ -61,11 +61,11 @@ module.exports = function (site) {
|
|
|
61
61
|
__dirname + '/site_files/js/first.js',
|
|
62
62
|
__dirname + '/site_files/js/jquery.js',
|
|
63
63
|
__dirname + '/site_files/js/mustache.js',
|
|
64
|
-
__dirname + '/site_files/js/base64.js',
|
|
64
|
+
__dirname + '/site_files/js/base64.min.js',
|
|
65
65
|
__dirname + '/site_files/js/site.js',
|
|
66
|
-
__dirname + '/site_files/js/dom-to-image.js',
|
|
66
|
+
__dirname + '/site_files/js/dom-to-image.min.js',
|
|
67
67
|
__dirname + '/site_files/js/barcode.js',
|
|
68
|
-
__dirname + '/site_files/js/qrcode.js',
|
|
68
|
+
__dirname + '/site_files/js/qrcode.min.js',
|
|
69
69
|
__dirname + '/site_files/js/angular.min.js',
|
|
70
70
|
__dirname + '/site_files/js/app.js',
|
|
71
71
|
__dirname + '/site_files/js/directive-core.js',
|
|
@@ -87,11 +87,11 @@ module.exports = function (site) {
|
|
|
87
87
|
__dirname + '/site_files/js/first.js',
|
|
88
88
|
__dirname + '/site_files/js/jquery.js',
|
|
89
89
|
__dirname + '/site_files/js/mustache.js',
|
|
90
|
-
__dirname + '/site_files/js/base64.js',
|
|
90
|
+
__dirname + '/site_files/js/base64.min.js',
|
|
91
91
|
__dirname + '/site_files/js/site.js',
|
|
92
|
-
__dirname + '/site_files/js/dom-to-image.js',
|
|
92
|
+
__dirname + '/site_files/js/dom-to-image.min.js',
|
|
93
93
|
__dirname + '/site_files/js/barcode.js',
|
|
94
|
-
__dirname + '/site_files/js/qrcode.js',
|
|
94
|
+
__dirname + '/site_files/js/qrcode.min.js',
|
|
95
95
|
__dirname + '/site_files/js/angular.min.js',
|
|
96
96
|
__dirname + '/site_files/js/app.js',
|
|
97
97
|
__dirname + '/site_files/js/directive-core.js',
|
|
@@ -1,319 +1,381 @@
|
|
|
1
|
-
//
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
|
|
3
|
-
//
|
|
4
|
-
;
|
|
5
1
|
(function (global, factory) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
if (global.Meteor) { // Meteor.js
|
|
20
|
-
Base64 = gBase64;
|
|
21
|
-
}
|
|
22
|
-
global.Base64 = gBase64;
|
|
23
|
-
})();
|
|
24
|
-
}((typeof self !== 'undefined' ? self
|
|
25
|
-
: typeof window !== 'undefined' ? window
|
|
26
|
-
: typeof global !== 'undefined' ? global
|
|
27
|
-
: this), function () {
|
|
28
|
-
'use strict';
|
|
29
|
-
/**
|
|
30
|
-
* base64.ts
|
|
31
|
-
*
|
|
32
|
-
* Licensed under the BSD 3-Clause License.
|
|
33
|
-
* http://opensource.org/licenses/BSD-3-Clause
|
|
34
|
-
*
|
|
35
|
-
* References:
|
|
36
|
-
* http://en.wikipedia.org/wiki/Base64
|
|
37
|
-
*
|
|
38
|
-
* @author Dan Kogai (https://github.com/dankogai)
|
|
39
|
-
*/
|
|
40
|
-
var version = '3.7.2';
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated use lowercase `version`.
|
|
43
|
-
*/
|
|
44
|
-
var VERSION = version;
|
|
45
|
-
var _hasatob = typeof atob === 'function';
|
|
46
|
-
var _hasbtoa = typeof btoa === 'function';
|
|
47
|
-
var _hasBuffer = typeof Buffer === 'function';
|
|
48
|
-
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
49
|
-
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
50
|
-
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
51
|
-
var b64chs = Array.prototype.slice.call(b64ch);
|
|
52
|
-
var b64tab = (function (a) {
|
|
53
|
-
var tab = {};
|
|
54
|
-
a.forEach(function (c, i) { return tab[c] = i; });
|
|
55
|
-
return tab;
|
|
56
|
-
})(b64chs);
|
|
57
|
-
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
58
|
-
var _fromCC = String.fromCharCode.bind(String);
|
|
59
|
-
var _U8Afrom = typeof Uint8Array.from === 'function'
|
|
60
|
-
? Uint8Array.from.bind(Uint8Array)
|
|
61
|
-
: function (it, fn) {
|
|
62
|
-
if (fn === void 0) { fn = function (x) { return x; }; }
|
|
63
|
-
return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
3
|
+
? (module.exports = factory())
|
|
4
|
+
: typeof define === 'function' && define.amd
|
|
5
|
+
? define(factory)
|
|
6
|
+
: // cf. https://github.com/dankogai/js-base64/issues/119
|
|
7
|
+
(function () {
|
|
8
|
+
// existing version for noConflict()
|
|
9
|
+
var _Base64 = global.Base64;
|
|
10
|
+
var gBase64 = factory();
|
|
11
|
+
gBase64.noConflict = function () {
|
|
12
|
+
global.Base64 = _Base64;
|
|
13
|
+
return gBase64;
|
|
64
14
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* polyfill version of `btoa`
|
|
70
|
-
*/
|
|
71
|
-
var btoaPolyfill = function (bin) {
|
|
72
|
-
// console.log('polyfilled');
|
|
73
|
-
var u32, c0, c1, c2, asc = '';
|
|
74
|
-
var pad = bin.length % 3;
|
|
75
|
-
for (var i = 0; i < bin.length;) {
|
|
76
|
-
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
77
|
-
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
78
|
-
(c2 = bin.charCodeAt(i++)) > 255)
|
|
79
|
-
throw new TypeError('invalid character found');
|
|
80
|
-
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
81
|
-
asc += b64chs[u32 >> 18 & 63]
|
|
82
|
-
+ b64chs[u32 >> 12 & 63]
|
|
83
|
-
+ b64chs[u32 >> 6 & 63]
|
|
84
|
-
+ b64chs[u32 & 63];
|
|
15
|
+
if (global.Meteor) {
|
|
16
|
+
// Meteor.js
|
|
17
|
+
Base64 = gBase64;
|
|
85
18
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
19
|
+
global.Base64 = gBase64;
|
|
20
|
+
})();
|
|
21
|
+
})(typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this, function () {
|
|
22
|
+
'use strict';
|
|
23
|
+
/**
|
|
24
|
+
* base64.ts
|
|
25
|
+
*
|
|
26
|
+
* Licensed under the BSD 3-Clause License.
|
|
27
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
28
|
+
*
|
|
29
|
+
* References:
|
|
30
|
+
* http://en.wikipedia.org/wiki/Base64
|
|
31
|
+
*
|
|
32
|
+
* @author Dan Kogai (https://github.com/dankogai)
|
|
33
|
+
*/
|
|
34
|
+
var version = '3.7.2';
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use lowercase `version`.
|
|
37
|
+
*/
|
|
38
|
+
var VERSION = version;
|
|
39
|
+
var _hasatob = typeof atob === 'function';
|
|
40
|
+
var _hasbtoa = typeof btoa === 'function';
|
|
41
|
+
var _hasBuffer = typeof Buffer === 'function';
|
|
42
|
+
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
43
|
+
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
44
|
+
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
45
|
+
var b64chs = Array.prototype.slice.call(b64ch);
|
|
46
|
+
var b64tab = (function (a) {
|
|
47
|
+
var tab = {};
|
|
48
|
+
a.forEach(function (c, i) {
|
|
49
|
+
return (tab[c] = i);
|
|
50
|
+
});
|
|
51
|
+
return tab;
|
|
52
|
+
})(b64chs);
|
|
53
|
+
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
54
|
+
var _fromCC = String.fromCharCode.bind(String);
|
|
55
|
+
var _U8Afrom =
|
|
56
|
+
typeof Uint8Array.from === 'function'
|
|
57
|
+
? Uint8Array.from.bind(Uint8Array)
|
|
58
|
+
: function (it, fn) {
|
|
59
|
+
if (fn === void 0) {
|
|
60
|
+
fn = function (x) {
|
|
61
|
+
return x;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
|
|
106
65
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
66
|
+
var _mkUriSafe = function (src) {
|
|
67
|
+
return src.replace(/=/g, '').replace(/[+\/]/g, function (m0) {
|
|
68
|
+
return m0 == '+' ? '-' : '_';
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
var _tidyB64 = function (s) {
|
|
72
|
+
return s.replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* polyfill version of `btoa`
|
|
76
|
+
*/
|
|
77
|
+
var btoaPolyfill = function (bin) {
|
|
78
|
+
// console.log('polyfilled');
|
|
79
|
+
var u32,
|
|
80
|
+
c0,
|
|
81
|
+
c1,
|
|
82
|
+
c2,
|
|
83
|
+
asc = '';
|
|
84
|
+
var pad = bin.length % 3;
|
|
85
|
+
for (var i = 0; i < bin.length; ) {
|
|
86
|
+
if ((c0 = bin.charCodeAt(i++)) > 255 || (c1 = bin.charCodeAt(i++)) > 255 || (c2 = bin.charCodeAt(i++)) > 255) throw new TypeError('invalid character found');
|
|
87
|
+
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
88
|
+
asc += b64chs[(u32 >> 18) & 63] + b64chs[(u32 >> 12) & 63] + b64chs[(u32 >> 6) & 63] + b64chs[u32 & 63];
|
|
89
|
+
}
|
|
90
|
+
return pad ? asc.slice(0, pad - 3) + '==='.substring(pad) : asc;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* does what `window.btoa` of web browsers do.
|
|
94
|
+
* @param {String} bin binary string
|
|
95
|
+
* @returns {string} Base64-encoded string
|
|
96
|
+
*/
|
|
97
|
+
var _btoa = _hasbtoa
|
|
98
|
+
? function (bin) {
|
|
99
|
+
return btoa(bin);
|
|
100
|
+
}
|
|
101
|
+
: _hasBuffer
|
|
102
|
+
? function (bin) {
|
|
103
|
+
return Buffer.from(bin, 'binary').toString('base64');
|
|
104
|
+
}
|
|
105
|
+
: btoaPolyfill;
|
|
106
|
+
var _fromUint8Array = _hasBuffer
|
|
107
|
+
? function (u8a) {
|
|
108
|
+
return Buffer.from(u8a).toString('base64');
|
|
109
|
+
}
|
|
110
|
+
: function (u8a) {
|
|
111
|
+
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
112
|
+
var maxargs = 0x1000;
|
|
113
|
+
var strs = [];
|
|
114
|
+
for (var i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
115
|
+
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
128
116
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
117
|
+
return _btoa(strs.join(''));
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* converts a Uint8Array to a Base64 string.
|
|
121
|
+
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
122
|
+
* @returns {string} Base64 string
|
|
123
|
+
*/
|
|
124
|
+
var fromUint8Array = function (u8a, urlsafe) {
|
|
125
|
+
if (urlsafe === void 0) {
|
|
126
|
+
urlsafe = false;
|
|
127
|
+
}
|
|
128
|
+
return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
129
|
+
};
|
|
130
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
131
|
+
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
132
|
+
// reverting good old fationed regexp
|
|
133
|
+
var cb_utob = function (c) {
|
|
134
|
+
if (c.length < 2) {
|
|
135
|
+
var cc = c.charCodeAt(0);
|
|
136
|
+
return cc < 0x80
|
|
137
|
+
? c
|
|
138
|
+
: cc < 0x800
|
|
139
|
+
? _fromCC(0xc0 | (cc >>> 6)) + _fromCC(0x80 | (cc & 0x3f))
|
|
140
|
+
: _fromCC(0xe0 | ((cc >>> 12) & 0x0f)) + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) + _fromCC(0x80 | (cc & 0x3f));
|
|
141
|
+
} else {
|
|
142
|
+
var cc = 0x10000 + (c.charCodeAt(0) - 0xd800) * 0x400 + (c.charCodeAt(1) - 0xdc00);
|
|
143
|
+
return _fromCC(0xf0 | ((cc >>> 18) & 0x07)) + _fromCC(0x80 | ((cc >>> 12) & 0x3f)) + _fromCC(0x80 | ((cc >>> 6) & 0x3f)) + _fromCC(0x80 | (cc & 0x3f));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
147
|
+
/**
|
|
148
|
+
* @deprecated should have been internal use only.
|
|
149
|
+
* @param {string} src UTF-8 string
|
|
150
|
+
* @returns {string} UTF-16 string
|
|
151
|
+
*/
|
|
152
|
+
var utob = function (u) {
|
|
153
|
+
return u.replace(re_utob, cb_utob);
|
|
154
|
+
};
|
|
155
|
+
//
|
|
156
|
+
var _encode = _hasBuffer
|
|
157
|
+
? function (s) {
|
|
158
|
+
return Buffer.from(s, 'utf8').toString('base64');
|
|
159
|
+
}
|
|
160
|
+
: _TE
|
|
161
|
+
? function (s) {
|
|
162
|
+
return _fromUint8Array(_TE.encode(s));
|
|
163
|
+
}
|
|
164
|
+
: function (s) {
|
|
165
|
+
return _btoa(utob(s));
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* converts a UTF-8-encoded string to a Base64 string.
|
|
169
|
+
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
170
|
+
* @returns {string} Base64 string
|
|
171
|
+
*/
|
|
172
|
+
var encode = function (src, urlsafe) {
|
|
173
|
+
if (urlsafe === void 0) {
|
|
174
|
+
urlsafe = false;
|
|
175
|
+
}
|
|
176
|
+
return urlsafe ? _mkUriSafe(_encode(src)) : _encode(src);
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
180
|
+
* @returns {string} Base64 string
|
|
181
|
+
*/
|
|
182
|
+
var encodeURI = function (src) {
|
|
183
|
+
return encode(src, true);
|
|
184
|
+
};
|
|
185
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
186
|
+
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
187
|
+
// reverting good old fationed regexp
|
|
188
|
+
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
189
|
+
var cb_btou = function (cccc) {
|
|
190
|
+
switch (cccc.length) {
|
|
191
|
+
case 4:
|
|
192
|
+
var cp = ((0x07 & cccc.charCodeAt(0)) << 18) | ((0x3f & cccc.charCodeAt(1)) << 12) | ((0x3f & cccc.charCodeAt(2)) << 6) | (0x3f & cccc.charCodeAt(3)),
|
|
193
|
+
offset = cp - 0x10000;
|
|
194
|
+
return _fromCC((offset >>> 10) + 0xd800) + _fromCC((offset & 0x3ff) + 0xdc00);
|
|
195
|
+
case 3:
|
|
196
|
+
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12) | ((0x3f & cccc.charCodeAt(1)) << 6) | (0x3f & cccc.charCodeAt(2)));
|
|
197
|
+
default:
|
|
198
|
+
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6) | (0x3f & cccc.charCodeAt(1)));
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* @deprecated should have been internal use only.
|
|
203
|
+
* @param {string} src UTF-16 string
|
|
204
|
+
* @returns {string} UTF-8 string
|
|
205
|
+
*/
|
|
206
|
+
var btou = function (b) {
|
|
207
|
+
return b.replace(re_btou, cb_btou);
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* polyfill version of `atob`
|
|
211
|
+
*/
|
|
212
|
+
var atobPolyfill = function (asc) {
|
|
213
|
+
// console.log('polyfilled');
|
|
214
|
+
asc = asc.replace(/\s+/g, '');
|
|
215
|
+
if (!b64re.test(asc)) throw new TypeError('malformed base64.');
|
|
216
|
+
asc += '=='.slice(2 - (asc.length & 3));
|
|
217
|
+
var u24,
|
|
218
|
+
bin = '',
|
|
219
|
+
r1,
|
|
220
|
+
r2;
|
|
221
|
+
for (var i = 0; i < asc.length; ) {
|
|
222
|
+
u24 = (b64tab[asc.charAt(i++)] << 18) | (b64tab[asc.charAt(i++)] << 12) | ((r1 = b64tab[asc.charAt(i++)]) << 6) | (r2 = b64tab[asc.charAt(i++)]);
|
|
223
|
+
bin += r1 === 64 ? _fromCC((u24 >> 16) & 255) : r2 === 64 ? _fromCC((u24 >> 16) & 255, (u24 >> 8) & 255) : _fromCC((u24 >> 16) & 255, (u24 >> 8) & 255, u24 & 255);
|
|
224
|
+
}
|
|
225
|
+
return bin;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* does what `window.atob` of web browsers do.
|
|
229
|
+
* @param {String} asc Base64-encoded string
|
|
230
|
+
* @returns {string} binary string
|
|
231
|
+
*/
|
|
232
|
+
var _atob = _hasatob
|
|
233
|
+
? function (asc) {
|
|
234
|
+
return atob(_tidyB64(asc));
|
|
235
|
+
}
|
|
236
|
+
: _hasBuffer
|
|
237
|
+
? function (asc) {
|
|
238
|
+
return Buffer.from(asc, 'base64').toString('binary');
|
|
239
|
+
}
|
|
240
|
+
: atobPolyfill;
|
|
241
|
+
//
|
|
242
|
+
var _toUint8Array = _hasBuffer
|
|
243
|
+
? function (a) {
|
|
244
|
+
return _U8Afrom(Buffer.from(a, 'base64'));
|
|
245
|
+
}
|
|
246
|
+
: function (a) {
|
|
247
|
+
return _U8Afrom(_atob(a), function (c) {
|
|
248
|
+
return c.charCodeAt(0);
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* converts a Base64 string to a Uint8Array.
|
|
253
|
+
*/
|
|
254
|
+
var toUint8Array = function (a) {
|
|
255
|
+
return _toUint8Array(_unURI(a));
|
|
256
|
+
};
|
|
257
|
+
//
|
|
258
|
+
var _decode = _hasBuffer
|
|
259
|
+
? function (a) {
|
|
260
|
+
return Buffer.from(a, 'base64').toString('utf8');
|
|
261
|
+
}
|
|
262
|
+
: _TD
|
|
263
|
+
? function (a) {
|
|
264
|
+
return _TD.decode(_toUint8Array(a));
|
|
265
|
+
}
|
|
266
|
+
: function (a) {
|
|
267
|
+
return btou(_atob(a));
|
|
268
|
+
};
|
|
269
|
+
var _unURI = function (a) {
|
|
270
|
+
return _tidyB64(
|
|
271
|
+
a.replace(/[-_]/g, function (m0) {
|
|
272
|
+
return m0 == '-' ? '+' : '/';
|
|
273
|
+
})
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* converts a Base64 string to a UTF-8 string.
|
|
278
|
+
* @param {String} src Base64 string. Both normal and URL-safe are supported
|
|
279
|
+
* @returns {string} UTF-8 string
|
|
280
|
+
*/
|
|
281
|
+
var decode = function (src) {
|
|
282
|
+
return _decode(_unURI(src));
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* check if a value is a valid Base64 string
|
|
286
|
+
* @param {String} src a value to check
|
|
287
|
+
*/
|
|
288
|
+
var isValid = function (src) {
|
|
289
|
+
if (typeof src !== 'string') return false;
|
|
290
|
+
var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
|
|
291
|
+
return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
|
|
292
|
+
};
|
|
293
|
+
//
|
|
294
|
+
var _noEnum = function (v) {
|
|
295
|
+
return {
|
|
296
|
+
value: v,
|
|
297
|
+
enumerable: false,
|
|
298
|
+
writable: true,
|
|
299
|
+
configurable: true,
|
|
281
300
|
};
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* extend String.prototype with relevant methods
|
|
304
|
+
*/
|
|
305
|
+
var extendString = function () {
|
|
306
|
+
var _add = function (name, body) {
|
|
307
|
+
return Object.defineProperty(String.prototype, name, _noEnum(body));
|
|
288
308
|
};
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
_add('fromBase64', function () {
|
|
310
|
+
return decode(this);
|
|
311
|
+
});
|
|
312
|
+
_add('toBase64', function (urlsafe) {
|
|
313
|
+
return encode(this, urlsafe);
|
|
314
|
+
});
|
|
315
|
+
_add('toBase64URI', function () {
|
|
316
|
+
return encode(this, true);
|
|
317
|
+
});
|
|
318
|
+
_add('toBase64URL', function () {
|
|
319
|
+
return encode(this, true);
|
|
320
|
+
});
|
|
321
|
+
_add('toUint8Array', function () {
|
|
322
|
+
return toUint8Array(this);
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* extend Uint8Array.prototype with relevant methods
|
|
327
|
+
*/
|
|
328
|
+
var extendUint8Array = function () {
|
|
329
|
+
var _add = function (name, body) {
|
|
330
|
+
return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
|
|
310
331
|
};
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
})
|
|
332
|
+
_add('toBase64', function (urlsafe) {
|
|
333
|
+
return fromUint8Array(this, urlsafe);
|
|
334
|
+
});
|
|
335
|
+
_add('toBase64URI', function () {
|
|
336
|
+
return fromUint8Array(this, true);
|
|
337
|
+
});
|
|
338
|
+
_add('toBase64URL', function () {
|
|
339
|
+
return fromUint8Array(this, true);
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* extend Builtin prototypes with relevant methods
|
|
344
|
+
*/
|
|
345
|
+
var extendBuiltins = function () {
|
|
346
|
+
extendString();
|
|
347
|
+
extendUint8Array();
|
|
348
|
+
};
|
|
349
|
+
var gBase64 = {
|
|
350
|
+
version: version,
|
|
351
|
+
VERSION: VERSION,
|
|
352
|
+
atob: _atob,
|
|
353
|
+
atobPolyfill: atobPolyfill,
|
|
354
|
+
btoa: _btoa,
|
|
355
|
+
btoaPolyfill: btoaPolyfill,
|
|
356
|
+
fromBase64: decode,
|
|
357
|
+
toBase64: encode,
|
|
358
|
+
encode: encode,
|
|
359
|
+
encodeURI: encodeURI,
|
|
360
|
+
encodeURL: encodeURI,
|
|
361
|
+
utob: utob,
|
|
362
|
+
btou: btou,
|
|
363
|
+
decode: decode,
|
|
364
|
+
isValid: isValid,
|
|
365
|
+
fromUint8Array: fromUint8Array,
|
|
366
|
+
toUint8Array: toUint8Array,
|
|
367
|
+
extendString: extendString,
|
|
368
|
+
extendUint8Array: extendUint8Array,
|
|
369
|
+
extendBuiltins: extendBuiltins,
|
|
370
|
+
};
|
|
371
|
+
//
|
|
372
|
+
// export Base64 to the namespace
|
|
373
|
+
//
|
|
374
|
+
// ES5 is yet to have Object.assign() that may make transpilers unhappy.
|
|
375
|
+
// gBase64.Base64 = Object.assign({}, gBase64);
|
|
376
|
+
gBase64.Base64 = {};
|
|
377
|
+
Object.keys(gBase64).forEach(function (k) {
|
|
378
|
+
return (gBase64.Base64[k] = gBase64[k]);
|
|
379
|
+
});
|
|
380
|
+
return gBase64;
|
|
381
|
+
});
|
package/index.js
CHANGED
|
@@ -24,7 +24,6 @@ module.exports = function init(options) {
|
|
|
24
24
|
____0.fs = require('node:fs');
|
|
25
25
|
____0.path = require('node:path');
|
|
26
26
|
____0.child_process = require('node:child_process');
|
|
27
|
-
____0.cluster = require('node:cluster');
|
|
28
27
|
____0.zlib = require('zlib');
|
|
29
28
|
____0.xlsx = ____0.XLSX = require('xlsx');
|
|
30
29
|
____0.pdf = ____0.PDF = require('pdf-lib');
|
package/lib/mongodb.js
CHANGED
|
@@ -21,8 +21,13 @@ module.exports = function init(____0) {
|
|
|
21
21
|
|
|
22
22
|
_mongo.ObjectId = mongodb.ObjectId;
|
|
23
23
|
_mongo.ObjectID = function (_id) {
|
|
24
|
-
if (typeof _id === 'string' && _id
|
|
25
|
-
|
|
24
|
+
if (_id && typeof _id === 'string' && /^[a-fA-F0-9]{24}$/.test(_id)) {
|
|
25
|
+
try {
|
|
26
|
+
return new _mongo.ObjectId(_id);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
return new _mongo.ObjectId();
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
return new _mongo.ObjectId();
|
|
28
33
|
};
|
|
@@ -66,7 +71,6 @@ module.exports = function init(____0) {
|
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
if (typeof doc === 'object') {
|
|
69
|
-
|
|
70
74
|
delete doc.$req;
|
|
71
75
|
delete doc.$res;
|
|
72
76
|
|
|
@@ -76,7 +80,7 @@ module.exports = function init(____0) {
|
|
|
76
80
|
|
|
77
81
|
for (let key in doc) {
|
|
78
82
|
if (key === '_id') {
|
|
79
|
-
if (typeof doc[key] === 'string') {
|
|
83
|
+
if (doc[key] && typeof doc[key] === 'string' && /^[a-fA-F0-9]{24}$/.test(doc[key])) {
|
|
80
84
|
doc[key] = _mongo.ObjectID(doc[key]);
|
|
81
85
|
}
|
|
82
86
|
} else if (key === 'id') {
|
package/object-options/index.js
CHANGED