UNPKG

projex

Version:
14 lines (13 loc) 558 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAccountName = void 0; /** * The function `getAccountName` takes a string as input and returns the 6th word in the string. * @param {string} text - A string that contains multiple words separated by spaces or commas. * @returns The function `getAccountName` returns the 6th element (index 5) after splitting the input * `text` by spaces and commas. */ const getAccountName = (text) => { return text.split(/[ ,]+/)[5]; }; exports.getAccountName = getAccountName;