@zajno/common 1.5.9 → 1.6.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.
Files changed (136) hide show
  1. package/coverage/clover.xml +182 -116
  2. package/coverage/coverage-final.json +14 -10
  3. package/coverage/lcov-report/index.html +44 -29
  4. package/coverage/lcov-report/src/__tests__/helpers/expect.ts.html +94 -0
  5. package/coverage/lcov-report/src/__tests__/helpers/index.html +18 -3
  6. package/coverage/lcov-report/src/__tests__/helpers/main.ts.html +2 -2
  7. package/coverage/lcov-report/src/async/arrays.ts.html +1 -1
  8. package/coverage/lcov-report/src/async/index.html +1 -1
  9. package/coverage/lcov-report/src/async/timeout.ts.html +13 -13
  10. package/coverage/lcov-report/src/cache.ts.html +6 -6
  11. package/coverage/lcov-report/src/dates/calc.ts.html +1 -1
  12. package/coverage/lcov-report/src/dates/convert.ts.html +1 -1
  13. package/coverage/lcov-report/src/dates/datex.ts.html +1 -1
  14. package/coverage/lcov-report/src/dates/format.ts.html +1 -1
  15. package/coverage/lcov-report/src/dates/index.html +1 -1
  16. package/coverage/lcov-report/src/dates/index.ts.html +1 -1
  17. package/coverage/lcov-report/src/dates/parse.ts.html +1 -1
  18. package/coverage/lcov-report/src/dates/period.ts.html +1 -1
  19. package/coverage/lcov-report/src/dates/shift.ts.html +1 -1
  20. package/coverage/lcov-report/src/dates/types.ts.html +1 -1
  21. package/coverage/lcov-report/src/dates/yearDate.ts.html +1 -1
  22. package/coverage/lcov-report/src/disposer.ts.html +1 -1
  23. package/coverage/lcov-report/src/enumHelper.ts.html +1 -1
  24. package/coverage/lcov-report/src/event.ts.html +6 -6
  25. package/coverage/lcov-report/src/fields/index.html +1 -1
  26. package/coverage/lcov-report/src/fields/update.ts.html +1 -1
  27. package/coverage/lcov-report/src/functions.ts.html +1 -1
  28. package/coverage/lcov-report/src/index.html +11 -26
  29. package/coverage/lcov-report/src/lazy/index.html +161 -0
  30. package/coverage/lcov-report/src/lazy/lazy.ts.html +181 -0
  31. package/coverage/lcov-report/src/lazy/light.ts.html +172 -0
  32. package/coverage/lcov-report/src/lazy/observable.ts.html +184 -0
  33. package/coverage/lcov-report/src/lazy/promise.ts.html +229 -0
  34. package/coverage/lcov-report/src/lazy/singleton.ts.html +181 -0
  35. package/coverage/lcov-report/src/lazy.light.ts.html +1 -1
  36. package/coverage/lcov-report/src/logger/batch.ts.html +1 -1
  37. package/coverage/lcov-report/src/logger/console.ts.html +1 -1
  38. package/coverage/lcov-report/src/logger/index.html +1 -1
  39. package/coverage/lcov-report/src/logger/index.ts.html +8 -8
  40. package/coverage/lcov-report/src/logger/named.ts.html +12 -12
  41. package/coverage/lcov-report/src/logger/proxy.ts.html +4 -4
  42. package/coverage/lcov-report/src/math/arrays.ts.html +1 -1
  43. package/coverage/lcov-report/src/math/calc.ts.html +1 -1
  44. package/coverage/lcov-report/src/math/distribution.ts.html +1 -1
  45. package/coverage/lcov-report/src/math/index.html +1 -1
  46. package/coverage/lcov-report/src/math/index.ts.html +1 -1
  47. package/coverage/lcov-report/src/observersMap.ts.html +1 -1
  48. package/coverage/lcov-report/src/observingCache.ts.html +1 -1
  49. package/coverage/lcov-report/src/queue/index.html +14 -14
  50. package/coverage/lcov-report/src/queue/parallel.ts.html +20 -8
  51. package/coverage/lcov-report/src/tempoCache.ts.html +1 -1
  52. package/coverage/lcov-report/src/transitionObserver.ts.html +1 -1
  53. package/coverage/lcov-report/src/types.ts.html +1 -1
  54. package/coverage/lcov-report/src/validation/ValidationErrors.ts.html +1 -1
  55. package/coverage/lcov-report/src/validation/creditCard.ts.html +1 -1
  56. package/coverage/lcov-report/src/validation/helpers.ts.html +1 -1
  57. package/coverage/lcov-report/src/validation/index.html +1 -1
  58. package/coverage/lcov-report/src/validation/index.ts.html +1 -1
  59. package/coverage/lcov-report/src/validation/types.ts.html +1 -1
  60. package/coverage/lcov-report/src/validation/validators.ts.html +3 -3
  61. package/coverage/lcov-report/src/validation/wrappers.ts.html +1 -1
  62. package/coverage/lcov-report/src/viewModels/CommonModel.ts.html +1 -1
  63. package/coverage/lcov-report/src/viewModels/FlagModel.ts.html +1 -1
  64. package/coverage/lcov-report/src/viewModels/LoadingModel.ts.html +1 -1
  65. package/coverage/lcov-report/src/viewModels/MultiSelectModel.ts.html +2 -2
  66. package/coverage/lcov-report/src/viewModels/NumberModel.ts.html +1 -1
  67. package/coverage/lcov-report/src/viewModels/SelectModel.ts.html +2 -2
  68. package/coverage/lcov-report/src/viewModels/TextModel.ts.html +4 -4
  69. package/coverage/lcov-report/src/viewModels/Validatable.ts.html +1 -1
  70. package/coverage/lcov-report/src/viewModels/index.html +5 -5
  71. package/coverage/lcov-report/src/viewModels/wrappers.ts.html +1 -1
  72. package/coverage/lcov.info +358 -228
  73. package/lib/cache.js.map +1 -1
  74. package/lib/lazy/index.d.ts +10 -0
  75. package/lib/lazy/index.d.ts.map +1 -0
  76. package/lib/lazy/index.js +23 -0
  77. package/lib/lazy/index.js.map +1 -0
  78. package/lib/lazy/light.d.ts +8 -0
  79. package/lib/lazy/light.d.ts.map +1 -0
  80. package/lib/lazy/light.js +23 -0
  81. package/lib/lazy/light.js.map +1 -0
  82. package/lib/lazy/observable.d.ts +9 -0
  83. package/lib/lazy/observable.d.ts.map +1 -0
  84. package/lib/lazy/observable.js +30 -0
  85. package/lib/lazy/observable.js.map +1 -0
  86. package/lib/{lazy.d.ts → lazy/promise.d.ts} +4 -14
  87. package/lib/lazy/promise.d.ts.map +1 -0
  88. package/lib/lazy/promise.js +39 -0
  89. package/lib/lazy/promise.js.map +1 -0
  90. package/lib/lazy/singleton.d.ts +13 -0
  91. package/lib/lazy/singleton.d.ts.map +1 -0
  92. package/lib/lazy/singleton.js +29 -0
  93. package/lib/lazy/singleton.js.map +1 -0
  94. package/lib/lazy.light.d.ts +1 -7
  95. package/lib/lazy.light.d.ts.map +1 -1
  96. package/lib/lazy.light.js +5 -20
  97. package/lib/lazy.light.js.map +1 -1
  98. package/lib/queue/parallel.d.ts +2 -0
  99. package/lib/queue/parallel.d.ts.map +1 -1
  100. package/lib/queue/parallel.js +3 -0
  101. package/lib/queue/parallel.js.map +1 -1
  102. package/lib/services/localization/LocalaziedValidationErrors.js.map +1 -1
  103. package/lib/services/localization/LocalizationManager.js.map +1 -1
  104. package/lib/unsubscriber.d.ts.map +1 -1
  105. package/lib/unsubscriber.js +1 -0
  106. package/lib/unsubscriber.js.map +1 -1
  107. package/lib/validation/validators.js +2 -2
  108. package/lib/validation/validators.js.map +1 -1
  109. package/lib/viewModels/MultiSelectModel.js +2 -2
  110. package/lib/viewModels/MultiSelectModel.js.map +1 -1
  111. package/lib/viewModels/PromptModal.js.map +1 -1
  112. package/lib/viewModels/SelectModel.js +2 -2
  113. package/lib/viewModels/SelectModel.js.map +1 -1
  114. package/lib/viewModels/TextModel.js.map +1 -1
  115. package/package.json +15 -16
  116. package/src/__tests__/helpers/expect.ts +3 -0
  117. package/src/__tests__/helpers/main.ts +1 -1
  118. package/src/lazy/__tests__/lazy.test.ts +94 -0
  119. package/src/lazy/index.ts +33 -0
  120. package/src/lazy/light.ts +29 -0
  121. package/src/lazy/observable.ts +33 -0
  122. package/src/lazy/promise.ts +48 -0
  123. package/src/lazy/singleton.ts +32 -0
  124. package/src/lazy.light.ts +4 -25
  125. package/src/logger/__tests__/logger.test.ts +7 -7
  126. package/src/queue/parallel.ts +4 -0
  127. package/src/unsubscriber.ts +3 -0
  128. package/src/validation/__tests__/validator.test.ts +1 -1
  129. package/src/validation/validators.ts +2 -2
  130. package/src/viewModels/MultiSelectModel.ts +1 -1
  131. package/src/viewModels/SelectModel.ts +1 -1
  132. package/yarn.lock +585 -488
  133. package/lib/lazy.d.ts.map +0 -1
  134. package/lib/lazy.js +0 -87
  135. package/lib/lazy.js.map +0 -1
  136. package/src/lazy.ts +0 -86
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zajno/common",
3
- "version": "1.5.9",
3
+ "version": "1.6.0",
4
4
  "description": "Zajno's re-usable utilities for JS/TS projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,25 +25,24 @@
