a zip code crypto-currency system good for red ONLY

query-params.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. (function (factory) {
  2. if (typeof module === "object" && typeof module.exports === "object") {
  3. var v = factory(require, exports);
  4. if (v !== undefined) module.exports = v;
  5. }
  6. else if (typeof define === "function" && define.amd) {
  7. define(["require", "exports"], factory);
  8. }
  9. })(function (require, exports) {
  10. "use strict";
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. /**
  13. * @hidden
  14. */
  15. var QueryParams = (function () {
  16. function QueryParams() {
  17. this.data = {};
  18. }
  19. QueryParams.prototype.parseUrl = function (url) {
  20. if (url) {
  21. var startIndex = url.indexOf('?');
  22. if (startIndex > -1) {
  23. var queries = url.slice(startIndex + 1).split('&');
  24. for (var i = 0; i < queries.length; i++) {
  25. if (queries[i].indexOf('=') > 0) {
  26. var split = queries[i].split('=');
  27. if (split.length > 1) {
  28. this.data[split[0].toLowerCase()] = split[1].split('#')[0];
  29. }
  30. }
  31. }
  32. }
  33. }
  34. };
  35. QueryParams.prototype.get = function (key) {
  36. return this.data[key.toLowerCase()];
  37. };
  38. return QueryParams;
  39. }());
  40. exports.QueryParams = QueryParams;
  41. });
  42. //# sourceMappingURL=query-params.js.map