@splitsoftware/splitio-commons 1.0.1-rc.5 → 1.2.0

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.
Files changed (561) hide show
  1. package/CHANGES.txt +13 -3
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/cjs/evaluator/Engine.js +6 -5
  5. package/cjs/evaluator/combiners/and.js +4 -4
  6. package/cjs/evaluator/combiners/ifelseif.js +4 -3
  7. package/cjs/evaluator/condition/index.js +4 -3
  8. package/cjs/evaluator/index.js +7 -7
  9. package/cjs/evaluator/matchers/all.js +2 -1
  10. package/cjs/evaluator/matchers/between.js +2 -1
  11. package/cjs/evaluator/matchers/boolean.js +2 -1
  12. package/cjs/evaluator/matchers/cont_all.js +3 -2
  13. package/cjs/evaluator/matchers/cont_any.js +3 -2
  14. package/cjs/evaluator/matchers/cont_str.js +2 -1
  15. package/cjs/evaluator/matchers/dependency.js +4 -4
  16. package/cjs/evaluator/matchers/eq.js +2 -1
  17. package/cjs/evaluator/matchers/eq_set.js +2 -1
  18. package/cjs/evaluator/matchers/ew.js +2 -1
  19. package/cjs/evaluator/matchers/gte.js +2 -1
  20. package/cjs/evaluator/matchers/index.js +36 -36
  21. package/cjs/evaluator/matchers/lte.js +2 -1
  22. package/cjs/evaluator/matchers/part_of.js +3 -2
  23. package/cjs/evaluator/matchers/segment.js +5 -5
  24. package/cjs/evaluator/matchers/string.js +2 -1
  25. package/cjs/evaluator/matchers/sw.js +2 -1
  26. package/cjs/evaluator/matchers/whitelist.js +2 -1
  27. package/cjs/evaluator/matchersTransform/index.js +12 -12
  28. package/cjs/evaluator/matchersTransform/segment.js +3 -2
  29. package/cjs/evaluator/matchersTransform/set.js +3 -2
  30. package/cjs/evaluator/matchersTransform/unaryNumeric.js +3 -2
  31. package/cjs/evaluator/matchersTransform/whitelist.js +3 -2
  32. package/cjs/evaluator/parser/index.js +16 -16
  33. package/cjs/evaluator/treatments/index.js +2 -1
  34. package/cjs/evaluator/value/index.js +5 -5
  35. package/cjs/evaluator/value/sanitize.js +2 -1
  36. package/cjs/integrations/browser.js +4 -4
  37. package/cjs/integrations/ga/GaToSplit.js +3 -4
  38. package/cjs/integrations/pluggable.js +3 -2
  39. package/cjs/listeners/browser.js +4 -4
  40. package/cjs/listeners/node.js +4 -4
  41. package/cjs/logger/index.js +2 -3
  42. package/cjs/logger/messages/info.js +1 -1
  43. package/cjs/logger/messages/warn.js +2 -2
  44. package/cjs/readiness/readinessManager.js +3 -4
  45. package/cjs/readiness/sdkReadinessManager.js +7 -7
  46. package/cjs/sdkClient/client.js +5 -5
  47. package/cjs/sdkClient/clientAttributesDecoration.js +108 -0
  48. package/cjs/sdkClient/clientCS.js +12 -10
  49. package/cjs/sdkClient/clientInputValidation.js +5 -5
  50. package/cjs/sdkClient/sdkClient.js +5 -6
  51. package/cjs/sdkClient/sdkClientMethodCS.js +4 -5
  52. package/cjs/sdkClient/sdkClientMethodCSWithTT.js +4 -5
  53. package/cjs/sdkFactory/index.js +9 -10
  54. package/cjs/sdkManager/index.js +6 -7
  55. package/cjs/services/splitApi.js +2 -3
  56. package/cjs/services/splitHttpClient.js +3 -4
  57. package/cjs/storages/AbstractSegmentsCacheSync.js +2 -1
  58. package/cjs/storages/AbstractSplitsCacheAsync.js +2 -1
  59. package/cjs/storages/AbstractSplitsCacheSync.js +2 -2
  60. package/cjs/storages/KeyBuilder.js +2 -2
  61. package/cjs/storages/KeyBuilderCS.js +4 -3
  62. package/cjs/storages/KeyBuilderSS.js +4 -3
  63. package/cjs/storages/findLatencyIndex.js +2 -1
  64. package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +4 -3
  65. package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +4 -3
  66. package/cjs/storages/inLocalStorage/index.js +20 -21
  67. package/cjs/storages/inMemory/AttributesCacheInMemory.js +70 -0
  68. package/cjs/storages/inMemory/CountsCacheInMemory.js +2 -1
  69. package/cjs/storages/inMemory/EventsCacheInMemory.js +2 -1
  70. package/cjs/storages/inMemory/ImpressionCountsCacheInMemory.js +2 -1
  71. package/cjs/storages/inMemory/ImpressionsCacheInMemory.js +2 -1
  72. package/cjs/storages/inMemory/InMemoryStorage.js +10 -11
  73. package/cjs/storages/inMemory/InMemoryStorageCS.js +12 -13
  74. package/cjs/storages/inMemory/LatenciesCacheInMemory.js +4 -4
  75. package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +4 -3
  76. package/cjs/storages/inMemory/SegmentsCacheInMemory.js +4 -3
  77. package/cjs/storages/inMemory/SplitsCacheInMemory.js +4 -3
  78. package/cjs/storages/inRedis/CountsCacheInRedis.js +2 -1
  79. package/cjs/storages/inRedis/EventsCacheInRedis.js +2 -1
  80. package/cjs/storages/inRedis/ImpressionsCacheInRedis.js +2 -1
  81. package/cjs/storages/inRedis/LatenciesCacheInRedis.js +4 -4
  82. package/cjs/storages/inRedis/RedisAdapter.js +6 -5
  83. package/cjs/storages/inRedis/SegmentsCacheInRedis.js +2 -1
  84. package/cjs/storages/inRedis/SplitsCacheInRedis.js +4 -3
  85. package/cjs/storages/inRedis/index.js +16 -17
  86. package/cjs/storages/pluggable/SplitsCachePluggable.js +2 -2
  87. package/cjs/storages/pluggable/index.js +8 -8
  88. package/cjs/sync/offline/splitsParser/parseCondition.js +2 -1
  89. package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +3 -3
  90. package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +2 -3
  91. package/cjs/sync/offline/syncManagerOffline.js +3 -4
  92. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +4 -5
  93. package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +2 -1
  94. package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +2 -1
  95. package/cjs/sync/polling/fetchers/splitChangesFetcher.js +2 -1
  96. package/cjs/sync/polling/pollingManagerCS.js +6 -6
  97. package/cjs/sync/polling/pollingManagerSS.js +8 -8
  98. package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +5 -5
  99. package/cjs/sync/polling/syncTasks/segmentsSyncTask.js +5 -5
  100. package/cjs/sync/polling/syncTasks/splitsSyncTask.js +5 -5
  101. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +2 -3
  102. package/cjs/sync/polling/updaters/segmentChangesUpdater.js +2 -3
  103. package/cjs/sync/polling/updaters/splitChangesUpdater.js +8 -6
  104. package/cjs/sync/streaming/AuthClient/index.js +2 -3
  105. package/cjs/sync/streaming/SSEClient/index.js +2 -1
  106. package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +2 -1
  107. package/cjs/sync/streaming/SSEHandler/index.js +4 -4
  108. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +4 -4
  109. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +4 -4
  110. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +4 -4
  111. package/cjs/sync/streaming/pushManager.js +18 -17
  112. package/cjs/sync/submitters/submitterSyncTask.js +2 -3
  113. package/cjs/sync/syncTask.js +2 -1
  114. package/cjs/trackers/eventTracker.js +7 -7
  115. package/cjs/trackers/impressionObserver/ImpressionObserver.js +4 -4
  116. package/cjs/trackers/impressionObserver/impressionObserverCS.js +2 -3
  117. package/cjs/trackers/impressionObserver/impressionObserverSS.js +2 -3
  118. package/cjs/trackers/impressionsTracker.js +6 -6
  119. package/cjs/utils/Backoff.js +2 -1
  120. package/cjs/utils/LRUCache/index.js +2 -1
  121. package/cjs/utils/MinEventEmitter.js +2 -1
  122. package/cjs/utils/inputValidation/attribute.js +20 -0
  123. package/cjs/utils/inputValidation/attributes.js +13 -1
  124. package/cjs/utils/inputValidation/trafficTypeExistance.js +2 -3
  125. package/cjs/utils/lang/binarySearch.js +2 -1
  126. package/cjs/utils/lang/objectAssign.js +85 -0
  127. package/cjs/utils/promise/thenable.js +5 -1
  128. package/cjs/utils/promise/timeout.js +2 -1
  129. package/cjs/utils/promise/wrapper.js +2 -1
  130. package/cjs/utils/settingsValidation/impressionsMode.js +2 -1
  131. package/cjs/utils/settingsValidation/index.js +5 -6
  132. package/cjs/utils/settingsValidation/mode.js +2 -1
  133. package/cjs/utils/timeTracker/index.js +7 -8
  134. package/cjs/utils/timeTracker/now/browser.js +2 -2
  135. package/cjs/utils/timeTracker/now/node.js +2 -1
  136. package/cjs/utils/timeTracker/timer.js +3 -2
  137. package/esm/evaluator/Engine.js +3 -3
  138. package/esm/evaluator/combiners/and.js +2 -2
  139. package/esm/evaluator/combiners/ifelseif.js +2 -2
  140. package/esm/evaluator/condition/index.js +2 -2
  141. package/esm/evaluator/index.js +2 -2
  142. package/esm/evaluator/matchers/all.js +1 -1
  143. package/esm/evaluator/matchers/between.js +1 -1
  144. package/esm/evaluator/matchers/boolean.js +1 -1
  145. package/esm/evaluator/matchers/cont_all.js +1 -1
  146. package/esm/evaluator/matchers/cont_any.js +1 -1
  147. package/esm/evaluator/matchers/cont_str.js +1 -1
  148. package/esm/evaluator/matchers/dependency.js +2 -2
  149. package/esm/evaluator/matchers/eq.js +1 -1
  150. package/esm/evaluator/matchers/eq_set.js +1 -1
  151. package/esm/evaluator/matchers/ew.js +1 -1
  152. package/esm/evaluator/matchers/gte.js +1 -1
  153. package/esm/evaluator/matchers/index.js +35 -35
  154. package/esm/evaluator/matchers/lte.js +1 -1
  155. package/esm/evaluator/matchers/part_of.js +1 -1
  156. package/esm/evaluator/matchers/segment.js +2 -2
  157. package/esm/evaluator/matchers/string.js +1 -1
  158. package/esm/evaluator/matchers/sw.js +1 -1
  159. package/esm/evaluator/matchers/whitelist.js +1 -1
  160. package/esm/evaluator/matchersTransform/index.js +5 -5
  161. package/esm/evaluator/matchersTransform/segment.js +1 -1
  162. package/esm/evaluator/matchersTransform/set.js +1 -1
  163. package/esm/evaluator/matchersTransform/unaryNumeric.js +1 -1
  164. package/esm/evaluator/matchersTransform/whitelist.js +1 -1
  165. package/esm/evaluator/parser/index.js +11 -11
  166. package/esm/evaluator/treatments/index.js +1 -1
  167. package/esm/evaluator/value/index.js +3 -3
  168. package/esm/evaluator/value/sanitize.js +1 -1
  169. package/esm/integrations/browser.js +2 -2
  170. package/esm/integrations/ga/GaToSplit.js +1 -1
  171. package/esm/integrations/pluggable.js +1 -1
  172. package/esm/listeners/browser.js +2 -2
  173. package/esm/listeners/node.js +2 -2
  174. package/esm/logger/index.js +1 -1
  175. package/esm/logger/messages/info.js +1 -1
  176. package/esm/logger/messages/warn.js +2 -2
  177. package/esm/readiness/readinessManager.js +1 -1
  178. package/esm/readiness/sdkReadinessManager.js +3 -3
  179. package/esm/sdkClient/client.js +2 -2
  180. package/esm/sdkClient/clientAttributesDecoration.js +104 -0
  181. package/esm/sdkClient/clientCS.js +10 -8
  182. package/esm/sdkClient/clientInputValidation.js +2 -2
  183. package/esm/sdkClient/sdkClient.js +3 -3
  184. package/esm/sdkClient/sdkClientMethodCS.js +4 -4
  185. package/esm/sdkClient/sdkClientMethodCSWithTT.js +4 -4
  186. package/esm/sdkFactory/index.js +6 -6
  187. package/esm/sdkManager/index.js +2 -2
  188. package/esm/services/splitApi.js +1 -1
  189. package/esm/services/splitHttpClient.js +1 -1
  190. package/esm/storages/AbstractSegmentsCacheSync.js +1 -1
  191. package/esm/storages/AbstractSplitsCacheAsync.js +1 -1
  192. package/esm/storages/AbstractSplitsCacheSync.js +1 -1
  193. package/esm/storages/KeyBuilder.js +1 -1
  194. package/esm/storages/KeyBuilderCS.js +2 -2
  195. package/esm/storages/KeyBuilderSS.js +2 -2
  196. package/esm/storages/findLatencyIndex.js +1 -1
  197. package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +2 -2
  198. package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +2 -2
  199. package/esm/storages/inLocalStorage/index.js +8 -8
  200. package/esm/storages/inMemory/AttributesCacheInMemory.js +67 -0
  201. package/esm/storages/inMemory/CountsCacheInMemory.js +1 -1
  202. package/esm/storages/inMemory/EventsCacheInMemory.js +1 -1
  203. package/esm/storages/inMemory/ImpressionCountsCacheInMemory.js +1 -1
  204. package/esm/storages/inMemory/ImpressionsCacheInMemory.js +1 -1
  205. package/esm/storages/inMemory/InMemoryStorage.js +5 -5
  206. package/esm/storages/inMemory/InMemoryStorageCS.js +5 -5
  207. package/esm/storages/inMemory/LatenciesCacheInMemory.js +2 -2
  208. package/esm/storages/inMemory/MySegmentsCacheInMemory.js +2 -2
  209. package/esm/storages/inMemory/SegmentsCacheInMemory.js +2 -2
  210. package/esm/storages/inMemory/SplitsCacheInMemory.js +2 -2
  211. package/esm/storages/inRedis/CountsCacheInRedis.js +1 -1
  212. package/esm/storages/inRedis/EventsCacheInRedis.js +1 -1
  213. package/esm/storages/inRedis/ImpressionsCacheInRedis.js +1 -1
  214. package/esm/storages/inRedis/LatenciesCacheInRedis.js +2 -2
  215. package/esm/storages/inRedis/RedisAdapter.js +3 -3
  216. package/esm/storages/inRedis/SegmentsCacheInRedis.js +1 -1
  217. package/esm/storages/inRedis/SplitsCacheInRedis.js +2 -2
  218. package/esm/storages/inRedis/index.js +8 -8
  219. package/esm/storages/pluggable/SplitsCachePluggable.js +1 -1
  220. package/esm/storages/pluggable/index.js +4 -4
  221. package/esm/sync/offline/splitsParser/parseCondition.js +1 -1
  222. package/esm/sync/offline/splitsParser/splitsParserFromFile.js +1 -1
  223. package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +1 -1
  224. package/esm/sync/offline/syncManagerOffline.js +2 -2
  225. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +2 -2
  226. package/esm/sync/polling/fetchers/mySegmentsFetcher.js +1 -1
  227. package/esm/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
  228. package/esm/sync/polling/fetchers/splitChangesFetcher.js +1 -1
  229. package/esm/sync/polling/pollingManagerCS.js +3 -3
  230. package/esm/sync/polling/pollingManagerSS.js +4 -4
  231. package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +3 -3
  232. package/esm/sync/polling/syncTasks/segmentsSyncTask.js +3 -3
  233. package/esm/sync/polling/syncTasks/splitsSyncTask.js +3 -3
  234. package/esm/sync/polling/updaters/mySegmentsUpdater.js +1 -1
  235. package/esm/sync/polling/updaters/segmentChangesUpdater.js +1 -1
  236. package/esm/sync/polling/updaters/splitChangesUpdater.js +7 -4
  237. package/esm/sync/streaming/AuthClient/index.js +1 -1
  238. package/esm/sync/streaming/SSEClient/index.js +1 -1
  239. package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +1 -1
  240. package/esm/sync/streaming/SSEHandler/index.js +2 -2
  241. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +2 -2
  242. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -2
  243. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +2 -2
  244. package/esm/sync/streaming/pushManager.js +10 -9
  245. package/esm/sync/submitters/submitterSyncTask.js +1 -1
  246. package/esm/sync/syncTask.js +1 -1
  247. package/esm/trackers/eventTracker.js +3 -3
  248. package/esm/trackers/impressionObserver/ImpressionObserver.js +2 -2
  249. package/esm/trackers/impressionObserver/impressionObserverCS.js +1 -1
  250. package/esm/trackers/impressionObserver/impressionObserverSS.js +1 -1
  251. package/esm/trackers/impressionsTracker.js +3 -3
  252. package/esm/utils/Backoff.js +1 -1
  253. package/esm/utils/LRUCache/index.js +1 -1
  254. package/esm/utils/MinEventEmitter.js +1 -1
  255. package/esm/utils/inputValidation/attribute.js +16 -0
  256. package/esm/utils/inputValidation/attributes.js +11 -0
  257. package/esm/utils/inputValidation/trafficTypeExistance.js +1 -1
  258. package/esm/utils/lang/binarySearch.js +1 -1
  259. package/esm/utils/lang/objectAssign.js +82 -0
  260. package/esm/utils/promise/thenable.js +3 -1
  261. package/esm/utils/promise/timeout.js +1 -1
  262. package/esm/utils/promise/wrapper.js +1 -1
  263. package/esm/utils/settingsValidation/impressionsMode.js +1 -1
  264. package/esm/utils/settingsValidation/index.js +3 -3
  265. package/esm/utils/settingsValidation/mode.js +1 -1
  266. package/esm/utils/timeTracker/index.js +4 -5
  267. package/esm/utils/timeTracker/now/browser.js +1 -2
  268. package/esm/utils/timeTracker/now/node.js +1 -1
  269. package/esm/utils/timeTracker/timer.js +1 -1
  270. package/package.json +2 -3
  271. package/src/evaluator/Engine.ts +3 -3
  272. package/src/evaluator/combiners/and.ts +2 -2
  273. package/src/evaluator/combiners/ifelseif.ts +2 -2
  274. package/src/evaluator/condition/index.ts +2 -2
  275. package/src/evaluator/index.ts +2 -2
  276. package/src/evaluator/matchers/all.ts +1 -1
  277. package/src/evaluator/matchers/between.ts +1 -1
  278. package/src/evaluator/matchers/boolean.ts +1 -1
  279. package/src/evaluator/matchers/cont_all.ts +1 -1
  280. package/src/evaluator/matchers/cont_any.ts +1 -1
  281. package/src/evaluator/matchers/cont_str.ts +1 -1
  282. package/src/evaluator/matchers/dependency.ts +2 -2
  283. package/src/evaluator/matchers/eq.ts +1 -1
  284. package/src/evaluator/matchers/eq_set.ts +1 -1
  285. package/src/evaluator/matchers/ew.ts +1 -1
  286. package/src/evaluator/matchers/gte.ts +1 -1
  287. package/src/evaluator/matchers/index.ts +35 -35
  288. package/src/evaluator/matchers/lte.ts +1 -1
  289. package/src/evaluator/matchers/part_of.ts +1 -1
  290. package/src/evaluator/matchers/segment.ts +2 -2
  291. package/src/evaluator/matchers/string.ts +1 -1
  292. package/src/evaluator/matchers/sw.ts +1 -1
  293. package/src/evaluator/matchers/whitelist.ts +1 -1
  294. package/src/evaluator/matchersTransform/index.ts +5 -5
  295. package/src/evaluator/matchersTransform/segment.ts +1 -1
  296. package/src/evaluator/matchersTransform/set.ts +1 -1
  297. package/src/evaluator/matchersTransform/unaryNumeric.ts +1 -1
  298. package/src/evaluator/matchersTransform/whitelist.ts +1 -1
  299. package/src/evaluator/parser/index.ts +12 -12
  300. package/src/evaluator/treatments/index.ts +1 -1
  301. package/src/evaluator/value/index.ts +3 -3
  302. package/src/evaluator/value/sanitize.ts +1 -1
  303. package/src/integrations/browser.ts +2 -2
  304. package/src/integrations/ga/GaToSplit.ts +1 -1
  305. package/src/integrations/pluggable.ts +1 -1
  306. package/src/listeners/browser.ts +2 -2
  307. package/src/listeners/node.ts +2 -2
  308. package/src/logger/index.ts +1 -1
  309. package/src/logger/messages/info.ts +1 -1
  310. package/src/logger/messages/warn.ts +2 -2
  311. package/src/readiness/readinessManager.ts +2 -2
  312. package/src/readiness/sdkReadinessManager.ts +3 -3
  313. package/src/sdkClient/client.ts +2 -2
  314. package/src/sdkClient/clientAttributesDecoration.ts +122 -0
  315. package/src/sdkClient/clientCS.ts +13 -8
  316. package/src/sdkClient/clientInputValidation.ts +2 -2
  317. package/src/sdkClient/sdkClient.ts +3 -3
  318. package/src/sdkClient/sdkClientMethodCS.ts +4 -2
  319. package/src/sdkClient/sdkClientMethodCSWithTT.ts +4 -2
  320. package/src/sdkFactory/index.ts +6 -6
  321. package/src/sdkManager/index.ts +2 -2
  322. package/src/services/splitApi.ts +1 -1
  323. package/src/services/splitHttpClient.ts +1 -1
  324. package/src/storages/AbstractSegmentsCacheSync.ts +1 -1
  325. package/src/storages/AbstractSplitsCacheAsync.ts +1 -1
  326. package/src/storages/AbstractSplitsCacheSync.ts +1 -1
  327. package/src/storages/KeyBuilder.ts +1 -1
  328. package/src/storages/KeyBuilderCS.ts +2 -2
  329. package/src/storages/KeyBuilderSS.ts +2 -2
  330. package/src/storages/findLatencyIndex.ts +1 -1
  331. package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +3 -3
  332. package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +3 -3
  333. package/src/storages/inLocalStorage/index.ts +8 -8
  334. package/src/storages/inMemory/AttributesCacheInMemory.ts +73 -0
  335. package/src/storages/inMemory/CountsCacheInMemory.ts +1 -1
  336. package/src/storages/inMemory/EventsCacheInMemory.ts +1 -1
  337. package/src/storages/inMemory/ImpressionCountsCacheInMemory.ts +1 -1
  338. package/src/storages/inMemory/ImpressionsCacheInMemory.ts +1 -1
  339. package/src/storages/inMemory/InMemoryStorage.ts +5 -5
  340. package/src/storages/inMemory/InMemoryStorageCS.ts +5 -5
  341. package/src/storages/inMemory/LatenciesCacheInMemory.ts +2 -2
  342. package/src/storages/inMemory/MySegmentsCacheInMemory.ts +2 -2
  343. package/src/storages/inMemory/SegmentsCacheInMemory.ts +2 -2
  344. package/src/storages/inMemory/SplitsCacheInMemory.ts +2 -2
  345. package/src/storages/inRedis/CountsCacheInRedis.ts +2 -2
  346. package/src/storages/inRedis/EventsCacheInRedis.ts +1 -1
  347. package/src/storages/inRedis/ImpressionsCacheInRedis.ts +1 -1
  348. package/src/storages/inRedis/LatenciesCacheInRedis.ts +3 -3
  349. package/src/storages/inRedis/RedisAdapter.ts +3 -3
  350. package/src/storages/inRedis/SegmentsCacheInRedis.ts +2 -2
  351. package/src/storages/inRedis/SplitsCacheInRedis.ts +3 -3
  352. package/src/storages/inRedis/index.ts +8 -8
  353. package/src/storages/pluggable/SegmentsCachePluggable.ts +1 -1
  354. package/src/storages/pluggable/SplitsCachePluggable.ts +2 -2
  355. package/src/storages/pluggable/index.ts +4 -4
  356. package/src/storages/types.ts +2 -2
  357. package/src/sync/offline/splitsParser/parseCondition.ts +1 -1
  358. package/src/sync/offline/splitsParser/splitsParserFromFile.ts +1 -1
  359. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +1 -1
  360. package/src/sync/offline/syncManagerOffline.ts +2 -2
  361. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +2 -2
  362. package/src/sync/polling/fetchers/mySegmentsFetcher.ts +1 -1
  363. package/src/sync/polling/fetchers/segmentChangesFetcher.ts +1 -1
  364. package/src/sync/polling/fetchers/splitChangesFetcher.ts +1 -1
  365. package/src/sync/polling/pollingManagerCS.ts +3 -3
  366. package/src/sync/polling/pollingManagerSS.ts +4 -4
  367. package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +3 -3
  368. package/src/sync/polling/syncTasks/segmentsSyncTask.ts +3 -3
  369. package/src/sync/polling/syncTasks/splitsSyncTask.ts +3 -3
  370. package/src/sync/polling/updaters/mySegmentsUpdater.ts +1 -1
  371. package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
  372. package/src/sync/polling/updaters/splitChangesUpdater.ts +6 -3
  373. package/src/sync/streaming/AuthClient/index.ts +1 -1
  374. package/src/sync/streaming/SSEClient/index.ts +1 -1
  375. package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +1 -1
  376. package/src/sync/streaming/SSEHandler/index.ts +2 -2
  377. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +2 -2
  378. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -2
  379. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +2 -2
  380. package/src/sync/streaming/UpdateWorkers/types.ts +1 -1
  381. package/src/sync/streaming/pushManager.ts +10 -9
  382. package/src/sync/submitters/submitterSyncTask.ts +1 -1
  383. package/src/sync/syncTask.ts +1 -1
  384. package/src/trackers/eventTracker.ts +3 -3
  385. package/src/trackers/impressionObserver/ImpressionObserver.ts +2 -2
  386. package/src/trackers/impressionObserver/impressionObserverCS.ts +1 -1
  387. package/src/trackers/impressionObserver/impressionObserverSS.ts +1 -1
  388. package/src/trackers/impressionsTracker.ts +3 -3
  389. package/src/types.ts +39 -0
  390. package/src/utils/Backoff.ts +1 -1
  391. package/src/utils/LRUCache/index.ts +1 -1
  392. package/src/utils/MinEventEmitter.ts +1 -1
  393. package/src/utils/inputValidation/attribute.ts +21 -0
  394. package/src/utils/inputValidation/attributes.ts +14 -0
  395. package/src/utils/inputValidation/trafficTypeExistance.ts +1 -1
  396. package/src/utils/lang/binarySearch.ts +1 -1
  397. package/src/utils/lang/objectAssign.ts +104 -0
  398. package/src/utils/promise/thenable.ts +3 -1
  399. package/src/utils/promise/timeout.ts +1 -1
  400. package/src/utils/promise/wrapper.ts +1 -1
  401. package/src/utils/settingsValidation/impressionsMode.ts +1 -1
  402. package/src/utils/settingsValidation/index.ts +3 -3
  403. package/src/utils/settingsValidation/mode.ts +1 -1
  404. package/src/utils/timeTracker/index.ts +4 -6
  405. package/src/utils/timeTracker/now/browser.ts +1 -3
  406. package/src/utils/timeTracker/now/node.ts +1 -1
  407. package/src/utils/timeTracker/timer.ts +1 -1
  408. package/types/evaluator/Engine.d.ts +1 -1
  409. package/types/evaluator/combiners/and.d.ts +1 -1
  410. package/types/evaluator/combiners/ifelseif.d.ts +1 -1
  411. package/types/evaluator/condition/index.d.ts +1 -1
  412. package/types/evaluator/matchers/all.d.ts +1 -1
  413. package/types/evaluator/matchers/between.d.ts +1 -1
  414. package/types/evaluator/matchers/boolean.d.ts +1 -1
  415. package/types/evaluator/matchers/cont_all.d.ts +1 -1
  416. package/types/evaluator/matchers/cont_any.d.ts +1 -1
  417. package/types/evaluator/matchers/cont_str.d.ts +1 -1
  418. package/types/evaluator/matchers/dependency.d.ts +1 -1
  419. package/types/evaluator/matchers/eq.d.ts +1 -1
  420. package/types/evaluator/matchers/eq_set.d.ts +1 -1
  421. package/types/evaluator/matchers/ew.d.ts +1 -1
  422. package/types/evaluator/matchers/gte.d.ts +1 -1
  423. package/types/evaluator/matchers/index.d.ts +1 -1
  424. package/types/evaluator/matchers/lte.d.ts +1 -1
  425. package/types/evaluator/matchers/part_of.d.ts +1 -1
  426. package/types/evaluator/matchers/segment.d.ts +1 -1
  427. package/types/evaluator/matchers/string.d.ts +1 -1
  428. package/types/evaluator/matchers/sw.d.ts +1 -1
  429. package/types/evaluator/matchers/whitelist.d.ts +1 -1
  430. package/types/evaluator/matchersTransform/index.d.ts +1 -1
  431. package/types/evaluator/matchersTransform/segment.d.ts +1 -1
  432. package/types/evaluator/matchersTransform/set.d.ts +1 -1
  433. package/types/evaluator/matchersTransform/unaryNumeric.d.ts +1 -1
  434. package/types/evaluator/matchersTransform/whitelist.d.ts +1 -1
  435. package/types/evaluator/parser/index.d.ts +1 -1
  436. package/types/evaluator/treatments/index.d.ts +1 -1
  437. package/types/evaluator/value/index.d.ts +1 -1
  438. package/types/evaluator/value/sanitize.d.ts +1 -1
  439. package/types/integrations/browser.d.ts +1 -1
  440. package/types/integrations/pluggable.d.ts +1 -1
  441. package/types/listeners/browser.d.ts +1 -1
  442. package/types/listeners/node.d.ts +1 -1
  443. package/types/logger/browser/{debugLogger.d.ts → DebugLogger.d.ts} +0 -0
  444. package/types/logger/browser/{errorLogger.d.ts → ErrorLogger.d.ts} +0 -0
  445. package/types/logger/browser/{infoLogger.d.ts → InfoLogger.d.ts} +0 -0
  446. package/types/logger/browser/{warnLogger.d.ts → WarnLogger.d.ts} +0 -0
  447. package/types/readiness/sdkReadinessManager.d.ts +1 -1
  448. package/types/sdkClient/client.d.ts +1 -1
  449. package/types/sdkClient/clientAttributesDecoration.d.ts +51 -0
  450. package/types/sdkClient/clientCS.d.ts +2 -1
  451. package/types/sdkClient/clientInputValidation.d.ts +1 -1
  452. package/types/storages/AbstractSegmentsCacheSync.d.ts +1 -1
  453. package/types/storages/AbstractSplitsCacheAsync.d.ts +1 -1
  454. package/types/storages/AbstractSplitsCacheSync.d.ts +1 -1
  455. package/types/storages/KeyBuilder.d.ts +1 -1
  456. package/types/storages/KeyBuilderCS.d.ts +2 -2
  457. package/types/storages/KeyBuilderSS.d.ts +2 -2
  458. package/types/storages/findLatencyIndex.d.ts +1 -1
  459. package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +3 -3
  460. package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +3 -3
  461. package/types/storages/inMemory/AttributesCacheInMemory.d.ts +43 -0
  462. package/types/storages/inMemory/CountsCacheInMemory.d.ts +1 -1
  463. package/types/storages/inMemory/EventsCacheInMemory.d.ts +1 -1
  464. package/types/storages/inMemory/ImpressionCountsCacheInMemory.d.ts +1 -1
  465. package/types/storages/inMemory/ImpressionsCacheInMemory.d.ts +1 -1
  466. package/types/storages/inMemory/LatenciesCacheInMemory.d.ts +1 -1
  467. package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +2 -2
  468. package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +2 -2
  469. package/types/storages/inMemory/SplitsCacheInMemory.d.ts +2 -2
  470. package/types/storages/inRedis/CountsCacheInRedis.d.ts +2 -2
  471. package/types/storages/inRedis/EventsCacheInRedis.d.ts +1 -1
  472. package/types/storages/inRedis/ImpressionsCacheInRedis.d.ts +1 -1
  473. package/types/storages/inRedis/LatenciesCacheInRedis.d.ts +2 -2
  474. package/types/storages/inRedis/RedisAdapter.d.ts +1 -1
  475. package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +2 -2
  476. package/types/storages/inRedis/SplitsCacheInRedis.d.ts +3 -3
  477. package/types/storages/pluggable/SegmentsCachePluggable.d.ts +1 -1
  478. package/types/storages/pluggable/SplitsCachePluggable.d.ts +2 -2
  479. package/types/storages/types.d.ts +2 -2
  480. package/types/sync/offline/splitsParser/parseCondition.d.ts +1 -1
  481. package/types/sync/offline/syncTasks/fromObjectSyncTask.d.ts +1 -1
  482. package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +1 -1
  483. package/types/sync/polling/fetchers/segmentChangesFetcher.d.ts +1 -1
  484. package/types/sync/polling/fetchers/splitChangesFetcher.d.ts +1 -1
  485. package/types/sync/polling/pollingManagerCS.d.ts +1 -1
  486. package/types/sync/polling/pollingManagerSS.d.ts +1 -1
  487. package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +1 -1
  488. package/types/sync/polling/syncTasks/segmentsSyncTask.d.ts +1 -1
  489. package/types/sync/polling/syncTasks/splitsSyncTask.d.ts +1 -1
  490. package/types/sync/streaming/SSEClient/index.d.ts +1 -1
  491. package/types/sync/streaming/SSEHandler/NotificationKeeper.d.ts +1 -1
  492. package/types/sync/streaming/SSEHandler/index.d.ts +1 -1
  493. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +2 -2
  494. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -2
  495. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +2 -2
  496. package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -1
  497. package/types/sync/streaming/pushManager.d.ts +1 -1
  498. package/types/sync/syncTask.d.ts +1 -1
  499. package/types/trackers/eventTracker.d.ts +1 -1
  500. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +1 -1
  501. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +1 -1
  502. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +1 -1
  503. package/types/trackers/impressionsTracker.d.ts +1 -1
  504. package/types/types.d.ts +39 -0
  505. package/types/utils/Backoff.d.ts +1 -1
  506. package/types/utils/LRUCache/index.d.ts +1 -1
  507. package/types/utils/MinEventEmitter.d.ts +1 -1
  508. package/types/utils/inputValidation/attribute.d.ts +2 -0
  509. package/types/utils/inputValidation/attributes.d.ts +1 -0
  510. package/types/utils/lang/binarySearch.d.ts +1 -1
  511. package/types/utils/lang/objectAssign.d.ts +3 -0
  512. package/types/utils/promise/thenable.d.ts +1 -2
  513. package/types/utils/promise/timeout.d.ts +1 -1
  514. package/types/utils/promise/wrapper.d.ts +1 -1
  515. package/types/utils/settingsValidation/impressionsMode.d.ts +1 -1
  516. package/types/utils/settingsValidation/mode.d.ts +1 -1
  517. package/types/utils/timeTracker/index.d.ts +2 -2
  518. package/types/utils/timeTracker/now/browser.d.ts +1 -2
  519. package/types/utils/timeTracker/now/node.d.ts +1 -1
  520. package/types/utils/timeTracker/timer.d.ts +1 -1
  521. package/src/logger/.DS_Store +0 -0
  522. package/types/integrations/ga/GaToSplitPlugin.d.ts +0 -3
  523. package/types/integrations/ga/SplitToGaPlugin.d.ts +0 -4
  524. package/types/logger/codes.d.ts +0 -2
  525. package/types/logger/codesConstants.d.ts +0 -117
  526. package/types/logger/codesConstantsBrowser.d.ts +0 -2
  527. package/types/logger/codesConstantsNode.d.ts +0 -14
  528. package/types/logger/codesDebug.d.ts +0 -1
  529. package/types/logger/codesDebugBrowser.d.ts +0 -1
  530. package/types/logger/codesDebugNode.d.ts +0 -1
  531. package/types/logger/codesError.d.ts +0 -1
  532. package/types/logger/codesErrorNode.d.ts +0 -1
  533. package/types/logger/codesInfo.d.ts +0 -1
  534. package/types/logger/codesWarn.d.ts +0 -1
  535. package/types/logger/codesWarnNode.d.ts +0 -1
  536. package/types/logger/debugLogger.d.ts +0 -2
  537. package/types/logger/errorLogger.d.ts +0 -2
  538. package/types/logger/infoLogger.d.ts +0 -2
  539. package/types/logger/messages/debugBrowser.d.ts +0 -1
  540. package/types/logger/messages/debugNode.d.ts +0 -1
  541. package/types/logger/messages/errorNode.d.ts +0 -1
  542. package/types/logger/messages/warnNode.d.ts +0 -1
  543. package/types/logger/noopLogger.d.ts +0 -2
  544. package/types/logger/warnLogger.d.ts +0 -2
  545. package/types/sdkManager/sdkManagerMethod.d.ts +0 -6
  546. package/types/storages/getRegisteredSegments.d.ts +0 -10
  547. package/types/sync/polling/syncTasks/splitsSyncTask.copy.d.ts +0 -35
  548. package/types/sync/polling/syncTasks/splitsSyncTask.morelikeoriginal.d.ts +0 -35
  549. package/types/sync/streaming/AuthClient/indexV1.d.ts +0 -12
  550. package/types/sync/streaming/AuthClient/indexV2.d.ts +0 -8
  551. package/types/sync/streaming/pushManagerCS.d.ts +0 -12
  552. package/types/sync/streaming/pushManagerNoUsers.d.ts +0 -13
  553. package/types/sync/streaming/pushManagerSS.d.ts +0 -11
  554. package/types/sync/syncManagerFromFile.d.ts +0 -2
  555. package/types/sync/syncManagerFromObject.d.ts +0 -2
  556. package/types/sync/syncManagerOffline.d.ts +0 -9
  557. package/types/utils/lang/errors.d.ts +0 -10
  558. package/types/utils/murmur3/commons.d.ts +0 -12
  559. package/types/utils/settingsValidation/buildMetadata.d.ts +0 -3
  560. package/types/utils/settingsValidation/localhost/index.d.ts +0 -9
  561. package/types/utils/settingsValidation/logger.d.ts +0 -11
