@docaohuynh/ielts-api-utils 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -500,6 +500,14 @@ var normalizeText = (text) => {
|
|
|
500
500
|
var fullNameToUsername = (fullName) => {
|
|
501
501
|
return import_transliteration.transliterate(fullName).normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]/g, "").trim();
|
|
502
502
|
};
|
|
503
|
+
// src/utils/strings/empty-line.util.ts
|
|
504
|
+
function removeEmptyLines(str) {
|
|
505
|
+
if (typeof str !== "string") {
|
|
506
|
+
throw new TypeError("Input must be a string");
|
|
507
|
+
}
|
|
508
|
+
return str.split(/\r?\n/).filter((line) => line.trim() !== "").join(`
|
|
509
|
+
`);
|
|
510
|
+
}
|
|
503
511
|
// src/utils/decode/decode-signed.util.ts
|
|
504
512
|
function decodeSignedPayload(signedPayload) {
|
|
505
513
|
const parts = signedPayload.split(".");
|
|
@@ -7273,6 +7281,7 @@ export {
|
|
|
7273
7281
|
sendDeleteWithBearer,
|
|
7274
7282
|
sendDelete,
|
|
7275
7283
|
replaceWordInList,
|
|
7284
|
+
removeEmptyLines,
|
|
7276
7285
|
normalizeText,
|
|
7277
7286
|
getCurrentDateStr,
|
|
7278
7287
|
getCurrentDateInUserTimezone,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes empty lines from a string.
|
|
3
|
+
* An empty line is considered to be a line that contains only whitespace characters or is completely empty.
|
|
4
|
+
*
|
|
5
|
+
* @param str - The input string to remove empty lines from
|
|
6
|
+
* @returns A new string with empty lines removed
|
|
7
|
+
*/
|
|
8
|
+
export declare function removeEmptyLines(str: string): string;
|