@gorhom/bottom-sheet
Version:
A performant interactive bottom sheet with fully configurable options 🚀
9 lines (8 loc) • 765 B
JavaScript
import invariant from 'invariant';
export const validateSnapPoint = snapPoint => {
invariant(typeof snapPoint === 'number' || typeof snapPoint === 'string', `'${snapPoint}' is not a valid snap point! expected types are string or number.`);
invariant(typeof snapPoint === 'number' || typeof snapPoint === 'string' && snapPoint.includes('%'), `'${snapPoint}' is not a valid percentage snap point! expected percentage snap point must include '%'. e.g. '50%'`);
invariant(typeof snapPoint === 'number' || typeof snapPoint === 'string' && Number(snapPoint.split('%')[0]), `'${snapPoint}' is not a valid percentage snap point! expected percentage snap point must be only numbers and '%'. e.g. '50%'`);
};
//# sourceMappingURL=validateSnapPoint.js.map
;