@andre1502/react-utilities 1.0.6 → 1.0.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/README.md +35 -51
- package/dist/EnvironmentEnum-CXTWJxNo.js +10 -0
- package/dist/EnvironmentEnum-CXTWJxNo.js.map +1 -0
- package/dist/Utils-CJ7ureSW.js +14 -0
- package/dist/Utils-CJ7ureSW.js.map +1 -0
- package/dist/browser-ponyfill-C-HVh7ck.js +321 -0
- package/dist/browser-ponyfill-C-HVh7ck.js.map +1 -0
- package/dist/chunk-vKJrgz-R.js +16 -0
- package/dist/config-cli-BIF4xuoO.js +1491 -0
- package/dist/config-cli-BIF4xuoO.js.map +1 -0
- package/dist/config-cli.js +3 -229
- package/dist/enums/CurrencySymbolEnum.d.ts +6 -5
- package/dist/enums/DeviceEnum.d.ts +5 -4
- package/dist/enums/EnvironmentEnum.d.ts +6 -5
- package/dist/format-BgweN3o5.js +65549 -0
- package/dist/format-BgweN3o5.js.map +1 -0
- package/dist/format.d.ts +26 -26
- package/dist/format.js +2 -55
- package/dist/hooks-oAipbPQ2.js +78 -0
- package/dist/hooks-oAipbPQ2.js.map +1 -0
- package/dist/hooks.js +2 -86
- package/dist/i18n-D1jKJPI0.js +1941 -0
- package/dist/i18n-D1jKJPI0.js.map +1 -0
- package/dist/i18n.js +4 -28
- package/dist/index-cli.d.ts +0 -1
- package/dist/index-cli.js +3 -28
- package/dist/index-rn.js +6 -39
- package/dist/index.js +7 -61
- package/dist/sentry-rn-DZwIel7y.js +743 -0
- package/dist/sentry-rn-DZwIel7y.js.map +1 -0
- package/dist/sentry-rn.js +2 -28
- package/dist/sentry.js +39 -26
- package/dist/sentry.js.map +1 -1
- package/dist/utils.js +45 -37
- package/dist/utils.js.map +1 -1
- package/package.json +56 -86
- package/src/Config/GoogleAuth.ts +1 -1
- package/src/Sentry/React.ts +2 -4
- package/src/Sentry/ReactNative.ts +2 -4
- package/src/enums/CurrencySymbolEnum.ts +8 -5
- package/src/enums/DeviceEnum.ts +6 -4
- package/src/enums/EnvironmentEnum.ts +8 -5
- package/src/format.ts +32 -32
- package/src/index-cli.ts +0 -1
- package/dist/Config/Config.js +0 -249
- package/dist/Config/Config.js.map +0 -1
- package/dist/Config/GoogleAuth.js +0 -68
- package/dist/Config/GoogleAuth.js.map +0 -1
- package/dist/Config/Locales.js +0 -62
- package/dist/Config/Locales.js.map +0 -1
- package/dist/Config/Output.js +0 -36
- package/dist/Config/Output.js.map +0 -1
- package/dist/Config/Sitemap.js +0 -72
- package/dist/Config/Sitemap.js.map +0 -1
- package/dist/EnvironmentEnum-BjXsfSRZ.js +0 -9
- package/dist/EnvironmentEnum-BjXsfSRZ.js.map +0 -1
- package/dist/EnvironmentEnum-UcQ6Il1O.js +0 -9
- package/dist/EnvironmentEnum-UcQ6Il1O.js.map +0 -1
- package/dist/Format/NumberFormat.js +0 -77
- package/dist/Format/NumberFormat.js.map +0 -1
- package/dist/Format/NumberParser.js +0 -51
- package/dist/Format/NumberParser.js.map +0 -1
- package/dist/Hooks/useDevice.js +0 -47
- package/dist/Hooks/useDevice.js.map +0 -1
- package/dist/Hooks/useSound.js +0 -47
- package/dist/Hooks/useSound.js.map +0 -1
- package/dist/Hooks/useWebSocket.js +0 -120
- package/dist/Hooks/useWebSocket.js.map +0 -1
- package/dist/I18n/I18n.js +0 -134
- package/dist/I18n/I18n.js.map +0 -1
- package/dist/NumberFormat-CvvBWhHc.js +0 -89
- package/dist/NumberFormat-CvvBWhHc.js.map +0 -1
- package/dist/NumberFormat-glmpbk7E.js +0 -94
- package/dist/NumberFormat-glmpbk7E.js.map +0 -1
- package/dist/React-BaJ1KfGF.js +0 -87
- package/dist/React-BaJ1KfGF.js.map +0 -1
- package/dist/React-qUl0CBmE.js +0 -109
- package/dist/React-qUl0CBmE.js.map +0 -1
- package/dist/ReactNative-B4gt8nBr.js +0 -1790
- package/dist/ReactNative-B4gt8nBr.js.map +0 -1
- package/dist/ReactNative-CDMfQFfN.js +0 -1812
- package/dist/ReactNative-CDMfQFfN.js.map +0 -1
- package/dist/Sentry/Build.d.ts +0 -9
- package/dist/Sentry/Build.js +0 -87
- package/dist/Sentry/Build.js.map +0 -1
- package/dist/Sentry/React.js +0 -103
- package/dist/Sentry/React.js.map +0 -1
- package/dist/Sentry/ReactNative.js +0 -113
- package/dist/Sentry/ReactNative.js.map +0 -1
- package/dist/Sentry/Utils.js +0 -24
- package/dist/Sentry/Utils.js.map +0 -1
- package/dist/Utils/Array.js +0 -26
- package/dist/Utils/Array.js.map +0 -1
- package/dist/Utils/Files.js +0 -51
- package/dist/Utils/Files.js.map +0 -1
- package/dist/Utils/Pagination.js +0 -32
- package/dist/Utils/Pagination.js.map +0 -1
- package/dist/Utils/Utils.js +0 -101
- package/dist/Utils/Utils.js.map +0 -1
- package/dist/Utils-BC1fDy39.js +0 -74
- package/dist/Utils-BC1fDy39.js.map +0 -1
- package/dist/Utils-Cq948gfa.js +0 -20
- package/dist/Utils-Cq948gfa.js.map +0 -1
- package/dist/Utils-D7KRF8VU.js +0 -64
- package/dist/Utils-D7KRF8VU.js.map +0 -1
- package/dist/Utils-Dilye04y.js +0 -22
- package/dist/Utils-Dilye04y.js.map +0 -1
- package/dist/config-cli.cjs +0 -532
- package/dist/config-cli.cjs.map +0 -1
- package/dist/config-cli.js.map +0 -1
- package/dist/config-cli.mjs +0 -500
- package/dist/config-cli.mjs.map +0 -1
- package/dist/enums/CurrencySymbolEnum.js +0 -15
- package/dist/enums/CurrencySymbolEnum.js.map +0 -1
- package/dist/enums/DeviceEnum.js +0 -12
- package/dist/enums/DeviceEnum.js.map +0 -1
- package/dist/enums/EnvironmentEnum.js +0 -13
- package/dist/enums/EnvironmentEnum.js.map +0 -1
- package/dist/format.cjs +0 -43
- package/dist/format.cjs.map +0 -1
- package/dist/format.js.map +0 -1
- package/dist/format.mjs +0 -30
- package/dist/format.mjs.map +0 -1
- package/dist/hooks.cjs +0 -13
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/hooks.mjs +0 -4
- package/dist/hooks.mjs.map +0 -1
- package/dist/i18n.cjs +0 -3039
- package/dist/i18n.cjs.map +0 -1
- package/dist/i18n.js.map +0 -1
- package/dist/i18n.mjs +0 -3032
- package/dist/i18n.mjs.map +0 -1
- package/dist/index-cli.cjs +0 -31
- package/dist/index-cli.cjs.map +0 -1
- package/dist/index-cli.js.map +0 -1
- package/dist/index-cli.mjs +0 -14
- package/dist/index-cli.mjs.map +0 -1
- package/dist/index-rn.cjs +0 -57
- package/dist/index-rn.cjs.map +0 -1
- package/dist/index-rn.js.map +0 -1
- package/dist/index-rn.mjs +0 -36
- package/dist/index-rn.mjs.map +0 -1
- package/dist/index.cjs +0 -79
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -40
- package/dist/index.mjs.map +0 -1
- package/dist/interfaces/Config/ConfigOptions.js +0 -6
- package/dist/interfaces/Config/ConfigOptions.js.map +0 -1
- package/dist/interfaces/Config/EntryOptions.js +0 -6
- package/dist/interfaces/Config/EntryOptions.js.map +0 -1
- package/dist/interfaces/Config/OutputMap.js +0 -6
- package/dist/interfaces/Config/OutputMap.js.map +0 -1
- package/dist/interfaces/Config/OutputOptions.js +0 -6
- package/dist/interfaces/Config/OutputOptions.js.map +0 -1
- package/dist/interfaces/Config/SitemapMap.js +0 -6
- package/dist/interfaces/Config/SitemapMap.js.map +0 -1
- package/dist/interfaces/Config/StringMap.js +0 -6
- package/dist/interfaces/Config/StringMap.js.map +0 -1
- package/dist/interfaces/Format/FormatOptions.js +0 -6
- package/dist/interfaces/Format/FormatOptions.js.map +0 -1
- package/dist/interfaces/Sentry/InitOptions.js +0 -6
- package/dist/interfaces/Sentry/InitOptions.js.map +0 -1
- package/dist/interfaces/Sentry/InitOptionsRN.js +0 -6
- package/dist/interfaces/Sentry/InitOptionsRN.js.map +0 -1
- package/dist/interfaces/Sentry/SourceMapOptions.d.ts +0 -7
- package/dist/interfaces/Sentry/SourceMapOptions.js +0 -6
- package/dist/interfaces/Sentry/SourceMapOptions.js.map +0 -1
- package/dist/sentry-cli.cjs +0 -119
- package/dist/sentry-cli.cjs.map +0 -1
- package/dist/sentry-cli.d.ts +0 -9
- package/dist/sentry-cli.js +0 -49
- package/dist/sentry-cli.js.map +0 -1
- package/dist/sentry-cli.mjs +0 -98
- package/dist/sentry-cli.mjs.map +0 -1
- package/dist/sentry-rn.cjs +0 -11
- package/dist/sentry-rn.cjs.map +0 -1
- package/dist/sentry-rn.js.map +0 -1
- package/dist/sentry-rn.mjs +0 -4
- package/dist/sentry-rn.mjs.map +0 -1
- package/dist/sentry.cjs +0 -11
- package/dist/sentry.cjs.map +0 -1
- package/dist/sentry.mjs +0 -4
- package/dist/sentry.mjs.map +0 -1
- package/dist/types/Config/OptionType.js +0 -6
- package/dist/types/Config/OptionType.js.map +0 -1
- package/dist/types/Format/OptionType.js +0 -6
- package/dist/types/Format/OptionType.js.map +0 -1
- package/dist/types/Sentry/OptionType.js +0 -6
- package/dist/types/Sentry/OptionType.js.map +0 -1
- package/dist/useWebSocket-B_B6kWXM.js +0 -167
- package/dist/useWebSocket-B_B6kWXM.js.map +0 -1
- package/dist/useWebSocket-YQWaiBz9.js +0 -172
- package/dist/useWebSocket-YQWaiBz9.js.map +0 -1
- package/dist/utils.cjs +0 -59
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.mjs +0 -43
- package/dist/utils.mjs.map +0 -1
- package/src/Sentry/Build.ts +0 -67
- package/src/interfaces/Sentry/SourceMapOptions.ts +0 -7
- package/src/sentry-cli.ts +0 -16
package/dist/Sentry/React.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.recordAdditionalSentryHttp = exports.initSentry = void 0;
|
|
8
|
-
var Sentry = _interopRequireWildcard(require("@sentry/react"));
|
|
9
|
-
var _Utils = require("./Utils");
|
|
10
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
17
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
20
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
21
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
|
-
/**
|
|
23
|
-
* Initialize Sentry for React.
|
|
24
|
-
*
|
|
25
|
-
* @param {InitOptions} options
|
|
26
|
-
* @return {void}
|
|
27
|
-
*/
|
|
28
|
-
var initSentry = exports.initSentry = function initSentry(options) {
|
|
29
|
-
var _options$requiredEnvF, _options$options, _options$httpClientIn, _options$httpClientIn2, _options$captureConso, _options$options2;
|
|
30
|
-
var shouldSendToSentry = options === null || options === void 0 || (_options$requiredEnvF = options.requiredEnvForSendToSentry) === null || _options$requiredEnvF === void 0 ? void 0 : _options$requiredEnvF.includes(options.env);
|
|
31
|
-
var ignoreErrors = [/antd:/, /is deprecated in StrictMode/, /React Intl/];
|
|
32
|
-
if (options !== null && options !== void 0 && options.ignoreErrorsOptions) {
|
|
33
|
-
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
|
34
|
-
}
|
|
35
|
-
if (options !== null && options !== void 0 && (_options$options = options.options) !== null && _options$options !== void 0 && _options$options.ignoreErrors) {
|
|
36
|
-
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
|
37
|
-
delete options.options.ignoreErrors;
|
|
38
|
-
}
|
|
39
|
-
var integrations = [];
|
|
40
|
-
if (options !== null && options !== void 0 && (_options$httpClientIn = options.httpClientIntegrationOptions) !== null && _options$httpClientIn !== void 0 && _options$httpClientIn.failedRequestStatusCodes && options !== null && options !== void 0 && (_options$httpClientIn2 = options.httpClientIntegrationOptions) !== null && _options$httpClientIn2 !== void 0 && _options$httpClientIn2.failedRequestTargets) {
|
|
41
|
-
integrations.push(Sentry.httpClientIntegration({
|
|
42
|
-
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
|
43
|
-
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
if (options !== null && options !== void 0 && (_options$captureConso = options.captureConsoleIntegrationOptions) !== null && _options$captureConso !== void 0 && _options$captureConso.levels) {
|
|
47
|
-
integrations.push(Sentry.captureConsoleIntegration({
|
|
48
|
-
levels: options.captureConsoleIntegrationOptions.levels
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
if (options !== null && options !== void 0 && (_options$options2 = options.options) !== null && _options$options2 !== void 0 && _options$options2.hasOwnProperty('integrations')) {
|
|
52
|
-
options.options.integrations = [].concat(_toConsumableArray(options.options.integrations), integrations);
|
|
53
|
-
} else {
|
|
54
|
-
options.options = options.options || {};
|
|
55
|
-
options.options.integrations = integrations;
|
|
56
|
-
}
|
|
57
|
-
var sentryOptions = {
|
|
58
|
-
dsn: options.dsn,
|
|
59
|
-
debug: options.debug,
|
|
60
|
-
release: options.release,
|
|
61
|
-
environment: options.env,
|
|
62
|
-
ignoreErrors: ignoreErrors,
|
|
63
|
-
sampleRate: 1.0,
|
|
64
|
-
maxBreadcrumbs: 50,
|
|
65
|
-
attachStacktrace: true,
|
|
66
|
-
autoSessionTracking: true,
|
|
67
|
-
sendClientReports: true,
|
|
68
|
-
enableTracing: true,
|
|
69
|
-
// Performance Monitoring
|
|
70
|
-
tracesSampleRate: 1.0,
|
|
71
|
-
// Capture 100% of the transactions
|
|
72
|
-
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
|
73
|
-
tracePropagationTargets: ['localhost'],
|
|
74
|
-
sendDefaultPii: true,
|
|
75
|
-
beforeSend: function beforeSend(event) {
|
|
76
|
-
var _event$message, _event$message2, _event$message3;
|
|
77
|
-
if (event !== null && event !== void 0 && (_event$message = event.message) !== null && _event$message !== void 0 && _event$message.includes('antd:') || event !== null && event !== void 0 && (_event$message2 = event.message) !== null && _event$message2 !== void 0 && _event$message2.includes('is deprecated in StrictMode') || event !== null && event !== void 0 && (_event$message3 = event.message) !== null && _event$message3 !== void 0 && _event$message3.includes('React Intl') || !shouldSendToSentry) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
return event;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
if (options !== null && options !== void 0 && options.beforeSend) {
|
|
84
|
-
sentryOptions.beforeSend = options.beforeSend;
|
|
85
|
-
}
|
|
86
|
-
if (options !== null && options !== void 0 && options.options) {
|
|
87
|
-
sentryOptions = _objectSpread(_objectSpread({}, sentryOptions), options.options);
|
|
88
|
-
}
|
|
89
|
-
Sentry.init(sentryOptions);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Record additional http data for Sentry.
|
|
94
|
-
*
|
|
95
|
-
* @param {any | null} config
|
|
96
|
-
* @param {any | null} request
|
|
97
|
-
* @param {any | null} response
|
|
98
|
-
* @return {void}
|
|
99
|
-
*/
|
|
100
|
-
var recordAdditionalSentryHttp = exports.recordAdditionalSentryHttp = function recordAdditionalSentryHttp(config, request, response) {
|
|
101
|
-
(0, _Utils.recordSentryHttp)(Sentry, config, request, response);
|
|
102
|
-
};
|
|
103
|
-
//# sourceMappingURL=React.js.map
|
package/dist/Sentry/React.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"React.js","names":["Sentry","_interopRequireWildcard","require","_Utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","iterator","isArray","initSentry","exports","options","_options$requiredEnvF","_options$options","_options$httpClientIn","_options$httpClientIn2","_options$captureConso","_options$options2","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","sentryOptions","dsn","debug","release","environment","sampleRate","maxBreadcrumbs","attachStacktrace","autoSessionTracking","sendClientReports","enableTracing","tracesSampleRate","tracePropagationTargets","sendDefaultPii","beforeSend","event","_event$message","_event$message2","_event$message3","message","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"sources":["../../src/Sentry/React.ts"],"sourcesContent":["import * as Sentry from '@sentry/react';\nimport { InitOptions } from '../interfaces/Sentry/InitOptions';\nimport { StringRegexArr } from '../types/Sentry/OptionType';\nimport { recordSentryHttp } from './Utils';\n\n/**\n * Initialize Sentry for React.\n *\n * @param {InitOptions} options\n * @return {void}\n */\nconst initSentry = (options: InitOptions): void => {\n let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(\n options.env,\n );\n\n let ignoreErrors: StringRegexArr = [\n /antd:/,\n /is deprecated in StrictMode/,\n /React Intl/,\n ];\n\n if (options?.ignoreErrorsOptions) {\n ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);\n }\n\n if (options?.options?.ignoreErrors) {\n ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);\n delete options.options.ignoreErrors;\n }\n\n let integrations: any[] = [];\n\n if (\n options?.httpClientIntegrationOptions?.failedRequestStatusCodes &&\n options?.httpClientIntegrationOptions?.failedRequestTargets\n ) {\n integrations.push(\n Sentry.httpClientIntegration({\n failedRequestStatusCodes:\n options.httpClientIntegrationOptions.failedRequestStatusCodes,\n failedRequestTargets:\n options.httpClientIntegrationOptions.failedRequestTargets,\n }),\n );\n }\n\n if (options?.captureConsoleIntegrationOptions?.levels) {\n integrations.push(\n Sentry.captureConsoleIntegration({\n levels: options.captureConsoleIntegrationOptions.levels,\n }),\n );\n }\n\n if (options?.options?.hasOwnProperty('integrations')) {\n options.options.integrations = [\n ...options.options.integrations,\n ...integrations,\n ];\n } else {\n options.options = options.options || {};\n options.options.integrations = integrations;\n }\n\n let sentryOptions: Sentry.BrowserOptions = {\n dsn: options.dsn,\n debug: options.debug,\n release: options.release,\n environment: options.env,\n ignoreErrors: ignoreErrors,\n sampleRate: 1.0,\n maxBreadcrumbs: 50,\n attachStacktrace: true,\n autoSessionTracking: true,\n sendClientReports: true,\n enableTracing: true,\n // Performance Monitoring\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: ['localhost'],\n sendDefaultPii: true,\n beforeSend: (event) => {\n if (\n event?.message?.includes('antd:') ||\n event?.message?.includes('is deprecated in StrictMode') ||\n event?.message?.includes('React Intl') ||\n !shouldSendToSentry\n ) {\n return null;\n }\n\n return event;\n },\n };\n\n if (options?.beforeSend) {\n sentryOptions.beforeSend = options.beforeSend;\n }\n\n if (options?.options) {\n sentryOptions = {\n ...sentryOptions,\n ...options.options,\n };\n }\n\n Sentry.init(sentryOptions);\n};\n\n/**\n * Record additional http data for Sentry.\n *\n * @param {any | null} config\n * @param {any | null} request\n * @param {any | null} response\n * @return {void}\n */\nconst recordAdditionalSentryHttp = (\n config?: any,\n request?: any,\n response?: any,\n) => {\n recordSentryHttp(Sentry, config, request, response);\n};\n\nexport { initSentry, recordAdditionalSentryHttp };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAA2C,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,wBAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAA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AACF,kBAAkB,EACnB;QACA,OAAO,IAAI;MACb;MAEA,OAAO8B,KAAK;IACd;EACF,CAAC;EAED,IAAIrC,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEoC,UAAU,EAAE;IACvBd,aAAa,CAACc,UAAU,GAAGpC,OAAO,CAACoC,UAAU;EAC/C;EAEA,IAAIpC,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEA,OAAO,EAAE;IACpBsB,aAAa,GAAAzD,aAAA,CAAAA,aAAA,KACRyD,aAAa,GACbtB,OAAO,CAACA,OAAO,CACnB;EACH;EAEAlE,MAAM,CAAC4G,IAAI,CAACpB,aAAa,CAAC;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMqB,0BAA0B,GAAA5C,OAAA,CAAA4C,0BAAA,GAAG,SAA7BA,0BAA0BA,CAC9BC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAAC,uBAAgB,EAACjH,MAAM,EAAE8G,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC;AACrD,CAAC","ignoreList":[]}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.recordAdditionalSentryHttp = exports.initSentry = void 0;
|
|
8
|
-
var _core = require("@sentry/core");
|
|
9
|
-
var Sentry = _interopRequireWildcard(require("@sentry/react-native"));
|
|
10
|
-
var _Utils = require("./Utils");
|
|
11
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
18
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
21
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
22
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
-
/**
|
|
24
|
-
* Initialize Sentry for React Native.
|
|
25
|
-
*
|
|
26
|
-
* @param {InitOptionsRN} options
|
|
27
|
-
* @return {void}
|
|
28
|
-
*/
|
|
29
|
-
var initSentry = exports.initSentry = function initSentry(options) {
|
|
30
|
-
var _options$requiredEnvF, _options$options, _options$httpClientIn, _options$httpClientIn2, _options$captureConso, _options$options2;
|
|
31
|
-
var shouldSendToSentry = options === null || options === void 0 || (_options$requiredEnvF = options.requiredEnvForSendToSentry) === null || _options$requiredEnvF === void 0 ? void 0 : _options$requiredEnvF.includes(options.env);
|
|
32
|
-
var ignoreErrors = [/StallTracking/];
|
|
33
|
-
if (options !== null && options !== void 0 && options.ignoreErrorsOptions) {
|
|
34
|
-
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
|
35
|
-
}
|
|
36
|
-
if (options !== null && options !== void 0 && (_options$options = options.options) !== null && _options$options !== void 0 && _options$options.ignoreErrors) {
|
|
37
|
-
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
|
38
|
-
delete options.options.ignoreErrors;
|
|
39
|
-
}
|
|
40
|
-
var integrations = [];
|
|
41
|
-
if (options !== null && options !== void 0 && (_options$httpClientIn = options.httpClientIntegrationOptions) !== null && _options$httpClientIn !== void 0 && _options$httpClientIn.failedRequestStatusCodes && options !== null && options !== void 0 && (_options$httpClientIn2 = options.httpClientIntegrationOptions) !== null && _options$httpClientIn2 !== void 0 && _options$httpClientIn2.failedRequestTargets) {
|
|
42
|
-
integrations.push(Sentry.httpClientIntegration({
|
|
43
|
-
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
|
44
|
-
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
if (options !== null && options !== void 0 && (_options$captureConso = options.captureConsoleIntegrationOptions) !== null && _options$captureConso !== void 0 && _options$captureConso.levels) {
|
|
48
|
-
integrations.push((0, _core.captureConsoleIntegration)({
|
|
49
|
-
levels: options.captureConsoleIntegrationOptions.levels
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
if (options !== null && options !== void 0 && (_options$options2 = options.options) !== null && _options$options2 !== void 0 && _options$options2.hasOwnProperty('integrations')) {
|
|
53
|
-
options.options.integrations = [].concat(_toConsumableArray(options.options.integrations), integrations);
|
|
54
|
-
} else {
|
|
55
|
-
options.options = options.options || {};
|
|
56
|
-
options.options.integrations = integrations;
|
|
57
|
-
}
|
|
58
|
-
var sentryOptions = {
|
|
59
|
-
dsn: options.dsn,
|
|
60
|
-
debug: options.debug,
|
|
61
|
-
environment: options.env,
|
|
62
|
-
ignoreErrors: ignoreErrors,
|
|
63
|
-
sampleRate: 1.0,
|
|
64
|
-
maxBreadcrumbs: 50,
|
|
65
|
-
autoSessionTracking: true,
|
|
66
|
-
attachScreenshot: true,
|
|
67
|
-
enableCaptureFailedRequests: true,
|
|
68
|
-
enableTracing: true,
|
|
69
|
-
tracesSampleRate: 1.0,
|
|
70
|
-
enableNative: true,
|
|
71
|
-
autoInitializeNativeSdk: true,
|
|
72
|
-
enableNativeCrashHandling: true,
|
|
73
|
-
enableNativeNagger: true,
|
|
74
|
-
enableAutoSessionTracking: true,
|
|
75
|
-
enableNdkScopeSync: true,
|
|
76
|
-
attachThreads: true,
|
|
77
|
-
enableAutoPerformanceTracing: true,
|
|
78
|
-
enableWatchdogTerminationTracking: true,
|
|
79
|
-
enableAppHangTracking: true,
|
|
80
|
-
appHangTimeoutInterval: 5,
|
|
81
|
-
sendDefaultPii: true,
|
|
82
|
-
beforeSend: function beforeSend(event) {
|
|
83
|
-
var _event$message;
|
|
84
|
-
if (event !== null && event !== void 0 && (_event$message = event.message) !== null && _event$message !== void 0 && _event$message.includes('StallTracking') || !shouldSendToSentry) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
return event;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
if (options !== null && options !== void 0 && options.release) {
|
|
91
|
-
sentryOptions.release = options.release;
|
|
92
|
-
}
|
|
93
|
-
if (options !== null && options !== void 0 && options.beforeSend) {
|
|
94
|
-
sentryOptions.beforeSend = options.beforeSend;
|
|
95
|
-
}
|
|
96
|
-
if (options !== null && options !== void 0 && options.options) {
|
|
97
|
-
sentryOptions = _objectSpread(_objectSpread({}, sentryOptions), options.options);
|
|
98
|
-
}
|
|
99
|
-
Sentry.init(sentryOptions);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Record additional http data for Sentry.
|
|
104
|
-
*
|
|
105
|
-
* @param {any | null} config
|
|
106
|
-
* @param {any | null} request
|
|
107
|
-
* @param {any | null} response
|
|
108
|
-
* @return {void}
|
|
109
|
-
*/
|
|
110
|
-
var recordAdditionalSentryHttp = exports.recordAdditionalSentryHttp = function recordAdditionalSentryHttp(config, request, response) {
|
|
111
|
-
(0, _Utils.recordSentryHttp)(Sentry, config, request, response);
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=ReactNative.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNative.js","names":["_core","require","Sentry","_interopRequireWildcard","_Utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","iterator","isArray","initSentry","exports","options","_options$requiredEnvF","_options$options","_options$httpClientIn","_options$httpClientIn2","_options$captureConso","_options$options2","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","sentryOptions","dsn","debug","environment","sampleRate","maxBreadcrumbs","autoSessionTracking","attachScreenshot","enableCaptureFailedRequests","enableTracing","tracesSampleRate","enableNative","autoInitializeNativeSdk","enableNativeCrashHandling","enableNativeNagger","enableAutoSessionTracking","enableNdkScopeSync","attachThreads","enableAutoPerformanceTracing","enableWatchdogTerminationTracking","enableAppHangTracking","appHangTimeoutInterval","sendDefaultPii","beforeSend","event","_event$message","message","release","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"sources":["../../src/Sentry/ReactNative.ts"],"sourcesContent":["import { captureConsoleIntegration } from '@sentry/core';\nimport * as Sentry from '@sentry/react-native';\nimport { InitOptionsRN } from '../interfaces/Sentry/InitOptionsRN';\nimport { StringRegexArr } from '../types/Sentry/OptionType';\nimport { recordSentryHttp } from './Utils';\n\n/**\n * Initialize Sentry for React Native.\n *\n * @param {InitOptionsRN} options\n * @return {void}\n */\nconst initSentry = (options: InitOptionsRN): void => {\n let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(\n options.env,\n );\n\n let ignoreErrors: StringRegexArr = [/StallTracking/];\n\n if (options?.ignoreErrorsOptions) {\n ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);\n }\n\n if (options?.options?.ignoreErrors) {\n ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);\n delete options.options.ignoreErrors;\n }\n\n let integrations: any[] = [];\n\n if (\n options?.httpClientIntegrationOptions?.failedRequestStatusCodes &&\n options?.httpClientIntegrationOptions?.failedRequestTargets\n ) {\n integrations.push(\n Sentry.httpClientIntegration({\n failedRequestStatusCodes:\n options.httpClientIntegrationOptions.failedRequestStatusCodes,\n failedRequestTargets:\n options.httpClientIntegrationOptions.failedRequestTargets,\n }),\n );\n }\n\n if (options?.captureConsoleIntegrationOptions?.levels) {\n integrations.push(\n captureConsoleIntegration({\n levels: options.captureConsoleIntegrationOptions.levels,\n }),\n );\n }\n\n if (options?.options?.hasOwnProperty('integrations')) {\n options.options.integrations = [\n ...options.options.integrations,\n ...integrations,\n ];\n } else {\n options.options = options.options || {};\n options.options.integrations = integrations;\n }\n\n let sentryOptions: Sentry.ReactNativeOptions = {\n dsn: options.dsn,\n debug: options.debug,\n environment: options.env,\n ignoreErrors: ignoreErrors,\n sampleRate: 1.0,\n maxBreadcrumbs: 50,\n autoSessionTracking: true,\n attachScreenshot: true,\n enableCaptureFailedRequests: true,\n enableTracing: true,\n tracesSampleRate: 1.0,\n enableNative: true,\n autoInitializeNativeSdk: true,\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n enableAutoSessionTracking: true,\n enableNdkScopeSync: true,\n attachThreads: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n enableAppHangTracking: true,\n appHangTimeoutInterval: 5,\n sendDefaultPii: true,\n beforeSend: (event) => {\n if (event?.message?.includes('StallTracking') || !shouldSendToSentry) {\n return null;\n }\n\n return event;\n },\n };\n\n if (options?.release) {\n sentryOptions.release = options.release;\n }\n\n if (options?.beforeSend) {\n sentryOptions.beforeSend = options.beforeSend;\n }\n\n if (options?.options) {\n sentryOptions = {\n ...sentryOptions,\n ...options.options,\n };\n }\n\n Sentry.init(sentryOptions);\n};\n\n/**\n * Record additional http data for Sentry.\n *\n * @param {any | null} config\n * @param {any | null} request\n * @param {any | null} response\n * @return {void}\n */\nconst recordAdditionalSentryHttp = (\n config?: any,\n request?: any,\n response?: any,\n) => {\n recordSentryHttp(Sentry, config, request, response);\n};\n\nexport { initSentry, recordAdditionalSentryHttp };\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AAA2C,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,C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AAPA,OAAO,eAAPA,OAAO,CAAEiD,OAAO,EAAE;IACpB3B,aAAa,CAAC2B,OAAO,GAAGjD,OAAO,CAACiD,OAAO;EACzC;EAEA,IAAIjD,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAE6C,UAAU,EAAE;IACvBvB,aAAa,CAACuB,UAAU,GAAG7C,OAAO,CAAC6C,UAAU;EAC/C;EAEA,IAAI7C,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEA,OAAO,EAAE;IACpBsB,aAAa,GAAAzD,aAAA,CAAAA,aAAA,KACRyD,aAAa,GACbtB,OAAO,CAACA,OAAO,CACnB;EACH;EAEAjE,MAAM,CAACmH,IAAI,CAAC5B,aAAa,CAAC;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAM6B,0BAA0B,GAAApD,OAAA,CAAAoD,0BAAA,GAAG,SAA7BA,0BAA0BA,CAC9BC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAAC,uBAAgB,EAACxH,MAAM,EAAEqH,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC;AACrD,CAAC","ignoreList":[]}
|
package/dist/Sentry/Utils.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.recordSentryHttp = void 0;
|
|
7
|
-
var recordSentryHttp = exports.recordSentryHttp = function recordSentryHttp(Sentry, config, request, response) {
|
|
8
|
-
if (config) {
|
|
9
|
-
Sentry.withScope(function (scope) {
|
|
10
|
-
scope.setContext('config', config);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
if (request) {
|
|
14
|
-
Sentry.withScope(function (scope) {
|
|
15
|
-
scope.setContext('request', request);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
if (response) {
|
|
19
|
-
Sentry.withScope(function (scope) {
|
|
20
|
-
scope.setContext('response', response);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=Utils.js.map
|
package/dist/Sentry/Utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","names":["recordSentryHttp","exports","Sentry","config","request","response","withScope","scope","setContext"],"sources":["../../src/Sentry/Utils.ts"],"sourcesContent":["const recordSentryHttp = (\n Sentry: any,\n config?: any,\n request?: any,\n response?: any,\n) => {\n if (config) {\n Sentry.withScope((scope: any) => {\n scope.setContext('config', config);\n });\n }\n\n if (request) {\n Sentry.withScope((scope: any) => {\n scope.setContext('request', request);\n });\n }\n\n if (response) {\n Sentry.withScope((scope: any) => {\n scope.setContext('response', response);\n });\n }\n};\n\nexport { recordSentryHttp };\n"],"mappings":";;;;;;AAAA,IAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAAnBA,gBAAgBA,CACpBE,MAAW,EACXC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAIF,MAAM,EAAE;IACVD,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,QAAQ,EAAEL,MAAM,CAAC;IACpC,CAAC,CAAC;EACJ;EAEA,IAAIC,OAAO,EAAE;IACXF,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,SAAS,EAAEJ,OAAO,CAAC;IACtC,CAAC,CAAC;EACJ;EAEA,IAAIC,QAAQ,EAAE;IACZH,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,UAAU,EAAEH,QAAQ,CAAC;IACxC,CAAC,CAAC;EACJ;AACF,CAAC","ignoreList":[]}
|
package/dist/Utils/Array.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.sliceFromEnd = exports.padArrayStart = exports.joinWithoutFalsy = void 0;
|
|
7
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
11
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
12
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
-
var padArrayStart = exports.padArrayStart = function padArrayStart(array, targetLength, padValue) {
|
|
14
|
-
var padding = Array(Math.max(targetLength - array.length, 0)).fill(padValue);
|
|
15
|
-
return [].concat(_toConsumableArray(padding), _toConsumableArray(array));
|
|
16
|
-
};
|
|
17
|
-
var sliceFromEnd = exports.sliceFromEnd = function sliceFromEnd(array, positionFromEnd) {
|
|
18
|
-
if (positionFromEnd <= 0) return []; // If position is 0 or negative, return an empty array
|
|
19
|
-
|
|
20
|
-
return array.slice(-positionFromEnd);
|
|
21
|
-
};
|
|
22
|
-
var joinWithoutFalsy = exports.joinWithoutFalsy = function joinWithoutFalsy(array) {
|
|
23
|
-
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
24
|
-
return array.filter(Boolean).join(separator);
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=Array.js.map
|
package/dist/Utils/Array.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Array.js","names":["padArrayStart","exports","array","targetLength","padValue","padding","Array","Math","max","length","fill","concat","_toConsumableArray","sliceFromEnd","positionFromEnd","slice","joinWithoutFalsy","separator","arguments","undefined","filter","Boolean","join"],"sources":["../../src/Utils/Array.ts"],"sourcesContent":["export const padArrayStart = (\n array: string[],\n targetLength: number,\n padValue: string,\n): string[] => {\n const padding = Array(Math.max(targetLength - array.length, 0)).fill(\n padValue,\n );\n return [...padding, ...array];\n};\n\nexport const sliceFromEnd = (\n array: string[],\n positionFromEnd: number,\n): string[] => {\n if (positionFromEnd <= 0) return []; // If position is 0 or negative, return an empty array\n\n return array.slice(-positionFromEnd);\n};\n\nexport const joinWithoutFalsy = (array: string[], separator = ','): string => {\n return array.filter(Boolean).join(separator);\n};\n"],"mappings":";;;;;;;;;;;;AAAO,IAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAAhBA,aAAaA,CACxBE,KAAe,EACfC,YAAoB,EACpBC,QAAgB,EACH;EACb,IAAMC,OAAO,GAAGC,KAAK,CAACC,IAAI,CAACC,GAAG,CAACL,YAAY,GAAGD,KAAK,CAACO,MAAM,EAAE,CAAC,CAAC,CAAC,CAACC,IAAI,CAClEN,QACF,CAAC;EACD,UAAAO,MAAA,CAAAC,kBAAA,CAAWP,OAAO,GAAAO,kBAAA,CAAKV,KAAK;AAC9B,CAAC;AAEM,IAAMW,YAAY,GAAAZ,OAAA,CAAAY,YAAA,GAAG,SAAfA,YAAYA,CACvBX,KAAe,EACfY,eAAuB,EACV;EACb,IAAIA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;;EAErC,OAAOZ,KAAK,CAACa,KAAK,CAAC,CAACD,eAAe,CAAC;AACtC,CAAC;AAEM,IAAME,gBAAgB,GAAAf,OAAA,CAAAe,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAId,KAAe,EAA8B;EAAA,IAA5Be,SAAS,GAAAC,SAAA,CAAAT,MAAA,QAAAS,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,GAAG;EAC/D,OAAOhB,KAAK,CAACkB,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAACL,SAAS,CAAC;AAC9C,CAAC","ignoreList":[]}
|
package/dist/Utils/Files.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.deleteFile = void 0;
|
|
8
|
-
var _fs = require("fs");
|
|
9
|
-
var path = _interopRequireWildcard(require("path"));
|
|
10
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
-
/**
|
|
12
|
-
* @param {string} path - The path.
|
|
13
|
-
* @returns {boolean} Whether path is a directory, otherwise always false.
|
|
14
|
-
*/
|
|
15
|
-
var isDir = function isDir(path) {
|
|
16
|
-
try {
|
|
17
|
-
var stat = (0, _fs.lstatSync)(path);
|
|
18
|
-
return stat.isDirectory();
|
|
19
|
-
} catch (error) {
|
|
20
|
-
// lstatSync throws an error if path doesn't exist
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {string} dirPath - Directory path.
|
|
27
|
-
* @param {string[]} exts - List of Extension file need to be removed.
|
|
28
|
-
* @returns {void}
|
|
29
|
-
*/
|
|
30
|
-
var _deleteFile = exports.deleteFile = function deleteFile(dirPath, exts) {
|
|
31
|
-
(0, _fs.readdir)(dirPath, function (err, files) {
|
|
32
|
-
if (err) {
|
|
33
|
-
console.error(err);
|
|
34
|
-
}
|
|
35
|
-
files.forEach(function (file) {
|
|
36
|
-
var fileDir = path.join("".concat(dirPath, "/").concat(file));
|
|
37
|
-
// Get the extension name of the file, lowercase it, then see if it is in the array of extensions
|
|
38
|
-
// defined above. If so, remove it.
|
|
39
|
-
|
|
40
|
-
if (isDir(fileDir)) {
|
|
41
|
-
_deleteFile(fileDir, exts);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (file.toLowerCase() === '.ds_store' || exts.includes(path.extname(file).toLowerCase())) {
|
|
45
|
-
(0, _fs.unlinkSync)(fileDir);
|
|
46
|
-
console.log("File: ".concat(fileDir, " deleted successfully."));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=Files.js.map
|
package/dist/Utils/Files.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Files.js","names":["_fs","require","path","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isDir","stat","lstatSync","isDirectory","error","deleteFile","exports","dirPath","exts","readdir","err","files","console","forEach","file","fileDir","join","concat","toLowerCase","includes","extname","unlinkSync","log"],"sources":["../../src/Utils/Files.ts"],"sourcesContent":["import { lstatSync, readdir, unlinkSync } from 'fs';\nimport * as path from 'path';\n\n/**\n * @param {string} path - The path.\n * @returns {boolean} Whether path is a directory, otherwise always false.\n */\nconst isDir = (path: string): boolean => {\n try {\n const stat = lstatSync(path);\n return stat.isDirectory();\n } catch (error) {\n // lstatSync throws an error if path doesn't exist\n return false;\n }\n};\n\n/**\n * @param {string} dirPath - Directory path.\n * @param {string[]} exts - List of Extension file need to be removed.\n * @returns {void}\n */\nconst deleteFile = (dirPath: string, exts: string[]): void => {\n readdir(dirPath, (err, files) => {\n if (err) {\n console.error(err);\n }\n\n files.forEach((file) => {\n const fileDir = path.join(`${dirPath}/${file}`);\n // Get the extension name of the file, lowercase it, then see if it is in the array of extensions\n // defined above. If so, remove it.\n\n if (isDir(fileDir)) {\n deleteFile(fileDir, exts);\n return;\n }\n\n if (\n file.toLowerCase() === '.ds_store' ||\n exts.includes(path.extname(file).toLowerCase())\n ) {\n unlinkSync(fileDir);\n\n console.log(`File: ${fileDir} deleted successfully.`);\n }\n });\n });\n};\n\nexport { deleteFile };\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA6B,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,wBAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,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IV,OAAO,OAAAU,MAAA,CAAIH,IAAI,CAAE,CAAC;MAC/C;MACA;;MAEA,IAAId,KAAK,CAACe,OAAO,CAAC,EAAE;QAClBV,WAAU,CAACU,OAAO,EAAEP,IAAI,CAAC;QACzB;MACF;MAEA,IACEM,IAAI,CAACI,WAAW,CAAC,CAAC,KAAK,WAAW,IAClCV,IAAI,CAACW,QAAQ,CAACzC,IAAI,CAAC0C,OAAO,CAACN,IAAI,CAAC,CAACI,WAAW,CAAC,CAAC,CAAC,EAC/C;QACA,IAAAG,cAAU,EAACN,OAAO,CAAC;QAEnBH,OAAO,CAACU,GAAG,UAAAL,MAAA,CAAUF,OAAO,2BAAwB,CAAC;MACvD;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/dist/Utils/Pagination.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getTotalPages = exports.getNextPage = exports.getItemRow = void 0;
|
|
7
|
-
var getItemRow = exports.getItemRow = function getItemRow(index, page, pageSize) {
|
|
8
|
-
page = page !== null && page !== void 0 ? page : 0;
|
|
9
|
-
if (page > 0) {
|
|
10
|
-
page = page - 1;
|
|
11
|
-
}
|
|
12
|
-
return (pageSize !== null && pageSize !== void 0 ? pageSize : 0) * page + index + 1;
|
|
13
|
-
};
|
|
14
|
-
var getNextPage = exports.getNextPage = function getNextPage(page, pageSize, totalRecords) {
|
|
15
|
-
var totalPage = 0;
|
|
16
|
-
page = (page !== null && page !== void 0 ? page : 0) + 1;
|
|
17
|
-
if (pageSize && totalRecords) {
|
|
18
|
-
totalPage = Math.ceil(totalRecords / pageSize);
|
|
19
|
-
}
|
|
20
|
-
if (page > totalPage) {
|
|
21
|
-
page = undefined;
|
|
22
|
-
}
|
|
23
|
-
return page;
|
|
24
|
-
};
|
|
25
|
-
var getTotalPages = exports.getTotalPages = function getTotalPages(pageSize, totalRecords) {
|
|
26
|
-
var totalPage = 0;
|
|
27
|
-
if (pageSize && totalRecords) {
|
|
28
|
-
totalPage = Math.ceil(totalRecords / pageSize);
|
|
29
|
-
}
|
|
30
|
-
return totalPage || 1;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":["getItemRow","exports","index","page","pageSize","getNextPage","totalRecords","totalPage","Math","ceil","undefined","getTotalPages"],"sources":["../../src/Utils/Pagination.ts"],"sourcesContent":["export const getItemRow = (index: number, page?: number, pageSize?: number) => {\n page = page ?? 0;\n\n if (page > 0) {\n page = page - 1;\n }\n\n return (pageSize ?? 0) * page + index + 1;\n};\n\nexport const getNextPage = (\n page?: number,\n pageSize?: number,\n totalRecords?: number,\n): number | undefined => {\n let totalPage = 0;\n\n page = (page ?? 0) + 1;\n\n if (pageSize && totalRecords) {\n totalPage = Math.ceil(totalRecords / pageSize);\n }\n\n if (page > totalPage) {\n page = undefined;\n }\n\n return page;\n};\n\nexport const getTotalPages = (\n pageSize?: number,\n totalRecords?: number,\n): number => {\n let totalPage = 0;\n\n if (pageSize && totalRecords) {\n totalPage = Math.ceil(totalRecords / pageSize);\n }\n\n return totalPage || 1;\n};\n"],"mappings":";;;;;;AAAO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,SAAbA,UAAUA,CAAIE,KAAa,EAAEC,IAAa,EAAEC,QAAiB,EAAK;EAC7ED,IAAI,GAAGA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,CAAC;EAEhB,IAAIA,IAAI,GAAG,CAAC,EAAE;IACZA,IAAI,GAAGA,IAAI,GAAG,CAAC;EACjB;EAEA,OAAO,CAACC,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,CAAC,IAAID,IAAI,GAAGD,KAAK,GAAG,CAAC;AAC3C,CAAC;AAEM,IAAMG,WAAW,GAAAJ,OAAA,CAAAI,WAAA,GAAG,SAAdA,WAAWA,CACtBF,IAAa,EACbC,QAAiB,EACjBE,YAAqB,EACE;EACvB,IAAIC,SAAS,GAAG,CAAC;EAEjBJ,IAAI,GAAG,CAACA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAI,CAAC,IAAI,CAAC;EAEtB,IAAIC,QAAQ,IAAIE,YAAY,EAAE;IAC5BC,SAAS,GAAGC,IAAI,CAACC,IAAI,CAACH,YAAY,GAAGF,QAAQ,CAAC;EAChD;EAEA,IAAID,IAAI,GAAGI,SAAS,EAAE;IACpBJ,IAAI,GAAGO,SAAS;EAClB;EAEA,OAAOP,IAAI;AACb,CAAC;AAEM,IAAMQ,aAAa,GAAAV,OAAA,CAAAU,aAAA,GAAG,SAAhBA,aAAaA,CACxBP,QAAiB,EACjBE,YAAqB,EACV;EACX,IAAIC,SAAS,GAAG,CAAC;EAEjB,IAAIH,QAAQ,IAAIE,YAAY,EAAE;IAC5BC,SAAS,GAAGC,IAAI,CAACC,IAAI,CAACH,YAAY,GAAGF,QAAQ,CAAC;EAChD;EAEA,OAAOG,SAAS,IAAI,CAAC;AACvB,CAAC","ignoreList":[]}
|
package/dist/Utils/Utils.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.padNumber = exports.isValidHttpUrl = exports.isHiddenKey = exports.getV = exports.getUniquePermutations = exports.getLastPathName = exports.getKeyByValue = exports.autoBlur = void 0;
|
|
8
|
-
exports.parseQueryString = parseQueryString;
|
|
9
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
12
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
21
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
22
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
23
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
24
|
-
var getV = exports.getV = function getV(divider) {
|
|
25
|
-
return Math.floor(Date.now() / divider);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// pad value with zero
|
|
29
|
-
var padNumber = exports.padNumber = function padNumber(value) {
|
|
30
|
-
var padded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
|
|
31
|
-
return (padded + Math.floor(value)).slice(-2);
|
|
32
|
-
};
|
|
33
|
-
var getLastPathName = exports.getLastPathName = function getLastPathName(pathName) {
|
|
34
|
-
var tmpPathName = pathName.split('/');
|
|
35
|
-
return tmpPathName[tmpPathName.length - 1] || 'bet';
|
|
36
|
-
};
|
|
37
|
-
function parseQueryString(fullString) {
|
|
38
|
-
var _fullString$split = fullString.split('?'),
|
|
39
|
-
_fullString$split2 = _slicedToArray(_fullString$split, 2),
|
|
40
|
-
originValue = _fullString$split2[0],
|
|
41
|
-
queryString = _fullString$split2[1];
|
|
42
|
-
var params = {};
|
|
43
|
-
if (queryString) {
|
|
44
|
-
queryString.split('&').forEach(function (param) {
|
|
45
|
-
var _param$split = param.split('='),
|
|
46
|
-
_param$split2 = _slicedToArray(_param$split, 2),
|
|
47
|
-
key = _param$split2[0],
|
|
48
|
-
value = _param$split2[1];
|
|
49
|
-
params[key] = value;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return _objectSpread({
|
|
53
|
-
originValue: originValue
|
|
54
|
-
}, params);
|
|
55
|
-
}
|
|
56
|
-
var _getUniquePermutations = exports.getUniquePermutations = function getUniquePermutations(array, length) {
|
|
57
|
-
if (length === 1) return array.map(function (item) {
|
|
58
|
-
return [item];
|
|
59
|
-
});
|
|
60
|
-
var permutations = new Set(); // Use Set to prevent duplicates
|
|
61
|
-
var _loop = function _loop() {
|
|
62
|
-
var current = array[i];
|
|
63
|
-
var remaining = array.slice(0, i).concat(array.slice(i + 1));
|
|
64
|
-
var subPermutations = _getUniquePermutations(remaining, length - 1);
|
|
65
|
-
subPermutations.forEach(function (perm) {
|
|
66
|
-
permutations.add([current].concat(_toConsumableArray(perm)).join(',')); // Join to ensure uniqueness
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
for (var i = 0; i < array.length; i++) {
|
|
70
|
-
_loop();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Convert back to array format
|
|
74
|
-
return _toConsumableArray(permutations).map(function (perm) {
|
|
75
|
-
return perm.split(',');
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
var getKeyByValue = exports.getKeyByValue = function getKeyByValue(object, value) {
|
|
79
|
-
return Object.keys(object).find(function (key) {
|
|
80
|
-
return object[key] === value;
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
var autoBlur = exports.autoBlur = function autoBlur() {
|
|
84
|
-
setTimeout(function () {
|
|
85
|
-
if (document.activeElement instanceof HTMLElement) {
|
|
86
|
-
document.activeElement.blur();
|
|
87
|
-
}
|
|
88
|
-
}, 0);
|
|
89
|
-
};
|
|
90
|
-
var isValidHttpUrl = exports.isValidHttpUrl = function isValidHttpUrl(url) {
|
|
91
|
-
try {
|
|
92
|
-
var newUrl = new URL(url);
|
|
93
|
-
return newUrl.protocol === 'http:' || newUrl.protocol === 'https:';
|
|
94
|
-
} catch (err) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var isHiddenKey = exports.isHiddenKey = function isHiddenKey(key) {
|
|
99
|
-
return key.startsWith('__');
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=Utils.js.map
|
package/dist/Utils/Utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","names":["getV","exports","divider","Math","floor","Date","now","padNumber","value","padded","arguments","length","undefined","slice","getLastPathName","pathName","tmpPathName","split","parseQueryString","fullString","_fullString$split","_fullString$split2","_slicedToArray","originValue","queryString","params","forEach","param","_param$split","_param$split2","key","_objectSpread","getUniquePermutations","array","map","item","permutations","Set","_loop","current","i","remaining","concat","subPermutations","perm","add","_toConsumableArray","join","getKeyByValue","object","Object","keys","find","autoBlur","setTimeout","document","activeElement","HTMLElement","blur","isValidHttpUrl","url","newUrl","URL","protocol","err","isHiddenKey","startsWith"],"sources":["../../src/Utils/Utils.ts"],"sourcesContent":["export const getV = (divider: number): number => {\n return Math.floor(Date.now() / divider);\n};\n\n// pad value with zero\nexport const padNumber = (value: number, padded: string | undefined = '0') => {\n return (padded + Math.floor(value)).slice(-2);\n};\n\nexport const getLastPathName = (pathName: string) => {\n const tmpPathName = pathName.split('/');\n\n return tmpPathName[tmpPathName.length - 1] || 'bet';\n};\n\nexport function parseQueryString(fullString: string): {\n originValue: string;\n} & Record<string, string> {\n const [originValue, queryString] = fullString.split('?');\n const params: { [key: string]: string } = {};\n\n if (queryString) {\n queryString.split('&').forEach((param) => {\n const [key, value] = param.split('=');\n params[key] = value;\n });\n }\n\n return { originValue, ...params };\n}\n\nexport const getUniquePermutations = (\n array: string[],\n length: number,\n): string[][] => {\n if (length === 1) return array.map((item) => [item]);\n\n const permutations = new Set<string>(); // Use Set to prevent duplicates\n for (let i = 0; i < array.length; i++) {\n const current = array[i];\n const remaining = array.slice(0, i).concat(array.slice(i + 1));\n const subPermutations = getUniquePermutations(remaining, length - 1);\n subPermutations.forEach((perm) => {\n permutations.add([current, ...perm].join(',')); // Join to ensure uniqueness\n });\n }\n\n // Convert back to array format\n return [...permutations].map((perm) => perm.split(','));\n};\n\nexport const getKeyByValue = <T>(\n object: Record<string, T>,\n value: T,\n): string | undefined => {\n return Object.keys(object).find((key) => object[key] === value);\n};\n\nexport const autoBlur = () => {\n setTimeout(() => {\n if (document.activeElement instanceof HTMLElement) {\n document.activeElement.blur();\n }\n }, 0);\n};\n\nexport const isValidHttpUrl = (url: string) => {\n try {\n const newUrl = new URL(url);\n\n return newUrl.protocol === 'http:' || newUrl.protocol === 'https:';\n } catch (err) {\n return false;\n }\n};\n\nexport const isHiddenKey = (key: string) => {\n return key.startsWith('__');\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,SAAPA,IAAIA,CAAIE,OAAe,EAAa;EAC/C,OAAOC,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGJ,OAAO,CAAC;AACzC,CAAC;;AAED;AACO,IAAMK,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,SAAZA,SAASA,CAAIC,KAAa,EAAuC;EAAA,IAArCC,MAA0B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SA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