Source: location.js

/*
 * Copyright 2013-2017 Hewlett Packard Enterprise Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

/**
 * @module js-whatever/js/location
 * @desc Wrapper around window.location, allowing for easier testing
 */
define(function() {
    'use strict';

    var host = window.location.host;
    var hostname = window.location.hostname;
    var pathname = window.location.pathname;
    var port = window.location.port;
    var protocol = window.location.protocol;
    var search = window.location.search;

    return {
        /**
         * @returns {string} window.location.host
         */
        host: function() {
            return host;
        },

        /**
         * @returns {string} window.location.hostname
         */
        hostname: function() {
            return hostname;
        },

        /**
         * @returns {string} window.location.pathname
         */
        pathname: function() {
            return pathname;
        },

        /**
         * @returns {string} window.location.port
         */
        port: function() {
            return port;
        },

        /**
         * @returns {string} window.location.protocol
         */
        protocol: function() {
            return protocol;
        },

        /**
         * @returns {string} window.location.search
         */
        search: function() {
            return search;
        }
    };
});
Copyright 2013-2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.4.3 on Thu Jun 21st 18:04 2018 using the DocStrap template.