UNPKG

hongluan-ui

Version:
1 lines 1.33 kB
{"version":3,"file":"validator.mjs","sources":["../../../../../packages/utils/vue/validator.ts"],"sourcesContent":["import { COMPONENT_SIZES, datePickTypes } from '@hongluan-ui/constants'\nimport type { DatePickType } from '@hongluan-ui/constants'\n\nexport const isValidComponentSize = (val: string) => {\n return [...COMPONENT_SIZES, null, undefined, ''].includes(val)\n}\n\n// 由于类型可扩展,防止控制台报警告信息,去掉类型校验\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const isValidComponentType = (val: string) => {\n return true\n // return [...COMPONENT_TYPES, null, undefined, ''].includes(val)\n}\n\nexport const isValidComponentState = (val: string) =>\n ['success', 'loading', 'fail'].includes(val)\n\nexport const isValidDatePickType = (val: string): val is DatePickType =>\n ([...datePickTypes] as string[]).includes(val)\n"],"names":[],"mappings":";;;;AACY,MAAC,oBAAoB,GAAG,CAAC,GAAG,KAAK;AAC7C,EAAE,OAAO,CAAC,GAAG,eAAe,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9D,EAAE;AACU,MAAC,oBAAoB,GAAG,CAAC,GAAG,KAAK;AAC7C,EAAE,OAAO,IAAI,CAAC;AACd,EAAE;AACU,MAAC,qBAAqB,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE;AAC/E,MAAC,mBAAmB,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,CAAC,QAAQ,CAAC,GAAG;;;;"}