@8ms/helpers 1.1.10 → 1.1.11
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.
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Input: Must be an array of objects that are the same.
|
|
4
4
|
* Output: No array [] brackets, each object must on its own new line.
|
|
5
5
|
*/
|
|
6
|
-
export declare const writeGlueJsonFile: ({ S3Lib, bucket, client,
|
|
6
|
+
export declare const writeGlueJsonFile: ({ S3Lib, bucket, client, data, key }: {
|
|
7
7
|
S3Lib: any;
|
|
8
8
|
bucket: string;
|
|
9
9
|
client: any;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
data: object[];
|
|
11
|
+
key: string;
|
|
12
12
|
}) => Promise<any>;
|
|
13
13
|
export default writeGlueJsonFile;
|
|
@@ -45,16 +45,16 @@ var writeFile_1 = require("./writeFile");
|
|
|
45
45
|
* Output: No array [] brackets, each object must on its own new line.
|
|
46
46
|
*/
|
|
47
47
|
var writeGlueJsonFile = function (_a) {
|
|
48
|
-
var S3Lib = _a.S3Lib, bucket = _a.bucket, client = _a.client,
|
|
48
|
+
var S3Lib = _a.S3Lib, bucket = _a.bucket, client = _a.client, data = _a.data, key = _a.key;
|
|
49
49
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
50
50
|
var inputArray, stringRows, concatString;
|
|
51
51
|
return __generator(this, function (_b) {
|
|
52
52
|
switch (_b.label) {
|
|
53
53
|
case 0:
|
|
54
|
-
inputArray = (0, array_1.getArray)({ input:
|
|
54
|
+
inputArray = (0, array_1.getArray)({ input: data });
|
|
55
55
|
stringRows = inputArray.map(function (row) { return JSON.stringify(row); });
|
|
56
56
|
concatString = stringRows.join("\n");
|
|
57
|
-
return [4 /*yield*/, (0, writeFile_1.writeFile)({ S3Lib: S3Lib, bucket: bucket, client: client,
|
|
57
|
+
return [4 /*yield*/, (0, writeFile_1.writeFile)({ S3Lib: S3Lib, bucket: bucket, client: client, data: concatString, key: key })];
|
|
58
58
|
case 1: return [2 /*return*/, _b.sent()];
|
|
59
59
|
}
|
|
60
60
|
});
|