utils/pathGenerator
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”ensureLeadingSlash()
Section titled “ensureLeadingSlash()”function ensureLeadingSlash(href: string): string
Defined in: studiocms/packages/studiocms_devapps/src/utils/pathGenerator.ts:33
Ensure the passed path starts with a leading slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
pathGenerator()
Section titled “pathGenerator()”function pathGenerator(endpointPath: string, _base: string): (path: string) => string
Defined in: studiocms/packages/studiocms_devapps/src/utils/pathGenerator.ts:40
Endpoint path generator
Parameters
Section titled “Parameters”endpointPath
Section titled “endpointPath”string
string
Returns
Section titled “Returns”Function
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
pathWithBase()
Section titled “pathWithBase()”function pathWithBase(path: string, _base: string): string
Defined in: studiocms/packages/studiocms_devapps/src/utils/pathGenerator.ts:12
Get the a root-relative URL path with the site’s base
prefixed.
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”string
stripLeadingSlash()
Section titled “stripLeadingSlash()”function stripLeadingSlash(href: string): string
Defined in: studiocms/packages/studiocms_devapps/src/utils/pathGenerator.ts:19
Ensure the passed path does not start with a leading slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
stripTrailingSlash()
Section titled “stripTrailingSlash()”function stripTrailingSlash(href: string): string
Defined in: studiocms/packages/studiocms_devapps/src/utils/pathGenerator.ts:26
Ensure the passed path does not end with a trailing slash.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string