@fern-api/ui-core-utils 0.121.2-b3b8d4905 → 0.121.2-cd41b789d

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.
@@ -6,4 +6,5 @@
6
6
  * @returns the endpoint, which will always have a protocol
7
7
  */
8
8
  export declare function withDefaultProtocol(endpoint: string, defaultProtocol?: string): string;
9
+ export declare function withDefaultProtocol(endpoint: string | undefined, defaultProtocol?: string): string | undefined;
9
10
  //# sourceMappingURL=withDefaultProtocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withDefaultProtocol.d.ts","sourceRoot":"","sources":["../src/withDefaultProtocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,SAAa,GAAG,MAAM,CAa1F"}
1
+ {"version":3,"file":"withDefaultProtocol.d.ts","sourceRoot":"","sources":["../src/withDefaultProtocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AACxF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC"}
@@ -1,11 +1,7 @@
1
- /**
2
- * Prefixes the given endpoint with the `defaultProtocol` if one isn't defined already.
3
- *
4
- * @param endpoint
5
- * @param defaultProtocol defaults to "https://"
6
- * @returns the endpoint, which will always have a protocol
7
- */
8
1
  export function withDefaultProtocol(endpoint, defaultProtocol = "https://") {
2
+ if (endpoint == null) {
3
+ return undefined;
4
+ }
9
5
  // matches any protocol scheme at the beginning of the string (e.g., "http://", "https://", "ftp://")
10
6
  const protocolRegex = /^[a-z]+:\/\//i;
11
7
  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.121.2-b3b8d4905",
3
+ "version": "0.121.2-cd41b789d",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern-platform.git",