tomprogers / filesystem-path Goto Github PK
View Code? Open in Web Editor NEWFluent interface over strings representing filesystem paths
License: MIT License
Fluent interface over strings representing filesystem paths
License: MIT License
Last time I used Windows, every path began with a "drive letter":
C:\Documents and Settings\tomprogers\Desktop\file.ext
There's no equivalent on *nix filesystems.
It's almost certainly very bad to treat "C:" as the first "folder". Ideally it'll be represented as an extra path prop, perhaps drive
or something.
Research these things.
Add the other stuff I have planned. Some of this will take a little research.
String methods
replace()
// like String.replace, operates on raw path, returns selfRegExp-facing methods (treats segments as lines unless /g
flag)
test()
//> bool? or would it be the string methodmatch()
//>search()
exec()
Array methods (operate on folders)
slice()
splice()
push()
pop()
shift()
unshift()
Static class methods
canonicalize( directory, filename, sep )
// resolves './' & '../'escape( directory, filename, sep )
// TODO: research what folks will needTests are decent, but the experimental design of each suite is isolated. This seems bad because the variety of paths encountered in the wild is presumably the same regardless of which method we're testing.
So, I want to standardize the set of scenarios that is checked across the board.
divide each test suite into two sections:
/path/to/some.fil
/etc/pam.d/
, plus accumulate every specific case associated with a real bugfind a better way to handle nix/win testing
Everything should be tested against both separators, but it'd be nice if that didn't require literally doubling the size of the test code. Is there a trustworthy way to generate the second set of cases based on the first, so that every test is automatically "cross-platform"?
new FSP( ...paths? , filename?, sep? )
I think this will be 100% backwards-compatible with v0.3.
Notes on updates I want to make to the documentation:
pam.d
case in the "guessing is bad" sectionA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.