-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (chore) update versions * (fix) Add missing build files --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicolas Brassard <[email protected]>
- Loading branch information
1 parent
2fc065b
commit 417de9c
Showing
23 changed files
with
173 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Decodes the pathname by splitting it into parts, decoding each part, and joining them with slashes. | ||
* @param pathname - The pathname to decode. | ||
* @returns The decoded pathname. | ||
*/ | ||
export declare const decodePath: (pathname: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Decodes the pathname by splitting it into parts, decoding each part, and joining them with slashes. | ||
* @param pathname - The pathname to decode. | ||
* @returns The decoded pathname. | ||
*/ | ||
export const decodePath = (pathname) => { | ||
return pathname.split('/').map(decodeURIComponent).join('/'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Remove the home URI from a URI. | ||
* @deprecated Use createEntryUrlBuilder instead. | ||
* @deprecated This was used with Craft 4. With Craft 5, use createEntryUrlBuilder instead. | ||
*/ | ||
export declare const getLanguageRelativeUri: (uri: string, homeUri: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* Remove the home URI from a URI. | ||
* @deprecated Use createEntryUrlBuilder instead. | ||
* @deprecated This was used with Craft 4. With Craft 5, use createEntryUrlBuilder instead. | ||
*/ | ||
export const getLanguageRelativeUri = (uri, homeUri) => uri?.replace(homeUri, '') || ''; | ||
/* @enddeprecated */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export * from './createEntryUrlBuilder.js'; | ||
export * from './decodePath.js'; | ||
export * from './isExternalUrl.js'; | ||
export * from './validateSameOrigin.js'; | ||
export * from './normalizePath.js'; | ||
export * from './parsedUrl.js'; | ||
export * from './urlCanParse.js'; | ||
export * from './validateSameOrigin.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export * from './createEntryUrlBuilder.js'; | ||
export * from './decodePath.js'; | ||
export * from './isExternalUrl.js'; | ||
export * from './validateSameOrigin.js'; | ||
export * from './normalizePath.js'; | ||
export * from './parsedUrl.js'; | ||
export * from './urlCanParse.js'; | ||
export * from './validateSameOrigin.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Returns the URL string without the protocol, composed of the hostname, pathname, search, and hash. | ||
* It starts with a double slash. | ||
* @param url - The URL to convert. | ||
*/ | ||
export declare const protocolLessUrl: (url: URL) => string; | ||
/** | ||
* Returns the URL string without the scheme, composed of the pathname, search, and hash. | ||
* It starts with a single slash. | ||
* @param url - The URL to convert. | ||
*/ | ||
export declare const schemeLessUrl: (url: URL) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Returns the URL string without the protocol, composed of the hostname, pathname, search, and hash. | ||
* It starts with a double slash. | ||
* @param url - The URL to convert. | ||
*/ | ||
export const protocolLessUrl = (url) => { | ||
const { hostname, pathname, hash, search } = url; | ||
return `//${hostname}${pathname}${search}${hash}`; | ||
}; | ||
/** | ||
* Returns the URL string without the scheme, composed of the pathname, search, and hash. | ||
* It starts with a single slash. | ||
* @param url - The URL to convert. | ||
*/ | ||
export const schemeLessUrl = (url) => { | ||
const { pathname, hash, search } = url; | ||
return `${pathname}${search}${hash}`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Normalizes the pathname by decoding it, normalizing each part, and joining them with slashes. | ||
* @see {@link @288-toolkit/strings#normalize} | ||
* @param pathname - The pathname to normalize. | ||
* @returns The normalized pathname. | ||
*/ | ||
export declare const normalizePath: (pathname: string) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { normalize } from '@288-toolkit/strings'; | ||
/** | ||
* Normalizes the pathname by decoding it, normalizing each part, and joining them with slashes. | ||
* @see {@link @288-toolkit/strings#normalize} | ||
* @param pathname - The pathname to normalize. | ||
* @returns The normalized pathname. | ||
*/ | ||
export const normalizePath = (pathname) => { | ||
return pathname | ||
.split('/') | ||
.map((part) => normalize(decodeURIComponent(part))) | ||
.join('/'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.