acuminous/yadda

View on GitHub
lib/converters/integer-converter.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
'use strict';

module.exports = function integer_converter(value, next) {
  var converted = parseInt(value);
  if (isNaN(converted)) return next(new Error('Cannot convert [' + value + '] to an integer'));
  return next(null, converted);
};