1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-10-06 15:35:11 +01:00
HackMyResume/src/utils/string.js
hacksalot b803eba934 Scrub string.js.
Will probably be retired in favor of Node reusables.
2015-12-29 10:26:30 -05:00

27 lines
542 B
JavaScript

/**
Definitions of string utility functions.
@module string.js
*/
/**
Determine if the string is null, empty, or whitespace.
See: http://stackoverflow.com/a/32800728/4942583
@method isNullOrWhitespace
*/
(function() {
String.isNullOrWhitespace = function( input ) {
return !input || !input.trim();
};
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
String.is = function( val ) {
return typeof val === 'string' || val instanceof String;
};
}());