@mintlify/common 1.0.381 → 1.0.383

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.
package/dist/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export * from './title.js';
16
16
  export * from './schema/common.js';
17
17
  export * from './camelToSentenceCase.js';
18
18
  export * from './asyncapi/index.js';
19
+ export * from './isAbsoluteUrl.js';
package/dist/index.js CHANGED
@@ -16,3 +16,4 @@ export * from './title.js';
16
16
  export * from './schema/common.js';
17
17
  export * from './camelToSentenceCase.js';
18
18
  export * from './asyncapi/index.js';
19
+ export * from './isAbsoluteUrl.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Check if a URL is absolute
3
+ * @param url - The URL to check
4
+ * @returns True if the URL is absolute, false otherwise
5
+ */
6
+ export declare const isAbsoluteUrl: (url?: string) => boolean;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Check if a URL is absolute
3
+ * @param url - The URL to check
4
+ * @returns True if the URL is absolute, false otherwise
5
+ */
6
+ export const isAbsoluteUrl = (url) => {
7
+ if (!url || typeof url !== 'string')
8
+ return false;
9
+ try {
10
+ return URL.canParse(url);
11
+ }
12
+ catch (_a) {
13
+ return false;
14
+ }
15
+ };
@@ -1,5 +1,5 @@
1
- import isAbsoluteUrl from 'is-absolute-url';
2
1
  import { getSecurityOptionsForAuthMethod } from '../../../../index.js';
2
+ import { isAbsoluteUrl } from '../../../../isAbsoluteUrl.js';
3
3
  import { isDocsConfig } from '../../../../isDocsConfig.js';
4
4
  import { isMdxJsxAttribute, isParamFieldLocation } from '../../../lib/mdx-utils.js';
5
5
  export const parseApiString = (apiString, config) => {
@@ -1,7 +1,7 @@
1
- import isAbsoluteUrl from 'is-absolute-url';
2
1
  import path from 'path';
3
2
  import { visit } from 'unist-util-visit';
4
3
  import { removeBasePath } from '../../../fs/removeBasePath.js';
4
+ import { isAbsoluteUrl } from '../../../isAbsoluteUrl.js';
5
5
  import { getS3URI } from '../../../services/aws.js';
6
6
  export const getImageUri = (imagePath, subdomain, filePath, basePath, opts = {}) => {
7
7
  if (imagePath.startsWith('/')) {