UNPKG

@shopgate/engage

Version:
6 lines 697 B
import{parser}from"./breakpoints";var comparators={'>=':function _(from,to,width){return width>=from;},'>':function _(from,to,width){return width>=to;},'<':function _(from,to,width){return width<from;},'<=':function _(from,to,width){return width<to;},'':function _(from,to,width){return width>=from&&width<to;}};/** * Tests if responsive condition applies. * @param {string} breakpoint Breakpoint rule. * @param {Object} params Parameters needed to generation. * @returns {string} */export var responsiveCondition=function responsiveCondition(breakpoint){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var parsed=parser(comparators,breakpoint,params);return parsed;};