@mintlify/common 1.0.1260 → 1.0.1262

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/common",
3
- "version": "1.0.1260",
3
+ "version": "1.0.1262",
4
4
  "description": "Commonly shared code within Mintlify",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -87,7 +87,7 @@
87
87
  "@mintlify/mdx": "4.0.7",
88
88
  "@mintlify/models": "0.0.375",
89
89
  "@mintlify/openapi-parser": "0.0.9",
90
- "@mintlify/validation": "0.1.923",
90
+ "@mintlify/validation": "0.1.924",
91
91
  "@sindresorhus/slugify": "2.2.0",
92
92
  "@types/mdast": "4.0.4",
93
93
  "acorn": "8.11.2",
@@ -152,5 +152,5 @@
152
152
  "typescript": "5.5.3",
153
153
  "vitest": "2.1.9"
154
154
  },
155
- "gitHead": "747cc76cb959c8fd994d9a5aef99a96df65f4534"
155
+ "gitHead": "438e9ce46134b3631021244781378a4db70d7306"
156
156
  }
@@ -1 +0,0 @@
1
- export declare function getReferencedSnippetPaths(content: string): string[];
@@ -1,29 +0,0 @@
1
- const SNIPPET_TAG = /<Snippet\s/g;
2
- const FILE_ATTR = /\bfile\s*=\s*["']([^"']+)["']/g;
3
- const SEARCH_WINDOW = 1000;
4
- export function getReferencedSnippetPaths(content) {
5
- var _a;
6
- if (!content.includes('<Snippet'))
7
- return [];
8
- const tagStarts = [...content.matchAll(SNIPPET_TAG)].map((tag) => tag.index);
9
- if (tagStarts.length === 0)
10
- return [];
11
- const paths = new Set();
12
- let nearest = 0;
13
- for (const attr of content.matchAll(FILE_ATTR)) {
14
- while (nearest + 1 < tagStarts.length && ((_a = tagStarts[nearest + 1]) !== null && _a !== void 0 ? _a : 0) <= attr.index)
15
- nearest++;
16
- const start = tagStarts[nearest];
17
- if (start === undefined || start > attr.index)
18
- continue;
19
- if (attr.index - start > SEARCH_WINDOW)
20
- continue;
21
- const path = attr[1];
22
- if (path === undefined)
23
- continue;
24
- paths.add(path);
25
- if (path.startsWith('/'))
26
- paths.add(path.slice(1));
27
- }
28
- return [...paths];
29
- }