Skip to content

Instantly share code, notes, and snippets.

@goofballLogic
Created March 30, 2026 11:54
Show Gist options
  • Select an option

  • Save goofballLogic/9cf1c8914d92a59d734551e2de02be7b to your computer and use it in GitHub Desktop.

Select an option

Save goofballLogic/9cf1c8914d92a59d734551e2de02be7b to your computer and use it in GitHub Desktop.
function resolvePath(fs, path) {
if (!(path in fs)) return null;
const { [path]: nextPath, ...others } = fs;
return nextPath ? resolvePath(others, nextPath) : path;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment