fistlabs / finger Goto Github PK
View Code? Open in Web Editor NEWUrls matching&building like a boss
License: MIT License
Urls matching&building like a boss
License: MIT License
Rule pattern should support query arguments declaration.
Every query argument may be optional or required.
One optional argument:
/?foo
One required argument:
/&foo
Query declaration should support any number of argument declarations:
/&foo&bar?baz?zot
Query declaration should support same argument declaration with different options
/&foo?foo
Query declaration should support quantifiers for arguments
/&foo+?bar+
Query arguments declarations should support same syntax as path arguments
/&Number:id?{\\w+}:tag+
Query declaration should can be omitted and all the arguments should be parsed
/?
like
/?sort[type]=some-type&sort[order]=asc
It might be handy to pass paths to url.format
example
/<page[type]>/post/<page[postId]>/
support the ability to create different routes for patterns /
and /?foo=bar
it should affect to matching result: url query must contain all the pattern query parameters
var router = new Router({
baseUrl: '/site/'
});
router.addRule('GET /news', {name: 'news'});
router.findMatches('/site/news'); // -> ok
router.getRule('news').build(); // -> /site/news
/news/(<postId>/)?feedId?*
?*
- should extend args
with all extra parsed query arguments when matching and should extendquerystring
with all extra passed values when building
/news/?*
Handy to provide back compatibility with 0.3
but hard to implement and could make matching and building a little bit slower
Number \d+
Alnum \w+
Path [^?&]+?
String [\s\S]+
Ident [a-zA-Z]\w*(?:-[a-zA-Z]\w*)*
Segment [^?&]+?
Во избежание недоразумений. Path и Query кодируются похожим образом, но некоторые части урла кодируются по-другому
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.