const isPlatformSpecifyProp = ( prop ) => prop . match ( /^(ali|wechat|toutiao)-/ ) ; const normalizeWebSpecifyProp = ( prop ) => prop . replace ( /^web-/ , '' ) ; export function filterProps < T > ( props ) { return Object . keys ( props ) . reduce < any > ( ( acc , cur ) => { let prop = cur ; if ( process . env . REMAX_PLATFORM === 'web' ) { prop = normalizeWebSpecifyProp ( cur ) ; } if ( isPlatformSpecifyProp ( prop ) ) { return acc ; } acc [ prop ] = ( props as any ) [ cur ] ; return acc ; } , { } ) ; } export default isPlatformSpecifyProp ;