@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
1 lines • 1.02 kB
Source Map (JSON)
{"version":3,"file":"select-menu-validators.cjs","sources":["../../../components/select_menu/select_menu_validators.js"],"sourcesContent":["const hasValidOptionValue = option => {\n return typeof option.value === 'string' || typeof option.value === 'number';\n};\n\nconst hasValidOptionLabel = option => {\n if (!option.label) {\n return false;\n }\n\n return typeof option.label === 'string';\n};\n\nexport const optionsValidator = options => {\n if (!options) {\n return true;\n }\n\n return options.every(option => {\n if (!hasValidOptionValue(option)) {\n return false;\n }\n\n if (!hasValidOptionLabel(option)) {\n return false;\n }\n\n return true;\n });\n};\n"],"names":["hasValidOptionValue","option","hasValidOptionLabel","optionsValidator","options"],"mappings":"gFAAA,MAAMA,EAAsBC,GACnB,OAAOA,EAAO,OAAU,UAAY,OAAOA,EAAO,OAAU,SAG/DC,EAAsBD,GACrBA,EAAO,MAIL,OAAOA,EAAO,OAAU,SAHtB,GAMEE,EAAmBC,GACzBA,EAIEA,EAAQ,MAAMH,GACf,GAACD,EAAoBC,CAAM,GAI3B,CAACC,EAAoBD,CAAM,EAKhC,EAbQ"}