@deephaven/utils
Advanced tools
Comparing version
@@ -9,4 +9,5 @@ declare class TextUtils { | ||
* @param items The items to join in a list | ||
* @param conjunction Conjunction to use between the last two items | ||
*/ | ||
static join(items: string[] | null): string; | ||
static join(items: string[] | null, conjunction?: string): string; | ||
/** | ||
@@ -13,0 +14,0 @@ * Converts text to lower case, handling null if necessary and returning an empty string |
@@ -9,4 +9,7 @@ class TextUtils { | ||
* @param items The items to join in a list | ||
* @param conjunction Conjunction to use between the last two items | ||
*/ | ||
static join(items) { | ||
var conjunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and'; | ||
if (items == null || items.length === 0) { | ||
@@ -21,3 +24,3 @@ return ''; | ||
if (items.length === 2) { | ||
return "".concat(items[0], " and ").concat(items[1]); | ||
return "".concat(items[0], " ").concat(conjunction, " ").concat(items[1]); | ||
} | ||
@@ -27,3 +30,3 @@ | ||
var lastItem = items[items.length - 1]; | ||
return "".concat(itemText, ", and ").concat(lastItem); | ||
return "".concat(itemText, ", ").concat(conjunction, " ").concat(lastItem); | ||
} | ||
@@ -30,0 +33,0 @@ /** |
{ | ||
"name": "@deephaven/utils", | ||
"version": "0.6.1-markdownnotebooks.4+99274f6", | ||
"version": "0.6.1", | ||
"description": "Deephaven Utils", | ||
@@ -35,3 +35,3 @@ "author": "Deephaven Data Labs LLC", | ||
"@babel/cli": "^7.14.8", | ||
"@deephaven/tsconfig": "^0.6.1-markdownnotebooks.4+99274f6", | ||
"@deephaven/tsconfig": "^0.6.0", | ||
"cross-env": "^7.0.2", | ||
@@ -48,3 +48,3 @@ "npm-run-all": "^4.1.5", | ||
}, | ||
"gitHead": "99274f61a6fca4dc3ca3c3f3a64711dc01bdd576" | ||
"gitHead": "c507b40ee4a849209f64f1f007f9baf50b36c1ec" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
127448
0.45%754
0.4%0
-100%