Finally finished giant ES6 refactor
This commit is contained in:
parent
c6d48cc424
commit
03e2666958
39 changed files with 553 additions and 635 deletions
|
@ -1,11 +1,11 @@
|
|||
import { parse } from 'url';
|
||||
|
||||
export function match(url) {
|
||||
var parsed = parse(url);
|
||||
export function* match(url) {
|
||||
const parsed = parse(url);
|
||||
if (!parsed.host.match(/rd\.io$/) && !parsed.host.match(/rdio\.com$/)) {
|
||||
return false;
|
||||
}
|
||||
var regular = parsed.path.match(/[\/]*artist[\/]*([^\/]*)[\/]*album[\/]*([^\/]*)[\/]*([track]*)?[\/]*([^\/]*)/);
|
||||
var short = parsed.path.match(/[\/]*x[\/]*([^\/]*)/);
|
||||
const regular = parsed.path.match(/[\/]*artist[\/]*([^\/]*)[\/]*album[\/]*([^\/]*)[\/]*([track]*)?[\/]*([^\/]*)/);
|
||||
const short = parsed.path.match(/[\/]*x[\/]*([^\/]*)/);
|
||||
return (regular && !!regular[2]) || (short && !!short[1]);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue