Sha256: f71c620ac4f95797ecc0910346be3da4ee89bd4f60ac837b372487858e6540ac

Contents?: true

Size: 451 Bytes

Versions: 7

Compression:

Stored size: 451 Bytes

Contents


    /**
     * Gets full query as string with all special chars decoded.
     */
    function getQuery(url) {
        url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query)
        var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt
        return (queryString)? decodeURIComponent(queryString[0]) : '';
    }

    module.exports = getQuery;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/mout/queryString/getQuery.js