@@ -4,18 +4,18 @@ import * as util from '../lib/utils/index.js';
4
4
import { SwitcherResult } from './result.js' ;
5
5
6
6
/**
7
- * Resolves the criteria for a given switcher request against the snapshot data .
7
+ * Resolves the criteria for a given switcher request against the snapshot domain .
8
8
*
9
- * @param {SnapshotData } data - The snapshot data containing domain and group information .
9
+ * @param {Domain } domain - The domain containing groups and configurations .
10
10
* @param {SwitcherRequest } switcher - The switcher request to be evaluated.
11
11
* @returns {SwitcherResult } - The result of the switcher evaluation.
12
12
*/
13
- function resolveCriteria ( data , switcher ) {
14
- if ( ! data . domain . activated ) {
13
+ function resolveCriteria ( domain , switcher ) {
14
+ if ( ! domain . activated ) {
15
15
return SwitcherResult . disabled ( 'Domain disabled' ) ;
16
16
}
17
17
18
- const { group } = data . domain ;
18
+ const { group } = domain ;
19
19
return checkGroup ( group , switcher ) ;
20
20
}
21
21
@@ -127,7 +127,7 @@ function isStrategyFulfilled(strategyEntry, strategyConfig) {
127
127
/**
128
128
* Checks the criteria for a switcher request against the local snapshot.
129
129
*
130
- * @param {Snapshot | undefined } snapshot - The snapshot containing the data to check against.
130
+ * @param {Snapshot | undefined } snapshot - The snapshot containing the domain to check against.
131
131
* @param {SwitcherRequest } switcher - The switcher request to be evaluated.
132
132
* @returns {SwitcherResult } - The result of the switcher evaluation.
133
133
* @throws {Error } - If the snapshot is not loaded.
@@ -137,6 +137,6 @@ export default function checkCriteriaLocal(snapshot, switcher) {
137
137
throw new Error ( 'Snapshot not loaded. Try to use \'Client.loadSnapshot()\'' ) ;
138
138
}
139
139
140
- const { data } = snapshot ;
141
- return resolveCriteria ( data , switcher ) ;
140
+ const { domain } = snapshot ;
141
+ return resolveCriteria ( domain , switcher ) ;
142
142
}
0 commit comments