@@ -1,4 +1,4 @@
1
- import Backoff from '../../../utils/Backoff';
1
+ import { Backoff } from '../../../utils/Backoff';
2
2
  /**
3
3
  * MySegmentsUpdateWorker class
4
4
  */
@@ -55,4 +55,4 @@ var MySegmentsUpdateWorker = /** @class */ (function () {
55
55
  };
56
56
  return MySegmentsUpdateWorker;
57
57
  }());
58
- export default MySegmentsUpdateWorker;
58
+ export { MySegmentsUpdateWorker };
@@ -1,4 +1,4 @@
1
- import Backoff from '../../../utils/Backoff';
1
+ import { Backoff } from '../../../utils/Backoff';
2
2
  /**
3
3
  * SegmentUpdateWorker class
4
4
  */
@@ -68,4 +68,4 @@ var SegmentsUpdateWorker = /** @class */ (function () {
68
68
  };
69
69
  return SegmentsUpdateWorker;
70
70
  }());
71
- export default SegmentsUpdateWorker;
71
+ export { SegmentsUpdateWorker };
@@ -1,5 +1,5 @@
1
1
  import { SDK_SPLITS_ARRIVED } from '../../../readiness/constants';
2
- import Backoff from '../../../utils/Backoff';
2
+ import { Backoff } from '../../../utils/Backoff';
3
3
  /**
4
4
  * SplitsUpdateWorker class
5
5
  */
