refactor(ivy): remove code duplication from applyXYZ functions (#31182)
refactor(ivy): remove code duplication from applyXYZ functions (#31182)

PR Close #31182

alexeagle/angular,sarunint/angular,mhevery/angular,shairez/angular,StephenFluin/angular,gnomeontherun/angular,gdi2290/angular,sarunint/angular,brandonroberts/angular,mhevery/angular,mhevery/angular,Toxicable/angular,alexeagle/angular,gdi2290/angular,blesh/angular,gkalpak/angular,vikerman/angular,filipesilva/angular,ocombe/angular,alexeagle/angular,snaptech/angular,mprobst/angular,IdeaBlade/angular,IdeaBlade/angular,blesh/angular,alxhub/angular,shairez/angular,sarunint/angular,angular/angular,IdeaBlade/angular,filipesilva/angular,mhevery/angular,ocombe/angular,gkalpak/angular,StephenFluin/angular,matsko/angular,filipesilva/angular,mhevery/angular,mprobst/angular,mgechev/angular,gnomeontherun/angular,angular-indonesia/angular,snaptech/angular,brandonroberts/angular,gdi2290/angular,JiaLiPassion/angular,matsko/angular,mgechev/angular,snaptech/angular,angular/angular,angular-indonesia/angular,matsko/angular,sarunint/angular,vikerman/angular,mprobst/angular,manekinekko/angular,alexeagle/angular,angular-indonesia/angular,Toxicable/angular,shairez/angular,Toxicable/angular,manekinekko/angular,gdi2290/angular,alxhub/angular,alexeagle/angular,alxhub/angular,Brocco/angular,Toxicable/angular,vikerman/angular,wKoza/angular,shairez/angular,StephenFluin/angular,Brocco/angular,Toxicable/angular,wKoza/angular,snaptech/angular,sarunint/angular,vikerman/angular,matsko/angular,brandonroberts/angular,JiaLiPassion/angular,manekinekko/angular,ocombe/angular,alxhub/angular,blesh/angular,manekinekko/angular,gnomeontherun/angular,ocombe/angular,mprobst/angular,JiaLiPassion/angular,blesh/angular,alexeagle/angular,brandonroberts/angular,gkalpak/angular,StephenFluin/angular,wKoza/angular,filipesilva/angular,gnomeontherun/angular,gdi2290/angular,angular-indonesia/angular,vikerman/angular,angular/angular,Brocco/angular,wKoza/angular,IdeaBlade/angular,wKoza/angular,sarunint/angular,snaptech/angular,filipesilva/angular,manekinekko/angular,blesh/angular,gdi2290/angular,matsko/angular,brandonroberts/angular,Brocco/angular,vikerman/angular,ocombe/angular,JiaLiPassion/angular,shairez/angular,alxhub/angular,manekinekko/angular,mhevery/angular,StephenFluin/angular,mgechev/angular,mgechev/angular,mgechev/angular,mprobst/angular,gkalpak/angular,angular/angular,Brocco/angular,Toxicable/angular,mprobst/angular,brandonroberts/angular,wKoza/angular,Brocco/angular,ocombe/angular,IdeaBlade/angular,snaptech/angular