Skip to content

Commit deae554

Browse files
committed
Release 0.13.21
1 parent 41d2660 commit deae554

13 files changed

+69
-30
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.20",
4+
"version": "0.13.21",
55
"author": "Casey Foster <c@sey.me>",
66
"license": "MIT",
77
"repository": {

src/execute.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ const { Promise } = globalThis;
1010
const { isArray } = Array;
1111

1212
/**
13+
* @template {string} [TypeName=string] Default is `string`
14+
* @template {{ [K: string]: any }} [Extensions={ [K: string]: any }] Default is
15+
* `{ [K: string]: any }`
16+
* @template [Context=any] Default is `any`
1317
* @param {{
1418
* context?: any;
1519
* object?: any;
1620
* path?: string[];
1721
* query: Query;
18-
* schema: Schema<string, {}, any>;
19-
* type: Type;
22+
* schema: Schema<TypeName, Extensions, Context>;
23+
* type: Type<TypeName, Extensions, Context>;
2024
* value?: any;
2125
* }} options
2226
*/

src/get-query-cost.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ import { isObject } from '#src/is-object.js';
55
const { isArray } = Array;
66

77
/**
8+
* @template {string} [TypeName=string] Default is `string`
9+
* @template {{ [K: string]: any }} [Extensions={ [K: string]: any }] Default is
10+
* `{ [K: string]: any }`
811
* @template [Context=any] Default is `any`
912
* @param {{
1013
* context?: Context;
1114
* path?: string[];
1215
* query: Query;
13-
* schema: Schema<string, {}, any>;
14-
* type: Type;
16+
* schema: Schema<TypeName, Extensions, Context>;
17+
* type: Type<TypeName, Extensions, Context>;
1518
* }} options
1619
*/
1720
export const getQueryCost = ({ context, path = [], query, schema, type }) => {

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* path: string[];
5454
* query: Query;
5555
* schema: Schema<TypeName, Extensions, Context>;
56-
* type: Type;
56+
* type: Type<TypeName, Extensions, Context>;
5757
* value: Value;
5858
* }) => any)
5959
* | {}
@@ -70,7 +70,7 @@
7070
* path: string[];
7171
* query: Query;
7272
* schema: Schema<TypeName, Extensions, Context>;
73-
* type: Type;
73+
* type: Type<TypeName, Extensions, Context>;
7474
* value: Value;
7575
* }) => number);
7676
* defaultValue?: any;
@@ -81,7 +81,7 @@
8181
* path: string[];
8282
* query: Query;
8383
* schema: Schema<TypeName, Extensions, Context>;
84-
* type: Type;
84+
* type: Type<TypeName, Extensions, Context>;
8585
* value: ResolvedValue;
8686
* }) => any;
8787
* } & Extensions)

src/validate-query.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ const { isArray } = Array;
99
const skipInput = {};
1010

1111
/**
12+
* @template {string} [TypeName=string] Default is `string`
13+
* @template {{ [K: string]: any }} [Extensions={ [K: string]: any }] Default is
14+
* `{ [K: string]: any }`
15+
* @template [Context=any] Default is `any`
1216
* @param {{
1317
* context?: any;
1418
* path?: string[];
1519
* query: Query;
16-
* schema: Schema<string, {}, any>;
17-
* type: Type;
20+
* schema: Schema<TypeName, Extensions, Context>;
21+
* type: Type<TypeName, Extensions, Context>;
1822
* }} options
1923
* @returns {Query}
2024
*/

src/validate-schema.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ const { Set } = globalThis;
88
const { isArray } = Array;
99

1010
/**
11+
* @template {string} [TypeName=string] Default is `string`
12+
* @template {{ [K: string]: any }} [Extensions={ [K: string]: any }] Default is
13+
* `{ [K: string]: any }`
14+
* @template [Context=any] Default is `any`
1115
* @param {{
1216
* extensions?: { [K: string]: any };
13-
* schema: Schema<string, {}, any>;
17+
* schema: Schema<TypeName, Extensions, Context>;
1418
* }} options
1519
*/
1620
export const validateSchema = ({ extensions, schema }) => {

src/validate-value.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import { throwPaveError } from '#src/throw-pave-error.js';
77
const { isArray } = Array;
88

99
/**
10+
* @template {string} [TypeName=string] Default is `string`
11+
* @template {{ [K: string]: any }} [Extensions={ [K: string]: any }] Default is
12+
* `{ [K: string]: any }`
13+
* @template [Context=any] Default is `any`
1014
* @param {{
1115
* context?: any;
1216
* object?: any;
1317
* path?: string[];
1418
* query?: Query;
15-
* schema: Schema<string, {}, any>;
16-
* type: Type;
19+
* schema: Schema<TypeName, Extensions, Context>;
20+
* type: Type<TypeName, Extensions, Context>;
1721
* value?: any;
1822
* }} options
1923
*/

types/execute.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
export function execute({ context, object, path, query, schema, type, value }: {
1+
export function execute<TypeName extends string = string, Extensions extends {
2+
[K: string]: any;
3+
} = {
4+
[K: string]: any;
5+
}, Context = any>({ context, object, path, query, schema, type, value }: {
26
context?: any;
37
object?: any;
48
path?: string[];
59
query: Query;
6-
schema: Schema<string, {}, any>;
7-
type: Type;
10+
schema: Schema<TypeName, Extensions, Context>;
11+
type: Type<TypeName, Extensions, Context>;
812
value?: any;
913
}): Promise<any>;
1014
import type { Query } from '#types/index.js';

types/get-query-cost.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
export function getQueryCost<Context = any>({ context, path, query, schema, type }: {
1+
export function getQueryCost<TypeName extends string = string, Extensions extends {
2+
[K: string]: any;
3+
} = {
4+
[K: string]: any;
5+
}, Context = any>({ context, path, query, schema, type }: {
26
context?: Context;
37
path?: string[];
48
query: Query;
5-
schema: Schema<string, {}, any>;
6-
type: Type;
9+
schema: Schema<TypeName, Extensions, Context>;
10+
type: Type<TypeName, Extensions, Context>;
711
}): any;
812
import type { Query } from '#types/index.js';
913
import type { Schema } from '#types/index.js';

types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export type Type<TypeName extends string = never, Extensions extends {
4949
path: string[];
5050
query: Query;
5151
schema: Schema<TypeName, Extensions, Context>;
52-
type: Type;
52+
type: Type<TypeName, Extensions, Context>;
5353
value: Value;
5454
}) => any) | {} | null;
5555
}) & {
@@ -61,7 +61,7 @@ export type Type<TypeName extends string = never, Extensions extends {
6161
path: string[];
6262
query: Query;
6363
schema: Schema<TypeName, Extensions, Context>;
64-
type: Type;
64+
type: Type<TypeName, Extensions, Context>;
6565
value: Value;
6666
}) => number);
6767
defaultValue?: any;
@@ -72,7 +72,7 @@ export type Type<TypeName extends string = never, Extensions extends {
7272
path: string[];
7373
query: Query;
7474
schema: Schema<TypeName, Extensions, Context>;
75-
type: Type;
75+
type: Type<TypeName, Extensions, Context>;
7676
value: ResolvedValue;
7777
}) => any;
7878
} & Extensions)>;

0 commit comments

Comments
 (0)