Plato on Github
Report Home
node_modules\atropa-inquire\src\atropa-inquire.js
Maintainability
79.53
Lines of code
112
Difficulty
19.82
Estimated Errors
0.25
Function weight
By Complexity
By SLOC
/// <reference path="../docs/vsdoc/OpenLayersAll.js"/> var atropa = require('atropa-header'); /*jslint indent: 4, maxerr: 50, white: true, browser: true, devel: true, plusplus: true, regexp: true */ /*global atropa */ // end header /** * Container for functions that test the state of inputs. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20120909 * @namespace Container for functions that test the state of inputs. */ atropa.inquire = {}; /** * Checks whether the input is null. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20120909 * @param {Mixed} x Any input that may or may not be null. * @returns {Boolean} Returns true if x === null. */ atropa.inquire.isNull = function (x) { "use strict"; return (x === null); }; /** * Checks whether the input is an object. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20120909 * @param {Mixed} x Any input that may or may not be an object. * @returns {Boolean} Returns true if typeof(x) === 'object'. */ atropa.inquire.isObject = function (x) { "use strict"; return (typeof x === 'object'); }; /** * Checks whether the input is both an object and not null. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20120909 * @param {Mixed} x Any input that may or may not be both an * object and null. * @returns {Boolean} Returns true if x is both an object and * not null. (null is an object). */ atropa.inquire.isObjectNotNull = function (x) { "use strict"; return atropa.inquire.isObject(x) && (!atropa.inquire.isNull(x)); }; /** * Checks an object for the existence of a property * regardless of whether the property was inherited * or not. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20120909 * @param {Object} obj An object which may or may not * have the property identified by prop. * @param {String} prop A string value representing the * name of the property. * @returns {Boolean} Returns true if obj.prop exists, * otherwise returns false. */ atropa.inquire.hasProperty = function (obj, prop) { "use strict"; if (atropa.inquire.isObjectNotNull(obj)) { return (prop in obj); } return false; }; /** * Checks whether the input is an empty string. * @author <a href="mailto:matthewkastor@gmail.com"> * Matthew Christopher Kastor-Inare III </a><br /> * ☭ Hial Atropa!! ☭ * @version 20130118 * @param {String} str The string you want to know about * @returns {Boolean} Returns true if str is an empty string, * otherwise returns false. */ atropa.inquire.isEmptyString = function (str) { "use strict"; var out = false; if ('' === str) { out = true; } return out; }; while(atropa.data.requirements.length > 0) { atropa.data.requirements.pop()(); } module.exports = atropa;