{"version":3,"sources":["../../../src/lib/splitText.ts"],"names":[],"mappings":";;;;;;AAQO,SAAS,SAAU,CAAA,GAAA,EAAa,MAAgB,EAAA,IAAA,GAAO,GAAK,EAAA;AAClE,EAAA,MAAM,IAAI,GAAI,CAAA,SAAA,CAAU,GAAG,MAAM,CAAA,CAAE,YAAY,IAAI,CAAA;AACnD,EAAM,MAAA,GAAA,GAAM,CAAM,KAAA,EAAA,GAAK,MAAS,GAAA,CAAA;AAChC,EAAO,OAAA,GAAA,CAAI,SAAU,CAAA,CAAA,EAAG,GAAG,CAAA;AAC5B;AAJgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"splitText.cjs","sourcesContent":["/**\n * Split a string by its latest space character in a range from the character 0 to the selected one.\n * @param str The text to split.\n * @param length The length of the desired string.\n * @param char The character to split with\n * @copyright 2019 Aura Román\n * @license Apache-2.0\n */\nexport function splitText(str: string, length: number, char = ' ') {\n\tconst x = str.substring(0, length).lastIndexOf(char);\n\tconst pos = x === -1 ? length : x;\n\treturn str.substring(0, pos);\n}\n"]}