@splitsoftware/splitio-commons 0.1.1-canary.9 → 0.1.1-rc.18
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/cjs/evaluator/matchers/matcherTypes.js +4 -4
- package/cjs/evaluator/matchersTransform/index.js +11 -11
- package/cjs/evaluator/value/sanitize.js +6 -6
- package/cjs/listeners/browser.js +1 -2
- package/cjs/listeners/node.js +0 -3
- package/cjs/logger/constants.js +3 -1
- package/cjs/logger/messages/error.js +3 -2
- package/cjs/logger/messages/info.js +2 -2
- package/cjs/logger/messages/warn.js +2 -1
- package/cjs/readiness/readinessManager.js +10 -7
- package/cjs/sdkFactory/index.js +1 -4
- package/cjs/services/splitApi.js +1 -1
- package/cjs/services/splitHttpClient.js +5 -4
- package/cjs/storages/AbstractSplitsCacheSync.js +1 -1
- package/cjs/storages/inLocalStorage/index.js +5 -2
- package/cjs/storages/inMemory/InMemoryStorage.js +2 -0
- package/cjs/storages/inMemory/InMemoryStorageCS.js +2 -0
- package/cjs/storages/inRedis/SplitsCacheInRedis.js +6 -2
- package/cjs/storages/inRedis/index.js +5 -2
- package/cjs/storages/pluggable/SplitsCachePluggable.js +6 -2
- package/cjs/storages/pluggable/inMemoryWrapper.js +6 -7
- package/cjs/storages/pluggable/index.js +5 -2
- package/cjs/storages/pluggable/wrapperAdapter.js +0 -1
- package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +92 -89
- package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +45 -42
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +14 -4
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +30 -10
- package/cjs/sync/streaming/SSEClient/index.js +0 -11
- package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
- package/cjs/sync/streaming/SSEHandler/NotificationParser.js +4 -1
- package/cjs/sync/streaming/SSEHandler/index.js +8 -9
- package/cjs/sync/streaming/SSEHandler/types.js +14 -0
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
- package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
- package/cjs/sync/streaming/constants.js +3 -1
- package/cjs/sync/streaming/mySegmentsV2utils.js +75 -0
- package/cjs/sync/streaming/pushManager.js +141 -40
- package/cjs/sync/submitters/metricsSyncTask.js +1 -1
- package/cjs/sync/submitters/submitterSyncTask.js +2 -2
- package/cjs/sync/syncManagerFromFile.js +15 -0
- package/cjs/sync/syncManagerFromObject.js +14 -0
- package/cjs/sync/syncManagerOffline.js +3 -3
- package/cjs/sync/syncManagerOnline.js +5 -3
- package/cjs/trackers/impressionObserver/ImpressionObserver.js +0 -2
- package/cjs/trackers/impressionObserver/buildKey.js +3 -9
- package/cjs/trackers/impressionObserver/impressionObserverCS.js +2 -2
- package/cjs/trackers/impressionObserver/impressionObserverSS.js +3 -3
- package/cjs/utils/constants/index.js +4 -1
- package/cjs/utils/decompress/index.js +427 -0
- package/cjs/utils/murmur3/{commons.js → common.js} +2 -6
- package/cjs/utils/murmur3/murmur3.js +11 -12
- package/cjs/utils/murmur3/murmur3_128.js +7 -142
- package/cjs/utils/murmur3/murmur3_128_x86.js +154 -0
- package/cjs/utils/murmur3/murmur3_64.js +36 -0
- package/cjs/utils/murmur3/utfx.js +100 -106
- package/cjs/utils/promise/wrapper.js +14 -11
- package/cjs/utils/settingsValidation/index.js +5 -2
- package/cjs/utils/settingsValidation/localhost/index.js +20 -0
- package/cjs/utils/settingsValidation/splitFilters.js +0 -1
- package/cjs/utils/settingsValidation/storage/storageCS.js +18 -8
- package/cjs/utils/settingsValidation/url.js +1 -1
- package/esm/evaluator/matchers/matcherTypes.js +2 -2
- package/esm/evaluator/matchersTransform/index.js +12 -12
- package/esm/evaluator/value/sanitize.js +7 -7
- package/esm/listeners/browser.js +1 -2
- package/esm/listeners/node.js +0 -3
- package/esm/logger/constants.js +2 -0
- package/esm/logger/messages/error.js +3 -2
- package/esm/logger/messages/info.js +2 -2
- package/esm/logger/messages/warn.js +2 -1
- package/esm/readiness/readinessManager.js +10 -7
- package/esm/sdkFactory/index.js +1 -4
- package/esm/services/splitApi.js +1 -1
- package/esm/services/splitHttpClient.js +5 -4
- package/esm/storages/AbstractSplitsCacheSync.js +1 -1
- package/esm/storages/inLocalStorage/index.js +5 -2
- package/esm/storages/inMemory/InMemoryStorage.js +2 -0
- package/esm/storages/inMemory/InMemoryStorageCS.js +2 -0
- package/esm/storages/inRedis/SplitsCacheInRedis.js +6 -2
- package/esm/storages/inRedis/index.js +5 -2
- package/esm/storages/pluggable/SplitsCachePluggable.js +6 -2
- package/esm/storages/pluggable/inMemoryWrapper.js +6 -7
- package/esm/storages/pluggable/index.js +5 -2
- package/esm/storages/pluggable/wrapperAdapter.js +0 -1
- package/esm/sync/offline/splitsParser/splitsParserFromFile.js +90 -88
- package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +43 -41
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +15 -5
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +30 -10
- package/esm/sync/streaming/SSEClient/index.js +0 -11
- package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
- package/esm/sync/streaming/SSEHandler/NotificationParser.js +4 -1
- package/esm/sync/streaming/SSEHandler/index.js +9 -10
- package/esm/sync/streaming/SSEHandler/types.js +13 -1
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
- package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
- package/esm/sync/streaming/constants.js +2 -0
- package/esm/sync/streaming/mySegmentsV2utils.js +69 -0
- package/esm/sync/streaming/pushManager.js +143 -42
- package/esm/sync/submitters/metricsSyncTask.js +1 -1
- package/esm/sync/submitters/submitterSyncTask.js +2 -2
- package/esm/sync/syncManagerFromFile.js +11 -0
- package/esm/sync/syncManagerFromObject.js +10 -0
- package/esm/sync/syncManagerOffline.js +3 -3
- package/esm/sync/syncManagerOnline.js +5 -3
- package/esm/trackers/impressionObserver/ImpressionObserver.js +0 -2
- package/esm/trackers/impressionObserver/buildKey.js +2 -9
- package/esm/trackers/impressionObserver/impressionObserverCS.js +2 -2
- package/esm/trackers/impressionObserver/impressionObserverSS.js +3 -3
- package/esm/utils/constants/index.js +3 -0
- package/esm/utils/decompress/index.js +424 -0
- package/esm/utils/murmur3/{commons.js → common.js} +1 -4
- package/esm/utils/murmur3/murmur3.js +1 -2
- package/esm/utils/murmur3/murmur3_128.js +7 -142
- package/esm/utils/murmur3/murmur3_128_x86.js +150 -0
- package/esm/utils/murmur3/murmur3_64.js +32 -0
- package/esm/utils/murmur3/utfx.js +96 -106
- package/esm/utils/promise/wrapper.js +14 -11
- package/esm/utils/settingsValidation/index.js +5 -2
- package/esm/utils/settingsValidation/localhost/index.js +16 -0
- package/esm/utils/settingsValidation/splitFilters.js +0 -1
- package/esm/utils/settingsValidation/storage/storageCS.js +16 -7
- package/esm/utils/settingsValidation/url.js +1 -1
- package/package.json +5 -5
- package/src/evaluator/matchers/matcherTypes.ts +2 -2
- package/src/evaluator/matchersTransform/index.ts +12 -12
- package/src/evaluator/value/sanitize.ts +7 -7
- package/src/listeners/browser.ts +1 -1
- package/src/listeners/node.ts +1 -2
- package/src/logger/constants.ts +2 -0
- package/src/logger/messages/error.ts +3 -2
- package/src/logger/messages/info.ts +2 -2
- package/src/logger/messages/warn.ts +3 -1
- package/src/readiness/readinessManager.ts +9 -7
- package/src/sdkFactory/index.ts +1 -3
- package/src/sdkFactory/types.ts +3 -3
- package/src/services/splitApi.ts +2 -3
- package/src/services/splitHttpClient.ts +6 -5
- package/src/services/types.ts +5 -5
- package/src/storages/AbstractSplitsCacheSync.ts +1 -1
- package/src/storages/inLocalStorage/index.ts +8 -4
- package/src/storages/inMemory/InMemoryStorage.ts +3 -0
- package/src/storages/inMemory/InMemoryStorageCS.ts +3 -0
- package/src/storages/inRedis/SplitsCacheInRedis.ts +3 -1
- package/src/storages/inRedis/index.ts +8 -4
- package/src/storages/pluggable/SplitsCachePluggable.ts +3 -1
- package/src/storages/pluggable/inMemoryWrapper.ts +6 -7
- package/src/storages/pluggable/index.ts +8 -4
- package/src/storages/pluggable/wrapperAdapter.ts +0 -1
- package/src/storages/types.ts +18 -15
- package/src/sync/offline/splitsParser/splitsParserFromFile.ts +110 -105
- package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +45 -41
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +15 -5
- package/src/sync/polling/types.ts +2 -1
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +28 -10
- package/src/sync/streaming/AuthClient/types.ts +3 -0
- package/src/sync/streaming/SSEClient/index.ts +1 -15
- package/src/sync/streaming/SSEClient/types.ts +0 -1
- package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +8 -0
- package/src/sync/streaming/SSEHandler/NotificationParser.ts +4 -2
- package/src/sync/streaming/SSEHandler/index.ts +11 -20
- package/src/sync/streaming/SSEHandler/types.ts +37 -3
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +7 -6
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -1
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +4 -3
- package/src/sync/streaming/UpdateWorkers/types.ts +1 -1
- package/src/sync/streaming/constants.ts +2 -0
- package/src/sync/streaming/mySegmentsV2utils.ts +77 -0
- package/src/sync/streaming/pushManager.ts +139 -42
- package/src/sync/streaming/types.ts +14 -22
- package/src/sync/submitters/metricsSyncTask.ts +1 -1
- package/src/sync/submitters/submitterSyncTask.ts +2 -1
- package/src/sync/syncManagerFromFile.ts +13 -0
- package/src/sync/syncManagerFromObject.ts +12 -0
- package/src/sync/syncManagerOffline.ts +3 -3
- package/src/sync/syncManagerOnline.ts +6 -3
- package/src/trackers/impressionObserver/ImpressionObserver.ts +4 -6
- package/src/trackers/impressionObserver/buildKey.ts +2 -16
- package/src/trackers/impressionObserver/impressionObserverCS.ts +2 -2
- package/src/trackers/impressionObserver/impressionObserverSS.ts +3 -3
- package/src/types.ts +16 -2
- package/src/utils/constants/index.ts +6 -1
- package/src/utils/decompress/index.ts +429 -0
- package/src/utils/murmur3/{commons.ts → common.ts} +1 -5
- package/src/utils/murmur3/murmur3.ts +5 -5
- package/src/utils/murmur3/murmur3_128.ts +7 -180
- package/src/utils/murmur3/murmur3_128_x86.ts +188 -0
- package/src/utils/murmur3/murmur3_64.ts +36 -0
- package/src/utils/murmur3/utfx.ts +92 -110
- package/src/utils/promise/wrapper.ts +12 -9
- package/src/utils/settingsValidation/index.ts +8 -4
- package/src/utils/settingsValidation/localhost/index.ts +19 -0
- package/src/utils/settingsValidation/splitFilters.ts +0 -1
- package/src/utils/settingsValidation/storage/storageCS.ts +21 -8
- package/src/utils/settingsValidation/types.ts +2 -11
- package/src/utils/settingsValidation/url.ts +1 -1
- package/types/evaluator/matchers/matcherTypes.d.ts +2 -2
- package/types/listeners/browser.d.ts +1 -0
- package/types/listeners/node.d.ts +0 -1
- package/types/logger/constants.d.ts +2 -0
- package/types/sdkFactory/types.d.ts +3 -3
- package/types/services/types.d.ts +1 -0
- package/types/storages/inLocalStorage/index.d.ts +2 -2
- package/types/storages/inMemory/InMemoryStorage.d.ts +3 -0
- package/types/storages/inMemory/InMemoryStorageCS.d.ts +3 -0
- package/types/storages/inRedis/index.d.ts +2 -2
- package/types/storages/pluggable/index.d.ts +2 -2
- package/types/storages/types.d.ts +15 -15
- package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +2 -7
- package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +1 -5
- package/types/sync/polling/types.d.ts +2 -1
- package/types/sync/streaming/AuthClient/indexV1.d.ts +12 -0
- package/types/sync/streaming/AuthClient/indexV2.d.ts +8 -0
- package/types/sync/streaming/AuthClient/types.d.ts +2 -0
- package/types/sync/streaming/SSEClient/index.d.ts +1 -9
- package/types/sync/streaming/SSEClient/types.d.ts +0 -1
- package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +3 -2
- package/types/sync/streaming/SSEHandler/types.d.ts +30 -2
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +4 -3
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -1
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +3 -2
- package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -1
- package/types/sync/streaming/constants.d.ts +3 -1
- package/types/sync/streaming/mySegmentsV2utils.d.ts +27 -0
- package/types/sync/streaming/pushManagerNoUsers.d.ts +13 -0
- package/types/sync/streaming/types.d.ts +9 -5
- package/types/sync/submitters/submitterSyncTask.d.ts +1 -1
- package/types/sync/syncManagerFromFile.d.ts +2 -0
- package/types/sync/syncManagerFromObject.d.ts +2 -0
- package/types/sync/syncManagerOffline.d.ts +1 -1
- package/types/trackers/impressionObserver/ImpressionObserver.d.ts +2 -2
- package/types/trackers/impressionObserver/buildKey.d.ts +1 -1
- package/types/trackers/impressionObserver/impressionObserverCS.d.ts +2 -2
- package/types/trackers/impressionObserver/impressionObserverSS.d.ts +2 -2
- package/types/types.d.ts +16 -2
- package/types/utils/constants/index.d.ts +5 -1
- package/types/utils/decompress/index.d.ts +16 -0
- package/types/utils/murmur3/common.d.ts +12 -0
- package/types/utils/murmur3/murmur3.d.ts +2 -2
- package/types/utils/murmur3/murmur3_128.d.ts +5 -0
- package/types/utils/murmur3/murmur3_128_x86.d.ts +7 -0
- package/types/utils/murmur3/murmur3_64.d.ts +10 -0
- package/types/utils/murmur3/utfx.d.ts +24 -6
- package/types/utils/settingsValidation/index.d.ts +3 -2
- package/types/utils/settingsValidation/localhost/index.d.ts +9 -0
- package/types/utils/settingsValidation/storage/storageCS.d.ts +7 -1
- package/types/utils/settingsValidation/types.d.ts +2 -10
- package/cjs/sync/streaming/pushManagerCS.js +0 -179
- package/cjs/sync/streaming/pushManagerSS.js +0 -128
- package/esm/sync/streaming/pushManagerCS.js +0 -175
- package/esm/sync/streaming/pushManagerSS.js +0 -124
- package/src/sync/streaming/pushManagerCS.ts +0 -238
- package/src/sync/streaming/pushManagerSS.ts +0 -177
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* eslint-disable no-fallthrough */
|
|
2
|
+
import { UTF16ToUTF8, x86Fmix, x86Multiply, x86Rotl } from './common';
|
|
3
|
+
/*!
|
|
4
|
+
* +----------------------------------------------------------------------------------+
|
|
5
|
+
* | murmurHash3.js v3.0.0 (http://github.com/karanlyons/murmurHash3.js) |
|
|
6
|
+
* | A TypeScript/JavaScript implementation of MurmurHash3's hashing algorithms. |
|
|
7
|
+
* |----------------------------------------------------------------------------------|
|
|
8
|
+
* | Copyright (c) 2012-2020 Karan Lyons. Freely distributable under the MIT license. |
|
|
9
|
+
* +----------------------------------------------------------------------------------+
|
|
10
|
+
*/
|
|
11
|
+
// PUBLIC FUNCTIONS
|
|
12
|
+
// ----------------
|
|
13
|
+
function hash128x86(key, seed) {
|
|
14
|
+
//
|
|
15
|
+
// Given a string and an optional seed as an int, returns a 128 bit
|
|
16
|
+
// hash using the x86 flavor of MurmurHash3, as an unsigned hex.
|
|
17
|
+
//
|
|
18
|
+
key = key || '';
|
|
19
|
+
seed = seed || 0;
|
|
20
|
+
var remainder = key.length % 16;
|
|
21
|
+
var bytes = key.length - remainder;
|
|
22
|
+
var h1 = seed;
|
|
23
|
+
var h2 = seed;
|
|
24
|
+
var h3 = seed;
|
|
25
|
+
var h4 = seed;
|
|
26
|
+
var k1 = 0;
|
|
27
|
+
var k2 = 0;
|
|
28
|
+
var k3 = 0;
|
|
29
|
+
var k4 = 0;
|
|
30
|
+
var c1 = 0x239b961b;
|
|
31
|
+
var c2 = 0xab0e9789;
|
|
32
|
+
var c3 = 0x38b34ae5;
|
|
33
|
+
var c4 = 0xa1e38b93;
|
|
34
|
+
for (var i = 0; i < bytes; i = i + 16) {
|
|
35
|
+
k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);
|
|
36
|
+
k2 = ((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24);
|
|
37
|
+
k3 = ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24);
|
|
38
|
+
k4 = ((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24);
|
|
39
|
+
k1 = x86Multiply(k1, c1);
|
|
40
|
+
k1 = x86Rotl(k1, 15);
|
|
41
|
+
k1 = x86Multiply(k1, c2);
|
|
42
|
+
h1 ^= k1;
|
|
43
|
+
h1 = x86Rotl(h1, 19);
|
|
44
|
+
h1 += h2;
|
|
45
|
+
h1 = x86Multiply(h1, 5) + 0x561ccd1b;
|
|
46
|
+
k2 = x86Multiply(k2, c2);
|
|
47
|
+
k2 = x86Rotl(k2, 16);
|
|
48
|
+
k2 = x86Multiply(k2, c3);
|
|
49
|
+
h2 ^= k2;
|
|
50
|
+
h2 = x86Rotl(h2, 17);
|
|
51
|
+
h2 += h3;
|
|
52
|
+
h2 = x86Multiply(h2, 5) + 0x0bcaa747;
|
|
53
|
+
k3 = x86Multiply(k3, c3);
|
|
54
|
+
k3 = x86Rotl(k3, 17);
|
|
55
|
+
k3 = x86Multiply(k3, c4);
|
|
56
|
+
h3 ^= k3;
|
|
57
|
+
h3 = x86Rotl(h3, 15);
|
|
58
|
+
h3 += h4;
|
|
59
|
+
h3 = x86Multiply(h3, 5) + 0x96cd1c35;
|
|
60
|
+
k4 = x86Multiply(k4, c4);
|
|
61
|
+
k4 = x86Rotl(k4, 18);
|
|
62
|
+
k4 = x86Multiply(k4, c1);
|
|
63
|
+
h4 ^= k4;
|
|
64
|
+
h4 = x86Rotl(h4, 13);
|
|
65
|
+
h4 += h1;
|
|
66
|
+
h4 = x86Multiply(h4, 5) + 0x32ac3b17;
|
|
67
|
+
}
|
|
68
|
+
k1 = 0;
|
|
69
|
+
k2 = 0;
|
|
70
|
+
k3 = 0;
|
|
71
|
+
k4 = 0;
|
|
72
|
+
switch (remainder) {
|
|
73
|
+
case 15:
|
|
74
|
+
k4 ^= key.charCodeAt(i + 14) << 16;
|
|
75
|
+
case 14:
|
|
76
|
+
k4 ^= key.charCodeAt(i + 13) << 8;
|
|
77
|
+
case 13:
|
|
78
|
+
k4 ^= key.charCodeAt(i + 12);
|
|
79
|
+
k4 = x86Multiply(k4, c4);
|
|
80
|
+
k4 = x86Rotl(k4, 18);
|
|
81
|
+
k4 = x86Multiply(k4, c1);
|
|
82
|
+
h4 ^= k4;
|
|
83
|
+
case 12:
|
|
84
|
+
k3 ^= key.charCodeAt(i + 11) << 24;
|
|
85
|
+
case 11:
|
|
86
|
+
k3 ^= key.charCodeAt(i + 10) << 16;
|
|
87
|
+
case 10:
|
|
88
|
+
k3 ^= key.charCodeAt(i + 9) << 8;
|
|
89
|
+
case 9:
|
|
90
|
+
k3 ^= key.charCodeAt(i + 8);
|
|
91
|
+
k3 = x86Multiply(k3, c3);
|
|
92
|
+
k3 = x86Rotl(k3, 17);
|
|
93
|
+
k3 = x86Multiply(k3, c4);
|
|
94
|
+
h3 ^= k3;
|
|
95
|
+
case 8:
|
|
96
|
+
k2 ^= key.charCodeAt(i + 7) << 24;
|
|
97
|
+
case 7:
|
|
98
|
+
k2 ^= key.charCodeAt(i + 6) << 16;
|
|
99
|
+
case 6:
|
|
100
|
+
k2 ^= key.charCodeAt(i + 5) << 8;
|
|
101
|
+
case 5:
|
|
102
|
+
k2 ^= key.charCodeAt(i + 4);
|
|
103
|
+
k2 = x86Multiply(k2, c2);
|
|
104
|
+
k2 = x86Rotl(k2, 16);
|
|
105
|
+
k2 = x86Multiply(k2, c3);
|
|
106
|
+
h2 ^= k2;
|
|
107
|
+
case 4:
|
|
108
|
+
k1 ^= key.charCodeAt(i + 3) << 24;
|
|
109
|
+
case 3:
|
|
110
|
+
k1 ^= key.charCodeAt(i + 2) << 16;
|
|
111
|
+
case 2:
|
|
112
|
+
k1 ^= key.charCodeAt(i + 1) << 8;
|
|
113
|
+
case 1:
|
|
114
|
+
k1 ^= key.charCodeAt(i);
|
|
115
|
+
k1 = x86Multiply(k1, c1);
|
|
116
|
+
k1 = x86Rotl(k1, 15);
|
|
117
|
+
k1 = x86Multiply(k1, c2);
|
|
118
|
+
h1 ^= k1;
|
|
119
|
+
}
|
|
120
|
+
h1 ^= key.length;
|
|
121
|
+
h2 ^= key.length;
|
|
122
|
+
h3 ^= key.length;
|
|
123
|
+
h4 ^= key.length;
|
|
124
|
+
h1 += h2;
|
|
125
|
+
h1 += h3;
|
|
126
|
+
h1 += h4;
|
|
127
|
+
h2 += h1;
|
|
128
|
+
h3 += h1;
|
|
129
|
+
h4 += h1;
|
|
130
|
+
h1 = x86Fmix(h1);
|
|
131
|
+
h2 = x86Fmix(h2);
|
|
132
|
+
h3 = x86Fmix(h3);
|
|
133
|
+
h4 = x86Fmix(h4);
|
|
134
|
+
h1 += h2;
|
|
135
|
+
h1 += h3;
|
|
136
|
+
h1 += h4;
|
|
137
|
+
h2 += h1;
|
|
138
|
+
h3 += h1;
|
|
139
|
+
h4 += h1;
|
|
140
|
+
return ('00000000' + (h1 >>> 0).toString(16)).slice(-8) + ('00000000' + (h2 >>> 0).toString(16)).slice(-8) + ('00000000' + (h3 >>> 0).toString(16)).slice(-8) + ('00000000' + (h4 >>> 0).toString(16)).slice(-8);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* x86 version of Murmur3 for 128bits.
|
|
144
|
+
* Used by hashImpression128 because in JS it is more efficient than the x64 version, no matter the underlying OS/CPU arch.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} str
|
|
147
|
+
*/
|
|
148
|
+
export function hash128(str, seed) {
|
|
149
|
+
return hash128x86(UTF16ToUTF8(str), seed >>> 0);
|
|
150
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { hash128 } from './murmur3_128';
|
|
2
|
+
/**
|
|
3
|
+
* Use instead of parseInt, to not lose precision when converting big integers (greater than 2^53 - 1)
|
|
4
|
+
*/
|
|
5
|
+
function hex2dec(s) {
|
|
6
|
+
var i, j, digits = [0], carry;
|
|
7
|
+
for (i = 0; i < s.length; i += 1) {
|
|
8
|
+
carry = parseInt(s.charAt(i), 16);
|
|
9
|
+
for (j = digits.length - 1; j >= 0; j -= 1) {
|
|
10
|
+
digits[j] = digits[j] * 16 + carry;
|
|
11
|
+
carry = digits[j] / 10 | 0;
|
|
12
|
+
digits[j] %= 10;
|
|
13
|
+
}
|
|
14
|
+
while (carry > 0) {
|
|
15
|
+
digits.unshift(carry % 10);
|
|
16
|
+
carry = carry / 10 | 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return digits.join('');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the higher 64 bits of the x64 version of Murmur3 for 128bits, as decimal and hexadecimal number strings.
|
|
23
|
+
* Used for MySegments channel V2 notifications.
|
|
24
|
+
* @param {string} str
|
|
25
|
+
*/
|
|
26
|
+
export function hash64(str) {
|
|
27
|
+
var hex = hash128(str).slice(0, 16);
|
|
28
|
+
return {
|
|
29
|
+
hex: hex,
|
|
30
|
+
dec: hex2dec(hex) // KeyList notification
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -6,114 +6,104 @@
|
|
|
6
6
|
Released under the Apache License, Version 2.0
|
|
7
7
|
see: https://github.com/dcodeIO/utfx for details
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if ((c1 = c2 !== null ? c2 : src()) === null)
|
|
53
|
-
break;
|
|
54
|
-
if (c1 >= 0xD800 && c1 <= 0xDFFF) {
|
|
55
|
-
if ((c2 = src()) !== null) {
|
|
56
|
-
if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
|
|
57
|
-
dst((c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000);
|
|
58
|
-
c2 = null;
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
* Encodes UTF8 code points to UTF8 bytes.
|
|
11
|
+
* @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point
|
|
12
|
+
* respectively `null` if there are no more code points left or a single numeric code point.
|
|
13
|
+
* @param {!function(number)} dst Bytes destination as a function successively called with the next byte
|
|
14
|
+
* @expose
|
|
15
|
+
*/
|
|
16
|
+
function encodeUTF8(src, dst) {
|
|
17
|
+
var cp = null;
|
|
18
|
+
if (typeof src === 'number')
|
|
19
|
+
cp = src, src = function () { return null; };
|
|
20
|
+
while (cp !== null || (cp = src()) !== null) {
|
|
21
|
+
if (cp < 0x80)
|
|
22
|
+
dst(cp & 0x7F);
|
|
23
|
+
else if (cp < 0x800)
|
|
24
|
+
dst(((cp >> 6) & 0x1F) | 0xC0), dst((cp & 0x3F) | 0x80);
|
|
25
|
+
else if (cp < 0x10000)
|
|
26
|
+
dst(((cp >> 12) & 0x0F) | 0xE0), dst(((cp >> 6) & 0x3F) | 0x80), dst((cp & 0x3F) | 0x80);
|
|
27
|
+
else
|
|
28
|
+
dst(((cp >> 18) & 0x07) | 0xF0), dst(((cp >> 12) & 0x3F) | 0x80), dst(((cp >> 6) & 0x3F) | 0x80), dst((cp & 0x3F) | 0x80);
|
|
29
|
+
cp = null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Converts UTF16 characters to UTF8 code points.
|
|
34
|
+
* @param {!function():number|null} src Characters source as a function returning the next char code respectively
|
|
35
|
+
* `null` if there are no more characters left.
|
|
36
|
+
* @param {!function(number)} dst Code points destination as a function successively called with each converted code
|
|
37
|
+
* point.
|
|
38
|
+
* @expose
|
|
39
|
+
*/
|
|
40
|
+
function UTF16toUTF8(src, dst) {
|
|
41
|
+
var c1, c2 = null;
|
|
42
|
+
// eslint-disable-next-line no-constant-condition
|
|
43
|
+
while (true) {
|
|
44
|
+
if ((c1 = c2 !== null ? c2 : src()) === null)
|
|
45
|
+
break;
|
|
46
|
+
if (c1 >= 0xD800 && c1 <= 0xDFFF) {
|
|
47
|
+
if ((c2 = src()) !== null) {
|
|
48
|
+
if (c2 >= 0xDC00 && c2 <= 0xDFFF) {
|
|
49
|
+
dst((c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000);
|
|
50
|
+
c2 = null;
|
|
51
|
+
continue;
|
|
61
52
|
}
|
|
62
53
|
}
|
|
63
|
-
dst(c1);
|
|
64
54
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
55
|
+
dst(c1);
|
|
56
|
+
}
|
|
57
|
+
if (c2 !== null)
|
|
58
|
+
dst(c2);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Converts and encodes UTF16 characters to UTF8 bytes.
|
|
62
|
+
* @param {!function():number|null} src Characters source as a function returning the next char code respectively `null`
|
|
63
|
+
* if there are no more characters left.
|
|
64
|
+
* @param {!function(number)} dst Bytes destination as a function successively called with the next byte.
|
|
65
|
+
* @expose
|
|
66
|
+
*/
|
|
67
|
+
export function encodeUTF16toUTF8(src, dst) {
|
|
68
|
+
UTF16toUTF8(src, function (cp) {
|
|
69
|
+
encodeUTF8(cp, dst);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* String.fromCharCode reference for compile time renaming.
|
|
74
|
+
* @type {!function(...[number]):string}
|
|
75
|
+
* @inner
|
|
76
|
+
*/
|
|
77
|
+
var stringFromCharCode = String.fromCharCode;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a source function for a string.
|
|
80
|
+
* @param {string} s String to read from
|
|
81
|
+
* @returns {!function():number|null} Source function returning the next char code respectively `null` if there are
|
|
82
|
+
* no more characters left.
|
|
83
|
+
* @throws {TypeError} If the argument is invalid
|
|
84
|
+
* @expose
|
|
85
|
+
*/
|
|
86
|
+
export function stringSource(s) {
|
|
87
|
+
if (typeof s !== 'string')
|
|
88
|
+
throw TypeError('Illegal argument: ' + (typeof s));
|
|
89
|
+
var i = 0;
|
|
90
|
+
return function () {
|
|
91
|
+
return i >= s.length ? null : s.charCodeAt(i++);
|
|
101
92
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Creates a destination function for a string.
|
|
96
|
+
* @returns {function(number=):undefined|string} Destination function successively called with the next char code.
|
|
97
|
+
* Returns the final string when called without arguments.
|
|
98
|
+
* @expose
|
|
99
|
+
*/
|
|
100
|
+
export function stringDestination() {
|
|
101
|
+
var cs = [], ps = [];
|
|
102
|
+
return function () {
|
|
103
|
+
if (arguments.length === 0)
|
|
104
|
+
return ps.join('') + stringFromCharCode.apply(String, cs);
|
|
105
|
+
if (cs.length + arguments.length > 1024)
|
|
106
|
+
ps.push(stringFromCharCode.apply(String, cs)), cs.length = 0; // @ts-ignore
|
|
107
|
+
Array.prototype.push.apply(cs, arguments);
|
|
117
108
|
};
|
|
118
|
-
|
|
119
|
-
})();
|
|
109
|
+
}
|
|
@@ -31,18 +31,21 @@ export default function promiseWrapper(customPromise, defaultOnRejected) {
|
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
var originalThen = newPromise.then;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
// Using `defineProperty` in case Promise.prototype.then property is not writable
|
|
35
|
+
Object.defineProperty(newPromise, 'then', {
|
|
36
|
+
value: function (onfulfilled, onrejected) {
|
|
37
|
+
var result = originalThen.call(newPromise, onfulfilled, onrejected);
|
|
38
|
+
if (typeof onfulfilled === 'function')
|
|
39
|
+
hasOnFulfilled = true;
|
|
40
|
+
if (typeof onrejected === 'function') {
|
|
41
|
+
hasOnRejected = true;
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return chain(result);
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
|
-
};
|
|
48
|
+
});
|
|
46
49
|
return newPromise;
|
|
47
50
|
}
|
|
48
51
|
var result = chain(customPromise);
|
|
@@ -61,7 +61,8 @@ var base = {
|
|
|
61
61
|
sync: {
|
|
62
62
|
splitFilters: undefined,
|
|
63
63
|
// impressions collection mode
|
|
64
|
-
impressionsMode: OPTIMIZED
|
|
64
|
+
impressionsMode: OPTIMIZED,
|
|
65
|
+
localhostMode: undefined
|
|
65
66
|
},
|
|
66
67
|
runtime: {
|
|
67
68
|
ip: false,
|
|
@@ -81,7 +82,7 @@ function fromSecondsToMillis(n) {
|
|
|
81
82
|
* @param validationParams defaults and fields validators used to validate and creates a settings object from a given config
|
|
82
83
|
*/
|
|
83
84
|
export function settingsValidation(config, validationParams) {
|
|
84
|
-
var defaults = validationParams.defaults, runtime = validationParams.runtime, storage = validationParams.storage, integrations = validationParams.integrations, logger = validationParams.logger;
|
|
85
|
+
var defaults = validationParams.defaults, runtime = validationParams.runtime, storage = validationParams.storage, integrations = validationParams.integrations, logger = validationParams.logger, localhost = validationParams.localhost;
|
|
85
86
|
// creates a settings object merging base, defaults and config objects.
|
|
86
87
|
var withDefaults = merge({}, base, defaults, config);
|
|
87
88
|
// ensure a valid logger.
|
|
@@ -119,6 +120,8 @@ export function settingsValidation(config, validationParams) {
|
|
|
119
120
|
// @ts-ignore, modify readonly prop
|
|
120
121
|
if (integrations)
|
|
121
122
|
withDefaults.integrations = integrations(withDefaults);
|
|
123
|
+
if (localhost)
|
|
124
|
+
withDefaults.sync.localhostMode = localhost(withDefaults);
|
|
122
125
|
// validate push options
|
|
123
126
|
if (withDefaults.streamingEnabled !== false) { // @ts-ignore, modify readonly prop
|
|
124
127
|
withDefaults.streamingEnabled = true;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ERROR_LOCALHOST_MODULE_REQUIRED } from '../../../logger/constants';
|
|
2
|
+
import { LOCALHOST_MODE } from '../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* This function validates `settings.storage` object
|
|
5
|
+
*
|
|
6
|
+
* @param {any} settings config object provided by the user to initialize the sdk
|
|
7
|
+
*
|
|
8
|
+
* @returns {Object} valid storage factory. It might be the default `InMemoryStorageCSFactory` if the provided storage is invalid.
|
|
9
|
+
*/
|
|
10
|
+
export function validateLocalhost(settings) {
|
|
11
|
+
var localhostMode = settings.sync.localhostMode;
|
|
12
|
+
if (settings.mode === LOCALHOST_MODE && (typeof localhostMode !== 'function' || localhostMode.type !== LOCALHOST_MODE)) {
|
|
13
|
+
settings.log.error(ERROR_LOCALHOST_MODULE_REQUIRED);
|
|
14
|
+
}
|
|
15
|
+
return localhostMode;
|
|
16
|
+
}
|
|
@@ -99,7 +99,6 @@ export function validateSplitFilters(log, maybeSplitFilters, mode) {
|
|
|
99
99
|
return res;
|
|
100
100
|
}
|
|
101
101
|
// Validate filters and group their values by filter type inside `groupedFilters` object
|
|
102
|
-
// Assign the valid filters to the output of the validator by using filter function
|
|
103
102
|
res.validFilters = maybeSplitFilters.filter(function (filter, index) {
|
|
104
103
|
if (filter && validateFilterType(filter.type) && Array.isArray(filter.values)) {
|
|
105
104
|
res.groupedFilters[filter.type] = res.groupedFilters[filter.type].concat(filter.values);
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { InMemoryStorageCSFactory } from '../../../storages/inMemory/InMemoryStorageCS';
|
|
2
2
|
import { WARN_STORAGE_INVALID } from '../../../logger/constants';
|
|
3
|
+
import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE, STORAGE_MEMORY } from '../../../utils/constants';
|
|
4
|
+
export function __InLocalStorageMockFactory(params) {
|
|
5
|
+
var result = InMemoryStorageCSFactory(params);
|
|
6
|
+
result.splits.checkCache = function () { return true; }; // to emit SDK_READY_FROM_CACHE
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
9
|
+
__InLocalStorageMockFactory.type = STORAGE_MEMORY;
|
|
3
10
|
/**
|
|
4
11
|
* This function validates `settings.storage` object
|
|
5
12
|
*
|
|
@@ -8,14 +15,16 @@ import { WARN_STORAGE_INVALID } from '../../../logger/constants';
|
|
|
8
15
|
* @returns {Object} valid storage factory. It might be the default `InMemoryStorageCSFactory` if the provided storage is invalid.
|
|
9
16
|
*/
|
|
10
17
|
export function validateStorageCS(settings) {
|
|
11
|
-
var
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (typeof storage === 'function')
|
|
16
|
-
return storage;
|
|
18
|
+
var _a = settings.storage, storage = _a === void 0 ? InMemoryStorageCSFactory : _a, log = settings.log, mode = settings.mode;
|
|
19
|
+
// If an invalid storage is provided, fallback into MEMORY
|
|
20
|
+
if (typeof storage !== 'function' || storage.type !== STORAGE_MEMORY && storage.type !== STORAGE_LOCALSTORAGE) {
|
|
21
|
+
storage = InMemoryStorageCSFactory;
|
|
17
22
|
log.warn(WARN_STORAGE_INVALID);
|
|
18
23
|
}
|
|
24
|
+
// In localhost mode with InLocalStorage, fallback to a mock InLocalStorage to emit SDK_READY_FROM_CACHE
|
|
25
|
+
if (mode === LOCALHOST_MODE && storage.type === STORAGE_LOCALSTORAGE) {
|
|
26
|
+
return __InLocalStorageMockFactory;
|
|
27
|
+
}
|
|
19
28
|
// return default InMemory storage if provided one is not valid
|
|
20
|
-
return
|
|
29
|
+
return storage;
|
|
21
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-commons",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-rc.18",
|
|
4
4
|
"description": "Split Javascript SDK common components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/google.analytics": "0.0.40",
|
|
52
52
|
"@types/ioredis": "^4.14.1",
|
|
53
|
-
"@types/jest": "^
|
|
53
|
+
"@types/jest": "^27.0.0",
|
|
54
54
|
"@types/lodash": "^4.14.162",
|
|
55
55
|
"@types/node": "^14.14.7",
|
|
56
56
|
"@types/object-assign": "^4.0.30",
|
|
@@ -58,18 +58,18 @@
|
|
|
58
58
|
"@typescript-eslint/parser": "^4.2.0",
|
|
59
59
|
"cross-env": "^7.0.2",
|
|
60
60
|
"csv-streamify": "^4.0.0",
|
|
61
|
-
"eslint": "^7.
|
|
61
|
+
"eslint": "^7.32.0",
|
|
62
62
|
"eslint-plugin-compat": "3.7.0",
|
|
63
63
|
"fetch-mock": "^9.10.7",
|
|
64
64
|
"ioredis": "^4.26.0",
|
|
65
|
-
"jest": "^
|
|
65
|
+
"jest": "^27.2.3",
|
|
66
66
|
"jest-localstorage-mock": "^2.4.3",
|
|
67
67
|
"js-yaml": "^3.14.0",
|
|
68
68
|
"lodash": "^4.17.21",
|
|
69
69
|
"node-fetch": "^2.6.1",
|
|
70
70
|
"redis-server": "1.2.2",
|
|
71
71
|
"rimraf": "^3.0.2",
|
|
72
|
-
"ts-jest": "^
|
|
72
|
+
"ts-jest": "^27.0.5",
|
|
73
73
|
"typescript": "^4.0.2"
|
|
74
74
|
},
|
|
75
75
|
"sideEffects": false
|
|
@@ -19,7 +19,7 @@ export const matcherTypes: Record<string, number> = {
|
|
|
19
19
|
MATCHES_STRING: 17
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const
|
|
22
|
+
export const matcherDataTypes = {
|
|
23
23
|
BOOLEAN: 'BOOLEAN',
|
|
24
24
|
STRING: 'STRING',
|
|
25
25
|
NUMBER: 'NUMBER',
|
|
@@ -28,7 +28,7 @@ export const dataTypes = {
|
|
|
28
28
|
NOT_SPECIFIED: 'NOT_SPECIFIED'
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export function
|
|
31
|
+
export function matcherTypesMapper(matcherType: string) {
|
|
32
32
|
const type = matcherTypes[matcherType];
|
|
33
33
|
if (type) return type;
|
|
34
34
|
else return matcherTypes.UNDEFINED;
|