Created
May 7, 2019 12:17
-
-
Save guelau/c082c85a1ff9f3726d84c0910c16aa64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = { | |
has: function (str1, str2) { | |
if (typeof str1 === 'string') { | |
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1 | |
} else { | |
return false | |
} | |
}, | |
lowerize: function (str) { | |
return str.toLowerCase() | |
}, | |
trim: function (str) { | |
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment