@@ -4,18 +4,18 @@ import * as util from '../lib/utils/index.js';
44import { SwitcherResult } from './result.js' ;
55
66/**
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 .
88 *
9- * @param {SnapshotData } data - The snapshot data containing domain and group information .
9+ * @param {Domain } domain - The domain containing groups and configurations .
1010 * @param {SwitcherRequest } switcher - The switcher request to be evaluated.
1111 * @returns {SwitcherResult } - The result of the switcher evaluation.
1212 */
13- function resolveCriteria ( data , switcher ) {
14- if ( ! data . domain . activated ) {
13+ function resolveCriteria ( domain , switcher ) {
14+ if ( ! domain . activated ) {
1515 return SwitcherResult . disabled ( 'Domain disabled' ) ;
1616 }
1717
18- const { group } = data . domain ;
18+ const { group } = domain ;
1919 return checkGroup ( group , switcher ) ;
2020}
2121
@@ -127,7 +127,7 @@ function isStrategyFulfilled(strategyEntry, strategyConfig) {
127127/**
128128 * Checks the criteria for a switcher request against the local snapshot.
129129 *
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.
131131 * @param {SwitcherRequest } switcher - The switcher request to be evaluated.
132132 * @returns {SwitcherResult } - The result of the switcher evaluation.
133133 * @throws {Error } - If the snapshot is not loaded.
@@ -137,6 +137,6 @@ export default function checkCriteriaLocal(snapshot, switcher) {
137137 throw new Error ( 'Snapshot not loaded. Try to use \'Client.loadSnapshot()\'' ) ;
138138 }
139139
140- const { data } = snapshot ;
141- return resolveCriteria ( data , switcher ) ;
140+ const { domain } = snapshot ;
141+ return resolveCriteria ( domain , switcher ) ;
142142}
0 commit comments