@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.
Files changed (48) hide show
  1. package/dist/handler/common/context.d.ts +2 -10
  2. package/dist/handler/common/context.js +4 -4
  3. package/dist/handler/common/context.js.map +1 -1
  4. package/dist/handler/middleware/cookie.js +2 -2
  5. package/dist/handler/middleware/cookie.js.map +1 -1
  6. package/dist/util/index.js +0 -2
  7. package/dist/util/index.js.map +1 -1
  8. package/dist/util/session/service.js +2 -2
  9. package/dist/util/session/service.js.map +1 -1
  10. package/package.json +8 -2
  11. package/src/handler/common/context.ts +5 -14
  12. package/src/handler/middleware/cookie.ts +12 -12
  13. package/src/util/index.ts +0 -2
  14. package/src/util/session/service.ts +126 -126
  15. package/dist/util/cookie/cookie.d.ts +0 -50
  16. package/dist/util/cookie/cookie.js +0 -168
  17. package/dist/util/cookie/cookie.js.map +0 -1
  18. package/dist/util/cookie/index.d.ts +0 -16
  19. package/dist/util/cookie/index.js +0 -9
  20. package/dist/util/cookie/index.js.map +0 -1
  21. package/dist/util/uuid/index.d.ts +0 -7
  22. package/dist/util/uuid/index.js +0 -8
  23. package/dist/util/uuid/index.js.map +0 -1
  24. package/dist/util/uuid/regex.d.ts +0 -2
  25. package/dist/util/uuid/regex.js +0 -5
  26. package/dist/util/uuid/regex.js.map +0 -1
  27. package/dist/util/uuid/rng.d.ts +0 -1
  28. package/dist/util/uuid/rng.js +0 -18
  29. package/dist/util/uuid/rng.js.map +0 -1
  30. package/dist/util/uuid/stringify.d.ts +0 -2
  31. package/dist/util/uuid/stringify.js +0 -50
  32. package/dist/util/uuid/stringify.js.map +0 -1
  33. package/dist/util/uuid/v4.d.ts +0 -5
  34. package/dist/util/uuid/v4.js +0 -27
  35. package/dist/util/uuid/v4.js.map +0 -1
  36. package/dist/util/uuid/validate.d.ts +0 -2
  37. package/dist/util/uuid/validate.js +0 -12
  38. package/dist/util/uuid/validate.js.map +0 -1
  39. package/src/util/cookie/cookie.ts +0 -207
  40. package/src/util/cookie/index.ts +0 -6
  41. package/src/util/uuid/index.ts +0 -5
  42. package/src/util/uuid/regex.ts +0 -2
  43. package/src/util/uuid/rng.ts +0 -14
  44. package/src/util/uuid/stringify.ts +0 -53
  45. package/src/util/uuid/v4.ts +0 -30
  46. package/src/util/uuid/validate.ts +0 -8
  47. package/test.md +0 -0
  48. 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;
@@ -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
- }
@@ -1,8 +0,0 @@
1
- // https://github.com/uuidjs/uuid/blob/main/src/validate.js
2
- import REGEX from './regex';
3
-
4
- const validate = (uuid: string) => {
5
- return typeof uuid === 'string' && REGEX.test(uuid);
6
- }
7
-
8
- export default validate;
package/test.md DELETED
File without changes
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./test-dist/",
5
- },
6
- "include": [
7
- "src/**/*",
8
- "test/**/*"
9
- ],
10
- "exclude": [
11
- "node_modules/"
12
- ]
13
- }