Skip to content

Commit

Permalink
fix: prevent erroneous d.ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Apr 12, 2024
1 parent 5c9875f commit b150d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/value/createValueMockFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { document, MockDocumentValueConfig } from "./document";
import { embed, MockEmbedValueConfig } from "./embed";
import { geoPoint, MockGeoPointValueConfig } from "./geoPoint";
import { group, MockGroupValueConfig } from "./group";
import { image, MockImageValueConfig } from "./image";
import { image, MockImageValue, MockImageValueConfig } from "./image";
import { integration, MockIntegrationFieldValueConfig } from "./integration";
import { keyText, MockKeyTextValueConfig } from "./keyText";
import { link, MockLinkValueConfig } from "./link";
Expand Down Expand Up @@ -135,7 +135,9 @@ export class ValueMockFactory {
Model extends
prismic.CustomTypeModelImageField = prismic.CustomTypeModelImageField,
State extends prismic.FieldState = "filled",
>(config?: WithoutFakerConfig<MockImageValueConfig<Model, State>>) {
>(
config?: WithoutFakerConfig<MockImageValueConfig<Model, State>>,
): MockImageValue<Model, State> {
return image({ ...config, faker: this.faker });
}

Expand Down
8 changes: 2 additions & 6 deletions src/value/image.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type * as prismic from "@prismicio/client";
import { type ImageField } from "@prismicio/client";
import * as prismic from "@prismicio/client";

import { buildImageFieldImage } from "../lib/buildImageFieldImage";
import { createFaker } from "../lib/createFaker";
Expand Down Expand Up @@ -30,10 +29,7 @@ export const image = <
State extends prismic.FieldState = "filled",
>(
config: MockImageValueConfig<Model, State>,
): ImageField<
NonNullable<NonNullable<Model["config"]>["thumbnails"]>[number]["name"],
State
> => {
): MockImageValue<Model, State> => {
const faker = config.faker || createFaker(config.seed);

const model = config.model || modelGen.image({ faker });
Expand Down

0 comments on commit b150d95

Please sign in to comment.