mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-19 08:01:04 +00:00
17 lines
507 B
JavaScript
17 lines
507 B
JavaScript
define(function() {
|
|
/**
|
|
* contains checks to see if a string contains another string
|
|
*
|
|
* @access private
|
|
* @function contains
|
|
* @param {string} str - The string we want to check for substrings
|
|
* @param {string} substr - The substring we want to search the first string for
|
|
* @returns {boolean} true if and only if the first string 'str' contains the second string 'substr'
|
|
*/
|
|
function contains(str, substr) {
|
|
return !!~('' + str).indexOf(substr);
|
|
}
|
|
|
|
return contains;
|
|
});
|