@twin.org/web 0.0.2-next.14 → 0.0.2-next.16

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.
@@ -741,18 +741,18 @@ class HeaderHelper {
741
741
  }
742
742
  return `Bearer ${token.trim()}`;
743
743
  }
744
- return undefined;
744
+ return "";
745
745
  }
746
746
  /**
747
747
  * Extract the bearer token from a header.
748
748
  * @param header The header value to extract the token from.
749
749
  * @returns The extracted token if it exists.
750
750
  */
751
- static extractBearerToken(header) {
751
+ static extractBearer(header) {
752
752
  if (core.Is.stringValue(header) && header.startsWith("Bearer ")) {
753
753
  return header.slice(7, header.length).trim();
754
754
  }
755
- return undefined;
755
+ return "";
756
756
  }
757
757
  }
758
758
 
@@ -739,18 +739,18 @@ class HeaderHelper {
739
739
  }
740
740
  return `Bearer ${token.trim()}`;
741
741
  }
742
- return undefined;
742
+ return "";
743
743
  }
744
744
  /**
745
745
  * Extract the bearer token from a header.
746
746
  * @param header The header value to extract the token from.
747
747
  * @returns The extracted token if it exists.
748
748
  */
749
- static extractBearerToken(header) {
749
+ static extractBearer(header) {
750
750
  if (Is.stringValue(header) && header.startsWith("Bearer ")) {
751
751
  return header.slice(7, header.length).trim();
752
752
  }
753
- return undefined;
753
+ return "";
754
754
  }
755
755
  }
756
756
 
@@ -7,11 +7,11 @@ export declare class HeaderHelper {
7
7
  * @param token The token to create the header for.
8
8
  * @returns The bearer token header.
9
9
  */
10
- static createBearer(token: string): string | undefined;
10
+ static createBearer(token: unknown): string;
11
11
  /**
12
12
  * Extract the bearer token from a header.
13
13
  * @param header The header value to extract the token from.
14
14
  * @returns The extracted token if it exists.
15
15
  */
16
- static extractBearerToken(header: unknown): string | undefined;
16
+ static extractBearer(header: unknown): string;
17
17
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @twin.org/web - Changelog
2
2
 
3
+ ## [0.0.2-next.16](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.15...web-v0.0.2-next.16) (2025-09-28)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **web:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/core bumped from 0.0.2-next.15 to 0.0.2-next.16
16
+ * @twin.org/crypto bumped from 0.0.2-next.15 to 0.0.2-next.16
17
+ * @twin.org/nameof bumped from 0.0.2-next.15 to 0.0.2-next.16
18
+ * devDependencies
19
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.15 to 0.0.2-next.16
20
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.15 to 0.0.2-next.16
21
+
22
+ ## [0.0.2-next.15](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.14...web-v0.0.2-next.15) (2025-09-22)
23
+
24
+
25
+ ### Features
26
+
27
+ * improve bearer creation and extraction ([29a347a](https://github.com/twinfoundation/framework/commit/29a347a760cb3bc5eb819112e84f1ac99430e72b))
28
+
29
+
30
+ ### Dependencies
31
+
32
+ * The following workspace dependencies were updated
33
+ * dependencies
34
+ * @twin.org/core bumped from 0.0.2-next.14 to 0.0.2-next.15
35
+ * @twin.org/crypto bumped from 0.0.2-next.14 to 0.0.2-next.15
36
+ * @twin.org/nameof bumped from 0.0.2-next.14 to 0.0.2-next.15
37
+ * devDependencies
38
+ * @twin.org/nameof-transformer bumped from 0.0.2-next.14 to 0.0.2-next.15
39
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.2-next.14 to 0.0.2-next.15
40
+
3
41
  ## [0.0.2-next.14](https://github.com/twinfoundation/framework/compare/web-v0.0.2-next.13...web-v0.0.2-next.14) (2025-09-22)
4
42
 
5
43
 
@@ -16,7 +16,7 @@ Class to helper with header operations.
16
16
 
17
17
  ### createBearer()
18
18
 
19
- > `static` **createBearer**(`token`): `undefined` \| `string`
19
+ > `static` **createBearer**(`token`): `string`
20
20
 
21
21
  Create a bearer token header.
22
22
 
@@ -24,21 +24,21 @@ Create a bearer token header.
24
24
 
25
25
  ##### token
26
26
 
27
- `string`
27
+ `unknown`
28
28
 
29
29
  The token to create the header for.
30
30
 
31
31
  #### Returns
32
32
 
33
- `undefined` \| `string`
33
+ `string`
34
34
 
35
35
  The bearer token header.
36
36
 
37
37
  ***
38
38
 
39
- ### extractBearerToken()
39
+ ### extractBearer()
40
40
 
41
- > `static` **extractBearerToken**(`header`): `undefined` \| `string`
41
+ > `static` **extractBearer**(`header`): `string`
42
42
 
43
43
  Extract the bearer token from a header.
44
44
 
@@ -52,6 +52,6 @@ The header value to extract the token from.
52
52
 
53
53
  #### Returns
54
54
 
55
- `undefined` \| `string`
55
+ `string`
56
56
 
57
57
  The extracted token if it exists.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/web",
3
- "version": "0.0.2-next.14",
3
+ "version": "0.0.2-next.16",
4
4
  "description": "Contains classes for use with web operations",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,9 +14,9 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "0.0.2-next.14",
18
- "@twin.org/crypto": "0.0.2-next.14",
19
- "@twin.org/nameof": "0.0.2-next.14",
17
+ "@twin.org/core": "0.0.2-next.16",
18
+ "@twin.org/crypto": "0.0.2-next.16",
19
+ "@twin.org/nameof": "0.0.2-next.16",
20
20
  "jose": "6.1.0"
21
21
  },
22
22
  "main": "./dist/cjs/index.cjs",