25
25
  "rimraf": "^3"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/faker": "^5.5.9",
29
- "@types/jest": "^28.1.6",
30
- "@types/node": "^16.11.3",
31
- "@zajno/eslint-config": "^2.1.0",
32
- "eslint": "^8.20.0",
33
- "faker": "^5.5.3",
34
- "fast-check": "^2.18.0",
35
- "jest": "^28.1.3",
36
- "jest-extended": "^3.0.2",
37
- "mobx": "^6.6.1",
38
- "ts-jest": "^28.0.7",
28
+ "@faker-js/faker": "^7.5.0",
29
+ "@types/jest": "^29.0.3",
30
+ "@types/node": "^16.11.59",
31
+ "@zajno/eslint-config": "^2.2.0",
32
+ "eslint": "^8.23.1",
33
+ "fast-check": "^3.1.4",
34
+ "jest": "^29.0.3",
35
+ "jest-extended": "^3.1.0",
36
+ "mobx": "^6.6.2",
37
+ "ts-jest": "^29.0.1",
39
38
  "ts-node": "^10.9.1",
40
39
  "tslib": "^2.4.0",
41
- "typescript": "^4.7.4"
40
+ "typescript": "^4.8.3"
42
41
  },
43
42
  "peerDependencies": {
44
- "mobx": "^6",
45
- "tslib": "^2",
46
- "typescript": "^4"
43
+ "mobx": "^6.6",
44
+ "tslib": "^2.4",
45
+ "typescript": "^4.8"
47
46
  },
