Commit 64f484f
fixes #14835
The form's default values are an empty object `{}` when defaults are not
provided by `.set()`. Therefore, the `.value()` getter should return a
deep partial of the schema type as all values are initially undefined.
Plus, deep partial `.set()` allows setting _some_, but not _all_ values
initially.
[`DeepPartial`
Demo](https://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true#code/C4TwDgpgBAIhFgAoEMBOwCWyA2AeAKgHxQC8AsAFACQ+UEAHsBAHYAmAzlAEoQDGA9qla5EqfpHQgA0hBAAaKAFdmAa2b8A7s2IAfJavVaA2gF1KVKgH4oAb3MWqRqVAzMoK2fwBmUfCcsAXL5OJnSMLBzcfILCouIQkjLy+mqa2lB6yqnGodZwCCjoWHj4IcRBpVImANz2VAC+9hUZ+qwQXq4QrLUUlALM7MBQTINB+UhomDi4dhRQ81D8AEYAVkE2wxCjsMhMUPVylAtQaKjrm9uDqK4A5vumh3MLqHxBPAJCuFe3Ct-MN4RKPViCRbJQgeCKCNgAA6ZYrSww6GUAD0KIWAD1LJRoTDToijAAGfxIrbAVHo+ZYnFkmEvXiI5EUNGY7G9Cj9QYXYAAJjG8AmRWmfwBpCgACJxRTjligA)
---
### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:
- [x] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [ ] Ideally, include a test that fails without this PR but passes with
it.
### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`
### Changesets
- [x] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.
### Edits
- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.
---------
Co-authored-by: Tee Ming <[email protected]>
1 parent d28d372 commit 64f484f
File tree
4 files changed
+26
-4
lines changed- .changeset
- packages/kit
- src
- exports
- types
- types
4 files changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
1910 | 1911 | | |
1911 | 1912 | | |
1912 | 1913 | | |
1913 | | - | |
| 1914 | + | |
1914 | 1915 | | |
1915 | | - | |
| 1916 | + | |
1916 | 1917 | | |
1917 | 1918 | | |
1918 | 1919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
246 | 254 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1885 | 1885 | | |
1886 | 1886 | | |
1887 | 1887 | | |
1888 | | - | |
| 1888 | + | |
1889 | 1889 | | |
1890 | | - | |
| 1890 | + | |
1891 | 1891 | | |
1892 | 1892 | | |
1893 | 1893 | | |
| |||
2402 | 2402 | | |
2403 | 2403 | | |
2404 | 2404 | | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
2405 | 2413 | | |
2406 | 2414 | | |
2407 | 2415 | | |
| |||
0 commit comments