UNPKG

react-collection-helpers

Version:
26 lines (21 loc) 1.97 kB
'use strict'; exports.__esModule = true; exports.unknownChildPassedToCollectionHelper = exports.invalidTypeSuppliedAsComparator = exports.invalidTypeSuppliedAsPredicate = undefined; var _constants = require('../constants'); var invalidTypeSuppliedAsPredicate = exports.invalidTypeSuppliedAsPredicate = function invalidTypeSuppliedAsPredicate(_ref) { var type = _ref.type, predicate = _ref.predicate, component = _ref.component; return '\n>> Error, via ' + _constants.MODULE_NAME + ' <<\n\nYou supplied an invalid predicate.\n\nPredicates must either be an object or a function. You provided the following ' + type + ': ' + predicate + '.\n\nCheck the render method of <' + component + '>.\n'; }; var invalidTypeSuppliedAsComparator = exports.invalidTypeSuppliedAsComparator = function invalidTypeSuppliedAsComparator(_ref2) { var type = _ref2.type, comparator = _ref2.comparator, component = _ref2.component; return '\n>> Error, via ' + _constants.MODULE_NAME + ' <<\n\nYou supplied an invalid comparator.\n\nPredicates must either be a string or a function. You provided the following ' + type + ': ' + comparator + '.\n\nCheck the render method of <' + component + '>.\n'; }; var unknownChildPassedToCollectionHelper = exports.unknownChildPassedToCollectionHelper = function unknownChildPassedToCollectionHelper(_ref3) { var children = _ref3.children, parentComponent = _ref3.parentComponent; return '\n>> Error, via ' + _constants.MODULE_NAME + ' <<\n\nYou supplied an unknown child to a Collection Helper.\n\nCollection Helpers take very specific children. Please supply 1 of the 2 following types:\n\n1. a function:\n\n <Filter>\n {item => <div>{item.name}</div>}\n </Filter>\n\n2. another Collection Helper:\n\n <Filter>\n <Sort>\n {item => <div>{item.name}</div>}\n </Sort>\n </Filter>\n\nYou supplied: ' + children + '.\n\nCheck the render method of <' + parentComponent + '>.\n'; };