@@ -822,14 +822,22 @@ export const init = (rawOptions?: Options): ReactGrabAPI => {
822822 }
823823 } ;
824824
825- const handleCopySuccessWithComments = (
826- copiedElements : Element [ ] ,
827- content : string ,
828- extraPrompt : string | undefined ,
829- elementName : string | undefined ,
830- tagName : string | null ,
831- componentName : string | null ,
832- ) => {
825+ const handleCopySuccessWithComments = ( options : {
826+ copiedElements : Element [ ] ;
827+ content : string ;
828+ extraPrompt : string | undefined ;
829+ elementName : string | undefined ;
830+ tagName : string | null ;
831+ componentName : string | null ;
832+ } ) => {
833+ const {
834+ copiedElements,
835+ content,
836+ extraPrompt,
837+ elementName,
838+ tagName,
839+ componentName,
840+ } = options ;
833841 pluginRegistry . hooks . onCopySuccess ( copiedElements , content ) ;
834842
835843 if ( ! extraPrompt ) return ;
@@ -919,14 +927,14 @@ export const init = (rawOptions?: Options): ReactGrabAPI => {
919927 transformCopyContent : pluginRegistry . hooks . transformCopyContent ,
920928 onAfterCopy : pluginRegistry . hooks . onAfterCopy ,
921929 onCopySuccess : ( copiedElements : Element [ ] , content : string ) => {
922- handleCopySuccessWithComments (
930+ handleCopySuccessWithComments ( {
923931 copiedElements,
924932 content,
925933 extraPrompt,
926934 elementName,
927935 tagName,
928936 componentName,
929- ) ;
937+ } ) ;
930938 } ,
931939 onCopyError : pluginRegistry . hooks . onCopyError ,
932940 } ,
0 commit comments