@featurevisor/core 2.26.1 → 3.0.1

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 (390) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/coverage/clover.xml +4991 -3130
  3. package/coverage/coverage-final.json +63 -39
  4. package/coverage/lcov-report/block-navigation.js +1 -1
  5. package/coverage/lcov-report/index.html +248 -98
  6. package/coverage/lcov-report/sorter.js +21 -7
  7. package/coverage/lcov-report/src/assess-distribution/index.html +116 -0
  8. package/coverage/lcov-report/src/assess-distribution/index.ts.html +754 -0
  9. package/coverage/lcov-report/{list → src/benchmark}/index.html +30 -30
  10. package/coverage/lcov-report/src/benchmark/index.ts.html +793 -0
  11. package/coverage/lcov-report/{builder → src/builder}/allocator.ts.html +38 -38
  12. package/coverage/lcov-report/{builder/buildScopedConditions.ts.html → src/builder/applyContextToConditions.ts.html} +80 -65
  13. package/coverage/lcov-report/{builder/buildScopedDatafile.ts.html → src/builder/applyContextToDatafile.ts.html} +92 -92
  14. package/coverage/lcov-report/{builder/buildScopedSegments.ts.html → src/builder/applyContextToSegments.ts.html} +103 -67
  15. package/coverage/lcov-report/{builder → src/builder}/buildDatafile.ts.html +336 -306
  16. package/coverage/lcov-report/src/builder/buildProject.ts.html +1117 -0
  17. package/coverage/lcov-report/src/builder/buildRuntimeDatafiles.ts.html +256 -0
  18. package/coverage/lcov-report/{builder → src/builder}/getFeatureRanges.ts.html +22 -22
  19. package/coverage/lcov-report/{builder → src/builder}/hashes.ts.html +50 -50
  20. package/coverage/lcov-report/{builder → src/builder}/index.html +114 -84
  21. package/coverage/lcov-report/{tester/cliFormat.ts.html → src/builder/index.ts.html} +17 -29
  22. package/coverage/lcov-report/{builder → src/builder}/mutateVariables.ts.html +55 -55
  23. package/coverage/lcov-report/{builder → src/builder}/mutator.ts.html +118 -118
  24. package/coverage/lcov-report/{builder → src/builder}/revision.ts.html +15 -15
  25. package/coverage/lcov-report/{builder → src/builder}/traffic.ts.html +86 -86
  26. package/coverage/lcov-report/src/cli/cli.ts.html +400 -0
  27. package/coverage/lcov-report/{tester → src/cli}/index.html +41 -41
  28. package/coverage/lcov-report/src/cli/plugins.ts.html +214 -0
  29. package/coverage/lcov-report/{config → src/config}/index.html +31 -31
  30. package/coverage/lcov-report/{config → src/config}/index.ts.html +12 -12
  31. package/coverage/lcov-report/{config → src/config}/projectConfig.ts.html +312 -96
  32. package/coverage/lcov-report/{datasource → src/datasource}/adapter.ts.html +28 -73
  33. package/coverage/lcov-report/{datasource → src/datasource}/datasource.ts.html +191 -104
  34. package/coverage/lcov-report/{datasource → src/datasource}/filesystemAdapter.ts.html +233 -635
  35. package/coverage/lcov-report/{datasource → src/datasource}/index.html +48 -48
  36. package/coverage/lcov-report/{datasource → src/datasource}/index.ts.html +14 -14
  37. package/coverage/lcov-report/src/evaluate/index.html +116 -0
  38. package/coverage/lcov-report/src/evaluate/index.ts.html +814 -0
  39. package/coverage/lcov-report/src/find-duplicate-segments/findDuplicateSegments.ts.html +313 -0
  40. package/coverage/lcov-report/src/find-duplicate-segments/index.html +131 -0
  41. package/coverage/lcov-report/src/find-duplicate-segments/index.ts.html +307 -0
  42. package/coverage/lcov-report/src/find-usage/index.html +116 -0
  43. package/coverage/lcov-report/src/find-usage/index.ts.html +1780 -0
  44. package/coverage/lcov-report/src/generate-code/index.html +131 -0
  45. package/coverage/lcov-report/src/generate-code/index.ts.html +403 -0
  46. package/coverage/lcov-report/{generate-code → src/generate-code}/typescript.ts.html +266 -1361
  47. package/coverage/lcov-report/{generate-code → src}/index.html +38 -23
  48. package/coverage/lcov-report/src/info/index.html +116 -0
  49. package/coverage/lcov-report/src/info/index.ts.html +472 -0
  50. package/coverage/lcov-report/src/init/index.html +116 -0
  51. package/coverage/lcov-report/src/init/index.ts.html +280 -0
  52. package/coverage/lcov-report/{linter → src/linter}/attributeSchema.ts.html +160 -157
  53. package/coverage/lcov-report/{linter → src/linter}/checkCircularDependency.ts.html +25 -25
  54. package/coverage/lcov-report/{linter → src/linter}/checkPercentageExceedingSlot.ts.html +42 -42
  55. package/coverage/lcov-report/{linter → src/linter}/conditionSchema.ts.html +207 -207
  56. package/coverage/lcov-report/{linter → src/linter}/featureSchema.ts.html +462 -471
  57. package/coverage/lcov-report/{linter → src/linter}/groupSchema.ts.html +25 -22
  58. package/coverage/lcov-report/{linter → src/linter}/index.html +129 -99
  59. package/coverage/lcov-report/src/linter/index.ts.html +88 -0
  60. package/coverage/lcov-report/{linter → src/linter}/lintProject.ts.html +740 -332
  61. package/coverage/lcov-report/{linter → src/linter}/mutationNotation.ts.html +130 -130
  62. package/coverage/lcov-report/{linter → src/linter}/printError.ts.html +27 -27
  63. package/coverage/lcov-report/{linter → src/linter}/schema.ts.html +153 -150
  64. package/coverage/lcov-report/{linter → src/linter}/segmentSchema.ts.html +18 -15
  65. package/coverage/lcov-report/src/linter/targetSchema.ts.html +223 -0
  66. package/coverage/lcov-report/{linter → src/linter}/testSchema.ts.html +54 -48
  67. package/coverage/lcov-report/{linter → src/linter}/zodHelpers.ts.html +17 -17
  68. package/coverage/lcov-report/src/list/index.html +131 -0
  69. package/coverage/lcov-report/src/list/index.ts.html +2065 -0
  70. package/coverage/lcov-report/{list → src/list}/matrix.ts.html +43 -58
  71. package/coverage/lcov-report/src/promoter/index.html +116 -0
  72. package/coverage/lcov-report/src/promoter/index.ts.html +3883 -0
  73. package/coverage/lcov-report/src/sets.ts.html +313 -0
  74. package/coverage/lcov-report/src/targeting.ts.html +403 -0
  75. package/coverage/lcov-report/src/tester/cliFormat.ts.html +133 -0
  76. package/coverage/lcov-report/{tester → src/tester}/helpers.ts.html +15 -15
  77. package/coverage/lcov-report/src/tester/index.html +206 -0
  78. package/coverage/lcov-report/src/tester/prettyDuration.ts.html +187 -0
  79. package/coverage/lcov-report/src/tester/printTestResult.ts.html +337 -0
  80. package/coverage/lcov-report/src/tester/testFeature.ts.html +1186 -0
  81. package/coverage/lcov-report/src/tester/testProject.ts.html +1018 -0
  82. package/coverage/lcov-report/src/tester/testSegment.ts.html +316 -0
  83. package/coverage/lcov-report/{utils → src/utils}/extractKeys.ts.html +68 -68
  84. package/coverage/lcov-report/{utils → src/utils}/git.ts.html +44 -68
  85. package/coverage/lcov-report/{utils → src/utils}/index.html +44 -44
  86. package/coverage/lcov-report/{utils → src/utils}/index.ts.html +14 -14
  87. package/coverage/lcov-report/{utils → src/utils}/pretty.ts.html +20 -20
  88. package/coverage/lcov.info +10121 -5723
  89. package/jest.config.js +13 -4
  90. package/lib/assess-distribution/index.d.ts +1 -1
  91. package/lib/assess-distribution/index.js +59 -40
  92. package/lib/assess-distribution/index.js.map +1 -1
  93. package/lib/benchmark/index.d.ts +8 -5
  94. package/lib/benchmark/index.js +82 -65
  95. package/lib/benchmark/index.js.map +1 -1
  96. package/lib/builder/applyContextToConditions.d.ts +5 -0
  97. package/lib/builder/{buildScopedConditions.js → applyContextToConditions.js} +19 -14
  98. package/lib/builder/applyContextToConditions.js.map +1 -0
  99. package/lib/builder/applyContextToDatafile.d.ts +2 -0
  100. package/lib/builder/{buildScopedDatafile.js → applyContextToDatafile.js} +26 -26
  101. package/lib/builder/applyContextToDatafile.js.map +1 -0
  102. package/lib/builder/applyContextToSegments.d.ts +5 -0
  103. package/lib/builder/{buildScopedSegments.js → applyContextToSegments.js} +19 -14
  104. package/lib/builder/applyContextToSegments.js.map +1 -0
  105. package/lib/builder/buildDatafile.d.ts +9 -6
  106. package/lib/builder/buildDatafile.js +86 -51
  107. package/lib/builder/buildDatafile.js.map +1 -1
  108. package/lib/builder/buildProject.d.ts +17 -3
  109. package/lib/builder/buildProject.js +151 -59
  110. package/lib/builder/buildProject.js.map +1 -1
  111. package/lib/builder/buildRuntimeDatafiles.d.ts +12 -0
  112. package/lib/builder/buildRuntimeDatafiles.js +35 -0
  113. package/lib/builder/buildRuntimeDatafiles.js.map +1 -0
  114. package/lib/builder/getFeatureRanges.js +34 -1
  115. package/lib/builder/getFeatureRanges.js.map +1 -1
  116. package/lib/builder/hashes.js +34 -1
  117. package/lib/builder/hashes.js.map +1 -1
  118. package/lib/builder/index.d.ts +0 -1
  119. package/lib/builder/index.js +0 -1
  120. package/lib/builder/index.js.map +1 -1
  121. package/lib/cli/cli.js +0 -4
  122. package/lib/cli/cli.js.map +1 -1
  123. package/lib/cli/plugins.js +7 -2
  124. package/lib/cli/plugins.js.map +1 -1
  125. package/lib/config/projectConfig.d.ts +17 -17
  126. package/lib/config/projectConfig.js +101 -15
  127. package/lib/config/projectConfig.js.map +1 -1
  128. package/lib/datasource/adapter.d.ts +7 -9
  129. package/lib/datasource/adapter.js +0 -7
  130. package/lib/datasource/adapter.js.map +1 -1
  131. package/lib/datasource/datasource.d.ts +15 -5
  132. package/lib/datasource/datasource.js +37 -9
  133. package/lib/datasource/datasource.js.map +1 -1
  134. package/lib/datasource/filesystemAdapter.d.ts +4 -10
  135. package/lib/datasource/filesystemAdapter.js +111 -149
  136. package/lib/datasource/filesystemAdapter.js.map +1 -1
  137. package/lib/evaluate/index.d.ts +1 -7
  138. package/lib/evaluate/index.js +81 -67
  139. package/lib/evaluate/index.js.map +1 -1
  140. package/lib/find-duplicate-segments/findDuplicateSegments.js +34 -1
  141. package/lib/find-duplicate-segments/findDuplicateSegments.js.map +1 -1
  142. package/lib/find-duplicate-segments/index.js +21 -13
  143. package/lib/find-duplicate-segments/index.js.map +1 -1
  144. package/lib/find-usage/index.js +57 -41
  145. package/lib/find-usage/index.js.map +1 -1
  146. package/lib/generate-code/index.d.ts +1 -1
  147. package/lib/generate-code/index.js +64 -21
  148. package/lib/generate-code/index.js.map +1 -1
  149. package/lib/generate-code/typescript.d.ts +1 -1
  150. package/lib/generate-code/typescript.js +59 -333
  151. package/lib/generate-code/typescript.js.map +1 -1
  152. package/lib/index.d.ts +2 -1
  153. package/lib/index.js +2 -1
  154. package/lib/index.js.map +1 -1
  155. package/lib/info/index.js +57 -16
  156. package/lib/info/index.js.map +1 -1
  157. package/lib/init/index.d.ts +2 -2
  158. package/lib/init/index.js +39 -3
  159. package/lib/init/index.js.map +1 -1
  160. package/lib/linter/attributeSchema.d.ts +1 -0
  161. package/lib/linter/attributeSchema.js +1 -0
  162. package/lib/linter/attributeSchema.js.map +1 -1
  163. package/lib/linter/conditionSchema.js +5 -5
  164. package/lib/linter/conditionSchema.js.map +1 -1
  165. package/lib/linter/featureSchema.d.ts +4 -1
  166. package/lib/linter/featureSchema.js +15 -13
  167. package/lib/linter/featureSchema.js.map +1 -1
  168. package/lib/linter/groupSchema.d.ts +1 -0
  169. package/lib/linter/groupSchema.js +1 -0
  170. package/lib/linter/groupSchema.js.map +1 -1
  171. package/lib/linter/lintProject.d.ts +1 -3
  172. package/lib/linter/lintProject.js +198 -68
  173. package/lib/linter/lintProject.js.map +1 -1
  174. package/lib/linter/schema.js +1 -0
  175. package/lib/linter/schema.js.map +1 -1
  176. package/lib/linter/segmentSchema.d.ts +1 -0
  177. package/lib/linter/segmentSchema.js +1 -0
  178. package/lib/linter/segmentSchema.js.map +1 -1
  179. package/lib/linter/targetSchema.d.ts +16 -0
  180. package/lib/linter/targetSchema.js +40 -0
  181. package/lib/linter/targetSchema.js.map +1 -0
  182. package/lib/linter/testSchema.d.ts +4 -3
  183. package/lib/linter/testSchema.js +9 -4
  184. package/lib/linter/testSchema.js.map +1 -1
  185. package/lib/list/index.d.ts +1 -0
  186. package/lib/list/index.js +131 -12
  187. package/lib/list/index.js.map +1 -1
  188. package/lib/list/matrix.js +3 -7
  189. package/lib/list/matrix.js.map +1 -1
  190. package/lib/promoter/index.d.ts +50 -0
  191. package/lib/promoter/index.js +880 -0
  192. package/lib/promoter/index.js.map +1 -0
  193. package/lib/sets.d.ts +11 -0
  194. package/lib/sets.js +81 -0
  195. package/lib/sets.js.map +1 -0
  196. package/lib/targeting.d.ts +14 -0
  197. package/lib/targeting.js +82 -0
  198. package/lib/targeting.js.map +1 -0
  199. package/lib/tester/cliFormat.d.ts +7 -1
  200. package/lib/tester/cliFormat.js +11 -2
  201. package/lib/tester/cliFormat.js.map +1 -1
  202. package/lib/tester/printTestResult.js +2 -2
  203. package/lib/tester/printTestResult.js.map +1 -1
  204. package/lib/tester/testFeature.d.ts +0 -1
  205. package/lib/tester/testFeature.js +8 -25
  206. package/lib/tester/testFeature.js.map +1 -1
  207. package/lib/tester/testProject.d.ts +2 -3
  208. package/lib/tester/testProject.js +93 -86
  209. package/lib/tester/testProject.js.map +1 -1
  210. package/lib/tester/testSegment.d.ts +1 -1
  211. package/lib/tester/testSegment.js +3 -21
  212. package/lib/tester/testSegment.js.map +1 -1
  213. package/lib/utils/git.js +45 -19
  214. package/lib/utils/git.js.map +1 -1
  215. package/package.json +12 -12
  216. package/src/assess-distribution/index.ts +72 -52
  217. package/src/benchmark/index.ts +124 -91
  218. package/src/builder/{buildScopedConditions.spec.ts → applyContextToConditions.spec.ts} +160 -142
  219. package/src/builder/{buildScopedConditions.ts → applyContextToConditions.ts} +19 -14
  220. package/src/builder/{buildScopedDatafile.spec.ts → applyContextToDatafile.spec.ts} +141 -81
  221. package/src/builder/{buildScopedDatafile.ts → applyContextToDatafile.ts} +33 -33
  222. package/src/builder/{buildScopedSegments.spec.ts → applyContextToSegments.spec.ts} +171 -151
  223. package/src/builder/{buildScopedSegments.ts → applyContextToSegments.ts} +26 -14
  224. package/src/builder/buildDatafile.spec.ts +192 -14
  225. package/src/builder/buildDatafile.ts +74 -64
  226. package/src/builder/buildProject.ts +171 -86
  227. package/src/builder/buildRuntimeDatafiles.ts +57 -0
  228. package/src/builder/index.ts +0 -1
  229. package/src/cli/cli.ts +0 -5
  230. package/src/cli/plugins.ts +7 -2
  231. package/src/config/projectConfig.spec.ts +171 -8
  232. package/src/config/projectConfig.ts +100 -28
  233. package/src/datasource/adapter.ts +8 -23
  234. package/src/datasource/datasource.ts +50 -21
  235. package/src/datasource/filesystemAdapter.spec.ts +133 -74
  236. package/src/datasource/filesystemAdapter.ts +93 -227
  237. package/src/evaluate/index.ts +109 -97
  238. package/src/find-duplicate-segments/index.ts +34 -16
  239. package/src/find-usage/index.ts +89 -44
  240. package/src/generate-code/index.ts +36 -24
  241. package/src/generate-code/typescript.spec.ts +106 -0
  242. package/src/generate-code/typescript.ts +33 -398
  243. package/src/index.ts +2 -1
  244. package/src/info/index.ts +72 -16
  245. package/src/init/index.ts +1 -1
  246. package/src/linter/attributeSchema.ts +1 -0
  247. package/src/linter/conditionSchema.spec.ts +23 -3
  248. package/src/linter/conditionSchema.ts +5 -5
  249. package/src/linter/featureSchema.spec.ts +107 -18
  250. package/src/linter/featureSchema.ts +25 -28
  251. package/src/linter/groupSchema.ts +1 -0
  252. package/src/linter/lintProject.spec.ts +131 -92
  253. package/src/linter/lintProject.ts +233 -97
  254. package/src/linter/schema.ts +1 -0
  255. package/src/linter/segmentSchema.spec.ts +5 -3
  256. package/src/linter/segmentSchema.ts +1 -0
  257. package/src/linter/targetSchema.spec.ts +159 -0
  258. package/src/linter/targetSchema.ts +46 -0
  259. package/src/linter/testSchema.spec.ts +70 -5
  260. package/src/linter/testSchema.ts +12 -10
  261. package/src/list/index.spec.ts +135 -0
  262. package/src/list/index.ts +188 -12
  263. package/src/list/matrix.ts +3 -8
  264. package/src/promoter/index.spec.ts +617 -0
  265. package/src/promoter/index.ts +1266 -0
  266. package/src/sets.ts +76 -0
  267. package/src/targeting.spec.ts +74 -0
  268. package/src/targeting.ts +106 -0
  269. package/src/tester/cliFormat.ts +11 -1
  270. package/src/tester/printTestResult.ts +12 -3
  271. package/src/tester/testFeature.ts +10 -36
  272. package/src/tester/testProject.spec.ts +50 -0
  273. package/src/tester/testProject.ts +89 -140
  274. package/src/tester/testSegment.ts +5 -22
  275. package/src/utils/git.ts +13 -21
  276. package/tsconfig.cjs.json +5 -1
  277. package/tsconfig.typecheck.json +9 -0
  278. package/coverage/lcov-report/builder/convertToV1.ts.html +0 -583
  279. package/lib/builder/allocator.spec.d.ts +0 -1
  280. package/lib/builder/allocator.spec.js +0 -85
  281. package/lib/builder/allocator.spec.js.map +0 -1
  282. package/lib/builder/buildDatafile.spec.d.ts +0 -1
  283. package/lib/builder/buildDatafile.spec.js +0 -233
  284. package/lib/builder/buildDatafile.spec.js.map +0 -1
  285. package/lib/builder/buildScopedConditions.d.ts +0 -5
  286. package/lib/builder/buildScopedConditions.js.map +0 -1
  287. package/lib/builder/buildScopedConditions.spec.d.ts +0 -1
  288. package/lib/builder/buildScopedConditions.spec.js +0 -2167
  289. package/lib/builder/buildScopedConditions.spec.js.map +0 -1
  290. package/lib/builder/buildScopedDatafile.d.ts +0 -2
  291. package/lib/builder/buildScopedDatafile.js.map +0 -1
  292. package/lib/builder/buildScopedDatafile.spec.d.ts +0 -1
  293. package/lib/builder/buildScopedDatafile.spec.js +0 -2277
  294. package/lib/builder/buildScopedDatafile.spec.js.map +0 -1
  295. package/lib/builder/buildScopedSegments.d.ts +0 -5
  296. package/lib/builder/buildScopedSegments.js.map +0 -1
  297. package/lib/builder/buildScopedSegments.spec.d.ts +0 -1
  298. package/lib/builder/buildScopedSegments.spec.js +0 -1062
  299. package/lib/builder/buildScopedSegments.spec.js.map +0 -1
  300. package/lib/builder/convertToV1.d.ts +0 -10
  301. package/lib/builder/convertToV1.js +0 -119
  302. package/lib/builder/convertToV1.js.map +0 -1
  303. package/lib/builder/mutateVariables.spec.d.ts +0 -1
  304. package/lib/builder/mutateVariables.spec.js +0 -1074
  305. package/lib/builder/mutateVariables.spec.js.map +0 -1
  306. package/lib/builder/mutator.spec.d.ts +0 -1
  307. package/lib/builder/mutator.spec.js +0 -368
  308. package/lib/builder/mutator.spec.js.map +0 -1
  309. package/lib/builder/revision.spec.d.ts +0 -1
  310. package/lib/builder/revision.spec.js +0 -21
  311. package/lib/builder/revision.spec.js.map +0 -1
  312. package/lib/builder/traffic.spec.d.ts +0 -1
  313. package/lib/builder/traffic.spec.js +0 -872
  314. package/lib/builder/traffic.spec.js.map +0 -1
  315. package/lib/config/projectConfig.spec.d.ts +0 -1
  316. package/lib/config/projectConfig.spec.js +0 -24
  317. package/lib/config/projectConfig.spec.js.map +0 -1
  318. package/lib/datasource/filesystemAdapter.spec.d.ts +0 -1
  319. package/lib/datasource/filesystemAdapter.spec.js +0 -88
  320. package/lib/datasource/filesystemAdapter.spec.js.map +0 -1
  321. package/lib/generate-code/typescript.spec.d.ts +0 -1
  322. package/lib/generate-code/typescript.spec.js +0 -78
  323. package/lib/generate-code/typescript.spec.js.map +0 -1
  324. package/lib/linter/attributeSchema.spec.d.ts +0 -1
  325. package/lib/linter/attributeSchema.spec.js +0 -266
  326. package/lib/linter/attributeSchema.spec.js.map +0 -1
  327. package/lib/linter/conditionSchema.spec.d.ts +0 -1
  328. package/lib/linter/conditionSchema.spec.js +0 -380
  329. package/lib/linter/conditionSchema.spec.js.map +0 -1
  330. package/lib/linter/featureSchema.spec.d.ts +0 -1
  331. package/lib/linter/featureSchema.spec.js +0 -1552
  332. package/lib/linter/featureSchema.spec.js.map +0 -1
  333. package/lib/linter/lintProject.spec.d.ts +0 -1
  334. package/lib/linter/lintProject.spec.js +0 -211
  335. package/lib/linter/lintProject.spec.js.map +0 -1
  336. package/lib/linter/mutationNotation.spec.d.ts +0 -1
  337. package/lib/linter/mutationNotation.spec.js +0 -598
  338. package/lib/linter/mutationNotation.spec.js.map +0 -1
  339. package/lib/linter/schema.spec.d.ts +0 -1
  340. package/lib/linter/schema.spec.js +0 -535
  341. package/lib/linter/schema.spec.js.map +0 -1
  342. package/lib/linter/segmentSchema.spec.d.ts +0 -1
  343. package/lib/linter/segmentSchema.spec.js +0 -303
  344. package/lib/linter/segmentSchema.spec.js.map +0 -1
  345. package/lib/linter/testSchema.spec.d.ts +0 -1
  346. package/lib/linter/testSchema.spec.js +0 -162
  347. package/lib/linter/testSchema.spec.js.map +0 -1
  348. package/lib/list/matrix.spec.d.ts +0 -1
  349. package/lib/list/matrix.spec.js +0 -42
  350. package/lib/list/matrix.spec.js.map +0 -1
  351. package/lib/site/exportSite.d.ts +0 -2
  352. package/lib/site/exportSite.js +0 -30
  353. package/lib/site/exportSite.js.map +0 -1
  354. package/lib/site/generateHistory.d.ts +0 -3
  355. package/lib/site/generateHistory.js +0 -31
  356. package/lib/site/generateHistory.js.map +0 -1
  357. package/lib/site/generateSiteSearchIndex.d.ts +0 -4
  358. package/lib/site/generateSiteSearchIndex.js +0 -195
  359. package/lib/site/generateSiteSearchIndex.js.map +0 -1
  360. package/lib/site/getLastModifiedFromHistory.d.ts +0 -2
  361. package/lib/site/getLastModifiedFromHistory.js +0 -18
  362. package/lib/site/getLastModifiedFromHistory.js.map +0 -1
  363. package/lib/site/getOwnerAndRepoFromUrl.d.ts +0 -4
  364. package/lib/site/getOwnerAndRepoFromUrl.js +0 -20
  365. package/lib/site/getOwnerAndRepoFromUrl.js.map +0 -1
  366. package/lib/site/getRelativePaths.d.ts +0 -6
  367. package/lib/site/getRelativePaths.js +0 -15
  368. package/lib/site/getRelativePaths.js.map +0 -1
  369. package/lib/site/getRepoDetails.d.ts +0 -8
  370. package/lib/site/getRepoDetails.js +0 -48
  371. package/lib/site/getRepoDetails.js.map +0 -1
  372. package/lib/site/index.d.ts +0 -2
  373. package/lib/site/index.js +0 -43
  374. package/lib/site/index.js.map +0 -1
  375. package/lib/site/serveSite.d.ts +0 -2
  376. package/lib/site/serveSite.js +0 -54
  377. package/lib/site/serveSite.js.map +0 -1
  378. package/lib/tester/helpers.spec.d.ts +0 -1
  379. package/lib/tester/helpers.spec.js +0 -115
  380. package/lib/tester/helpers.spec.js.map +0 -1
  381. package/src/builder/convertToV1.ts +0 -166
  382. package/src/site/exportSite.ts +0 -42
  383. package/src/site/generateHistory.ts +0 -40
  384. package/src/site/generateSiteSearchIndex.ts +0 -258
  385. package/src/site/getLastModifiedFromHistory.ts +0 -21
  386. package/src/site/getOwnerAndRepoFromUrl.ts +0 -17
  387. package/src/site/getRelativePaths.ts +0 -24
  388. package/src/site/getRepoDetails.ts +0 -62
  389. package/src/site/index.ts +0 -46
  390. package/src/site/serveSite.ts +0 -58
