@featurevisor/core 3.4.0 → 3.5.0
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.
|
@@ -414,7 +414,7 @@ export type VariableType<F extends FeatureKey, V extends VariableKey<F>> = Featu
|
|
|
414
414
|
? Features[F][V]
|
|
415
415
|
: never;
|
|
416
416
|
export type Variation<F extends FeatureKey> = Features[F] extends { variation: infer V }
|
|
417
|
-
? V
|
|
417
|
+
? Extract<V, string>
|
|
418
418
|
: never;
|
|
419
419
|
`.trimStart();
|
|
420
420
|
const featuresFilePath = path.join(outputPath, "features.ts");
|
|
@@ -433,7 +433,7 @@ export function getVariation<F extends FeatureKey>(
|
|
|
433
433
|
featureKey: F,
|
|
434
434
|
context: Context = {},
|
|
435
435
|
): Variation<F> | null {
|
|
436
|
-
return getInstance().getVariation(featureKey, context)
|
|
436
|
+
return getInstance().getVariation<Variation<F>>(featureKey, context);
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
export function getVariable<F extends FeatureKey, V extends VariableKey<F>>(
|
|
@@ -441,7 +441,7 @@ export function getVariable<F extends FeatureKey, V extends VariableKey<F>>(
|
|
|
441
441
|
variableKey: V,
|
|
442
442
|
context: Context = {},
|
|
443
443
|
): VariableType<F, V> | null {
|
|
444
|
-
return getInstance().getVariable(featureKey, variableKey, context)
|
|
444
|
+
return getInstance().getVariable<VariableType<F, V>>(featureKey, variableKey, context);
|
|
445
445
|
}
|
|
446
446
|
`.trimStart();
|
|
447
447
|
const functionsFilePath = path.join(outputPath, "functions.ts");
|
|
@@ -466,7 +466,7 @@ export function useVariation<F extends FeatureKey>(
|
|
|
466
466
|
featureKey: F,
|
|
467
467
|
context: Context = {},
|
|
468
468
|
): Variation<F> | null {
|
|
469
|
-
return useVariationOriginal(featureKey, context)
|
|
469
|
+
return useVariationOriginal<Variation<F>>(featureKey, context);
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
export function useVariable<F extends FeatureKey, V extends VariableKey<F>>(
|
|
@@ -474,7 +474,7 @@ export function useVariable<F extends FeatureKey, V extends VariableKey<F>>(
|
|
|
474
474
|
variableKey: V,
|
|
475
475
|
context: Context = {},
|
|
476
476
|
): VariableType<F, V> | null {
|
|
477
|
-
return useVariableOriginal(featureKey, variableKey, context)
|
|
477
|
+
return useVariableOriginal<VariableType<F, V>>(featureKey, variableKey, context);
|
|
478
478
|
}
|
|
479
479
|
`.trimStart();
|
|
480
480
|
const reactFilePath = path.join(outputPath, "react.ts");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Core package of Featurevisor for Node.js usage",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@featurevisor/catalog": "3.3.0",
|
|
47
47
|
"@featurevisor/parsers": "3.2.0",
|
|
48
|
-
"@featurevisor/sdk": "3.
|
|
48
|
+
"@featurevisor/sdk": "3.5.0",
|
|
49
49
|
"@featurevisor/types": "3.3.0",
|
|
50
50
|
"axios": "^1.18.0",
|
|
51
51
|
"tar": "^7.5.22",
|
|
52
52
|
"yargs": "^18.0.0",
|
|
53
53
|
"zod": "^4.4.3"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "3c5e6e7c4023d54641393d2dab3d76a6c2135471"
|
|
56
56
|
}
|