-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
groq-builder: feature(compat): moved all exports to the main index, r…
…emoving the need for the `/validation` entrypoint
- Loading branch information
scottrippey
committed
Dec 16, 2023
1 parent
e61fcc1
commit 0517e0e
Showing
9 changed files
with
28 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
import { primitives } from "./primitives"; | ||
import { | ||
createGroqBuilder as _createGroqBuilder, | ||
RootConfig, | ||
GroqBuilderOptions, | ||
} from "../index"; | ||
import { sanityValidators } from "./content-block"; | ||
import { primitiveValidators } from "./primitives"; | ||
import { createGroqBuilder, RootConfig, GroqBuilderOptions } from "../index"; | ||
import { sanityValidators } from "./sanity"; | ||
|
||
export * from "../index"; | ||
export { primitives } from "./primitives"; | ||
export { sanityValidators } from "./content-block"; | ||
export const validate = { | ||
...primitiveValidators, | ||
...sanityValidators, | ||
}; | ||
|
||
export function createGroqBuilderWithValidation<TRootConfig extends RootConfig>( | ||
options?: GroqBuilderOptions | ||
) { | ||
return Object.assign(_createGroqBuilder<TRootConfig>(options), validate); | ||
return Object.assign(createGroqBuilder<TRootConfig>(options), validate); | ||
} | ||
|
||
export const validate = { | ||
...primitives, | ||
...sanityValidators, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...q-builder/src/validation/content-block.ts → ...ges/groq-builder/src/validation/sanity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.