Skip to content

Commit

Permalink
Use LooseArray and LooseRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel committed May 18, 2023
1 parent ddf1348 commit f29f956
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/modules/manager/bazel-module/fragments.ts
@@ -1,4 +1,5 @@
import { z } from 'zod';
import { LooseArray, LooseRecord } from '../../../util/schema-utils';
import * as starlark from './starlark';

export const StringFragmentSchema = z.object({
Expand All @@ -17,7 +18,7 @@ const PrimitiveFragmentsSchema = z.discriminatedUnion('type', [
]);
export const ArrayFragmentSchema = z.object({
type: z.literal('array'),
items: PrimitiveFragmentsSchema.array(),
items: LooseArray(PrimitiveFragmentsSchema),
isComplete: z.boolean(),
});
const ValueFragmentsSchema = z.discriminatedUnion('type', [
Expand All @@ -27,7 +28,7 @@ const ValueFragmentsSchema = z.discriminatedUnion('type', [
]);
export const RecordFragmentSchema = z.object({
type: z.literal('record'),
children: z.record(z.string(), ValueFragmentsSchema),
children: LooseRecord(ValueFragmentsSchema),
isComplete: z.boolean(),
});
export const AttributeFragmentSchema = z.object({
Expand Down

0 comments on commit f29f956

Please sign in to comment.