Git Product home page Git Product logo

file-uri-to-path's Issues

"file:" schema not supported, only recognises "file://" (with an empty authority) as a valid file URI

The definition of a URI is:
scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
(https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#URL_and_URN)

So the // is optional. At the moment, the validation fails unless the slashes are included.

Expected
Any URI starting with "file:" is accepted

Actual
URIs are rejected unless they begin"file://"

This is causing issues when using this library in a system with URIs produced by other libraries.

Wrongly decoding URL encoded multibyte UTF8 characters

Passing in file:///C:/P%C3%A9ter/test.txt returns C:\\Péter\\test.txt instead of C:\\Péter\\test.txt (note that %C3%A9 is the correct representation of é).

The fix should be trivial:
In this line you use the deprecated unescape function instead of decodeURI (which correctly handles the above case).

BTW, awesome package (together with get-uri)! It's super light-weight helper packages like these that make developing for node so much fun 😄

File uri containing percent encoded character doesn't seem to convert properly.

If the file uri has a percentage in it, it seems to not convert it properly.
Such as file:///c%3A/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js will return /c%3A/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js

while file:///c:/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js will return c:/Users/Admin/Desktop/Github_Stuff/Discord_Bots/StratoBotElite/branches/master/src/bot/commands/Logging/user-join.js

Include full text of license?

Hi there!

Would you mind including the full text of the license? It helps with packaging for Linux distros.

Cheers!

npm WARN tarball tarball data for file-uri-to-path@https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz (sha512-) seems to be corrupted. Trying again.

Hi
I am having trouble installing a package that requires this module.
npm install system-sleep

npm WARN tarball tarball data for file-uri-to-path@https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz (sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for file-uri-to-path@https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz (sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==) seems to be corrupted. Trying again.
npm ERR! code ENOENT
npm ERR! syscall lstat

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.