@@ -76,4 +76,4 @@ var SplitsUpdateWorker = /** @class */ (function () {
76
76
  };
77
77
  return SplitsUpdateWorker;
78
78
  }());
79
- export default SplitsUpdateWorker;
79
+ export { SplitsUpdateWorker };
@@ -1,12 +1,12 @@
1
- import objectAssign from 'object-assign';
2
- import Backoff from '../../utils/Backoff';
3
- import SSEHandlerFactory from './SSEHandler';
4
- import MySegmentsUpdateWorker from './UpdateWorkers/MySegmentsUpdateWorker';
5
- import SegmentsUpdateWorker from './UpdateWorkers/SegmentsUpdateWorker';
6
- import SplitsUpdateWorker from './UpdateWorkers/SplitsUpdateWorker';
1
+ import { objectAssign } from '../../utils/lang/objectAssign';
2
+ import { Backoff } from '../../utils/Backoff';
3
+ import { SSEHandlerFactory } from './SSEHandler';
4
+ import { MySegmentsUpdateWorker } from './UpdateWorkers/MySegmentsUpdateWorker';
5
+ import { SegmentsUpdateWorker } from './UpdateWorkers/SegmentsUpdateWorker';
6
+ import { SplitsUpdateWorker } from './UpdateWorkers/SplitsUpdateWorker';
7
7
  import { authenticateFactory, hashUserKey } from './AuthClient';
