Code tweaks

This commit is contained in:
Sam Potts
2018-01-14 23:15:33 +11:00
parent cfc86bcb7c
commit 22e8892993
15 changed files with 71 additions and 76 deletions
+3
View File
@@ -50,6 +50,9 @@ const utils = {
track(input) {
return this.instanceof(input, TextTrack) || (!this.nullOrUndefined(input) && this.string(input.kind));
},
url(input) {
return !this.nullOrUndefined(input) && /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/.test(input);
},
nullOrUndefined(input) {
return input === null || typeof input === 'undefined';
},