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