MCPcopy Create free account
hub / github.com/codesandbox/sandpack / getFileName

Function getFileName

sandpack-react/src/utils/stringUtils.ts:1–4  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

1export const getFileName = (filePath: string): string => {
2 const lastIndexOfSlash = filePath.lastIndexOf("/");
3 return filePath.slice(lastIndexOfSlash + 1);
4};
5
6export const calculateNearestUniquePath = (
7 currentPath: string,

Callers 2

CodeMirror.tsxFile · 0.90
getTriggerTextFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected