Skip to content

Commit

Permalink
Improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurk91 committed Oct 29, 2022
1 parent cb4f774 commit c78a58f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export default defineComponent({
});
},
methods: {
prepareConfig(): Partial<flatpickr.Options.Options> {
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
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type Kebab<T extends string, A extends string = ""> =
Kebab<R, `${A}${F extends Lowercase<F> ? "" : "-"}${Lowercase<F>}`> :
A;

function camelToKebab<T extends string>(string: T): string {
function camelToKebab<T extends string>(string: T): Kebab<T> {
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() as Kebab<T>;
}

Expand Down

0 comments on commit c78a58f

Please sign in to comment.