@fern-api/ui-core-utils 0.139.5-17e6e4ca0 → 0.139.5-2c30cfa75

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.
@@ -58,6 +58,10 @@ describe("sanitizeUrl", () => {
58
58
  expect(sanitizeUrl("https://user:pass@example.com")).toBe("https://user:pass@example.com/");
59
59
  expect(sanitizeUrl("user:pass@example.com")).toBe("https://user:pass@example.com/");
60
60
  });
61
+ it("handles websocket protocol", () => {
62
+ expect(sanitizeUrl("wss://streaming.assemblyai.com")).toBe("wss://streaming.assemblyai.com/");
63
+ expect(sanitizeUrl("ws://streaming.assemblyai.com")).toBe("ws://streaming.assemblyai.com/");
64
+ });
61
65
  it("handles IP addresses", () => {
62
66
  expect(sanitizeUrl("https://192.168.1.1")).toBe("https://192.168.1.1/");
63
67
  expect(sanitizeUrl("192.168.1.1")).toBe("https://192.168.1.1/");
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizeUrl.d.ts","sourceRoot":"","sources":["../src/sanitizeUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAgCvE"}
1
+ {"version":3,"file":"sanitizeUrl.d.ts","sourceRoot":"","sources":["../src/sanitizeUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAqCvE"}
@@ -17,7 +17,10 @@ export function sanitizeUrl(url) {
17
17
  }
18
18
  }
19
19
  // handle URLs without protocol
20
- if (!url.startsWith("http://") && !url.startsWith("https://")) {
20
+ if (!url.startsWith("http://") &&
21
+ !url.startsWith("https://") &&
22
+ !url.startsWith("wss://") &&
23
+ !url.startsWith("ws://")) {
21
24
  try {
22
25
  const parsedUrl = new URL(`https://${url}`);
23
26
  return parsedUrl.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/ui-core-utils",
3
- "version": "0.139.5-17e6e4ca0",
3
+ "version": "0.139.5-2c30cfa75",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern-platform.git",