@atlaskit/tmp-editor-statsig 8.2.0 → 8.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 8.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#177692](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/177692)
8
+ [`19ab0513e027f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/19ab0513e027f) -
9
+ Add defaultValue parameter to expValEq and expValEqNoExposure to allow for checking default state
10
+ (e.g. false state) and avoid issue when experiment is not defined
11
+
3
12
  ## 8.2.0
4
13
 
5
14
  ### Minor Changes
@@ -10,6 +10,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
10
10
  *
11
11
  * !!! Note: This method never fires exposure. !!!
12
12
  *
13
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
14
+ *
13
15
  * @example Boolean experiment
14
16
  * if (expValEqualsNoExposure('example-boolean', 'isEnabled', true)) {
15
17
  * // Run code for on variant
@@ -27,9 +29,11 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
27
29
  * @param experimentName - experiment key
28
30
  * @param experimentParam - the name of the parameter to fetch from the experiment config
29
31
  * @param experimentExpectedValue - expected value to compare with
32
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
30
33
  *
31
34
  * @returns boolean
32
35
  */
33
36
  function expValEqualsNoExposure(experimentName, experimentParam, experimentExpectedValue) {
34
- return (0, _expValEqualsInternal.expValEqualsInternal)(experimentName, experimentParam, experimentExpectedValue, null, false);
37
+ var experimentDefaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
38
+ return (0, _expValEqualsInternal.expValEqualsInternal)(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, false);
35
39
  }
@@ -10,6 +10,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
10
10
  *
11
11
  * !!! Note: This method always fires exposure. !!!
12
12
  *
13
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
14
+ *
13
15
  * @example Boolean experiment
14
16
  * if (expValEquals('example-boolean', 'isEnabled', true)) {
15
17
  * // Run code for on variant
@@ -27,9 +29,11 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
27
29
  * @param experimentName - experiment key
28
30
  * @param experimentParam - the name of the parameter to fetch from the experiment config
29
31
  * @param experimentExpectedValue - expected value to compare with
32
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
30
33
  *
31
34
  * @returns boolean
32
35
  */
33
36
  function expValEquals(experimentName, experimentParam, experimentExpectedValue) {
34
- return (0, _expValEqualsInternal.expValEqualsInternal)(experimentName, experimentParam, experimentExpectedValue, null, true);
37
+ var experimentDefaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
38
+ return (0, _expValEqualsInternal.expValEqualsInternal)(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, true);
35
39
  }
@@ -4,6 +4,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
4
4
  *
5
5
  * !!! Note: This method never fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEqualsNoExposure('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,9 +23,10 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export function expValEqualsNoExposure(experimentName, experimentParam, experimentExpectedValue) {
28
- return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, null, false);
30
+ export function expValEqualsNoExposure(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue = null) {
31
+ return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, false);
29
32
  }
@@ -4,6 +4,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
4
4
  *
5
5
  * !!! Note: This method always fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEquals('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,9 +23,10 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export function expValEquals(experimentName, experimentParam, experimentExpectedValue) {
28
- return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, null, true);
30
+ export function expValEquals(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue = null) {
31
+ return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, true);
29
32
  }
@@ -4,6 +4,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
4
4
  *
5
5
  * !!! Note: This method never fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEqualsNoExposure('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,9 +23,11 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
30
  export function expValEqualsNoExposure(experimentName, experimentParam, experimentExpectedValue) {
28
- return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, null, false);
31
+ var experimentDefaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
32
+ return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, false);
29
33
  }
@@ -4,6 +4,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
4
4
  *
5
5
  * !!! Note: This method always fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEquals('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,9 +23,11 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
30
  export function expValEquals(experimentName, experimentParam, experimentExpectedValue) {
28
- return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, null, true);
31
+ var experimentDefaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
32
+ return expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, true);
29
33
  }
@@ -4,6 +4,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
4
4
  *
5
5
  * !!! Note: This method never fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEqualsNoExposure('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,7 +23,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue']): boolean;
30
+ export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], experimentDefaultValue?: EditorExperimentsConfig[ExperimentName]['defaultValue'] | null): boolean;
@@ -4,6 +4,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
4
4
  *
5
5
  * !!! Note: This method always fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEquals('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,7 +23,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue']): boolean;
30
+ export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], experimentDefaultValue?: EditorExperimentsConfig[ExperimentName]['defaultValue'] | null): boolean;
@@ -4,6 +4,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
4
4
  *
5
5
  * !!! Note: This method never fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEqualsNoExposure('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,7 +23,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue']): boolean;
30
+ export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], experimentDefaultValue?: EditorExperimentsConfig[ExperimentName]['defaultValue'] | null): boolean;
@@ -4,6 +4,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
4
4
  *
5
5
  * !!! Note: This method always fires exposure. !!!
6
6
  *
7
+ * IMPORTANT: If experiment is not defined default value will be null, unless provided otherwise.
8
+ *
7
9
  * @example Boolean experiment
8
10
  * if (expValEquals('example-boolean', 'isEnabled', true)) {
9
11
  * // Run code for on variant
@@ -21,7 +23,8 @@ import { type EditorExperimentsConfig } from './experiments-config';
21
23
  * @param experimentName - experiment key
22
24
  * @param experimentParam - the name of the parameter to fetch from the experiment config
23
25
  * @param experimentExpectedValue - expected value to compare with
26
+ * @param experimentDefaultValue - default value to use if the experiment is not defined.
24
27
  *
25
28
  * @returns boolean
26
29
  */
27
- export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue']): boolean;
30
+ export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], experimentDefaultValue?: EditorExperimentsConfig[ExperimentName]['defaultValue'] | null): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "Temp plugin to ease use of statsig feature flags until platform feature flags are available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",