@hastehaul/common 2.0.11 → 2.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
1
  export declare function hasElapsed(expirationDate: Date): boolean;
2
2
  export declare function colorize(text: string, colorCode: number): string;
3
3
  export declare function formatDatetimeToHumanReadable(datetime: Date, format?: string): string;
4
+ export declare function generateIdentifier(messageContent: string): string;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.formatDatetimeToHumanReadable = exports.colorize = exports.hasElapsed = void 0;
6
+ exports.generateIdentifier = exports.formatDatetimeToHumanReadable = exports.colorize = exports.hasElapsed = void 0;
7
7
  const moment_1 = __importDefault(require("moment"));
8
8
  function hasElapsed(expirationDate) {
9
9
  const currentDate = (0, moment_1.default)();
@@ -20,3 +20,8 @@ function formatDatetimeToHumanReadable(datetime, format) {
20
20
  return (0, moment_1.default)(datetime).format(format || 'MMMM D, YYYY h:mm A');
21
21
  }
22
22
  exports.formatDatetimeToHumanReadable = formatDatetimeToHumanReadable;
23
+ function generateIdentifier(messageContent) {
24
+ // You can use any hash function or strategy that suits your needs
25
+ return Buffer.from(messageContent).toString('base64');
26
+ }
27
+ exports.generateIdentifier = generateIdentifier;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hastehaul/common",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",