isDivisibleBy.js 587 B

12345678910111213141516171819202122
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isDivisibleBy;
  6. var _assertString = require('./util/assertString');
  7. var _assertString2 = _interopRequireDefault(_assertString);
  8. var _toFloat = require('./toFloat');
  9. var _toFloat2 = _interopRequireDefault(_toFloat);
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. function isDivisibleBy(str, num) {
  12. (0, _assertString2.default)(str);
  13. return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
  14. }
  15. module.exports = exports['default'];