import { isObject } from './isObject' ; param value param prefix export function objectToTuples ( original , prefix = '' ) { const entries = [ ] ; for ( const [ key , value ] of Object . entries ( original ) ) { if ( isObject ( value ) ) { entries . push ( ... objectToTuples ( value as Record < string , unknown > , `${ prefix }${ key }.` ) ) ; } else { entries . push ( [ `${ prefix }${ key }` , value ] ) ; } } return entries ; }