Giter VIP home page Giter VIP logo

Comments (5)

jonschlinkert avatar jonschlinkert commented on May 25, 2024

I can see how that would make sense given the name of the lib, but it seems like that would be a better job for node's native path.normalize() method, wouldn't it?

from normalize-path.

sliekens avatar sliekens commented on May 25, 2024

I don't know, I can't find a good definition of the scope of this library.

from normalize-path.

sliekens avatar sliekens commented on May 25, 2024

Anyway I guess it depends on whether you consider variations of a path to be duplicates or not.

Personally I think it's confusing that small variations return different output from normalize.

normalize('ayy/') !== normalize('./ayy/') // weird

from normalize-path.

jonschlinkert avatar jonschlinkert commented on May 25, 2024

I don't know, I can't find a good definition of the scope of this library.

Maybe try reading the actual repository description? I'll quote it here: "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled."

I'm not sure how it could be any less confusing.

normalize('ayy/') !== normalize('./ayy/') // weird

console.log(normalize('ayy/'))   //=> "ayy"
console.log(normalize('./ayy/')) //=> "./ayy"

Given how clearly defined the repository description is, it's weird that you find that weird.

Closing.

from normalize-path.

sliekens avatar sliekens commented on May 25, 2024

Describing what the code currently does is not what I consider defining its scope because it says nothing about which problems you're trying to solve. But no need to be salty. Just reply to my comment after that (from the perspective of someone who doesn't know exactly how your function is implemented).

PS didn't mean to offend, I'm just saying that the verb "to normalize" is very loosely defined. It can mean basically anything you want it to so whether this feature is in scope really depends on your interpretation.

PPS my take on this is that when two different paths resolve to the same file or folder, their normal forms should be equal strings. I know that's not always possible, but in this case it is.

from normalize-path.

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.