@mintlify/common 1.0.1198 → 1.0.1199
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,6 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as v from 'valibot';
|
|
2
2
|
export const WILDCARD_GROUP = '*';
|
|
3
|
-
|
|
3
|
+
const groupNameSchema = v.pipe(v.string(), v.minLength(1));
|
|
4
|
+
const groupRuleSchema = v.strictObject({
|
|
5
|
+
includes: v.optional(v.pipe(v.array(groupNameSchema), v.minLength(1))),
|
|
6
|
+
excludes: v.optional(v.pipe(v.array(groupNameSchema), v.check((excludes) => !excludes.includes(WILDCARD_GROUP)))),
|
|
7
|
+
});
|
|
8
|
+
const pageGroupsSchema = v.union([v.array(groupNameSchema), v.array(groupRuleSchema)]);
|
|
9
|
+
export const isPageGroups = (value) => v.is(pageGroupsSchema, value);
|
|
4
10
|
const isStringArray = (groups) => groups.every((entry) => typeof entry === 'string');
|
|
5
11
|
const DENY_ALL = { includes: [], excludes: [] };
|
|
6
12
|
export function normalizeGroups(groups) {
|