Skip to content

Commit e1e301f

Browse files
committed
Fixed isTainted for no arguments
1 parent b1ae591 commit e1e301f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/lib/client/superForm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,8 @@ export function superForm<
12071207
function Tainted_isTainted(
12081208
path?: FormPath<T> | Record<string, unknown> | boolean | undefined
12091209
): boolean {
1210+
if (!arguments.length) return Tainted__isObjectTainted(Data.tainted);
1211+
12101212
if (typeof path === 'boolean') return path;
12111213
if (typeof path === 'object') return Tainted__isObjectTainted(path);
12121214
if (!Data.tainted || path === undefined) return false;

src/tests/superForm.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ describe('Tainted', () => {
8585

8686
tainted.set({ name: true });
8787
expect(form.isTainted(get(tainted))).toBe(true);
88-
// true since the real store is tainted:
89-
expect(form.isTainted(undefined)).toBe(true);
90-
9188
expect(form.isTainted(get(tainted)?.name)).toBe(true);
9289
});
9390

0 commit comments

Comments
 (0)