UNPKG

yanzhen-design-vue

Version:

21 lines (20 loc) 514 B
import { fromPairs } from "lodash-es"; import { eventType } from "ant-design-vue/es/_util/type"; const emitRegExp = /^(on)([A-Z]+)([\S\s]{0,})$/; const handleExtendProps = (extendProps, props) => { const keys = Object.keys(props); const extendKeys = Object.keys(extendProps); return fromPairs( extendKeys.reduce((prev, key) => { if (keys.includes(key)) { prev.push([key, props[key]]); } return prev; }, []) ); }; export { emitRegExp, eventType, handleExtendProps };