Skip to content

Commit

Permalink
Merge pull request #1047 from ecomfe/types/truncateText
Browse files Browse the repository at this point in the history
fix(type): make the last two parameters `ellipsis` & `options` of the function `truncateText` optional
  • Loading branch information
Ovilia authored Jan 3, 2024
2 parents e7caf87 + cd1f473 commit d53f1c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/graphic/helper/parseText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export function truncateText(
text: string,
containerWidth: number,
font: string,
ellipsis: string,
options: InnerTruncateOption
ellipsis?: string,
options?: InnerTruncateOption
): string {
if (!containerWidth) {
return '';
Expand All @@ -63,8 +63,8 @@ export function truncateText(
function prepareTruncateOptions(
containerWidth: number,
font: string,
ellipsis: string,
options: InnerTruncateOption
ellipsis?: string,
options?: InnerTruncateOption
): InnerPreparedTruncateOption {
options = options || {};
let preparedOpts = extend({}, options) as InnerPreparedTruncateOption;
Expand Down

0 comments on commit d53f1c8

Please sign in to comment.