You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
1.3 KiB
1 line
1.3 KiB
{"ast":null,"code":"import '../types.mjs';\nimport { isFunction } from '@vue/shared';\nconst composeRefs = (...refs) => {\n return el => {\n refs.forEach(ref => {\n if (isFunction(ref)) {\n ref(el);\n } else {\n ref.value = el;\n }\n });\n };\n};\nexport { composeRefs };","map":{"version":3,"names":["composeRefs","refs","el","forEach","ref","isFunction","value"],"sources":["../../../../../packages/utils/vue/refs.ts"],"sourcesContent":["import { isFunction } from '../types'\n\nimport type { ComponentPublicInstance, Ref } from 'vue'\n\nexport type RefSetter = (\n el: Element | ComponentPublicInstance | undefined\n) => void\n\nexport const composeRefs = (\n ...refs: (Ref<HTMLElement | undefined> | RefSetter)[]\n) => {\n return (el: Element | ComponentPublicInstance | null) => {\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(el as Element | ComponentPublicInstance)\n } else {\n ref.value = el as HTMLElement | undefined\n }\n })\n }\n}\n"],"mappings":";;AACY,MAACA,WAAW,GAAGA,CAAC,GAAGC,IAAI,KAAK;EACtC,OAAQC,EAAE,IAAK;IACbD,IAAI,CAACE,OAAO,CAAEC,GAAG,IAAK;MACpB,IAAIC,UAAU,CAACD,GAAG,CAAC,EAAE;QACnBA,GAAG,CAACF,EAAE,CAAC;MACf,CAAO,MAAM;QACLE,GAAG,CAACE,KAAK,GAAGJ,EAAE;MACtB;IACA,CAAK,CAAC;EACN,CAAG;AACH","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |