@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.
- package/build/utils/utils.d.ts +1 -0
- package/build/utils/utils.js +6 -1
- package/package.json +1 -1
package/build/utils/utils.d.ts
CHANGED
@@ -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;
|
package/build/utils/utils.js
CHANGED
@@ -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;
|