@pnp/common
Advanced tools
Comparing version 2.1.0-beta4 to 2.1.0-beta5
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
export declare function mergeMaps<K, V>(target: Map<K, V>, ...maps: Map<K, V>[]): Map<K, V>; | ||
export declare function mergeMaps<K = string, V = any>(target: Map<K, V>, ...maps: Map<K, V>[]): Map<K, V>; | ||
//# sourceMappingURL=collections.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { isFunc } from "./util"; | ||
import { isFunc, objectDefinedNotNull } from "./util"; | ||
/** | ||
@@ -12,3 +12,3 @@ * Used to calculate the object properties, with polyfill if needed | ||
export function objectToMap(o) { | ||
if (o !== undefined && o !== null) { | ||
if (objectDefinedNotNull(o)) { | ||
return new Map(objectEntries(o)); | ||
@@ -31,6 +31,5 @@ } | ||
maps[i].forEach(function (v, k) { | ||
if (Object.prototype.toString.call(v) === "[object Object]") { | ||
if ((typeof k === "string" && k !== "spfxContext") && Object.prototype.toString.call(v) === "[object Object]") { | ||
// we only handle one level of deep object merging | ||
var existing = target.get(k); | ||
target.set(k, Object.assign(existing, v)); | ||
target.set(k, Object.assign({}, target.get(k) || {}, v)); | ||
} | ||
@@ -37,0 +36,0 @@ else { |
{ | ||
"name": "@pnp/common", | ||
"version": "2.1.0-beta4", | ||
"version": "2.1.0-beta5", | ||
"description": "pnp - provides shared functionality across all pnp libraries", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68659
1137