react-bps
Version:
Create breakpoints to your component props
58 lines (54 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var keys = exports.keys = function keys(obj) {
return Object.keys(obj);
};
var map = exports.map = function map(fn) {
return function (array) {
return array.map(fn);
};
};
var filter = exports.filter = function filter(fn) {
return function (array) {
return array.filter(fn);
};
};
var sort = exports.sort = function sort(fn) {
return function (array) {
return array.sort(fn);
};
};
var head = exports.head = function head(array) {
return array[0];
};
var gte = exports.gte = function gte(num1) {
return function (num2) {
return num1 >= num2;
};
};
var lte = exports.lte = function lte(num1) {
return function (num2) {
return num1 <= num2;
};
};
var asc = exports.asc = function asc(a, b) {
return a - b;
};
var desc = exports.desc = function desc(a, b) {
return b - a;
};
var pipe = exports.pipe = function pipe() {
for (var _len = arguments.length, props = Array(_len), _key = 0; _key < _len; _key++) {
props[_key] = arguments[_key];
}
return function () {
for (var _len2 = arguments.length, passProps = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
passProps[_key2] = arguments[_key2];
}
return props.reduce.apply(props, [function (acc, fn) {
return fn(acc);
}].concat(passProps));
};
};