1 /* 2 * isPrint.js - Character type is printable char 3 * 4 * Copyright © 2012-2015, 2018, JEDLSoft 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 var isCntrl = require("./isCntrl.js"); 21 22 /** 23 * Return whether or not the first character is any printable character, 24 * including space.<p> 25 * 26 * @static 27 * @param {string|IString|number} ch character or code point to examine 28 * @return {boolean} true if the first character is printable. 29 */ 30 var isPrint = function (ch) { 31 return typeof(ch) !== 'undefined' && ch.length > 0 && !isCntrl(ch); 32 }; 33 34 /** 35 * @protected 36 * @param {boolean} sync 37 * @param {Object|undefined} loadParams 38 * @param {function(*)|undefined} onLoad 39 */ 40 isPrint._init = function (sync, loadParams, onLoad) { 41 isCntrl._init(sync, loadParams, onLoad); 42 }; 43 44 module.exports = isPrint; 45