Skip to content

Commit

Permalink
Merge pull request #26644 from kubabutkiewicz/ts-migration/GetStyledT…
Browse files Browse the repository at this point in the history
…extArray

[No QA] [TS Migration] migrate GetStyledTextArray to Typescript
  • Loading branch information
cristipaval authored Sep 12, 2023
2 parents 6246232 + 6651618 commit 0805f72
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Str from 'expensify-common/lib/str';

/**
* Render a suggestion menu item component.
* @param {String} name
* @param {String} prefix
* @returns {Array}
*/
const getStyledTextArray = (name, prefix) => {
type StyledText = {
text: string;
isColored: boolean;
};

const getStyledTextArray = (name: string, prefix: string): StyledText[] => {
const texts = [];
const prefixLowercase = prefix.toLowerCase();
const prefixLocation = name.toLowerCase().search(Str.escapeForRegExp(prefixLowercase));
Expand Down

0 comments on commit 0805f72

Please sign in to comment.