48
47
  "files": [
49
48
  "src/*",
@@ -0,0 +1,3 @@
1
+ import 'jest-extended';
2
+
3
+ export const expectAnythingOrNothing = expect.toBeOneOf([expect.anything(), undefined, null]);
@@ -1,5 +1,5 @@
1
1
  import fc from 'fast-check';
2
- import faker from 'faker';
2
+ import { faker } from '@faker-js/faker';
3
3
 
4
4
  export const toArbitrary = (fakerGen) => {
5
5
  return fc.integer()
@@ -0,0 +1,94 @@
1
+ import { Lazy } from '../singleton';
2
+ import { LazyPromise } from '../promise';
3
+ import { setTimeoutAsync } from '../../async/timeout';
4
+
5
+ import { LazyObservable, LazyPromiseObservable } from '../observable';
6
+ import { reaction } from 'mobx';
7
+ import { expectAnythingOrNothing } from '../../__tests__/helpers/expect';
8
+
9
+ describe('Lazy', () => {
10
+ it('simple', () => {
11
+ const VAL = 'abc';
12
+ const l = new Lazy(() => VAL);
13
+
14
+ expect(l.hasValue).toBeFalse();
15
+ expect(l.value).toBe(VAL);
16
+ expect(l.hasValue).toBeTrue();
17
+
18
+ l.reset();
19
+ expect(l.hasValue).toBeFalse();
20
+
21
+ l.prewarm();
22
+
23
+ expect(l.hasValue).toBeTrue();
24
+ expect(l.value).toBe(VAL);
25
+ });
26
+
27
+ it('observable', () => {
28
+ const createObj = () => ({ str: 'abc' });
29
+ const l = new LazyObservable(() => createObj());
30
+
31
+ const listener = jest.fn().mockImplementation();
32
+
33
+ const clean = reaction(() => l.value, listener, { fireImmediately: true });
34
+
35
+ expect(listener).toHaveBeenCalledWith(createObj(), expectAnythingOrNothing, expectAnythingOrNothing);
36
+
37
+ listener.mockClear();
38
+
39
+ l.reset();
40
+
41
+ expect(listener).toHaveBeenCalledWith(createObj(), expectAnythingOrNothing, expectAnythingOrNothing);
42
+
43
+ clean();
44
+ });
45
+ });
46
+
47
+ describe('LazyPromise', () => {
48
+
49
+ it('simple', async () => {
50
+ const VAL = 'abc';
51
+ const l = new LazyPromise(() => setTimeoutAsync(100).then(() => VAL));
52
+
53
+ expect(l.hasValue).toBeFalse();
54
+ expect(l.busy).toBeFalse();
55
+
56
+ expect(l.value).toBeUndefined();
57
+ expect(l.busy).toBeTrue();
58
+
59
+ await expect(l.promise).resolves.not.toThrow();
60
+
61
+ expect(l.hasValue).toBeTrue();
62
+ expect(l.busy).toBeFalse();
63
+ expect(l.value).toBe(VAL);
64
+
65
+ l.dispose();
66
+ expect(l.hasValue).toBeFalse();
67
+ });
68
+
69
+ it('observable', async () => {
70
+ const VAL = 'abc';
71
+ const l = new LazyPromiseObservable(() => setTimeoutAsync(200).then(() => VAL));
72
+
73
+ expect(l.hasValue).toBeFalse();
74
+ expect(l.busy).toBeFalse();
75
+
76
+ expect(l.value).toBeUndefined();
77
+ expect(l.busy).toBeTrue();
78
+
79
+ const listener = jest.fn().mockImplementation();
80
+ const clean = reaction(() => l.value, listener, { fireImmediately: true });
81
+
82
+ expect(listener).toHaveBeenCalledWith(undefined, expectAnythingOrNothing, expectAnythingOrNothing);
83
+
84
+ await expect(l.promise).resolves.not.toThrow();
85
+
86
+ expect(listener).toHaveBeenCalledWith(VAL, expectAnythingOrNothing, expectAnythingOrNothing);
87
+
88
+ expect(l.hasValue).toBeTrue();
89
+ expect(l.busy).toBeFalse();
90
+ expect(l.value).toBe(VAL);
91
+
92
+ clean();
93
+ });
94
+ });
@@ -0,0 +1,33 @@
1
+
2
+ import { LazyObservable, LazyPromiseObservable } from './observable';
3
+ import logger from '../logger';
4
+
5
+ // Backward compatibility stuff ...
6
+
7
+ class LazyObservableWarned<T> extends LazyObservable<T> {
8
+
9
+ constructor(factory: () => T) {
10
+ super(factory);
11
+
12
+ logger.log('@zajno/common/lazy: you are using LazyObservable but imported just as Lazy. To avoid this warning import LazyObservable directly from lazy/observable or use non-observable version from lazy/singleton.');
13
+ }
14
+
15
+ }
16
+
17
+ class LazyPromiseObservableWarned<T> extends LazyPromiseObservable<T> {
18
+
19
+ constructor(factory: () => Promise<T>, initial?: T) {
20
+ super(factory, initial);
21
+
22
+ logger.log('@zajno/common/lazy: you are using LazyPromiseObservableWarned but imported just as LazyPromise. To avoid this warning import LazyPromiseObservable directly from lazy/observable or use non-observable version from lazy/promise.');
23
+ }
24
+
25
+ }
26
+
27
+ export default LazyObservableWarned;
28
+
29
+ // In future versions make these imports straight
30
+ export {
31
+ LazyObservableWarned as Lazy,
32
+ LazyPromiseObservableWarned as LazyPromise,
33
+ };
@@ -0,0 +1,29 @@
1
+ import type { IDisposable } from '../disposer';
2
+
3
+ export type LazyLight<T> = IDisposable & {
4
+ readonly value: T;
5
+ readonly hasValue: boolean;
6
+
7
+ reset(): void;
8
+ };
9
+
10
+ export function createLazy<T>(factory: () => T) {
11
+ const _factory = factory;
12
+ let _instance: T = undefined;
13
+
14
+ const res: LazyLight<T> = {
15
+ get value() {
16
+ if (_instance === undefined) {
17
+ _instance = _factory();
18
+ }
19
+ return _instance;
20
+ },
21
+ get hasValue() { return _instance !== undefined; },
22
+ reset: () => {
23
+ _instance = undefined;
24
+ },
25
+ dispose: () => res.reset(),
26
+ };
27
+
28
+ return res;
29
+ }
@@ -0,0 +1,33 @@
1
+ import { Lazy } from './singleton';
2
+ import { LazyPromise } from './promise';
3
+ import { observable, makeObservable, action } from 'mobx';
4
+
5
+ export class LazyObservable<T> extends Lazy<T> {
6
+
7
+ constructor(factory: (() => T)) {
8
+ super(factory);
9
+
10
+ makeObservable<Lazy<T>, '_instance' | 'ensureInstance'>(this, {
11
+ _instance: observable,
12
+ reset: action,
13
+ ensureInstance: action,
14
+ });
15
+ }
16
+ }
17
+
18
+ export class LazyPromiseObservable<T> extends LazyPromise<T> {
19
+
20
+ constructor(
21
+ factory: () => Promise<T>,
22
+ initial?: T,
23
+ ) {
24
+ super(factory, initial);
25
+
26
+ makeObservable<LazyPromise<T>, '_instance' | '_busy' | 'setInstance'>(this, {
27
+ _instance: observable.ref,
28
+ _busy: observable,
29
+ setInstance: action,
30
+ reset: action,
31
+ });
32
+ }
33
+ }
@@ -0,0 +1,48 @@
1
+ import type { IDisposable } from '../disposer';
2
+
3
+ export class LazyPromise<T> implements IDisposable {
4
+
5
+ private _instance: T = undefined;
6
+ private _busy: boolean = null;
7
+
8
+ private _promise: Promise<T> = null;
9
+
10
+ constructor(
11
+ private readonly _factory: () => Promise<T>,
12
+ private readonly initial: T = undefined,
13
+ ) {
14
+ this._instance = initial;
15
+ }
16
+
17
+ get busy() { return this._busy || false; }
18
+ get hasValue() { return this._busy === false; }
19
+
20
+ get promise() {
21
+ return this._promise;
22
+ }
23
+
24
+ get value() {
25
+ if (this._busy === null) {
26
+ this._busy = true;
27
+ this._promise = this._factory();
28
+ this._promise.then(this.setInstance);
29
+ }
30
+
31
+ return this._instance;
32
+ }
33
+
34
+ private setInstance = (res: T) => {
35
+ this._busy = false;
36
+ this._instance = res || null;
37
+
38
+ // keep this._promise to allow to re-use it outside
39
+ };
40
+
41
+ reset() {
42
+ this._busy = null;
43
+ this._instance = this.initial;
44
+ this._promise = null;
45
+ }
46
+
47
+ dispose = () => this.reset();
48
+ }
@@ -0,0 +1,32 @@
1
+ import type { IDisposable } from '../disposer';
2
+
3
+ export class Lazy<T> implements IDisposable {
4
+
5
+ protected _instance: T = null;
6
+
7
+ constructor(protected readonly _factory: (() => T)) { }
8
+
9
+ get hasValue() { return this._instance !== null; }
10
+
11
+ get value() {
12
+ this.ensureInstance();
13
+ return this._instance;
14
+ }
15
+
16
+ private ensureInstance() {
17
+ if (this._instance === null) {
18
+ this._instance = this._factory();
19
+ }
20
+ }
21
+
22
+ prewarm() {
23
+ this.ensureInstance();
24
+ return this;
25
+ }
26
+
27
+ reset() {
28
+ this._instance = null;
29
+ }
30
+
31
+ dispose() { this.reset(); }
32
+ }
package/src/lazy.light.ts CHANGED
@@ -1,29 +1,8 @@
1
- import type { IDisposable } from './disposer';
2
1
 
3
- export type LazyLight<T> = IDisposable & {
4
- readonly value: T;
5
- readonly hasValue: boolean;
2
+ // DEPRECATED MODULE. Delete in future versions
6
3
 
7
- reset(): void;
8
- };
4
+ import logger from './logger';
9
5
 
10
- export function createLazy<T>(factory: () => T) {
11
- const _factory = factory;
12
- let _instance: T = undefined;
6
+ export * from './lazy/light';
13
7
 
14
- const res: LazyLight<T> = {
15
- get value() {
16
- if (_instance === undefined) {
17
- _instance = _factory();
18
- }
19
- return _instance;
20
- },
21
- get hasValue() { return _instance !== undefined; },
22
- reset: () => {
23
- _instance = undefined;
24
- },
25
- dispose: () => res.reset(),
26
- };
27
-
28
- return res;
29
- }
8
+ logger.warn('@zajno/common: importing module "lazy.light" is deprecated; please change your import to "lazy/light" module.');
@@ -1,4 +1,4 @@
1
- import faker from 'faker';
1
+ import { faker } from '@faker-js/faker';
2
2
  import logger, { batchLoggers, createLogger, getMode, ILogger, setMode } from '..';
3
3
  import fc from 'fast-check';
4
4
  import { toArbitrary } from '../../__tests__/helpers/main';
@@ -9,16 +9,16 @@ const CONSOLE = console;
9
9
  describe('#logger-tests', () => {
10
10
 
11
11
  const customLogger = {
12
- log: jest.fn().mockImplementation(null),
13
- warn: jest.fn().mockImplementation(null),
14
- error: jest.fn().mockImplementation(null),
12
+ log: jest.fn().mockImplementation(),
13
+ warn: jest.fn().mockImplementation(),
14
+ error: jest.fn().mockImplementation(),
15
15
  };
16
16
  const customLoggerGetter = () => customLogger;
17
17
 
18
18
  const consoleMocks: Record<keyof ILogger, jest.SpyInstance> = {
19
- log: jest.spyOn(CONSOLE, 'log').mockImplementation(null),
20
- warn: jest.spyOn(CONSOLE, 'warn').mockImplementation(null),
21
- error: jest.spyOn(CONSOLE, 'error').mockImplementation(null),
19
+ log: jest.spyOn(CONSOLE, 'log').mockImplementation(),
20
+ warn: jest.spyOn(CONSOLE, 'warn').mockImplementation(),
21
+ error: jest.spyOn(CONSOLE, 'error').mockImplementation(),
22
22
  } as const;
23
23
  const loggerMethods = Object.keys(consoleMocks) as (keyof ILogger)[];
24
24
 
@@ -17,6 +17,7 @@ export class ParallelQueue {
17
17
 
18
18
  private readonly _beforePriorityRun = new Event<number>();
19
19
  private readonly _afterPriorityRun = new Event<number>();
20
+ private readonly _finished = new Event();
20
21
 
21
22
  public get currentPriority() { return this._currentIndex; }
22
23
  public get inProgress() { return this._inProgress; }
@@ -24,6 +25,8 @@ export class ParallelQueue {
24
25
  public get beforePriorityRun() { return this._beforePriorityRun.expose(); }
25
26
  public get afterPriorityRun() { return this._afterPriorityRun.expose(); }
26
27
 
28
+ public get finished() { return this._finished.expose(); }
29
+
27
30
  public withLogger(name?: string) {
28
31
  this._logger = createLogger(`[Queue:${name || '?'}]`);
29
32
  return this;
@@ -120,6 +123,7 @@ export class ParallelQueue {
120
123
  // looks like we've finished!
121
124
  this._inProgress = false;
122
125
  this._logger?.log('Finished processing at index =', this._currentIndex);
126
+ this._finished.trigger();
123
127
  return;
124
128
  }
125
129
 
@@ -1,3 +1,6 @@
1
+
2
+ // DEPRECATED MODULE. Delete in future versions
3
+
1
4
  import logger from './logger';
2
5
 
3
6
  export {
@@ -1,6 +1,6 @@
1
1
  import * as validation from '..';
2
2
  import { ValidationErrors } from '../ValidationErrors';
3
- import faker from 'faker';
3
+ import { faker } from '@faker-js/faker';
4
4
  import fc from 'fast-check';
5
5
  import { toArbitrary } from '../../__tests__/helpers/main';
6
6
 
@@ -4,7 +4,7 @@ import { ValidationErrors } from './ValidationErrors';
4
4
  export const ValidatorsRegExps = {
5
5
  // There is at least first and last name
6
6
  // eslint-disable-next-line no-useless-escape
7
- name: /^[a-z,\.'-]+( +[a-z,\.'-]+)+$/i,
7
+ name: /^[\p{L},\.'-]+( +[\p{L},\.'-]+)+$/iu,
8
8
  englishLetters: /^([a-zA-Z\s]+)$/,
9
9
  email: /^([a-zA-Z0-9_.\-\\+])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/,
10
10
 
@@ -22,7 +22,7 @@ export const ValidatorsRegExps = {
22
22
  expiryDateCard: /^\d+$/,
23
23
  cvv: /^\d+$/,
24
24
  // eslint-disable-next-line no-useless-escape
25
- website: /^(https?:\/\/)?([a-z0-9]+((((-?[a-z0-9]{2,})+)?)\.))+[a-z]{2,}(:[0-9]{1,})?(\/.*)?$/i,
25
+ website: /^(https?:\/\/)?((\p{N}|\p{L})+((((-?(\p{N}|\p{L})+)+)?)\.))+\p{L}{2,}(:[0-9]+)?(\/.*)?$/iu,
26
26
  linkedin: /^(https?:\/\/)?([a-z]+\d*[a-z]*\.)?linkedin\.com\/.*$/i,
27
27
  };
28
28
 
@@ -1,4 +1,4 @@
1
- import { createLazy } from '../lazy.light';
1
+ import { createLazy } from '../lazy/light';
2
2
  import { action, computed, makeObservable, observable, reaction } from 'mobx';
3
3
  import { FlagModel, ILabeledFlagModel } from './FlagModel';
4
4
  import { ValidatableModel } from './Validatable';
@@ -1,5 +1,5 @@
1
1
  import { observable, computed, makeObservable, reaction, action } from 'mobx';
2
- import { createLazy } from '../lazy.light';
2
+ import { createLazy } from '../lazy/light';
3
3
  import { FlagModel, ILabeledFlagModel } from './FlagModel';
4
4
  import { ValidatableModel } from './Validatable';
5
5
  import { IValueModel } from './types';