Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for parsing/stringifying fragment identifier #222

Merged
merged 24 commits into from Jun 6, 2020

Conversation

Mark1626
Copy link
Contributor

Fixes #220

Add a new option parseFragment, which will provide the hash in the parseURL result. The new option is to prevent it from becoming a breaking change

Seems Fragment Identifier is the technical jargon for it, let me know if it's ok or hash seems like a better choice

cc\ @sindresorhus

@sindresorhus
Copy link
Owner

The name is "fragment identifier", not "fragment". "fragment" feels a bit too generic.

Can you also add it to the readme?

@Mark1626
Copy link
Contributor Author

Mark1626 commented Dec 1, 2019

@sindresorhus Done

readme.md Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Can you fix the merge conflict?

@sindresorhus
Copy link
Owner

stringifyUrl() was just added: 1604958 I think it would make sense to support fragmentIdentifier there too so they're perfect opposites.

@sindresorhus
Copy link
Owner

@M4rk9696 Bump

@sindresorhus
Copy link
Owner

Bump

@Mark1626
Copy link
Contributor Author

Mark1626 commented Apr 6, 2020

Sorry, got busy with some work. I've made the changes except the typing. Any further changes I'll get it done ASAP and we'll get this closed soon

readme.md Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

readme.md Show resolved Hide resolved
Co-authored-by: Karuppiah <karuppiah7890@gmail.com>
@Mark1626
Copy link
Contributor Author

@sindresorhus Made the changes

index.d.ts Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
Mark1626 and others added 2 commits May 24, 2020 19:36
Co-authored-by: Karuppiah <karuppiah7890@gmail.com>
Co-authored-by: Karuppiah <karuppiah7890@gmail.com>
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

#222 (comment)

Mark1626 and others added 4 commits June 3, 2020 20:03
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
@Mark1626
Copy link
Contributor Author

Mark1626 commented Jun 3, 2020

Made the changes

@sindresorhus sindresorhus changed the title Add support for Hash / Fragment identifier Add support for parsing/stringifying fragment identifier Jun 6, 2020
@sindresorhus sindresorhus merged commit ce06095 into sindresorhus:master Jun 6, 2020
@luckymore
Copy link

@Mark1626 How about this feature 😂

excute

queryString.parseUrl('https://foo.bar?query=1#/hashpath?hashquery=1', { parseFragmentIdentifier: true })

now

{
    "url": "https://foo.bar",
    "query": {
        "query": "1"
    },
    "fragmentIdentifier": "/hashpath?hashquery=1"
}

expect

{
    "url": "https://foo.bar",
    "query": {
        "query": "1"
    },
    "params": {
        "hashquery": "1"
    },
    "fragmentIdentifier": "/hashpath?hashquery=1"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support hash
3 participants