import { Headers } from 'node-fetch' ; export function convertHeaders ( headers ) { return headers . reduce ( ( h , [ name , value ] ) => { if ( name . length > 0 ) { h . append ( name , value ) ; } return h ; } , new Headers ( ) ) ; } export function unconvertHeaders ( headers ) { const h = [ ] ; headers . forEach ( ( value , name ) => h . push ( [ name , value ] ) ) ; return h ; }