express-optimized icon indicating copy to clipboard operation
express-optimized copied to clipboard

what does querystring.js do?

Open jonathanong opened this issue 11 years ago • 4 comments

is it just a faster querystring parser?

jonathanong avatar Jul 07 '14 05:07 jonathanong

okay and path-join.js. lol

jonathanong avatar Jul 07 '14 05:07 jonathanong

querystring was modified from node core to separate out the try-catch in querystring.parse().

path-join is basically the posix path.join() from node core, simplified a bit. The two reasons for this are:

  • path.join() changes behavior depending on whether you're on Windows or not (it uses '' instead of '/' on Windows) which causes problems when you're using it to join url paths for mounted routers
  • there's a lot of duplicated work in the path functions, so I just combined some of the code to make it a little more efficient (e.g. no splitting and joining only to split again).

mscdex avatar Jul 07 '14 05:07 mscdex

oh god. i think i need path-join as a module! i always do path.join() and some sort of replace(/\/\//, '/') crap

jonathanong avatar Jul 07 '14 05:07 jonathanong

If only... https://github.com/joyent/node/issues/2216

dougwilson avatar Jul 07 '14 05:07 dougwilson