* Selects a value from an array of options based on the targeting key using xxHash32 * @param targetingKey The key to use for targeting * @param options Array of available options * @returns The selected option
( flagKey: string, targetingKey: string, options: T[] )
| 14 | * @returns The selected option |
| 15 | */ |
| 16 | function selectTargetedOption<T>( |
| 17 | flagKey: string, |
| 18 | targetingKey: string, |
| 19 | options: T[] |
| 20 | ): T { |
| 21 | const index = xxHash32(`${flagKey}:${targetingKey}`) % options.length |
| 22 | return options[index] |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * A custom OpenFeature provider that uses a static configuration. |
no outgoing calls
no test coverage detected