@mintlify/common 1.0.304 → 1.0.306

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
@@ -12,3 +12,4 @@ export * from './secureCompare.js';
12
12
  export * from './isWildcardRedirect.js';
13
13
  export * from './isDocsConfig.js';
14
14
  export * from './divisions/index.js';
15
+ export * from './title.js';
package/dist/index.js CHANGED
@@ -12,3 +12,4 @@ export * from './secureCompare.js';
12
12
  export * from './isWildcardRedirect.js';
13
13
  export * from './isDocsConfig.js';
14
14
  export * from './divisions/index.js';
15
+ export * from './title.js';
@@ -12,7 +12,23 @@ export function remarkExtractChangelogFilters(mdxExtracts) {
12
12
  try {
13
13
  tags = JSON.parse(tagsAttribute.value.value);
14
14
  }
15
- catch (_a) { }
15
+ catch (_a) {
16
+ const isProgram = tagsAttribute.value.data.estree.type === 'Program';
17
+ if (isProgram && tagsAttribute.value.data.estree.body.length === 1) {
18
+ const body = tagsAttribute.value.data.estree.body[0];
19
+ if (body.type === 'ExpressionStatement' &&
20
+ body.expression.type === 'ArrayExpression') {
21
+ tags = body.expression.elements
22
+ .map((element) => {
23
+ if (element.type === 'Literal') {
24
+ return element.value;
25
+ }
26
+ return null;
27
+ })
28
+ .filter(Boolean);
29
+ }
30
+ }
31
+ }
16
32
  if (Array.isArray(tags)) {
17
33
  tags.forEach((tag) => {
18
34
  if (!!tag.trim()) {
@@ -0,0 +1 @@
1
+ export declare function convertStrToTitle(str: string): string;
package/dist/title.js ADDED
@@ -0,0 +1,8 @@
1
+ export function convertStrToTitle(str) {
2
+ const spacedString = str.replace(/[-_\/]/g, ' ');
3
+ const words = spacedString.split(/(?=[A-Z])|\s+/);
4
+ const titleCasedWords = words.map((word) => {
5
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
6
+ });
7
+ return titleCasedWords.join(' ').trim();
8
+ }