@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
|
@@ -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
package/src/dtos/types.ts
CHANGED
|
@@ -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']
|
|
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) ?
|