@@ -1,13 +1,13 @@
1
1
  import type { Condition, DatafileContent } from "@featurevisor/types";
2
2
 
3
3
  import {
4
- buildScopedCondition,
4
+ applyContextToCondition,
5
5
  removeRedundantConditions,
6
- buildScopedConditions,
7
- } from "./buildScopedConditions";
8
- import { DatafileReader, createLogger } from "@featurevisor/sdk";
6
+ applyContextToConditions,
7
+ } from "./applyContextToConditions";
8
+ import { createFeaturevisor } from "@featurevisor/sdk";
9
9
 
10
- describe("core: buildScopedConditions", function () {
10
+ describe("core: applyContextToConditions", function () {
11
11
  const emptyDatafile: DatafileContent = {
12
12
  schemaVersion: "2",
13
13
  revision: "unknown",
@@ -15,24 +15,24 @@ describe("core: buildScopedConditions", function () {
15
15
  features: {},
16
16
  };
17
17
 
18
- const datafileReader = new DatafileReader({
18
+ const featurevisor = createFeaturevisor({
19
19
  datafile: emptyDatafile,
20
- logger: createLogger({ level: "fatal" }),
20
+ logLevel: "fatal",
21
21
  });
22
22
 
23
- describe("buildScopedConditions (plural)", function () {
24
- test("buildScopedConditions is a function", function () {
25
- expect(buildScopedConditions).toBeInstanceOf(Function);
23
+ describe("applyContextToConditions (plural)", function () {
24
+ test("applyContextToConditions is a function", function () {
25
+ expect(applyContextToConditions).toBeInstanceOf(Function);
26
26
  });
27
27
 
28
28
  test("simple cases", function () {
29
29
  // "*" remains "*"
30
- expect(buildScopedConditions(datafileReader, "*", {})).toEqual("*");
30
+ expect(applyContextToConditions(featurevisor, "*", {})).toEqual("*");
31
31
 
32
32
  // Plain condition that matches
33
33
  expect(
34
- buildScopedConditions(
35
- datafileReader,
34
+ applyContextToConditions(
35
+ featurevisor,
36
36
  {
37
37
  attribute: "platform",
38
38
  operator: "equals",
@@ -46,8 +46,8 @@ describe("core: buildScopedConditions", function () {
46
46
 
47
47
  // Plain condition that doesn't match
48
48
  expect(
49
- buildScopedConditions(
50
- datafileReader,
49
+ applyContextToConditions(
50
+ featurevisor,
51
51
  {
52
52
  attribute: "platform",
53
53
  operator: "equals",
@@ -65,8 +65,8 @@ describe("core: buildScopedConditions", function () {
65
65
 
66
66
  // Array of conditions - partial match (redundant "*" removed)
67
67
  expect(
68
- buildScopedConditions(
69
- datafileReader,
68
+ applyContextToConditions(
69
+ featurevisor,
70
70
  [
71
71
  {
72
72
  attribute: "platform",
@@ -93,8 +93,8 @@ describe("core: buildScopedConditions", function () {
93
93
 
94
94
  // Array of conditions - full match (all "*" becomes "*")
95
95
  expect(
96
- buildScopedConditions(
97
- datafileReader,
96
+ applyContextToConditions(
97
+ featurevisor,
98
98
  [
99
99
  {
100
100
  attribute: "platform",
@@ -116,8 +116,8 @@ describe("core: buildScopedConditions", function () {
116
116
 
117
117
  // Array of conditions - no match
118
118
  expect(
119
- buildScopedConditions(
120
- datafileReader,
119
+ applyContextToConditions(
120
+ featurevisor,
121
121
  [
122
122
  {
123
123
  attribute: "platform",
@@ -152,8 +152,8 @@ describe("core: buildScopedConditions", function () {
152
152
  test("AND conditions", function () {
153
153
  // AND with all matching conditions (all "*" becomes "*")
154
154
  expect(
155
- buildScopedConditions(
156
- datafileReader,
155
+ applyContextToConditions(
156
+ featurevisor,
157
157
  {
158
158
  and: [
159
159
  {
@@ -177,8 +177,8 @@ describe("core: buildScopedConditions", function () {
177
177
 
178
178
  // AND with partial match (redundant "*" removed)
179
179
  expect(
180
- buildScopedConditions(
181
- datafileReader,
180
+ applyContextToConditions(
181
+ featurevisor,
182
182
  {
183
183
  and: [
184
184
  {
@@ -209,8 +209,8 @@ describe("core: buildScopedConditions", function () {
209
209
 
210
210
  // AND with no matches
211
211
  expect(
212
- buildScopedConditions(
213
- datafileReader,
212
+ applyContextToConditions(
213
+ featurevisor,
214
214
  {
215
215
  and: [
216
216
  {
@@ -247,8 +247,8 @@ describe("core: buildScopedConditions", function () {
247
247
 
248
248
  // AND with "*" in it (all "*" becomes "*")
249
249
  expect(
250
- buildScopedConditions(
251
- datafileReader,
250
+ applyContextToConditions(
251
+ featurevisor,
252
252
  {
253
253
  and: [
254
254
  "*",
@@ -271,8 +271,8 @@ describe("core: buildScopedConditions", function () {
271
271
  // Note: This would require both conditions to match, which isn't possible with same attribute
272
272
  // So testing with different attributes that both match
273
273
  expect(
274
- buildScopedConditions(
275
- datafileReader,
274
+ applyContextToConditions(
275
+ featurevisor,
276
276
  {
277
277
  or: [
278
278
  {
@@ -296,8 +296,8 @@ describe("core: buildScopedConditions", function () {
296
296
 
297
297
  // OR with partial match (redundant "*" removed, but OR structure remains)
298
298
  expect(
299
- buildScopedConditions(
300
- datafileReader,
299
+ applyContextToConditions(
300
+ featurevisor,
301
301
  {
302
302
  or: [
303
303
  {
@@ -328,8 +328,8 @@ describe("core: buildScopedConditions", function () {
328
328
 
329
329
  // OR with no matches
330
330
  expect(
331
- buildScopedConditions(
332
- datafileReader,
331
+ applyContextToConditions(
332
+ featurevisor,
333
333
  {
334
334
  or: [
335
335
  {
@@ -365,10 +365,10 @@ describe("core: buildScopedConditions", function () {
365
365
  });
366
366
 
367
367
  test("NOT conditions", function () {
368
- // NOT with matching condition (all "*" becomes "*")
368
+ // NOT with matching condition remains an always-false expression
369
369
  expect(
370
- buildScopedConditions(
371
- datafileReader,
370
+ applyContextToConditions(
371
+ featurevisor,
372
372
  {
373
373
  not: [
374
374
  {
@@ -382,12 +382,14 @@ describe("core: buildScopedConditions", function () {
382
382
  platform: "web",
383
383
  },
384
384
  ),
385
- ).toEqual("*");
385
+ ).toEqual({
386
+ not: ["*"],
387
+ });
386
388
 
387
389
  // NOT with non-matching condition
388
390
  expect(
389
- buildScopedConditions(
390
- datafileReader,
391
+ applyContextToConditions(
392
+ featurevisor,
391
393
  {
392
394
  not: [
393
395
  {
@@ -411,10 +413,10 @@ describe("core: buildScopedConditions", function () {
411
413
  ],
412
414
  });
413
415
 
414
- // NOT with multiple conditions (all "*" becomes "*")
416
+ // NOT with multiple matching conditions remains an always-false expression
415
417
  expect(
416
- buildScopedConditions(
417
- datafileReader,
418
+ applyContextToConditions(
419
+ featurevisor,
418
420
  {
419
421
  not: [
420
422
  {
@@ -434,14 +436,16 @@ describe("core: buildScopedConditions", function () {
434
436
  browser: "chrome",
435
437
  },
436
438
  ),
437
- ).toEqual("*");
439
+ ).toEqual({
440
+ not: ["*"],
441
+ });
438
442
  });
439
443
 
440
444
  test("nested AND conditions", function () {
441
445
  // Nested AND with all matching (all "*" becomes "*")
442
446
  expect(
443
- buildScopedConditions(
444
- datafileReader,
447
+ applyContextToConditions(
448
+ featurevisor,
445
449
  {
446
450
  and: [
447
451
  {
@@ -475,8 +479,8 @@ describe("core: buildScopedConditions", function () {
475
479
 
476
480
  // Nested AND with partial match (redundant "*" removed)
477
481
  expect(
478
- buildScopedConditions(
479
- datafileReader,
482
+ applyContextToConditions(
483
+ featurevisor,
480
484
  {
481
485
  and: [
482
486
  {
@@ -523,8 +527,8 @@ describe("core: buildScopedConditions", function () {
523
527
  test("nested OR conditions", function () {
524
528
  // Nested OR with outer match (redundant "*" removed, but inner OR remains)
525
529
  expect(
526
- buildScopedConditions(
527
- datafileReader,
530
+ applyContextToConditions(
531
+ featurevisor,
528
532
  {
529
533
  or: [
530
534
  {
@@ -573,8 +577,8 @@ describe("core: buildScopedConditions", function () {
573
577
 
574
578
  // Nested OR with inner match (redundant "*" removed, but outer OR remains)
575
579
  expect(
576
- buildScopedConditions(
577
- datafileReader,
580
+ applyContextToConditions(
581
+ featurevisor,
578
582
  {
579
583
  or: [
580
584
  {
@@ -623,10 +627,10 @@ describe("core: buildScopedConditions", function () {
623
627
  });
624
628
 
625
629
  test("nested NOT conditions", function () {
626
- // Nested NOT (all "*" becomes "*")
630
+ // Nested NOT preserves non-broadening false expressions
627
631
  expect(
628
- buildScopedConditions(
629
- datafileReader,
632
+ applyContextToConditions(
633
+ featurevisor,
630
634
  {
631
635
  not: [
632
636
  {
@@ -650,14 +654,20 @@ describe("core: buildScopedConditions", function () {
650
654
  browser: "chrome",
651
655
  },
652
656
  ),
653
- ).toEqual("*");
657
+ ).toEqual({
658
+ not: [
659
+ {
660
+ not: ["*"],
661
+ },
662
+ ],
663
+ });
654
664
  });
655
665
 
656
666
  test("mixed nested conditions", function () {
657
667
  // AND with nested OR (redundant "*" removed, but OR structure remains if not all match)
658
668
  expect(
659
- buildScopedConditions(
660
- datafileReader,
669
+ applyContextToConditions(
670
+ featurevisor,
661
671
  {
662
672
  and: [
663
673
  {
@@ -702,8 +712,8 @@ describe("core: buildScopedConditions", function () {
702
712
 
703
713
  // OR with nested AND (redundant "*" removed, but OR structure remains if not all match)
704
714
  expect(
705
- buildScopedConditions(
706
- datafileReader,
715
+ applyContextToConditions(
716
+ featurevisor,
707
717
  {
708
718
  or: [
709
719
  {
@@ -744,8 +754,8 @@ describe("core: buildScopedConditions", function () {
744
754
 
745
755
  // AND with nested NOT (redundant "*" removed)
746
756
  expect(
747
- buildScopedConditions(
748
- datafileReader,
757
+ applyContextToConditions(
758
+ featurevisor,
749
759
  {
750
760
  and: [
751
761
  {
@@ -785,8 +795,8 @@ describe("core: buildScopedConditions", function () {
785
795
 
786
796
  // Complex nested structure (redundant "*" removed)
787
797
  expect(
788
- buildScopedConditions(
789
- datafileReader,
798
+ applyContextToConditions(
799
+ featurevisor,
790
800
  {
791
801
  and: [
792
802
  {
@@ -843,8 +853,8 @@ describe("core: buildScopedConditions", function () {
843
853
  test("arrays with nested conditions", function () {
844
854
  // Array with AND condition (redundant "*" removed)
845
855
  expect(
846
- buildScopedConditions(
847
- datafileReader,
856
+ applyContextToConditions(
857
+ featurevisor,
848
858
  [
849
859
  {
850
860
  attribute: "platform",
@@ -876,8 +886,8 @@ describe("core: buildScopedConditions", function () {
876
886
 
877
887
  // Array with OR condition (redundant "*" removed, but OR structure remains if not all match)
878
888
  expect(
879
- buildScopedConditions(
880
- datafileReader,
889
+ applyContextToConditions(
890
+ featurevisor,
881
891
  [
882
892
  {
883
893
  attribute: "platform",
@@ -920,8 +930,8 @@ describe("core: buildScopedConditions", function () {
920
930
  test("edge cases", function () {
921
931
  // Empty context
922
932
  expect(
923
- buildScopedConditions(
924
- datafileReader,
933
+ applyContextToConditions(
934
+ featurevisor,
925
935
  {
926
936
  attribute: "platform",
927
937
  operator: "equals",
@@ -936,12 +946,12 @@ describe("core: buildScopedConditions", function () {
936
946
  });
937
947
 
938
948
  // Empty array (all "*" becomes "*")
939
- expect(buildScopedConditions(datafileReader, [], {})).toEqual("*");
949
+ expect(applyContextToConditions(featurevisor, [], {})).toEqual("*");
940
950
 
941
951
  // "*" in array with matching condition (all "*" becomes "*")
942
952
  expect(
943
- buildScopedConditions(
944
- datafileReader,
953
+ applyContextToConditions(
954
+ featurevisor,
945
955
  [
946
956
  "*",
947
957
  {
@@ -958,8 +968,8 @@ describe("core: buildScopedConditions", function () {
958
968
 
959
969
  // AND with empty array (all "*" becomes "*")
960
970
  expect(
961
- buildScopedConditions(
962
- datafileReader,
971
+ applyContextToConditions(
972
+ featurevisor,
963
973
  {
964
974
  and: [],
965
975
  },
@@ -969,8 +979,8 @@ describe("core: buildScopedConditions", function () {
969
979
 
970
980
  // OR with empty array (all "*" becomes "*")
971
981
  expect(
972
- buildScopedConditions(
973
- datafileReader,
982
+ applyContextToConditions(
983
+ featurevisor,
974
984
  {
975
985
  or: [],
976
986
  },
@@ -980,19 +990,19 @@ describe("core: buildScopedConditions", function () {
980
990
  });
981
991
  });
982
992
 
983
- describe("buildScopedCondition (singular)", function () {
984
- test("buildScopedCondition is a function", function () {
985
- expect(buildScopedCondition).toBeInstanceOf(Function);
993
+ describe("applyContextToCondition (singular)", function () {
994
+ test("applyContextToCondition is a function", function () {
995
+ expect(applyContextToCondition).toBeInstanceOf(Function);
986
996
  });
987
997
 
988
998
  test("simple cases", function () {
989
999
  // "*" remains "*"
990
- expect(buildScopedCondition(datafileReader, "*", {})).toEqual("*");
1000
+ expect(applyContextToCondition(featurevisor, "*", {})).toEqual("*");
991
1001
 
992
1002
  // Plain condition that matches
993
1003
  expect(
994
- buildScopedCondition(
995
- datafileReader,
1004
+ applyContextToCondition(
1005
+ featurevisor,
996
1006
  {
997
1007
  attribute: "platform",
998
1008
  operator: "equals",
@@ -1006,8 +1016,8 @@ describe("core: buildScopedConditions", function () {
1006
1016
 
1007
1017
  // Plain condition that doesn't match
1008
1018
  expect(
1009
- buildScopedCondition(
1010
- datafileReader,
1019
+ applyContextToCondition(
1020
+ featurevisor,
1011
1021
  {
1012
1022
  attribute: "platform",
1013
1023
  operator: "equals",
@@ -1039,7 +1049,7 @@ describe("core: buildScopedConditions", function () {
1039
1049
 
1040
1050
  // Partial match
1041
1051
  expect(
1042
- buildScopedCondition(datafileReader, originalConditions, {
1052
+ applyContextToCondition(featurevisor, originalConditions, {
1043
1053
  platform: "web",
1044
1054
  }),
1045
1055
  ).toEqual([
@@ -1053,7 +1063,7 @@ describe("core: buildScopedConditions", function () {
1053
1063
 
1054
1064
  // Full match
1055
1065
  expect(
1056
- buildScopedCondition(datafileReader, originalConditions, {
1066
+ applyContextToCondition(featurevisor, originalConditions, {
1057
1067
  platform: "web",
1058
1068
  browser: "chrome",
1059
1069
  }),
@@ -1061,7 +1071,7 @@ describe("core: buildScopedConditions", function () {
1061
1071
 
1062
1072
  // No match
1063
1073
  expect(
1064
- buildScopedCondition(datafileReader, originalConditions, {
1074
+ applyContextToCondition(featurevisor, originalConditions, {
1065
1075
  platform: "mobile",
1066
1076
  browser: "safari",
1067
1077
  }),
@@ -1082,8 +1092,8 @@ describe("core: buildScopedConditions", function () {
1082
1092
  test("AND conditions", function () {
1083
1093
  // AND with all matching conditions
1084
1094
  expect(
1085
- buildScopedCondition(
1086
- datafileReader,
1095
+ applyContextToCondition(
1096
+ featurevisor,
1087
1097
  {
1088
1098
  and: [
1089
1099
  {
@@ -1109,8 +1119,8 @@ describe("core: buildScopedConditions", function () {
1109
1119
 
1110
1120
  // AND with partial match
1111
1121
  expect(
1112
- buildScopedCondition(
1113
- datafileReader,
1122
+ applyContextToCondition(
1123
+ featurevisor,
1114
1124
  {
1115
1125
  and: [
1116
1126
  {
@@ -1142,8 +1152,8 @@ describe("core: buildScopedConditions", function () {
1142
1152
 
1143
1153
  // AND with no matches
1144
1154
  expect(
1145
- buildScopedCondition(
1146
- datafileReader,
1155
+ applyContextToCondition(
1156
+ featurevisor,
1147
1157
  {
1148
1158
  and: [
1149
1159
  {
@@ -1180,8 +1190,8 @@ describe("core: buildScopedConditions", function () {
1180
1190
 
1181
1191
  // AND with "*" in it
1182
1192
  expect(
1183
- buildScopedCondition(
1184
- datafileReader,
1193
+ applyContextToCondition(
1194
+ featurevisor,
1185
1195
  {
1186
1196
  and: [
1187
1197
  "*",
@@ -1204,8 +1214,8 @@ describe("core: buildScopedConditions", function () {
1204
1214
  test("OR conditions", function () {
1205
1215
  // OR with all matching conditions
1206
1216
  expect(
1207
- buildScopedCondition(
1208
- datafileReader,
1217
+ applyContextToCondition(
1218
+ featurevisor,
1209
1219
  {
1210
1220
  or: [
1211
1221
  {
@@ -1230,8 +1240,8 @@ describe("core: buildScopedConditions", function () {
1230
1240
 
1231
1241
  // OR with partial match (first matches)
1232
1242
  expect(
1233
- buildScopedCondition(
1234
- datafileReader,
1243
+ applyContextToCondition(
1244
+ featurevisor,
1235
1245
  {
1236
1246
  or: [
1237
1247
  {
@@ -1263,8 +1273,8 @@ describe("core: buildScopedConditions", function () {
1263
1273
 
1264
1274
  // OR with no matches
1265
1275
  expect(
1266
- buildScopedCondition(
1267
- datafileReader,
1276
+ applyContextToCondition(
1277
+ featurevisor,
1268
1278
  {
1269
1279
  or: [
1270
1280
  {
@@ -1302,8 +1312,8 @@ describe("core: buildScopedConditions", function () {
1302
1312
  test("NOT conditions", function () {
1303
1313
  // NOT with matching condition (should not match)
1304
1314
  expect(
1305
- buildScopedCondition(
1306
- datafileReader,
1315
+ applyContextToCondition(
1316
+ featurevisor,
1307
1317
  {
1308
1318
  not: [
1309
1319
  {
@@ -1323,8 +1333,8 @@ describe("core: buildScopedConditions", function () {
1323
1333
 
1324
1334
  // NOT with non-matching condition
1325
1335
  expect(
1326
- buildScopedCondition(
1327
- datafileReader,
1336
+ applyContextToCondition(
1337
+ featurevisor,
1328
1338
  {
1329
1339
  not: [
1330
1340
  {
@@ -1350,8 +1360,8 @@ describe("core: buildScopedConditions", function () {
1350
1360
 
1351
1361
  // NOT with multiple conditions
1352
1362
  expect(
1353
- buildScopedCondition(
1354
- datafileReader,
1363
+ applyContextToCondition(
1364
+ featurevisor,
1355
1365
  {
1356
1366
  not: [
1357
1367
  {
@@ -1379,8 +1389,8 @@ describe("core: buildScopedConditions", function () {
1379
1389
  test("nested AND conditions", function () {
1380
1390
  // Nested AND with all matching
1381
1391
  expect(
1382
- buildScopedCondition(
1383
- datafileReader,
1392
+ applyContextToCondition(
1393
+ featurevisor,
1384
1394
  {
1385
1395
  and: [
1386
1396
  {
@@ -1421,8 +1431,8 @@ describe("core: buildScopedConditions", function () {
1421
1431
 
1422
1432
  // Nested AND with partial match
1423
1433
  expect(
1424
- buildScopedCondition(
1425
- datafileReader,
1434
+ applyContextToCondition(
1435
+ featurevisor,
1426
1436
  {
1427
1437
  and: [
1428
1438
  {
@@ -1471,8 +1481,8 @@ describe("core: buildScopedConditions", function () {
1471
1481
  test("nested OR conditions", function () {
1472
1482
  // Nested OR with matching
1473
1483
  expect(
1474
- buildScopedCondition(
1475
- datafileReader,
1484
+ applyContextToCondition(
1485
+ featurevisor,
1476
1486
  {
1477
1487
  or: [
1478
1488
  {
@@ -1522,8 +1532,8 @@ describe("core: buildScopedConditions", function () {
1522
1532
 
1523
1533
  // Nested OR with inner match
1524
1534
  expect(
1525
- buildScopedCondition(
1526
- datafileReader,
1535
+ applyContextToCondition(
1536
+ featurevisor,
1527
1537
  {
1528
1538
  or: [
1529
1539
  {
@@ -1575,8 +1585,8 @@ describe("core: buildScopedConditions", function () {
1575
1585
  test("nested NOT conditions", function () {
1576
1586
  // Nested NOT
1577
1587
  expect(
1578
- buildScopedCondition(
1579
- datafileReader,
1588
+ applyContextToCondition(
1589
+ featurevisor,
1580
1590
  {
1581
1591
  not: [
1582
1592
  {
@@ -1613,8 +1623,8 @@ describe("core: buildScopedConditions", function () {
1613
1623
  test("mixed nested conditions", function () {
1614
1624
  // AND with nested OR
1615
1625
  expect(
1616
- buildScopedCondition(
1617
- datafileReader,
1626
+ applyContextToCondition(
1627
+ featurevisor,
1618
1628
  {
1619
1629
  and: [
1620
1630
  {
@@ -1661,8 +1671,8 @@ describe("core: buildScopedConditions", function () {
1661
1671
 
1662
1672
  // OR with nested AND
1663
1673
  expect(
1664
- buildScopedCondition(
1665
- datafileReader,
1674
+ applyContextToCondition(
1675
+ featurevisor,
1666
1676
  {
1667
1677
  or: [
1668
1678
  {
@@ -1706,8 +1716,8 @@ describe("core: buildScopedConditions", function () {
1706
1716
 
1707
1717
  // AND with nested NOT
1708
1718
  expect(
1709
- buildScopedCondition(
1710
- datafileReader,
1719
+ applyContextToCondition(
1720
+ featurevisor,
1711
1721
  {
1712
1722
  and: [
1713
1723
  {
@@ -1748,8 +1758,8 @@ describe("core: buildScopedConditions", function () {
1748
1758
 
1749
1759
  // Complex nested structure
1750
1760
  expect(
1751
- buildScopedCondition(
1752
- datafileReader,
1761
+ applyContextToCondition(
1762
+ featurevisor,
1753
1763
  {
1754
1764
  and: [
1755
1765
  {
@@ -1810,8 +1820,8 @@ describe("core: buildScopedConditions", function () {
1810
1820
  test("arrays with nested conditions", function () {
1811
1821
  // Array with AND condition
1812
1822
  expect(
1813
- buildScopedCondition(
1814
- datafileReader,
1823
+ applyContextToCondition(
1824
+ featurevisor,
1815
1825
  [
1816
1826
  {
1817
1827
  attribute: "platform",
@@ -1848,8 +1858,8 @@ describe("core: buildScopedConditions", function () {
1848
1858
 
1849
1859
  // Array with OR condition
1850
1860
  expect(
1851
- buildScopedCondition(
1852
- datafileReader,
1861
+ applyContextToCondition(
1862
+ featurevisor,
1853
1863
  [
1854
1864
  {
1855
1865
  attribute: "platform",
@@ -1894,8 +1904,8 @@ describe("core: buildScopedConditions", function () {
1894
1904
  test("edge cases", function () {
1895
1905
  // Empty context
1896
1906
  expect(
1897
- buildScopedCondition(
1898
- datafileReader,
1907
+ applyContextToCondition(
1908
+ featurevisor,
1899
1909
  {
1900
1910
  attribute: "platform",
1901
1911
  operator: "equals",
@@ -1910,12 +1920,12 @@ describe("core: buildScopedConditions", function () {
1910
1920
  });
1911
1921
 
1912
1922
  // Empty array
1913
- expect(buildScopedCondition(datafileReader, [], {})).toEqual([]);
1923
+ expect(applyContextToCondition(featurevisor, [], {})).toEqual([]);
1914
1924
 
1915
1925
  // "*" in array
1916
1926
  expect(
1917
- buildScopedCondition(
1918
- datafileReader,
1927
+ applyContextToCondition(
1928
+ featurevisor,
1919
1929
  [
1920
1930
  "*",
1921
1931
  {
@@ -1932,8 +1942,8 @@ describe("core: buildScopedConditions", function () {
1932
1942
 
1933
1943
  // AND with empty array
1934
1944
  expect(
1935
- buildScopedCondition(
1936
- datafileReader,
1945
+ applyContextToCondition(
1946
+ featurevisor,
1937
1947
  {
1938
1948
  and: [],
1939
1949
  },
@@ -1945,8 +1955,8 @@ describe("core: buildScopedConditions", function () {
1945
1955
 
1946
1956
  // OR with empty array
1947
1957
  expect(
1948
- buildScopedCondition(
1949
- datafileReader,
1958
+ applyContextToCondition(
1959
+ featurevisor,
1950
1960
  {
1951
1961
  or: [],
1952
1962
  },
@@ -2126,7 +2136,9 @@ describe("core: buildScopedConditions", function () {
2126
2136
 
2127
2137
  test("NOT conditions", function () {
2128
2138
  // All "*" in NOT
2129
- expect(removeRedundantConditions({ not: ["*", "*", "*"] })).toEqual("*");
2139
+ expect(removeRedundantConditions({ not: ["*", "*", "*"] })).toEqual({
2140
+ not: ["*"],
2141
+ });
2130
2142
 
2131
2143
  // Mixed with "*" in NOT
2132
2144
  expect(
@@ -2299,7 +2311,13 @@ describe("core: buildScopedConditions", function () {
2299
2311
  "*",
2300
2312
  ],
2301
2313
  }),
2302
- ).toEqual("*");
2314
+ ).toEqual({
2315
+ not: [
2316
+ {
2317
+ not: ["*"],
2318
+ },
2319
+ ],
2320
+ });
2303
2321
 
2304
2322
  // Nested NOT with mixed conditions
2305
2323
  expect(