Skip to content

Commit 4feced2

Browse files
committed
Release 0.13.15
1 parent 3eb3cd6 commit 4feced2

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pave",
33
"type": "module",
4-
"version": "0.13.14",
4+
"version": "0.13.15",
55
"author": "Casey Foster <c@sey.me>",
66
"license": "MIT",
77
"repository": {

src/execute.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @import {Type} from '#src/index.js' */
2+
13
import { strict as assert } from 'node:assert';
24

35
import { Context } from '#src/context.js';

src/index.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
* @template {string} [TypeName=string] Default is `string`
1919
* @template {Record<string, any>} [Extensions=Record<never, never>] Default is
2020
* `Record<never, never>`
21-
* @template [Context=any] Default is `any`
22-
* @template [Input=any] Default is `any`
21+
* @template [Context=unknown] Default is `unknown`
22+
* @template [Input=unknown] Default is `unknown`
23+
* @template [Object=unknown] Default is `unknown`
24+
* @template [Value=unknown] Default is. Default is `unknown`
25+
* @template [ResolvedValue=NonNullable<unknown>] Default is
26+
* `NonNullable<unknown>`
2327
* @typedef {Recursive<
2428
* | TypeName
2529
* | ((
@@ -46,12 +50,12 @@
4650
* | ((options: {
4751
* context: Context;
4852
* input: Input;
49-
* object: any;
53+
* object: Object;
5054
* path: string[];
5155
* query: Query;
5256
* schema: Schema;
5357
* type: Type;
54-
* value: any;
58+
* value: Value;
5559
* }) => any)
5660
* | {}
5761
* | null;
@@ -63,23 +67,23 @@
6367
* context: Context;
6468
* cost: number;
6569
* input: Input;
66-
* object: any;
70+
* object: Object;
6771
* path: string[];
6872
* query: Query;
6973
* schema: Schema;
7074
* type: Type;
71-
* value: any;
75+
* value: Value;
7276
* }) => number);
7377
* defaultValue?: any;
7478
* validate?: (options: {
7579
* context: Context;
7680
* input: Input;
77-
* object: any;
81+
* object: Object;
7882
* path: string[];
7983
* query: Query;
8084
* schema: Schema;
8185
* type: Type;
82-
* value: any;
86+
* value: ResolvedValue;
8387
* }) => any;
8488
* } & Extensions)
8589
* >} Type

types/index.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type Query<T = any> = {
1818
};
1919
export type Recursive<T> = T | RecursiveArray<T>;
2020
export type RecursiveArray<T> = Recursive<T>[];
21-
export type Type<TypeName extends string = string, Extensions extends Record<string, any> = Record<never, never>, Context = any, Input = any> = Recursive<TypeName | (({
21+
export type Type<TypeName extends string = string, Extensions extends Record<string, any> = Record<never, never>, Context = unknown, Input = unknown, Object = unknown, Value = unknown, ResolvedValue = {}> = Recursive<TypeName | (({
2222
optional: Type<TypeName, Extensions, Context>;
2323
} | {
2424
nullable: Type<TypeName, Extensions, Context>;
@@ -43,35 +43,35 @@ export type Type<TypeName extends string = string, Extensions extends Record<str
4343
resolve?: ((options: {
4444
context: Context;
4545
input: Input;
46-
object: any;
46+
object: Object;
4747
path: string[];
4848
query: Query;
4949
schema: Schema;
5050
type: Type;
51-
value: any;
51+
value: Value;
5252
}) => any) | {} | null;
5353
}) & {
5454
cost?: number | ((options: {
5555
context: Context;
5656
cost: number;
5757
input: Input;
58-
object: any;
58+
object: Object;
5959
path: string[];
6060
query: Query;
6161
schema: Schema;
6262
type: Type;
63-
value: any;
63+
value: Value;
6464
}) => number);
6565
defaultValue?: any;
6666
validate?: (options: {
6767
context: Context;
6868
input: Input;
69-
object: any;
69+
object: Object;
7070
path: string[];
7171
query: Query;
7272
schema: Schema;
7373
type: Type;
74-
value: any;
74+
value: ResolvedValue;
7575
}) => any;
7676
} & Extensions)>;
7777
export type Schema<TypeName extends string = string> = Record<TypeName, Type<TypeName>>;

0 commit comments

Comments
 (0)