Finally finished giant ES6 refactor

This commit is contained in:
Jonathan Cremin 2015-08-20 23:22:57 +01:00
parent c6d48cc424
commit 03e2666958
39 changed files with 553 additions and 635 deletions

View file

@ -1,16 +1,15 @@
"use strict";
var parse = require('url').parse;
var querystring = require('querystring');
import { parse } from 'url';
import querystring from 'querystring';
module.exports.match = function(url, type) {
var parsed = parse(url);
export function* match(url, type) {
const parsed = parse(url);
if (!parsed.host.match(/itunes.apple\.com$/)) {
return false;
}
var matches = parsed.path.match(/[\/]?([\/]?[a-z]{2}?)?[\/]+album[\/]+([^\/]+)[\/]+([^\?]+)/);
var query = querystring.parse(parsed.query);
const matches = parsed.path.match(/[\/]?([\/]?[a-z]{2}?)?[\/]+album[\/]+([^\/]+)[\/]+([^\?]+)/);
const query = querystring.parse(parsed.query);
return !!matches[3];
};