@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,
@@ -3,7 +3,6 @@ export * from './strings';
3
3
  export * from './decode';
4
4
  export * from './language';
5
5
  export * from './list';
6
- export * from './strings';
7
6
  export * from './time';
8
7
  export * from './request';
9
8
  export * from './slug';
@@ -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;
@@ -1,2 +1,3 @@
1
1
  export * from './split.util';
2
2
  export * from './normalize.util';
3
+ export * from './empty-line.util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docaohuynh/ielts-api-utils",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Utilities for IELTS API",
5
5
  "module": "index.ts",
6
6
  "main": "dist/index.js",