fix array expansion when using "..."

This commit is contained in:
Tobias Koppers 2021-02-22 09:03:12 +01:00
parent 5ff9a1486f
commit e63e733713
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ const A = (obj, prop, factory) => {
const item = value[i];
if (item === "...") {
if (newArray === undefined) {
newArray = i > 0 ? value.slice(0, i - 1) : [];
newArray = value.slice(0, i);
obj[prop] = /** @type {T[P]} */ (/** @type {unknown} */ (newArray));
}
const items = /** @type {any[]} */ (/** @type {unknown} */ (factory()));