Front end of the Slack clone application.

query-params.js 935B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @hidden
  3. */
  4. var QueryParams = (function () {
  5. function QueryParams() {
  6. this.data = {};
  7. }
  8. QueryParams.prototype.parseUrl = function (url) {
  9. if (url) {
  10. var startIndex = url.indexOf('?');
  11. if (startIndex > -1) {
  12. var queries = url.slice(startIndex + 1).split('&');
  13. for (var i = 0; i < queries.length; i++) {
  14. if (queries[i].indexOf('=') > 0) {
  15. var split = queries[i].split('=');
  16. if (split.length > 1) {
  17. this.data[split[0].toLowerCase()] = split[1].split('#')[0];
  18. }
  19. }
  20. }
  21. }
  22. }
  23. };
  24. QueryParams.prototype.get = function (key) {
  25. return this.data[key.toLowerCase()];
  26. };
  27. return QueryParams;
  28. }());
  29. export { QueryParams };
  30. //# sourceMappingURL=query-params.js.map