8
8
  import { forOwn } from '../../utils/lang';
9
- import SSEClient from './SSEClient';
9
+ import { SSEClient } from './SSEClient';
10
10
  import { getMatching } from '../../utils/key';
11
11
  import { MY_SEGMENTS_UPDATE, MY_SEGMENTS_UPDATE_V2, PUSH_NONRETRYABLE_ERROR, PUSH_SUBSYSTEM_DOWN, SECONDS_BEFORE_EXPIRATION, SEGMENT_UPDATE, SPLIT_KILL, SPLIT_UPDATE, PUSH_RETRYABLE_ERROR, PUSH_SUBSYSTEM_UP, ControlType } from './constants';
12
12
  import { STREAMING_FALLBACK, STREAMING_REFRESH_TOKEN, STREAMING_CONNECTING, STREAMING_DISABLED, ERROR_STREAMING_AUTH, STREAMING_DISCONNECTING, STREAMING_RECONNECT, STREAMING_PARSING_MY_SEGMENTS_UPDATE_V2 } from '../../logger/constants';
@@ -19,7 +19,7 @@ import { hash64 } from '../../utils/murmur3/murmur3_64';
19
19
  * - for server-side if key is not provided in settings.
20
20
  * - for client-side, with support for multiple clients, if key is provided in settings
