check out my latest app: Online Check
and my latest blog post
Convert a URL to a valid filename
License: MIT License
check out my latest app: Online Check
and my latest blog post
I have a list of test names (in reports from https://github.com/web-platform-tests/) which are of the form /encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-decode.html?5001-6000
or /xhr/xmlhttprequest-timeout-worker-synconworker.html?load fires normally
, to give two examples.
I'd like write a file per test on the filesystem, and came to this repo and https://github.com/sindresorhus/filenamify for a solution.
However, I have an additional requirement of being able to reconstruct the original string byte-for-byte, so I need to be able to reverse the escaping.
In either project, a unfilenamify
or unfilenamifyUrl
that is guaranteed to return the original string would be great.
Hi,
maybe a stupid question but what is the motivation for stripping away the scheme? Wouldn't keeping the scheme allow more url normalizations?
Thank you!
The output of two versions with same input.
v1:
const filenamifyUrl = require('filenamify-url');
console.log(filenamifyUrl(`http://localhost:40771?query=pageres*|<>:"\\`));
// => localhost!40771!query=pageres
v2:
const filenamifyUrl = require('filenamify-url');
console.log(filenamifyUrl(`http://localhost:40771?query=pageres*|<>:"\\`));
// => localhost!40771!query=pageres!%7C%3C%3E%3A%22%5C
IssueHunt has been backed by the following sponsors. Become a sponsor
error message:
node_modules/filenamify-url/index.d.ts:1:9 - error TS2305: Module '"..src_project_folder/node_modules/filenamify"' has no exported member 'Options'.
In filenamify\index.d.ts does not seem to have export Options, hence this error.
We are using "filenamify-url": "^2.1.1"
Wondering what's our wrong with our setup.
Thanks.
A 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.