@axinom/mosaic-ui 0.43.0-rc.2 → 0.43.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-ui",
3
- "version": "0.43.0-rc.2",
3
+ "version": "0.43.0-rc.3",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -32,7 +32,7 @@
32
32
  "build-storybook": "storybook build"
33
33
  },
34
34
  "dependencies": {
35
- "@axinom/mosaic-core": "^0.4.16-rc.2",
35
+ "@axinom/mosaic-core": "^0.4.16-rc.3",
36
36
  "@faker-js/faker": "^7.4.0",
37
37
  "@popperjs/core": "^2.11.8",
38
38
  "clsx": "^1.1.0",
@@ -105,5 +105,5 @@
105
105
  "publishConfig": {
106
106
  "access": "public"
107
107
  },
108
- "gitHead": "5d0249232bc0618f5c6e0cb03b70d1addfda82b0"
108
+ "gitHead": "f6f6a3572169ce5183ac5406f34ea1f8655aa28e"
109
109
  }
@@ -1,13 +0,0 @@
1
- import { ErrorType } from '../components/models';
2
- /**
3
- * Type assertion function that throws an error if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.
4
- * This is a copy of assertError() in @axinom/service-common to avoid dependencies.
5
- */
6
- export declare const assertError: (error: unknown) => asserts error is Error;
7
- /**
8
- * Asserts if the passed error is of ErrorType.
9
- *
10
- * @param error error object of type unknown
11
- */
12
- export declare const assertErrorType: (error: unknown) => asserts error is ErrorType;
13
- //# sourceMappingURL=assertError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertError.d.ts","sourceRoot":"","sources":["../../src/common/assertError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI,KAM9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI,SAalE,CAAC"}
@@ -1,61 +0,0 @@
1
- /* eslint-disable jest/no-conditional-expect */
2
- import 'jest-extended';
3
- import { StationError } from '../components/models';
4
- import { assertError, assertErrorType } from './assertError';
5
-
6
- describe('assertError', () => {
7
- it('StationError type error is thrown -> ErrorType asserted', async () => {
8
- try {
9
- throw {
10
- title: 'test title',
11
- body: 'test body',
12
- };
13
- } catch (error) {
14
- assertErrorType(error);
15
- expect((error as StationError).title).toBe('test title');
16
- expect((error as StationError).body).toBe('test body');
17
- }
18
- });
19
-
20
- it('Error is thrown -> ErrorType asserted', async () => {
21
- try {
22
- throw new Error('test error');
23
- } catch (error) {
24
- assertErrorType(error);
25
- expect((error as Error).message).toBe('test error');
26
- }
27
- });
28
-
29
- it('string is thrown -> ErrorType asserted', async () => {
30
- try {
31
- throw 'test error';
32
- } catch (error) {
33
- assertErrorType(error);
34
- expect(error as string).toBe('test error');
35
- }
36
- });
37
-
38
- it('error-like object is thrown -> ErrorType asserted', async () => {
39
- try {
40
- throw { message: 'test error' };
41
- } catch (error) {
42
- assertErrorType(error);
43
- expect(Object(error).message).toBe('test error');
44
- }
45
- });
46
-
47
- it('number is thrown -> ErrorType assertion failed', async () => {
48
- try {
49
- throw 123;
50
- } catch (error) {
51
- try {
52
- assertErrorType(error);
53
- } catch (assertionError) {
54
- assertError(assertionError);
55
- expect(assertionError.message).toBe(
56
- 'The caught error is not an instance of ErrorType.',
57
- );
58
- }
59
- }
60
- });
61
- });
@@ -1,33 +0,0 @@
1
- import { ErrorType, StationError } from '../components/models';
2
-
3
- /**
4
- * Type assertion function that throws an error if provided parameter is not an instance of an Error, and asserts value to an Error type if no error is thrown.
5
- * This is a copy of assertError() in @axinom/service-common to avoid dependencies.
6
- */
7
- export const assertError: (error: unknown) => asserts error is Error = (
8
- error: unknown,
9
- ): asserts error is Error => {
10
- if (!(error instanceof Error)) {
11
- throw new Error('A caught error is not an instance of an Error class.');
12
- }
13
- };
14
-
15
- /**
16
- * Asserts if the passed error is of ErrorType.
17
- *
18
- * @param error error object of type unknown
19
- */
20
- export const assertErrorType: (error: unknown) => asserts error is ErrorType = (
21
- error: unknown,
22
- ): asserts error is ErrorType => {
23
- if (
24
- !(
25
- error instanceof Error ||
26
- typeof error === 'string' ||
27
- (error as StationError).title !== undefined ||
28
- error instanceof Object
29
- )
30
- ) {
31
- throw new Error('The caught error is not an instance of ErrorType.');
32
- }
33
- };