Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit d893dcb

Browse files
committed
chore: fix export and parsing of preview-app-versisons data
1 parent 3645344 commit d893dcb

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/preview-app-versions.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const data = {
1+
exports.data = {
22
"staging": {
33
"playground": {
44
"android": 30,
@@ -29,7 +29,4 @@ const data = {
2929
"ios": 19
3030
}
3131
}
32-
};
33-
export {
34-
data
3532
};

src/services/preview-app-versions-service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ export class PreviewAppVersionsService {
3131
}
3232

3333
private parseResponseCore(response: any): string {
34-
let parts = response.split("\n");
35-
const count = parts.length - 1;
36-
// Remove first and the last three rows
37-
parts = parts.filter((part, index) => index !== 0 && index !== count && index !== count - 1 && index !== count - 2);
38-
parts.unshift("{ ");
34+
const parts = response.split("\n");
35+
// Replace first row with {
36+
parts[0] = "{ ";
3937
let result = parts.join("\n");
40-
// Remove last ;
38+
// Remove last symbol - ;
4139
result = result.substr(0, result.length - 1);
4240

4341
return result;

0 commit comments

Comments
 (0)