Skip to content

Commit f83d48e

Browse files
committed
Add sa_settings to overwriteOptions
1 parent c7eb0b3 commit f83d48e

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const GREEN = "\x1b[32m%s\x1b[0m";
88
const YELLOW = "\x1b[33m%s\x1b[0m";
99
const RED = "\x1b[31m%s\x1b[0m";
1010

11-
const VERSION = 9;
11+
const VERSION = 10;
1212

1313
Handlebars.registerHelper("or", function (param1, param2) {
1414
return param1 || param2;

src/default.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@
116116
: [];
117117
};
118118

119+
var isObject = function (object) {
120+
return object && object.constructor === Object;
121+
};
122+
123+
var assign = function () {
124+
var to = {};
125+
var arg = arguments;
126+
for (var index = 0; index < arg.length; index++) {
127+
var nextSource = arg[index];
128+
if (isObject(nextSource)) {
129+
for (var nextKey in nextSource) {
130+
if (hasProp(nextSource, nextKey)) {
131+
to[nextKey] = nextSource[nextKey];
132+
}
133+
}
134+
}
135+
}
136+
return to;
137+
};
138+
139+
// Merge overwriteOptions with sa_settings
140+
overwriteOptions = assign(overwriteOptions, window.sa_settings);
141+
119142
/** if ignoremetrics **/
120143
// Customers can skip data points
121144
var ignoreMetrics = convertCommaSeparatedToArray(
@@ -164,26 +187,6 @@
164187
return typeof func == "function";
165188
};
166189

167-
var isObject = function (object) {
168-
return object && object.constructor === Object;
169-
};
170-
171-
var assign = function () {
172-
var to = {};
173-
var arg = arguments;
174-
for (var index = 0; index < arg.length; index++) {
175-
var nextSource = arg[index];
176-
if (isObject(nextSource)) {
177-
for (var nextKey in nextSource) {
178-
if (hasProp(nextSource, nextKey)) {
179-
to[nextKey] = nextSource[nextKey];
180-
}
181-
}
182-
}
183-
}
184-
return to;
185-
};
186-
187190
// Define namespace for the library
188191
var namespaceText = "namespace";
189192
var namespace =

0 commit comments

Comments
 (0)