diff --git a/public/bower_components/core-focusable/core-focusable.js b/public/bower_components/core-focusable/core-focusable.js index 6633b5f..3e39b94 100644 --- a/public/bower_components/core-focusable/core-focusable.js +++ b/public/bower_components/core-focusable/core-focusable.js @@ -77,6 +77,9 @@ Polymer.CoreFocusable = { disabled: '_disabledChanged' }, + /** + * Handles changes in the disabled state of the component. If the component is disabled it stops pointer events, removes tabindex, and set aria-disabled attribute. Conversely, if the component is enabled it allows pointer events, adds tabindex, and removes aria-disabled attribute. + */ _disabledChanged: function() { if (this.disabled) { this.style.pointerEvents = 'none'; @@ -89,6 +92,10 @@ Polymer.CoreFocusable = { } }, + /** + * Function to handle the downAction which alters the active and pressed states. When invoked, sets the status of 'pressed' as true. If 'toggle' is true, it inverts the status of 'active'; otherwise, sets 'active' as true. + */ + _downAction: function() { this.pressed = true; @@ -111,6 +118,11 @@ Polymer.CoreFocusable = { this._focusAction(); }, + /** + * Method to handle the up action. It is used to manage the state of a potentially toggleable button or input. + * If the toggle property of the button or input is false, it turns off its active state upon triggering up action. + * @returns {void} This method does not return anything. + */ _upAction: function() { this.pressed = false; @@ -119,6 +131,11 @@ Polymer.CoreFocusable = { } }, + /** + * Represents a method that sets the 'focused' state of the element to true only when the element is not in a 'pressed' state. + * Primarily used for keyboard-based navigation. + * @returns {void} This method does not have a return value. + */ _focusAction: function() { if (!this.pressed) { // Only render the "focused" state if the element gains focus due to @@ -127,6 +144,10 @@ Polymer.CoreFocusable = { } }, + /** + * This method is responsible for managing the blur action within the application. Upon calling it, it alters the application focus state. + * @returns {void} No directly observable return value. The focused state of the application is internally altered to false. + */ _blurAction: function() { this.focused = false; } diff --git a/public/bower_components/core-focusable/polymer-mixin.js b/public/bower_components/core-focusable/polymer-mixin.js index 2ee1d66..bc4c808 100644 --- a/public/bower_components/core-focusable/polymer-mixin.js +++ b/public/bower_components/core-focusable/polymer-mixin.js @@ -1,3 +1,9 @@ +/** + * This method is for handling the mixture of prototypes. It adds properties from a mixin to a prototype, including publish, eventDelegates, and observe properties. + * @param {Object} prototype - The prototype object that is being extended. + * @param {Object} mixin - The mixin object that contains properties to add to the prototype. + * @returns {Object} Returns the updated prototype object. + */ Polymer.mixin2 = function(prototype, mixin) { // adds a single mixin to prototype diff --git a/public/bower_components/core-overlay/tests/js/htmltests.js b/public/bower_components/core-overlay/tests/js/htmltests.js index 0ba1fa6..37a8353 100644 --- a/public/bower_components/core-overlay/tests/js/htmltests.js +++ b/public/bower_components/core-overlay/tests/js/htmltests.js @@ -1,7 +1,18 @@ -htmlSuite('core-overlay', function() { - htmlTest('html/core-overlay-basic.html'); - htmlTest('html/core-overlay-positioning.html'); - htmlTest('html/core-overlay-positioning-margin.html'); - htmlTest('html/core-overlay-scroll.html'); - htmlTest('html/core-overlay-quick-close.html'); -}); +/** + * This method is a suite of tests for the 'core-overlay' functionality. Each separate test is described by the string input parameter, + * which represents the specific HTML file that contains the test. The core-overlay functionality is likely a UI element or group of + * elements, and these tests verify its correct operation and interaction with other elements. + * @param {string} 'html/core-overlay-basic.html' - The path to the basic test for core-overlay functionality. + * @param {string} 'html/core-overlay-positioning.html' - The path to the test for the positioning of the core-overlay. + * @param {string} 'html/core-overlay-positioning-margin.html' - The path to the test for the positioning margin of the core-overlay. + * @param {string} 'html/core-overlay-scroll.html' - The path to the test for the scrolling feature of the core-overlay. + * @param {string} 'html/core-overlay-quick-close.html' - The path to the test for the quick close feature of the core-overlay. + * @returns {void} This function does not return anything. It simply runs the tests as indicated by the argument paths. + */ +htmlSuite('core-overlay', function() { + htmlTest('html/core-overlay-basic.html'); + htmlTest('html/core-overlay-positioning.html'); + htmlTest('html/core-overlay-positioning-margin.html'); + htmlTest('html/core-overlay-scroll.html'); + htmlTest('html/core-overlay-quick-close.html'); +}); diff --git a/public/bower_components/file-input/file-input.js b/public/bower_components/file-input/file-input.js index d94fb28..a7c0436 100644 --- a/public/bower_components/file-input/file-input.js +++ b/public/bower_components/file-input/file-input.js @@ -1,8 +1,77 @@ +/** + * Represents a collection of helper methods used to process and validate file inputs. + */ + +/** + * Converts a pseudoArray into an array. + * @param {Object} pseudoArray - The object that needs to be converted into an array. + * @returns {Array} The converted object in array form. + */ + +/** + * Extracts the lower case extension from a given filename. + * @param {string} filename - The name of the file. + * @returns {string} The lower case extension of the file. + */ + +/** + * Process and validates the limit of the count of the files. + * @param {number} limit - Maximum limit for files. + * @param {Array} files - Array of file objects. + * @returns {Object} An object containing two arrays: 'invalid' with files that exceed the limit, and 'valid' with the files within the limit. + */ + +/** + * Validates the file extension against a string of permissible extensions. + * @param {string} extensionsStr - JSON String containing valid extensions. + * @param {Array} files - Array of file objects to validate against extensions. + * @returns {Object} An object containing two arrays: 'invalid' with the files having non-permissible extensions, and 'valid' with the valid files. + */ + +/** + * Validates the size of the files. + * @param {number} minSize - Minimum size allowed for files. + * @param {number} maxSize - Maximum size allowed for files. + * @param {Array} files - Array of file objects to validate file sizes. + * @returns {Object} An object containing three arrays: 'tooBig' for files larger than maxSize, 'tooSmall' for files smaller than minSize, and 'valid' for correctly sized files. + */ + +/** + * Checks if the current device is an iOS device. + * @returns {boolean} True if the device is an iOS device, else False. + */ + +/** + * Resets the input field without disconnecting it from its Parent Node. + * @param {Object} customEl - Custom Element + */ + +/** + * Sets up a hidden validation input field. + * @param {Object} customEl - Custom Element + */ + + +/** + * Updates the validity of the file input depending on whether files are selected or not. + * @param {Object} customEl - Custom Element + */ + (function() { + /** + * This method converts pseudocode array to a proper JavaScript array. + * @param {Array-like object} pseudoArray - An array-like object for conversion. + * @returns {Array} Converted JavaScript array. + */ var arrayOf = function(pseudoArray) { return Array.prototype.slice.call(pseudoArray); }, + /** + * This method is used to obtain the lowercase extension from a given filename. + * @param {String} filename - The name of the file from which the extension is to be extracted. + * @returns {String} The lowercase file extension part from the input filename. If the filename does not contain any extension, it will return undefined. + */ getLowerCaseExtension = function(filename) { var extIdx = filename.lastIndexOf(".") + 1; @@ -11,6 +80,13 @@ } }, + /** + * This function validates if the provided limit criteria is met by comparing it to the number of files. + * It then separates the invalid and valid files. + * @param {Number} limit - User-defined limit specifying the maximum number of files that are considered valid. + * @param {Array} files - Array containing all the files that need to be validated. + * @returns {Object} An object with two properties: 'invalid', an array of files that exceed the limit, and 'valid', an array of files that are within the limit. + */ getResultOfCountLimitValidation = function(limit, files) { if (limit > 0 && limit < files.length) { return { @@ -22,12 +98,33 @@ return {invalid: [], valid: files}; }, + /** + * Function to validate file extensions against a list of allowed (or disallowed) extensions. + * The function parses a JSON formatted list of extensions and checks each file in provided files array. + * It groups the files into valid and invalid based on their extension. + * If 'extensionsStr' begins with '!', the provided extensions are deemed as invalid. Files matching these are grouped in 'invalid'. + * If 'extensionsStr' doesn't begin with '!', the provided extensions are deemed as valid, Files matching these are grouped in 'valid'. + * + * @param {string} extensionsStr - A JSON formatted string of extensions to validate files against. + * @param {Array} files - An array of files to validate, each file is an object with a 'name' property. + * @returns {Object} An object containing two arrays - 'valid' and 'invalid', housing files based on the result of validation. + */ getResultOfExtensionsValidation = function(extensionsStr, files) { if (extensionsStr) { var negate = extensionsStr.charAt(0) === "!", extensions = JSON.parse(extensionsStr.toLowerCase().substr(negate ? 1 : 0)), result = {invalid: [], valid: []}; + /** + * Iterates over each file in the 'files' array, determines the file extension, and categorizes + * it as either 'valid' or 'invalid' based on whether the extension is found within the 'extensions' array. + * The categorization is flipped if 'negate' is true. + * @param {Array} files - An array of file objects which should at least contain a 'name' property. + * @param {string} file.name - The name of the file from which the extension is extracted. + * @param {boolean} negate - Optional boolean flag indicating if the check should be negated, default is 'false'. + * @param {Array} extensions - Array of file extensions considered valid. + * @returns {Object} An object with two properties: 'valid' and 'invalid'. Each one is an array containing the files which passed or failed the check. + */ files.forEach(function(file) { var extension = getLowerCaseExtension(file.name); @@ -45,6 +142,13 @@ return {invalid: [], valid: files}; }, + /** + * This method validates the size of each file in a list of files, categorizing them into too big, too small, and valid groups. + * @param {Number} minSize - The minimum file size limit. If this parameter is false, there is no lower limit. + * @param {Number} maxSize - The maximum file size limit. If this parameter is false, there is no upper limit. + * @param {Array} files - Array of file objects which should contain at least a size property. + * @returns {Object} An object containing three properties: tooBig (containing files that are too big), tooSmall (containing files that are too small), and valid (containing files that fall within the size limits). + */ getResultOfSizeValidation = function(minSize, maxSize, files) { if (!minSize && !maxSize) { return {tooBig: [], tooSmall: [], valid: files}; @@ -54,6 +158,15 @@ tooBig = [], tooSmall = []; + /** + * Processes each file in the files array. If a file size is less than minSize, it pushes it into the tooSmall array. + * If a file size is greater than maxSize, it pushes it into the tooBig array. + * Whenever a file size is in between minSize and maxSize or either of these is undefined, it pushes the file into the valid array. + * @param {Object[]} files - An array of file objects to be processed + * @param {number} minSize - The smallest acceptable file size. If no minimum size is required, this should be null or undefined. + * @param {number} maxSize - The largest acceptable file size. If no maximum size is required, this should be null or undefined. + * @returns {void} This function does not return a value. The arrays tooSmall, tooBig, and valid are modified by this function. + */ files.forEach(function(file) { if (minSize && file.size < minSize) { tooSmall.push(file); @@ -69,6 +182,10 @@ return {tooBig: tooBig, tooSmall: tooSmall, valid: valid}; }, + /** + * Evaluates the user's navigator agent string for keywords related to iOS devices ("iPad", "iPod", "iPhone"). + * @returns {boolean} True if the user's navigator agent contains any of the listed iOS device keywords, false otherwise. + */ isIos = function() { return navigator.userAgent.indexOf("iPad") !== -1 || navigator.userAgent.indexOf("iPod") !== -1 || @@ -101,6 +218,11 @@ updateValidity(customEl); }, + /** + * Sets up a validation target by creating a new input element and setting various styles and attributes. A reference to a custom element is attached to the newly created input. The input is added to the DOM before the custom element and makes a call to update the validity of the custom element. + * @param {Element} customEl - The custom element to which the validation target corresponds. + * @returns {void} + */ setupValidationTarget = function(customEl) { validationTarget = document.createElement("input"); validationTarget.setAttribute("tabindex", "-1"); @@ -126,6 +248,12 @@ updateValidity(customEl); }, + /** + * This method updates the validity of the provided custom element within a validation target. + * If the custom element has a file(s), it sets the validation target's custom validity to an empty string. + * If the custom element does not have a file, it sets the custom validity of the validation target to the invalidText of the provided custom element. + * @param {Object} customEl - The custom element whose validity is to be checked. It must contain a property 'files' (Array) and 'invalidText' (String). + */ updateValidity = function(customEl) { if (validationTarget) { if (customEl.files.length) { @@ -141,6 +269,12 @@ this.fileInput = { + /** + * Handles changes in the file input by validating the selected files based on various provided constraints like minimum and maximum file size, + * allowed file extensions, and maximum number of files. If a file fails in any of the constraints, it is added to an invalid files list with the + * specific reason for being invalid. Valid files are stored separately and both lists (invalid and valid files) are updated in the element's state. + * Updates the component's validation status and emits a 'change' event with the current state of invalid and valid selected files. + */ changeHandler: function() { var customEl = this, files = arrayOf(customEl.$.fileInput.files), @@ -182,6 +316,10 @@ } }, + /** + * This method is automatically executed when the component instance has been created, + * and is used to initialize the 'files' array and the 'invalid' object. + */ created: function() { var customEl = this; @@ -197,6 +335,12 @@ minSize: 0, + /** + * Sets up the domReady function. Adjusts camera settings on iOS devices, handles file input properties based on set parameters, and sets validation if needed. + * @function domReady + * @param {Object} customEl - The custom element the function is operating on. + * @returns {void} - Does not return anything. + */ domReady: function() { var customEl = this; @@ -225,6 +369,10 @@ } }, + /** + * Resets the custom element by reinitializing it and resetting its input. + * @returns {void} Nothing + */ reset: function() { var customEl = this; diff --git a/public/bower_components/file-input/gruntfile.js b/public/bower_components/file-input/gruntfile.js index eaad507..fb532a9 100644 --- a/public/bower_components/file-input/gruntfile.js +++ b/public/bower_components/file-input/gruntfile.js @@ -3,6 +3,11 @@ function config(name) { return require("./grunt_tasks/" + name + ".js"); } +/** + * This function is used to initialize grunt tasks and register new tasks. + * @param {Object} grunt - Grunt is a task-based command-line build tool for JavaScript projects. + * There are no explicit returns, but it has an implicit return of `undefined` if the function completes without early return. + */ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), diff --git a/public/bower_components/firebase/firebase-debug.js b/public/bower_components/firebase/firebase-debug.js index 302d4e0..f074c8d 100644 --- a/public/bower_components/firebase/firebase-debug.js +++ b/public/bower_components/firebase/firebase-debug.js @@ -3,9 +3,21 @@ var goog = goog || {}; goog.global = this; goog.global.CLOSURE_UNCOMPILED_DEFINES; goog.global.CLOSURE_DEFINES; +/** + * Checks if the provided value is defined or not. + * @param {Any} val - The value to be checked. + * @returns {Boolean} True if the input is not undefined, otherwise False. + */ goog.isDef = function(val) { return val !== void 0; }; +/** + * This method exports a path as a nested structure of the input object on the global goog object. + * If the path already exists, it's overridden by the input object. If the path doesn't exist, it is created. + * @param {string} name - Dot-separated path that should be exported. + * @param {Object} opt_object - The object that is assigned to the path. + * @param {Object} opt_objectToExportTo - Optional parameter, the object to add the path and object to. + */ goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { var parts = name.split("."); var cur = opt_objectToExportTo || goog.global; @@ -24,6 +36,12 @@ goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { } } }; +/** + * Defines a named value. The defined properties can further be used in Google Closure applications. + * @param {string} name - The name of the property to be defined. + * @param {*} defaultValue - The default value for the property. + * @returns {void} No return value. The specified name is attached to the global 'goog' object with the provided default value. + */ goog.define = function(name, defaultValue) { var value = defaultValue; if (!COMPILED) { @@ -41,6 +59,13 @@ goog.DEBUG = true; goog.define("goog.LOCALE", "en"); goog.define("goog.TRUSTED_SITE", true); goog.define("goog.STRICT_MODE_COMPATIBLE", false); +/** + * Provides the given namespace ensuring the namespace is unique and dynamically creates any missing parents of the namespace. + * Throws an error if the namespace is already declared. + * @param {string} name - The fully qualified name of the object this function will provide. + * @throws {Error} Will throw an error if the namespace is already declared. + * @returns {undefined} Does not have a return value, it is used for its side effects. + */ goog.provide = function(name) { if (!COMPILED) { if (goog.isProvided_(name)) { @@ -57,20 +82,44 @@ goog.provide = function(name) { } goog.exportPath_(name); }; +/** + * Sets the code to function and work only during testing. It throws an error if the code is imported into the non-debug environment + * and debugging is not enabled. The method accepts an optional message to provide a custom error message. + * @param {string} opt_message - An optional message to provide details about the error. Default value is an empty string. + * @throws {Error} Throws an Error if the code is tried to be imported into non-debug environment. + */ goog.setTestOnly = function(opt_message) { if (COMPILED && !goog.DEBUG) { opt_message = opt_message || ""; throw Error("Importing test-only code into non-debug environment" + opt_message ? ": " + opt_message : "."); } }; +/** + * This method is a forward declaration of a variable, it doesn't initiate a value but tells the compiler about its existence. + * @param {string} name - The name of the variable to be declared. + */ + goog.forwardDeclare = function(name) { }; if (!COMPILED) { + /** + * Determines if a given namespace (name) has been provided. + * @param {string} name - The name of the namespace. + * @returns {boolean} True if the namespace has been provided and false otherwise. + */ goog.isProvided_ = function(name) { return!goog.implicitNamespaces_[name] && goog.isDefAndNotNull(goog.getObjectByName(name)); }; goog.implicitNamespaces_ = {}; } +/** + * The method gets the value of a deeply nested object property, given the dot notation representation of the property's path and the object. + * If the property doesn't exist, it returns null. + * + * @param {string} name - The dot notation representation of the object property's path. + * @param {Object} opt_obj - The object in which we are looking for the property. + * @returns {Object|null} The value of the property if it exists, null otherwise. + */ goog.getObjectByName = function(name, opt_obj) { var parts = name.split("."); var cur = opt_obj || goog.global; @@ -83,12 +132,25 @@ goog.getObjectByName = function(name, opt_obj) { } return cur; }; +/** + * This method assigns properties from the given object to the global scope object. + * @param {Object} obj - The Object with properties that should be globalized. + * @param {Object} opt_global - Optional, A reference to the global object. + */ goog.globalize = function(obj, opt_global) { var global = opt_global || goog.global; for (var x in obj) { global[x] = obj[x]; } }; +/** + * This method adds dependencies to the Google closure library. + * @param {string} relPath - The relative file path where the dependencies are located, with forward slashes. + * @param {Array} provides - The list of namespaces that the script provides. + * @param {Array} requires - The list of namespaces or classes that the script requires. + * @returns {undefined} No return value + */ + goog.addDependency = function(relPath, provides, requires) { if (goog.DEPENDENCIES_ENABLED) { var provide, require; @@ -110,6 +172,14 @@ goog.addDependency = function(relPath, provides, requires) { } }; goog.define("goog.ENABLE_DEBUG_LOADER", true); +/** + * This method is used for importing a Google Closure library. It ensures that the library - represented by a unique namespace - is available for use within the current context. + * This will throw an error in case the library could not be found - applicable for non-compiled mode only. If a library is already imported, it will return without doing anything. + * In debug mode, it gets the path to the library from its dependencies and writes scripts to include the library into the current JS context. + * @param {string} name - The unique namespace of the Closure library that needs to be imported. + * @throws {Error} Throws an error if the Closure library (namespace) to import could not be found. + * @returns {void} This function does not return a value. + */ goog.require = function(name) { if (!COMPILED) { if (goog.isProvided_(name)) { @@ -134,15 +204,44 @@ goog.basePath = ""; goog.global.CLOSURE_BASE_PATH; goog.global.CLOSURE_NO_DEPS; goog.global.CLOSURE_IMPORT_SCRIPT; +/** + * This is a no-operation function which is intended to be a placeholder for + * optional functions in a defined API. It is not expected to be invoked and it does not return any value. + */ goog.nullFunction = function() { }; +/** + * It is a simple identity function that returns the first argument it receives. + * @param {any} opt_returnValue - The value to be returned. + * @param {any} var_args - optional arguments + * @returns {any} Returns whatever is passed as the first argument. + */ goog.identityFunction = function(opt_returnValue, var_args) { return opt_returnValue; }; +/** + * This is an abstract method declaration which throws an error when not implemented. + * It's a placeholder for methods that need to be implemented in derived classes. + * @throws {Error} Throws an error when the method is not implemented + */ goog.abstractMethod = function() { throw Error("unimplemented abstract method"); }; +/** + * This method ensures a class to be Singleton by adding a getInstance method to its constructor. + * The getInstance method is used to obtain the singleton instance of the class. + * It checks if an instance already exists. If it does, this instance is returned. + * If it doesn't, a new instance is created, stored, and then returned. + * If the code execution is in DEBUG mode, the constructor information is stored in instantiatedSingletons array. + * @param {function} ctor - The constructor of the class which needs to become Singleton. + */ goog.addSingletonGetter = function(ctor) { + /** + * Singleton pattern implementation. This method is used to ensure a class has only one instance + * and provides a global point of access to it. It checks if an instance of the class already exists. + * If it exists, the instance is returned. Otherwise, a new instance is created and returned. + * @returns {Object} An instance of the constructor function 'ctor'. + */ ctor.getInstance = function() { if (ctor.instance_) { return ctor.instance_; @@ -158,10 +257,18 @@ goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; if (goog.DEPENDENCIES_ENABLED) { goog.included_ = {}; goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}; + /** + * Checks if the global document object is defined and if the "write" property exists in the document object. + * @returns {boolean} True if the global document object is defined and the "write" property exists in the document. + */ goog.inHtmlDocument_ = function() { var doc = goog.global.document; return typeof doc != "undefined" && "write" in doc; }; + /** + * Finds the base path of the google closure library by reviewing attached scripts. + * @returns {void} Sets the global variable 'goog.basePath' to the base path if found. + */ goog.findBasePath_ = function() { if (goog.global.CLOSURE_BASE_PATH) { goog.basePath = goog.global.CLOSURE_BASE_PATH; @@ -183,12 +290,23 @@ if (goog.DEPENDENCIES_ENABLED) { } } }; + /** + * Method to import scripts into the global context. + * @param {String} src - The URL source of the script to be imported. + * @returns {undefined} This function does not have a return statement; the result is a side effect (script gets imported). + */ goog.importScript_ = function(src) { var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; if (!goog.dependencies_.written[src] && importScript(src)) { goog.dependencies_.written[src] = true; } }; + /** + * Writes a script tag with the provided source URL to the document. + * Throwing an error if script tag for 'deps.js' tries to be loaded after document load. + * @param {string} src - The source URL of the script to be written. + * @returns {boolean} Returns true if the script could be written successfully. Returns false if the function is not working in the context of an HTML document or the function tries to load 'deps.js' after document load. + */ goog.writeScriptTag_ = function(src) { if (goog.inHtmlDocument_()) { var doc = goog.global.document; @@ -206,10 +324,23 @@ if (goog.DEPENDENCIES_ENABLED) { return false; } }; + /** + * Writes scripts in correct order by visiting dependencies among them. + * Keeps track of scripts already seen/written and dependencies visited. + * If a dependency required isn't provided, it retrieves the correct path to it. + * If it fails to retrieve or a script input is undefined, it throws an error. + * + * @returns {undefined} Does not return anything. + */ goog.writeScripts_ = function() { var scripts = []; var seenScript = {}; var deps = goog.dependencies_; + /** + * Visits a given node, checks its existence in dependencies, handles circular dependencies, processes requirement dependencies, and handles undefined dependencies. + * @param {string} path - The path of the node to visit. + * @throws {Error} Throws an error if the required dependency's name does not exist in dependencies nameToPath. + */ function visitNode(path) { if (path in deps.written) { return; @@ -251,6 +382,11 @@ if (goog.DEPENDENCIES_ENABLED) { } } }; + /** + * Retrieves the path from the dependencies using a specific rule. + * @param {string} rule - The rule to use to get the path from the dependencies. + * @returns {string|null} The path if the rule exists in the dependencies, otherwise returns null. + */ goog.getPathFromDeps_ = function(rule) { if (rule in goog.dependencies_.nameToPath) { return goog.dependencies_.nameToPath[rule]; @@ -263,6 +399,11 @@ if (goog.DEPENDENCIES_ENABLED) { goog.importScript_(goog.basePath + "deps.js"); } } +/** + * Determines the effective type of a value. + * @param {any} value - The value for which to determine the type. + * @returns {string} A string indicating the effective type of the value. Possible return values include "object", "array", "function", "null", or the standard typeof return value. + */ goog.typeOf = function(value) { var s = typeof value; if (s == "object") { @@ -294,12 +435,27 @@ goog.typeOf = function(value) { } return s; }; +/** + * Checks if the provided value is null. + * @param {any} val - The value to be checked. + * @returns {boolean} Returns true if the value is null, otherwise false. + */ goog.isNull = function(val) { return val === null; }; +/** + * Check if a given value is defined and not null. + * @param {any} val - The value to be checked. + * @returns {boolean} Returns true if the value is defined and not null, false otherwise. + */ goog.isDefAndNotNull = function(val) { return val != null; }; +/** + * Checks if the input value is an array. + * @param {any} val - The value to check. + * @returns {boolean} True if value is an array, False otherwise. + */ goog.isArray = function(val) { return goog.typeOf(val) == "array"; };