mirror of https://github.com/VueTubeApp/VueTube
Merge branch 'main' of https://github.com/404-Program-not-found/VueTube into main
This commit is contained in:
commit
3737eb9b7a
|
@ -42,10 +42,18 @@ function getMutationByKey(key, mutations) {
|
|||
return mutations.find((mutation) => mutation.entityKey === key).payload;
|
||||
}
|
||||
|
||||
function linkParser(url) {
|
||||
var regExp =
|
||||
/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/;
|
||||
var match = url.match(regExp);
|
||||
return match && match[7].length == 11 ? match[7] : false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getBetweenStrings,
|
||||
hexToRgb,
|
||||
rgbToHex,
|
||||
getCpn,
|
||||
getMutationByKey,
|
||||
linkParser,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue