@infra-blocks/aws-dynamodb 0.37.0 → 0.38.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/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils.d.ts +14 -0
- package/lib/cjs/utils.js +20 -0
- package/lib/cjs/utils.js.map +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils.d.ts +14 -0
- package/lib/esm/utils.js +17 -0
- package/lib/esm/utils.js.map +1 -0
- package/package.json +1 -1
package/lib/cjs/index.d.ts
CHANGED
package/lib/cjs/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./client.js"), exports);
|
|
|
18
18
|
__exportStar(require("./commands/index.js"), exports);
|
|
19
19
|
__exportStar(require("./error.js"), exports);
|
|
20
20
|
__exportStar(require("./types.js"), exports);
|
|
21
|
+
__exportStar(require("./utils.js"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,6CAA2B;AAC3B,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Date object into a TTL value that AWS DynamoDB expects.
|
|
3
|
+
*
|
|
4
|
+
* The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
|
|
5
|
+
* This function converts the provided Date object into such a timestamp
|
|
6
|
+
* by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The date to convert into a TTL value.
|
|
9
|
+
*
|
|
10
|
+
* @returns The TTL value as expected by AWS DynamoDB.
|
|
11
|
+
*
|
|
12
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
|
|
13
|
+
*/
|
|
14
|
+
export declare function dateToTtl(date: Date): number;
|
package/lib/cjs/utils.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateToTtl = dateToTtl;
|
|
4
|
+
/**
|
|
5
|
+
* Converts a Date object into a TTL value that AWS DynamoDB expects.
|
|
6
|
+
*
|
|
7
|
+
* The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
|
|
8
|
+
* This function converts the provided Date object into such a timestamp
|
|
9
|
+
* by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
|
|
10
|
+
*
|
|
11
|
+
* @param date - The date to convert into a TTL value.
|
|
12
|
+
*
|
|
13
|
+
* @returns The TTL value as expected by AWS DynamoDB.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
|
|
16
|
+
*/
|
|
17
|
+
function dateToTtl(date) {
|
|
18
|
+
return Math.round(date.getTime() / 1000);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;AAaA,8BAEC;AAfD;;;;;;;;;;;;GAYG;AACH,SAAgB,SAAS,CAAC,IAAU;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Date object into a TTL value that AWS DynamoDB expects.
|
|
3
|
+
*
|
|
4
|
+
* The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
|
|
5
|
+
* This function converts the provided Date object into such a timestamp
|
|
6
|
+
* by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The date to convert into a TTL value.
|
|
9
|
+
*
|
|
10
|
+
* @returns The TTL value as expected by AWS DynamoDB.
|
|
11
|
+
*
|
|
12
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
|
|
13
|
+
*/
|
|
14
|
+
export declare function dateToTtl(date: Date): number;
|
package/lib/esm/utils.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a Date object into a TTL value that AWS DynamoDB expects.
|
|
3
|
+
*
|
|
4
|
+
* The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
|
|
5
|
+
* This function converts the provided Date object into such a timestamp
|
|
6
|
+
* by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
|
|
7
|
+
*
|
|
8
|
+
* @param date - The date to convert into a TTL value.
|
|
9
|
+
*
|
|
10
|
+
* @returns The TTL value as expected by AWS DynamoDB.
|
|
11
|
+
*
|
|
12
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
|
|
13
|
+
*/
|
|
14
|
+
export function dateToTtl(date) {
|
|
15
|
+
return Math.round(date.getTime() / 1000);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|