Skip to content

Commit 2e43f4f

Browse files
committed
refactor: reduce code
1 parent 521218d commit 2e43f4f

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

packages/vue-final-modal/src/components/ModalsContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { computed, onBeforeUnmount } from 'vue'
3+
import { isString } from '@vueuse/core'
34
import { useInternalVfm, useVfm } from '~/useApi'
4-
import { isString } from '~/utils'
55
66
const { modalsContainers, dynamicModals } = useVfm()
77
const { resolvedClosed, resolvedOpened } = useInternalVfm()

packages/vue-final-modal/src/useApi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { tryOnUnmounted } from '@vueuse/core'
1+
import { isString, tryOnUnmounted } from '@vueuse/core'
22
import { computed, inject, markRaw, reactive, useAttrs } from 'vue'
33
import type CoreModal from './components/CoreModal/CoreModal.vue'
44
import { internalVfmSymbol, vfmSymbol } from './injectionSymbols'
55
import type { ComponentProps, InternalVfm, ModalSlot, UseModalOptions, UseModalOptionsPrivate, UseModalReturnType, Vfm } from './Modal'
6-
import { isString } from './utils'
76

87
/**
98
* Returns the vfm instance. Equivalent to using `$vfm` inside

packages/vue-final-modal/src/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,3 @@ export const noop = () => {}
1212
export function clamp(val: number, min: number, max: number) {
1313
return val > max ? max : val < min ? min : val
1414
}
15-
16-
export function isString(str: any): str is string {
17-
return typeof str === 'string'
18-
}

0 commit comments

Comments
 (0)