spws
Version:
SharePoint Web Services Wrapper
16 lines (15 loc) • 742 B
TypeScript
type Params = {
url: string;
beforePath: string;
};
/**
* Extracts the preceding path segment from a given URL based on a specified path segment.
*
* @param params - An object containing the URL and the path segment to look for.
* @param params.url - The URL string to be processed.
* @param params.beforePath - The path segment to find in the URL. The function will return the segment immediately preceding this path segment.
* @returns The path segment immediately preceding the specified path segment in the URL.
* @throws Will throw an error if the specified path segment is not found in the URL.
*/
declare const getPrecedingPathFromUrl: (params: Params) => string;
export default getPrecedingPathFromUrl;