docs(globaltocjs): correcting errors in documentation
refactor(globaltocjs): extract logic for storing node paths to transform to function