import { RecursiveReadonly } from '@kbn/utility-types' ; public export type Freezable = { [ k ] : any ; } | any [ ] ; public export function deepFreeze < T extends Freezable > ( object ) { for ( const value of Object . values ( object ) ) { if ( value !== null && typeof value === 'object' ) { deepFreeze ( value ) ; } } return Object . freeze ( object ) as RecursiveReadonly < T > ; }