Skip to content

Commit 5d91aa4

Browse files
correct length check
Co-authored-by: Alex Johnson <johnson.alex.c@gmail.com>
1 parent 3c3b839 commit 5d91aa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ lib.ensureUniformFontSize = function(gd, baseFont) {
12561256
*/
12571257
lib.join2 = function(arr, mainSeparator, lastSeparator) {
12581258
var len = arr.length;
1259-
if(len > 2 && lastSeparator) {
1259+
if(len > 1 && lastSeparator) {
12601260
return arr.slice(0, -1).join(mainSeparator) + lastSeparator + arr[len - 1];
12611261
}
12621262
return arr.join(mainSeparator);

0 commit comments

Comments
 (0)