export class ConstraintBuilder { private constructor ( ) { } static stripRequiredConstraints ( constraints , keysToStrip = null ) { if ( constraints == null ) { return null ; } const keysToBeStripped = keysToStrip || Object . keys ( constraints ) ; const newConstraints = keysToBeStripped . reduce ( ( modifiedConstraints , key ) => { let constraint = Object . assign ( { } , constraints [ key ] ) ; delete constraint . required ; modifiedConstraints [ key ] = constraint ; return modifiedConstraints ; } , { } ) ; return newConstraints ; } }