const getURLParameters = (url: string) =>
        (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
          (a, v) => (
            (a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a
          ),
          {}
        );
      
      Typescript language logo

      Get url parameters

      Codiga's TypeScript Recipes

      Creates an object containing the parameters of the current URL.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.