const interceptionSuffix = ( proxyPort ) => `+httptoolkit:${ proxyPort }` ; export function transformComposeCreationLabels ( proxyPort , labels ) { if ( ! labels ) return undefined ; if ( ! labels [ 'com.docker.compose.config-hash' ] ) return labels ; return { ... labels , 'com.docker.compose.config-hash' : labels [ 'com.docker.compose.config-hash' ] + interceptionSuffix ( proxyPort ) } ; } export function transformComposeResponseLabels ( proxyPort , labels ) { if ( ! labels ) return undefined ; if ( ! labels [ 'com.docker.compose.config-hash' ] ) return labels ; const currentHash = labels [ 'com.docker.compose.config-hash' ] ; const modifiedHash = currentHash . endsWith ( interceptionSuffix ( proxyPort ) ) ? currentHash . slice ( 0 , - 1 * interceptionSuffix ( proxyPort ) . length ) : currentHash + '+unintercepted' ; return { ... labels , 'com.docker.compose.config-hash' : modifiedHash } ; }