import { Extension } from '@/extensions/types' ; /**
 * Extension responsible for clamping all values to configured `limit`.
 */ export const extensionLimit = ( config , state , changelog ) => { const { values } = state ; const limitedValues = values . map ( value => ( value . clampReal ( state . limit ?. min ?. asReal ( ) ?? - Infinity , state . limit ?. max ?. asReal ( ) ?? + Infinity ) ) ) ; return state . updateValues ( limitedValues ) ; } ;