- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases (#31270). Learn more about Node.js releases.
- Added new
normalizePath
function (#35992).
- Removed unused
react-native-url-polyfill
dependency (#34687).
- Drop support for Internet Explorer 11 (#31110). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/.
- Increase the minimum Node.js version to v12 matching Long Term Support releases (#31270). Learn more at https://nodejs.org/en/about/releases/.
- Add optional argument
maxLength
for truncating URL infilterURLForDisplay
- Added
getPathAndQueryString
.
addQueryArgs
arguments are optional (#21926)
- Include TypeScript type declarations (#18942)
getQueryString
now correctly considers hash fragments when considering whether to return a query string. Previously,getQueryString( 'https://example.com/#?foo' )
would wrongly return'foo'
as its result. A hash fragment is always the last segment of a URL, and the querystring must always precede it (see reference specification).
isURL
now correctly returnstrue
for many other forms of a valid URL, as it now conforms to the URL Living Standard definition of a valid URL string.
addQueryArgs
will return only the querystring fragment if the passedurl
is undefined. Previously, an uncaught error would be thrown.addQueryArgs
will not append (or remove) a?
if there are no query arguments to be added. Previously,?
would be wrongly appended even if there was no querystring generated.
- The
isValidProtocol
function now correctly considers the protocol of the URL as only incoporating characters up to and including the colon (':'). getFragment
is now greedier and matches fragments from the first occurrence of the '#' symbol instead of the last.
- Added
getProtocol
. - Added
isValidProtocol
. - Added
getAuthority
- Added
isValidAuthority
. - Added
getPath
. - Added
isValidPath
. - Added
getQueryString
. - Added
isValidQueryString
. - Added
getFragment
. - Added
isValidFragment
.
- Added
getQueryArg
. - Added
hasQueryArg
. - Added
removeQueryArgs
.
- Added
safeDecodeURI
.
- Fix typo in the
qs
dependency definition in thepackage.json
- Change how required built-ins are polyfilled with Babel 7 (#9171). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods.