@bigbinary/neeto-commons-frontend 2.0.10 → 2.0.12
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/README.md +7 -7
- package/initializers.cjs.js +49 -1
- package/initializers.d.ts +1 -0
- package/initializers.js +48 -1
- package/package.json +12 -4
- package/react-utils.cjs.js +89402 -961
- package/react-utils.d.ts +57 -7
- package/react-utils.js +89404 -966
- package/utils.cjs.js +11 -6
- package/utils.d.ts +2 -2
- package/utils.js +11 -6
package/utils.cjs.js
CHANGED
|
@@ -904,6 +904,7 @@ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
|
904
904
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
905
905
|
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
906
906
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
907
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
907
908
|
|
|
908
909
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
909
910
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -959,6 +960,9 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
959
960
|
throw new $TypeError$1('"allowMissing" argument must be a boolean');
|
|
960
961
|
}
|
|
961
962
|
|
|
963
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
964
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
965
|
+
}
|
|
962
966
|
var parts = stringToPath(name);
|
|
963
967
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
964
968
|
|
|
@@ -1165,8 +1169,9 @@ function addNumericSeparator(num, str) {
|
|
|
1165
1169
|
return $replace.call(str, sepRegex, '$&_');
|
|
1166
1170
|
}
|
|
1167
1171
|
|
|
1168
|
-
var
|
|
1169
|
-
var
|
|
1172
|
+
var utilInspect = util_inspect;
|
|
1173
|
+
var inspectCustom = utilInspect.custom;
|
|
1174
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1170
1175
|
|
|
1171
1176
|
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
1172
1177
|
var opts = options || {};
|
|
@@ -1256,7 +1261,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1256
1261
|
return inspect_(value, opts, depth + 1, seen);
|
|
1257
1262
|
}
|
|
1258
1263
|
|
|
1259
|
-
if (typeof obj === 'function') {
|
|
1264
|
+
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
1260
1265
|
var name = nameOf(obj);
|
|
1261
1266
|
var keys = arrObjKeys(obj, inspect);
|
|
1262
1267
|
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
@@ -1286,15 +1291,15 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1286
1291
|
}
|
|
1287
1292
|
if (isError(obj)) {
|
|
1288
1293
|
var parts = arrObjKeys(obj, inspect);
|
|
1289
|
-
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1294
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1290
1295
|
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1291
1296
|
}
|
|
1292
1297
|
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1293
1298
|
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1294
1299
|
}
|
|
1295
1300
|
if (typeof obj === 'object' && customInspect) {
|
|
1296
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
1297
|
-
return obj
|
|
1301
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1302
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1298
1303
|
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1299
1304
|
return obj.inspect();
|
|
1300
1305
|
}
|
package/utils.d.ts
CHANGED
|
@@ -15,14 +15,14 @@ export function withEventTargetValue(
|
|
|
15
15
|
export function getSubdomain(): string;
|
|
16
16
|
export function simulateApiCall<T>(
|
|
17
17
|
result: T,
|
|
18
|
-
error
|
|
18
|
+
error?: any,
|
|
19
19
|
errorProbability?: number,
|
|
20
20
|
delayMs?: number
|
|
21
21
|
): Promise<T>;
|
|
22
22
|
|
|
23
23
|
export function copyToClipboard(
|
|
24
24
|
text: string,
|
|
25
|
-
configs
|
|
25
|
+
configs?: { showToastr?: boolean; message?: string }
|
|
26
26
|
): void;
|
|
27
27
|
|
|
28
28
|
export function buildUrl(route: string, params: object): string;
|
package/utils.js
CHANGED
|
@@ -891,6 +891,7 @@ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
|
891
891
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
892
892
|
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
893
893
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
894
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
894
895
|
|
|
895
896
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
896
897
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -946,6 +947,9 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
946
947
|
throw new $TypeError$1('"allowMissing" argument must be a boolean');
|
|
947
948
|
}
|
|
948
949
|
|
|
950
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
951
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
952
|
+
}
|
|
949
953
|
var parts = stringToPath(name);
|
|
950
954
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
951
955
|
|
|
@@ -1152,8 +1156,9 @@ function addNumericSeparator(num, str) {
|
|
|
1152
1156
|
return $replace.call(str, sepRegex, '$&_');
|
|
1153
1157
|
}
|
|
1154
1158
|
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1159
|
+
var utilInspect = util_inspect;
|
|
1160
|
+
var inspectCustom = utilInspect.custom;
|
|
1161
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1157
1162
|
|
|
1158
1163
|
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
1159
1164
|
var opts = options || {};
|
|
@@ -1243,7 +1248,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1243
1248
|
return inspect_(value, opts, depth + 1, seen);
|
|
1244
1249
|
}
|
|
1245
1250
|
|
|
1246
|
-
if (typeof obj === 'function') {
|
|
1251
|
+
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
1247
1252
|
var name = nameOf(obj);
|
|
1248
1253
|
var keys = arrObjKeys(obj, inspect);
|
|
1249
1254
|
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
@@ -1273,15 +1278,15 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1273
1278
|
}
|
|
1274
1279
|
if (isError(obj)) {
|
|
1275
1280
|
var parts = arrObjKeys(obj, inspect);
|
|
1276
|
-
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1281
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1277
1282
|
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1278
1283
|
}
|
|
1279
1284
|
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1280
1285
|
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1281
1286
|
}
|
|
1282
1287
|
if (typeof obj === 'object' && customInspect) {
|
|
1283
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
1284
|
-
return obj
|
|
1288
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1289
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1285
1290
|
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1286
1291
|
return obj.inspect();
|
|
1287
1292
|
}
|