@zajno/common 2.0.3 → 2.0.4
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/{lib/abstractions → abstractions}/controllers/IPluggableController.d.ts +0 -0
- package/{lib/abstractions → abstractions}/controllers/IPluggableController.d.ts.map +0 -0
- package/{lib/abstractions → abstractions}/controllers/IPluggableController.js +0 -0
- package/{lib/abstractions → abstractions}/controllers/IPluggableController.js.map +0 -0
- package/{lib/async → async}/arrays.d.ts +0 -0
- package/{lib/async → async}/arrays.d.ts.map +0 -0
- package/{lib/async → async}/arrays.extend.d.ts +0 -0
- package/{lib/async → async}/arrays.extend.d.ts.map +0 -0
- package/{lib/async → async}/arrays.extend.js +0 -0
- package/{lib/async → async}/arrays.extend.js.map +0 -0
- package/{lib/async → async}/arrays.js +0 -0
- package/{lib/async → async}/arrays.js.map +0 -0
- package/{lib/async → async}/misc.d.ts +0 -0
- package/{lib/async → async}/misc.d.ts.map +0 -0
- package/{lib/async → async}/misc.js +0 -0
- package/{lib/async → async}/misc.js.map +0 -0
- package/{lib/async → async}/timeout.d.ts +0 -0
- package/{lib/async → async}/timeout.d.ts.map +0 -0
- package/{lib/async → async}/timeout.js +0 -0
- package/{lib/async → async}/timeout.js.map +0 -0
- package/{lib/controllers → controllers}/PluggableController.d.ts +0 -0
- package/{lib/controllers → controllers}/PluggableController.d.ts.map +0 -0
- package/{lib/controllers → controllers}/PluggableController.js +0 -0
- package/{lib/controllers → controllers}/PluggableController.js.map +0 -0
- package/{lib/dates → dates}/calc.d.ts +0 -0
- package/{lib/dates → dates}/calc.d.ts.map +0 -0
- package/{lib/dates → dates}/calc.js +0 -0
- package/{lib/dates → dates}/calc.js.map +0 -0
- package/{lib/dates → dates}/convert.d.ts +0 -0
- package/{lib/dates → dates}/convert.d.ts.map +0 -0
- package/{lib/dates → dates}/convert.js +0 -0
- package/{lib/dates → dates}/convert.js.map +0 -0
- package/{lib/dates → dates}/datex.d.ts +0 -0
- package/{lib/dates → dates}/datex.d.ts.map +0 -0
- package/{lib/dates → dates}/datex.js +0 -0
- package/{lib/dates → dates}/datex.js.map +0 -0
- package/{lib/dates → dates}/format.d.ts +0 -0
- package/{lib/dates → dates}/format.d.ts.map +0 -0
- package/{lib/dates → dates}/format.js +0 -0
- package/{lib/dates → dates}/format.js.map +0 -0
- package/{lib/dates → dates}/index.d.ts +0 -0
- package/{lib/dates → dates}/index.d.ts.map +0 -0
- package/{lib/dates → dates}/index.js +0 -0
- package/{lib/dates → dates}/index.js.map +0 -0
- package/{lib/dates → dates}/parse.d.ts +0 -0
- package/{lib/dates → dates}/parse.d.ts.map +0 -0
- package/{lib/dates → dates}/parse.js +0 -0
- package/{lib/dates → dates}/parse.js.map +0 -0
- package/{lib/dates → dates}/period.d.ts +0 -0
- package/{lib/dates → dates}/period.d.ts.map +0 -0
- package/{lib/dates → dates}/period.js +0 -0
- package/{lib/dates → dates}/period.js.map +0 -0
- package/{lib/dates → dates}/shift.d.ts +0 -0
- package/{lib/dates → dates}/shift.d.ts.map +0 -0
- package/{lib/dates → dates}/shift.js +0 -0
- package/{lib/dates → dates}/shift.js.map +0 -0
- package/{lib/dates → dates}/types.d.ts +0 -0
- package/{lib/dates → dates}/types.d.ts.map +0 -0
- package/{lib/dates → dates}/types.js +0 -0
- package/{lib/dates → dates}/types.js.map +0 -0
- package/{lib/dates → dates}/yearDate.d.ts +0 -0
- package/{lib/dates → dates}/yearDate.d.ts.map +0 -0
- package/{lib/dates → dates}/yearDate.js +0 -0
- package/{lib/dates → dates}/yearDate.js.map +0 -0
- package/{lib/fields → fields}/filter.d.ts +0 -0
- package/{lib/fields → fields}/filter.d.ts.map +0 -0
- package/{lib/fields → fields}/filter.js +0 -0
- package/{lib/fields → fields}/filter.js.map +0 -0
- package/{lib/fields → fields}/index.d.ts +0 -0
- package/{lib/fields → fields}/index.d.ts.map +0 -0
- package/{lib/fields → fields}/index.js +0 -0
- package/{lib/fields → fields}/index.js.map +0 -0
- package/{lib/fields → fields}/transfer.d.ts +0 -0
- package/{lib/fields → fields}/transfer.d.ts.map +0 -0
- package/{lib/fields → fields}/transfer.js +0 -0
- package/{lib/fields → fields}/transfer.js.map +0 -0
- package/{lib/fields → fields}/update.d.ts +0 -0
- package/{lib/fields → fields}/update.d.ts.map +0 -0
- package/{lib/fields → fields}/update.js +0 -0
- package/{lib/fields → fields}/update.js.map +0 -0
- package/{lib/functions → functions}/assert.d.ts +0 -0
- package/{lib/functions → functions}/assert.d.ts.map +0 -0
- package/{lib/functions → functions}/assert.js +0 -0
- package/{lib/functions → functions}/assert.js.map +0 -0
- package/{lib/functions → functions}/disposer.d.ts +0 -0
- package/{lib/functions → functions}/disposer.d.ts.map +0 -0
- package/{lib/functions → functions}/disposer.js +0 -0
- package/{lib/functions → functions}/disposer.js.map +0 -0
- package/{lib/functions → functions}/safeCall.d.ts +0 -0
- package/{lib/functions → functions}/safeCall.d.ts.map +0 -0
- package/{lib/functions → functions}/safeCall.js +0 -0
- package/{lib/functions → functions}/safeCall.js.map +0 -0
- package/{lib/functions → functions}/throttle.d.ts +0 -0
- package/{lib/functions → functions}/throttle.d.ts.map +0 -0
- package/{lib/functions → functions}/throttle.js +0 -0
- package/{lib/functions → functions}/throttle.js.map +0 -0
- package/{lib/lazy → lazy}/light.d.ts +0 -0
- package/{lib/lazy → lazy}/light.d.ts.map +0 -0
- package/{lib/lazy → lazy}/light.js +0 -0
- package/{lib/lazy → lazy}/light.js.map +0 -0
- package/{lib/lazy → lazy}/promise.d.ts +0 -0
- package/{lib/lazy → lazy}/promise.d.ts.map +0 -0
- package/{lib/lazy → lazy}/promise.js +0 -0
- package/{lib/lazy → lazy}/promise.js.map +0 -0
- package/{lib/lazy → lazy}/singleton.d.ts +0 -0
- package/{lib/lazy → lazy}/singleton.d.ts.map +0 -0
- package/{lib/lazy → lazy}/singleton.js +0 -0
- package/{lib/lazy → lazy}/singleton.js.map +0 -0
- package/{lib/logger → logger}/abstractions.d.ts +0 -0
- package/{lib/logger → logger}/abstractions.d.ts.map +0 -0
- package/{lib/logger → logger}/abstractions.js +0 -0
- package/{lib/logger → logger}/abstractions.js.map +0 -0
- package/{lib/logger → logger}/batch.d.ts +0 -0
- package/{lib/logger → logger}/batch.d.ts.map +0 -0
- package/{lib/logger → logger}/batch.js +0 -0
- package/{lib/logger → logger}/batch.js.map +0 -0
- package/{lib/logger → logger}/console.d.ts +0 -0
- package/{lib/logger → logger}/console.d.ts.map +0 -0
- package/{lib/logger → logger}/console.js +0 -0
- package/{lib/logger → logger}/console.js.map +0 -0
- package/{lib/logger → logger}/file.d.ts +0 -0
- package/{lib/logger → logger}/file.d.ts.map +0 -0
- package/{lib/logger → logger}/file.js +0 -0
- package/{lib/logger → logger}/file.js.map +0 -0
- package/{lib/logger → logger}/index.d.ts +0 -0
- package/{lib/logger → logger}/index.d.ts.map +0 -0
- package/{lib/logger → logger}/index.js +0 -0
- package/{lib/logger → logger}/index.js.map +0 -0
- package/{lib/logger → logger}/named.d.ts +0 -0
- package/{lib/logger → logger}/named.d.ts.map +0 -0
- package/{lib/logger → logger}/named.js +0 -0
- package/{lib/logger → logger}/named.js.map +0 -0
- package/{lib/logger → logger}/proxy.d.ts +0 -0
- package/{lib/logger → logger}/proxy.d.ts.map +0 -0
- package/{lib/logger → logger}/proxy.js +0 -0
- package/{lib/logger → logger}/proxy.js.map +0 -0
- package/{lib/math → math}/arrays.d.ts +0 -0
- package/{lib/math → math}/arrays.d.ts.map +0 -0
- package/{lib/math → math}/arrays.js +0 -0
- package/{lib/math → math}/arrays.js.map +0 -0
- package/{lib/math → math}/calc.d.ts +0 -0
- package/{lib/math → math}/calc.d.ts.map +0 -0
- package/{lib/math → math}/calc.js +0 -0
- package/{lib/math → math}/calc.js.map +0 -0
- package/{lib/math → math}/distribution.d.ts +0 -0
- package/{lib/math → math}/distribution.d.ts.map +0 -0
- package/{lib/math → math}/distribution.js +0 -0
- package/{lib/math → math}/distribution.js.map +0 -0
- package/{lib/math → math}/index.d.ts +0 -0
- package/{lib/math → math}/index.d.ts.map +0 -0
- package/{lib/math → math}/index.js +0 -0
- package/{lib/math → math}/index.js.map +0 -0
- package/{lib/models → models}/EntityWithStatus.d.ts +0 -0
- package/{lib/models → models}/EntityWithStatus.d.ts.map +0 -0
- package/{lib/models → models}/EntityWithStatus.js +0 -0
- package/{lib/models → models}/EntityWithStatus.js.map +0 -0
- package/{lib/models → models}/File.d.ts +0 -0
- package/{lib/models → models}/File.d.ts.map +0 -0
- package/{lib/models → models}/File.js +0 -0
- package/{lib/models → models}/File.js.map +0 -0
- package/models/Model.d.ts +12 -0
- package/models/Model.d.ts.map +1 -0
- package/models/Model.js +23 -0
- package/models/Model.js.map +1 -0
- package/{lib/observing → observing}/event.d.ts +0 -0
- package/{lib/observing → observing}/event.d.ts.map +0 -0
- package/{lib/observing → observing}/event.js +0 -0
- package/{lib/observing → observing}/event.js.map +0 -0
- package/{lib/observing → observing}/progressTracker.d.ts +0 -0
- package/{lib/observing → observing}/progressTracker.d.ts.map +0 -0
- package/{lib/observing → observing}/progressTracker.js +0 -0
- package/{lib/observing → observing}/progressTracker.js.map +0 -0
- package/{lib/observing → observing}/throttledEvent.d.ts +0 -0
- package/{lib/observing → observing}/throttledEvent.d.ts.map +0 -0
- package/{lib/observing → observing}/throttledEvent.js +0 -0
- package/{lib/observing → observing}/throttledEvent.js.map +0 -0
- package/{lib/observing → observing}/timer.d.ts +0 -0
- package/{lib/observing → observing}/timer.d.ts.map +0 -0
- package/{lib/observing → observing}/timer.js +0 -0
- package/{lib/observing → observing}/timer.js.map +0 -0
- package/package.json +8 -9
- package/{lib/storage → storage}/abstractions.d.ts +0 -0
- package/{lib/storage → storage}/abstractions.d.ts.map +0 -0
- package/{lib/storage → storage}/abstractions.js +0 -0
- package/{lib/storage → storage}/abstractions.js.map +0 -0
- package/{lib/storage → storage}/asyncWrapper.d.ts +0 -0
- package/{lib/storage → storage}/asyncWrapper.d.ts.map +0 -0
- package/{lib/storage → storage}/asyncWrapper.js +0 -0
- package/{lib/storage → storage}/asyncWrapper.js.map +0 -0
- package/{lib/storage → storage}/index.d.ts +0 -0
- package/{lib/storage → storage}/index.d.ts.map +0 -0
- package/{lib/storage → storage}/index.js +0 -0
- package/{lib/storage → storage}/index.js.map +0 -0
- package/{lib/storage → storage}/keyStorage.d.ts +0 -0
- package/{lib/storage → storage}/keyStorage.d.ts.map +0 -0
- package/{lib/storage → storage}/keyStorage.js +0 -0
- package/{lib/storage → storage}/keyStorage.js.map +0 -0
- package/{lib/structures → structures}/helpers/enum.d.ts +0 -0
- package/{lib/structures → structures}/helpers/enum.d.ts.map +0 -0
- package/{lib/structures → structures}/helpers/enum.js +0 -0
- package/{lib/structures → structures}/helpers/enum.js.map +0 -0
- package/{lib/structures → structures}/helpers/name.d.ts +0 -0
- package/{lib/structures → structures}/helpers/name.d.ts.map +0 -0
- package/{lib/structures → structures}/helpers/name.js +0 -0
- package/{lib/structures → structures}/helpers/name.js.map +0 -0
- package/{lib/structures → structures}/linkedList.d.ts +0 -0
- package/{lib/structures → structures}/linkedList.d.ts.map +0 -0
- package/{lib/structures → structures}/linkedList.js +0 -0
- package/{lib/structures → structures}/linkedList.js.map +0 -0
- package/{lib/structures → structures}/pool.d.ts +0 -0
- package/{lib/structures → structures}/pool.d.ts.map +0 -0
- package/{lib/structures → structures}/pool.js +0 -0
- package/{lib/structures → structures}/pool.js.map +0 -0
- package/{lib/structures → structures}/queue/parallel.d.ts +0 -0
- package/{lib/structures → structures}/queue/parallel.d.ts.map +0 -0
- package/{lib/structures → structures}/queue/parallel.js +0 -0
- package/{lib/structures → structures}/queue/parallel.js.map +0 -0
- package/{lib/structures → structures}/queue/tasks.d.ts +0 -0
- package/{lib/structures → structures}/queue/tasks.d.ts.map +0 -0
- package/{lib/structures → structures}/queue/tasks.js +0 -0
- package/{lib/structures → structures}/queue/tasks.js.map +0 -0
- package/{lib/structures → structures}/tempoCache.d.ts +0 -0
- package/{lib/structures → structures}/tempoCache.d.ts.map +0 -0
- package/{lib/structures → structures}/tempoCache.js +0 -0
- package/{lib/structures → structures}/tempoCache.js.map +0 -0
- package/{lib/types → types}/comparator.d.ts +0 -0
- package/{lib/types → types}/comparator.d.ts.map +0 -0
- package/{lib/types → types}/comparator.js +0 -0
- package/{lib/types → types}/comparator.js.map +0 -0
- package/{lib/types → types}/deep.d.ts +0 -0
- package/{lib/types → types}/deep.d.ts.map +0 -0
- package/{lib/types → types}/deep.js +0 -0
- package/{lib/types → types}/deep.js.map +0 -0
- package/{lib/types → types}/functions.d.ts +0 -0
- package/{lib/types → types}/functions.d.ts.map +0 -0
- package/{lib/types → types}/functions.js +0 -0
- package/{lib/types → types}/functions.js.map +0 -0
- package/{lib/types → types}/getter.d.ts +0 -0
- package/{lib/types → types}/getter.d.ts.map +0 -0
- package/{lib/types → types}/getter.js +0 -0
- package/{lib/types → types}/getter.js.map +0 -0
- package/{lib/types → types}/ident.d.ts +0 -0
- package/{lib/types → types}/ident.d.ts.map +0 -0
- package/{lib/types → types}/ident.js +0 -0
- package/{lib/types → types}/ident.js.map +0 -0
- package/{lib/types → types}/index.d.ts +3 -0
- package/{lib/types → types}/index.d.ts.map +1 -1
- package/{lib/types → types}/index.js +0 -0
- package/{lib/types → types}/index.js.map +0 -0
- package/types/models.d.ts +19 -0
- package/types/models.d.ts.map +1 -0
- package/types/models.js +3 -0
- package/types/models.js.map +1 -0
- package/{lib/validation → validation}/ValidationErrors.d.ts +0 -0
- package/{lib/validation → validation}/ValidationErrors.d.ts.map +0 -0
- package/{lib/validation → validation}/ValidationErrors.js +0 -0
- package/{lib/validation → validation}/ValidationErrors.js.map +0 -0
- package/{lib/validation → validation}/creditCard.d.ts +0 -0
- package/{lib/validation → validation}/creditCard.d.ts.map +0 -0
- package/{lib/validation → validation}/creditCard.js +0 -0
- package/{lib/validation → validation}/creditCard.js.map +0 -0
- package/{lib/validation → validation}/emails.d.ts +0 -0
- package/{lib/validation → validation}/emails.d.ts.map +0 -0
- package/{lib/validation → validation}/emails.js +0 -0
- package/{lib/validation → validation}/emails.js.map +0 -0
- package/{lib/validation → validation}/helpers.d.ts +0 -0
- package/{lib/validation → validation}/helpers.d.ts.map +0 -0
- package/{lib/validation → validation}/helpers.js +0 -0
- package/{lib/validation → validation}/helpers.js.map +0 -0
- package/{lib/validation → validation}/index.d.ts +0 -0
- package/{lib/validation → validation}/index.d.ts.map +0 -0
- package/{lib/validation → validation}/index.js +0 -0
- package/{lib/validation → validation}/index.js.map +0 -0
- package/{lib/validation → validation}/types.d.ts +0 -0
- package/{lib/validation → validation}/types.d.ts.map +0 -0
- package/{lib/validation → validation}/types.js +0 -0
- package/{lib/validation → validation}/types.js.map +0 -0
- package/{lib/validation → validation}/validators.d.ts +0 -0
- package/{lib/validation → validation}/validators.d.ts.map +0 -0
- package/{lib/validation → validation}/validators.js +0 -0
- package/{lib/validation → validation}/validators.js.map +0 -0
- package/{lib/validation → validation}/wrappers.d.ts +0 -0
- package/{lib/validation → validation}/wrappers.d.ts.map +0 -0
- package/{lib/validation → validation}/wrappers.js +0 -0
- package/{lib/validation → validation}/wrappers.js.map +0 -0
- package/.eslintignore +0 -5
- package/.eslintrc.js +0 -9
- package/.github/workflows/CI.yml +0 -48
- package/.gitignore +0 -13
- package/.nvmrc +0 -1
- package/coverage/clover.xml +0 -1280
- package/coverage/coverage-final.json +0 -43
- package/coverage/lcov-report/CommonModel.ts.html +0 -215
- package/coverage/lcov-report/FlagModel.ts.html +0 -290
- package/coverage/lcov-report/MultiSelectModel.ts.html +0 -614
- package/coverage/lcov-report/NumberModel.ts.html +0 -230
- package/coverage/lcov-report/SelectModel.ts.html +0 -503
- package/coverage/lcov-report/Validatable.ts.html +0 -386
- package/coverage/lcov-report/__tests__/helpers/expect.ts.html +0 -94
- package/coverage/lcov-report/__tests__/helpers/index.html +0 -131
- package/coverage/lcov-report/__tests__/helpers/main.ts.html +0 -121
- package/coverage/lcov-report/async/arrays.ts.html +0 -199
- package/coverage/lcov-report/async/index.html +0 -131
- package/coverage/lcov-report/async/timeout.ts.html +0 -337
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/dates/calc.ts.html +0 -301
- package/coverage/lcov-report/dates/convert.ts.html +0 -658
- package/coverage/lcov-report/dates/datex.ts.html +0 -211
- package/coverage/lcov-report/dates/format.ts.html +0 -403
- package/coverage/lcov-report/dates/index.html +0 -251
- package/coverage/lcov-report/dates/index.ts.html +0 -112
- package/coverage/lcov-report/dates/parse.ts.html +0 -157
- package/coverage/lcov-report/dates/period.ts.html +0 -154
- package/coverage/lcov-report/dates/shift.ts.html +0 -355
- package/coverage/lcov-report/dates/types.ts.html +0 -181
- package/coverage/lcov-report/dates/yearDate.ts.html +0 -193
- package/coverage/lcov-report/disposer.ts.html +0 -376
- package/coverage/lcov-report/enumHelper.ts.html +0 -454
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/fields/index.html +0 -116
- package/coverage/lcov-report/fields/update.ts.html +0 -457
- package/coverage/lcov-report/functions/disposer.ts.html +0 -376
- package/coverage/lcov-report/functions/index.html +0 -116
- package/coverage/lcov-report/functions/safeCall.ts.html +0 -103
- package/coverage/lcov-report/index.html +0 -311
- package/coverage/lcov-report/lazy/index.html +0 -131
- package/coverage/lcov-report/lazy/light.ts.html +0 -172
- package/coverage/lcov-report/lazy/promise.ts.html +0 -241
- package/coverage/lcov-report/lazy/singleton.ts.html +0 -181
- package/coverage/lcov-report/logger/batch.ts.html +0 -112
- package/coverage/lcov-report/logger/console.ts.html +0 -241
- package/coverage/lcov-report/logger/index.html +0 -176
- package/coverage/lcov-report/logger/index.ts.html +0 -298
- package/coverage/lcov-report/logger/named.ts.html +0 -226
- package/coverage/lcov-report/logger/proxy.ts.html +0 -172
- package/coverage/lcov-report/math/arrays.ts.html +0 -907
- package/coverage/lcov-report/math/calc.ts.html +0 -292
- package/coverage/lcov-report/math/distribution.ts.html +0 -145
- package/coverage/lcov-report/math/index.html +0 -161
- package/coverage/lcov-report/math/index.ts.html +0 -166
- package/coverage/lcov-report/observing/event.ts.html +0 -358
- package/coverage/lcov-report/observing/index.html +0 -116
- package/coverage/lcov-report/observing/transition.ts.html +0 -634
- package/coverage/lcov-report/parallel.ts.html +0 -550
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/queue/index.html +0 -116
- package/coverage/lcov-report/queue/parallel.ts.html +0 -499
- package/coverage/lcov-report/queue/tasks.ts.html +0 -358
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/__tests__/helpers/expect.ts.html +0 -94
- package/coverage/lcov-report/src/__tests__/helpers/index.html +0 -131
- package/coverage/lcov-report/src/__tests__/helpers/main.ts.html +0 -121
- package/coverage/lcov-report/src/async/arrays.ts.html +0 -199
- package/coverage/lcov-report/src/async/index.html +0 -131
- package/coverage/lcov-report/src/async/timeout.ts.html +0 -337
- package/coverage/lcov-report/src/cache.ts.html +0 -628
- package/coverage/lcov-report/src/dates/calc.ts.html +0 -301
- package/coverage/lcov-report/src/dates/convert.ts.html +0 -658
- package/coverage/lcov-report/src/dates/datex.ts.html +0 -211
- package/coverage/lcov-report/src/dates/format.ts.html +0 -403
- package/coverage/lcov-report/src/dates/index.html +0 -251
- package/coverage/lcov-report/src/dates/index.ts.html +0 -112
- package/coverage/lcov-report/src/dates/parse.ts.html +0 -157
- package/coverage/lcov-report/src/dates/period.ts.html +0 -154
- package/coverage/lcov-report/src/dates/shift.ts.html +0 -355
- package/coverage/lcov-report/src/dates/types.ts.html +0 -181
- package/coverage/lcov-report/src/dates/yearDate.ts.html +0 -193
- package/coverage/lcov-report/src/disposer.ts.html +0 -376
- package/coverage/lcov-report/src/enumHelper.ts.html +0 -454
- package/coverage/lcov-report/src/event.ts.html +0 -361
- package/coverage/lcov-report/src/fields/index.html +0 -116
- package/coverage/lcov-report/src/fields/update.ts.html +0 -457
- package/coverage/lcov-report/src/functions.ts.html +0 -127
- package/coverage/lcov-report/src/index.html +0 -251
- package/coverage/lcov-report/src/lazy/index.html +0 -161
- package/coverage/lcov-report/src/lazy/lazy.ts.html +0 -181
- package/coverage/lcov-report/src/lazy/light.ts.html +0 -172
- package/coverage/lcov-report/src/lazy/observable.ts.html +0 -196
- package/coverage/lcov-report/src/lazy/promise.ts.html +0 -241
- package/coverage/lcov-report/src/lazy/singleton.ts.html +0 -181
- package/coverage/lcov-report/src/lazy.light.ts.html +0 -172
- package/coverage/lcov-report/src/logger/batch.ts.html +0 -112
- package/coverage/lcov-report/src/logger/console.ts.html +0 -241
- package/coverage/lcov-report/src/logger/index.html +0 -176
- package/coverage/lcov-report/src/logger/index.ts.html +0 -298
- package/coverage/lcov-report/src/logger/named.ts.html +0 -226
- package/coverage/lcov-report/src/logger/proxy.ts.html +0 -172
- package/coverage/lcov-report/src/math/arrays.ts.html +0 -868
- package/coverage/lcov-report/src/math/calc.ts.html +0 -292
- package/coverage/lcov-report/src/math/distribution.ts.html +0 -145
- package/coverage/lcov-report/src/math/index.html +0 -161
- package/coverage/lcov-report/src/math/index.ts.html +0 -166
- package/coverage/lcov-report/src/observers.ts.html +0 -368
- package/coverage/lcov-report/src/observersMap.ts.html +0 -400
- package/coverage/lcov-report/src/observingCache.ts.html +0 -565
- package/coverage/lcov-report/src/queue/index.html +0 -131
- package/coverage/lcov-report/src/queue/parallel.ts.html +0 -511
- package/coverage/lcov-report/src/queue/tasks.ts.html +0 -358
- package/coverage/lcov-report/src/tempoCache.ts.html +0 -139
- package/coverage/lcov-report/src/transitionObserver.ts.html +0 -634
- package/coverage/lcov-report/src/types/comparator.ts.html +0 -103
- package/coverage/lcov-report/src/types/getter.ts.html +0 -127
- package/coverage/lcov-report/src/types/index.html +0 -146
- package/coverage/lcov-report/src/types/index.ts.html +0 -112
- package/coverage/lcov-report/src/types.ts.html +0 -175
- package/coverage/lcov-report/src/validation/ValidationErrors.ts.html +0 -163
- package/coverage/lcov-report/src/validation/creditCard.ts.html +0 -160
- package/coverage/lcov-report/src/validation/helpers.ts.html +0 -226
- package/coverage/lcov-report/src/validation/index.html +0 -206
- package/coverage/lcov-report/src/validation/index.ts.html +0 -112
- package/coverage/lcov-report/src/validation/types.ts.html +0 -139
- package/coverage/lcov-report/src/validation/validators.ts.html +0 -250
- package/coverage/lcov-report/src/validation/wrappers.ts.html +0 -163
- package/coverage/lcov-report/src/viewModels/CommonModel.ts.html +0 -220
- package/coverage/lcov-report/src/viewModels/FlagModel.ts.html +0 -295
- package/coverage/lcov-report/src/viewModels/LoadingModel.ts.html +0 -241
- package/coverage/lcov-report/src/viewModels/MultiSelectModel.ts.html +0 -619
- package/coverage/lcov-report/src/viewModels/NumberModel.ts.html +0 -235
- package/coverage/lcov-report/src/viewModels/SelectModel.ts.html +0 -541
- package/coverage/lcov-report/src/viewModels/TextModel.ts.html +0 -466
- package/coverage/lcov-report/src/viewModels/Validatable.ts.html +0 -391
- package/coverage/lcov-report/src/viewModels/index.html +0 -236
- package/coverage/lcov-report/src/viewModels/wrappers.ts.html +0 -232
- package/coverage/lcov-report/structures/helpers/enum.ts.html +0 -454
- package/coverage/lcov-report/structures/helpers/index.html +0 -116
- package/coverage/lcov-report/structures/index.html +0 -116
- package/coverage/lcov-report/structures/promiseCache.ts.html +0 -628
- package/coverage/lcov-report/structures/queue/index.html +0 -131
- package/coverage/lcov-report/structures/queue/parallel.ts.html +0 -511
- package/coverage/lcov-report/structures/queue/tasks.ts.html +0 -358
- package/coverage/lcov-report/structures/subscribersMap.ts.html +0 -400
- package/coverage/lcov-report/structures/subscribersPromiseCache.ts.html +0 -562
- package/coverage/lcov-report/structures/tempoCache.ts.html +0 -139
- package/coverage/lcov-report/tasks.ts.html +0 -355
- package/coverage/lcov-report/tempoCache.ts.html +0 -134
- package/coverage/lcov-report/timer.ts.html +0 -200
- package/coverage/lcov-report/types/comparator.ts.html +0 -103
- package/coverage/lcov-report/types/getter.ts.html +0 -127
- package/coverage/lcov-report/types/index.html +0 -146
- package/coverage/lcov-report/types/index.ts.html +0 -136
- package/coverage/lcov-report/update.ts.html +0 -374
- package/coverage/lcov-report/validation/ValidationErrors.ts.html +0 -163
- package/coverage/lcov-report/validation/creditCard.ts.html +0 -160
- package/coverage/lcov-report/validation/helpers.ts.html +0 -226
- package/coverage/lcov-report/validation/index.html +0 -206
- package/coverage/lcov-report/validation/index.ts.html +0 -112
- package/coverage/lcov-report/validation/types.ts.html +0 -139
- package/coverage/lcov-report/validation/validators.ts.html +0 -250
- package/coverage/lcov-report/validation/wrappers.ts.html +0 -163
- package/coverage/lcov-report/viewModels/CommonModel.ts.html +0 -215
- package/coverage/lcov-report/viewModels/FlagModel.ts.html +0 -290
- package/coverage/lcov-report/viewModels/LoadingModel.ts.html +0 -244
- package/coverage/lcov-report/viewModels/MultiSelectModel.ts.html +0 -614
- package/coverage/lcov-report/viewModels/NumberModel.ts.html +0 -230
- package/coverage/lcov-report/viewModels/SelectModel.ts.html +0 -536
- package/coverage/lcov-report/viewModels/TextModel.ts.html +0 -461
- package/coverage/lcov-report/viewModels/Validatable.ts.html +0 -386
- package/coverage/lcov-report/viewModels/index.html +0 -116
- package/coverage/lcov.info +0 -2763
- package/global-test-setup.js +0 -3
- package/jest.config.js +0 -10
- package/src/.DS_Store +0 -0
- package/src/__tests__/helpers/expect.ts +0 -3
- package/src/__tests__/helpers/main.ts +0 -12
- package/src/abstractions/controllers/IPluggableController.ts +0 -7
- package/src/async/__tests__/timeout.test.ts +0 -74
- package/src/async/arrays.extend.ts +0 -17
- package/src/async/arrays.ts +0 -38
- package/src/async/misc.ts +0 -26
- package/src/async/timeout.ts +0 -84
- package/src/controllers/PluggableController.ts +0 -35
- package/src/dates/__tests__/dates.test.ts +0 -1314
- package/src/dates/calc.ts +0 -72
- package/src/dates/convert.ts +0 -191
- package/src/dates/datex.ts +0 -42
- package/src/dates/format.ts +0 -106
- package/src/dates/index.ts +0 -9
- package/src/dates/parse.ts +0 -24
- package/src/dates/period.ts +0 -23
- package/src/dates/shift.ts +0 -90
- package/src/dates/types.ts +0 -32
- package/src/dates/yearDate.ts +0 -36
- package/src/fields/__tests__/fields.update.test.ts +0 -73
- package/src/fields/filter.ts +0 -27
- package/src/fields/index.ts +0 -4
- package/src/fields/transfer.ts +0 -85
- package/src/fields/update.ts +0 -124
- package/src/functions/assert.ts +0 -19
- package/src/functions/disposer.ts +0 -97
- package/src/functions/safeCall.ts +0 -6
- package/src/functions/throttle.ts +0 -96
- package/src/lazy/__tests__/lazy.test.ts +0 -48
- package/src/lazy/light.ts +0 -29
- package/src/lazy/promise.ts +0 -52
- package/src/lazy/singleton.ts +0 -32
- package/src/logger/__tests__/logger.test.ts +0 -206
- package/src/logger/abstractions.ts +0 -13
- package/src/logger/batch.ts +0 -9
- package/src/logger/console.ts +0 -52
- package/src/logger/file.ts +0 -66
- package/src/logger/index.ts +0 -71
- package/src/logger/named.ts +0 -47
- package/src/logger/proxy.ts +0 -29
- package/src/math/__tests__/arrays.test.ts +0 -196
- package/src/math/__tests__/calc.test.ts +0 -67
- package/src/math/__tests__/distribution.test.ts +0 -25
- package/src/math/__tests__/index.test.ts +0 -20
- package/src/math/arrays.ts +0 -274
- package/src/math/calc.ts +0 -69
- package/src/math/distribution.ts +0 -20
- package/src/math/index.ts +0 -27
- package/src/models/EntityWithStatus.ts +0 -58
- package/src/models/File.ts +0 -14
- package/src/observing/event.ts +0 -91
- package/src/observing/progressTracker.ts +0 -90
- package/src/observing/throttledEvent.ts +0 -20
- package/src/observing/timer.ts +0 -40
- package/src/storage/abstractions.ts +0 -18
- package/src/storage/asyncWrapper.ts +0 -24
- package/src/storage/index.ts +0 -2
- package/src/storage/keyStorage.ts +0 -40
- package/src/structures/__tests__/enumHelper.test.ts +0 -85
- package/src/structures/__tests__/tempoCache.test.ts +0 -31
- package/src/structures/helpers/enum.ts +0 -123
- package/src/structures/helpers/name.ts +0 -58
- package/src/structures/linkedList.ts +0 -129
- package/src/structures/pool.ts +0 -47
- package/src/structures/queue/__tests__/parallel.test.ts +0 -58
- package/src/structures/queue/__tests__/tasks.test.ts +0 -87
- package/src/structures/queue/parallel.ts +0 -142
- package/src/structures/queue/tasks.ts +0 -91
- package/src/structures/tempoCache.ts +0 -18
- package/src/types/comparator.ts +0 -6
- package/src/types/deep.ts +0 -18
- package/src/types/functions.ts +0 -8
- package/src/types/getter.ts +0 -14
- package/src/types/ident.ts +0 -8
- package/src/types/index.ts +0 -17
- package/src/validation/ValidationErrors.ts +0 -26
- package/src/validation/__tests__/index.test.ts +0 -8
- package/src/validation/__tests__/validator.test.ts +0 -107
- package/src/validation/creditCard.ts +0 -25
- package/src/validation/emails.ts +0 -5
- package/src/validation/helpers.ts +0 -47
- package/src/validation/index.ts +0 -9
- package/src/validation/types.ts +0 -18
- package/src/validation/validators.ts +0 -55
- package/src/validation/wrappers.ts +0 -26
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -32
- package/yarn-error.log +0 -3709
- package/yarn.lock +0 -3446
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import * as DateHelpers from '../dates';
|
|
2
|
-
import * as MathHelpers from '../math';
|
|
3
|
-
import logger, { ILogger } from '../logger';
|
|
4
|
-
import { Event } from './event';
|
|
5
|
-
|
|
6
|
-
export class ProgressTracker {
|
|
7
|
-
|
|
8
|
-
private readonly _firstTimestamp = Date.now();
|
|
9
|
-
private _lastTimestamp: number = null;
|
|
10
|
-
private _lastCompleted: number = null;
|
|
11
|
-
|
|
12
|
-
private _completed = 0;
|
|
13
|
-
private _total = 0;
|
|
14
|
-
|
|
15
|
-
private _currentProgress: number = 0;
|
|
16
|
-
|
|
17
|
-
private readonly _deltas: number[] = [];
|
|
18
|
-
|
|
19
|
-
private readonly _changed = new Event<{ completed: number, total: number, currentProgress: number, totalElapsedMs: number, totalEstimatedMs: number }>();
|
|
20
|
-
|
|
21
|
-
constructor(readonly log: boolean | ILogger = true) { }
|
|
22
|
-
|
|
23
|
-
public get changed() { return this._changed.expose(); }
|
|
24
|
-
public get total() { return this._total; }
|
|
25
|
-
public get completed() { return this._completed; }
|
|
26
|
-
public get current() { return this._currentProgress; }
|
|
27
|
-
|
|
28
|
-
private get logger() {
|
|
29
|
-
return this.log === true
|
|
30
|
-
? logger
|
|
31
|
-
: (this.log || null);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public setTotal(total: number) {
|
|
35
|
-
this._total = total;
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public add(amount = 1, restart = false) {
|
|
40
|
-
this._completed = restart ? amount : (this._completed + amount);
|
|
41
|
-
this.track(this._completed, this._total);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
public track(completed: number, total: number) {
|
|
45
|
-
|
|
46
|
-
if (!this._lastTimestamp) {
|
|
47
|
-
this._lastTimestamp = this._firstTimestamp;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const elapsedDelta = Date.now() - this._lastTimestamp;
|
|
51
|
-
const completedDelta = completed - (this._lastCompleted || 0);
|
|
52
|
-
this._lastCompleted = completed;
|
|
53
|
-
this._completed = completed;
|
|
54
|
-
const timePerCompleted = completedDelta > 0 ? (elapsedDelta / completedDelta) : 0;
|
|
55
|
-
|
|
56
|
-
this._deltas.push(timePerCompleted);
|
|
57
|
-
if (this._deltas.length > 20) {
|
|
58
|
-
this._deltas.shift();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
this._currentProgress = Math.floor(completed / (total || 100) * 100);
|
|
62
|
-
const itemsLeft = total - completed;
|
|
63
|
-
const leftProgressTime = itemsLeft * (MathHelpers.arrayAverage(this._deltas, true) || 1000);
|
|
64
|
-
|
|
65
|
-
this._lastTimestamp = Date.now();
|
|
66
|
-
|
|
67
|
-
const totalElapsedMs = this._lastTimestamp - this._firstTimestamp;
|
|
68
|
-
|
|
69
|
-
if (this.log) {
|
|
70
|
-
const totalElapsed = msToString(totalElapsedMs);
|
|
71
|
-
const totalEstimated = msToString(leftProgressTime);
|
|
72
|
-
|
|
73
|
-
this.logger.log(`Progress: ${completed}/${total} ${totalElapsed}/${totalEstimated} => ${this._currentProgress}%`);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this._changed.trigger({
|
|
77
|
-
completed,
|
|
78
|
-
total,
|
|
79
|
-
currentProgress: this._currentProgress,
|
|
80
|
-
totalElapsedMs,
|
|
81
|
-
totalEstimatedMs: leftProgressTime,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function msToString(this: void, ms: number) {
|
|
87
|
-
const decs = DateHelpers.decomposeMs(ms, 'second', 'minute', 'hour');
|
|
88
|
-
const nf = (n: number) => n.toString().padStart(2, '0');
|
|
89
|
-
return `${nf(decs.hour)}:${nf(decs.minute)}:${nf(decs.second)}`;
|
|
90
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Event } from './event';
|
|
2
|
-
import { ThrottleAction } from '../functions/throttle';
|
|
3
|
-
|
|
4
|
-
export class ThrottledEvent extends Event {
|
|
5
|
-
|
|
6
|
-
private readonly _throttle = new ThrottleAction(100);
|
|
7
|
-
|
|
8
|
-
public setTimeout(timeout: number) {
|
|
9
|
-
this._throttle.timeout = timeout;
|
|
10
|
-
return this;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public trigger() {
|
|
14
|
-
this._throttle.tryRun(() => super.trigger());
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public async triggerAsync(): Promise<Error[]> {
|
|
18
|
-
throw new Error('ThrottledEvent does not support triggerAsync');
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/observing/timer.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '../functions/disposer';
|
|
2
|
-
import { Event, EventHandler, IEvent } from './event';
|
|
3
|
-
|
|
4
|
-
export class Timer implements IDisposable, IEvent<number> {
|
|
5
|
-
private readonly _event = new Event<number>();
|
|
6
|
-
|
|
7
|
-
private _now: number = Date.now();
|
|
8
|
-
private _handle = null;
|
|
9
|
-
|
|
10
|
-
constructor(readonly interval = 3600 * 1000) {
|
|
11
|
-
this.restart();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
get now() {
|
|
15
|
-
return this._now;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
on(handler: EventHandler<number>): () => void {
|
|
19
|
-
return this._event.on(handler);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
off(handler: EventHandler<number>): void {
|
|
23
|
-
return this._event.off(handler);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public restart() {
|
|
27
|
-
this.dispose();
|
|
28
|
-
|
|
29
|
-
// Update _now once an hour
|
|
30
|
-
this._handle = setInterval(() => {
|
|
31
|
-
this._now = Date.now();
|
|
32
|
-
this._event.trigger(this._now);
|
|
33
|
-
}, this.interval);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public dispose(): void {
|
|
37
|
-
clearInterval(this._handle);
|
|
38
|
-
this._handle = null;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface IStorage {
|
|
3
|
-
getValue(key: string): Promise<string>;
|
|
4
|
-
setValue(key: string, value: string): Promise<void>;
|
|
5
|
-
|
|
6
|
-
hasValue(key: string): Promise<boolean>;
|
|
7
|
-
remove(key: string): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IStorageSync {
|
|
11
|
-
getValue(key: string): string;
|
|
12
|
-
setValue(key: string, value: string): void;
|
|
13
|
-
|
|
14
|
-
removeValue(key: string): boolean;
|
|
15
|
-
hasValue(key: string): boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default IStorage;
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
package/src/storage/index.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { IStorageSync } from './abstractions';
|
|
2
|
-
|
|
3
|
-
export class KeyStorage {
|
|
4
|
-
constructor(readonly storage: IStorageSync, readonly key: string) { }
|
|
5
|
-
|
|
6
|
-
get value() { return this.storage.getValue(this.key); }
|
|
7
|
-
set value(v: string) { this.storage.setValue(this.key, v); }
|
|
8
|
-
|
|
9
|
-
public clean() {
|
|
10
|
-
this.storage.removeValue(this.key);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public getHasValue() {
|
|
14
|
-
return this.storage.hasValue(this.key);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class KeyStorageConverted<T> {
|
|
19
|
-
private readonly _storage: KeyStorage = null;
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
storage: IStorageSync,
|
|
23
|
-
key: string,
|
|
24
|
-
readonly input: (v: T) => string = (v => JSON.stringify(v)),
|
|
25
|
-
readonly output: (s: string) => T = (s => JSON.parse(s || null) as T),
|
|
26
|
-
) {
|
|
27
|
-
this._storage = new KeyStorage(storage, key);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get value(): T { return this.output(this._storage.value); }
|
|
31
|
-
set value(v: T) { this._storage.value = this.input(v); }
|
|
32
|
-
|
|
33
|
-
public clean() {
|
|
34
|
-
this._storage.clean();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public getHasValue() {
|
|
38
|
-
return this._storage.getHasValue();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import EnumHelper, { EnumBitwiseHelper, EnumStringHelper } from '../helpers/enum';
|
|
2
|
-
|
|
3
|
-
enum Enum {
|
|
4
|
-
Val1 = 1,
|
|
5
|
-
Val2 = 2,
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
describe('EnumHelper', () => {
|
|
9
|
-
const helper = new EnumHelper(Enum);
|
|
10
|
-
|
|
11
|
-
it('runs correctly', () => {
|
|
12
|
-
expect(helper.Keys).toEqual(['Val1', 'Val2']);
|
|
13
|
-
expect(helper.Values).toEqual([Enum.Val1, Enum.Val2]);
|
|
14
|
-
expect(helper.keyToString('Val1', { [Enum.Val1]: 'kek' })).toBe('kek');
|
|
15
|
-
expect(helper.keyToValue('Val1')).toBe(Enum.Val1);
|
|
16
|
-
expect(helper.valueToString(Enum.Val1, { [Enum.Val1]: 'kek' })).toBe('kek');
|
|
17
|
-
expect(helper.validateValue(1)).toBe(Enum.Val1);
|
|
18
|
-
expect(helper.validateValue(123)).toBeNull();
|
|
19
|
-
expect(helper.validateValue(null)).toBeNull();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
enum EnumString {
|
|
24
|
-
A = 'a',
|
|
25
|
-
B = 'b',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
describe('EnumStringHelper', () => {
|
|
29
|
-
const helper = new EnumStringHelper<EnumString>(EnumString);
|
|
30
|
-
|
|
31
|
-
it('runs correctly', () => {
|
|
32
|
-
expect(helper.Keys).toEqual(['A', 'B']);
|
|
33
|
-
expect(helper.Values).toEqual([EnumString.A, EnumString.B]);
|
|
34
|
-
expect(helper.keyToString('A')).toBe('A');
|
|
35
|
-
expect(helper.valueToString(EnumString.A)).toBe(EnumString.A);
|
|
36
|
-
|
|
37
|
-
expect(helper.validateValue('a')).toBe(EnumString.A);
|
|
38
|
-
expect(helper.validateValue('123')).toBeNull();
|
|
39
|
-
expect(helper.validateValue(null)).toBeNull();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
enum EnumBitwise {
|
|
44
|
-
One = 1 << 0,
|
|
45
|
-
Two = 1 << 1,
|
|
46
|
-
|
|
47
|
-
Three = One | Two,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
describe('EnumBitwiseHelper', () => {
|
|
51
|
-
const helper = new EnumBitwiseHelper<EnumBitwise>(EnumBitwise, {
|
|
52
|
-
[EnumBitwise.One]: 'one',
|
|
53
|
-
[EnumBitwise.Two]: 'two',
|
|
54
|
-
[EnumBitwise.Three]: 'three',
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('runs correctly', () => {
|
|
58
|
-
expect(helper.Keys).toEqual(['One', 'Two', 'Three']);
|
|
59
|
-
expect(helper.Values).toEqual([EnumBitwise.One, EnumBitwise.Two, EnumBitwise.Three]);
|
|
60
|
-
expect(helper.keyToString('One')).toBe('one');
|
|
61
|
-
expect(helper.valueToString(EnumBitwise.One)).toBe('one');
|
|
62
|
-
|
|
63
|
-
expect(helper.validateValue(EnumBitwise.One)).toBe(EnumBitwise.One);
|
|
64
|
-
expect(helper.validateValue(6)).toBeNull();
|
|
65
|
-
expect(helper.validateValue(null)).toBeNull();
|
|
66
|
-
|
|
67
|
-
expect(helper.toStrings(0)).toStrictEqual([undefined]);
|
|
68
|
-
expect(helper.toStrings(EnumBitwise.One)).toStrictEqual(['one']);
|
|
69
|
-
expect(helper.toStrings(EnumBitwise.Three)).toStrictEqual(['one', 'two', 'three']);
|
|
70
|
-
|
|
71
|
-
expect(helper.toString(EnumBitwise.Three)).toBe('one, two, three');
|
|
72
|
-
|
|
73
|
-
expect(helper.contains(EnumBitwise.Three, EnumBitwise.One)).toBe(true);
|
|
74
|
-
expect(helper.contains(EnumBitwise.Three, EnumBitwise.Two)).toBe(true);
|
|
75
|
-
expect(helper.contains(EnumBitwise.One, EnumBitwise.Two)).toBe(false);
|
|
76
|
-
expect(helper.contains(EnumBitwise.Two, EnumBitwise.One)).toBe(false);
|
|
77
|
-
expect(helper.contains(EnumBitwise.One, 0)).toBe(true);
|
|
78
|
-
|
|
79
|
-
expect(helper.combine(EnumBitwise.One, EnumBitwise.Two)).toBe(EnumBitwise.Three);
|
|
80
|
-
expect(helper.combine(EnumBitwise.One)).toBe(EnumBitwise.One);
|
|
81
|
-
expect(helper.combine(EnumBitwise.One, 0)).toBe(EnumBitwise.One);
|
|
82
|
-
|
|
83
|
-
expect(helper.remove(EnumBitwise.Three, EnumBitwise.Two)).toBe(EnumBitwise.One);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TempoCache } from '../tempoCache';
|
|
2
|
-
import { setTimeoutAsync } from '../../async/timeout';
|
|
3
|
-
|
|
4
|
-
describe('TempoCache', () => {
|
|
5
|
-
it('just works', async () => {
|
|
6
|
-
let incrementer = 1;
|
|
7
|
-
|
|
8
|
-
const example = new TempoCache(() => Promise.resolve(incrementer++), 199);
|
|
9
|
-
|
|
10
|
-
expect(await example.current).toBe(1);
|
|
11
|
-
await expect(example.current).resolves.toBe(1);
|
|
12
|
-
|
|
13
|
-
await setTimeoutAsync(100);
|
|
14
|
-
|
|
15
|
-
await expect(example.current).resolves.toBe(1);
|
|
16
|
-
|
|
17
|
-
await setTimeoutAsync(200);
|
|
18
|
-
|
|
19
|
-
await expect(example.current).resolves.toBe(2);
|
|
20
|
-
|
|
21
|
-
await setTimeoutAsync(100);
|
|
22
|
-
|
|
23
|
-
await expect(example.current).resolves.toBe(2);
|
|
24
|
-
await expect(example.current).resolves.toBe(2);
|
|
25
|
-
|
|
26
|
-
await setTimeoutAsync(300);
|
|
27
|
-
|
|
28
|
-
await expect(example.current).resolves.toBe(3);
|
|
29
|
-
await expect(example.current).resolves.toBe(3);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export class EnumStringHelper<T extends string> {
|
|
2
|
-
public readonly Keys: string[] = null;
|
|
3
|
-
public readonly Values: T[] = null;
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
6
|
-
protected readonly _obj: any,
|
|
7
|
-
private readonly _valuesToStrings: { [val: string]: string } = null,
|
|
8
|
-
) {
|
|
9
|
-
this.Keys = Object.keys(this._obj)
|
|
10
|
-
.filter(k => typeof this._obj[k as any] === 'string');
|
|
11
|
-
|
|
12
|
-
this.Values = this.Keys.map(k => this._obj[k]);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
keyToString(key: string): string {
|
|
16
|
-
return this._valuesToStrings
|
|
17
|
-
? this._valuesToStrings[this._obj[key]]
|
|
18
|
-
: key;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
valueToString(v: T): string {
|
|
22
|
-
const custom = this._valuesToStrings && this._valuesToStrings[v];
|
|
23
|
-
return custom || v;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
validateValue(v: string | null): T | null {
|
|
27
|
-
if (!v) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const i = this.Values.findIndex(vv => vv === v);
|
|
31
|
-
return i >= 0
|
|
32
|
-
? this.Values[i]
|
|
33
|
-
: null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type ValueToStringMap = { [val: number]: string };
|
|
38
|
-
|
|
39
|
-
export default class EnumHelper<T extends number> {
|
|
40
|
-
public readonly Keys: string[] = null;
|
|
41
|
-
public readonly Values: T[] = null;
|
|
42
|
-
|
|
43
|
-
constructor(
|
|
44
|
-
protected readonly _obj: any,
|
|
45
|
-
private readonly _valuesToStrings: ValueToStringMap = null,
|
|
46
|
-
) {
|
|
47
|
-
this.Keys = Object.keys(this._obj)
|
|
48
|
-
.filter(k => typeof this._obj[k as any] === 'number');
|
|
49
|
-
|
|
50
|
-
this.Values = this.Keys.map(k => this._obj[k]);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
keyToString(key: string, overrideMap: ValueToStringMap = null): string {
|
|
54
|
-
const map = overrideMap || this._valuesToStrings;
|
|
55
|
-
return map
|
|
56
|
-
? map[this._obj[key]]
|
|
57
|
-
: key;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
keyToValue(key: string): T {
|
|
61
|
-
const v = this._obj[key];
|
|
62
|
-
return v == null ? null : v as T;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
valueToString(v: T, overrideMap: ValueToStringMap = null): string {
|
|
66
|
-
const map = overrideMap || this._valuesToStrings;
|
|
67
|
-
const custom = map && map[v];
|
|
68
|
-
return custom || this._obj[v];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
validateValue(v: number | null): T | null {
|
|
72
|
-
if (v == null || Number.isNaN(v)) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
const i = this.Values.findIndex(vv => vv === v);
|
|
76
|
-
return i >= 0
|
|
77
|
-
? this.Values[i]
|
|
78
|
-
: null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export class EnumBitwiseHelper<T extends number> extends EnumHelper<T> {
|
|
83
|
-
toStrings(value: T, overrideMap: ValueToStringMap = null): string[] {
|
|
84
|
-
if (value == 0) {
|
|
85
|
-
return [this.valueToString(value, overrideMap)];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return this.Keys
|
|
89
|
-
.filter(k => this._obj[k] && this.contains(value, this._obj[k]))
|
|
90
|
-
.map(k => this.keyToString(k, overrideMap));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
toString(value: T, separator = ', ', overrideMap: ValueToStringMap = null): string {
|
|
94
|
-
const strs = this.toStrings(value, overrideMap);
|
|
95
|
-
return strs.length === 0
|
|
96
|
-
? this._obj[0]
|
|
97
|
-
: strs.join(separator);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
contains(base: T, target: T) {
|
|
101
|
-
return this.intersection(base, target) === target;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
combine(...values: T[]) {
|
|
105
|
-
let res = 0;
|
|
106
|
-
values.forEach(v => {
|
|
107
|
-
res = this.add(res as T, v);
|
|
108
|
-
});
|
|
109
|
-
return res;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
add(value: T, other: T) {
|
|
113
|
-
return value | other;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
intersection(v1: T, v2: T) {
|
|
117
|
-
return v1 & v2;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
remove(value: T, other: T) {
|
|
121
|
-
return value & ~other;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export type DisplayName = { displayName: string };
|
|
3
|
-
export type SplittedName = {
|
|
4
|
-
firstName: string,
|
|
5
|
-
lastName: string,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type FullName = DisplayName & SplittedName;
|
|
9
|
-
|
|
10
|
-
function splitDisplayName(name: Partial<DisplayName>): SplittedName {
|
|
11
|
-
if (!name || !name.displayName) {
|
|
12
|
-
return { firstName: '', lastName: '' };
|
|
13
|
-
}
|
|
14
|
-
const names = name.displayName.split(' ');
|
|
15
|
-
const first = names[0];
|
|
16
|
-
const last = names.slice(1).join(' ');
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
firstName: first,
|
|
20
|
-
lastName: last,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const NamesHelper = {
|
|
25
|
-
|
|
26
|
-
split(name: Partial<DisplayName>): SplittedName { return splitDisplayName(name); },
|
|
27
|
-
join(name: Partial<SplittedName>): DisplayName { return { displayName: `${name.firstName} ${name.lastName}` }; },
|
|
28
|
-
|
|
29
|
-
ensure(name: Partial<FullName>): FullName {
|
|
30
|
-
if (name.displayName && name.firstName && name.lastName) {
|
|
31
|
-
return name as FullName;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (name.displayName) {
|
|
35
|
-
return {
|
|
36
|
-
displayName: name.displayName,
|
|
37
|
-
...NamesHelper.split(name),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
...NamesHelper.join(name),
|
|
43
|
-
firstName: name.firstName,
|
|
44
|
-
lastName: name.lastName,
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
ensureFromUsers(user: Partial<FullName>, authUser: Partial<DisplayName>) {
|
|
49
|
-
const n = {
|
|
50
|
-
firstName: user ? user.firstName : '',
|
|
51
|
-
lastName: user ? user.lastName : '',
|
|
52
|
-
displayName: (user && user.displayName) || (authUser && authUser.displayName) || '',
|
|
53
|
-
};
|
|
54
|
-
return NamesHelper.ensure(n);
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default NamesHelper;
|
|
@@ -1,129 +0,0 @@
|
|
|
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
|
-
}
|