4.1.2 • Published 1 month ago

@288-toolkit/url v4.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Url

npm i @288-toolkit/url

A collection of functions to work with urls.

isExternalUrl()

Check if a URL is external.

validateSameOrigin()

Validate if the URL is from the same origin as the request URL.

createEntryUrlBuilder

Creates a function that builds URLs for entries.

const getEntryUrl = createEntryUrlBuilder({
	localize: true,
	siteUrl: 'https://example.org',
	homeUri: '__home__'
});

getEntryUrl(mockEntry).raw; // The URL object.
getEntryUrl(mockEntry).toAbsolute(); // Returns the full URL string.
getEntryUrl(mockEntry).toString(); // Returns the full URL string.
getEntryUrl(mockEntry).toSchemeLess(); // Returns the URL string without the scheme, composed of the pathname, search, and hash.
getEntryUrl(mockEntry).toLanguageRelative(); // Returns the entry uri relative to the language.
4.1.2

1 month ago

4.1.0

2 months ago

4.1.1

2 months ago

4.0.0

2 months ago

3.0.0

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago