@infineit-nestjs/services 1.0.48 → 1.0.49

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.
@@ -2,6 +2,7 @@ export declare class MessageFormatterService {
2
2
  static capitalizeFirstLetter(word: string): string;
3
3
  static toLowerCase(word: string): string;
4
4
  static formatMessage(template: string, label: string): string;
5
+ static formatMessage(template: string, replacements: Record<string, string>): string;
5
6
  static toSingularOrPlural(word: string, count: number): string;
6
7
  static prepareMessage(template: string, label: string, capitalize?: boolean): string;
7
8
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MessageFormatterService=void 0;const e=require("tslib"),t=require("@nestjs/common");let r=class{static capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}static toLowerCase(e){return e.toLowerCase()}static formatMessage(e,t){return e.replace(/{{module_label}}/gi,t)}static toSingularOrPlural(e,t){return 1===t?e:`${e}s`}static prepareMessage(e,t,r=!1){const s=r?this.capitalizeFirstLetter(t):this.toLowerCase(t);return this.formatMessage(e,s)}};exports.MessageFormatterService=r,exports.MessageFormatterService=r=e.__decorate([(0,t.Injectable)()],r);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MessageFormatterService=void 0;const e=require("tslib"),t=require("@nestjs/common");let r=class{static capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}static toLowerCase(e){return e.toLowerCase()}static formatMessage(e,t){if("string"==typeof t)return e.replace(/{{module_label}}/gi,t);let r=e;for(const[e,s]of Object.entries(t)){const t=`{{${e}}}`;r=r.replace(new RegExp(t,"gi"),s)}return r}static toSingularOrPlural(e,t){return 1===t?e:`${e}s`}static prepareMessage(e,t,r=!1){const s=r?this.capitalizeFirstLetter(t):this.toLowerCase(t);return this.formatMessage(e,s)}};exports.MessageFormatterService=r,exports.MessageFormatterService=r=e.__decorate([(0,t.Injectable)()],r);
@@ -2,6 +2,7 @@ export declare class MessageFormatterService {
2
2
  static capitalizeFirstLetter(word: string): string;
3
3
  static toLowerCase(word: string): string;
4
4
  static formatMessage(template: string, label: string): string;
5
+ static formatMessage(template: string, replacements: Record<string, string>): string;
5
6
  static toSingularOrPlural(word: string, count: number): string;
6
7
  static prepareMessage(template: string, label: string, capitalize?: boolean): string;
7
8
  }
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.MessageFormatterService=void 0;const e=require("tslib"),t=require("@nestjs/common");let r=class{static capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}static toLowerCase(e){return e.toLowerCase()}static formatMessage(e,t){return e.replace(/{{module_label}}/gi,t)}static toSingularOrPlural(e,t){return 1===t?e:`${e}s`}static prepareMessage(e,t,r=!1){const s=r?this.capitalizeFirstLetter(t):this.toLowerCase(t);return this.formatMessage(e,s)}};exports.MessageFormatterService=r,exports.MessageFormatterService=r=e.__decorate([(0,t.Injectable)()],r);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.MessageFormatterService=void 0;const e=require("tslib"),t=require("@nestjs/common");let r=class{static capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}static toLowerCase(e){return e.toLowerCase()}static formatMessage(e,t){if("string"==typeof t)return e.replace(/{{module_label}}/gi,t);let r=e;for(const[e,s]of Object.entries(t)){const t=`{{${e}}}`;r=r.replace(new RegExp(t,"gi"),s)}return r}static toSingularOrPlural(e,t){return 1===t?e:`${e}s`}static prepareMessage(e,t,r=!1){const s=r?this.capitalizeFirstLetter(t):this.toLowerCase(t);return this.formatMessage(e,s)}};exports.MessageFormatterService=r,exports.MessageFormatterService=r=e.__decorate([(0,t.Injectable)()],r);
@@ -2,6 +2,7 @@ declare class MessageFormatterService {
2
2
  static capitalizeFirstLetter(word: string): string;
3
3
  static toLowerCase(word: string): string;
4
4
  static formatMessage(template: string, label: string): string;
5
+ static formatMessage(template: string, replacements: Record<string, string>): string;
5
6
  static toSingularOrPlural(word: string, count: number): string;
6
7
  static prepareMessage(template: string, label: string, capitalize?: boolean): string;
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infineit-nestjs/services",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -114,5 +114,5 @@
114
114
  "node": ">=18.0.0",
115
115
  "npm": ">=9.0.0"
116
116
  },
117
- "gitHead": "f6ab81f8881c0e0e3fb6ce9dfe67c9261a75afe3"
117
+ "gitHead": "7920b070395ded95d50556b18ec00fe62e1eb3c4"
118
118
  }