Skip to content

Commit e062a3b

Browse files
committed
FormPathLeaves caused a memory leak when using svelte-package.
Fixes #404
1 parent 623b681 commit e062a3b

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- `FormPathLeaves` caused a memory leak when using `svelte-package`.
13+
814
## [2.12.3] - 2024-04-08
915

1016
### Fixed

src/lib/stringPath.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,28 @@ type BuiltInObjects = Date | Set<unknown> | File;
2424
/**
2525
* Lists all paths in an object as string accessors.
2626
*/
27-
export type FormPath<T extends object, Type = any> = string & T extends any
28-
? StringPath<T, { filter: 'all'; objAppend: never; path: ''; type: Type }>
29-
: never;
27+
export type FormPath<T extends object, Type = any> = string &
28+
StringPath<T, { filter: 'all'; objAppend: never; path: ''; type: Type }>;
3029

3130
/**
3231
* List paths in an object as string accessors, but only with non-objects as accessible properties.
3332
* Similar to the leaves in a node tree, if you look at the object as a tree structure.
3433
*/
35-
export type FormPathLeaves<T extends object, Type = any> = string & T extends any
36-
? StringPath<T, { filter: 'leaves'; objAppend: never; path: ''; type: Type }>
37-
: never;
34+
export type FormPathLeaves<T extends object, Type = any> = string &
35+
StringPath<T, { filter: 'leaves'; objAppend: never; path: ''; type: Type }>;
3836

3937
/**
4038
* List paths in an object as string accessors, but only with non-objects as accessible properties.
4139
* Also includes the _errors field for objects and arrays.
4240
*/
43-
export type FormPathLeavesWithErrors<T extends object, Type = any> = string & T extends any
44-
? StringPath<T, { filter: 'leaves'; objAppend: '_errors'; path: ''; type: Type }>
45-
: never;
41+
export type FormPathLeavesWithErrors<T extends object, Type = any> = string &
42+
StringPath<T, { filter: 'leaves'; objAppend: '_errors'; path: ''; type: Type }>;
4643

4744
/**
4845
* List all arrays in an object as string accessors.
4946
*/
50-
export type FormPathArrays<T extends object, Type = any> = string & T extends any
51-
? StringPath<T, { filter: 'arrays'; objAppend: never; path: ''; type: Type }>
52-
: never;
47+
export type FormPathArrays<T extends object, Type = any> = string &
48+
StringPath<T, { filter: 'arrays'; objAppend: never; path: ''; type: Type }>;
5349

5450
type Concat<
5551
Path extends string,

0 commit comments

Comments
 (0)