From 438c3df46719eaeb6ac6708f7de3fde5c55f49a1 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 21 Sep 2022 17:28:16 -0400 Subject: [PATCH] *Merge arrays with splat, don't push --- src/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 33e8bc9..9772e61 100644 --- a/src/index.ts +++ b/src/index.ts @@ -157,9 +157,7 @@ export default class Config { switch (value) { case Array.isArray(value): - let newVal = this.array(key) ?? []; - newVal.push(value); - this.set(key, newVal); + this.set(key, [...(this.array(key) ?? []), ...value]); break; default: this.set(key, value);