diff --git a/src/Formulario.ts b/src/Formulario.ts index 08b912f..faf31d1 100644 --- a/src/Formulario.ts +++ b/src/Formulario.ts @@ -1,5 +1,4 @@ import { VueConstructor } from 'vue' -import isPlainObject from 'is-plain-object' import library from '@/libs/library' import rules from '@/validation/rules' @@ -103,7 +102,7 @@ export default class Formulario { const options = this.options as FormularioOptions const path = vm.$route && vm.$route.path ? vm.$route.path : false const pathPrefix = path ? vm.$route.path.replace(/[/\\.\s]/g, '-') : 'global' - if (!Object.prototype.hasOwnProperty.call(this.idRegistry, pathPrefix)) { + if (!has(this.idRegistry, pathPrefix)) { this.idRegistry[pathPrefix] = 0 } return `${options.idPrefix}${pathPrefix}-${++this.idRegistry[pathPrefix]}` @@ -120,28 +119,6 @@ export default class Formulario { throw new Error(`VueFormulario extend() should be passed an object (was ${typeof extendWith})`) } - /** - * Determine what "class" of input this element is given the "type". - */ - classify (type: string) { - if (has(this.options.library, type)) { - return this.options.library[type].classification - } - - return 'unknown' - } - - /** - * Determine what type of component to render given the "type". - */ - component (type: string) { - if (has(this.options.library, type)) { - return this.options.library[type].component - } - - return false - } - /** * Get validation rules by merging any passed in with global rules. */ diff --git a/src/common.types.ts b/src/common.types.ts index ddc9127..098f699 100644 --- a/src/common.types.ts +++ b/src/common.types.ts @@ -1 +1,2 @@ +export type ArrayType = [any] export type ObjectType = { [key: string]: any } diff --git a/src/libs/utils.ts b/src/libs/utils.ts index fe23e01..7839ae0 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -1,7 +1,8 @@ import FileUpload from '@/FileUpload' - -type ArrayType = [any] -type ObjectType = { [key: string]: any } +import { + ArrayType, + ObjectType, +} from '@/common.types' /** * Function to map over an object.