1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-22 16:30:11 +00:00

Scrub string.js.

Will probably be retired in favor of Node reusables.
This commit is contained in:
hacksalot 2015-12-29 10:26:30 -05:00
parent 483207e5a0
commit b803eba934

View File

@ -1,6 +1,5 @@
/** /**
Definitions of string utility functions. Definitions of string utility functions.
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
@module string.js @module string.js
*/ */
@ -10,14 +9,18 @@ See: http://stackoverflow.com/a/32800728/4942583
@method isNullOrWhitespace @method isNullOrWhitespace
*/ */
String.isNullOrWhitespace = function( input ) { (function() {
String.isNullOrWhitespace = function( input ) {
return !input || !input.trim(); return !input || !input.trim();
}; };
String.prototype.endsWith = function(suffix) { String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1; return this.indexOf(suffix, this.length - suffix.length) !== -1;
}; };
String.is = function( val ) { String.is = function( val ) {
return typeof val === 'string' || val instanceof String; return typeof val === 'string' || val instanceof String;
}; };
}());