mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
6 lines
162 B
TypeScript
6 lines
162 B
TypeScript
export function removeFromLast<T>(path: string, key: string): string | T {
|
|
const i = path.lastIndexOf(key);
|
|
|
|
return i === -1 ? path : path.substring(0, i);
|
|
}
|