dropkiq
Version:
Liquid Expressions Simplified
1 lines • 1.33 kB
JavaScript
;var __read=this&&this.__read||function(r,t){var n="function"==typeof Symbol&&r[Symbol.iterator];if(!n)return r;var e,o,a=n.call(r),u=[];try{for(;(void 0===t||t-- >0)&&!(e=a.next()).done;)u.push(e.value)}catch(r){o={error:r}}finally{try{e&&!e.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return u},__spread=this&&this.__spread||function(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(__read(arguments[t]));return r};Object.defineProperty(exports,"__esModule",{value:!0});var toLowerCase=String.prototype.toLowerCase;function caseInsensitiveCmp(r,t){return t?r?(r=toLowerCase.call(r))<(t=toLowerCase.call(t))?-1:r>t?1:0:1:-1}function sortNatural(r,t){return r&&r.sort?void 0!==t?__spread(r).sort((function(r,n){return caseInsensitiveCmp(r[t],n[t])})):__spread(r).sort(caseInsensitiveCmp):[]}exports.default={abs:function(r){return Math.abs(r)},at_least:function(r,t){return Math.max(r,t)},at_most:function(r,t){return Math.min(r,t)},ceil:function(r){return Math.ceil(r)},divided_by:function(r,t){return r/t},floor:function(r){return Math.floor(r)},minus:function(r,t){return r-t},modulo:function(r,t){return r%t},round:function(r,t){void 0===t&&(t=0);var n=Math.pow(10,t);return Math.round(r*n)/n},plus:function(r,t){return Number(r)+Number(t)},sort_natural:sortNatural,times:function(r,t){return r*t}};