Skip to content

Commit

Permalink
QA: Remove unused props type + add extra types just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesst20 committed Jun 26, 2024
1 parent c69e2d2 commit 3d07f5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/svelte/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import type { PageProps } from '@inertiajs/core'
import type { ComponentType } from 'svelte'

export type ComponentsResolver = (name: string) => ResolvedComponents | Promise<ResolvedComponents>

export type ResolvedComponents = {
default?: ComponentType
layout?: ComponentType,
props?: PageProps
layout?: ComponentType
}
4 changes: 2 additions & 2 deletions packages/svelte/src/lib/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default function useForm<TForm extends FormDataType>(
return this
},
reset(...fields) {
const resolvedData = typeof data === 'object' ? cloneDeep(defaults) : cloneDeep(data!())
const clonedData = cloneDeep(resolvedData)
const resolvedData: TForm = typeof data === 'object' ? cloneDeep(defaults) : cloneDeep(data!())
const clonedData = cloneDeep(resolvedData) as TForm
if (fields.length === 0) {
this.setStore(clonedData)
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue2/src/createInertiaApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default async function createInertiaApp({
const el = isServer ? null : document.getElementById(id)
const initialPage = page || JSON.parse(el.dataset.page)
// @ts-expect-error
const resolveComponent = (name) => Promise.resolve(resolve(name)).then((module) => module.default || module)
const resolveComponent = (name: string) => Promise.resolve(resolve(name)).then((module) => module.default || module)

let head = []

Expand Down

0 comments on commit 3d07f5e

Please sign in to comment.