@featurevisor/sdk 0.36.0 → 0.38.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.
@@ -207,13 +207,13 @@
207
207
  <span class="cline-any cline-neutral">&nbsp;</span>
208
208
  <span class="cline-any cline-neutral">&nbsp;</span>
209
209
  <span class="cline-any cline-neutral">&nbsp;</span>
210
- <span class="cline-any cline-yes">14x</span>
210
+ <span class="cline-any cline-yes">17x</span>
211
211
  <span class="cline-any cline-no">&nbsp;</span>
212
212
  <span class="cline-any cline-neutral">&nbsp;</span>
213
213
  <span class="cline-any cline-neutral">&nbsp;</span>
214
214
  <span class="cline-any cline-neutral">&nbsp;</span>
215
215
  <span class="cline-any cline-neutral">&nbsp;</span>
216
- <span class="cline-any cline-yes">13x</span>
216
+ <span class="cline-any cline-yes">16x</span>
217
217
  <span class="cline-any cline-neutral">&nbsp;</span>
218
218
  <span class="cline-any cline-neutral">&nbsp;</span>
219
219
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -328,7 +328,7 @@ export function createLogger(options: CreateLoggerOptions = {}): Logger {
328
328
  <div class='footer quiet pad2 space-top1 center small'>
329
329
  Code coverage generated by
330
330
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
331
- at 2023-07-13T20:52:46.032Z
331
+ at 2023-07-16T19:53:34.344Z
332
332
  </div>
333
333
  <script src="prettify.js"></script>
334
334
  <script>
@@ -132,8 +132,8 @@
132
132
  <span class="cline-any cline-neutral">&nbsp;</span>
133
133
  <span class="cline-any cline-neutral">&nbsp;</span>
134
134
  <span class="cline-any cline-neutral">&nbsp;</span>
135
- <span class="cline-any cline-yes">34x</span>
136
- <span class="cline-any cline-yes">12x</span>
135
+ <span class="cline-any cline-yes">45x</span>
136
+ <span class="cline-any cline-yes">23x</span>
137
137
  <span class="cline-any cline-neutral">&nbsp;</span>
138
138
  <span class="cline-any cline-neutral">&nbsp;</span>
139
139
  <span class="cline-any cline-yes">22x</span>
@@ -175,17 +175,17 @@
175
175
  <span class="cline-any cline-neutral">&nbsp;</span>
176
176
  <span class="cline-any cline-no">&nbsp;</span>
177
177
  <span class="cline-any cline-neutral">&nbsp;</span>
178
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { Attributes, GroupSegment, Segment, Condition } from "@featurevisor/types";
178
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { Context, GroupSegment, Segment, Condition } from "@featurevisor/types";
179
179
  import { allConditionsAreMatched } from "./conditions";
180
180
  import { DatafileReader } from "./datafileReader";
181
181
  &nbsp;
182
- export function segmentIsMatched(segment: Segment, attributes: Attributes): boolean {
183
- return allConditionsAreMatched(segment.conditions as Condition | Condition[], attributes);
182
+ export function segmentIsMatched(segment: Segment, context: Context): boolean {
183
+ return allConditionsAreMatched(segment.conditions as Condition | Condition[], context);
184
184
  }
185
185
  &nbsp;
186
186
  export function allGroupSegmentsAreMatched(
187
187
  groupSegments: GroupSegment | GroupSegment[] | "*",
188
- attributes: Attributes,
188
+ context: Context,
189
189
  datafileReader: DatafileReader,
190
190
  ): boolean {
191
191
  if (groupSegments === "*") {
@@ -196,7 +196,7 @@ export function allGroupSegmentsAreMatched(
196
196
  const segment = datafileReader.getSegment(groupSegments);
197
197
  &nbsp;
198
198
  if (segment) {
199
- return segmentIsMatched(segment, attributes);
199
+ return segmentIsMatched(segment, context);
200
200
  }
201
201
  &nbsp;
202
202
  <span class="cstat-no" title="statement not covered" > return false;</span>
@@ -205,27 +205,27 @@ export function allGroupSegmentsAreMatched(
205
205
  if (typeof groupSegments === "object") {
206
206
  <span class="missing-if-branch" title="if path not taken" >I</span>if ("and" in groupSegments &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >Array.isArray(groupSegments.and))</span> {
207
207
  <span class="cstat-no" title="statement not covered" > return groupSegments.and.every(<span class="fstat-no" title="function not covered" >(g</span>roupSegment) =&gt;</span>
208
- <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, attributes, datafileReader),</span>
208
+ <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, context, datafileReader),</span>
209
209
  );
210
210
  }
211
211
  &nbsp;
212
212
  <span class="missing-if-branch" title="if path not taken" >I</span>if ("or" in groupSegments &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >Array.isArray(groupSegments.or))</span> {
213
213
  <span class="cstat-no" title="statement not covered" > return groupSegments.or.some(<span class="fstat-no" title="function not covered" >(g</span>roupSegment) =&gt;</span>
214
- <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, attributes, datafileReader),</span>
214
+ <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, context, datafileReader),</span>
215
215
  );
216
216
  }
217
217
  &nbsp;
218
218
  <span class="missing-if-branch" title="if path not taken" >I</span>if ("not" in groupSegments &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >Array.isArray(groupSegments.not))</span> {
219
219
  <span class="cstat-no" title="statement not covered" > return groupSegments.not.every(</span>
220
220
  <span class="fstat-no" title="function not covered" > (g</span>roupSegment) =&gt;
221
- <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, attributes, datafileReader) === false,</span>
221
+ <span class="cstat-no" title="statement not covered" > allGroupSegmentsAreMatched(groupSegment, context, datafileReader) === false,</span>
222
222
  );
223
223
  }
224
224
  }
225
225
  &nbsp;
226
226
  if (Array.isArray(groupSegments)) {
227
227
  return groupSegments.every((groupSegment) =&gt;
228
- allGroupSegmentsAreMatched(groupSegment, attributes, datafileReader),
228
+ allGroupSegmentsAreMatched(groupSegment, context, datafileReader),
229
229
  );
230
230
  }
231
231
  &nbsp;
@@ -238,7 +238,7 @@ export function allGroupSegmentsAreMatched(
238
238
  <div class='footer quiet pad2 space-top1 center small'>
239
239
  Code coverage generated by
240
240
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
241
- at 2023-07-13T20:52:46.032Z
241
+ at 2023-07-16T19:53:34.344Z
242
242
  </div>
243
243
  <script src="prettify.js"></script>
244
244
  <script>