Skip to content

Commit 1db86bc

Browse files
authored
fix: Use different loop to not use tslib (#1759)
1 parent ed9d554 commit 1db86bc

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/utils/src/object.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ export function assign(target: any, ...args: any[]): object {
303303
[key: string]: any;
304304
};
305305

306-
for (const source of args) {
306+
// tslint:disable-next-line
307+
for (let i = 0; i < args.length; i++) {
308+
const source = args[i];
307309
if (source !== null) {
308310
for (const nextKey in source as {
309311
[key: string]: any;

packages/utils/src/string.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ export function safeJoin(input: any[], delimiter?: string): string {
7070
}
7171

7272
const output = [];
73-
74-
for (const value of input) {
73+
// tslint:disable-next-line
74+
for (let i = 0; i < input.length; i++) {
75+
const value = input[i];
7576
try {
7677
output.push(String(value));
7778
} catch (e) {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8987,7 +8987,7 @@ ts-jest@^22.4.4:
89878987
source-map-support "^0.5.5"
89888988
yargs "^11.0.0"
89898989

8990-
tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
8990+
tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
89918991
version "1.9.3"
89928992
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
89938993

0 commit comments

Comments
 (0)