Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
spasovski committed May 10, 2021
1 parent 5c1944f commit c5243f4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/utils/src/TextUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class TextUtils {
* One
* One and Two
* One, Two, and Three
* @param {String[]} items The items to join in a list
* @param items The items to join in a list
*/
static join(items: string[]): string {
static join(items: string[] | null): string {
if (items == null || items.length === 0) {
return '';
}
Expand All @@ -27,10 +27,10 @@ class TextUtils {

/**
* Converts text to lower case, handling null if necessary and returning an empty string
* @param {String} text The text to convert to lower case
* @param {Boolean} isNullAllowed True if a null string should return an empty string from this function. If false an error is thrown if null is passed in.
* @param text The text to convert to lower case
* @param isNullAllowed True if a null string should return an empty string from this function. If false an error is thrown if null is passed in.
*/
static toLower(text: string, isNullAllowed = true): string {
static toLower(text: string | null, isNullAllowed = true): string {
if (text == null) {
if (isNullAllowed) {
return '';
Expand All @@ -44,9 +44,9 @@ class TextUtils {

/**
*
* @param {String} a The string to sort
* @param {String} b Second string to sort
* @param {boolean} isAscending Whether to sort ascending or descending
* @param a The string to sort
* @param b Second string to sort
* @param isAscending Whether to sort ascending or descending
*/
static sort(a: string, b: string, isAscending = true): number {
if (a < b) {
Expand Down

0 comments on commit c5243f4

Please sign in to comment.