21
21
  */
22
- export default function pushManagerFactory(pollingManager, storage, readiness, fetchAuth, platform, settings) {
22
+ export function pushManagerFactory(pollingManager, storage, readiness, fetchAuth, platform, settings) {
23
23
  // `userKey` is the matching key of main client in client-side SDK.
24
24
  // It can be used to check if running on client-side or server-side SDK.
25
25
  var userKey = settings.core.key ? getMatching(settings.core.key) : undefined; //
@@ -87,7 +87,8 @@ export default function pushManagerFactory(pollingManager, storage, readiness, f
87
87
  // Guard condition in case `stop/disconnectPush` has been called (e.g., calling SDK destroy, or app signal close/background)
88
88
  if (disconnected)
89
89
  return;
90
- log.info(STREAMING_CONNECTING, [disconnected === undefined ? '' : 'Re-']);
90
+ // @TODO distinguish log for 'Connecting' (1st time) and 'Re-connecting'
91
+ log.info(STREAMING_CONNECTING);
91
92
  disconnected = false;
92
93
  var userKeys = userKey ? Object.keys(clients) : undefined;
93
94
  authenticate(userKeys).then(function (authData) {
@@ -1,4 +1,4 @@
1
- import syncTaskFactory from '../syncTask';
1
+ import { syncTaskFactory } from '../syncTask';
2
2
  import { SUBMITTERS_PUSH, SUBMITTERS_PUSH_FAILS, SUBMITTERS_PUSH_RETRY } from '../../logger/constants';
3
3
  /**
4
4
  * Base function to create submitter sync tasks, such as ImpressionsSyncTask and EventsSyncTask
@@ -10,7 +10,7 @@ import { SYNC_TASK_EXECUTE, SYNC_TASK_START, SYNC_TASK_STOP } from '../logger/co
10
10
  * @param taskName Optional task name for logging.
11
11
  * @returns A sync task that wraps the given task.
12
12
  */
13
- export default function syncTaskFactory(log, task, period, taskName) {
13
+ export function syncTaskFactory(log, task, period, taskName) {
14
14
  if (taskName === void 0) { taskName = 'task'; }
15
15
  // Flag that indicates if the task is being executed
16
16
  var executing = false;
@@ -1,5 +1,5 @@
1
- import objectAssign from 'object-assign';
2
- import thenable from '../utils/promise/thenable';
1
+ import { objectAssign } from '../utils/lang/objectAssign';
2
+ import { thenable } from '../utils/promise/thenable';
3
3
  import { EVENTS_TRACKER_SUCCESS, ERROR_EVENTS_TRACKER } from '../logger/constants';
4
4
  /**
5
5
  * Event tracker stores events in cache and pass them to the integrations manager if provided.
@@ -7,7 +7,7 @@ import { EVENTS_TRACKER_SUCCESS, ERROR_EVENTS_TRACKER } from '../logger/constant
7
7
  * @param eventsCache cache to save events
8
8
  * @param integrationsManager optional event handler used for integrations
9
9
  */
10
- export default function eventTrackerFactory(log, eventsCache, integrationsManager) {
10
+ export function eventTrackerFactory(log, eventsCache, integrationsManager) {
11
11
  function queueEventsCallback(eventData, tracked) {
12
12
  var eventTypeId = eventData.eventTypeId, trafficTypeName = eventData.trafficTypeName, key = eventData.key, value = eventData.value, timestamp = eventData.timestamp, properties = eventData.properties;
13
13
  // Logging every prop would be too much.
@@ -1,4 +1,4 @@
1
- import LRUCache from '../../utils/LRUCache';
1
+ import { LRUCache } from '../../utils/LRUCache';
2
2
  var ImpressionObserver = /** @class */ (function () {
3
3
  function ImpressionObserver(size, hasher) {
4
4
  this.cache = new LRUCache(size);
@@ -12,4 +12,4 @@ var ImpressionObserver = /** @class */ (function () {
12
12
  };
13
13
  return ImpressionObserver;
14
14
  }());
15
- export default ImpressionObserver;
15
+ export { ImpressionObserver };
@@ -1,4 +1,4 @@
1
- import ImpressionObserver from './ImpressionObserver';
1
+ import { ImpressionObserver } from './ImpressionObserver';
2
2
  import { hash } from '../../utils/murmur3/murmur3';
3
3
  import { buildKey } from './buildKey';
4
4
  export function hashImpression32(impression) {
@@ -1,4 +1,4 @@
1
- import ImpressionObserver from './ImpressionObserver';
1
+ import { ImpressionObserver } from './ImpressionObserver';
2
2
  import { hash128 } from '../../utils/murmur3/murmur3_128_x86';
3
3
  import { buildKey } from './buildKey';
4
4
  export function hashImpression128(impression) {
@@ -1,5 +1,5 @@
1
- import objectAssign from 'object-assign';
2
- import thenable from '../utils/promise/thenable';
1
+ import { objectAssign } from '../utils/lang/objectAssign';
2
+ import { thenable } from '../utils/promise/thenable';
3
3
  import { truncateTimeFrame } from '../utils/time';
4
4
  import { IMPRESSIONS_TRACKER_SUCCESS, ERROR_IMPRESSIONS_TRACKER, ERROR_IMPRESSIONS_LISTENER } from '../logger/constants';
5
5
  /**
@@ -12,7 +12,7 @@ import { IMPRESSIONS_TRACKER_SUCCESS, ERROR_IMPRESSIONS_TRACKER, ERROR_IMPRESSIO
12
12
  * @param observer optional impression observer. If provided, previous time (pt property) is included in impression instances
13
13
  * @param countsCache optional cache to save impressions count. If provided, impressions will be deduped (OPTIMIZED mode)
14
14
  */
15
- export default function impressionsTrackerFactory(log, impressionsCache,
15
+ export function impressionsTrackerFactory(log, impressionsCache,
16
16
  // @TODO consider passing only an optional integrationsManager to handle impressions
17
17
  _a, impressionListener, integrationsManager,
18
18
  // if observer is provided, it implies `shouldAddPreviousTime` flag (i.e., if impressions previous time should be added or not)
@@ -38,4 +38,4 @@ var Backoff = /** @class */ (function () {
38
38
  Backoff.DEFAULT_MAX_MILLIS = 1800000; // 30 minutes
39
39
  return Backoff;
40
40
  }());
41
- export default Backoff;
41
+ export { Backoff };
@@ -37,4 +37,4 @@ var LRUCache = /** @class */ (function () {
37
37
  };
38
38
  return LRUCache;
39
39
  }());
40
- export default LRUCache;
40
+ export { LRUCache };
@@ -94,4 +94,4 @@ var EventEmitter = /** @class */ (function () {
94
94
  };
95
95
  return EventEmitter;
96
96
  }());
97
- export default EventEmitter;
97
+ export { EventEmitter };
@@ -0,0 +1,16 @@
1
+ import { isString, isFiniteNumber, isBoolean } from '../../utils/lang';
2
+ export function validateAttribute(log, attributeKey, attributeValue, method) {
3
+ if (!isString(attributeKey) || attributeKey.length === 0) {
4
+ log.warn(method + ": you passed an invalid attribute name, attribute name must be a non-empty string.");
5
+ return false;
6
+ }
7
+ var isStringVal = isString(attributeValue);
8
+ var isFiniteVal = isFiniteNumber(attributeValue);
9
+ var isBoolVal = isBoolean(attributeValue);
10
+ var isArrayVal = Array.isArray(attributeValue);
11
+ if (!(isStringVal || isFiniteVal || isBoolVal || isArrayVal)) { // If it's not of valid type.
12
+ log.warn(method + ": you passed an invalid attribute value for " + attributeKey + ". Acceptable types are: string, number, boolean and array of strings.");
13
+ return false;
14
+ }
15
+ return true;
16
+ }
@@ -1,4 +1,5 @@
1
1
  import { isObject } from '../lang';
2
+ import { validateAttribute } from './attribute';
2
3
  import { ERROR_NOT_PLAIN_OBJECT } from '../../logger/constants';
3
4
  export function validateAttributes(log, maybeAttrs, method) {
4
5
  // Attributes are optional
@@ -7,3 +8,13 @@ export function validateAttributes(log, maybeAttrs, method) {
7
8
  log.error(ERROR_NOT_PLAIN_OBJECT, [method, 'attributes']);
8
9
  return false;
9
10
  }
11
+ export function validateAttributesDeep(log, maybeAttributes, method) {
12
+ if (!validateAttributes(log, maybeAttributes, method))
13
+ return false;
14
+ var result = true;
15
+ Object.keys(maybeAttributes).forEach(function (attributeKey) {
16
+ if (!validateAttribute(log, attributeKey, maybeAttributes[attributeKey], method))
17
+ result = false;
18
+ });
19
+ return result;
20
+ }
@@ -1,4 +1,4 @@
1
- import thenable from '../promise/thenable';
1
+ import { thenable } from '../promise/thenable';
2
2
  import { LOCALHOST_MODE } from '../constants';
3
3
  import { WARN_NOT_EXISTENT_TT } from '../../logger/constants';
4
4
  function logTTExistanceWarning(log, maybeTT, method) {
@@ -6,7 +6,7 @@
6
6
  * @returns integer number between 0 and `items.length`. This value is the index of the search value,
7
7
  * if it is contained in the array, or the index at which the value should be inserted to keep the array ordered.
8
8
  */
9
- export default function binarySearch(items, value) {
9
+ export function binarySearch(items, value) {
10
10
  var startIndex = 0;
11
11
  var stopIndex = items.length - 1;
12
12
  var middle = Math.floor((stopIndex + startIndex) / 2);
@@ -0,0 +1,82 @@
1
+ /*
2
+ Adaptation of "object-assign" library (https://www.npmjs.com/package/object-assign)
3
+ exported as an ES module instead of CommonJS, to avoid extra configuration steps when using
4
+ the ESM build of the SDK with tools that doesn't support CommonJS by default (e.g. Rollup).
5
+
6
+ object-assign
7
+ (c) Sindre Sorhus
8
+ @license MIT
9
+ */
10
+ /* eslint-disable */
11
+ // @ts-nocheck
12
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
13
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
14
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
15
+ function toObject(val) {
16
+ if (val === null || val === undefined) {
17
+ throw new TypeError('Object.assign cannot be called with null or undefined');
18
+ }
19
+ return Object(val);
20
+ }
21
+ function shouldUseNative() {
22
+ try {
23
+ if (!Object.assign) {
24
+ return false;
25
+ }
26
+ // Detect buggy property enumeration order in older V8 versions.
27
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
28
+ var test1 = new String('abc');
29
+ test1[5] = 'de';
30
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
31
+ return false;
32
+ }
33
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
34
+ var test2 = {};
35
+ for (var i = 0; i < 10; i++) {
36
+ test2['_' + String.fromCharCode(i)] = i;
37
+ }
38
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
39
+ return test2[n];
40
+ });
41
+ if (order2.join('') !== '0123456789') {
42
+ return false;
43
+ }
44
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
45
+ var test3 = {};
46
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
47
+ test3[letter] = letter;
48
+ });
49
+ if (Object.keys(Object.assign({}, test3)).join('') !==
50
+ 'abcdefghijklmnopqrst') {
51
+ return false;
52
+ }
53
+ return true;
54
+ }
55
+ catch (err) {
56
+ // We don't expect any of the above to throw, but better to be safe.
57
+ return false;
58
+ }
59
+ }
60
+ export var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
61
+ var from;
62
+ var to = toObject(target);
63
+ var symbols;
64
+ for (var s = 1; s < arguments.length; s++) {
65
+ from = Object(arguments[s]);
66
+ // eslint-disable-next-line no-restricted-syntax
67
+ for (var key in from) {
68
+ if (hasOwnProperty.call(from, key)) {
69
+ to[key] = from[key];
70
+ }
71
+ }
72
+ if (getOwnPropertySymbols) {
73
+ symbols = getOwnPropertySymbols(from);
74
+ for (var i = 0; i < symbols.length; i++) {
75
+ if (propIsEnumerable.call(from, symbols[i])) {
76
+ to[symbols[i]] = from[symbols[i]];
77
+ }
78
+ }
79
+ }
80
+ }
81
+ return to;
82
+ };
@@ -1,2 +1,4 @@
1
1
  // returns true if the given value is a thenable object
2
- export default (function (o) { return o !== undefined && o !== null && typeof o.then === 'function'; });
2
+ export function thenable(o) {
3
+ return o !== undefined && o !== null && typeof o.then === 'function';
4
+ }
@@ -1,4 +1,4 @@
1
- export default function timeout(ms, promise) {
1
+ export function timeout(ms, promise) {
2
2
  if (ms < 1)
3
3
  return promise;
4
4
  return new Promise(function (resolve, reject) {
@@ -16,7 +16,7 @@
16
16
  * @returns a promise that doesn't need to be handled for rejection (except when using async/await syntax) and
17
17
  * includes a method named `hasOnFulfilled` that returns true if the promise has attached an onFulfilled handler.
18
18
  */
19
- export default function promiseWrapper(customPromise, defaultOnRejected) {
19
+ export function promiseWrapper(customPromise, defaultOnRejected) {
20
20
  var hasOnFulfilled = false;
21
21
  var hasOnRejected = false;
22
22
  function chain(promise) {
@@ -1,6 +1,6 @@
1
1
  import { ERROR_INVALID_IMPRESSIONS_MODE } from '../../logger/constants';
2
2
  import { DEBUG, OPTIMIZED } from '../constants';
3
- export default function validImpressionsMode(log, impressionsMode) {
3
+ export function validImpressionsMode(log, impressionsMode) {
4
4
  impressionsMode = impressionsMode.toUpperCase();
5
5
  if ([DEBUG, OPTIMIZED].indexOf(impressionsMode) === -1) {
6
6
  log.error(ERROR_INVALID_IMPRESSIONS_MODE, [[DEBUG, OPTIMIZED], OPTIMIZED]);
@@ -1,8 +1,8 @@
1
1
  import { merge } from '../lang';
2
- import mode from './mode';
2
+ import { mode } from './mode';
3
3
  import { validateSplitFilters } from './splitFilters';
4
4
  import { STANDALONE_MODE, OPTIMIZED, LOCALHOST_MODE } from '../constants';
5
- import validImpressionsMode from './impressionsMode';
5
+ import { validImpressionsMode } from './impressionsMode';
6
6
  var base = {
7
7
  // Define which kind of object you want to retrieve from SplitFactory
8
8
  mode: STANDALONE_MODE,
@@ -100,7 +100,7 @@ export function settingsValidation(config, validationParams) {
100
100
  // Startup periods
101
101
  startup.requestTimeoutBeforeReady = fromSecondsToMillis(startup.requestTimeoutBeforeReady);
102
102
  startup.readyTimeout = fromSecondsToMillis(startup.readyTimeout);
103
- startup.eventsFirstPushWindow = fromSecondsToMillis(withDefaults.startup.eventsFirstPushWindow);
103
+ startup.eventsFirstPushWindow = fromSecondsToMillis(startup.eventsFirstPushWindow);
104
104
  // ensure a valid SDK mode
105
105
  // @ts-ignore, modify readonly prop
106
106
  withDefaults.mode = mode(withDefaults.core.authorizationKey, withDefaults.mode);
@@ -1,5 +1,5 @@
1
1
  import { LOCALHOST_MODE, STANDALONE_MODE, PRODUCER_MODE, CONSUMER_MODE, CONSUMER_PARTIAL_MODE } from '../constants';
2
- export default function mode(key, mode) {
2
+ export function mode(key, mode) {
3
3
  // Leaving the comparison as is, in case we change the mode name but not the setting.
4
4
  if (key === 'localhost')
5
5
  return LOCALHOST_MODE;
@@ -1,7 +1,7 @@
1
1
  var _a;
2
2
  import { uniqueId } from '../lang';
3
- import timer from './timer';
4
- import thenable from '../promise/thenable';
3
+ import { timer } from './timer';
4
+ import { thenable } from '../promise/thenable';
5
5
  // Map we will use for storing timers data
6
6
  var timers = {};
7
7
  // Tasks constants
@@ -86,7 +86,8 @@ function getCallbackForTask(task, collector) {
86
86
  return collector[callbackData.method];
87
87
  return false;
88
88
  }
89
- var TrackerAPI = {
89
+ // Our "time tracker" API
90
+ export var TrackerAPI = {
90
91
  /**
91
92
  * "Private" method, used to attach count/countException and stop callbacks to a promise.
92
93
  *
@@ -190,5 +191,3 @@ var TrackerAPI = {
190
191
  */
191
192
  TaskNames: CONSTANTS
192
193
  };
193
- // Our "time tracker" API
194
- export default TrackerAPI;
@@ -9,5 +9,4 @@ function nowFactory() {
9
9
  return Date.now;
10
10
  }
11
11
  }
12
- var now = nowFactory();
13
- export default now;
12
+ export var now = nowFactory();
@@ -1,5 +1,5 @@
1
1
  // @TODO migrate to Node SDK package eventually
2
- export default function now() {
2
+ export function now() {
3
3
  // eslint-disable-next-line no-undef
4
4
  var time = process.hrtime();
5
5
  return time[0] * 1e3 + time[1] * 1e-6; // convert it to milis
@@ -1,4 +1,4 @@
1
- export default function start(now) {
1
+ export function timer(now) {
2
2
  var st = now ? now() : Date.now();
3
3
  return function stop() {
4
4
  return Math.round(now ? now() : Date.now() - st);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-commons",
3
- "version": "1.0.1-rc.5",
3
+ "version": "1.2.0",
4
4
  "description": "Split Javascript SDK common components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -44,7 +44,6 @@
44
44
  "bugs": "https://github.com/splitio/javascript-commons/issues",
45
45
  "homepage": "https://github.com/splitio/javascript-commons#readme",
46
46
  "dependencies": {
47
- "object-assign": "^4.1.1",
48
47
  "tslib": "^2.1.0"
49
48
  },
50
49
  "devDependencies": {
@@ -52,13 +51,13 @@
52
51
  "@types/ioredis": "^4.28.0",
53
52
  "@types/jest": "^27.0.0",
54
53
  "@types/lodash": "^4.14.162",
55
- "@types/object-assign": "^4.0.30",
56
54
  "@typescript-eslint/eslint-plugin": "^4.2.0",
57
55
  "@typescript-eslint/parser": "^4.2.0",
58
56
  "cross-env": "^7.0.2",
59
57
  "csv-streamify": "^4.0.0",
60
58
  "eslint": "^7.32.0",
61
59
  "eslint-plugin-compat": "3.7.0",
60
+ "eslint-plugin-import": "^2.25.3",
62
61
  "fetch-mock": "^9.10.7",
63
62
  "ioredis": "^4.28.0",
64
63
  "jest": "^27.2.3",
@@ -1,7 +1,7 @@
1
1
  import { get } from '../utils/lang';
2
- import parser from './parser';
2
+ import { parser } from './parser';
3
3
  import { keyParser } from '../utils/key';
4
- import thenable from '../utils/promise/thenable';
4
+ import { thenable } from '../utils/promise/thenable';
5
5
  import * as LabelsConstants from '../utils/labels';
6
6
  import { CONTROL } from '../utils/constants';
7
7
  import { ISplit, MaybeThenable } from '../dtos/types';
@@ -17,7 +17,7 @@ function evaluationResult(result: IEvaluation | undefined, defaultTreatment: str
17
17
  };
18
18
  }
19
19
 
20
- export default class Engine {
20
+ export class Engine {
21
21
 
22
22
  constructor(private baseInfo: ISplit, private evaluator: IEvaluator) {
23
23
 
@@ -1,11 +1,11 @@
1
1
  import { findIndex } from '../../utils/lang';
2
2
  import { ILogger } from '../../logger/types';
3
- import thenable from '../../utils/promise/thenable';
3
+ import { thenable } from '../../utils/promise/thenable';
4
4
  import { MaybeThenable } from '../../dtos/types';
5
5
  import { IMatcher } from '../types';
6
6
  import { ENGINE_COMBINER_AND } from '../../logger/constants';
7
7
 
8
- export default function andCombinerContext(log: ILogger, matchers: IMatcher[]) {
8
+ export function andCombinerContext(log: ILogger, matchers: IMatcher[]) {
9
9
 
10
10
  function andResults(results: boolean[]): boolean {
11
11
  // Array.prototype.every is supported by target environments
@@ -1,13 +1,13 @@
1
1
  import { findIndex } from '../../utils/lang';
2
2
  import { ILogger } from '../../logger/types';
3
- import thenable from '../../utils/promise/thenable';
3
+ import { thenable } from '../../utils/promise/thenable';
4
4
  import * as LabelsConstants from '../../utils/labels';
5
5
  import { CONTROL } from '../../utils/constants';
6
6
  import { SplitIO } from '../../types';
7
7
  import { IEvaluation, IEvaluator, ISplitEvaluator } from '../types';
8
8
  import { ENGINE_COMBINER_IFELSEIF, ENGINE_COMBINER_IFELSEIF_NO_TREATMENT, ERROR_ENGINE_COMBINER_IFELSEIF } from '../../logger/constants';
9
9
 
10
- export default function ifElseIfCombinerContext(log: ILogger, predicates: IEvaluator[]): IEvaluator {
10
+ export function ifElseIfCombinerContext(log: ILogger, predicates: IEvaluator[]): IEvaluator {
11
11
 
12
12
  function unexpectedInputHandler() {
13
13
  log.error(ERROR_ENGINE_COMBINER_IFELSEIF);
@@ -1,5 +1,5 @@
1
1
  import { getTreatment, shouldApplyRollout } from './engineUtils';
2
- import thenable from '../../utils/promise/thenable';
2
+ import { thenable } from '../../utils/promise/thenable';
3
3
  import * as LabelsConstants from '../../utils/labels';
4
4
  import { MaybeThenable } from '../../dtos/types';
5
5
  import { IEvaluation, IEvaluator, ISplitEvaluator } from '../types';
@@ -22,7 +22,7 @@ function match(log: ILogger, matchingResult: boolean, bucketingKey: string | und
22
22
  }
23
23
 
24
24
  // Condition factory
25
- export default function conditionContext(log: ILogger, matcherEvaluator: (...args: any) => MaybeThenable<boolean>, treatments: { getTreatmentFor: (x: number) => string }, label: string, conditionType: 'ROLLOUT' | 'WHITELIST'): IEvaluator {
25
+ export function conditionContext(log: ILogger, matcherEvaluator: (...args: any) => MaybeThenable<boolean>, treatments: { getTreatmentFor: (x: number) => string }, label: string, conditionType: 'ROLLOUT' | 'WHITELIST'): IEvaluator {
26
26
 
27
27
  return function conditionEvaluator(key: SplitIO.SplitKey, seed: number, trafficAllocation?: number, trafficAllocationSeed?: number, attributes?: SplitIO.Attributes, splitEvaluator?: ISplitEvaluator) {
28
28
 
@@ -1,5 +1,5 @@
1
- import Engine from './Engine';
2
- import thenable from '../utils/promise/thenable';
1
+ import { Engine } from './Engine';
2
+ import { thenable } from '../utils/promise/thenable';
3
3
  import * as LabelsConstants from '../utils/labels';
4
4
  import { CONTROL } from '../utils/constants';
5
5
  import { ISplit, MaybeThenable } from '../dtos/types';
@@ -1,7 +1,7 @@
1
1
  import { ENGINE_MATCHER_ALL } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
3
 
4
- export default function allMatcherContext(log: ILogger) {
4
+ export function allMatcherContext(log: ILogger) {
5
5
  return function allMatcher(runtimeAttr: string): boolean {
6
6
  log.debug(ENGINE_MATCHER_ALL);
7
7
 
@@ -2,7 +2,7 @@ import { IBetweenMatcherData } from '../../dtos/types';
2
2
  import { ENGINE_MATCHER_BETWEEN } from '../../logger/constants';
3
3
  import { ILogger } from '../../logger/types';
4
4
 
5
- export default function betweenMatcherContext(log: ILogger, ruleVO: IBetweenMatcherData) /*: Function */ {
5
+ export function betweenMatcherContext(log: ILogger, ruleVO: IBetweenMatcherData) /*: Function */ {
6
6
  return function betweenMatcher(runtimeAttr: number): boolean {
7
7
 
8
8
  let isBetween = runtimeAttr >= ruleVO.start && runtimeAttr <= ruleVO.end;
@@ -1,7 +1,7 @@
1
1
  import { ENGINE_MATCHER_BOOLEAN } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
3
 
4
- export default function booleanMatcherContext(log: ILogger, ruleAttr: boolean) /*: Function */ {
4
+ export function booleanMatcherContext(log: ILogger, ruleAttr: boolean) /*: Function */ {
5
5
  return function booleanMatcher(runtimeAttr: boolean): boolean {
6
6
  let booleanMatches = ruleAttr === runtimeAttr;
7
7
 
@@ -2,7 +2,7 @@ import { ENGINE_MATCHER_CONTAINS_ALL } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
3
  import { findIndex } from '../../utils/lang';
4
4
 
5
- export default function containsAllMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
5
+ export function containsAllSetMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
6
6
  return function containsAllMatcher(runtimeAttr: string[]): boolean {
7
7
  let containsAll = true;
8
8
 
@@ -2,7 +2,7 @@ import { ENGINE_MATCHER_CONTAINS_ANY } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
3
  import { findIndex } from '../../utils/lang';
4
4
 
5
- export default function containsAnyMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
5
+ export function containsAnySetMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
6
6
  return function containsAnyMatcher(runtimeAttr: string[]): boolean {
7
7
  let containsAny = false;
8
8
 
@@ -2,7 +2,7 @@ import { isString } from '../../utils/lang';
2
2
  import { ILogger } from '../../logger/types';
3
3
  import { ENGINE_MATCHER_CONTAINS_STRING } from '../../logger/constants';
4
4
 
5
- export default function containsStringMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
5
+ export function containsStringMatcherContext(log: ILogger, ruleAttr: string[]) /*: Function */ {
6
6
  return function containsStringMatcher(runtimeAttr: string): boolean {
7
7
  let contains = ruleAttr.some(e => isString(runtimeAttr) && runtimeAttr.indexOf(e) > -1);
8
8
 
@@ -1,11 +1,11 @@
1
1
  import { IDependencyMatcherData, MaybeThenable } from '../../dtos/types';
2
2
  import { IStorageAsync, IStorageSync } from '../../storages/types';
3
3
  import { ILogger } from '../../logger/types';
4
- import thenable from '../../utils/promise/thenable';
4
+ import { thenable } from '../../utils/promise/thenable';
5
5
  import { IDependencyMatcherValue, IEvaluation, ISplitEvaluator } from '../types';
6
6
  import { ENGINE_MATCHER_DEPENDENCY, ENGINE_MATCHER_DEPENDENCY_PRE } from '../../logger/constants';
7
7
 
8
- export default function dependencyMatcherContext(log: ILogger, { split, treatments }: IDependencyMatcherData, storage: IStorageSync | IStorageAsync) {
8
+ export function dependencyMatcherContext(log: ILogger, { split, treatments }: IDependencyMatcherData, storage: IStorageSync | IStorageAsync) {
9
9
 
10
10
  function checkTreatment(evaluation: IEvaluation, acceptableTreatments: string[], parentName: string) {
11
11
  let matches = false;
@@ -1,7 +1,7 @@
1
1
  import { ENGINE_MATCHER_EQUAL } from '../../logger/constants';
2
2
  import { ILogger } from '../../logger/types';
3
3
 
4
- export default function equalToMatcherContext(log: ILogger, ruleAttr: number) /*: Function */ {
4
+ export function equalToMatcherContext(log: ILogger, ruleAttr: number) /*: Function */ {
5
5
  return function equalToMatcher(runtimeAttr: number): boolean {
6
6
  let isEqual = runtimeAttr === ruleAttr;
7
7