MCPcopy
hub / github.com/prettier/prettier / getFileBasename

Function getFileBasename

src/universal/index.browser.js:5–5  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

3@returns {string}
4*/
5const getFileBasename = (file) => String(file).split(/[/\\]/).pop();
6
7// Ideally, we should only allow `URL` with `file:` protocol and
8// string starts with `file:`, but `URL` is missing in some environments

Callers

nothing calls this directly

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…