UNPKG

publish-url-params

Version:
2 lines (1 loc) 522 B
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).urlparams=t()}(this,(function(){"use strict";return function(e){if("string"!=typeof e)throw new Error("Parameter `url` must be a string.");var t=null;if(e.indexOf("?")>0&&(t=e.substr(e.indexOf("?")+1)),!t)return{};for(var n={},r=t.split("&"),i=r.length;i-- >0;){var f=r[i].split("=")[0],o=r[i].split("=")[1]||!0;n[f]=o}return n}}));