Skip to content

Commit

Permalink
fix(deps): update dependency zod to ^3.20.0 (#105)
Browse files Browse the repository at this point in the history
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [zod](https://togithub.com/colinhacks/zod) | [`^3.19.1` ->
`^3.20.0`](https://renovatebot.com/diffs/npm/zod/3.19.1/3.20.0) |
[![age](https://badges.renovateapi.com/packages/npm/zod/3.20.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/zod/3.20.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/zod/3.20.0/compatibility-slim/3.19.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/zod/3.20.0/confidence-slim/3.19.1)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>colinhacks/zod</summary>

###
[`v3.20.0`](https://togithub.com/colinhacks/zod/releases/tag/v3.20.0):
-beta

[Compare
Source](https://togithub.com/colinhacks/zod/compare/v3.19.1...v3.20.0)

##### Breaking changes

There are no breaking API changes, however TypeScript versions `4.4` and
earlier are no longer officially supported.

##### New features

The most feature-packed release since Zod 3.0!

##### `.pipe()`

A new schema method `.pipe()` is now available on all schemas. which can
be used to chain multiple schemas into a "validation pipeline".
Typically this will be used in conjunction with `.transform()`.

```ts
z.string()
  .transform(val => val.length)
  .pipe(z.number().min(5))
```

The `.pipe()` method returns a `ZodPipeline` instance.

##### `z.coerce`

Zod now provides a more convenient way to coerce primitive values.

```ts
const schema = z.coerce.string();
schema.parse("tuna"); // => "tuna"
schema.parse(12); // => "12"
schema.parse(true); // => "true"
```

During the parsing step, the input is passed through the `String()`
function, which is a JavaScript built-in for coercing data into strings.
Note that the returned schema is a `ZodString` instance so you can use
all string methods.

```ts
z.coerce.string().email().min(5);
```

All primitive types support coercion.

```ts
z.coerce.string();   // String(input)
z.coerce.number();   // Number(input)
z.coerce.boolean();  // Boolean(input)
z.coerce.bigint();   // BigInt(input)
z.coerce.date();     // new Date(input)
```

##### `.catch()`

A new schema method `.catch()` is now available on all schemas. It can
be used to provide a "catchall" value that will be returned in the event
of a parsing error.

```ts
const schema = z.string().catch("fallback");

schema.parse("kate"); // => "kate"
schema.parse(4); // => "fallback"
```

The `.catch()` method returns a `ZodCatch` instance.

##### `z.symbol()`

A long-missing hole in Zod's type system is finally filled! Thanks
[@&#8203;santosmarco-caribou](https://togithub.com/santosmarco-caribou).

```ts
const schema = z.symbol();
schema.parse(Symbol('asdf'));
```

Relatedly, you can also pass symbols into `z.literal()`.

```ts
const TUNA = Symbol("tuna");
const schema = z.literal(TUNA);

schema.parse(TUNA); // Symbol(tuna)
schema.parse(Symbol("nottuna")); // Error
```

##### `z.string().datetime()`

A new method has been added to `ZodString` to validate ISO datetime
strings. Thanks [@&#8203;samchungy](https://togithub.com/samchungy)!

```ts
z.string().datetime();
```

This method defaults to only allowing *UTC datetimes* (the ones that end
in `"Z"`). No timezone offsets are allowed; arbitrary sub-second
precision is supported.

```ts
const dt = z.string().datetime();
dt.parse("2020-01-01T00:00:00Z"); // 🟢
dt.parse("2020-01-01T00:00:00.123Z"); // 🟢
dt.parse("2020-01-01T00:00:00.123456Z"); // 🟢 (arbitrary precision)
dt.parse("2020-01-01T00:00:00+02:00"); // 🔴 (no offsets allowed)
```

Offsets can be supported with the `offset` parameter.

```ts
const a = z.string().datetime({ offset: true });
a.parse("2020-01-01T00:00:00+02:00"); // 🟢 offset allowed
```

You can additionally constrain the allowable `precision`. This specifies
the number of digits that should follow the decimal point.

```ts
const b = z.string().datetime({ precision: 3 })
b.parse("2020-01-01T00:00:00.123Z"); // 🟢 precision of 3 decimal points
b.parse("2020-01-01T00:00:00Z"); // 🔴 invalid precision
```

##### `z.number().finite()`

Restrict a number schema to finite values. Thanks
[@&#8203;igalklebanov](https://togithub.com/igalklebanov).

```ts
const schema = z.number().finite();
schema.parse(5); 🟢
schema.parse(Infinity); 🔴
schema.parse(-Infinity); 🔴
```

##### What's Changed

- Add `mask` parameter to `.required` method by
[@&#8203;SrBrahma](https://togithub.com/SrBrahma) in
[https://github.com/colinhacks/zod/pull/1315](https://togithub.com/colinhacks/zod/pull/1315)
- Added Intersections to TOC by
[@&#8203;tmkn](https://togithub.com/tmkn) in
[https://github.com/colinhacks/zod/pull/1450](https://togithub.com/colinhacks/zod/pull/1450)
- \[[#&#8203;1468](https://togithub.com/colinhacks/zod/issues/1468)] Fix
zod.dev main page cross origin links. by
[@&#8203;agrahamg](https://togithub.com/agrahamg) in
[https://github.com/colinhacks/zod/pull/1469](https://togithub.com/colinhacks/zod/pull/1469)
- Updates remix-domains library name and description in README by
[@&#8203;diogob](https://togithub.com/diogob) in
[https://github.com/colinhacks/zod/pull/1501](https://togithub.com/colinhacks/zod/pull/1501)
- Removed BRAND from ZodBrand Input definition by
[@&#8203;Xetera](https://togithub.com/Xetera) in
[https://github.com/colinhacks/zod/pull/1492](https://togithub.com/colinhacks/zod/pull/1492)
- Add Zodix to readme ecosystem section by
[@&#8203;rileytomasek](https://togithub.com/rileytomasek) in
[https://github.com/colinhacks/zod/pull/1506](https://togithub.com/colinhacks/zod/pull/1506)
- Fix small typos in README by
[@&#8203;Yhozen](https://togithub.com/Yhozen) in
[https://github.com/colinhacks/zod/pull/1521](https://togithub.com/colinhacks/zod/pull/1521)
- fix typo by [@&#8203;oasido](https://togithub.com/oasido) in
[https://github.com/colinhacks/zod/pull/1528](https://togithub.com/colinhacks/zod/pull/1528)
- add `fatal` to `ZodIssue`. by
[@&#8203;igalklebanov](https://togithub.com/igalklebanov) in
[https://github.com/colinhacks/zod/pull/1555](https://togithub.com/colinhacks/zod/pull/1555)
- Fix typo in ERROR_HANDLING.md by
[@&#8203;Tsuyoshi84](https://togithub.com/Tsuyoshi84) in
[https://github.com/colinhacks/zod/pull/1543](https://togithub.com/colinhacks/zod/pull/1543)
- add `.finite()` @&#8203; `ZodNumber`. by
[@&#8203;igalklebanov](https://togithub.com/igalklebanov) in
[https://github.com/colinhacks/zod/pull/1546](https://togithub.com/colinhacks/zod/pull/1546)
- Fix typing bug hiding errors of nullable composite fields by
[@&#8203;tadeokondrak](https://togithub.com/tadeokondrak) in
[https://github.com/colinhacks/zod/pull/1545](https://togithub.com/colinhacks/zod/pull/1545)
- [#&#8203;1227](https://togithub.com/colinhacks/zod/issues/1227)
Feature default on mismatch by
[@&#8203;seancrowe](https://togithub.com/seancrowe) in
[https://github.com/colinhacks/zod/pull/1537](https://togithub.com/colinhacks/zod/pull/1537)
- fix [#&#8203;1046](https://togithub.com/colinhacks/zod/issues/1046)
`.required()` doesn't remove optional flag from the result of
`.nullish()`. by
[@&#8203;igalklebanov](https://togithub.com/igalklebanov) in
[https://github.com/colinhacks/zod/pull/1542](https://togithub.com/colinhacks/zod/pull/1542)
- add `datetime()` string formats by
[@&#8203;samchungy](https://togithub.com/samchungy) in
[https://github.com/colinhacks/zod/pull/1494](https://togithub.com/colinhacks/zod/pull/1494)
- Bump minimatch from 3.0.4 to 3.1.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/colinhacks/zod/pull/1558](https://togithub.com/colinhacks/zod/pull/1558)
- Bump minimist from 1.2.5 to 1.2.7 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/colinhacks/zod/pull/1507](https://togithub.com/colinhacks/zod/pull/1507)
- [#&#8203;1171](https://togithub.com/colinhacks/zod/issues/1171)
support for refine, superRefine, transform and lazy in
discriminatedUnion by [@&#8203;roblabat](https://togithub.com/roblabat)
in
[https://github.com/colinhacks/zod/pull/1290](https://togithub.com/colinhacks/zod/pull/1290)
- branded type as normal argument by
[@&#8203;KATT](https://togithub.com/KATT) in
[https://github.com/colinhacks/zod/pull/1502](https://togithub.com/colinhacks/zod/pull/1502)
- Take `path` parameter into account within `.parseAsync()` by
[@&#8203;RobinTail](https://togithub.com/RobinTail) in
[https://github.com/colinhacks/zod/pull/1513](https://togithub.com/colinhacks/zod/pull/1513)
- Update README.md by
[@&#8203;rosnerdev](https://togithub.com/rosnerdev) in
[https://github.com/colinhacks/zod/pull/1463](https://togithub.com/colinhacks/zod/pull/1463)
- Add `ZodSymbol` by
[@&#8203;santosmarco-caribou](https://togithub.com/santosmarco-caribou)
in
[https://github.com/colinhacks/zod/pull/1448](https://togithub.com/colinhacks/zod/pull/1448)
- Fix Minor Typos by
[@&#8203;WebDevSimplified](https://togithub.com/WebDevSimplified) in
[https://github.com/colinhacks/zod/pull/1624](https://togithub.com/colinhacks/zod/pull/1624)

##### New Contributors

- [@&#8203;SrBrahma](https://togithub.com/SrBrahma) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1315](https://togithub.com/colinhacks/zod/pull/1315)
- [@&#8203;tmkn](https://togithub.com/tmkn) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1450](https://togithub.com/colinhacks/zod/pull/1450)
- [@&#8203;agrahamg](https://togithub.com/agrahamg) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1469](https://togithub.com/colinhacks/zod/pull/1469)
- [@&#8203;diogob](https://togithub.com/diogob) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1501](https://togithub.com/colinhacks/zod/pull/1501)
- [@&#8203;Xetera](https://togithub.com/Xetera) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1492](https://togithub.com/colinhacks/zod/pull/1492)
- [@&#8203;rileytomasek](https://togithub.com/rileytomasek) made their
first contribution in
[https://github.com/colinhacks/zod/pull/1506](https://togithub.com/colinhacks/zod/pull/1506)
- [@&#8203;Yhozen](https://togithub.com/Yhozen) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1521](https://togithub.com/colinhacks/zod/pull/1521)
- [@&#8203;oasido](https://togithub.com/oasido) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1528](https://togithub.com/colinhacks/zod/pull/1528)
- [@&#8203;igalklebanov](https://togithub.com/igalklebanov) made their
first contribution in
[https://github.com/colinhacks/zod/pull/1555](https://togithub.com/colinhacks/zod/pull/1555)
- [@&#8203;Tsuyoshi84](https://togithub.com/Tsuyoshi84) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1543](https://togithub.com/colinhacks/zod/pull/1543)
- [@&#8203;tadeokondrak](https://togithub.com/tadeokondrak) made their
first contribution in
[https://github.com/colinhacks/zod/pull/1545](https://togithub.com/colinhacks/zod/pull/1545)
- [@&#8203;seancrowe](https://togithub.com/seancrowe) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1537](https://togithub.com/colinhacks/zod/pull/1537)
- [@&#8203;samchungy](https://togithub.com/samchungy) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1494](https://togithub.com/colinhacks/zod/pull/1494)
- [@&#8203;roblabat](https://togithub.com/roblabat) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1290](https://togithub.com/colinhacks/zod/pull/1290)
- [@&#8203;KATT](https://togithub.com/KATT) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1502](https://togithub.com/colinhacks/zod/pull/1502)
- [@&#8203;RobinTail](https://togithub.com/RobinTail) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1513](https://togithub.com/colinhacks/zod/pull/1513)
- [@&#8203;rosnerdev](https://togithub.com/rosnerdev) made their first
contribution in
[https://github.com/colinhacks/zod/pull/1463](https://togithub.com/colinhacks/zod/pull/1463)
-
[@&#8203;santosmarco-caribou](https://togithub.com/santosmarco-caribou)
made their first contribution in
[https://github.com/colinhacks/zod/pull/1448](https://togithub.com/colinhacks/zod/pull/1448)
- [@&#8203;WebDevSimplified](https://togithub.com/WebDevSimplified) made
their first contribution in
[https://github.com/colinhacks/zod/pull/1624](https://togithub.com/colinhacks/zod/pull/1624)

**Full Changelog**:
colinhacks/zod@v3.19.1...v3.20.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - "after 8:00 before 23:00 every weekday except on Friday" in
timezone UTC.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/fiatconnect/fiatconnect-types).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC41NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNTQuMiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Dec 15, 2022
1 parent f5f6095 commit 9a37a61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"preset": "conventionalcommits"
},
"dependencies": {
"zod": "^3.19.1"
"zod": "^3.20.0"
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5884,7 +5884,7 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zod@^3.19.1:
version "3.19.1"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.19.1.tgz#112f074a97b50bfc4772d4ad1576814bd8ac4473"
integrity sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==
zod@^3.20.0:
version "3.20.2"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.20.2.tgz#068606642c8f51b3333981f91c0a8ab37dfc2807"
integrity sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==

0 comments on commit 9a37a61

Please sign in to comment.