gooddata
Advanced tools
Comparing version 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-06T18-14-44-333Z to 5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-06T18-44-59-315Z
@@ -125,2 +125,4 @@ // Copyright (C) 2007-2017, GoodData(R) Corporation. All rights reserved. | ||
setJsPackage(name: string, version: string): void; | ||
setRequestHeader(key: string, value: string): void; | ||
getRequestHeader(key: string): void; | ||
} | ||
@@ -127,0 +129,0 @@ |
@@ -7,8 +7,11 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
exports.sanitizeDomain = sanitizeDomain; | ||
exports.createModule = createModule; | ||
exports.sanitizeConfig = sanitizeConfig; | ||
// Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
var _lodash = require('lodash'); | ||
/** | ||
@@ -66,6 +69,16 @@ * Config module holds SDK configuration variables | ||
function setRequestHeader(key, value) { | ||
(0, _lodash.set)(configStorage, ['xhrSettings', 'headers', key], value); | ||
} | ||
function getRequestHeader(key) { | ||
(0, _lodash.get)(configStorage, ['xhrSettings', 'headers', key]); | ||
} | ||
return { | ||
setCustomDomain: setCustomDomain, | ||
getDomain: getDomain, | ||
setJsPackage: setJsPackage | ||
setJsPackage: setJsPackage, | ||
setRequestHeader: setRequestHeader, | ||
getRequestHeader: getRequestHeader | ||
}; | ||
@@ -75,5 +88,7 @@ } | ||
function sanitizeConfig(config) { | ||
var sanitized = _extends({}, config); | ||
var sanitized = _extends({ | ||
xhrSettings: {} | ||
}, config); | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
return sanitized; | ||
} |
@@ -117,4 +117,2 @@ 'use strict'; | ||
(0, _lodash.defaults)(configStorage, { xhrSettings: {} }); | ||
function createRequestSettings(customSettings) { | ||
@@ -121,0 +119,0 @@ var settings = (0, _lodash.merge)({ |
{ | ||
"name": "gooddata", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-06T18-14-44-333Z", | ||
"version": "5.0.0-pavelzgdc-pzb-647-telemetrie-2018-03-06T18-44-59-315Z", | ||
"author": "GoodData", | ||
@@ -5,0 +5,0 @@ "description": "GoodData JavaScript SDK", |
// Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved. | ||
import { set as _set, get as _get } from 'lodash'; | ||
/** | ||
@@ -54,6 +56,16 @@ * Config module holds SDK configuration variables | ||
function setRequestHeader(key, value) { | ||
_set(configStorage, ['xhrSettings', 'headers', key], value); | ||
} | ||
function getRequestHeader(key) { | ||
_get(configStorage, ['xhrSettings', 'headers', key]); | ||
} | ||
return { | ||
setCustomDomain, | ||
getDomain, | ||
setJsPackage | ||
setJsPackage, | ||
setRequestHeader, | ||
getRequestHeader | ||
}; | ||
@@ -63,5 +75,8 @@ } | ||
export function sanitizeConfig(config) { | ||
const sanitized = { ...config }; | ||
const sanitized = { | ||
xhrSettings: {}, | ||
...config | ||
}; | ||
sanitized.domain = sanitizeDomain(config.domain); | ||
return sanitized; | ||
} |
@@ -7,3 +7,2 @@ // Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved. | ||
set as _set, | ||
defaults, | ||
merge, | ||
@@ -103,4 +102,2 @@ result | ||
defaults(configStorage, { xhrSettings: {} }); | ||
function createRequestSettings(customSettings) { | ||
@@ -107,0 +104,0 @@ const settings = merge( |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1182269
27519