Skip to content

Commit 80b78c0

Browse files
committed
Release 0.13.17
1 parent 500c6a1 commit 80b78c0

14 files changed

Lines changed: 39 additions & 33 deletions

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

src/create-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const createClient = ({ cache, execute, getKey, transformQuery }) => {
3030
else if (transformQuery === null) transformQuery = noopTransform;
3131
/** @type {Set<Watcher>} */
3232
const watchers = new Set();
33-
/** @type {Record<string, never>} */
33+
/** @type {{ [K: keyof any]: never }} */
3434
let currentUpdate;
3535

3636
const client = {

src/execute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { isArray } = Array;
1515
* object?: any;
1616
* path?: string[];
1717
* query: Query;
18-
* schema: Schema;
18+
* schema: Schema<string, {}, any>;
1919
* type: Type;
2020
* value?: any;
2121
* }} options
@@ -34,7 +34,7 @@ export const execute = async ({
3434

3535
/**
3636
* @param {Parameters<typeof throwPaveError>[0]} code
37-
* @param {Record<string, any>} [extra]
37+
* @param {{ [K: string]: any }} [extra]
3838
*/
3939
const fail = (code, extra) =>
4040
throwPaveError(code, {

src/get-query-cost.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { isArray } = Array;
1010
* context?: Context;
1111
* path?: string[];
1212
* query: Query;
13-
* schema: Schema;
13+
* schema: Schema<string, {}, any>;
1414
* type: Type;
1515
* }} options
1616
*/

src/index.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @template [T=any] Default is `any`
3-
* @typedef {{ _?: string; $?: any; _type?: Record<keyof any, never> }
3+
* @typedef {{ _?: string; $?: any; _type?: { [K in keyof any]: never } }
44
* | { [K: string]: Query<T> }} Query
55
*/
66

@@ -16,8 +16,7 @@
1616

1717
/**
1818
* @template {string} [TypeName=never] Default is `never`
19-
* @template {Record<string, any>} [Extensions=Record<never, never>] Default is
20-
* `Record<never, never>`
19+
* @template {{ [K: string]: any }} [Extensions={}] Default is `{}`
2120
* @template [Context=unknown] Default is `unknown`
2221
* @template [Input=unknown] Default is `unknown`
2322
* @template [Object=unknown] Default is `unknown`
@@ -53,7 +52,7 @@
5352
* object: Object;
5453
* path: string[];
5554
* query: Query;
56-
* schema: Schema;
55+
* schema: Schema<TypeName, Extensions, Context>;
5756
* type: Type;
5857
* value: Value;
5958
* }) => any)
@@ -70,7 +69,7 @@
7069
* object: Object;
7170
* path: string[];
7271
* query: Query;
73-
* schema: Schema;
72+
* schema: Schema<TypeName, Extensions, Context>;
7473
* type: Type;
7574
* value: Value;
7675
* }) => number);
@@ -81,7 +80,7 @@
8180
* object: Object;
8281
* path: string[];
8382
* query: Query;
84-
* schema: Schema;
83+
* schema: Schema<TypeName, Extensions, Context>;
8584
* type: Type;
8685
* value: ResolvedValue;
8786
* }) => any;
@@ -91,14 +90,12 @@
9190
*/
9291

9392
/**
94-
* @template {string} [TypeName=never] Default is `never`
95-
* @template {Record<string, any>} [Extensions=Record<never, never>] Default is
96-
* `Record<never, never>`
97-
* @template [Context=unknown] Default is `unknown`
98-
* @typedef {Record<
99-
* TypeName,
100-
* Type<TypeName, Extensions, Context, any, any, any, any>
101-
* >} Schema
93+
* @template {string} TypeName
94+
* @template {{ [K: string]: any }} Extensions
95+
* @template Context
96+
* @typedef {{
97+
* [K in TypeName]: Type<TypeName, Extensions, Context, any, any, any, any>;
98+
* }} Schema
10299
*/
103100

104101
export { Context } from '#src/context.js';

src/validate-query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const skipInput = {};
1313
* context?: any;
1414
* path?: string[];
1515
* query: Query;
16-
* schema: Schema;
16+
* schema: Schema<string, {}, any>;
1717
* type: Type;
1818
* }} options
1919
* @returns {Query}

src/validate-schema.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const { Set } = globalThis;
77

88
const { isArray } = Array;
99

10-
/** @param {{ extensions?: { [K: string]: any }; schema: Schema }} options */
10+
/**
11+
* @param {{
12+
* extensions?: { [K: string]: any };
13+
* schema: Schema<string, {}, any>;
14+
* }} options
15+
*/
1116
export const validateSchema = ({ extensions, schema }) => {
1217
const positiveNumber = {
1318
resolve: ({ value }) => {

src/validate-value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { isArray } = Array;
1212
* object?: any;
1313
* path?: string[];
1414
* query?: Query;
15-
* schema: Schema;
15+
* schema: Schema<string, {}, any>;
1616
* type: Type;
1717
* value?: any;
1818
* }} options

types/execute.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export function execute({ context, object, path, query, schema, type, value }: {
33
object?: any;
44
path?: string[];
55
query: Query;
6-
schema: Schema;
6+
schema: Schema<string, {}, any>;
77
type: Type;
88
value?: any;
99
}): Promise<any>;

types/get-query-cost.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export function getQueryCost<Context = any>({ context, path, query, schema, type
22
context?: Context;
33
path?: string[];
44
query: Query;
5-
schema: Schema;
5+
schema: Schema<string, {}, any>;
66
type: Type;
77
}): any;
88
import type { Query } from '#src/index.js';

0 commit comments

Comments
 (0)