import { TransformFactory } from '../types' ; import { setMetadata } from '../lib/metadata' ; export interface BlurOptions { blur : string ; } export const blur = ( config , ctx ) => { let blur = undefined ; blur = config . blur ? parseFloat ( config . blur ) : undefined ; blur ||= config . blur === 'true' ; blur ||= config . blur === '' ; if ( ! blur ) return ; return function blurTransform ( image ) { setMetadata ( image , 'blur' , blur ) ; return image . blur ( blur ) ; } ; } ;