@miqro/core 1.3.9 → 1.3.11
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/dist/handler/common/context.d.ts +2 -10
- package/dist/handler/common/context.js +4 -4
- package/dist/handler/common/context.js.map +1 -1
- package/dist/handler/middleware/cookie.js +2 -2
- package/dist/handler/middleware/cookie.js.map +1 -1
- package/dist/util/index.js +0 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/session/service.js +2 -2
- package/dist/util/session/service.js.map +1 -1
- package/package.json +8 -2
- package/src/handler/common/context.ts +5 -14
- package/src/handler/middleware/cookie.ts +12 -12
- package/src/util/index.ts +0 -2
- package/src/util/session/service.ts +126 -126
- package/dist/util/cookie/cookie.d.ts +0 -50
- package/dist/util/cookie/cookie.js +0 -168
- package/dist/util/cookie/cookie.js.map +0 -1
- package/dist/util/cookie/index.d.ts +0 -16
- package/dist/util/cookie/index.js +0 -9
- package/dist/util/cookie/index.js.map +0 -1
- package/dist/util/uuid/index.d.ts +0 -7
- package/dist/util/uuid/index.js +0 -8
- package/dist/util/uuid/index.js.map +0 -1
- package/dist/util/uuid/regex.d.ts +0 -2
- package/dist/util/uuid/regex.js +0 -5
- package/dist/util/uuid/regex.js.map +0 -1
- package/dist/util/uuid/rng.d.ts +0 -1
- package/dist/util/uuid/rng.js +0 -18
- package/dist/util/uuid/rng.js.map +0 -1
- package/dist/util/uuid/stringify.d.ts +0 -2
- package/dist/util/uuid/stringify.js +0 -50
- package/dist/util/uuid/stringify.js.map +0 -1
- package/dist/util/uuid/v4.d.ts +0 -5
- package/dist/util/uuid/v4.js +0 -27
- package/dist/util/uuid/v4.js.map +0 -1
- package/dist/util/uuid/validate.d.ts +0 -2
- package/dist/util/uuid/validate.js +0 -12
- package/dist/util/uuid/validate.js.map +0 -1
- package/src/util/cookie/cookie.ts +0 -207
- package/src/util/cookie/index.ts +0 -6
- package/src/util/uuid/index.ts +0 -5
- package/src/util/uuid/regex.ts +0 -2
- package/src/util/uuid/rng.ts +0 -14
- package/src/util/uuid/stringify.ts +0 -53
- package/src/util/uuid/v4.ts +0 -30
- package/src/util/uuid/validate.ts +0 -8
- package/test.md +0 -0
- package/tsconfig-test.json +0 -13
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// https://github.com/uuidjs/uuid/blob/main/src/stringify.js
|
|
2
|
-
|
|
3
|
-
import validate from './validate';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
7
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
8
|
-
*/
|
|
9
|
-
const byteToHex: string[] = [];
|
|
10
|
-
|
|
11
|
-
for (let i = 0; i < 256; ++i) {
|
|
12
|
-
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const stringify = (arr: Uint8Array, offset = 0): string => {
|
|
16
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
17
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
18
|
-
const uuid = (
|
|
19
|
-
byteToHex[arr[offset + 0]] +
|
|
20
|
-
byteToHex[arr[offset + 1]] +
|
|
21
|
-
byteToHex[arr[offset + 2]] +
|
|
22
|
-
byteToHex[arr[offset + 3]] +
|
|
23
|
-
'-' +
|
|
24
|
-
byteToHex[arr[offset + 4]] +
|
|
25
|
-
byteToHex[arr[offset + 5]] +
|
|
26
|
-
'-' +
|
|
27
|
-
byteToHex[arr[offset + 6]] +
|
|
28
|
-
byteToHex[arr[offset + 7]] +
|
|
29
|
-
'-' +
|
|
30
|
-
byteToHex[arr[offset + 8]] +
|
|
31
|
-
byteToHex[arr[offset + 9]] +
|
|
32
|
-
'-' +
|
|
33
|
-
byteToHex[arr[offset + 10]] +
|
|
34
|
-
byteToHex[arr[offset + 11]] +
|
|
35
|
-
byteToHex[arr[offset + 12]] +
|
|
36
|
-
byteToHex[arr[offset + 13]] +
|
|
37
|
-
byteToHex[arr[offset + 14]] +
|
|
38
|
-
byteToHex[arr[offset + 15]]
|
|
39
|
-
).toLowerCase();
|
|
40
|
-
|
|
41
|
-
// Consistency check for valid UUID. If this throws, it's likely due to one
|
|
42
|
-
// of the following:
|
|
43
|
-
// - One or more input array values don't map to a hex octet (leading to
|
|
44
|
-
// "undefined" in the uuid)
|
|
45
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
|
46
|
-
if (!validate(uuid)) {
|
|
47
|
-
throw TypeError('Stringified UUID is invalid');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return uuid;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default stringify;
|
package/src/util/uuid/v4.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// https://github.com/uuidjs/uuid/blob/main/src/v4.js
|
|
2
|
-
|
|
3
|
-
import rng from './rng';
|
|
4
|
-
import stringify from './stringify';
|
|
5
|
-
|
|
6
|
-
export const v4 = (options?: {
|
|
7
|
-
random?: Uint8Array;
|
|
8
|
-
rng?: () => Uint8Array;
|
|
9
|
-
}, buf?: Buffer, offset?: number) => {
|
|
10
|
-
options = options || {};
|
|
11
|
-
|
|
12
|
-
const rnds: Uint8Array = options.random || (options.rng || rng)();
|
|
13
|
-
|
|
14
|
-
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
15
|
-
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
16
|
-
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
17
|
-
|
|
18
|
-
// Copy bytes to buffer, if provided
|
|
19
|
-
if (buf) {
|
|
20
|
-
offset = offset || 0;
|
|
21
|
-
|
|
22
|
-
for (let i = 0; i < 16; ++i) {
|
|
23
|
-
buf[offset + i] = rnds[i];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return buf;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return stringify(rnds);
|
|
30
|
-
}
|
package/test.md
DELETED
|
File without changes
|