@fern-api/ui-core-utils 0.132.5-eaf7db4d1 → 0.132.6-0d56dcfe9
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.
|
@@ -17,7 +17,7 @@ describe("withDefaultProtocol", () => {
|
|
|
17
17
|
expect(withDefaultProtocol("HtTp://example.com")).toBe("HtTp://example.com");
|
|
18
18
|
});
|
|
19
19
|
it("handles an empty string", () => {
|
|
20
|
-
expect(withDefaultProtocol("")).
|
|
20
|
+
expect(() => withDefaultProtocol("")).toThrow();
|
|
21
21
|
});
|
|
22
22
|
it("handles IP addresses", () => {
|
|
23
23
|
expect(withDefaultProtocol("192.168.1.1")).toBe("https://192.168.1.1");
|
package/dist/titleCase.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"titleCase.d.ts","sourceRoot":"","sources":["../src/titleCase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"titleCase.d.ts","sourceRoot":"","sources":["../src/titleCase.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe9C;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -2,6 +2,9 @@ export function withDefaultProtocol(endpoint, defaultProtocol = "https://") {
|
|
|
2
2
|
if (endpoint == null) {
|
|
3
3
|
return undefined;
|
|
4
4
|
}
|
|
5
|
+
if (endpoint === "") {
|
|
6
|
+
throw new Error(`URL is empty`);
|
|
7
|
+
}
|
|
5
8
|
// matches any protocol scheme at the beginning of the string (e.g., "http://", "https://", "ftp://")
|
|
6
9
|
const protocolRegex = /^[a-z]+:\/\//i;
|
|
7
10
|
if (!protocolRegex.test(endpoint)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fern-api/ui-core-utils",
|
|
3
|
-
"version": "0.132.
|
|
3
|
+
"version": "0.132.6-0d56dcfe9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/fern-api/fern-platform.git",
|
|
@@ -64,14 +64,12 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@fern-platform/configs": "workspace:*",
|
|
67
|
-
"@types/node": "^18.
|
|
67
|
+
"@types/node": "^18.11.9",
|
|
68
68
|
"@types/title": "^3.4.3",
|
|
69
69
|
"@types/ua-parser-js": "^0.7.39",
|
|
70
70
|
"depcheck": "^1.4.7",
|
|
71
|
-
"eslint": "^9",
|
|
72
|
-
"prettier": "^3.4.2",
|
|
73
71
|
"stylelint": "^16.1.0",
|
|
74
72
|
"typescript": "^5",
|
|
75
|
-
"vitest": "^
|
|
73
|
+
"vitest": "^3.0.5"
|
|
76
74
|
}
|
|
77
75
|
}
|