Skip to content

Commit

Permalink
Fix record tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Feb 26, 2023
1 parent e559605 commit defdab9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions deno/lib/types.ts
Expand Up @@ -3102,7 +3102,7 @@ export type RecordType<K extends string | number | symbol, V> = [
? Record<K, V>
: [symbol] extends [K]
? Record<K, V>
: K extends BRAND<string | number | symbol>
: [BRAND<string | number | symbol>] extends [K]
? Record<K, V>
: Partial<Record<K, V>>;
export class ZodRecord<
Expand Down Expand Up @@ -3538,7 +3538,7 @@ export class ZodFunction<
return this._def.returns;
}

args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(
args<Items extends Parameters<typeof ZodTuple["create"]>[0]>(
...items: Items
): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns> {
return new ZodFunction({
Expand Down Expand Up @@ -4673,18 +4673,18 @@ const oboolean = () => booleanType().optional();

export const coerce = {
string: ((arg) =>
ZodString.create({ ...arg, coerce: true })) as (typeof ZodString)["create"],
ZodString.create({ ...arg, coerce: true })) as typeof ZodString["create"],
number: ((arg) =>
ZodNumber.create({ ...arg, coerce: true })) as (typeof ZodNumber)["create"],
ZodNumber.create({ ...arg, coerce: true })) as typeof ZodNumber["create"],
boolean: ((arg) =>
ZodBoolean.create({
...arg,
coerce: true,
})) as (typeof ZodBoolean)["create"],
})) as typeof ZodBoolean["create"],
bigint: ((arg) =>
ZodBigInt.create({ ...arg, coerce: true })) as (typeof ZodBigInt)["create"],
ZodBigInt.create({ ...arg, coerce: true })) as typeof ZodBigInt["create"],
date: ((arg) =>
ZodDate.create({ ...arg, coerce: true })) as (typeof ZodDate)["create"],
ZodDate.create({ ...arg, coerce: true })) as typeof ZodDate["create"],
};

export {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -93,7 +93,7 @@
"ts-node": "^10.9.1",
"tslib": "^2.3.1",
"tsx": "^3.8.0",
"typescript": "4.5"
"typescript": "~4.5.0"
},
"lint-staged": {
"src/*.ts": [
Expand Down
14 changes: 7 additions & 7 deletions src/types.ts
Expand Up @@ -3102,7 +3102,7 @@ export type RecordType<K extends string | number | symbol, V> = [
? Record<K, V>
: [symbol] extends [K]
? Record<K, V>
: K extends BRAND<string | number | symbol>
: [BRAND<string | number | symbol>] extends [K]
? Record<K, V>
: Partial<Record<K, V>>;
export class ZodRecord<
Expand Down Expand Up @@ -3538,7 +3538,7 @@ export class ZodFunction<
return this._def.returns;
}

args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(
args<Items extends Parameters<typeof ZodTuple["create"]>[0]>(
...items: Items
): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns> {
return new ZodFunction({
Expand Down Expand Up @@ -4673,18 +4673,18 @@ const oboolean = () => booleanType().optional();

export const coerce = {
string: ((arg) =>
ZodString.create({ ...arg, coerce: true })) as (typeof ZodString)["create"],
ZodString.create({ ...arg, coerce: true })) as typeof ZodString["create"],
number: ((arg) =>
ZodNumber.create({ ...arg, coerce: true })) as (typeof ZodNumber)["create"],
ZodNumber.create({ ...arg, coerce: true })) as typeof ZodNumber["create"],
boolean: ((arg) =>
ZodBoolean.create({
...arg,
coerce: true,
})) as (typeof ZodBoolean)["create"],
})) as typeof ZodBoolean["create"],
bigint: ((arg) =>
ZodBigInt.create({ ...arg, coerce: true })) as (typeof ZodBigInt)["create"],
ZodBigInt.create({ ...arg, coerce: true })) as typeof ZodBigInt["create"],
date: ((arg) =>
ZodDate.create({ ...arg, coerce: true })) as (typeof ZodDate)["create"],
ZodDate.create({ ...arg, coerce: true })) as typeof ZodDate["create"],
};

export {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -4781,7 +4781,7 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@4.5:
typescript@~4.5.0:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
Expand Down

0 comments on commit defdab9

Please sign in to comment.