Skip to content

Automatically remove ? at the start of the string #1

@gusdecool

Description

@gusdecool

I think will be great if we add function to automatically remove ? at the start of the string since windows.location.search will return us ? at the start of string

consider this URL as example:

const url = 'https://google.com/?query=foo';
const query = window.location.search // we got ?query=foo

var queryString = require('querystrings');
const output = queryString.parse(query);

// output will be
const output = {
    '?query': 'foo' // we got unintended `?`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions