@builder.io/sdk 2.2.7-0 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarnrc.yml +1 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.browser.js +40 -50
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +40 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +40 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +40 -50
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.js +39 -49
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/promise.class.js +154 -150
- package/dist/src/classes/query-string.class.js +74 -73
- package/dist/src/classes/query-string.class.test.js +20 -20
- package/dist/src/functions/assign.function.js +19 -19
- package/dist/src/functions/fetch.function.js +75 -97
- package/dist/src/functions/finder.function.js +274 -389
- package/dist/src/functions/get-top-level-domain.js +8 -8
- package/dist/src/functions/next-tick.function.js +23 -26
- package/dist/src/functions/omit.function.js +13 -13
- package/dist/src/functions/server-only-require.function.js +9 -10
- package/dist/src/functions/throttle.function.js +37 -35
- package/dist/src/functions/to-error.js +6 -5
- package/dist/src/functions/uuid.js +8 -9
- package/dist/src/types/api-version.js +3 -3
- package/dist/src/types/element.js +3 -3
- package/dist/src/url.test.js +118 -222
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
|
@@ -1,166 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TinyPromise = void 0;
|
|
4
|
-
var next_tick_function_1 = require(
|
|
4
|
+
var next_tick_function_1 = require("../functions/next-tick.function");
|
|
5
5
|
var State = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Pending: 'Pending',
|
|
7
|
+
Fulfilled: 'Fulfilled',
|
|
8
|
+
Rejected: 'Rejected',
|
|
9
9
|
};
|
|
10
10
|
function isFunction(val) {
|
|
11
|
-
|
|
11
|
+
return val && typeof val === 'function';
|
|
12
12
|
}
|
|
13
13
|
function isObject(val) {
|
|
14
|
-
|
|
14
|
+
return val && typeof val === 'object';
|
|
15
15
|
}
|
|
16
16
|
var TinyPromise = /** @class */ (function () {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
TinyPromise.prototype._resolve = function (x) {
|
|
24
|
-
var _this = this;
|
|
25
|
-
if (x instanceof TinyPromise) {
|
|
26
|
-
x.then(this._resolve.bind(this), this._reject.bind(this));
|
|
27
|
-
} else if (isObject(x) || isFunction(x)) {
|
|
28
|
-
var called_1 = false;
|
|
29
|
-
try {
|
|
30
|
-
var thenable = x.then;
|
|
31
|
-
if (isFunction(thenable)) {
|
|
32
|
-
thenable.call(
|
|
33
|
-
x,
|
|
34
|
-
function (result) {
|
|
35
|
-
if (!called_1) _this._resolve(result);
|
|
36
|
-
called_1 = true;
|
|
37
|
-
return undefined;
|
|
38
|
-
},
|
|
39
|
-
function (error) {
|
|
40
|
-
if (!called_1) _this._reject(error);
|
|
41
|
-
called_1 = true;
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
} else {
|
|
46
|
-
this._fulfill(x);
|
|
47
|
-
}
|
|
48
|
-
} catch (ex) {
|
|
49
|
-
if (!called_1) {
|
|
50
|
-
this._reject(ex);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
this._fulfill(x);
|
|
17
|
+
function TinyPromise(executor) {
|
|
18
|
+
this._state = State.Pending;
|
|
19
|
+
this._handlers = [];
|
|
20
|
+
this._value = null;
|
|
21
|
+
executor(this._resolve.bind(this), this._reject.bind(this));
|
|
55
22
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return this._state === State.Fulfilled;
|
|
78
|
-
};
|
|
79
|
-
TinyPromise.prototype._isRejected = function () {
|
|
80
|
-
return this._state === State.Rejected;
|
|
81
|
-
};
|
|
82
|
-
TinyPromise.prototype._addHandler = function (onFulfilled, onRejected) {
|
|
83
|
-
this._handlers.push({
|
|
84
|
-
onFulfilled: onFulfilled,
|
|
85
|
-
onRejected: onRejected,
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
TinyPromise.prototype._callHandler = function (handler) {
|
|
89
|
-
if (this._isFulfilled() && isFunction(handler.onFulfilled)) {
|
|
90
|
-
handler.onFulfilled(this._value);
|
|
91
|
-
} else if (this._isRejected() && isFunction(handler.onRejected)) {
|
|
92
|
-
handler.onRejected(this._value);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
TinyPromise.prototype.then = function (onFulfilled, onRejected) {
|
|
96
|
-
var _this = this;
|
|
97
|
-
switch (this._state) {
|
|
98
|
-
case State.Pending: {
|
|
99
|
-
return new TinyPromise(function (resolve, reject) {
|
|
100
|
-
_this._addHandler(
|
|
101
|
-
function (value) {
|
|
102
|
-
(0, next_tick_function_1.nextTick)(function () {
|
|
103
|
-
try {
|
|
104
|
-
if (isFunction(onFulfilled)) {
|
|
105
|
-
resolve(onFulfilled(value));
|
|
106
|
-
} else {
|
|
107
|
-
resolve(value);
|
|
108
|
-
}
|
|
109
|
-
} catch (ex) {
|
|
110
|
-
reject(ex);
|
|
23
|
+
TinyPromise.prototype._resolve = function (x) {
|
|
24
|
+
var _this = this;
|
|
25
|
+
if (x instanceof TinyPromise) {
|
|
26
|
+
x.then(this._resolve.bind(this), this._reject.bind(this));
|
|
27
|
+
}
|
|
28
|
+
else if (isObject(x) || isFunction(x)) {
|
|
29
|
+
var called_1 = false;
|
|
30
|
+
try {
|
|
31
|
+
var thenable = x.then;
|
|
32
|
+
if (isFunction(thenable)) {
|
|
33
|
+
thenable.call(x, function (result) {
|
|
34
|
+
if (!called_1)
|
|
35
|
+
_this._resolve(result);
|
|
36
|
+
called_1 = true;
|
|
37
|
+
return undefined;
|
|
38
|
+
}, function (error) {
|
|
39
|
+
if (!called_1)
|
|
40
|
+
_this._reject(error);
|
|
41
|
+
called_1 = true;
|
|
42
|
+
return undefined;
|
|
43
|
+
});
|
|
111
44
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
function (error) {
|
|
115
|
-
(0, next_tick_function_1.nextTick)(function () {
|
|
116
|
-
try {
|
|
117
|
-
if (isFunction(onRejected)) {
|
|
118
|
-
resolve(onRejected(error));
|
|
119
|
-
} else {
|
|
120
|
-
reject(error);
|
|
121
|
-
}
|
|
122
|
-
} catch (ex) {
|
|
123
|
-
reject(ex);
|
|
45
|
+
else {
|
|
46
|
+
this._fulfill(x);
|
|
124
47
|
}
|
|
125
|
-
});
|
|
126
48
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return new TinyPromise(function (resolve, reject) {
|
|
132
|
-
(0, next_tick_function_1.nextTick)(function () {
|
|
133
|
-
try {
|
|
134
|
-
if (isFunction(onFulfilled)) {
|
|
135
|
-
resolve(onFulfilled(_this._value));
|
|
136
|
-
} else {
|
|
137
|
-
resolve(_this._value);
|
|
138
|
-
}
|
|
139
|
-
} catch (ex) {
|
|
140
|
-
reject(ex);
|
|
49
|
+
catch (ex) {
|
|
50
|
+
if (!called_1) {
|
|
51
|
+
this._reject(ex);
|
|
52
|
+
}
|
|
141
53
|
}
|
|
142
|
-
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this._fulfill(x);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
TinyPromise.prototype._fulfill = function (result) {
|
|
60
|
+
var _this = this;
|
|
61
|
+
this._state = State.Fulfilled;
|
|
62
|
+
this._value = result;
|
|
63
|
+
this._handlers.forEach(function (handler) { return _this._callHandler(handler); });
|
|
64
|
+
};
|
|
65
|
+
TinyPromise.prototype._reject = function (error) {
|
|
66
|
+
var _this = this;
|
|
67
|
+
this._state = State.Rejected;
|
|
68
|
+
this._value = error;
|
|
69
|
+
this._handlers.forEach(function (handler) { return _this._callHandler(handler); });
|
|
70
|
+
};
|
|
71
|
+
TinyPromise.prototype._isPending = function () {
|
|
72
|
+
return this._state === State.Pending;
|
|
73
|
+
};
|
|
74
|
+
TinyPromise.prototype._isFulfilled = function () {
|
|
75
|
+
return this._state === State.Fulfilled;
|
|
76
|
+
};
|
|
77
|
+
TinyPromise.prototype._isRejected = function () {
|
|
78
|
+
return this._state === State.Rejected;
|
|
79
|
+
};
|
|
80
|
+
TinyPromise.prototype._addHandler = function (onFulfilled, onRejected) {
|
|
81
|
+
this._handlers.push({
|
|
82
|
+
onFulfilled: onFulfilled,
|
|
83
|
+
onRejected: onRejected,
|
|
143
84
|
});
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
85
|
+
};
|
|
86
|
+
TinyPromise.prototype._callHandler = function (handler) {
|
|
87
|
+
if (this._isFulfilled() && isFunction(handler.onFulfilled)) {
|
|
88
|
+
handler.onFulfilled(this._value);
|
|
89
|
+
}
|
|
90
|
+
else if (this._isRejected() && isFunction(handler.onRejected)) {
|
|
91
|
+
handler.onRejected(this._value);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
TinyPromise.prototype.then = function (onFulfilled, onRejected) {
|
|
95
|
+
var _this = this;
|
|
96
|
+
switch (this._state) {
|
|
97
|
+
case State.Pending: {
|
|
98
|
+
return new TinyPromise(function (resolve, reject) {
|
|
99
|
+
_this._addHandler(function (value) {
|
|
100
|
+
(0, next_tick_function_1.nextTick)(function () {
|
|
101
|
+
try {
|
|
102
|
+
if (isFunction(onFulfilled)) {
|
|
103
|
+
resolve(onFulfilled(value));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
resolve(value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (ex) {
|
|
110
|
+
reject(ex);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}, function (error) {
|
|
114
|
+
(0, next_tick_function_1.nextTick)(function () {
|
|
115
|
+
try {
|
|
116
|
+
if (isFunction(onRejected)) {
|
|
117
|
+
resolve(onRejected(error));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
reject(error);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (ex) {
|
|
124
|
+
reject(ex);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
156
129
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
130
|
+
case State.Fulfilled: {
|
|
131
|
+
return new TinyPromise(function (resolve, reject) {
|
|
132
|
+
(0, next_tick_function_1.nextTick)(function () {
|
|
133
|
+
try {
|
|
134
|
+
if (isFunction(onFulfilled)) {
|
|
135
|
+
resolve(onFulfilled(_this._value));
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
resolve(_this._value);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (ex) {
|
|
142
|
+
reject(ex);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
case State.Rejected: {
|
|
148
|
+
return new TinyPromise(function (resolve, reject) {
|
|
149
|
+
(0, next_tick_function_1.nextTick)(function () {
|
|
150
|
+
try {
|
|
151
|
+
if (isFunction(onRejected)) {
|
|
152
|
+
resolve(onRejected(_this._value));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
reject(_this._value);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (ex) {
|
|
159
|
+
reject(ex);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return TinyPromise;
|
|
167
|
+
}());
|
|
164
168
|
exports.TinyPromise = TinyPromise;
|
|
165
|
-
exports.default = typeof Promise !== 'undefined' ? Promise : TinyPromise;
|
|
166
|
-
//# sourceMappingURL=promise.class.js.map
|
|
169
|
+
exports.default = (typeof Promise !== 'undefined' ? Promise : TinyPromise);
|
|
170
|
+
//# sourceMappingURL=promise.class.js.map
|
|
@@ -1,82 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryString = void 0;
|
|
4
4
|
var PROPERTY_NAME_DENY_LIST = Object.freeze(['__proto__', 'prototype', 'constructor']);
|
|
5
5
|
// TODO: unit tests
|
|
6
6
|
var QueryString = /** @class */ (function () {
|
|
7
|
-
|
|
8
|
-
QueryString.parseDeep = function (queryString) {
|
|
9
|
-
var obj = this.parse(queryString);
|
|
10
|
-
return this.deepen(obj);
|
|
11
|
-
};
|
|
12
|
-
QueryString.stringifyDeep = function (obj) {
|
|
13
|
-
var map = this.flatten(obj);
|
|
14
|
-
return this.stringify(map);
|
|
15
|
-
};
|
|
16
|
-
QueryString.parse = function (queryString) {
|
|
17
|
-
var query = {};
|
|
18
|
-
var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
|
|
19
|
-
for (var i = 0; i < pairs.length; i++) {
|
|
20
|
-
var pair = pairs[i].split('=');
|
|
21
|
-
// TODO: node support?
|
|
22
|
-
try {
|
|
23
|
-
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
|
|
24
|
-
} catch (error) {
|
|
25
|
-
// Ignore malformed URI components
|
|
26
|
-
}
|
|
7
|
+
function QueryString() {
|
|
27
8
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
QueryString.parseDeep = function (queryString) {
|
|
10
|
+
var obj = this.parse(queryString);
|
|
11
|
+
return this.deepen(obj);
|
|
12
|
+
};
|
|
13
|
+
QueryString.stringifyDeep = function (obj) {
|
|
14
|
+
var map = this.flatten(obj);
|
|
15
|
+
return this.stringify(map);
|
|
16
|
+
};
|
|
17
|
+
QueryString.parse = function (queryString) {
|
|
18
|
+
var query = {};
|
|
19
|
+
var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');
|
|
20
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
21
|
+
var pair = pairs[i].split('=');
|
|
22
|
+
// TODO: node support?
|
|
23
|
+
try {
|
|
24
|
+
query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
// Ignore malformed URI components
|
|
28
|
+
}
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
30
|
+
return query;
|
|
31
|
+
};
|
|
32
|
+
QueryString.stringify = function (map) {
|
|
33
|
+
var str = '';
|
|
34
|
+
for (var key in map) {
|
|
35
|
+
if (map.hasOwnProperty(key)) {
|
|
36
|
+
var value = map[key];
|
|
37
|
+
if (str) {
|
|
38
|
+
str += '&';
|
|
39
|
+
}
|
|
40
|
+
str += encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return str;
|
|
44
|
+
};
|
|
45
|
+
QueryString.deepen = function (map) {
|
|
46
|
+
// FIXME; Should be type Tree = Record<string, string | Tree>
|
|
47
|
+
// requires a typescript upgrade.
|
|
48
|
+
var output = {};
|
|
49
|
+
for (var k in map) {
|
|
50
|
+
var t = output;
|
|
51
|
+
var parts = k.split('.');
|
|
52
|
+
var key = parts.pop();
|
|
53
|
+
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
|
|
54
|
+
var part = parts_1[_i];
|
|
55
|
+
assertAllowedPropertyName(part);
|
|
56
|
+
t = t[part] = t[part] || {};
|
|
57
|
+
}
|
|
58
|
+
t[key] = map[k];
|
|
59
|
+
}
|
|
60
|
+
return output;
|
|
61
|
+
};
|
|
62
|
+
QueryString.flatten = function (obj, _current, _res) {
|
|
63
|
+
if (_res === void 0) { _res = {}; }
|
|
64
|
+
for (var key in obj) {
|
|
65
|
+
var value = obj[key];
|
|
66
|
+
var newKey = _current ? _current + '.' + key : key;
|
|
67
|
+
if (value && typeof value === 'object') {
|
|
68
|
+
this.flatten(value, newKey, _res);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
_res[newKey] = value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return _res;
|
|
75
|
+
};
|
|
76
|
+
return QueryString;
|
|
77
|
+
}());
|
|
77
78
|
exports.QueryString = QueryString;
|
|
78
79
|
function assertAllowedPropertyName(name) {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
if (PROPERTY_NAME_DENY_LIST.indexOf(name) >= 0)
|
|
81
|
+
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
81
82
|
}
|
|
82
|
-
//# sourceMappingURL=query-string.class.js.map
|
|
83
|
+
//# sourceMappingURL=query-string.class.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
var query_string_class_1 = require(
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var query_string_class_1 = require("./query-string.class");
|
|
4
4
|
test.each([
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// prettier-ignore
|
|
6
|
+
['__proto__.foo.baz=1'],
|
|
7
|
+
['prototype.foo=1'],
|
|
8
8
|
])('(regression) prototype pollution %#', function (input) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
expect(function () {
|
|
10
|
+
query_string_class_1.QueryString.parseDeep(input);
|
|
11
|
+
}).toThrowError(/Property name \".*\" is not allowed/);
|
|
12
|
+
var pollutedObject = {};
|
|
13
|
+
expect(pollutedObject.foo).toBeUndefined();
|
|
14
14
|
});
|
|
15
15
|
describe('.parseDeep', function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
test('input string may be prefixed with a question mark', function () {
|
|
17
|
+
var result = query_string_class_1.QueryString.parseDeep('?foo=1');
|
|
18
|
+
expect(result).toEqual({ foo: '1' });
|
|
19
|
+
});
|
|
20
|
+
test('converts the paths to a single object', function () {
|
|
21
|
+
var result = query_string_class_1.QueryString.parseDeep('foo.bar.baz=1&foo.boo=2');
|
|
22
|
+
expect(result).toEqual({ foo: { bar: { baz: '1' }, boo: '2' } });
|
|
23
|
+
});
|
|
24
24
|
});
|
|
25
|
-
//# sourceMappingURL=query-string.class.test.js.map
|
|
25
|
+
//# sourceMappingURL=query-string.class.test.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assign = void 0;
|
|
4
4
|
function assign(target) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
var args = [];
|
|
6
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7
|
+
args[_i - 1] = arguments[_i];
|
|
8
|
+
}
|
|
9
|
+
var to = Object(target);
|
|
10
|
+
for (var index = 1; index < arguments.length; index++) {
|
|
11
|
+
var nextSource = arguments[index];
|
|
12
|
+
if (nextSource != null) {
|
|
13
|
+
// Skip over if undefined or null
|
|
14
|
+
for (var nextKey in nextSource) {
|
|
15
|
+
// Avoid bugs when hasOwnProperty is shadowed
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
17
|
+
to[nextKey] = nextSource[nextKey];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
|
-
}
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
return to;
|
|
22
|
+
return to;
|
|
23
23
|
}
|
|
24
24
|
exports.assign = assign;
|
|
25
|
-
//# sourceMappingURL=assign.function.js.map
|
|
25
|
+
//# sourceMappingURL=assign.function.js.map
|