From c78a58f3fee5320dccdea5dc7740d4ab6dcbc5fc Mon Sep 17 00:00:00 2001 From: ankurk91 Date: Sat, 29 Oct 2022 11:15:32 +0530 Subject: [PATCH] Improve types --- src/component.ts | 4 ++-- src/util.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/component.ts b/src/component.ts index 4144ade..c039a5b 100644 --- a/src/component.ts +++ b/src/component.ts @@ -73,9 +73,9 @@ export default defineComponent({ }); }, methods: { - prepareConfig(): Partial { + prepareConfig(): flatpickr.Options.Options { // Don't mutate original object on parent component - let safeConfig: flatpickr.Options.Options = {...this.config}; + let safeConfig = {...this.config}; this.events.forEach((hook) => { // Respect global callbacks registered via setDefault() method diff --git a/src/util.ts b/src/util.ts index c61064c..aa52e1d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -3,7 +3,7 @@ export type Kebab = Kebab ? "" : "-"}${Lowercase}`> : A; -function camelToKebab(string: T): string { +function camelToKebab(string: T): Kebab { return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() as Kebab; }