@pnp/common
Advanced tools
Comparing version 2.0.0-2 to 2.0.0-3
{ | ||
"name": "@pnp/common", | ||
"version": "2.0.0-2", | ||
"version": "2.0.0-3", | ||
"description": "pnp - provides shared functionality across all pnp libraries", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -41,3 +41,3 @@ import { TypedHash } from "./collections"; | ||
*/ | ||
extend(config: TypedHash<any>): void; | ||
assign(config: TypedHash<any>): void; | ||
get(key: string): any; | ||
@@ -44,0 +44,0 @@ readonly defaultCachingStore: "session" | "local"; |
import { mergeMaps, objectToMap } from "./collections"; | ||
export function setup(config) { | ||
RuntimeConfig.extend(config); | ||
RuntimeConfig.assign(config); | ||
} | ||
@@ -32,3 +32,3 @@ // lable mapping for known config values | ||
*/ | ||
RuntimeConfigImpl.prototype.extend = function (config) { | ||
RuntimeConfigImpl.prototype.assign = function (config) { | ||
this._v = mergeMaps(this._v, objectToMap(config)); | ||
@@ -35,0 +35,0 @@ }; |
import * as tslib_1 from "tslib"; | ||
import { extend, objectDefinedNotNull } from "./util"; | ||
import { assign, objectDefinedNotNull } from "./util"; | ||
export function mergeHeaders(target, source) { | ||
@@ -13,4 +13,4 @@ if (source !== undefined && source !== null) { | ||
if (objectDefinedNotNull(source)) { | ||
var headers = extend(target.headers || {}, source.headers); | ||
target = extend(target, source); | ||
var headers = assign(target.headers || {}, source.headers); | ||
target = assign(target, source); | ||
target.headers = headers; | ||
@@ -17,0 +17,0 @@ } |
import { TypedHash } from "./collections"; | ||
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | ||
/** | ||
@@ -67,3 +68,3 @@ * Gets a callback function which will maintain context across async calls. | ||
*/ | ||
export declare function extend<T extends TypedHash<any> = any, S extends TypedHash<any> = any>(target: T, source: S, noOverwrite?: boolean, filter?: (propName: string) => boolean): T & S; | ||
export declare function assign<T extends TypedHash<any> = any, S extends TypedHash<any> = any>(target: T, source: S, noOverwrite?: boolean, filter?: (propName: string) => boolean): T & S; | ||
/** | ||
@@ -70,0 +71,0 @@ * Determines if a given url is absolute |
@@ -144,3 +144,3 @@ /** | ||
*/ | ||
export function extend(target, source, noOverwrite, filter) { | ||
export function assign(target, source, noOverwrite, filter) { | ||
if (noOverwrite === void 0) { noOverwrite = false; } | ||
@@ -147,0 +147,0 @@ if (filter === void 0) { filter = function () { return true; }; } |
52227
1354