underscore.string
underscore.string copied to clipboard
improve tests, prevent errors in toSentence([]) and unquote(null)
Functionality changes
toSentence
- Result of
toSentence([])is""(previously it rised an error). - Empty strings, null and undefined in array are ommited
... so
toSentence([null, 'test', undefined])will return 'test' (previously it was "null, test and undefined")
unquote
- Result of
unqote(null)is""(previously it rised an error).
Test improvements
camelizeze
- add uppercase string cases to test decapitalization
- remove similar cases of string with spaces
capitalize
- remove duplicate assertion
chop
- (formatting) remove space inside array
escapeRegExp
- add cases with null and undefined
lpad
- add case with length shorter than string
naturalCms
- add cases with numbers, empty strings, undefined and null
pad
- add case with length shorter than string
repeat
- add case with 0 and 1 repetitions
rpad
- add case with length shorter than string
splice
- add case with no substring
- add cases with null and undefined
toBoolean
- add cases with true, false, null and undefined
toSentence
- add cases with empty array, empty string, null and undefined
unquote
- add cases for empty string, null and undefined
@lokson Thx for your awesome work! Will review tonight.
Ready with filter and omitted changes in dist - thanks for review.