@atlaskit/tmp-editor-statsig 5.7.0 → 5.8.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,13 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 5.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#163510](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163510)
8
+ [`82ae25a1f9aaa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/82ae25a1f9aaa) -
9
+ Adds expValEquals and expValEqualsNoExposure methods
10
+
3
11
  ## 5.7.0
4
12
 
5
13
  ### Minor Changes
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.expValEqualsNoExposure = expValEqualsNoExposure;
7
+ var _experiments = require("./experiments");
8
+ /**
9
+ * Check the value if an editor experiment and without exposure.
10
+ *
11
+ * !!! Note: This method never fires exposure. !!!
12
+ *
13
+ * @example Boolean experiment
14
+ * if (expValEqualsNoExposure('example-boolean', true)) {
15
+ * // Run code for on variant
16
+ * } else {
17
+ * // Run code for off variant
18
+ * }
19
+ *
20
+ * @example Multivariate experiment
21
+ * if (expValEqualsNoExposure('example-multivariate', 'one')) {
22
+ * // Run code for 'one' variant
23
+ * } else {
24
+ * // Run code for control
25
+ * }
26
+ *
27
+ * @param experimentName - experiment key
28
+ * @param experimentExpectedValue - expected value to compare with
29
+ *
30
+ * @returns boolean
31
+ */
32
+ function expValEqualsNoExposure(experimentName, experimentExpectedValue) {
33
+ return (0, _experiments.editorExperiment)(experimentName, experimentExpectedValue, {
34
+ exposure: false
35
+ });
36
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.expValEquals = expValEquals;
7
+ var _experiments = require("./experiments");
8
+ /**
9
+ * Check the value if an editor experiment and fire exposure.
10
+ *
11
+ * !!! Note: This method always fires exposure. !!!
12
+ *
13
+ * @example Boolean experiment
14
+ * if (expValEquals('example-boolean', true)) {
15
+ * // Run code for on variant
16
+ * } else {
17
+ * // Run code for off variant
18
+ * }
19
+ *
20
+ * @example Multivariate experiment
21
+ * if (expValEquals('example-multivariate', 'one')) {
22
+ * // Run code for 'one' variant
23
+ * } else {
24
+ * // Run code for control
25
+ * }
26
+ *
27
+ * @param experimentName - experiment key
28
+ * @param experimentExpectedValue - expected value to compare with
29
+ *
30
+ * @returns boolean
31
+ */
32
+ function expValEquals(experimentName, experimentExpectedValue) {
33
+ return (0, _experiments.editorExperiment)(experimentName, experimentExpectedValue, {
34
+ exposure: true
35
+ });
36
+ }
@@ -0,0 +1,31 @@
1
+ import { editorExperiment } from './experiments';
2
+
3
+ /**
4
+ * Check the value if an editor experiment and without exposure.
5
+ *
6
+ * !!! Note: This method never fires exposure. !!!
7
+ *
8
+ * @example Boolean experiment
9
+ * if (expValEqualsNoExposure('example-boolean', true)) {
10
+ * // Run code for on variant
11
+ * } else {
12
+ * // Run code for off variant
13
+ * }
14
+ *
15
+ * @example Multivariate experiment
16
+ * if (expValEqualsNoExposure('example-multivariate', 'one')) {
17
+ * // Run code for 'one' variant
18
+ * } else {
19
+ * // Run code for control
20
+ * }
21
+ *
22
+ * @param experimentName - experiment key
23
+ * @param experimentExpectedValue - expected value to compare with
24
+ *
25
+ * @returns boolean
26
+ */
27
+ export function expValEqualsNoExposure(experimentName, experimentExpectedValue) {
28
+ return editorExperiment(experimentName, experimentExpectedValue, {
29
+ exposure: false
30
+ });
31
+ }
@@ -0,0 +1,31 @@
1
+ import { editorExperiment } from './experiments';
2
+
3
+ /**
4
+ * Check the value if an editor experiment and fire exposure.
5
+ *
6
+ * !!! Note: This method always fires exposure. !!!
7
+ *
8
+ * @example Boolean experiment
9
+ * if (expValEquals('example-boolean', true)) {
10
+ * // Run code for on variant
11
+ * } else {
12
+ * // Run code for off variant
13
+ * }
14
+ *
15
+ * @example Multivariate experiment
16
+ * if (expValEquals('example-multivariate', 'one')) {
17
+ * // Run code for 'one' variant
18
+ * } else {
19
+ * // Run code for control
20
+ * }
21
+ *
22
+ * @param experimentName - experiment key
23
+ * @param experimentExpectedValue - expected value to compare with
24
+ *
25
+ * @returns boolean
26
+ */
27
+ export function expValEquals(experimentName, experimentExpectedValue) {
28
+ return editorExperiment(experimentName, experimentExpectedValue, {
29
+ exposure: true
30
+ });
31
+ }
@@ -0,0 +1,31 @@
1
+ import { editorExperiment } from './experiments';
2
+
3
+ /**
4
+ * Check the value if an editor experiment and without exposure.
5
+ *
6
+ * !!! Note: This method never fires exposure. !!!
7
+ *
8
+ * @example Boolean experiment
9
+ * if (expValEqualsNoExposure('example-boolean', true)) {
10
+ * // Run code for on variant
11
+ * } else {
12
+ * // Run code for off variant
13
+ * }
14
+ *
15
+ * @example Multivariate experiment
16
+ * if (expValEqualsNoExposure('example-multivariate', 'one')) {
17
+ * // Run code for 'one' variant
18
+ * } else {
19
+ * // Run code for control
20
+ * }
21
+ *
22
+ * @param experimentName - experiment key
23
+ * @param experimentExpectedValue - expected value to compare with
24
+ *
25
+ * @returns boolean
26
+ */
27
+ export function expValEqualsNoExposure(experimentName, experimentExpectedValue) {
28
+ return editorExperiment(experimentName, experimentExpectedValue, {
29
+ exposure: false
30
+ });
31
+ }
@@ -0,0 +1,31 @@
1
+ import { editorExperiment } from './experiments';
2
+
3
+ /**
4
+ * Check the value if an editor experiment and fire exposure.
5
+ *
6
+ * !!! Note: This method always fires exposure. !!!
7
+ *
8
+ * @example Boolean experiment
9
+ * if (expValEquals('example-boolean', true)) {
10
+ * // Run code for on variant
11
+ * } else {
12
+ * // Run code for off variant
13
+ * }
14
+ *
15
+ * @example Multivariate experiment
16
+ * if (expValEquals('example-multivariate', 'one')) {
17
+ * // Run code for 'one' variant
18
+ * } else {
19
+ * // Run code for control
20
+ * }
21
+ *
22
+ * @param experimentName - experiment key
23
+ * @param experimentExpectedValue - expected value to compare with
24
+ *
25
+ * @returns boolean
26
+ */
27
+ export function expValEquals(experimentName, experimentExpectedValue) {
28
+ return editorExperiment(experimentName, experimentExpectedValue, {
29
+ exposure: true
30
+ });
31
+ }
@@ -0,0 +1,26 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Check the value if an editor experiment and without exposure.
4
+ *
5
+ * !!! Note: This method never fires exposure. !!!
6
+ *
7
+ * @example Boolean experiment
8
+ * if (expValEqualsNoExposure('example-boolean', true)) {
9
+ * // Run code for on variant
10
+ * } else {
11
+ * // Run code for off variant
12
+ * }
13
+ *
14
+ * @example Multivariate experiment
15
+ * if (expValEqualsNoExposure('example-multivariate', 'one')) {
16
+ * // Run code for 'one' variant
17
+ * } else {
18
+ * // Run code for control
19
+ * }
20
+ *
21
+ * @param experimentName - experiment key
22
+ * @param experimentExpectedValue - expected value to compare with
23
+ *
24
+ * @returns boolean
25
+ */
26
+ export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig, ExperimentValue extends EditorExperimentsConfig[ExperimentName]['defaultValue']>(experimentName: ExperimentName, experimentExpectedValue: ExperimentValue): boolean;
@@ -0,0 +1,26 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Check the value if an editor experiment and fire exposure.
4
+ *
5
+ * !!! Note: This method always fires exposure. !!!
6
+ *
7
+ * @example Boolean experiment
8
+ * if (expValEquals('example-boolean', true)) {
9
+ * // Run code for on variant
10
+ * } else {
11
+ * // Run code for off variant
12
+ * }
13
+ *
14
+ * @example Multivariate experiment
15
+ * if (expValEquals('example-multivariate', 'one')) {
16
+ * // Run code for 'one' variant
17
+ * } else {
18
+ * // Run code for control
19
+ * }
20
+ *
21
+ * @param experimentName - experiment key
22
+ * @param experimentExpectedValue - expected value to compare with
23
+ *
24
+ * @returns boolean
25
+ */
26
+ export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig, ExperimentValue extends EditorExperimentsConfig[ExperimentName]['defaultValue']>(experimentName: ExperimentName, experimentExpectedValue: ExperimentValue): boolean;
@@ -0,0 +1,26 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Check the value if an editor experiment and without exposure.
4
+ *
5
+ * !!! Note: This method never fires exposure. !!!
6
+ *
7
+ * @example Boolean experiment
8
+ * if (expValEqualsNoExposure('example-boolean', true)) {
9
+ * // Run code for on variant
10
+ * } else {
11
+ * // Run code for off variant
12
+ * }
13
+ *
14
+ * @example Multivariate experiment
15
+ * if (expValEqualsNoExposure('example-multivariate', 'one')) {
16
+ * // Run code for 'one' variant
17
+ * } else {
18
+ * // Run code for control
19
+ * }
20
+ *
21
+ * @param experimentName - experiment key
22
+ * @param experimentExpectedValue - expected value to compare with
23
+ *
24
+ * @returns boolean
25
+ */
26
+ export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig, ExperimentValue extends EditorExperimentsConfig[ExperimentName]['defaultValue']>(experimentName: ExperimentName, experimentExpectedValue: ExperimentValue): boolean;
@@ -0,0 +1,26 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Check the value if an editor experiment and fire exposure.
4
+ *
5
+ * !!! Note: This method always fires exposure. !!!
6
+ *
7
+ * @example Boolean experiment
8
+ * if (expValEquals('example-boolean', true)) {
9
+ * // Run code for on variant
10
+ * } else {
11
+ * // Run code for off variant
12
+ * }
13
+ *
14
+ * @example Multivariate experiment
15
+ * if (expValEquals('example-multivariate', 'one')) {
16
+ * // Run code for 'one' variant
17
+ * } else {
18
+ * // Run code for control
19
+ * }
20
+ *
21
+ * @param experimentName - experiment key
22
+ * @param experimentExpectedValue - expected value to compare with
23
+ *
24
+ * @returns boolean
25
+ */
26
+ export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig, ExperimentValue extends EditorExperimentsConfig[ExperimentName]['defaultValue']>(experimentName: ExperimentName, experimentExpectedValue: ExperimentValue): boolean;
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@atlaskit/tmp-editor-statsig/exp-val-equals",
3
+ "main": "../dist/cjs/exp-val-equals.js",
4
+ "module": "../dist/esm/exp-val-equals.js",
5
+ "module:es2019": "../dist/es2019/exp-val-equals.js",
6
+ "types": "../dist/types/exp-val-equals.d.ts",
7
+ "typesVersions": {
8
+ ">=4.5 <5.4": {
9
+ "*": [
10
+ "../dist/types-ts4.5/exp-val-equals.d.ts"
11
+ ]
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure",
3
+ "main": "../dist/cjs/exp-val-equals-no-exposure.js",
4
+ "module": "../dist/esm/exp-val-equals-no-exposure.js",
5
+ "module:es2019": "../dist/es2019/exp-val-equals-no-exposure.js",
6
+ "types": "../dist/types/exp-val-equals-no-exposure.d.ts",
7
+ "typesVersions": {
8
+ ">=4.5 <5.4": {
9
+ "*": [
10
+ "../dist/types-ts4.5/exp-val-equals-no-exposure.d.ts"
11
+ ]
12
+ }
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "5.7.0",
3
+ "version": "5.8.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",
@@ -36,7 +36,9 @@
36
36
  "./setup": "./src/setup.ts",
37
37
  "./experiments": "./src/experiments.ts",
38
38
  "./experiments-config": "./src/experiments-config.ts",
39
- "./editor-experiments-test-utils": "./src/editor-experiments-test-utils.ts"
39
+ "./editor-experiments-test-utils": "./src/editor-experiments-test-utils.ts",
40
+ "./exp-val-equals": "./src/exp-val-equals.ts",
41
+ "./exp-val-equals-no-exposure": "./src/exp-val-equals-no-exposure.ts"
40
42
  },
41
43
  "dependencies": {
42
44
  "@atlaskit/feature-gate-js-client": "^5.3.0",