export const TRACKED_LAYER_DESCRIPTOR = '__trackedLayerDescriptor' ; export function copyPersistentState ( input ) { if ( typeof input !== 'object' || input === null ) { return input ; } const copyInput = Array . isArray ( input ) ? [ ] : { } ; for ( const key in input ) { if ( ! key . startsWith ( '__' ) ) { copyInput [ key ] = copyPersistentState ( input [ key ] ) ; } } return copyInput ; }