@mittwald/react-ghostmaker 1.4.7 → 1.4.9
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.
- package/dist/esm/index.js +1 -1
- package/dist/esm/maybeGhost/asGhost.js +2 -2
- package/dist/esm/maybeGhost/asGhost.test.js +2 -2
- package/dist/esm/testMocks.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/maybeGhost/asGhost.d.ts +1 -1
- package/dist/types/maybeGhost/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,6 @@ export { makeGhost } from "./makeGhost.js";
|
|
|
2
2
|
export { registerModelIdentifier } from "./modelIdentifier.js";
|
|
3
3
|
export { getQueryContext, forwardQueryContext } from "./context.js";
|
|
4
4
|
export { invalidateGhosts } from "./invalidate.js";
|
|
5
|
-
export * from "./maybeGhost";
|
|
5
|
+
export * from "./maybeGhost/index.js";
|
|
6
6
|
export { GhostMakerModel, ghostMakerModel } from "./metaData.js";
|
|
7
7
|
export { getModelId, getModelName } from "./queries.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { makeGhost } from "../makeGhost";
|
|
2
|
-
import { isReactGhost } from "../types";
|
|
1
|
+
import { makeGhost } from "../makeGhost.js";
|
|
2
|
+
import { isReactGhost } from "../types.js";
|
|
3
3
|
export function asGhost(maybeGhost) {
|
|
4
4
|
if (isReactGhost(maybeGhost)) {
|
|
5
5
|
return maybeGhost;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { asGhostProps } from "../maybeGhost";
|
|
2
|
-
import { isReactGhost } from "../types";
|
|
1
|
+
import { asGhostProps } from "../maybeGhost/index.js";
|
|
2
|
+
import { isReactGhost } from "../types.js";
|
|
3
3
|
import { expect, test } from "vitest";
|
|
4
4
|
test("makes Ghosts of all props", () => {
|
|
5
5
|
const ghostProps = asGhostProps({
|
package/dist/esm/testMocks.js
CHANGED
|
@@ -33,7 +33,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
35
|
import { beforeEach, vitest } from "vitest";
|
|
36
|
-
import { getQueryContext, makeGhost } from ".";
|
|
36
|
+
import { getQueryContext, makeGhost } from "./index.js";
|
|
37
37
|
import { GhostMakerModel } from "./metaData.js";
|
|
38
38
|
const sleep = () => new Promise((resolve) => setTimeout(resolve, 200));
|
|
39
39
|
export const advanceSleepTimer = async (times = 1) => {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { registerModelIdentifier } from "./modelIdentifier.ts";
|
|
|
3
3
|
export { type ReactGhost, UseGhostReturn } from "./types.ts";
|
|
4
4
|
export { getQueryContext, forwardQueryContext } from "./context.ts";
|
|
5
5
|
export { invalidateGhosts } from "./invalidate.ts";
|
|
6
|
-
export * from "./maybeGhost";
|
|
6
|
+
export * from "./maybeGhost/index.ts";
|
|
7
7
|
export { GhostMakerModel, ghostMakerModel } from "./metaData.ts";
|
|
8
8
|
export { getModelId, getModelName } from "./queries.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactGhost } from "../types";
|
|
1
|
+
import { type ReactGhost } from "../types.ts";
|
|
2
2
|
import type { MaybeReactGhost, PropsWithFixedUpReactGhosts, PropsWithMaybeReactGhosts } from "./types.ts";
|
|
3
3
|
export declare function asGhost<T>(maybeGhost: MaybeReactGhost<T>): ReactGhost<T>;
|
|
4
4
|
export declare function asGhostProps<T, TProps extends (keyof T)[] = (keyof T)[]>(props: PropsWithMaybeReactGhosts<T, TProps>, keys?: TProps): PropsWithFixedUpReactGhosts<T, TProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OrOptional, type ReactGhost } from "../types";
|
|
1
|
+
import { type OrOptional, type ReactGhost } from "../types.ts";
|
|
2
2
|
export type MaybeReactGhost<T> = T extends ReactGhost<infer U> ? ReactGhost<U> | U : T | ReactGhost<T>;
|
|
3
3
|
export type PropsWithMaybeReactGhosts<T, TProps extends (keyof T)[]> = {
|
|
4
4
|
[K in keyof T]: K extends TProps[number] ? MaybeReactGhost<T[K] | OrOptional<T[K]>> : T[K] | OrOptional<T[K]>;
|