import type { Mode } from './types' ; import { join } from './util' ; export const mode = ( report ) : Mode => ( { unknown ( section , parts , optional ) { if ( ! optional ) { report ( `No theme value found for ${ section }[${ JSON . stringify ( join ( parts ) || 'DEFAULT' ) }]` ) ; } } , warn ( message , directive ) { report ( ( directive ? `[${ directive }] ` : '' ) + message ) ; } , } ) ; export const warn = mode ( ( message ) => console . warn ( message ) ) ; export const strict = mode ( ( message ) => { throw new Error ( message ) ; } ) ;