@splitsoftware/splitio-commons 2.10.0 → 2.10.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.
package/CHANGES.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 2.10.1 (December 18, 2025)
2
+ - Bugfix - Handle `null` prerequisites properly
3
+
1
4
  2.10.0 (December 16, 2025)
2
5
  - Added property `impressionsDisabled` in getTreatment(s) `evaluationOptions` parameter, to disable impressions per evaluations.
3
6
 
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prerequisitesMatcherContext = void 0;
4
4
  var thenable_1 = require("../../utils/promise/thenable");
5
5
  function prerequisitesMatcherContext(prerequisites, storage, log) {
6
- if (prerequisites === void 0) { prerequisites = []; }
7
6
  return function prerequisitesMatcher(_a, splitEvaluator) {
8
7
  var key = _a.key, attributes = _a.attributes;
8
+ prerequisites = prerequisites == null ? [] : prerequisites;
9
9
  function evaluatePrerequisite(prerequisite) {
10
10
  var evaluation = splitEvaluator(log, key, prerequisite.n, attributes, storage);
11
11
  return (0, thenable_1.thenable)(evaluation) ?
@@ -1,8 +1,8 @@
1
1
  import { thenable } from '../../utils/promise/thenable';
2
2
  export function prerequisitesMatcherContext(prerequisites, storage, log) {
3
- if (prerequisites === void 0) { prerequisites = []; }
4
3
  return function prerequisitesMatcher(_a, splitEvaluator) {
5
4
  var key = _a.key, attributes = _a.attributes;
5
+ prerequisites = prerequisites == null ? [] : prerequisites;
6
6
  function evaluatePrerequisite(prerequisite) {
7
7
  var evaluation = splitEvaluator(log, key, prerequisite.n, attributes, storage);
8
8
  return thenable(evaluation) ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-commons",
3
- "version": "2.10.0",
3
+ "version": "2.10.1",
4
4
  "description": "Split JavaScript SDK common components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
package/src/dtos/types.ts CHANGED
@@ -220,7 +220,7 @@ export interface ISplit {
220
220
  changeNumber: number,
221
221
  status: 'ACTIVE' | 'ARCHIVED',
222
222
  conditions: ISplitCondition[],
223
- prerequisites?: {
223
+ prerequisites?: null | {
224
224
  n: string,
225
225
  ts: string[]
226
226
  }[]
@@ -4,10 +4,12 @@ import { ILogger } from '../../logger/types';
4
4
  import { thenable } from '../../utils/promise/thenable';
5
5
  import { IDependencyMatcherValue, ISplitEvaluator } from '../types';
6
6
 
7
- export function prerequisitesMatcherContext(prerequisites: ISplit['prerequisites'] = [], storage: IStorageSync | IStorageAsync, log: ILogger) {
7
+ export function prerequisitesMatcherContext(prerequisites: ISplit['prerequisites'], storage: IStorageSync | IStorageAsync, log: ILogger) {
8
8
 
9
9
  return function prerequisitesMatcher({ key, attributes }: IDependencyMatcherValue, splitEvaluator: ISplitEvaluator): MaybeThenable<boolean> {
10
10
 
11
+ prerequisites = prerequisites == null ? [] : prerequisites;
12
+
11
13
  function evaluatePrerequisite(prerequisite: { n: string; ts: string[] }): MaybeThenable<boolean> {
12
14
  const evaluation = splitEvaluator(log, key, prerequisite.n, attributes, storage);
13
15
  return thenable(evaluation) ?