MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-workbench / getPathDepth

Function getPathDepth

src/utils/paths.ts:4–8  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

2 jsonFilePath.substring(0, jsonFilePath.lastIndexOf(".")) + ".sqlite";
3
4export function getPathDepth(filePath: string) {
5 const separatorRegExp = /[\\/]/g;
6 const depth = (filePath.match(separatorRegExp) || []).length;
7 return depth;
8}

Callers 1

flattenFileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected