UNPKG

php.js

Version:

Use phpjs functions as required.

18 lines (16 loc) 630 B
exports.setlocale=require("./setlocale"); module.exports=function(){ return ctype_alpha.apply(exports,arguments) }; function ctype_alpha(text) { // discuss at: http://phpjs.org/functions/ctype_alpha/ // original by: Brett Zamir (http://brett-zamir.me) // depends on: setlocale // example 1: ctype_alpha('Az'); // returns 1: true if (typeof text !== 'string') { return false; } // BEGIN REDUNDANT this.setlocale('LC_ALL', 0); // ensure setup of localization variables takes place // END REDUNDANT return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.al) !== -1; }