Skip to content

gaffa-tape/gedi-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gedi Paths

A convenience library for working with gedi paths.

browser support

var paths = require('gedi-paths');

paths.create(number/string/array);
// Create a valid gedi path from a string/number, or an array of strings/numbers.

paths.isAbsolute(path);
// Checks if a path is absolute (basically, starts with '/'

paths.isRoot(path);
// Checks if a path is equivilent to '[]'

paths.append(path1, path2, ... pathN);
// Adds paths together to form an unresolved path,
// eg, paths.append('[stuff]', '[/things]', '[../majigger]');
// would result in [stuff//things/../majigger], an unresolved, invalid path.

paths.toParts(path);
// Breaks a path into an array of path parts/keys.

paths.createRoot();
// Returns a root path ('[/]')

paths.resolve(path1, path2, ... pathN);
// Resolves an invalid path to a valid one,
// eg: paths.resolve('[stuff//things/../majigger]')
// would result in '[/majigger]'

Releases

No releases published

Packages

No packages published