@ulu/utils
Advanced tools
Comparing version 0.0.10 to 0.0.11
# Change Log | ||
## 0.0.11 | ||
- Array > joinForSentence (Used for joining array of strings/numbers for a sentence) | ||
- Example [1,2,3] "1, 2 and 3" | ||
## 0.0.10 | ||
@@ -4,0 +9,0 @@ |
@@ -90,2 +90,19 @@ /** | ||
return matrix; | ||
} | ||
/** | ||
* Joins an array into sentence form | ||
* - IE ["2013", "2015", "2020"] --> "2013, 2015 and 2020" | ||
* @param {Array.<String, Number>} arr Array to join | ||
* @returns {String} | ||
*/ | ||
export function joinForSentence(array) { | ||
if (array.length === 0) { | ||
return ""; | ||
} else if (array.length === 1) { | ||
return array[0]; | ||
} else { | ||
return array.slice(0, array.length - 1).join(", ") + " and " + array[array.length - 1]; | ||
} | ||
} |
{ | ||
"name": "@ulu/utils", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Low level utility library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -52,2 +52,9 @@ /** | ||
export function createEmptyMatrix(columnCount: number, rowCount: number, value?: any): Array.Array; | ||
/** | ||
* Joins an array into sentence form | ||
* - IE ["2013", "2015", "2020"] --> "2013, 2015 and 2020" | ||
* @param {Array.<String, Number>} arr Array to join | ||
* @returns {String} | ||
*/ | ||
export function joinForSentence(array: any): string; | ||
//# sourceMappingURL=array.d.ts.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37101
958