mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-12-29 10:04:49 -05:00
MultiMap
handles string values a bit better now
This commit is contained in:
parent
d62de05339
commit
cf2e81d32f
1 changed files with 2 additions and 2 deletions
|
@ -330,7 +330,7 @@ export class MultiMap<K, V> extends ArrayMap<K, V[]> {
|
|||
* @returns This {@link MultiMap} instance for chaining purposes.
|
||||
*/
|
||||
set(key: K, value: V | Iterable<V>): this {
|
||||
const values = isIterable(value) ? asArray(value) : [value];
|
||||
const values = typeof value !== "string" && isIterable(value) ? asArray(value) : [value];
|
||||
return super.set(key, values);
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ export class MultiMap<K, V> extends ArrayMap<K, V[]> {
|
|||
return this.set(key, value as V);
|
||||
}
|
||||
|
||||
if (isIterable(value)) {
|
||||
if (typeof value !== "string" && isIterable(value)) {
|
||||
existingValues.push(...value);
|
||||
} else {
|
||||
existingValues.push(value);
|
||||
|
|
Loading…
Reference in a new issue