@mintlify/common 1.0.1168 → 1.0.1169
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.
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { pageGroupsSchema } from '@mintlify/validation';
|
|
1
2
|
export const WILDCARD_GROUP = '*';
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
value !== null &&
|
|
5
|
-
!Array.isArray(value) &&
|
|
6
|
-
(!('includes' in value) || value.includes === undefined || isStringArray(value.includes)) &&
|
|
7
|
-
(!('excludes' in value) || value.excludes === undefined || isStringArray(value.excludes));
|
|
8
|
-
export const isPageGroups = (value) => isStringArray(value) || (Array.isArray(value) && value.every(isGroupRule));
|
|
3
|
+
export const isPageGroups = (value) => pageGroupsSchema.safeParse(value).success;
|
|
4
|
+
const isStringArray = (groups) => groups.every((entry) => typeof entry === 'string');
|
|
9
5
|
const DENY_ALL = { includes: [], excludes: [] };
|
|
10
6
|
export function normalizeGroups(groups) {
|
|
11
7
|
var _a;
|
|
@@ -24,10 +20,8 @@ export function normalizeGroups(groups) {
|
|
|
24
20
|
for (const group of rule.includes)
|
|
25
21
|
includes.add(group);
|
|
26
22
|
}
|
|
27
|
-
for (const group of (_a = rule.excludes) !== null && _a !== void 0 ? _a : [])
|
|
28
|
-
|
|
29
|
-
excludes.add(group);
|
|
30
|
-
}
|
|
23
|
+
for (const group of (_a = rule.excludes) !== null && _a !== void 0 ? _a : [])
|
|
24
|
+
excludes.add(group);
|
|
31
25
|
}
|
|
32
26
|
return {
|
|
33
27
|
includes: hasIncludes ? [...includes] : undefined,
|