File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -342,18 +342,24 @@ export type LocalStorageOptions = Omit<
342342 | 'onPaintFinish'
343343> ;
344344
345- function isOptionKey ( key : string ) : key is keyof Options {
346- return key in ReactScanInternals . options . value ;
347- }
345+ const filetLocalStorageOptions = ( options : Options ) : LocalStorageOptions => {
346+ const {
347+ onCommitStart,
348+ onRender,
349+ onCommitFinish,
350+ onPaintStart,
351+ onPaintFinish,
352+ ...rest
353+ } = options ;
354+ return rest ;
355+ } ;
348356
349357const validateOptions = ( options : Partial < Options > ) : Partial < Options > => {
350358 const errors : Array < string > = [ ] ;
351359 const validOptions : Partial < Options > = { } ;
352360
353361 for ( const key in options ) {
354- if ( ! isOptionKey ( key ) ) continue ;
355-
356- const value = options [ key ] ;
362+ const value = options [ key as keyof Options ] ;
357363 switch ( key ) {
358364 case 'enabled' :
359365 // case 'includeChildren':
@@ -500,7 +506,10 @@ export const setOptions = (userOptions: Partial<Options>) => {
500506 /** */
501507 }
502508
503- saveLocalStorage ( 'react-scan-options' , newOptions ) ;
509+ saveLocalStorage < LocalStorageOptions > (
510+ 'react-scan-options' ,
511+ filetLocalStorageOptions ( newOptions ) ,
512+ ) ;
504513
505514 if ( shouldInitToolbar ) {
506515 initToolbar ( ! ! newOptions . showToolbar ) ;
You can’t perform that action at this time.
0 commit comments