@microsoft/applicationinsights-common 3.0.0-beta.2301-20 → 3.0.0-beta.2302-02
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/browser/applicationinsights-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +99 -30
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +10 -10
- package/dist/applicationinsights-common.api.md +1 -1
- package/dist/applicationinsights-common.d.ts +7 -7
- package/dist/applicationinsights-common.js +99 -30
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +7 -7
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/IThrottleMgr.js +1 -1
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/ThrottleMgr.js +46 -19
- package/dist-esm/ThrottleMgr.js.map +1 -1
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +1 -1
- package/dist-esm/__DynamicConstants.js +6 -5
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-common.js +1 -1
- package/package.json +5 -5
- package/src/ConnectionStringParser.ts +8 -8
- package/src/HelperFuncs.ts +6 -6
- package/src/Interfaces/IConfig.ts +7 -7
- package/src/Interfaces/IThrottleMgr.ts +6 -6
- package/src/StorageHelperFuncs.ts +10 -10
- package/src/Telemetry/Common/DataSanitizer.ts +8 -8
- package/src/Telemetry/Common/Envelope.ts +11 -11
- package/src/Telemetry/Event.ts +11 -11
- package/src/Telemetry/Exception.ts +22 -22
- package/src/Telemetry/Metric.ts +12 -12
- package/src/Telemetry/PageView.ts +14 -14
- package/src/Telemetry/PageViewPerformance.ts +12 -12
- package/src/Telemetry/RemoteDependencyData.ts +12 -12
- package/src/Telemetry/Trace.ts +12 -12
- package/src/TelemetryItemCreator.ts +10 -10
- package/src/ThrottleMgr.ts +53 -21
- package/src/UrlHelperFuncs.ts +6 -6
- package/src/Util.ts +16 -16
- package/src/__DynamicConstants.ts +50 -49
- package/types/Enums.d.ts +2 -2
- package/types/Interfaces/ConnectionString.d.ts +2 -2
- package/types/Interfaces/Contracts/SeverityLevel.d.ts +1 -1
- package/types/Interfaces/IThrottleMgr.d.ts +6 -6
- package/types/__DynamicConstants.d.ts +2 -1
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.34.
|
|
4
|
+
"toolVersion": "7.34.2",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -2346,7 +2346,7 @@
|
|
|
2346
2346
|
"excerptTokens": [
|
|
2347
2347
|
{
|
|
2348
2348
|
"kind": "Content",
|
|
2349
|
-
"text": "export
|
|
2349
|
+
"text": "export type DistributedTracingModes = "
|
|
2350
2350
|
},
|
|
2351
2351
|
{
|
|
2352
2352
|
"kind": "Content",
|
|
@@ -13591,7 +13591,7 @@
|
|
|
13591
13591
|
{
|
|
13592
13592
|
"kind": "PropertySignature",
|
|
13593
13593
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleInterval#dayInterval:member",
|
|
13594
|
-
"docComment": "/**\n * Identifies days that items can be sent
|
|
13594
|
+
"docComment": "/**\n * Identifies days Interval from start date that items can be sent Default: undefined\n */\n",
|
|
13595
13595
|
"excerptTokens": [
|
|
13596
13596
|
{
|
|
13597
13597
|
"kind": "Content",
|
|
@@ -13617,16 +13617,16 @@
|
|
|
13617
13617
|
},
|
|
13618
13618
|
{
|
|
13619
13619
|
"kind": "PropertySignature",
|
|
13620
|
-
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleInterval#
|
|
13621
|
-
"docComment": "/**\n * Identifies
|
|
13620
|
+
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleInterval#daysOfMonth:member",
|
|
13621
|
+
"docComment": "/**\n * Identifies days within each month that items can be sent If both monthInterval and dayInterval are undefined, it will be default to [28]\n */\n",
|
|
13622
13622
|
"excerptTokens": [
|
|
13623
13623
|
{
|
|
13624
13624
|
"kind": "Content",
|
|
13625
|
-
"text": "
|
|
13625
|
+
"text": "daysOfMonth?: "
|
|
13626
13626
|
},
|
|
13627
13627
|
{
|
|
13628
13628
|
"kind": "Content",
|
|
13629
|
-
"text": "number"
|
|
13629
|
+
"text": "number[]"
|
|
13630
13630
|
},
|
|
13631
13631
|
{
|
|
13632
13632
|
"kind": "Content",
|
|
@@ -13636,7 +13636,7 @@
|
|
|
13636
13636
|
"isReadonly": false,
|
|
13637
13637
|
"isOptional": true,
|
|
13638
13638
|
"releaseTag": "Public",
|
|
13639
|
-
"name": "
|
|
13639
|
+
"name": "daysOfMonth",
|
|
13640
13640
|
"propertyTypeTokenRange": {
|
|
13641
13641
|
"startIndex": 1,
|
|
13642
13642
|
"endIndex": 2
|
|
@@ -13645,7 +13645,7 @@
|
|
|
13645
13645
|
{
|
|
13646
13646
|
"kind": "PropertySignature",
|
|
13647
13647
|
"canonicalReference": "@microsoft/applicationinsights-common!IThrottleInterval#monthInterval:member",
|
|
13648
|
-
"docComment": "/**\n * Identifies month interval that items can be sent For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.)
|
|
13648
|
+
"docComment": "/**\n * Identifies month interval that items can be sent For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.) If both monthInterval and dayInterval are undefined, it will be set to 3\n */\n",
|
|
13649
13649
|
"excerptTokens": [
|
|
13650
13650
|
{
|
|
13651
13651
|
"kind": "Content",
|
|
@@ -17665,7 +17665,7 @@
|
|
|
17665
17665
|
"excerptTokens": [
|
|
17666
17666
|
{
|
|
17667
17667
|
"kind": "Content",
|
|
17668
|
-
"text": "export
|
|
17668
|
+
"text": "export type SeverityLevel = "
|
|
17669
17669
|
},
|
|
17670
17670
|
{
|
|
17671
17671
|
"kind": "Content",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2302-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -1965,19 +1965,19 @@ declare namespace ApplicationInsights {
|
|
|
1965
1965
|
/**
|
|
1966
1966
|
* Identifies month interval that items can be sent
|
|
1967
1967
|
* For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.)
|
|
1968
|
-
*
|
|
1968
|
+
* If both monthInterval and dayInterval are undefined, it will be set to 3
|
|
1969
1969
|
*/
|
|
1970
1970
|
monthInterval?: number;
|
|
1971
1971
|
/**
|
|
1972
|
-
* Identifies days that items can be sent
|
|
1973
|
-
* Default:
|
|
1972
|
+
* Identifies days Interval from start date that items can be sent
|
|
1973
|
+
* Default: undefined
|
|
1974
1974
|
*/
|
|
1975
1975
|
dayInterval?: number;
|
|
1976
1976
|
/**
|
|
1977
|
-
* Identifies
|
|
1978
|
-
*
|
|
1977
|
+
* Identifies days within each month that items can be sent
|
|
1978
|
+
* If both monthInterval and dayInterval are undefined, it will be default to [28]
|
|
1979
1979
|
*/
|
|
1980
|
-
|
|
1980
|
+
daysOfMonth?: number[];
|
|
1981
1981
|
}
|
|
1982
1982
|
|
|
1983
1983
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.0.0-beta.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.0.0-beta.2302-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -509,6 +509,44 @@
|
|
|
509
509
|
var TRIM = "trim";
|
|
510
510
|
var strTrim = StrProto[TRIM] ? _unwrapFunction(TRIM) : polyStrTrim;
|
|
511
511
|
|
|
512
|
+
function _createTimerHandler(startTimer, refreshFn, cancelFn) {
|
|
513
|
+
var ref = true;
|
|
514
|
+
var timerId = startTimer ? refreshFn(null) : null;
|
|
515
|
+
function _unref() {
|
|
516
|
+
ref = false;
|
|
517
|
+
timerId && timerId["unref"] && timerId["unref"]();
|
|
518
|
+
return timer;
|
|
519
|
+
}
|
|
520
|
+
function _ref() {
|
|
521
|
+
ref = true;
|
|
522
|
+
timerId && timerId["ref"] && timerId["ref"]();
|
|
523
|
+
return timer;
|
|
524
|
+
}
|
|
525
|
+
function _hasRef() {
|
|
526
|
+
if (timerId && timerId["hasRef"]) {
|
|
527
|
+
return timerId["hasRef"]();
|
|
528
|
+
}
|
|
529
|
+
return ref;
|
|
530
|
+
}
|
|
531
|
+
var timer = {
|
|
532
|
+
cancel: function () {
|
|
533
|
+
timerId && cancelFn(timerId);
|
|
534
|
+
timerId = null;
|
|
535
|
+
},
|
|
536
|
+
refresh: function () {
|
|
537
|
+
timerId = refreshFn(timerId);
|
|
538
|
+
if (!ref) {
|
|
539
|
+
_unref();
|
|
540
|
+
}
|
|
541
|
+
return timer;
|
|
542
|
+
},
|
|
543
|
+
hasRef: _hasRef,
|
|
544
|
+
ref: _ref,
|
|
545
|
+
unref: _unref
|
|
546
|
+
};
|
|
547
|
+
return timer;
|
|
548
|
+
}
|
|
549
|
+
|
|
512
550
|
function _extractArgs(args, startAt) {
|
|
513
551
|
var theArgs = [];
|
|
514
552
|
for (var lp = startAt; lp < args[LENGTH]; lp++) {
|
|
@@ -517,22 +555,26 @@
|
|
|
517
555
|
return theArgs;
|
|
518
556
|
}
|
|
519
557
|
|
|
520
|
-
function
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
558
|
+
function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
|
|
559
|
+
var isArr = isArray(overrideFn);
|
|
560
|
+
var len = isArr ? overrideFn.length : 0;
|
|
561
|
+
var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
|
|
562
|
+
var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
|
|
563
|
+
return _createTimerHandler(startTimer, function (timerId) {
|
|
564
|
+
if (timerId) {
|
|
565
|
+
if (timerId.refresh) {
|
|
566
|
+
timerId.refresh();
|
|
567
|
+
return timerId;
|
|
568
|
+
}
|
|
569
|
+
clearFn.call(self, timerId);
|
|
531
570
|
}
|
|
532
|
-
|
|
571
|
+
return setFn.apply(self, theArgs);
|
|
572
|
+
}, function (timerId) {
|
|
573
|
+
clearFn.call(self, timerId);
|
|
574
|
+
});
|
|
533
575
|
}
|
|
534
576
|
function scheduleTimeout(callback, timeout) {
|
|
535
|
-
return
|
|
577
|
+
return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
|
|
536
578
|
}
|
|
537
579
|
|
|
538
580
|
var createEnumStyle = createEnum;
|
|
@@ -1146,7 +1188,7 @@
|
|
|
1146
1188
|
return result;
|
|
1147
1189
|
}
|
|
1148
1190
|
|
|
1149
|
-
var version = "3.0.0-beta.
|
|
1191
|
+
var version = "3.0.0-beta.2302-02";
|
|
1150
1192
|
var instanceName = "." + newId(6);
|
|
1151
1193
|
var _dataUid = 0;
|
|
1152
1194
|
function createUniqueNamespace(name, includeVersion) {
|
|
@@ -1947,9 +1989,10 @@
|
|
|
1947
1989
|
var _DYN_COUNT = "count";
|
|
1948
1990
|
var _DYN_PRE_TRIGGER_DATE = "preTriggerDate";
|
|
1949
1991
|
var _DYN_DISABLED = "disabled";
|
|
1992
|
+
var _DYN_INTERVAL = "interval";
|
|
1993
|
+
var _DYN_DAYS_OF_MONTH = "daysOfMonth";
|
|
1950
1994
|
var _DYN_DATE = "date";
|
|
1951
1995
|
var _DYN_GET_UTCDATE = "getUTCDate";
|
|
1952
|
-
var _DYN_MAX_TIMES_PER_MONTH = "maxTimesPerMonth";
|
|
1953
1996
|
var _DYN_STRINGIFY = "stringify";
|
|
1954
1997
|
var _DYN_PATHNAME = "pathname";
|
|
1955
1998
|
var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns";
|
|
@@ -2487,6 +2530,7 @@
|
|
|
2487
2530
|
var _namePrefix;
|
|
2488
2531
|
var _queue;
|
|
2489
2532
|
var _isReady = false;
|
|
2533
|
+
var _isSpecificDaysGiven = false;
|
|
2490
2534
|
_initConfig();
|
|
2491
2535
|
_self.getConfig = function () {
|
|
2492
2536
|
return _config;
|
|
@@ -2560,7 +2604,7 @@
|
|
|
2560
2604
|
return null;
|
|
2561
2605
|
};
|
|
2562
2606
|
function _initConfig() {
|
|
2563
|
-
var _a, _b
|
|
2607
|
+
var _a, _b;
|
|
2564
2608
|
_canUseLocalStorage = utlCanUseLocalStorage();
|
|
2565
2609
|
_logger = safeGetLogger(core);
|
|
2566
2610
|
_isTriggered = false;
|
|
@@ -2570,15 +2614,12 @@
|
|
|
2570
2614
|
_config = {};
|
|
2571
2615
|
_config[_DYN_DISABLED ] = !!configMgr[_DYN_DISABLED ];
|
|
2572
2616
|
_config.msgKey = configMgr.msgKey;
|
|
2573
|
-
var
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
maxTimesPerMonth: ((_c = configMgr.interval) === null || _c === void 0 ? void 0 : _c.maxTimesPerMonth) || 1
|
|
2577
|
-
};
|
|
2578
|
-
_config.interval = interval;
|
|
2617
|
+
var configInterval = configMgr[_DYN_INTERVAL ] || {};
|
|
2618
|
+
_isSpecificDaysGiven = (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth) && (configInterval === null || configInterval === void 0 ? void 0 : configInterval.daysOfMonth[_DYN_LENGTH ]) > 0;
|
|
2619
|
+
_config[_DYN_INTERVAL ] = _getIntervalConfig(configInterval);
|
|
2579
2620
|
var limit = {
|
|
2580
|
-
samplingRate: ((
|
|
2581
|
-
maxSendNumber: ((
|
|
2621
|
+
samplingRate: ((_a = configMgr.limit) === null || _a === void 0 ? void 0 : _a.samplingRate) || 100,
|
|
2622
|
+
maxSendNumber: ((_b = configMgr.limit) === null || _b === void 0 ? void 0 : _b.maxSendNumber) || 1
|
|
2582
2623
|
};
|
|
2583
2624
|
_config.limit = limit;
|
|
2584
2625
|
_localStorageName = _getLocalStorageName(_config.msgKey, _namePrefix);
|
|
@@ -2589,15 +2630,43 @@
|
|
|
2589
2630
|
_isTriggered = _isTriggeredOnCurDate(_localStorageObj[_DYN_PRE_TRIGGER_DATE ]);
|
|
2590
2631
|
}
|
|
2591
2632
|
}
|
|
2633
|
+
function _getIntervalConfig(interval) {
|
|
2634
|
+
interval = interval || {};
|
|
2635
|
+
var monthInterval = interval === null || interval === void 0 ? void 0 : interval.monthInterval;
|
|
2636
|
+
var dayInterval = interval === null || interval === void 0 ? void 0 : interval.dayInterval;
|
|
2637
|
+
if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) {
|
|
2638
|
+
interval.monthInterval = 3;
|
|
2639
|
+
if (!_isSpecificDaysGiven) {
|
|
2640
|
+
interval[_DYN_DAYS_OF_MONTH ] = [28];
|
|
2641
|
+
_isSpecificDaysGiven = true;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
interval = {
|
|
2645
|
+
monthInterval: interval === null || interval === void 0 ? void 0 : interval.monthInterval,
|
|
2646
|
+
dayInterval: interval === null || interval === void 0 ? void 0 : interval.dayInterval,
|
|
2647
|
+
daysOfMonth: interval === null || interval === void 0 ? void 0 : interval.daysOfMonth
|
|
2648
|
+
};
|
|
2649
|
+
return interval;
|
|
2650
|
+
}
|
|
2592
2651
|
function _canThrottle(config, canUseLocalStorage, localStorageObj) {
|
|
2593
2652
|
if (!config[_DYN_DISABLED ] && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
|
|
2594
2653
|
var curDate = _getThrottleDate();
|
|
2595
2654
|
var date = localStorageObj[_DYN_DATE ];
|
|
2596
|
-
var interval = config
|
|
2597
|
-
var
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2655
|
+
var interval = config[_DYN_INTERVAL ];
|
|
2656
|
+
var monthCheck = 1;
|
|
2657
|
+
if (interval === null || interval === void 0 ? void 0 : interval.monthInterval) {
|
|
2658
|
+
var monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();
|
|
2659
|
+
monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);
|
|
2660
|
+
}
|
|
2661
|
+
var dayCheck = 1;
|
|
2662
|
+
if (_isSpecificDaysGiven) {
|
|
2663
|
+
dayCheck = arrIndexOf(interval[_DYN_DAYS_OF_MONTH ], curDate[_DYN_GET_UTCDATE ]());
|
|
2664
|
+
}
|
|
2665
|
+
else if (interval === null || interval === void 0 ? void 0 : interval.dayInterval) {
|
|
2666
|
+
var daySpan = Math.floor((curDate.getTime() - date.getTime()) / 86400000);
|
|
2667
|
+
dayCheck = _checkInterval(interval.dayInterval, 0, daySpan);
|
|
2668
|
+
}
|
|
2669
|
+
return monthCheck >= 0 && dayCheck >= 0;
|
|
2601
2670
|
}
|
|
2602
2671
|
return false;
|
|
2603
2672
|
}
|