npmtest-voca (v0.0.1)

Code coverage report for node-npmtest-voca/node_modules/voca/is_alpha.js

Statements: 81.82% (9 / 11)      Branches: 75% (3 / 4)      Functions: 50% (1 / 2)      Lines: 80% (8 / 10)      Ignored: none     

All files » node-npmtest-voca/node_modules/voca/ » is_alpha.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40    1     1   1   1   1   1                                         1       1  
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isAlpha;
 
var _coerce_to_string = require('./helper/string/coerce_to_string');
 
var _coerce_to_string2 = _interopRequireDefault(_coerce_to_string);
 
var _const_extended = require('./helper/reg_exp/const_extended');
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
/**
 * Checks whether `subject` contains only alpha characters.
 *
 * @function isAlpha
 * @static
 * @since 1.0.0
 * @memberOf Query
 * @param {string} [subject=''] The string to verify.
 * @return {boolean} Returns `true` if `subject` contains only alpha characters or `false` otherwise.
 * @example
 * v.isAlpha('bart');
 * // => true
 *
 * v.isAlpha('lisa!');
 * // => false
 *
 * v.isAlpha('lisa and bart');
 * // => false
 */
function isAlpha(subject) {
  var subjectString = (0, _coerce_to_string2.default)(subject);
  return _const_extended.REGEXP_ALPHA.test(subjectString);
}
module.exports = exports['default'];