@taskora-uni/common 1.1.0 → 1.2.0
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.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/auth-token-payload.type.d.ts +9 -0
- package/dist/types/auth-token-payload.type.js +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +17 -0
- package/dist/utils/timestamp.util.d.ts +1 -1
- package/dist/utils/timestamp.util.js +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums"), exports);
|
|
18
18
|
__exportStar(require("./utils"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auth-token-payload.type";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth-token-payload.type"), exports);
|
|
@@ -3,5 +3,5 @@ interface Timestamp {
|
|
|
3
3
|
nanos: number;
|
|
4
4
|
}
|
|
5
5
|
export declare const timestampToIsoString: (timestamp: Timestamp) => string;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const dateToTimestamp: (value: Date | string) => Timestamp;
|
|
7
7
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.dateToTimestamp = exports.timestampToIsoString = void 0;
|
|
4
4
|
const timestampToIsoString = (timestamp) => new Date(timestamp.seconds * 1000 + Math.floor(timestamp.nanos / 1_000_000)).toISOString();
|
|
5
5
|
exports.timestampToIsoString = timestampToIsoString;
|
|
6
|
-
const
|
|
7
|
-
const date = new Date(
|
|
6
|
+
const dateToTimestamp = (value) => {
|
|
7
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
8
8
|
const time = date.getTime();
|
|
9
9
|
return {
|
|
10
10
|
seconds: Math.floor(time / 1000),
|
|
11
11
|
nanos: (time % 1000) * 1_000_000,
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
14
|
+
exports.dateToTimestamp = dateToTimestamp;
|