Coder Social home page Coder Social logo

Comments (2)

nchaloult avatar nchaloult commented on June 2, 2024

Not sure if it's too late to give my feedback and initial thoughts since I see a PR that mentioned this issue got merged into master....

Thoughts about formatDirName()

Should the formatDirName() func rewrite take the length of the comment into account? In other words, should

const spacing = `${' '.repeat(output.length - maxCharLengthOfLevel)} `;

be changed to

const spacing = `${' '.repeat(maxCharLengthOfLevel - (output.length + comment.length))} `;

?

Also, I think that naming a variable output without it actually being the variable that the function ultimately returns is confusing. Perhaps consider renaming the output variable to something like dirRelativeLink or dirSection?

Thoughts about the new Tree Core architecture, or Tree Gen structure

Are you proposing that a list of the following objects be maintained, one object for each line in the generated tree printout?

{
maxCharLengthOfLevel: number - Will help us calculate spacing for comments,
numberOfFoldersPerLevel: number,
numberOfFilesPerLevel: number,
}

What are your plans for keeping the values in each of these objects consistent? For example, if there's only one line in the entire tree printout where the corresponding object's numberOfFoldersPerLevel key equals, say, 3, and that line then gets deleted, will any of the values in the other objects need to be updated? In other words, is it possible for any updates or deletions of lines in the tree printout displayed on the page to knock your Tree Core data structure out of sync?

from 0.2.1-readme-dirs.

ralph-dev avatar ralph-dev commented on June 2, 2024

@nchaloult I will update the TreeCore and TreeGen architecture accordingly the cool part is that TreeGen doesn't need to be re-created on every single deletion :)

from 0.2.1-readme-dirs.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.