Comments (5)
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.
I don't know, I can't find a good definition of the scope of this library.
from normalize-path.
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.
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.
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)
- Tests fail HOT 6
- Excuse me, please tell me, what's the different between your two project HOT 1
- Strips path fragments HOT 3
- Normalize path with ".." elements HOT 2
- npm package 1.0.0 is missing tests and license HOT 2
- Use `remove-trailing-separator` module as dependency? HOT 4
- add "../" support HOT 1
- changelog HOT 1
- Missing remove-trailing-separator dependency HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from normalize-path.