10 lines
260 B
JavaScript
10 lines
260 B
JavaScript
import { parse } from 'url';
|
|
|
|
export default function match(url) {
|
|
const parsed = parse(url);
|
|
if (!parsed.host.match(/deezer\.com$/)) {
|
|
return false;
|
|
}
|
|
const matches = parsed.path.match(/\/(album|track)[/]+([^/]+)/);
|
|
return matches.length > 1;
|
|
}
|