mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-09-28 20:19:12 +01:00
0f65e4c9f3
Reintroduce HackMyCore, dropping the interim submodule, and reorganize and improve tests.
16 lines
442 B
CoffeeScript
16 lines
442 B
CoffeeScript
###*
|
|
Definitions of string utility functions.
|
|
@module utils/string
|
|
###
|
|
|
|
###*
|
|
Determine if the string is null, empty, or whitespace.
|
|
See: http://stackoverflow.com/a/32800728/4942583
|
|
@method isNullOrWhitespace
|
|
###
|
|
|
|
|
|
String.isNullOrWhitespace = ( input ) -> !input || !input.trim()
|
|
String.prototype.endsWith = (suffix) -> @indexOf(suffix, this.length - suffix.length) != -1
|
|
String.is = ( val ) -> typeof val == 'string' || val instanceof String
|