@zajno/common 1.6.3 → 2.0.0-beta.2
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/.eslintrc.js +1 -1
- package/README.md +6 -1
- package/coverage/clover.xml +344 -1066
- package/coverage/coverage-final.json +31 -45
- package/coverage/lcov-report/__tests__/helpers/expect.ts.html +1 -1
- package/coverage/lcov-report/__tests__/helpers/index.html +1 -1
- package/coverage/lcov-report/__tests__/helpers/main.ts.html +1 -1
- package/coverage/lcov-report/async/arrays.ts.html +1 -1
- package/coverage/lcov-report/async/index.html +36 -21
- package/coverage/lcov-report/async/timeout.ts.html +59 -59
- package/coverage/lcov-report/dates/calc.ts.html +1 -1
- package/coverage/lcov-report/dates/convert.ts.html +1 -1
- package/coverage/lcov-report/dates/datex.ts.html +1 -1
- package/coverage/lcov-report/dates/format.ts.html +1 -1
- package/coverage/lcov-report/dates/index.html +1 -1
- package/coverage/lcov-report/dates/index.ts.html +1 -1
- package/coverage/lcov-report/dates/parse.ts.html +1 -1
- package/coverage/lcov-report/dates/period.ts.html +1 -1
- package/coverage/lcov-report/dates/shift.ts.html +1 -1
- package/coverage/lcov-report/dates/types.ts.html +1 -1
- package/coverage/lcov-report/dates/yearDate.ts.html +1 -1
- package/coverage/lcov-report/fields/index.html +1 -1
- package/coverage/lcov-report/fields/update.ts.html +1 -1
- package/coverage/lcov-report/functions/index.html +17 -17
- package/coverage/lcov-report/functions/safeCall.ts.html +13 -13
- package/coverage/lcov-report/index.html +119 -74
- package/coverage/lcov-report/lazy/index.html +1 -1
- package/coverage/lcov-report/lazy/promise.ts.html +1 -1
- package/coverage/lcov-report/lazy/singleton.ts.html +1 -1
- package/coverage/lcov-report/logger/batch.ts.html +1 -1
- package/coverage/lcov-report/logger/console.ts.html +1 -1
- package/coverage/lcov-report/logger/index.html +1 -1
- package/coverage/lcov-report/logger/index.ts.html +1 -1
- package/coverage/lcov-report/logger/named.ts.html +1 -1
- package/coverage/lcov-report/logger/proxy.ts.html +1 -1
- package/coverage/lcov-report/math/arrays.ts.html +1 -1
- package/coverage/lcov-report/math/calc.ts.html +1 -1
- package/coverage/lcov-report/math/distribution.ts.html +1 -1
- package/coverage/lcov-report/math/index.html +1 -1
- package/coverage/lcov-report/math/index.ts.html +1 -1
- package/coverage/lcov-report/observing/event.ts.html +1 -1
- package/coverage/lcov-report/observing/index.html +1 -1
- package/coverage/lcov-report/structures/helpers/enum.ts.html +1 -1
- package/coverage/lcov-report/structures/helpers/index.html +1 -1
- package/coverage/lcov-report/structures/index.html +1 -1
- package/coverage/lcov-report/structures/queue/index.html +24 -9
- package/coverage/lcov-report/structures/queue/parallel.ts.html +1 -1
- package/coverage/lcov-report/structures/queue/tasks.ts.html +358 -0
- package/coverage/lcov-report/structures/tempoCache.ts.html +1 -1
- package/coverage/lcov-report/types/comparator.ts.html +1 -1
- package/coverage/lcov-report/types/getter.ts.html +1 -1
- package/coverage/lcov-report/types/index.html +1 -1
- package/coverage/lcov-report/types/index.ts.html +1 -1
- package/coverage/lcov-report/validation/ValidationErrors.ts.html +1 -1
- package/coverage/lcov-report/validation/creditCard.ts.html +1 -1
- package/coverage/lcov-report/validation/helpers.ts.html +1 -1
- package/coverage/lcov-report/validation/index.html +1 -1
- package/coverage/lcov-report/validation/index.ts.html +1 -1
- package/coverage/lcov-report/validation/types.ts.html +1 -1
- package/coverage/lcov-report/validation/validators.ts.html +1 -1
- package/coverage/lcov-report/validation/wrappers.ts.html +1 -1
- package/coverage/lcov.info +863 -2381
- package/lib/fields/update.js +3 -3
- package/lib/fields/update.js.map +1 -1
- package/lib/{assert.d.ts → functions/assert.d.ts} +1 -1
- package/lib/functions/assert.d.ts.map +1 -0
- package/lib/{assert.js → functions/assert.js} +2 -2
- package/lib/functions/assert.js.map +1 -0
- package/lib/{disposer.d.ts → functions/disposer.d.ts} +0 -0
- package/lib/functions/disposer.d.ts.map +1 -0
- package/lib/{disposer.js → functions/disposer.js} +1 -1
- package/lib/functions/disposer.js.map +1 -0
- package/lib/functions/safeCall.d.ts +2 -0
- package/lib/functions/safeCall.d.ts.map +1 -0
- package/lib/{functions.js → functions/safeCall.js} +1 -1
- package/lib/functions/safeCall.js.map +1 -0
- package/lib/{throttle.d.ts → functions/throttle.d.ts} +0 -0
- package/lib/functions/throttle.d.ts.map +1 -0
- package/lib/{throttle.js → functions/throttle.js} +1 -1
- package/lib/functions/throttle.js.map +1 -0
- package/lib/lazy/light.d.ts +1 -1
- package/lib/lazy/light.d.ts.map +1 -1
- package/lib/lazy/promise.d.ts +1 -1
- package/lib/lazy/promise.d.ts.map +1 -1
- package/lib/lazy/singleton.d.ts +1 -1
- package/lib/lazy/singleton.d.ts.map +1 -1
- package/lib/math/arrays.d.ts +1 -0
- package/lib/math/arrays.d.ts.map +1 -1
- package/lib/math/arrays.js +13 -1
- package/lib/math/arrays.js.map +1 -1
- package/lib/{event.d.ts → observing/event.d.ts} +2 -3
- package/lib/observing/event.d.ts.map +1 -0
- package/lib/{event.js → observing/event.js} +2 -3
- package/lib/{event.js.map → observing/event.js.map} +1 -1
- package/lib/{throttledEvent.d.ts → observing/throttledEvent.d.ts} +0 -0
- package/lib/observing/throttledEvent.d.ts.map +1 -0
- package/lib/{throttledEvent.js → observing/throttledEvent.js} +1 -1
- package/lib/observing/throttledEvent.js.map +1 -0
- package/lib/{timer.d.ts → observing/timer.d.ts} +1 -1
- package/lib/observing/timer.d.ts.map +1 -0
- package/lib/{timer.js → observing/timer.js} +0 -0
- package/lib/observing/timer.js.map +1 -0
- package/lib/{abstractions/services/storage.d.ts → storage/abstractions.d.ts} +3 -2
- package/lib/storage/abstractions.d.ts.map +1 -0
- package/lib/{services/localization → storage}/abstractions.js +0 -0
- package/lib/storage/abstractions.js.map +1 -0
- package/lib/storage/asyncWrapper.d.ts +10 -0
- package/lib/storage/asyncWrapper.d.ts.map +1 -0
- package/lib/storage/asyncWrapper.js +24 -0
- package/lib/storage/asyncWrapper.js.map +1 -0
- package/lib/storage/index.d.ts +2 -0
- package/lib/storage/index.d.ts.map +1 -0
- package/lib/storage/index.js +5 -0
- package/lib/storage/index.js.map +1 -0
- package/lib/{services/storage/index.d.ts → storage/keyStorage.d.ts} +2 -10
- package/lib/storage/keyStorage.d.ts.map +1 -0
- package/lib/{services/storage/index.js → storage/keyStorage.js} +2 -22
- package/lib/storage/keyStorage.js.map +1 -0
- package/lib/{enumHelper.d.ts → structures/helpers/enum.d.ts} +1 -1
- package/lib/structures/helpers/enum.d.ts.map +1 -0
- package/lib/{enumHelper.js → structures/helpers/enum.js} +1 -1
- package/lib/structures/helpers/enum.js.map +1 -0
- package/lib/{nameHelper.d.ts → structures/helpers/name.d.ts} +5 -5
- package/lib/structures/helpers/name.d.ts.map +1 -0
- package/lib/{nameHelper.js → structures/helpers/name.js} +7 -6
- package/lib/structures/helpers/name.js.map +1 -0
- package/lib/structures/linkedList.d.ts +39 -0
- package/lib/structures/linkedList.d.ts.map +1 -0
- package/lib/structures/linkedList.js +82 -0
- package/lib/structures/linkedList.js.map +1 -0
- package/lib/{pool.d.ts → structures/pool.d.ts} +1 -1
- package/lib/structures/pool.d.ts.map +1 -0
- package/lib/{pool.js → structures/pool.js} +2 -2
- package/lib/structures/pool.js.map +1 -0
- package/lib/{queue → structures/queue}/parallel.d.ts +3 -3
- package/lib/structures/queue/parallel.d.ts.map +1 -0
- package/lib/{queue → structures/queue}/parallel.js +2 -2
- package/lib/structures/queue/parallel.js.map +1 -0
- package/lib/{queue → structures/queue}/tasks.d.ts +1 -1
- package/lib/structures/queue/tasks.d.ts.map +1 -0
- package/lib/{queue → structures/queue}/tasks.js +0 -0
- package/lib/structures/queue/tasks.js.map +1 -0
- package/lib/{tempoCache.d.ts → structures/tempoCache.d.ts} +0 -0
- package/lib/structures/tempoCache.d.ts.map +1 -0
- package/lib/{tempoCache.js → structures/tempoCache.js} +0 -0
- package/lib/structures/tempoCache.js.map +1 -0
- package/lib/types/comparator.d.ts +5 -0
- package/lib/types/comparator.d.ts.map +1 -0
- package/lib/types/comparator.js +8 -0
- package/lib/types/comparator.js.map +1 -0
- package/lib/types/deep.d.ts +9 -0
- package/lib/types/deep.d.ts.map +1 -0
- package/lib/{viewModels/types.js → types/deep.js} +1 -1
- package/lib/types/deep.js.map +1 -0
- package/lib/types/functions.d.ts +7 -0
- package/lib/types/functions.d.ts.map +1 -0
- package/lib/{abstractions/services/storage.js → types/functions.js} +1 -1
- package/lib/types/functions.js.map +1 -0
- package/lib/types/getter.d.ts +5 -0
- package/lib/types/getter.d.ts.map +1 -0
- package/lib/{types.js → types/getter.js} +2 -6
- package/lib/types/getter.js.map +1 -0
- package/lib/{ident.d.ts → types/ident.d.ts} +0 -0
- package/lib/types/ident.d.ts.map +1 -0
- package/lib/{ident.js → types/ident.js} +0 -0
- package/lib/types/ident.js.map +1 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +7 -0
- package/lib/types/index.js.map +1 -0
- package/lib/validation/ValidationErrors.d.ts +1 -1
- package/lib/validation/ValidationErrors.d.ts.map +1 -1
- package/lib/validation/ValidationErrors.js +2 -2
- package/lib/validation/ValidationErrors.js.map +1 -1
- package/lib/{emails.d.ts → validation/emails.d.ts} +0 -0
- package/lib/validation/emails.d.ts.map +1 -0
- package/lib/{emails.js → validation/emails.js} +0 -0
- package/lib/validation/emails.js.map +1 -0
- package/package.json +16 -16
- package/src/async/__tests__/timeout.test.ts +1 -1
- package/src/fields/update.ts +1 -1
- package/src/{assert.ts → functions/assert.ts} +2 -2
- package/src/{disposer.ts → functions/disposer.ts} +1 -1
- package/src/functions/safeCall.ts +6 -0
- package/src/{throttle.ts → functions/throttle.ts} +1 -1
- package/src/lazy/__tests__/lazy.test.ts +1 -48
- package/src/lazy/light.ts +1 -1
- package/src/lazy/promise.ts +1 -1
- package/src/lazy/singleton.ts +1 -1
- package/src/math/arrays.ts +13 -0
- package/src/{event.ts → observing/event.ts} +3 -4
- package/src/{throttledEvent.ts → observing/throttledEvent.ts} +1 -1
- package/src/{timer.ts → observing/timer.ts} +1 -1
- package/src/{abstractions/services/storage.ts → storage/abstractions.ts} +3 -1
- package/src/storage/asyncWrapper.ts +24 -0
- package/src/storage/index.ts +2 -0
- package/src/{services/storage/index.ts → storage/keyStorage.ts} +1 -24
- package/src/{__tests__ → structures/__tests__}/enumHelper.test.ts +1 -1
- package/src/{__tests__ → structures/__tests__}/tempoCache.test.ts +1 -1
- package/src/{enumHelper.ts → structures/helpers/enum.ts} +0 -0
- package/src/{nameHelper.ts → structures/helpers/name.ts} +4 -4
- package/src/structures/linkedList.ts +129 -0
- package/src/{pool.ts → structures/pool.ts} +2 -2
- package/src/{queue → structures/queue}/__tests__/parallel.test.ts +2 -2
- package/src/{queue → structures/queue}/__tests__/tasks.test.ts +2 -2
- package/src/{queue → structures/queue}/parallel.ts +2 -2
- package/src/{queue → structures/queue}/tasks.ts +1 -1
- package/src/{tempoCache.ts → structures/tempoCache.ts} +0 -0
- package/src/types/comparator.ts +6 -0
- package/src/types/deep.ts +18 -0
- package/src/types/functions.ts +8 -0
- package/src/types/getter.ts +14 -0
- package/src/{ident.ts → types/ident.ts} +0 -0
- package/src/types/index.ts +9 -0
- package/src/validation/ValidationErrors.ts +1 -1
- package/src/{emails.ts → validation/emails.ts} +0 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +0 -1
- package/yarn.lock +467 -370
- package/lib/abstractions/services/storage.d.ts.map +0 -1
- package/lib/abstractions/services/storage.js.map +0 -1
- package/lib/assert.d.ts.map +0 -1
- package/lib/assert.js.map +0 -1
- package/lib/cache.d.ts +0 -36
- package/lib/cache.d.ts.map +0 -1
- package/lib/cache.js +0 -165
- package/lib/cache.js.map +0 -1
- package/lib/deepPartial.d.ts +0 -4
- package/lib/deepPartial.d.ts.map +0 -1
- package/lib/deepPartial.js +0 -3
- package/lib/deepPartial.js.map +0 -1
- package/lib/disposer.d.ts.map +0 -1
- package/lib/disposer.js.map +0 -1
- package/lib/emails.d.ts.map +0 -1
- package/lib/emails.js.map +0 -1
- package/lib/enumHelper.d.ts.map +0 -1
- package/lib/enumHelper.js.map +0 -1
- package/lib/event.d.ts.map +0 -1
- package/lib/functions.d.ts +0 -9
- package/lib/functions.d.ts.map +0 -1
- package/lib/functions.js.map +0 -1
- package/lib/ident.d.ts.map +0 -1
- package/lib/ident.js.map +0 -1
- package/lib/lazy/index.d.ts +0 -10
- package/lib/lazy/index.d.ts.map +0 -1
- package/lib/lazy/index.js +0 -23
- package/lib/lazy/index.js.map +0 -1
- package/lib/lazy/observable.d.ts +0 -9
- package/lib/lazy/observable.d.ts.map +0 -1
- package/lib/lazy/observable.js +0 -31
- package/lib/lazy/observable.js.map +0 -1
- package/lib/lazy.light.d.ts +0 -2
- package/lib/lazy.light.d.ts.map +0 -1
- package/lib/lazy.light.js +0 -8
- package/lib/lazy.light.js.map +0 -1
- package/lib/nameHelper.d.ts.map +0 -1
- package/lib/nameHelper.js.map +0 -1
- package/lib/observersMap.d.ts +0 -22
- package/lib/observersMap.d.ts.map +0 -1
- package/lib/observersMap.js +0 -93
- package/lib/observersMap.js.map +0 -1
- package/lib/observingCache.d.ts +0 -32
- package/lib/observingCache.d.ts.map +0 -1
- package/lib/observingCache.js +0 -128
- package/lib/observingCache.js.map +0 -1
- package/lib/pool.d.ts.map +0 -1
- package/lib/pool.js.map +0 -1
- package/lib/queue/parallel.d.ts.map +0 -1
- package/lib/queue/parallel.js.map +0 -1
- package/lib/queue/tasks.d.ts.map +0 -1
- package/lib/queue/tasks.js.map +0 -1
- package/lib/services/localization/LocalaziedValidationErrors.d.ts +0 -9
- package/lib/services/localization/LocalaziedValidationErrors.d.ts.map +0 -1
- package/lib/services/localization/LocalaziedValidationErrors.js +0 -27
- package/lib/services/localization/LocalaziedValidationErrors.js.map +0 -1
- package/lib/services/localization/LocalizationManager.d.ts +0 -18
- package/lib/services/localization/LocalizationManager.d.ts.map +0 -1
- package/lib/services/localization/LocalizationManager.js +0 -58
- package/lib/services/localization/LocalizationManager.js.map +0 -1
- package/lib/services/localization/abstractions.d.ts +0 -12
- package/lib/services/localization/abstractions.d.ts.map +0 -1
- package/lib/services/localization/abstractions.js.map +0 -1
- package/lib/services/localization/defaultShape.d.ts +0 -26
- package/lib/services/localization/defaultShape.d.ts.map +0 -1
- package/lib/services/localization/defaultShape.js +0 -28
- package/lib/services/localization/defaultShape.js.map +0 -1
- package/lib/services/localization/index.d.ts +0 -5
- package/lib/services/localization/index.d.ts.map +0 -1
- package/lib/services/localization/index.js +0 -10
- package/lib/services/localization/index.js.map +0 -1
- package/lib/services/storage/index.d.ts.map +0 -1
- package/lib/services/storage/index.js.map +0 -1
- package/lib/services/storage/web/localStorage.d.ts +0 -13
- package/lib/services/storage/web/localStorage.d.ts.map +0 -1
- package/lib/services/storage/web/localStorage.js +0 -29
- package/lib/services/storage/web/localStorage.js.map +0 -1
- package/lib/services/storage/web/sessionStorage.d.ts +0 -13
- package/lib/services/storage/web/sessionStorage.d.ts.map +0 -1
- package/lib/services/storage/web/sessionStorage.js +0 -29
- package/lib/services/storage/web/sessionStorage.js.map +0 -1
- package/lib/services/storage/web/webStorage.d.ts +0 -9
- package/lib/services/storage/web/webStorage.d.ts.map +0 -1
- package/lib/services/storage/web/webStorage.js +0 -24
- package/lib/services/storage/web/webStorage.js.map +0 -1
- package/lib/tempoCache.d.ts.map +0 -1
- package/lib/tempoCache.js.map +0 -1
- package/lib/throttle.d.ts.map +0 -1
- package/lib/throttle.js.map +0 -1
- package/lib/throttledEvent.d.ts.map +0 -1
- package/lib/throttledEvent.js.map +0 -1
- package/lib/timeHelper.d.ts +0 -7
- package/lib/timeHelper.d.ts.map +0 -1
- package/lib/timeHelper.js +0 -37
- package/lib/timeHelper.js.map +0 -1
- package/lib/timer.d.ts.map +0 -1
- package/lib/timer.js.map +0 -1
- package/lib/transitionObserver.d.ts +0 -36
- package/lib/transitionObserver.d.ts.map +0 -1
- package/lib/transitionObserver.js +0 -153
- package/lib/transitionObserver.js.map +0 -1
- package/lib/types.d.ts +0 -17
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/unsubscriber.d.ts +0 -2
- package/lib/unsubscriber.d.ts.map +0 -1
- package/lib/unsubscriber.js +0 -12
- package/lib/unsubscriber.js.map +0 -1
- package/lib/validation/ValidationErrorsLocalization.d.ts +0 -27
- package/lib/validation/ValidationErrorsLocalization.d.ts.map +0 -1
- package/lib/validation/ValidationErrorsLocalization.js +0 -26
- package/lib/validation/ValidationErrorsLocalization.js.map +0 -1
- package/lib/viewModels/CommonModel.d.ts +0 -13
- package/lib/viewModels/CommonModel.d.ts.map +0 -1
- package/lib/viewModels/CommonModel.js +0 -38
- package/lib/viewModels/CommonModel.js.map +0 -1
- package/lib/viewModels/FlagModel.d.ts +0 -22
- package/lib/viewModels/FlagModel.d.ts.map +0 -1
- package/lib/viewModels/FlagModel.js +0 -52
- package/lib/viewModels/FlagModel.js.map +0 -1
- package/lib/viewModels/InitializableModel.d.ts +0 -6
- package/lib/viewModels/InitializableModel.d.ts.map +0 -1
- package/lib/viewModels/InitializableModel.js +0 -23
- package/lib/viewModels/InitializableModel.js.map +0 -1
- package/lib/viewModels/LoadingModel.d.ts +0 -17
- package/lib/viewModels/LoadingModel.d.ts.map +0 -1
- package/lib/viewModels/LoadingModel.js +0 -42
- package/lib/viewModels/LoadingModel.js.map +0 -1
- package/lib/viewModels/MultiSelectModel.d.ts +0 -47
- package/lib/viewModels/MultiSelectModel.d.ts.map +0 -1
- package/lib/viewModels/MultiSelectModel.js +0 -144
- package/lib/viewModels/MultiSelectModel.js.map +0 -1
- package/lib/viewModels/NumberModel.d.ts +0 -19
- package/lib/viewModels/NumberModel.d.ts.map +0 -1
- package/lib/viewModels/NumberModel.js +0 -38
- package/lib/viewModels/NumberModel.js.map +0 -1
- package/lib/viewModels/PromptModal.d.ts +0 -31
- package/lib/viewModels/PromptModal.d.ts.map +0 -1
- package/lib/viewModels/PromptModal.js +0 -57
- package/lib/viewModels/PromptModal.js.map +0 -1
- package/lib/viewModels/SelectModel.d.ts +0 -35
- package/lib/viewModels/SelectModel.d.ts.map +0 -1
- package/lib/viewModels/SelectModel.js +0 -118
- package/lib/viewModels/SelectModel.js.map +0 -1
- package/lib/viewModels/TextModel.d.ts +0 -41
- package/lib/viewModels/TextModel.d.ts.map +0 -1
- package/lib/viewModels/TextModel.js +0 -98
- package/lib/viewModels/TextModel.js.map +0 -1
- package/lib/viewModels/Validatable.d.ts +0 -26
- package/lib/viewModels/Validatable.d.ts.map +0 -1
- package/lib/viewModels/Validatable.js +0 -81
- package/lib/viewModels/Validatable.js.map +0 -1
- package/lib/viewModels/ValueModel.d.ts +0 -12
- package/lib/viewModels/ValueModel.d.ts.map +0 -1
- package/lib/viewModels/ValueModel.js +0 -29
- package/lib/viewModels/ValueModel.js.map +0 -1
- package/lib/viewModels/ValuesCollector.d.ts +0 -26
- package/lib/viewModels/ValuesCollector.d.ts.map +0 -1
- package/lib/viewModels/ValuesCollector.js +0 -51
- package/lib/viewModels/ValuesCollector.js.map +0 -1
- package/lib/viewModels/index.d.ts +0 -12
- package/lib/viewModels/index.d.ts.map +0 -1
- package/lib/viewModels/index.js +0 -15
- package/lib/viewModels/index.js.map +0 -1
- package/lib/viewModels/types.d.ts +0 -19
- package/lib/viewModels/types.d.ts.map +0 -1
- package/lib/viewModels/types.js.map +0 -1
- package/lib/viewModels/wrappers.d.ts +0 -12
- package/lib/viewModels/wrappers.d.ts.map +0 -1
- package/lib/viewModels/wrappers.js +0 -43
- package/lib/viewModels/wrappers.js.map +0 -1
- package/src/__tests__/observingCache.test.ts +0 -127
- package/src/__tests__/transitionObserver.test.ts +0 -219
- package/src/cache.ts +0 -181
- package/src/deepPartial.ts +0 -4
- package/src/functions.ts +0 -14
- package/src/lazy/index.ts +0 -33
- package/src/lazy/observable.ts +0 -37
- package/src/lazy.light.ts +0 -8
- package/src/observersMap.ts +0 -105
- package/src/observingCache.ts +0 -160
- package/src/services/localization/LocalaziedValidationErrors.ts +0 -18
- package/src/services/localization/LocalizationManager.ts +0 -53
- package/src/services/localization/abstractions.ts +0 -16
- package/src/services/localization/defaultShape.ts +0 -26
- package/src/services/localization/index.ts +0 -6
- package/src/services/storage/web/localStorage.ts +0 -35
- package/src/services/storage/web/sessionStorage.ts +0 -35
- package/src/services/storage/web/webStorage.ts +0 -29
- package/src/timeHelper.ts +0 -39
- package/src/transitionObserver.ts +0 -183
- package/src/types.ts +0 -30
- package/src/unsubscriber.ts +0 -14
- package/src/validation/ValidationErrorsLocalization.ts +0 -27
- package/src/viewModels/CommonModel.ts +0 -45
- package/src/viewModels/FlagModel.ts +0 -70
- package/src/viewModels/InitializableModel.ts +0 -17
- package/src/viewModels/LoadingModel.ts +0 -52
- package/src/viewModels/MultiSelectModel.ts +0 -178
- package/src/viewModels/NumberModel.ts +0 -50
- package/src/viewModels/PromptModal.ts +0 -65
- package/src/viewModels/SelectModel.ts +0 -152
- package/src/viewModels/TextModel.ts +0 -127
- package/src/viewModels/Validatable.ts +0 -102
- package/src/viewModels/ValueModel.ts +0 -34
- package/src/viewModels/ValuesCollector.ts +0 -81
- package/src/viewModels/__tests__/common.test.ts +0 -107
- package/src/viewModels/__tests__/multiSelect.test.ts +0 -138
- package/src/viewModels/__tests__/select.test.ts +0 -71
- package/src/viewModels/__tests__/wrappers.test.ts +0 -79
- package/src/viewModels/index.ts +0 -15
- package/src/viewModels/types.ts +0 -23
- package/src/viewModels/wrappers.ts +0 -49
- package/tsconfig.eslint.json +0 -9
|
@@ -2,9 +2,7 @@ import { Lazy } from '../singleton';
|
|
|
2
2
|
import { LazyPromise } from '../promise';
|
|
3
3
|
import { setTimeoutAsync } from '../../async/timeout';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { reaction } from 'mobx';
|
|
7
|
-
import { expectAnythingOrNothing } from '../../__tests__/helpers/expect';
|
|
5
|
+
import '../../__tests__/helpers/expect';
|
|
8
6
|
|
|
9
7
|
describe('Lazy', () => {
|
|
10
8
|
it('simple', () => {
|
|
@@ -23,25 +21,6 @@ describe('Lazy', () => {
|
|
|
23
21
|
expect(l.hasValue).toBeTrue();
|
|
24
22
|
expect(l.value).toBe(VAL);
|
|
25
23
|
});
|
|
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
24
|
});
|
|
46
25
|
|
|
47
26
|
describe('LazyPromise', () => {
|
|
@@ -66,30 +45,4 @@ describe('LazyPromise', () => {
|
|
|
66
45
|
expect(l.hasValue).toBeFalse();
|
|
67
46
|
});
|
|
68
47
|
|
|
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
|
-
expect(l.promise).not.toBeNull();
|
|
79
|
-
|
|
80
|
-
const listener = jest.fn().mockImplementation();
|
|
81
|
-
const clean = reaction(() => l.value, listener, { fireImmediately: true });
|
|
82
|
-
|
|
83
|
-
expect(listener).toHaveBeenCalledWith(undefined, expectAnythingOrNothing, expectAnythingOrNothing);
|
|
84
|
-
|
|
85
|
-
await expect(l.promise).resolves.not.toThrow();
|
|
86
|
-
|
|
87
|
-
expect(listener).toHaveBeenCalledWith(VAL, expectAnythingOrNothing, expectAnythingOrNothing);
|
|
88
|
-
|
|
89
|
-
expect(l.hasValue).toBeTrue();
|
|
90
|
-
expect(l.busy).toBeFalse();
|
|
91
|
-
expect(l.value).toBe(VAL);
|
|
92
|
-
|
|
93
|
-
clean();
|
|
94
|
-
});
|
|
95
48
|
});
|
package/src/lazy/light.ts
CHANGED
package/src/lazy/promise.ts
CHANGED
package/src/lazy/singleton.ts
CHANGED
package/src/math/arrays.ts
CHANGED
|
@@ -259,3 +259,16 @@ export function arrayRepeat<T>(factory: Getter<T>, count = 1) {
|
|
|
259
259
|
}
|
|
260
260
|
return res;
|
|
261
261
|
}
|
|
262
|
+
|
|
263
|
+
export function chunkify<T>(array: T[], size: number): T[][] {
|
|
264
|
+
return array.reduce((res, item) => {
|
|
265
|
+
let arr = res[res.length - 1];
|
|
266
|
+
if (!arr || arr.length >= size) {
|
|
267
|
+
arr = [];
|
|
268
|
+
res.push(arr);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
arr.push(item);
|
|
272
|
+
return res;
|
|
273
|
+
}, [] as T[][]);
|
|
274
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Predicate } from '
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import { ILogger, createLogger } from './logger';
|
|
1
|
+
import type { Predicate } from '../types';
|
|
2
|
+
import { forEachAsync } from '../async/arrays';
|
|
3
|
+
import { ILogger, createLogger } from '../logger';
|
|
5
4
|
|
|
6
5
|
export type EventHandler<T = any> = (data?: T) => void | Promise<void>;
|
|
7
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
export
|
|
2
|
+
export interface IStorage {
|
|
3
3
|
getValue(key: string): Promise<string>;
|
|
4
4
|
setValue(key: string, value: string): Promise<void>;
|
|
5
5
|
|
|
@@ -14,3 +14,5 @@ export interface IStorageSync {
|
|
|
14
14
|
removeValue(key: string): boolean;
|
|
15
15
|
hasValue(key: string): boolean;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export default IStorage;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IStorage, IStorageSync } from './abstractions';
|
|
2
|
+
|
|
3
|
+
export class StorageAsyncWrapper implements IStorage {
|
|
4
|
+
|
|
5
|
+
constructor(readonly webStorage: IStorageSync) { }
|
|
6
|
+
|
|
7
|
+
getValue(key: string) {
|
|
8
|
+
return Promise.resolve(this.webStorage.getValue(key));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
setValue(key: string, value: string) {
|
|
12
|
+
this.webStorage.setValue(key, value);
|
|
13
|
+
return Promise.resolve();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
hasValue(key: string) {
|
|
17
|
+
return Promise.resolve(this.webStorage.hasValue(key));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
remove(key: string) {
|
|
21
|
+
this.webStorage.removeValue(key);
|
|
22
|
+
return Promise.resolve();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export class StorageAsyncWrapper implements IStorage {
|
|
4
|
-
|
|
5
|
-
constructor(readonly webStorage: IStorageSync) { }
|
|
6
|
-
|
|
7
|
-
getValue(key: string) {
|
|
8
|
-
return Promise.resolve(this.webStorage.getValue(key));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
setValue(key: string, value: string) {
|
|
12
|
-
this.webStorage.setValue(key, value);
|
|
13
|
-
return Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
hasValue(key: string) {
|
|
17
|
-
return Promise.resolve(this.webStorage.hasValue(key));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
remove(key: string) {
|
|
21
|
-
this.webStorage.removeValue(key);
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import { IStorageSync } from './abstractions';
|
|
25
2
|
|
|
26
3
|
export class KeyStorage {
|
|
27
4
|
constructor(readonly storage: IStorageSync, readonly key: string) { }
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
type DisplayName = { displayName: string };
|
|
3
|
-
type SplittedName = {
|
|
2
|
+
export type DisplayName = { displayName: string };
|
|
3
|
+
export type SplittedName = {
|
|
4
4
|
firstName: string,
|
|
5
5
|
lastName: string,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
type FullName = DisplayName & SplittedName;
|
|
8
|
+
export type FullName = DisplayName & SplittedName;
|
|
9
9
|
|
|
10
10
|
function splitDisplayName(name: Partial<DisplayName>): SplittedName {
|
|
11
11
|
if (!name || !name.displayName) {
|
|
@@ -21,7 +21,7 @@ function splitDisplayName(name: Partial<DisplayName>): SplittedName {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const NamesHelper = {
|
|
24
|
+
export const NamesHelper = {
|
|
25
25
|
|
|
26
26
|
split(name: Partial<DisplayName>): SplittedName { return splitDisplayName(name); },
|
|
27
27
|
join(name: Partial<SplittedName>): DisplayName { return { displayName: `${name.firstName} ${name.lastName}` }; },
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
|
|
2
|
+
export interface ILinkedListItem<T> {
|
|
3
|
+
readonly value: T;
|
|
4
|
+
readonly next?: ILinkedListItem<T> | undefined;
|
|
5
|
+
readonly prev?: ILinkedListItem<T> | undefined;
|
|
6
|
+
|
|
7
|
+
readonly position: number;
|
|
8
|
+
|
|
9
|
+
readonly list: LinkedList<T>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ILinkedList<T> extends Iterable<ILinkedListItem<T>> {
|
|
13
|
+
readonly root: ILinkedListItem<T> | undefined;
|
|
14
|
+
readonly last: ILinkedListItem<T> | undefined;
|
|
15
|
+
|
|
16
|
+
readonly length: number;
|
|
17
|
+
|
|
18
|
+
add(value: T): ILinkedListItem<T>;
|
|
19
|
+
remove(item: ILinkedListItem<T>): void;
|
|
20
|
+
removeLast(): void;
|
|
21
|
+
removeFirst(): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface LinkedListItem<T> extends ILinkedListItem<T> {
|
|
26
|
+
next?: LinkedListItem<T>;
|
|
27
|
+
prev?: LinkedListItem<T>;
|
|
28
|
+
|
|
29
|
+
position: number;
|
|
30
|
+
|
|
31
|
+
list: LinkedList<T>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class LinkedList<T> implements ILinkedList<T> {
|
|
35
|
+
|
|
36
|
+
private _root: LinkedListItem<T> = null;
|
|
37
|
+
private _last: LinkedListItem<T> = null;
|
|
38
|
+
|
|
39
|
+
private _length = 0;
|
|
40
|
+
|
|
41
|
+
get root(): ILinkedListItem<T> { return this._root; }
|
|
42
|
+
get last(): ILinkedListItem<T> { return this._last; }
|
|
43
|
+
get length() { return this._length; }
|
|
44
|
+
|
|
45
|
+
*[Symbol.iterator]() {
|
|
46
|
+
let current = this._root;
|
|
47
|
+
while (current) {
|
|
48
|
+
yield current;
|
|
49
|
+
current = current.next;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
add(value: T) {
|
|
54
|
+
const next: LinkedListItem<T> = {
|
|
55
|
+
value: value,
|
|
56
|
+
list: this,
|
|
57
|
+
position: null,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
this._length++;
|
|
61
|
+
|
|
62
|
+
if (!this.root || !this.last) {
|
|
63
|
+
next.position = 0;
|
|
64
|
+
this._root = this._last = next;
|
|
65
|
+
} else {
|
|
66
|
+
next.prev = this._last;
|
|
67
|
+
this._last.next = next;
|
|
68
|
+
this._last = next;
|
|
69
|
+
next.position = this._length - 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return this.last;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
remove(item: ILinkedListItem<T>) {
|
|
76
|
+
if (!item || item.list !== this) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const itemInternal = item as LinkedListItem<T>;
|
|
81
|
+
const { next, prev } = itemInternal;
|
|
82
|
+
let removed = false;
|
|
83
|
+
|
|
84
|
+
if (next && next.prev === item) {
|
|
85
|
+
next.prev = prev;
|
|
86
|
+
|
|
87
|
+
if (this._root === item) {
|
|
88
|
+
this._root = next;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
removed = true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (prev && prev.next === item) {
|
|
95
|
+
prev.next = next;
|
|
96
|
+
|
|
97
|
+
if (this._last === item) {
|
|
98
|
+
this._last = prev;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
removed = true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
itemInternal.prev = itemInternal.next = null;
|
|
105
|
+
itemInternal.list = undefined;
|
|
106
|
+
|
|
107
|
+
if (removed) {
|
|
108
|
+
this._length--;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
removeLast(): void {
|
|
113
|
+
this.remove(this._last);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
removeFirst(): void {
|
|
117
|
+
this.remove(this._root);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
clear(): void {
|
|
121
|
+
for (const item of this) {
|
|
122
|
+
item.next = item.prev = undefined;
|
|
123
|
+
item.list = undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this._root = this._last = null;
|
|
127
|
+
this._length = 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'jest-extended';
|
|
2
2
|
import { ParallelQueue } from '../parallel';
|
|
3
|
-
import { setTimeoutAsync } from '
|
|
4
|
-
import { setMode } from '
|
|
3
|
+
import { setTimeoutAsync } from '../../../async/timeout';
|
|
4
|
+
import { setMode } from '../../../logger';
|
|
5
5
|
|
|
6
6
|
const createLoader = () => jest.fn(() => setTimeoutAsync(100));
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TasksQueue } from '../tasks';
|
|
2
|
-
import { setTimeoutAsync } from '
|
|
3
|
-
import { safeCall } from '
|
|
2
|
+
import { setTimeoutAsync } from '../../../async/timeout';
|
|
3
|
+
import { safeCall } from '../../../functions/safeCall';
|
|
4
4
|
import 'jest-extended';
|
|
5
5
|
|
|
6
6
|
describe('TasksQueue', () => {
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
type Primitive = number | string | Symbol | boolean | null | undefined | bigint;
|
|
3
|
+
|
|
4
|
+
export type DeepReadonly<T> = T extends (Function | Primitive)
|
|
5
|
+
? T
|
|
6
|
+
: (
|
|
7
|
+
T extends Object
|
|
8
|
+
? { readonly [P in keyof T]: DeepReadonly<T[P]>; }
|
|
9
|
+
: T
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export type DeepPartial<T> = T extends (Function | Primitive)
|
|
13
|
+
? T
|
|
14
|
+
: (
|
|
15
|
+
T extends Object
|
|
16
|
+
? { [P in keyof T]?: DeepPartial<T[P]>; }
|
|
17
|
+
: T
|
|
18
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
export type Getter<T> = (() => T) | T | null;
|
|
3
|
+
|
|
4
|
+
export namespace Getter {
|
|
5
|
+
export function getValue<T>(getter: Getter<T>): T {
|
|
6
|
+
if (getter == null) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (typeof getter === 'function') {
|
|
10
|
+
return (getter as () => T)();
|
|
11
|
+
}
|
|
12
|
+
return getter;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
File without changes
|
|
File without changes
|