@openfin/ui-library 0.1.17-alpha.1623210265 → 0.1.17

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/dist/index.d.ts CHANGED
@@ -16,4 +16,3 @@ export * from './hooks/useColorScheme';
16
16
  export * from './hooks/useMediaQuery';
17
17
  export * from './hooks/usePrevious';
18
18
  export * as StoryHelpers from './storybookHelpers';
19
- export * from './lib/whenFin';
package/dist/index.js CHANGED
@@ -41,4 +41,3 @@ __exportStar(require("./hooks/useColorScheme"), exports);
41
41
  __exportStar(require("./hooks/useMediaQuery"), exports);
42
42
  __exportStar(require("./hooks/usePrevious"), exports);
43
43
  exports.StoryHelpers = __importStar(require("./storybookHelpers"));
44
- __exportStar(require("./lib/whenFin"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.1.17-alpha.1623210265",
4
+ "version": "0.1.17",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",
@@ -1,6 +0,0 @@
1
- /**
2
- * OpenFin/Non-OpenFin context expression switch.
3
- * @param finValue Expression invoked/returned when running in the fin environment.
4
- * @param noFinValue Expression invoked/returned when not running in the fin environment.
5
- */
6
- export declare function whenFin<F, N = undefined>(finValue: (() => F) | F, noFinValue?: (() => N) | N): F | N | undefined;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.whenFin = void 0;
4
- /**
5
- * OpenFin/Non-OpenFin context expression switch.
6
- * @param finValue Expression invoked/returned when running in the fin environment.
7
- * @param noFinValue Expression invoked/returned when not running in the fin environment.
8
- */
9
- function whenFin(finValue, noFinValue) {
10
- const expression = typeof fin !== 'undefined' ? finValue : noFinValue;
11
- return typeof expression === 'function' ? expression() : expression;
12
- }
13
- exports.whenFin = whenFin;
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const whenFin_1 = require("./whenFin");
4
- describe('whenFin', () => {
5
- afterEach(() => {
6
- delete global.fin;
7
- });
8
- describe('When `fin` is present', () => {
9
- beforeEach(() => {
10
- global.fin = {};
11
- });
12
- test('And a function provided the function is invoked', () => {
13
- let value = 0;
14
- whenFin_1.whenFin(() => {
15
- value = 1;
16
- });
17
- expect(value).toEqual(1);
18
- });
19
- test('And a value provided the value is returned', () => {
20
- const value = whenFin_1.whenFin(1, undefined);
21
- expect(value).toEqual(1);
22
- });
23
- });
24
- describe('When `fin` is not present', () => {
25
- test('And a function provided the function is invoked', () => {
26
- let value = 0;
27
- whenFin_1.whenFin(() => {
28
- value = 0;
29
- }, () => {
30
- value = 1;
31
- });
32
- expect(value).toEqual(1);
33
- });
34
- test('And a value provided the value is returned', () => {
35
- const value = whenFin_1.whenFin(undefined, 1);
36
- expect(value).toEqual(1);
37
- });
38
- });
39
- });