Skip to content

Commit 5cd9a34

Browse files
committed
fix: align Node.js and ECMAScript versions
For details please refer to https://node.green/
1 parent 4cc0398 commit 5cd9a34

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Archive/Validators/HarValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class HarValidator implements Validator<Har> {
4747
.map(this.parseEntry, this)
4848
.filter((item: string) => !!item);
4949

50-
const targets: string[] = [...new Set(urls).values()];
50+
const targets: string[] = [...new Set(urls)];
5151

5252
return targets.length !== 0;
5353
}

src/RequestExecutor/Request.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,17 @@ export class Request {
123123
...headers
124124
};
125125

126-
this._headers = Object.fromEntries(
127-
Object.entries(mergedHeaders).map(
128-
([field, value]: [string, string | string[]]) => [
129-
field,
126+
this._headers = Object.entries(mergedHeaders).reduce(
127+
(result, [field, value]: [string, string | string[]]) => {
128+
result[field] =
130129
Array.isArray(value) &&
131130
Request.SINGLE_VALUE_HEADERS.has(field.toLowerCase())
132131
? value.join(', ')
133-
: value
134-
]
135-
)
132+
: value;
133+
134+
return result;
135+
},
136+
{}
136137
);
137138
}
138139

0 commit comments

Comments
 (0)